mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
1 line
3.9 MiB
1 line
3.9 MiB
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/ui/React/DialogBox.tsx","webpack:///./src/ui/React/Money.tsx","webpack:///./src/Augmentation/Augmentations.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/utils/StringHelperFunctions.ts","webpack:///./src/Server/AllServers.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/ui/Context.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/ui/Router.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Company/Companies.ts","webpack:///./src/SourceFile/SourceFileFlags.ts","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/PersonObjects/Sleeve/SleeveTaskTypesEnum.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Hacking.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/Terminal.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/Message/Message.ts","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/Alias.ts","webpack:///./src/NetscriptEvaluator.ts","webpack:///./src/Literature/Literature.ts","webpack:///./src/ui/React/CopyableText.tsx","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/Faction/FactionWorkTypeEnum.ts","webpack:///./src/utils/helpers/createProgressBarText.ts","webpack:///./src/Corporation/Material.ts","webpack:///./src/Faction/Faction.ts","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/Casino/Game.tsx","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/Crime/Crime.ts","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/Bladeburner/Bladeburner.tsx","webpack:///./src/Company/Company.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","webpack:///./src/Bladeburner/Skill.ts","webpack:///./src/ui/React/Hashes.tsx","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/SaveObject.tsx","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/Infiltration/utils.ts","webpack:///./src/RedPill.tsx","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/TextFile.ts","webpack:///./src/utils/helpers/exceptionAlert.ts","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Bladeburner/BlackOperations.tsx","webpack:///./src/Bladeburner/GeneralActions.tsx","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/ui/React/LogBoxManager.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/utils/helpers/arrayToString.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/utils/IPAddress.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/ui/React/Theme.tsx","webpack:///./src/Bladeburner/Action.tsx","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Terminal/ITerminal.ts","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/Prestige.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/Script/RunningScript.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/Script/Script.ts","webpack:///./src/Hacknet/HashManager.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/ui/InteractiveTutorial/ITutorialEvents.ts","webpack:///./src/Crime/CrimeHelpers.ts","webpack:///./src/Corporation/OfficeSpace.ts","webpack:///./src/Corporation/IndustryUpgrades.ts","webpack:///./src/ExportBonus.tsx","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/utils/helpers/getTimestamp.ts","webpack:///./src/ui/React/AlertManager.tsx","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/Corporation/Product.ts","webpack:///./src/db.tsx","webpack:///./src/Bladeburner/City.ts","webpack:///./src/Locations/City.ts","webpack:///./src/Faction/ui/Option.tsx","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./src/Corporation/data/CorporationUnlockUpgrades.ts","webpack:///./src/Corporation/data/CorporationUpgrades.ts","webpack:///./src/ui/React/WorldMap.tsx","webpack:///./src/Bladeburner/ui/SuccessChance.tsx","webpack:///./src/ui/React/StaticModal.tsx","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/utils/helpers/roundToTwo.ts","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Netscript/Pid.ts","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./src/Gang/Gang.ts","webpack:///./src/utils/helpers/getRandomByte.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/Server/BaseServer.ts","webpack:///./src/ui/React/CodingContractModal.tsx","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/BitNode/ui/BitFlumeModal.tsx","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/Faction/FactionInfo.tsx","webpack:///./src/Faction/ui/InvitationModal.tsx","webpack:///./src/ThirdParty/JSInterpreter.js","webpack:///./src/Server/formulas/grow.ts","webpack:///./src/ui/React/PromptManager.tsx","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/Programs/ProgramHelpers.ts","webpack:///./src/ui/React/AugmentationAccordion.tsx","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/Gang/GangMemberTask.ts","webpack:///./src/Infiltration/ui/BlinkingCursor.tsx","webpack:///./src/PersonObjects/Resleeving/Resleeving.ts","webpack:///./src/PersonObjects/Sleeve/SleeveHelpers.ts","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Locations/ui/TravelAgencyRoot.tsx","webpack:///./src/ScriptEditor/ui/ScriptEditorRoot.tsx","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/Bladeburner/Contract.ts","webpack:///./src/Bladeburner/data/Help.ts","webpack:///./src/Corporation/ResearchTree.ts","webpack:///./src/StockMarket/StockMarketConstants.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/engine.tsx","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Locations/ui/GenericLocation.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/ScriptEditor/CursorPositions.ts","webpack:///./src/ScriptEditor/NetscriptDefinitions.ts","webpack:///./src/Milestones/Milestones.ts","webpack:///./src/Faction/formulas/donation.ts","webpack:///./src/StockMarket/data/TickerHeaderFormatData.ts","webpack:///./src/Terminal/Parser.ts","webpack:///./src/Terminal/HelpText.ts","webpack:///./src/Terminal/Terminal.ts","webpack:///./src/data/codingcontracttypes.ts","webpack:///./src/utils/helpers/createRandomString.ts","webpack:///./src/Programs/Program.ts","webpack:///./src/Programs/data/ProgramsMetadata.ts","webpack:///./src/Server/data/servers.ts","webpack:///./src/utils/helpers/isValidIPAddress.ts","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.ts","webpack:///./src/PersonObjects/Player/PlayerObject.ts","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./src/utils/helpers/clearObject.ts","webpack:///./src/Company/data/CompaniesMetadata.ts","webpack:///./src/Corporation/Research.ts","webpack:///./src/Corporation/data/ResearchMetadata.ts","webpack:///./src/Hacknet/HashUpgrade.ts","webpack:///./src/Hacknet/data/HashUpgradesMetadata.tsx","webpack:///./src/Netscript/Environment.ts","webpack:///./src/Company/data/CompanyPositionsMetadata.ts","webpack:///./src/Corporation/Industry.ts","webpack:///./src/utils/calculateEffectWithFactors.ts","webpack:///./src/Corporation/Employee.ts","webpack:///./src/Corporation/ProductRatingWeights.ts","webpack:///./src/utils/helpers/isPowerOfTwo.ts","webpack:///./src/StockMarket/data/InitStockMetadata.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx","webpack:///./src/ui/React/Overview.tsx","webpack:///./src/Sidebar/ui/SidebarRoot.tsx","webpack:///./src/Augmentation/ui/AugmentationsRoot.tsx","webpack:///./src/Augmentation/ui/InstalledAugmentations.tsx","webpack:///./src/Augmentation/ui/PlayerMultipliers.tsx","webpack:///./src/Augmentation/ui/PurchasedAugmentations.tsx","webpack:///./src/Augmentation/ui/SourceFiles.tsx","webpack:///./src/Augmentation/ui/SourceFileMinus1.tsx","webpack:///./src/Augmentation/ui/OwnedSourceFiles.tsx","webpack:///./src/ui/React/SourceFileAccordion.tsx","webpack:///./src/DevMenu.tsx","webpack:///./src/DevMenu/ui/General.tsx","webpack:///./src/DevMenu/ui/Stats.tsx","webpack:///./src/DevMenu/ui/Factions.tsx","webpack:///./src/DevMenu/ui/Augmentations.tsx","webpack:///./src/DevMenu/ui/SourceFiles.tsx","webpack:///./src/DevMenu/ui/Programs.tsx","webpack:///./src/DevMenu/ui/Servers.tsx","webpack:///./src/DevMenu/ui/Companies.tsx","webpack:///./src/DevMenu/ui/Bladeburner.tsx","webpack:///./src/DevMenu/ui/Gang.tsx","webpack:///./src/DevMenu/ui/Corporation.tsx","webpack:///./src/DevMenu/ui/CodingContracts.tsx","webpack:///./src/DevMenu/ui/StockMarket.tsx","webpack:///./src/DevMenu/ui/Sleeves.tsx","webpack:///./src/DevMenu/ui/TimeSkip.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/GangMemberAccordion.tsx","webpack:///./src/Gang/ui/GangMemberAccordionContent.tsx","webpack:///./src/Gang/ui/GangMemberStats.tsx","webpack:///./src/Gang/ui/AscensionModal.tsx","webpack:///./src/Gang/ui/TaskSelector.tsx","webpack:///./src/Gang/ui/TaskDescription.tsx","webpack:///./src/Gang/data/tasks.ts","webpack:///./src/Gang/ui/RecruitButton.tsx","webpack:///./src/Gang/ui/RecruitModal.tsx","webpack:///./src/Gang/ui/TerritorySubpage.tsx","webpack:///./src/Gang/ui/EquipmentsSubpage.tsx","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Corporation/ui/CorporationRoot.tsx","webpack:///./src/Corporation/ui/MainPanel.tsx","webpack:///./src/Corporation/ui/CityTabs.tsx","webpack:///./src/Corporation/ui/Industry.tsx","webpack:///./src/Corporation/ui/IndustryOffice.tsx","webpack:///./src/Corporation/ui/UpgradeOfficeSizeModal.tsx","webpack:///./src/Corporation/ui/ThrowPartyModal.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/MakeProductModal.tsx","webpack:///./src/Corporation/ui/ResearchModal.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/SmartSupplyModal.tsx","webpack:///./src/Corporation/ui/ProductElem.tsx","webpack:///./src/Corporation/ui/DiscontinueProductModal.tsx","webpack:///./src/Corporation/ui/LimitProductProductionModal.tsx","webpack:///./src/Corporation/ui/SellProductModal.tsx","webpack:///./src/Corporation/ui/ProductMarketTaModal.tsx","webpack:///./src/Corporation/ui/MaterialElem.tsx","webpack:///./src/Corporation/ui/ExportModal.tsx","webpack:///./src/Corporation/ui/MaterialMarketTaModal.tsx","webpack:///./src/Corporation/ui/SellMaterialModal.tsx","webpack:///./src/Corporation/ui/PurchaseMaterialModal.tsx","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Corporation/ui/IndustryProductEquation.tsx","webpack:///./src/Corporation/ui/ExpandNewCity.tsx","webpack:///./src/Corporation/ui/ExpandIndustryTab.tsx","webpack:///./src/Corporation/ui/Overview.tsx","webpack:///./src/Corporation/ui/LevelableUpgrade.tsx","webpack:///./src/Corporation/ui/UnlockUpgrade.tsx","webpack:///./src/Corporation/ui/BribeFactionModal.tsx","webpack:///./src/Corporation/ui/SellSharesModal.tsx","webpack:///./src/Corporation/ui/BuybackSharesModal.tsx","webpack:///./src/Corporation/ui/IssueDividendsModal.tsx","webpack:///./src/Corporation/ui/IssueNewSharesModal.tsx","webpack:///./src/Corporation/ui/FindInvestorsModal.tsx","webpack:///./src/Corporation/ui/GoPublicModal.tsx","webpack:///./src/Infiltration/ui/InfiltrationRoot.tsx","webpack:///./src/Infiltration/ui/Intro.tsx","webpack:///./src/Infiltration/ui/Game.tsx","webpack:///./src/Infiltration/ui/Countdown.tsx","webpack:///./src/Infiltration/ui/BracketGame.tsx","webpack:///./src/Infiltration/ui/SlashGame.tsx","webpack:///./src/Infiltration/ui/BackwardGame.tsx","webpack:///./src/Infiltration/ui/BribeGame.tsx","webpack:///./src/Infiltration/ui/CheatCodeGame.tsx","webpack:///./src/Infiltration/ui/Cyberpunk2077Game.tsx","webpack:///./src/Infiltration/ui/MinesweeperGame.tsx","webpack:///./src/Infiltration/ui/WireCuttingGame.tsx","webpack:///./src/Infiltration/ui/Victory.tsx","webpack:///./src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx","webpack:///./src/PersonObjects/Resleeving/Resleeve.ts","webpack:///./src/PersonObjects/Resleeving/ui/ResleeveElem.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/ui/React/GameOptionsRoot.tsx","webpack:///./src/Diagnostic/FileDiagnosticModal.tsx","webpack:///./src/ui/React/ConfirmationModal.tsx","webpack:///./src/ui/React/ThemeEditorModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveAugmentationsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreEarningsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/PersonObjects/Sleeve/ui/FAQModal.tsx","webpack:///./src/Hacknet/ui/HacknetRoot.tsx","webpack:///./src/Hacknet/ui/GeneralInfo.tsx","webpack:///./src/Hacknet/ui/HacknetNodeElem.tsx","webpack:///./src/Hacknet/ui/HacknetServerElem.tsx","webpack:///./src/Hacknet/ui/HashUpgradeModal.tsx","webpack:///./src/Hacknet/ui/HacknetUpgradeElem.tsx","webpack:///./src/Hacknet/ui/MultiplierButtons.tsx","webpack:///./src/Hacknet/ui/PlayerInfo.tsx","webpack:///./src/Hacknet/ui/PurchaseButton.tsx","webpack:///./src/Locations/ui/CompanyLocation.tsx","webpack:///./src/Company/ui/QuitJobModal.tsx","webpack:///./src/Locations/ui/GymLocation.tsx","webpack:///./src/Locations/ui/HospitalLocation.tsx","webpack:///./src/Locations/ui/SlumsLocation.tsx","webpack:///./src/Locations/ui/SpecialLocation.tsx","webpack:///./src/Corporation/ui/CreateCorporationModal.tsx","webpack:///./src/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/Blackjack.tsx","webpack:///./src/Casino/CardDeck/Deck.ts","webpack:///./src/Casino/CoinFlip.tsx","webpack:///./src/Casino/Roulette.tsx","webpack:///./src/Casino/SlotMachine.tsx","webpack:///./src/ui/React/CorruptableText.tsx","webpack:///./src/Locations/ui/City.tsx","webpack:///./src/Programs/ui/ProgramsRoot.tsx","webpack:///./src/ScriptEditor/ui/OptionsModal.tsx","webpack:///./src/Milestones/ui/MilestonesRoot.tsx","webpack:///./src/Terminal/ui/TerminalRoot.tsx","webpack:///./src/Terminal/ui/TerminalInput.tsx","webpack:///./src/Terminal/determineAllPossibilitiesForTabCompletion.ts","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/Terminal/tabCompletion.ts","webpack:///./src/Tutorial/ui/TutorialRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsRoot.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/Faction/ui/FactionsRoot.tsx","webpack:///./src/Faction/ui/FactionRoot.tsx","webpack:///./src/Faction/ui/AugmentationsPage.tsx","webpack:///./src/Faction/ui/PurchaseableAugmentation.tsx","webpack:///./src/Faction/ui/PurchaseAugmentationModal.tsx","webpack:///./src/ui/React/Augmentation.tsx","webpack:///./src/Faction/ui/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/Faction/ui/CreateGangModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/ui/CharacterStats.tsx","webpack:///./src/StockMarket/ui/StockMarketRoot.tsx","webpack:///./src/StockMarket/ui/InfoAndPurchases.tsx","webpack:///./src/StockMarket/ui/StockTickers.tsx","webpack:///./src/StockMarket/ui/StockTicker.tsx","webpack:///./src/StockMarket/ui/StockTickerHeaderText.tsx","webpack:///./src/StockMarket/ui/StockTickerOrderList.tsx","webpack:///./src/StockMarket/ui/StockTickerOrder.tsx","webpack:///./src/StockMarket/ui/StockTickerPositionText.tsx","webpack:///./src/StockMarket/ui/PlaceOrderModal.tsx","webpack:///./src/BitNode/ui/BitverseRoot.tsx","webpack:///./src/BitNode/ui/PortalModal.tsx","webpack:///./src/ui/React/CinematicLine.tsx","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/Bladeburner/ui/BladeburnerCinematic.tsx","webpack:///./src/Exploits/Unclickable.tsx","webpack:///./src/utils/helpers/is2DArray.ts","webpack:///./src/NetscriptFunctions/Gang.ts","webpack:///./src/Gang/GangMember.ts","webpack:///./src/NetscriptFunctions/Sleeve.ts","webpack:///./src/NetscriptFunctions/Extra.ts","webpack:///./src/NetscriptFunctions/Hacknet.ts","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/Script/ScriptUrl.ts","webpack:///./src/NetscriptPort.ts","webpack:///./src/SourceFile/applySourceFile.ts","webpack:///./src/Exploits/applyExploits.ts","webpack:///./src/Terminal/commands/alias.ts","webpack:///./src/Terminal/commands/analyze.ts","webpack:///./src/Terminal/commands/backdoor.ts","webpack:///./src/Terminal/commands/buy.ts","webpack:///./src/Terminal/commands/cat.ts","webpack:///./src/Terminal/commands/cd.ts","webpack:///./src/Terminal/commands/check.ts","webpack:///./src/Terminal/commands/connect.ts","webpack:///./src/Terminal/commands/download.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/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/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/weaken.ts","webpack:///./src/Terminal/commands/wget.ts","webpack:///./src/Exploits/loops.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","1","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","Decimal","corporation","Corporation","funds","revenue","expenses","divisions","ind","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","exploits","sanitizeExploits","extraFormats","extraNotations","numeralWrapper","constructor","this","defaultLocale","updateLocale","numeral","locale","console","warn","format","Math","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","Infinity","repeat","str","formatHp","formatMoney","formatSkill","formatExp","formatHashes","formatReputation","formatFavor","formatRAM","formatPercentage","formatter","formatServerSecurity","formatRespect","formatWanted","formatMultiplier","formatSleeveShock","formatSleeveSynchro","formatSleeveMemory","formatPopulation","formatStamina","formatShares","formatInfiltrationSecurity","formatThreads","parseMoney","numeralValue","parsed","parseFloat","isNaN","NaN","max","AugmentationNames","Targeting1","Targeting2","Targeting3","SyntheticHeart","SynfibrilMuscle","CombatRib1","CombatRib2","CombatRib3","NanofiberWeave","SubdermalArmor","WiredReflexes","GrapheneBoneLacings","BionicSpine","GrapheneBionicSpine","BionicLegs","GrapheneBionicLegs","SpeechProcessor","TITN41Injection","EnhancedSocialInteractionImplant","BitWire","ArtificialBioNeuralNetwork","ArtificialSynapticPotentiation","EnhancedMyelinSheathing","SynapticEnhancement","NeuralRetentionEnhancement","DataJack","ENM","ENMCore","ENMCoreV2","ENMCoreV3","ENMAnalyzeEngine","ENMDMA","Neuralstimulator","NeuralAccelerator","CranialSignalProcessorsG1","CranialSignalProcessorsG2","CranialSignalProcessorsG3","CranialSignalProcessorsG4","CranialSignalProcessorsG5","NeuronalDensification","NeuroreceptorManager","NuoptimalInjectorImplant","SpeechEnhancement","FocusWire","PCDNI","PCDNIOptimizer","PCDNINeuralNetwork","PCMatrix","ADRPheromone1","ADRPheromone2","ShadowsSimulacrum","HacknetNodeCPUUpload","HacknetNodeCacheUpload","HacknetNodeNICUpload","HacknetNodeKernelDNI","HacknetNodeCoreDNI","NeuroFluxGovernor","Neurotrainer1","Neurotrainer2","Neurotrainer3","Hypersight","LuminCloaking1","LuminCloaking2","HemoRecirculator","SmartSonar","PowerRecirculator","QLink","TheRedPill","SPTN97","HiveMind","CordiARCReactor","SmartJaw","Neotra","Xanipher","nextSENS","OmniTekInfoLoad","PhotosyntheticCells","Neurolink","TheBlackHand","UnstableCircadianModulator","CRTX42AA","Neuregen","CashRoot","NutriGen","INFRARet","DermaForce","GrapheneBrachiBlades","GrapheneBionicArms","BrachiBlades","BionicArms","SNA","HydroflameLeftArm","EsperEyewear","EMS4Recombination","OrionShoulder","HyperionV1","HyperionV2","GolemSerum","VangelisVirus","VangelisVirus3","INTERLINKED","BladeRunner","BladeArmor","BladeArmorPowerCells","BladeArmorEnergyShielding","BladeArmorUnibeam","BladeArmorOmnibeam","BladeArmorIPU","BladesSimulacrum","CONSTANTS","Version","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","NumNetscriptPorts","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerFortifyAmount","ServerWeakenAmount","PurchasedServerLimit","PurchasedServerMaxRam","MultipleAugMultiplier","TorRouterCost","InfiltrationBribeBaseAmount","InfiltrationMoneyValue","InfiltrationRepValue","InfiltrationExpPow","WSEAccountCost","TIXAPICost","MarketData4SCost","MarketDataTixApi4SCost","StockMarketCommission","HospitalCostPerHp","IntelligenceCrimeWeight","IntelligenceInfiltrationWeight","IntelligenceCrimeBaseExpGain","IntelligenceProgramBaseExpGain","IntelligenceTerminalHackBaseExpGain","IntelligenceSingFnBaseExpGain","IntelligenceClassBaseExpGain","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","BaseFocusBonus","FactionWorkHacking","FactionWorkField","FactionWorkSecurity","WorkTypeCompany","WorkTypeCompanyPartTime","WorkTypeFaction","WorkTypeCreateProgram","WorkTypeStudyClass","WorkTypeCrime","ClassStudyComputerScience","ClassDataStructures","ClassNetworks","ClassAlgorithms","ClassManagement","ClassLeadership","ClassGymStrength","ClassGymDefense","ClassGymDexterity","ClassGymAgility","ClassDataStructuresBaseCost","ClassNetworksBaseCost","ClassAlgorithmsBaseCost","ClassManagementBaseCost","ClassLeadershipBaseCost","ClassGymBaseCost","ClassStudyComputerScienceBaseExp","ClassDataStructuresBaseExp","ClassNetworksBaseExp","ClassAlgorithmsBaseExp","ClassManagementBaseExp","ClassLeadershipBaseExp","CrimeShoplift","CrimeRobStore","CrimeMug","CrimeLarceny","CrimeDrugs","CrimeBondForgery","CrimeTraffickArms","CrimeHomicide","CrimeGrandTheftAuto","CrimeKidnap","CrimeAssassination","CrimeHeist","CodingContractBaseFactionRepGain","CodingContractBaseCompanyRepGain","CodingContractBaseMoneyGain","TotalNumBitNodes","LatestUpdate","BitNodeMultipliers","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","ServerGrowthRate","ServerMaxMoney","ServerStartingMoney","ServerStartingSecurity","ServerWeakenRate","HomeComputerRamCost","PurchasedServerCost","CompanyWorkMoney","CrimeMoney","HacknetNodeMoney","ManualHackMoney","ScriptHackMoney","ScriptHackMoneyGain","CodingContractMoney","ClassGymExpGain","CompanyWorkExpGain","CrimeExpGain","FactionWorkExpGain","HackExpGain","FactionPassiveRepGain","FactionWorkRepGain","RepToDonateToFaction","AugmentationMoneyCost","AugmentationRepCost","InfiltrationMoney","InfiltrationRep","FourSigmaMarketDataCost","FourSigmaMarketDataApiCost","CorporationValuation","BladeburnerRank","BladeburnerSkillCost","DaedalusAugsRequirement","GangKarmaRequirement","LocationName","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","EnableBashHotkeys","EnableTimestamps","Locale","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressHospitalizationPopup","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","theme","primarylight","primary","primarydark","errorlight","error","errordark","secondarylight","secondary","secondarydark","warninglight","warning","warningdark","infolight","info","infodark","welllight","well","white","black","hp","hack","combat","cha","int","rep","disabled","Settings","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","init","assign","load","RamCostConstants","ScriptBaseRamCost","ScriptDomRamCost","ScriptHackRamCost","ScriptHackAnalyzeRamCost","ScriptGrowRamCost","ScriptGrowthAnalyzeRamCost","ScriptWeakenRamCost","ScriptScanRamCost","ScriptPortProgramRamCost","ScriptRunRamCost","ScriptExecRamCost","ScriptSpawnRamCost","ScriptScpRamCost","ScriptKillRamCost","ScriptHasRootAccessRamCost","ScriptGetHostnameRamCost","ScriptGetHackingLevelRamCost","ScriptGetMultipliersRamCost","ScriptGetServerRamCost","ScriptGetServerMaxRam","ScriptGetServerUsedRam","ScriptFileExistsRamCost","ScriptIsRunningRamCost","ScriptHacknetNodesRamCost","ScriptHNUpgLevelRamCost","ScriptHNUpgRamRamCost","ScriptHNUpgCoreRamCost","ScriptGetStockRamCost","ScriptBuySellStockRamCost","ScriptGetPurchaseServerRamCost","ScriptPurchaseServerRamCost","ScriptGetPurchasedServerLimit","ScriptGetPurchasedServerMaxRam","ScriptRoundRamCost","ScriptReadWriteRamCost","ScriptArbScriptRamCost","ScriptGetScriptRamCost","ScriptGetRunningScriptRamCost","ScriptGetHackTimeRamCost","ScriptGetFavorToDonate","ScriptCodingContractBaseRamCost","ScriptSleeveBaseRamCost","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","RamCosts","hacknet","numNodes","purchaseNode","getPurchaseNodeCost","getNodeStats","upgradeLevel","upgradeRam","upgradeCore","upgradeCache","getLevelUpgradeCost","getRamUpgradeCost","getCoreUpgradeCost","getCacheUpgradeCost","numHashes","hashCost","spendHashes","sprintf","vsprintf","scan","hackAnalyzeThreads","hackAnalyzePercent","hackChance","sleep","grow","growthAnalyze","weaken","print","tprint","clearLog","disableLog","enableLog","isLogEnabled","getScriptLogs","nuke","brutessh","ftpcrack","relaysmtp","httpworm","sqlinject","run","exec","spawn","kill","killall","exit","scp","ls","ps","hasRootAccess","getIp","getHostname","getHackingLevel","getHackingMultipliers","getHacknetMultipliers","getBitNodeMultipliers","getServer","getServerMoneyAvailable","getServerSecurityLevel","getServerBaseSecurityLevel","getServerMinSecurityLevel","getServerRequiredHackingLevel","getServerMaxMoney","getServerGrowth","getServerNumPortsRequired","getServerRam","getServerMaxRam","getServerUsedRam","serverExists","fileExists","isRunning","getStockSymbols","getStockPrice","getStockAskPrice","getStockBidPrice","getStockPosition","getStockMaxShares","getStockPurchaseCost","getStockSaleGain","buyStock","sellStock","shortStock","sellShort","placeOrder","cancelOrder","getOrders","getStockVolatility","getStockForecast","purchase4SMarketData","purchase4SMarketDataTixApi","getPurchasedServerLimit","getPurchasedServerMaxRam","getPurchasedServerCost","purchaseServer","deleteServer","getPurchasedServers","write","tryWrite","read","peek","clear","getPortHandle","rm","scriptRunning","scriptKill","getScriptName","getScriptRam","getHackTime","getGrowTime","getWeakenTime","getScriptIncome","getScriptExpGain","getRunningScript","nFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","universityCourse","gymWorkout","travelToCity","purchaseTor","purchaseProgram","getCurrentServer","connect","manualHack","installBackdoor","getStats","getCharacterInformation","getPlayer","hospitalize","isBusy","stopAction","upgradeHomeRam","getUpgradeHomeRamCost","workForCompany","applyToCompany","getCompanyRep","getCompanyFavor","getCompanyFavorGain","checkFactionInvitations","joinFaction","workForFaction","getFactionRep","getFactionFavor","getFactionFavorGain","donateToFaction","createProgram","commitCrime","getCrimeChance","getCrimeStats","getOwnedAugmentations","getOwnedSourceFiles","getAugmentationsFromFaction","getAugmentationCost","getAugmentationPrereq","getAugmentationPrice","getAugmentationRepReq","getAugmentationStats","purchaseAugmentation","softReset","installAugmentations","gang","createGang","inGang","getMemberNames","getGangInformation","getOtherGangInformation","getMemberInformation","canRecruitMember","recruitMember","getTaskNames","getTaskStats","setMemberTask","getEquipmentNames","getEquipmentCost","getEquipmentType","getEquipmentStats","purchaseEquipment","ascendMember","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","getCityEstimatedCommunities","getCityChaos","getCity","switchCity","getStamina","joinBladeburnerFaction","joinBladeburnerDivision","codingcontract","attempt","getContractType","getData","getDescription","getNumTriesRemaining","sleeve","getNumSleeves","setToShockRecovery","setToSynchronize","setToCommitCrime","setToUniversityCourse","travel","setToCompanyWork","setToFactionWork","setToGymWorkout","getSleeveStats","getTask","getInformation","getSleeveAugmentations","getSleevePurchasableAugs","purchaseSleeveAug","heart","break","getRamCost","args","curr","currType","dialogBoxCreate","txt","AlertEvents","emit","dangerouslySetInnerHTML","__html","useStyles","makeStyles","createStyles","unbuyable","color","palette","action","colors","Money","props","classes","undefined","player","Error","canAfford","className","Augmentations","log","ctor","constructors","fromJSON","Generic_toJSON","ctorName","obj","keys","index","Generic_fromJSON","CityName","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","AllServers","GetServer","server","isValidIPAddress","hostname","GetServerByHostname","ipserver","ip","GetServerByIP","GetAllServers","servers","DeleteServer","serverkey","ipExists","createUniqueRandomIp","createRandomIp","AddToAllServers","initForeignServers","homeComputer","networkLayers","propertiesToPatternMatch","toNumber","getRandomInt","min","metadata","serverMetadata","serverParams","numOpenPortsRequired","organizationName","maxRamExponent","maxRam","pow","prop","Server","filename","literature","messages","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","prestigeAllServers","member","loadAllServers","saveAllServers","TempAllServers","stringify","runningScripts","runningScriptObj","logs","Factions","loadFactions","faction","getInfo","err","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","AddToFactions","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","Context","React","createContext","Router","use","useContext","lower","upper","Page","Augmentation","params","moneyCost","repCost","prereqs","baseRepRequirement","baseCost","startingCost","isSpecial","level","hacking_mult","mults","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","stats","programs","startingMoney","f","x","decimals","desc","join","generateStatsDescription","addToFactions","factionList","augmentations","addToAllFactions","fac","facObj","toJSON","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","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Training","Recruitment","FieldAnalysis","Diplomacy","iTutorialSteps","ITutorial","currStep","Start","stepIsDone","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalGoHome","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End","iTutorialStart","iTutorialNextStep","iTutorialEnd","ITutorialEvents","iTutorialPrevStep","getHomeComputer","LiteratureNames","HackersStartingHandbook","modal","display","alignItems","justifyContent","paper","backgroundColor","background","default","border","main","boxShadow","dark","padding","maxWidth","maxHeight","overflow","scrollbarWidth","Modal","disableRestoreFocus","disableScrollLock","disableEnforceFocus","disableAutoFocus","open","onClose","closeAfterTransition","in","sx","children","AllCorporationStates","CorporationConstants","INITIALSHARES","SHARESPERPRICEUPDATE","IssueNewSharesCooldown","SellSharesCooldown","CyclesPerMarketCycle","CyclesPerIndustryStateCycle","SecsPerMarketCycle","Cities","WarehouseInitialCost","WarehouseInitialSize","WarehouseUpgradeBaseCost","OfficeInitialCost","OfficeInitialSize","OfficeUpgradeBaseCost","BribeThreshold","BribeToRepRatio","ProductProductionCostRatio","DividendMaxPercentage","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","root","borderBottom","small","width","TableCell","Table","Division","useCorporation","useDivision","t_homeComp","safetlyCreateUniqueServer","adminRights","isConnectedTo","purchasedByPlayer","currentServer","SpecialServers","Home","Programs","NukeProgram","prestigeAugmentation","numPeopleKilled","karma","hacking_skill","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","city","Sector12","location","TravelAgency","companyName","jobs","purchasedServers","factions","factionInvitations","queuedAugmentations","resleeves","numSleeves","SourceFileFlags","bitNodeN","sleevesFromCovenant","sleeves","Sleeve","shock","synchronize","shockRecovery","isWorking","currentWorkFactionName","currentWorkFactionDescription","createProgramName","crimeType","workHackExpGainRate","workStrExpGainRate","workDefExpGainRate","workDexExpGainRate","workAgiExpGainRate","workChaExpGainRate","workRepGainRate","workMoneyGainRate","workHackExpGained","workStrExpGained","workDefExpGained","workDexExpGained","workAgiExpGained","workChaExpGained","workRepGained","workMoneyGained","timeWorked","lastUpdate","Date","getTime","playtimeSinceLastAug","scriptProdSinceLastAug","moneySourceA","reset","hacknetNodes","hashManager","prestige","reapplyAllAugmentations","max_hp","prestigeSourceFile","sync","resetGangs","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","moneySourceB","playtimeSinceLastBitnode","receiveInvite","includes","calculateSkill","exp","mult","calculateSkillF","updateSkillLevels","intelligence","intelligence_exp","ratio","round","resetMultipliers","hasProgram","programName","home","toLowerCase","setMoney","gainMoney","plus","loseMoney","eq","minus","cost","gte","recordMoneySource","amt","source","MoneySourceTracker","record","gainHackingExp","gainStrengthExp","gainDefenseExp","gainDexterityExp","gainAgilityExp","gainCharismaExp","gainIntelligenceExp","queryStatFromString","tempStr","resetWorkStatus","generalType","group","workType","factionWorkType","singularityStopWork","workMoneyLossRate","timeWorkedCreateProgram","processWorkEarnings","numCycles","focusBonus","hasAugmentation","focus","hackExpGain","strExpGain","defExpGain","dexExpGain","agiExpGain","chaExpGain","moneyGain","startWork","router","getWorkHackExpGain","getWorkStrExpGain","getWorkDefExpGain","getWorkDexExpGain","getWorkAgiExpGain","getWorkChaExpGain","getWorkRepGain","getWorkMoneyGain","timeNeededToCompleteWork","toWork","cancelationPenalty","backdoorInstalled","work","overMax","comp","Companies","influenceStockThroughCompanyWork","finishWork","cancelled","sing","playerReputation","content","reputation","startWorkPartTime","workPartTime","finishWorkPartTime","startFocusing","stopFocusing","startFactionWork","favorMult","startFactionHackWork","getIntelligenceBonus","startFactionFieldWork","getFactionFieldWorkRepGain","startFactionSecurityWork","getFactionSecurityWorkRepGain","getHackingWorkRepGain","finishFactionWork","bn11Mult","company","companyPositionName","companyPosition","CompanyPositions","baseSalary","salaryMultiplier","hackingExpGain","expMultiplier","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","charismaExpGain","jobPerformance","calculateJobPerformance","startCreateProgramWork","reqLevel","createProgramReqLvl","programFile","startsWith","endsWith","split","percComplete","Number","createProgramWork","reqLvl","skillMult","finishCreateProgramWork","incompleteName","toString","startClass","costMult","expMult","gameCPS","hackExp","strExp","defExp","dexExp","agiExp","chaExp","getStudyMult","getTrainingMult","takeClass","finishClass","startCrime","workerscript","committingCrimeThruSingFn","singFnCrimeWorkerScript","finishCrime","determineCrimeSuccess","crime","Crimes","type","kills","ws","disableLogs","ALL","scriptRef","takeDamage","regenerateHp","getHospitalizationCost","applyForJob","entryPosType","currCompany","currPositionName","Company","pos","isQualified","reqText","getJobRequirementText","newPos","getNextCompanyPositionHelper","hasPosition","nextPos","getNextCompanyPosition","currentPositionName","currentPosition","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","quitJob","applyForSoftwareJob","posNames","applyForSoftwareConsultantJob","applyForItJob","applyForSecurityEngineerJob","applyForNetworkEngineerJob","applyForBusinessJob","applyForBusinessConsultantJob","applyForSecurityJob","applyForAgentJob","applyForEmployeeJob","applyForPartTimeEmployeeJob","applyForWaiterJob","applyForPartTimeWaiterJob","position","offset","jobStatReqOffset","reqHacking","requiredHacking","reqStrength","requiredStrength","reqDefense","requiredDefense","reqDexterity","requiredDexterity","reqAgility","reqCharisma","requiredCharisma","requiredReputation","augName","aug","owned","applyAugmentation","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","values","checkMegacorpRequirements","repNeeded","illuminatiFac","isBanned","isMember","alreadyInvited","daedalusFac","covenantFac","ecorpFac","AevumECorp","megacorpFac","Sector12MegaCorp","bachmanandassociatesFac","AevumBachmanAndAssociates","bladeindustriesFac","Sector12BladeIndustries","nwoFac","VolhavenNWO","clarkeincorporatedFac","AevumClarkeIncorporated","omnitekincorporatedFac","VolhavenOmniTekIncorporated","foursigmaFac","Sector12FourSigma","kuaigonginternationalFac","ChongqingKuaiGongInternational","fulcrumsecrettechonologiesFac","fulcrumSecretServer","FulcrumSecretTechnologies","AevumFulcrumTechnologies","bitrunnersFac","bitrunnersServer","BitRunnersServer","theblackhandFac","blackhandServer","TheBlackHandServer","nitesecFac","nitesecServer","NiteSecServer","chongqingFac","Chongqing","sector12Fac","newtokyoFac","NewTokyo","aevumFac","Aevum","ishimaFac","Ishima","volhavenFac","Volhaven","speakersforthedeadFac","Sector12CIA","Sector12NSA","thedarkarmyFac","thesyndicateFac","silhouetteFac","tetradsFac","slumsnakesFac","netburnersFac","totalHacknetRam","totalHacknetCores","totalHacknetLevels","v","hserver","HacknetServer","cores","ram","tiandihuiFac","cybersecFac","cybersecServer","CyberSecServer","setBitNodeNumber","queueAugmentation","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","filter","gainPerFaction","facName","CompanyReputation","to","gotoLocation","Locations","canAccessResleeving","giveExploit","exploit","weight","calculateIntelligenceBonus","getCasinoWinnings","casino","getMult","setMult","EmployeePositions","Operations","Engineer","Business","Management","RandD","Unassigned","BaseServer","super","createRandomString","requiredHackingSkill","moneyAvailable","moneyMax","hackDifficulty","baseDifficulty","minDifficulty","serverGrowth","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","fortify","Industries","Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Computer","Robotics","Software","Healthcare","RealEstate","IndustryStartingCosts","IndustryDescriptions","corp","IndustryResearchTrees","getBaseResearchTreeCopy","getProductIndustryResearchTreeCopy","resetIndustryResearchTrees","LocationType","BladeburnerConstants","CityNames","CyclesPerSecond","StaminaGainPerSecond","BaseStaminaLoss","MaxStaminaToGainFactor","DifficultyToTimeFactor","DiffMultExponentialFactor","DiffMultLinearFactor","EffAgiLinearFactor","EffDexLinearFactor","EffAgiExponentialFactor","EffDexExponentialFactor","BaseRecruitmentTimeNeeded","PopulationThreshold","PopulationExponent","ChaosThreshold","BaseStatGain","BaseIntGain","ActionCountGrowthPeriod","RankToFactionRepFactor","RankNeededForFaction","ContractSuccessesPerLevel","OperationSuccessesPerLevel","RanksPerSkillPoint","ContractBaseMoneyGain","HrcHpGain","HrcStaminaGain","CorporationManagementHandbook","HistoryOfSynthoids","AGreenTomorrow","AlphaOmega","SimulatedReality","BeyondMan","BrighterThanTheSun","DemocracyIsDead","Sector12Crime","ManAndMachine","SecretSocieties","TheFailedFrontier","CodedIntelligence","SyntheticMuscles","TensionsInTechRace","CostOfImmortality","TheHiddenWorld","TheNewGod","NewTriads","TheSecretWar","hasHacknetServers","purchaseHacknet","numOwned","getCostOfNextHacknetServer","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","lt","calculateLevelUpgradeCost","levelsToMax","gt","getMaxNumberRamUpgrades","calculateRamUpgradeCost","log2","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","purchaseRamUpgrade","purchaseCoreUpgrade","purchaseCacheUpgrade","processHacknetEarnings","HashManager","hashes","updateHashRate","h","process","storeHashes","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","upgrade","upg","HashUpgrades","refundUpgrade","target","e","old","division","sciResearch","qty","changeRank","skillPoints","generateRandomContract","initCompanies","oldCompanies","companiesMetadata","forEach","loadCompanies","Array","updateSourceFileFlags","sf","lvl","PositionTypes","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","unlock","LevelUpgrade","priceMult","upgrades","IssueDividends","percent","dividendPercentage","SellMaterial","mat","price","replace","temp","bCost","eval","sCost","q","tempQty","sllman","SellProduct","product","all","cities","tempCity","SetSmartSupply","warehouse","smartSupply","smartSupplyEnabled","SetSmartSupplyUseLeftovers","material","useLeftover","smartSupplyUseLeftovers","BuyMaterial","buy","AssignJob","employee","job","UpgradeOfficeSize","office","initialPriceMult","ThrowParty","costPerEmployee","totalCost","employees","throwParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouse","sizeUpgradeCost","updateSize","BuyCoffee","IndustryUpgrades","HireAdVert","MakeProduct","productName","designInvest","marketingInvest","Product","createCity","designCost","advCost","products","Research","researchName","researchTree","getAllNodes","research","ResearchMap","researched","ExportMaterial","divisionName","cityName","sanitizedAmt","exportObj","CancelExportMaterial","LimitProductProduction","prdman","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","programsMetadata","Program","SleeveTaskType","AllGangs","power","territory","Tetrads","NiteSec","loadAllGangs","Shoplift","Crime","dexterity_success_weight","agility_success_weight","RobStore","hacking_success_weight","Mug","strength_success_weight","defense_success_weight","Larceny","DealDrugs","charisma_success_weight","BondForgery","TraffickArms","Homicide","GrandTheftAuto","Kidnap","Assassination","Heist","trusted","event","isTrusted","companyPositionMetadata","CompanyPosition","updateHashCapacity","seconds","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","runScript","script","calculateHashGainRate","ramUsed","StockSymbols","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","calculateHackingChance","difficultyMult","chance","calculateHackingExpGain","expGain","calculatePercentMoneyHacked","percentMoneyHacked","calculateHackingTime","skillFactor","calculateGrowTime","calculateWeakenTime","StockMarket","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","stock","shares","workerScript","Stock","order","Order","symbol","orders","stk","processOrderRefs","stockMarket","symbolToStockMap","processOrders","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","initStockMarket","InitStockMetadata","TicksPerCycle","initSymbolToStockMap","cyclesPerStockUpdate","processStockPrices","timeNow","flipForecastForecast","stockMarketCycle","av","mv","chc","otlkMag","cap","changePrice","OrderTypes","LimitBuy","Short","LimitSell","Long","StopBuy","StopSell","otlkMagChange","cycleForecast","cycleForecastForecast","shareTxUntilMovement","shareTxForMovement","initStockMarketFnForReact","eventEmitterForUiReset","EventEmitter","KEY","CTRL","DOWNARROW","ENTER","ESC","TAB","UPARROW","B","C","D","E","F","G","H","I","J","K","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","fn","getDifficulty","getMaxNumTries","getType","isSolution","solution","Promise","resolve","Cancelled","onAttempt","val","Success","Failure","CodingContractEvent","isScriptFilename","Reputation","TheDarkArmyServer","DaedalusServer","WorldDaemon","DarkWeb","MoneyRate","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","removeLeadingSlash","removeTrailingSlash","isValidFilename","match","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","lastIndexOf","getFirstParentDirectory","getAllParentDirectories","lastSlash","isInRootDirectory","evaluateDirectoryPath","currPath","reconstructedPath","pop","evaluateFilePath","margin","spacing","code","page","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCity","toCorporation","toCreateProgram","toDevMenu","toFaction","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toResleeves","toScriptEditor","toSleeves","toStockMarket","toTerminal","toTravel","toTutorial","toBladeburnerCinematic","toLocation","GameRoot","engine","terminal","setPage","useState","Work","Terminal","determineStartPage","setRerender","setFaction","flume","setFlume","quick","setQuick","setLocation","Infiltration","Location","Job","cinematicText","setCinematicText","rerender","useEffect","subscribe","ActiveScripts","Bladeburner","Stats","CreateProgram","DevMenu","Options","Gang","Hacknet","Milestones","Resleeves","ScriptEditor","Sleeves","Tutorial","City","Travel","BitVerse","BladeburnerCinematic","scrollTo","Provider","save","saveObject","saveGame","enter","enterBitNode","flexDirection","flexGrow","px","height","workerScripts","buyStockLong","buyStockShort","eventEmitterForReset","sellStockLong","sellStockShort","export","exportGame","forceKill","exportGameFn","onExport","installAugmentationsFn","numCycleForGrowth","growth","ajdGrowthRate","serverGrowthPercentage","coreBonus","processSingleServerGrowth","threads","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","ceil","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","scripts","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","StatsTable","rows","title","wide","MuiTable","map","row","elem","align","noWrap","TTerminal","count","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","inviteToFaction","InvitationEvent","factionInfo","enemies","enemy","hasAugmentationPrereqs","hasPrereqs","prereqAug","augmentationPriceMult","queuedAugmentation","getNextNeurofluxLevel","nextLevel","currLevel","processPassiveFactionRepGain","offersWork","getGangName","hRep","sRep","fRep","rate","String","MoneyCost","uuidv4","uuid","subscribers","sub","Message","msg","recvd","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","useGang","killWorkerScript","rerenderUi","WorkerScript","stopAndCleanUpWorkerScript","RunningScript","killWorkerScriptByPid","pid","compareArrays","env","stopFlag","delay","clearTimeout","delayResolve","killNetscriptDelay","runningScript","rs","ramUsage","delete","WorkerScriptStartStopEventEmitter","removeWorkerScript","defaultConstructorParams","initPrice","marketCap","spreadPerc","range","divisor","lastPrice","playerShares","playerAvgPx","playerShortShares","playerAvgShortPx","otlkMagForecast","getAbsoluteForecast","totalSharesUnrounded","totalShares","maxShares","changeForecastForecast","newff","newPrice","changeAmt","increaseChance","getForecastIncreaseChance","getAskPrice","getBidPrice","influenceForecast","change","influenceForecastForecast","Adjuster","setValue","label","placeholder","add","subtract","tons","onChange","InputProps","startAdornment","onClick","style","transform","endAdornment","Aliases","GlobalAliases","loadAliases","loadGlobalAliases","printAliases","parseAliasDeclaration","dec","global","matches","trim","addGlobalAlias","addAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","netscriptDelay","setTimeout","makeRuntimeRejectMsg","resolveNetscriptRequestedThreads","functionName","requestedThreads","requestedThreadsAsInt","isScriptErrorMessage","Literature","CopyableText","setOpen","variant","copyText","document","createElement","body","appendChild","select","setSelectionRange","execCommand","removeChild","AddToAugmentations","initAugmentations","clearObject","randomBonuses","bonuses","description","randomNumber","WHRNG","step","getRandomBonus","UnstableCircadianModulatorParams","augmentationExists","RedPill","FTPCrackProgram","RelaySMTPProgram","BruteSSHProgram","DeepscanV1","AutoLink","resetAugmentation","newAugObject","reapply","augObj","ownedAug","augmentationList","nfgIndex","isRepeatableAug","UpgradeType","gangMemberUpgradesMetadata","def","upgType","Weapon","dex","agi","Armor","Vehicle","Rootkit","MaterialSizes","Water","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AICores","NetscriptPorts","NetscriptPort","prestigeWorkerScripts","startNetscript1Script","codeWithImports","codeLineOffset","running","importProcessingRes","ast","ecmaVersion","allowReserved","sourceType","generatedCode","hasImports","walksimple","ImportDeclaration","scriptName","getScript","scriptAst","specifiers","namespace","local","fnNames","fnDeclarations","FunctionDeclaration","id","fnName","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","interpreterInitialization","scope","NetscriptFunctions","entry","tempWrapper","fnArgs","pseudoToNative","cb","then","catch","setProperty","createAsyncFunction","createNativeFunction","nativeToPseudo","interpreter","Interpreter","reject","runInterpreter","errorMessage","startWorkerScript","parent","createAndAddWorkerScript","roundToTwo","getRamUsageFromRunningScript","arrayToString","generateNextPid","set","runningFn","wrap","propName","finally","vars","executeJSScript","message","stack","startNetscript2Script","w","onlineExpGained","onlineMoneyMade","errorTextArray","errorMsg","updateOnlineScriptTimes","onlineRunningTime","loadAllRunningScripts","skipScriptLoad","href","indexOf","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","caller","scriptname","isArray","ramAvailable","hasAdminRights","FactionWorkType","createProgressBarText","derived","progress","totalTicks","bars","dashes","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","copy","sll","prd","imp","totalExp","marketTa2Price","gainFavor","rolloverRep","getFavorGain","totalRep","favorToRep","newFavor","repToFavor","newRep","KeyHandler","press","onKeyDown","addEventListener","removeEventListener","TimerProgress","withStyles","bar","transition","LinearProgress","GameTimer","setV","intervalId","setInterval","onExpire","millis","clearInterval","item","xs","interpolate","settings","out","lerpD","lerp","y","Trivial","Normal","Hard","Impossible","Map","win","reachedLimit","reached","Game","getBuyTransactionCost","posType","getSellTransactionGain","processTransactionForecastMovement","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","GangMemberUpgrades","GangMemberUpgrade","commit","div","successRate","createTaskTracker","Person","calculateStat","getFactionHackingWorkRepGain","updateStatLevels","BitNode","number","BitNodes","initBitNodeMultipliers","sf12Lvl","inc","ActionIdentifier","general","contracts","ops","blackops","events","updateSkillMultipliers","calculateMaxStamina","stamina","maxStamina","getCurrentCity","calculateStaminaPenalty","actionId","actionTimeCurrent","actionTimeToComplete","getActionObject","resetAction","exceptionAlert","commsEst","getRecruitmentTime","skill","skillName","skills","executeConsoleCommands","commands","consoleHistory","arrayOfCommands","executeConsoleCommand","postToConsole","input","saveToLogs","consoleLogs","getTimestamp","clearConsole","bladeburnerFac","rank","storeCycles","getActionIdFromTypeAndName","convertedType","convertedName","operations","BlackOperations","executeStartConsoleCommand","GeneralActions","executeSkillConsoleCommand","skillNames","Skills","multKeys","skillMultipliers","Skill","currentLevel","pointCost","calculateCost","executeLogConsoleCommand","flag","logging","executeHelpConsoleCommand","line","ConsoleHelpText","helpList","helpText","executeAutomateConsoleCommand","variable","highLow","automateActionHigh","automateActionLow","automateThreshHigh","automateThreshLow","automateEnabled","parseCommandArguments","command","start","endQuote","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","rand","percentage","comms","triggerPotentialMigration","randomEvent","chaos","gainActionStats","success","successMult","unweightedGain","unweightedIntGain","weights","intExp","getDiplomacyEffectiveness","getRecruitmentSuccessChance","teamSize","effCharisma","effCha","charismaFactor","resetSkillMultipliers","successChanceAll","successChanceStealth","successChanceKill","successChanceContract","successChanceOperation","successChanceEstimate","actionTime","effHack","effStr","effDef","effDex","effAgi","effInt","multiplierNames","multiplierName","getMultiplier","multiplierValue","completeOperation","teamCount","losses","teamLost","improvePopulationEstimateByPercentage","improveCommunityEstimate","changePopulationByPercentage","changeEstEqually","nonZero","changeChaosByCount","changeChaosByPercentage","changePopulationByCount","estChange","estOffset","completeContract","improvePopulationEstimateByCount","completeAction","isOperation","difficultyMultiplier","rewardMultiplier","rewardFac","successes","setMaxLevel","rankGain","gain","addOffset","failures","loss","damage","rankLoss","hpLoss","hpLost","calculateHospitalizationCost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","staminaGain","staminaBonus","eff","successChance","maxRank","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","calculateStaminaGainPerSecond","effAgility","maxStaminaBonus","oldMax","difficultyFac","decays","isStealth","isKill","reqdRank","redPillFlag","contract","growthF","Growths","op","randomEventCounter","getTypeAndNameFromActionId","types","getContractNamesNetscriptFn","getOperationNamesNetscriptFn","getBlackOpNamesNetscriptFn","getGeneralActionNamesNetscriptFn","getSkillNamesNetscriptFn","startActionNetscriptFn","errorLogText","nm","getActionTimeNetscriptFn","actionObj","getActionEstimatedSuccessChanceNetscriptFn","getEstSuccessChance","recChance","getActionCountRemainingNetscriptFn","getSkillLevelNetscriptFn","getSkillUpgradeCostNetscriptFn","upgradeSkillNetscriptFn","maxLvl","getTeamSizeNetscriptFn","setTeamSizeNetscriptFn","sanitizedSize","joinBladeburnerFactionNetscriptFn","DefaultConstructorParams","companyPositions","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","favorGain","reqdRep","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","getPurchaseServerMaxRam","getPurchaseServerLimit","clz32","newServ","purchaseRamForHomeComputer","materials","unlockUpgrades","updateMaterialSizeUsed","sizeUsed","matName","getStorageMultiplier","GangMemberTasks","gangMemberTasksMetadata","GangMemberTask","isHacking","isCombat","startingLevel","extraLevels","totalMultiplier","startingRam","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","opts","suppressDialog","totalPrice","origTotal","newTotal","rerenderFn","resultTxt","gains","netProfit","origCost","profit","costInc","Hashes","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","ExploitName","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","GlobalAliasesSave","MessagesSave","Messages","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","AllGangsSave","btoa","unescape","encodeURIComponent","GameSavedEvents","epochTime","now","bn","file","Blob","navigator","msSaveOrOpenBlob","url","URL","createObjectURL","download","click","revokeObjectURL","loadGame","decodeURIComponent","escape","atob","saveObj","loadMessages","initMessages","ver","anyPlayer","positionName","evaluateVersionCompatibility","createNewUpdateText","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","constructLocation","asciiArt","LocationsMetadata","addLocation","getArrow","keyCode","setRedPillFlag","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","timePassed","confidence","dataMap","serv","timesGrown","host","cpuCores","offlineRunningTime","offlineExpGained","timesWeakened","findRunningScript","findRunningScriptByPid","TextFile","append","show","getTextFile","textFiles","createTextFile","fileName","lineNumber","sendMessage","forced","showMessage","serverHostname","other","addMessageToServer","checkForMessagesToSend","jumper0","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","redpill","redpillOwned","flightName","Flight","AddToAllMessages","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","calculateExp","actionName","Action","SourceFile","bitnodeKey","bitnode","LogBoxEvents","LogBoxManager","setLogs","LogWindow","close","overflowY","overflowX","container","useRef","handle","flexFlow","left","top","zIndex","ref","cursor","right","overflowWrap","whiteSpace","bottom","updateMoneyGainRate","moneyGainRatePerSecond","totalMoneyGenerated","HashUpgradesMetadata","HashUpgrade","vals","getStockMarket4SDataCost","getStockMarket4STixApiCost","ApplyToJobButton","getJobRequirementTooltip","DarkWebItems","DarkWebItem","HTTPWormProgram","SQLInjectProgram","DeepscanV2","AutolinkProgram","ServerProfilerProgram","ServerProfiler","midpoint","RamCalculationErrorCode","nsFuncsGenerator","sanitizedPid","found","Environment","getScriptOnServer","shouldLog","func","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","getRandomByte","researchMetadata","Favor","ThemeEvents","refreshTheme","createTheme","light","typography","fontFamily","button","textTransform","components","MuiInputBase","styleOverrides","userSelect","MuiInput","borderBottomColor","underline","MuiInputLabel","MuiButton","borderRadius","MuiSelect","icon","defaultProps","MuiTextField","MuiTypography","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","tooltip","fontSize","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","selectLabel","displayedRows","MuiTab","textColorPrimary","TTheme","injectFirst","sum","EPSILON","decay","inst","getSuccessChance","baseTime","skillFac","effDexterity","statFac","getTeamSuccessBonus","getActionTypeSkillSuccessBonus","est","popEst","clamp","real","low","high","competence","stat","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","None","crimeKey","currentTask","finishTask","resetTaskStatus","gainRatesForTask","currentTaskLocation","currentTaskMaxTime","retValue","currentTaskTime","successGainRates","keysForIteration","gainExperience","fromOtherSleeve","multFac","pHackExp","pStrExp","pDefExp","pDexExp","pAgiExp","pChaExp","earningsForPlayer","earningsForTask","earningsForSleeves","task","getMemoryUpgradeCost","memory","currCost","currMemory","getRepGain","Hacking","Field","Security","installAugmentation","cyclesUsed","Class","Gym","updateTaskGainRates","Recovery","Synchro","gymStatType","takeUniversityCourse","universityName","AevumSummitUniversity","Sector12RothmanUniversity","VolhavenZBInstituteOfTechnology","newCity","tryBuyAugmentation","some","AevumCrushFitnessGym","AevumSnapFitnessGym","Sector12IronGym","Sector12PowerhouseGym","VolhavenMilleniumFitnessGym","baseGymExp","totalExpMultiplier","sanitizedStat","totalExpMult","upgradeMemory","sanitizedWorkType","offerHackingWork","offerFieldWork","offerSecurityWork","workoutAtGym","gymName","Output","Link","TTimer","timeLeft","TerminalEvents","TerminalClearEvents","program","orderType","refs","orderBook","executeOrder","isBuy","CorporationState","numUnlockUpgrades","CorporationUnlockUpgrades","CorporationUpgrades","fill","upgradeMultipliers","addFunds","isFinite","getState","state","marketCycles","gameCycles","shareSaleCooldown","issueNewSharesCooldown","cycleProfit","times","totalDividends","retainedEarnings","dividendsPerShare","numShares","dividendTaxPercentage","updateSharePrice","nextState","determineValuation","public","getTargetSharePrice","targetPrice","sharePrice","immediatelyUpdateSharePrice","calculateShareSale","sharesTracker","sharesUntilUpdate","shareSalesUntilPriceUpdate","sharesSold","maxIterations","convertCooldownToString","cd","upgN","basePrice","upgradeAmt","getProductionMultiplier","getDreamSenseGain","getAdvertisingMultiplier","getEmployeeCreMultiplier","getEmployeeChaMultiplier","getEmployeeIntMultiplier","getEmployeeEffMultiplier","getSalesMultiplier","getScientificResearchMultiplier","getStarterGuide","hasHandbook","handbookFn","showLiterature","maintainMembership","keep","finishAction","resetPidCounter","setMaxRam","BadRNG","totalPlaytime","s1","s2","s3","nextPosition","repMultiplier","reqdHacking","reqdStrength","reqdDefense","reqdDexterity","requiredAgility","reqdAgility","reqdCharisma","reqdReputation","hackingEffectiveness","strengthEffectiveness","defenseEffectiveness","dexterityEffectiveness","agilityEffectiveness","charismaEffectiveness","hackRatio","strRatio","defRatio","dexRatio","agiRatio","chaRatio","reputationGain","logEntry","logUpd","displayLog","recordHack","moneyGained","recordGrow","recordWeaken","StartButton","mx","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","calculateRamUsage","getUpgrade","getUpgradeCost","getCost","capacity","newCap","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","findCrime","roughName","atCapacity","hasResearch","emp","hireRandomEmployee","maxEne","maxHap","maxMor","perfMult","hasAutobrew","hasAutoparty","salaryPaid","mor","hap","ene","calculateEmployeeProductivity","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","experience","creativity","efficiency","salary","assignEmployeeToJob","unassignEmployeeFromJob","minEne","minHap","canGetBonus","setLastExportBonus","unixTime","sanitizedSource","formattedHours","getHours","formattedMinutes","getMinutes","getMonth","getDate","AlertManager","alerts","setAlerts","oldhp","createCityMap","demand","competition","markup","quality","per","performance","dur","durability","rel","reliability","aes","aesthetics","fea","features","siz","reqMats","req","createProduct","empWorkMult","fin","prog","finishProduct","progrMult","engrRatio","mgmtRatio","rndRatio","opsRatio","busRatio","totalMult","sciFac","calculateRating","advMult","busmgtgRatio","awareness","popularity","reqMat","ProductRatingWeights","rat","Quality","Performance","Durability","Reliability","Aesthetics","Features","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","async","request","put","deleteGame","locations","Option","my","buttonText","infoText","TickerDisplayMode","DisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","StockTickersConfig","changeWatchlistFilter","canAccessGang","getGangFaction","hasGangWith","startGang","hacking","currentCity","onTravel","lineHeight","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","ReputationRate","MaxSleevesFromCovenant","BaseCostPerSleeve","hasTorRouter","decimal","checkIfConnectedToDarkweb","listAllDarkwebItems","buyDarkwebItem","itemName","pidCounter","tempCounter","has","MAX_SAFE_INTEGER","defaultInterpreter","toNative","pseudoObj","nativeObj","class","getProperty","hasProperty","properties","updateDynamicRam","ramCost","dynamicLoadedFns","dynamicRamUsage","safeGetServer","callingFnName","makeRuntimeErrorMsg","scriptArgs","getRunningScriptByPid","getCannotFindRunningScriptErrorMessage","checkTixApiAccess","callingFn","getStockFromSymbol","failOnHacknetServer","errstack","userstack","stackline","dependency","dependencies","parseChromeStackline","lineMatch","funcMatch","chromeCall","parseFirefoxStackline","lio","firefoxCall","rejectMsg","checkFormulasAccess","extra","checkSingularityAccess","checkBladeburnerAccess","skipjoined","checkBladeburnerCity","getCodingContract","getContract","getBladeburnerActionObject","getCompany","getFaction","getAugmentation","getDivision","find","getOffice","getWarehouse","getMaterial","materialName","getProduct","getEmployee","employeeName","runAfterReset","cbScript","manual","hackingTime","canHack","netscriptCanHack","expGainedOnSuccess","expGainedOnFailure","percentHacked","maxThreadNeeded","moneyDrained","influenceStockThroughServerHack","argsToString","arg","helper","string","funcName","argName","boolean","NetscriptGang","NetscriptSleeve","NetscriptExtra","functions","NetscriptHacknet","hackAmount","netscriptCanGrow","growTime","moneyBefore","moneyAfter","logGrowPercent","influenceStockThroughServerGrow","netscriptCanWeaken","weakenTime","tprintf","possibleLogs","tail","arguments","openPortCount","sshPortOpen","ftpPortOpen","smtpPortOpen","httpPortOpen","sqlPortOpen","scriptServer","spawnDelay","killByPid","scriptsRunning","ip1","ip2","destServer","currServ","txtFile","newFile","sourceScript","oldScript","newScript","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","sanitizedPosType","orderPos","ltype","lpos","stockMarketOrders","forecast","hostnameStr","port","iport","status","removeFile","suc","offlineMoneyMade","tFormat","milliseconds","milliPrecision","PromptEvent","$","writeToScriptFile","writeToTextFile","overwritten","fail","cityname","darkweb","setcwd","baseserver","installTime","jobTitles","maxHp","agilityExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","tor","workHackExpGain","workStrExpGain","workDefExpGain","workDexExpGain","workAgiExpGain","workChaExpGain","workRepGain","workMoneyGain","charismaExp","field","hackAvailable","fdWkAvailable","scWkAvailable","repNeededToDonate","crimeRoughName","Slums","purchased","facname","augs","expandIndustry","industryName","expandCity","unlockUpgrade","upgradeName","levelUpgrade","issueDividends","sellMaterial","sellProduct","discontinueProduct","setSmartSupply","enabled","buyMaterial","assignJob","hireEmployee","upgradeOfficeSize","purchaseWarehouse","upgradeWarehouse","buyCoffee","hireAdVert","makeProduct","exportMaterial","sourceDivision","targetDivision","targetCity","cancelExportMaterial","setMaterialMarketTA1","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","returnReward","is2DArray","answerComponents","creward","removeContract","tries","formulas","basic","hackPercent","growPercent","hackTime","moneyGainRate","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","extraCores","hacknetNodeCost","constants","hacknetServers","hashGainRate","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","cacheUpgradeCost","extraCache","HScalculateCacheUpgradeCost","hashUpgradeCost","hacknetServerCost","HScalculateServerCost","flags","Boolean","numDashes","ret","libarg","argv","fromEntries","getFunctionNames","prefix","functionNames","entries","moneyHacked","orgName","percTotalMoneyHacked","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","tooltiptext","reqRep","CinematicText","setI","done","setDone","lines","onDone","newI","auto","members","wanted","respect","isHackingGang","respectGainRate","wantedGainRate","storedTerritoryAndPowerCycles","territoryClashChance","territoryWarfareEngaged","notifyMemberDeath","getPower","getTerritory","cycles","processGains","processExperienceGains","processTerritoryAndPowerGains","moneyGains","respectGains","wantedLevelGains","justice","calculateRespectGain","calculateMoneyGain","calculateWantedLevelGain","baseWanted","recordEarnedRespect","oldWanted","newWanted","gangName","calculatePower","gainRoll","multiplicativeGain","additiveGain","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","initValue","baseCheck","initialCheck","Hand","cards","addCards","removeByIndex","StockTickerTxButton","contractName","CodingContractModal","setProps","setAnswer","contractType","autoFocus","preventDefault","specialReferenceIF","specialReferenceFOR","specialReferenceWHILE","memCheckGlobalKey","parseOnlyRamCalculate","dependencyMap","completedParses","Set","parseQueue","parseCode","moduleName","parseOnlyCalculateDeps","additionalModules","initialModule","nextModule","URLImportError","ImportError","unresolvedRefs","resolvedRefs","ident","k","dep","applyFuncRam","loadedFns","SyntaxError","currentModule","globalKey","internalToExternal","addRef","external","objectPrototypeProperties","getOwnPropertyNames","commonVisitors","Identifier","st","WhileStatement","walkDeeper","test","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","walk","importModuleName","spec","imported","codeCopy","BitFlumeEvent","BitFlumeModal","litObj","Literatures","FactionInfo","offerHackingMission","augmentationRepRequirementMult","Illuminati","Daedalus","ECorp","MegaCorp","NWO","BitRunners","Silhouette","Netburners","CyberSec","Bladeburners","InvitationModal","findIndex","opt_initFunc","sourceCode","sourceCodeLineOffset","acorn","PARSE_OPTIONS","initFunc_","paused_","polyfills_","functionCounter_","stepFunctions_","stepMatch","methodName","createScope","stripLocations_","State","stateStack","nodeConstructor","READONLY_DESCRIPTOR","configurable","writable","NONENUMERABLE_DESCRIPTOR","READONLY_NONENUMERABLE_DESCRIPTOR","VARIABLE_DESCRIPTOR","STEP_ERROR","SCOPE_REFERENCE","VALUE_IN_DESCRIPTOR","toStringCycles_","getErrorLineNumber","getErrorLineNumberMessage","appendCode","populateScope_","initGlobalScope","OBJECT_PROTO","FUNCTION_PROTO","initFunction","initObject","proto","OBJECT","initArray","initString","initBoolean","initNumber","initDate","initRegExp","initError","initMath","initJSON","thisInterpreter","EvalError","parseInt","strFunctions","decodeURI","encodeURI","wrapper","nativeFunc","throwException","URI_ERROR","FUNCTION","ARRAY","ARRAY_PROTO","REGEXP","REGEXP_PROTO","DATE","DATE_PROTO","identifierRegexp","var_args","calledWithNew","newFunc","createObjectProto","argsStr","SYNTAX_ERROR","parentScope","boxThis","isObject","getScope","strict","box","getPrototype","thisArg","func_","funcThis_","arguments_","arrayPseudoToNative","TYPE_ERROR","doneExec_","setNativeFunctionPrototype","valueOf","throwIfNullUndefined","arrayNativeToPseudo","descriptor","preventExtensions","getOwnPropertyDescriptor","setter","hasValue","pseudoDescriptor","propertyIsEnumerable","newArray","first","legalArrayLength","RANGE_ERROR","unshift","reverse","howmany","opt_begin","opt_end","opt_separator","iLength","element","isa","jLength","searchElement","opt_fromIndex","STRING","fromCharCode","compareString","locales","options","localeCompare","separator","limit","jsList","regexp","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","ERROR","digits","toFixed","precision","toPrecision","radix","from","Function","UTC","pattern","rgx","populateRegExp","RegExp","lastIndex","opt_message","newError","createObject","createErrorSubclass","EVAL_ERROR","REFERENCE_ERROR","myMath","mathConsts","numFunctions","myJSON","child","legalArrayIndex","Value","strs","pseudoRegexp","nativeRegexp","ignoreCase","multiline","createFunction","opt_constructor","illegalConstructor","asyncFunc","pseudoDate","opt_cycles","pseudo","native","nativeArray","pseudoArray","lineNum","charCodeAt","isGetter","TypeError","opt_descriptor","ReferenceError","defObj","firstNode","expression","createSpecialScope","opt_scope","getValueFromScope","prevNode","setValueToScope","nodeClass","end","isConstructor","getValue","Completion","NORMAL","BREAK","CONTINUE","RETURN","THROW","errorClass","lineNumErrorMsg","unwind","lineNumberMsg","cv","labels","isLoop","isSwitch","realError","errorTable","RangeError","URIError","createGetter_","funcThis","doneCallee_","doneArgs_","createSetter_","elements","n_","array_","doneLeft_","doneRight_","leftReference_","doneGetter_","leftValue_","leftValue","doneSetter_","setterValue_","rightValue","directEval_","funcNode","paramName","paramValue","argsList","evalNode","argsWithCallback","done_","throwValue","mode_","test_","doneInit_","doneObject_","variable_","object_","visited_","name_","gotPropName","props_","doneVariable_","doneProperty_","properties_","kinds","switchValue_","defaultCase_","index_","switchCase","matched_","tested_","doneBlock_","doneHandler_","doneFinalizer_","leftSide_","changeValue","returnValue","declarations","declarationNode","init_","doneBody_","numServerGrowthCycles","adjGrowthRate","numServerGrowthCyclesAdjusted","PromptManager","setPrompt","Snackbar","anchorOrigin","vertical","horizontal","autoHideDuration","getAvailableCreatePrograms","AugmentationAccordion","displayName","component","Paper","unmountOnExit","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","checked","TeamSizeButton","baseRespect","baseMoney","hackWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","BlinkingCursor","setOn","purchaseResleeve","augKey","generateResleeves","Resleeve","baseNumAugs","numAugs","augKeys","randKey","randAug","findSleevePurchasableAugs","ownedAugNames","availableAugs","isAvailableForSleeve","HashRate","TravelAgencyRoot","destination","setDestination","startTravel","Fragment","symbolsLoaded","symbols","SetupTextEditor","populate","exclude","lastFilename","lastCode","lastPosition","Root","editorRef","setFilename","setCode","setRAM","updatingRam","setUpdatingRam","optionsOpen","setOptionsOpen","setOptions","insertSpaces","debouncedSetRAM","useMemo","debounce","current","getPosition","CursorPositions","saveCursor","column","textFile","updateRAM","newCode","maybeSave","ctrlKey","metaKey","tabIndex","beforeMount","monaco","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","typescript","javascriptDefaults","addExtraLib","libSource","typescriptDefaults","onMount","editor","getCursor","setPosition","loading","defaultLanguage","defaultValue","pretty","beautifyCode","indent_with_tabs","indent_size","brace_style","TablePaginationActionsAll","useTheme","rowsPerPage","onPageChange","flexShrink","ml","direction","fma","ex","canAccessBladeburner","inBladeburner","startBladeburner","automate","cls","help","stop","createTreantMarkup","childrenArray","htmlClass","HTMLclass","innerHTML","findNode","setParent","chart","nodeStructure","queue","getMultiplierHelper","getProductProductionMultiplier","canAccessCorporation","hasCorporation","startCorporation","corpName","additionalShares","currPos","nextPosName","Engine","_lastUpdate","updateGame","expForOtherSleeves","decrementAllCounters","checkCounters","Counters","autoSaveCounter","updateSkillLevelsCounter","updateDisplays","updateDisplaysLong","updateActiveScriptsDisplay","createProgramNotifications","augmentationsNotifications","passiveFactionGrowth","mechanicProcess","contractGeneration","counterName","counter","adjustedCycles","startExploits","timeOffline","numCyclesOffline","offlineReputation","offlineHackingIncome","offlineProductionFromHacknetNodes","hacknetProdInfo","timeOfflineString","_thisUpdate","requestAnimationFrame","LoadingScreen","setShow","loaded","setLoaded","reason","doLoad","minHeight","Tracking","Retirement","Investigation","Raid","typ","invalidArgs","Void","infiltrationData","techVendorMaxRam","techVendorMinRam","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","serverType","purchase","canPurchase","GenericLocation","locContent","locName","Hospital","Special","TechVendor","University","Casino","getLocationSpecificContent","card","textAlign","fontWeight","red","ReactCard","hidden","Clubs","Spades","positions","allFactionAugs","factionAugs","factionAug","repFromDonation","TickerHeaderFormatData","longestName","longestSymbol","isNumber","ParseCommands","allCommands","flat","ParseCommand","inQuote","prevChar","escaped","TerminalHelpText","HelpTexts","analyze","backdoor","cat","check","expr","free","lscpu","mem","nano","sudov","unalias","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","isHacknet","org","hackingSkill","security","hackingChance","numPort","getProgressText","getFile","getLitFile","getFilepath","cwd","filepath","lit","currDir","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","ans","len","nums","ways","padStart","matrix","spiral","u","col","playerAns","reach","intervals","numIntervals","interval","sanitizedResult","sanitizedAns","ansArr","ipInAns","maxCur","maxSoFar","hold1","MIN_SAFE_INTEGER","hold2","release1","release2","prices","hold","rele","cur","createTriangleRecurse","numLevels","createTriangle","triangle","dp","numRows","numColumns","currentRow","gridString","grid","obstacleGrid","roll","dfs","pair","playerAnsArray","resultInAnswer","numDigits","digitsArray","sanitizedPlayerAnsArr","evaluated","multed","htmlID","requireHackingLevel","targetServer","numAugReq","specialName","AevumGalacticCybersystems","Sector12DeltaOne","AevumPolice","NewTokyoNoodleBar","Sector12JoesGuns","ipaddress","byteRange","generalMethods","augmentationMethods","bladeburnerMethods","corporationMethods","gangMethods","serverMethods","AllSoftwarePositions","AllITPositions","AllNetworkEngineerPositions","SecurityEngineerPositions","AllTechnologyPositions","AllBusinessPositions","AllAgentPositions","AllSecurityPositions","AllSoftwareConsultantPositions","AllBusinessConsultantPositions","SoftwarePositionsUpToHeadOfEngineering","SoftwarePositionsUpToLeadDeveloper","BusinessPositionsUpToOperationsManager","WaiterOnly","EmployeeOnly","PartTimeWaiterOnly","PartTimeEmployeeOnly","OperationsManagerOnly","CEOOnly","Sector12CarmichaelSecurity","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","effectText","costPerLevel","hasTargetServer","lookup","reFac","robFac","aiFac","advFac","prodMats","hwFac","makesProducts","getProductDescriptionText","getMaximumNumberProducts","additional","hasMaximumNumberProducts","calculateProductionFactors","multSum","cityMult","updateWarehouseSizeUsed","prodName","dividedBy","newInd","employeeSalary","officeLoc","processMaterialMarket","processProductMarket","popularityGain","awarenessGain","processMaterials","processProducts","wh","foo","buyAmt","maxAmt","smartBuy","smartSupplyStore","worseAmt","totalSize","freeSpace","maxProd","getOfficeProductivity","totalMatSize","tmp","reqMatName","normQty","producableFrac","reqMatQtyNeeded","fooProd","fooI","businessFactor","getBusinessFactor","advertisingFactor","getAdvertisingFactors","marketFactor","getMarketFactor","markupLimit","numerator","sqrtNumerator","sqrtDenominator","denominator","sqrt","optimalPrice","maxSell","sellAmt","expI","amtStr","expIndustry","expWarehouse","engrProd","mgmtProd","opProd","mgmtFactor","processProduct","totalProfit","forProduct","netStorageSize","pCost","sCostString","businessProd","calculateEffectWithFactors","awarenessFac","popularityFac","ratioFac","updateResearchTree","expFac","linearFac","morale","happiness","energy","det","cyclesUntilRaise","trainingEff","effCre","effEff","prodBase","pro","maxClearanceLevel","startingSecurityLevel","AevumCasino","Sector12CityHall","WorldStockExchange","ChongqingChurchOfTheMachineGod","textfield","InteractiveTutorialRoot","contents","canNext","square","aria-label","nobackground","Overview","Loading","openedMixin","transitions","easing","sharp","duration","enteringScreen","closedMixin","leavingScreen","breakpoints","up","Drawer","styled","shouldForwardProp","boxSizing","active","borderLeft","listitem","SidebarRoot","hackingOpen","setHackingOpen","characterOpen","setCharacterOpen","worldOpen","setWorldOpen","helpOpen","setHelpOpen","flashTerminal","flashStats","flashActiveScripts","flashHacknet","flashCity","flashTutorial","augmentationCount","invitationsCount","programCount","canCreateProgram","canOpenFactions","canOpenAugmentations","canOpenSleeves","canCorporation","canGang","canJob","canStockMarket","canBladeburner","clickTerminal","clickScriptEditor","clickStats","clickActiveScripts","clickCreateProgram","clickFactions","clickAugmentations","clickHacknet","clickCity","clickTravel","clickJob","clickBladeburner","clickGang","clickTutorial","handleShortcuts","altKey","anchor","timeout","clsx","badgeContent","AugmentationsRoot","InstalledAugmentations","sourceAugs","Alphabetically","aug1","aug2","dense","Improvements","MultiplierTable","PlayerMultipliers","augP","calculateAugmentedStats","PurchasedAugmentations","SourceFileMinus1","OwnedSourceFiles","sourceSfs","sf1","sf2","sfObj","SourceFileAccordion","DevMenuRoot","General","addMoney","TransitionProps","expandIcon","bigNumber","modifyExp","modifier","modifyKarma","resetExperience","modifyFactionRep","AllFaction","modifyFactionFavor","labelId","arial-label","augmentation","setAugmentation","validSFN","setSF","sfN","sfLvl","setAllSF","setProgram","AllPrograms","Servers","setServer","colSpan","setCompany","modifyCompanyRep","AllCompanies","modifyCompanyFavor","modifyBladeburnerRank","modify","modifyBladeburnerCycles","modifyGangCycles","modifyCorporationCycles","CodingContracts","setCodingcontract","cc","stockPrice","setStockPrice","setStockSymbol","processStocks","inputSymbols","SM","stocks","TimeSkip","timeskip","reload","BladeburnerRoot","travelOpen","setTravelOpen","inFaction","TravelModal","nopadding","preformatted","Line","Console","scrollHook","setCommand","consoleHistoryIndex","setConsoleHistoryIndex","scrollToBottom","scrollTop","scrollHeight","id2","prevCommand","currentTarget","spellCheck","AllPages","tab","GeneralActionPage","GeneralActionList","actions","GeneralActionElem","computedActionTimeCurrent","actionData","ContractPage","ContractList","ContractElem","Contracts","StealthIcon","KillIcon","OperationPage","OperationList","OperationElem","TeamSizeModal","BlackOpPage","BlackOpList","blackopName","blackop","BlackOpElem","hasReqdRank","SkillPage","valid","onUpgrade","SkillList","SkillElem","canLevel","GangRoot","ManagementSubpage","GangStats","territoryMult","territoryStr","BonusTime","CyclerPerSecond","bonusMillis","GangMemberList","onRecruit","GangMemberAccordion","GangMemberAccordionContent","onAscend","onTaskChange","GangMemberStats","ascendOpen","setAscendOpen","asc","calculateAscensionMult","hack_asc_points","str_asc_points","def_asc_points","dex_asc_points","agi_asc_points","cha_asc_points","hack_mult","str_mult","def_mult","dex_mult","agi_mult","cha_mult","hack_exp","str_exp","def_exp","dex_exp","agi_exp","cha_exp","canAscend","AscensionModal","preAscend","getCurrentAscensionMults","postAscend","getAscensionMultsAfterAscend","TaskSelector","setCurrentTask","tasks","assignToTask","TaskDescription","RecruitButton","RecruitModal","setName","recruit","onKeyUp","TerritorySubpage","gangNames","g","control","formatTerritory","OtherGangTerritory","playerPower","clashVictoryChance","NextReveal","PurchasedUpgrade","UpgradeButton","buyUpgrade","GangMemberUpgradePanel","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","flexWrap","EquipmentsSubpage","createDescription","CorporationRoot","setDivisionName","canExpand","industryType","MainPanel","CityTabs","setCity","cityStateSetter","countEmployee","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","nf","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","MakeProductButton","makeOpen","setMakeOpen","hasMaxProducts","createProductButtonText","Text","researchOpen","setResearchOpen","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","Upgrades","IndustryOverview","MakeProductModal","allCities","design","setDesign","marketing","setMarketing","createProductPopupText","tpe","Upgrade","but","ResearchModal","WarehouseRoot","smartSupplyOpen","setSmartSupplyOpen","canAffordUpgrade","stateText","mats","isRelevantMaterial","breakdown","IndustryWarehouse","EmptyWarehouse","Leftover","setChecked","SmartSupplyModal","ProductElem","sellOpen","setSellOpen","limitOpen","setLimitOpen","discontinueOpen","setDiscontinueOpen","marketTaOpen","setMarketTaOpen","nfB","hasUpgradeDashboard","sellButtonText","limitProductionButtonText","DiscontinueProductModal","LimitProductProductionModal","setLimit","limitProductProduction","SellProductModal","iQty","setQty","setPx","initialPrice","MarketTA2","ProductMarketTaModal","MaterialElem","purchaseMaterialOpen","setPurchaseMaterialOpen","exportOpen","setExportOpen","sellMaterialOpen","setSellMaterialOpen","materialMarketTaOpen","setMaterialMarketTaOpen","tutorial","purchaseButtonText","ExportModal","setIndustry","setAmt","removeExport","currentDivision","possibleCities","newCost","setNewCost","MaterialMarketTaModal","SellMaterialModal","setPrice","BulkPurchaseText","parsedAmt","amount","matSize","BulkPurchase","setBuyAmt","bulkPurchase","PurchaseMaterialModal","purchaseMaterial","IndustryProductEquation","reqs","reqAmt","raw","tex","ExpandNewCity","ExpandIndustryTab","possibleIndustries","newIndustry","multRows","appendMult","issuedShares","DividendsStats","PublicButtons","PrivateButtons","BribeButton","findInvestorsopen","setFindInvestorsopen","goPublicopen","setGoPublicopen","fundingAvailable","fundingRound","findInvestorsTooltip","upgradeData","sellSharesOpen","setSellSharesOpen","buybackSharesOpen","setBuybackSharesOpen","issueNewSharesOpen","setIssueNewSharesOpen","issueDividendsOpen","setIssueDividendsOpen","sellSharesOnCd","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesTooltip","canBribe","playerEarnings","storedTime","LevelableUpgrade","UU","BribeFactionModal","setStock","selectedFaction","setSelectedFaction","getRepText","bribe","SellSharesModal","setShares","sell","stockSaleResults","newSharePrice","newSharesUntilUpdate","BuybackSharesModal","buybackPrice","IssueDividendsModal","setPercent","canIssue","EffectText","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateShares","FindInvestorsModal","percShares","roundMultiplier","funding","investShares","GoPublicModal","initialSharePrice","goPublic","InfiltrationRoot","setStart","startingDifficulty","totalStats","calcDifficulty","StartingDifficulty","Difficulty","cancel","arrowPart","arrow","Intro","Stage","minigames","SlashGame","BracketGame","BackwardGame","BribeGame","CheatCodeGame","Cyberpunk2077Game","MinesweeperGame","WireCuttingGame","setLevel","stage","setStage","Countdown","results","setResults","gameIds","setGameIds","lastGames","nextGameId","ids","setupNextGame","pushResult","next","stageComponent","onFinish","Minigame","MiniGame","onSuccess","Sell","onFailure","automated","setX","difficulties","timer","setRight","generateLeftSide","char","shiftKey","getChar","guarding","setGuarding","words","makeAnswer","guess","setGuess","nextGuess","choices","positive","option","negative","array","shuffleArray","makeChoices","setIndex","newIndex","arrows","generateCode","puzzle","randChar","generatePuzzle","generateAnswer","setPos","cell","move","mines","minefield","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","reduce","fieldEquals","wiresmin","wiresmax","rules","colorNames","blue","wires","numWires","wireColors","generateWires","cutWires","setCutWires","questions","numQuestions","questionGenerators","randomPositionQuestion","randomColorQuestion","generateQuestion","question","_","wire","wireNum","shouldCut","wiresToBeCut","shouldBeCut","cutColor","Victory","quitInfiltration","levelBonus","SortOption","Cost","Strength","Defense","Dexterity","Agility","Charisma","AverageCombatStats","AverageAllStats","TotalNumAugmentations","getAverage","SortFunctions","ResleeveRoot","setSort","sortFunction","opt","resleeve","totalAugmentationCost","ResleeveElem","setAug","currentAug","CYCLES_PER_SEC","WorkInProgressRoot","unfocus","stopText","penaltyString","numBars","progressBar","GameOptionsRoot","importInput","execTime","setExecTime","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","suppressMessages","setSuppressMessages","suppressFactionInvites","setSuppressFactionInvites","suppressTravelConfirmations","setSuppressTravelConfirmations","suppressBuyAugmentationConfirmation","setSuppressBuyAugmentationConfirmation","suppressHospitalizationPopup","setSuppressHospitalizationPopup","suppressBladeburnerPopup","setSuppressBladeburnerPopup","disableHotkeys","setDisableHotkeys","disableASCIIArt","setDisableASCIIArt","disableTextEffects","setDisableTextEffects","enableBashHotkeys","setEnableBashHotkeys","enableTimestamps","setEnableTimestamps","saveGameOnFileSave","setSaveGameOnFileSave","setLocale","diagnosticOpen","setDiagnosticOpen","deleteGameOpen","setDeleteOpen","themeEditorOpen","setThemeEditorOpen","gutterBottom","sm","newValue","valueLabelDisplay","marks","method","src","alt","File","FileReader","FileList","ii","files","reader","onload","readAsText","onConfirm","confirmationText","ServerAccordion","FileDiagnosticModal","ConfirmationModal","ColorEditor","onColorChange","defaultColor","hideTextfield","newColor","hex","ThemeEditorModal","customTheme","setCustomTheme","placement","importedTheme","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","earningsOpen","setEarningsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","SleeveAugmentationsModal","StatsElement","MoreStatsModal","MoreEarningsModal","universitySelectorOptions","gymSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","second","facInfo","universities","gyms","Synchronize","canDo","getABC","s0","setS0","setS1","setS2","validActions","detailsF","details","details2","detail","FAQModal","HacknetRoot","purchaseMultiplier","setPurchaseMultiplier","totalProduction","purchaseMultiplierOnClicks","multiplier","onClicks","GeneralInfo","HacknetNodeElem","purchaseMult","upgradeLevelContent","upgradeRamContent","upgradeCoresContent","upgradeLevelCost","upgradeRamCost","upgradeCoreCost","HacknetServerElem","upgradeCacheContent","upgradeCacheCost","HashUpgradeModal","HacknetUpgradeElem","selectedServer","setSelectedServer","effect","MultiplierButton","MultiplierButtons","buttons","btnProps","PlayerInfo","hasServers","PurchaseButton","CompanyLocation","quitOpen","setQuitOpen","jobTitle","isEmployedHere","onQuit","QuitJobModal","GymLocation","train","HospitalLocation","btnStyle","getHealed","currHp","setState","render","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","handleBladeburner","new","worldHeader","HTMLElement","handleResleeving","renderBladeburner","renderCotMG","CreateCorporationModal","canSelfFund","ServerButton","TechVendorLocation","purchaseServerButtons","RamButton","TorButton","purchaseTorRouter","CoresButton","maxCores","PurchaseServerModal","setHostname","tryToPurchaseServer","TravelConfirmationModal","UniversityLocation","take","dataStructuresCost","networksCost","algorithmsCost","managementCost","leadershipCost","GameType","CasinoLocation","game","setGame","Coin","Slots","Roulette","Blackjack","Result","bet","canStartGame","playerHand","deck","safeDrawCard","dealerHand","gameInProgress","Pending","getTrueHandValue","finishGame","Tie","PlayerWonByBlackjack","DealerWon","hand","flatMap","handValues","getHandValue","valuesUnder21","isHandBusted","newHand","newDealerHand","PlayerWon","dealerHandValue","playerHandValue","isPlayerWinResult","betInput","wager","wagerInvalid","wagerInvalidHelperText","startGame","Deck","playerHandValues","getHandDisplayValues","dealerHandValues","wagerOnChange","helperText","playerHit","playerStay","startOnClick","elevation","numDecks","shuffle","drawCard","isEmpty","CoinFlip","investment","setInvestment","setResult","setStatus","playLock","setPlayLock","play","letter","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","rng","canPlay","setCanPlay","setN","lock","setLock","strategy","setStrategy","playerWin","isRed","currentNumber","getPayout","payLines","SlotMachine","locks","setLocks","stoppedOne","getTable","getPaylineData","payline","point","countSequence","checkWinnings","CorruptableText","setContent","randFrom","randomize","LocationLetter","ASCIICity","locationLettersRegex","letterMap","lineElems","elems","startI","endI","locationI","ListCity","locationButtons","LocationCity","ProgramsRoot","OptionsModal","setTheme","setInsertSpaces","setFontSize","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","paragraph","TerminalRoot","setKey","doScroll","hook","scrollIntoView","maxWait","TerminalInput","terminalInput","possibilities","setPossibilities","saveValue","moveTextCursor","inputLength","selectionStart","keyDown","fullWidth","autoComplete","inputRef","semiColonIndex","allPos","determineAllPossibilitiesForTabCompletion","tabCompletion","selectionEnd","mod","inputText","delStart","modifyInput","parentDirPath","evaledParentDirPath","addAllCodingContracts","cct","addAllLitFiles","addAllPrograms","addAllScripts","processFilepath","addAllTextFiles","addAllDirectories","subdirs","getSubdirectories","t_parentDirPath","convertParentPath","isCommand","cmd","t_cmd","addAllMessages","t_dir","processFile","subdir","remaining","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","ActiveScriptsRoot","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setFilter","setRowsPerPage","serverToScriptMap","filtered","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","disablePadding","noborder","WorkerScriptAccordion","killScript","onlineMps","onlineEps","FactionsRoot","openFaction","acceptInvitation","GangNames","MainPage","onAugmentations","sleevesOpen","setSleevesOpen","gangOpen","setGangOpen","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","startHackingContracts","startFieldWork","startSecurityWork","FactionRoot","purchasingAugs","setPurchasingAugs","routeToMainPage","AugmentationsPage","getAugs","switchSortOrder","newOrder","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","getAugsSorted","purchasable","purchaseableAugmentation","augListElems","ownedElem","Requirements","PurchaseableAugmentation","hasCost","btnTxt","PurchaseAugmentationModal","DonateOption","donateAmt","setDonateAmt","noformat","Info","CreateGangModal","CovenantPurchasesRoot","setUpdate","purchaseDisabled","upgradePanels","CovenantSleeveMemoryUpgrade","getPurchaseCost","maxMemory","purchaseBtnDisabled","purchaseBtnContent","LastEmployer","LastJob","Employers","Intelligence","bn5Stat","BladeburnerMults","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","parts","hacknetnode","hospitalization","infiltration","CharacterStats","moneyOpen","setMoneyOpen","timeRows","StockMarketRoot","Purchase4SMarketDataTixApiAccessButton","PurchaseWseAccountButton","PurchaseTixApiAccessButton","Purchase4SMarketDataButton","InfoAndPurchases","StockTickers","setTickerDisplayMode","AllStocks","watchlistSymbols","setWatchlistSymbols","tickers","stockMarketProp","rerenderAllTickers","sanitizedWatchlist","SelectorOrderType","StockTicker","setOrderType","Market","tickerOpen","setTicketOpen","modalProps","setModalProps","placeText","place","getQuantity","hasOrderAccess","Limit","Stop","getBuyTransactionCostContent","getSellTransactionCostContent","playerMoney","localesWithLongPriceFormat","StockTickerHeaderText","stockPriceFormat","spacesAllottedForStockPrice","spacesAfterStockName","spacesBeforePrice","hdrText","plusOrMinus","StockTickerOrderList","StockTickerOrder","posTxt","LongPosition","percentageGains","ShortPosition","StockTickerPositionText","PlaceOrderModal","level0","level1","level2","level3","BitNodePortal","portalOpen","setPortalOpen","bitNode","cssClass","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileFlags","PortalModal","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","cellNone","CharacterOverview","Element","getComputedStyle","visibility","checkGangApiAccess","getGangMember","wantedLevel","wantedLevelGainRate","cpy","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","recruited","memberName","getGangTask","equipName","equipment","engage","points","unassignFromTask","statWeight","respectMult","calc","difficultyPerCycles","getGainedAscensionPoints","getAscensionResults","applyUpgrade","respectToDeduct","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","asleeveNumber","aCrimeRoughName","auniversityName","aclassName","acityName","acompanyName","afactionName","aworkType","agymName","astat","sl","purchasableAugs","aaugName","bypass","doc","completely_unused_field","real_document","getHacknetNode","hi","maxNumNodes","hasUpgraded","timeOnline","getHashUpgradeLevel","makeScriptBlob","uurls","shouldCompile","_getScriptUrls","loadedModule","depScript","seen","urlStack","transformedCode","unmodified","suffix","importedScript","urls","ScriptUrl","full","empty","srcFile","sourceFileObject","incMult","decMult","normalServer","evaledDir","zip","JSZip","zipFn","generateAsync","FileSaver","saveAs","sanitizedExpr","used","avail","maxLength","usedPercent","numArgs","incorrectUsage","newPath","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","dest","parsedFn","firstParentDir","msgOrLit","postSegments","segments","filesPerRow","groups","numThreads","sourcePath","destPath","destFile","rsObj","delTarget","executableName","runContract","runProgram","commandArgs","runArgs","permissive","threadFlag","tailFlag","hasRoot","maxHostname","maxIP","tRes","sRes","candidates","args2","candidate","headers","currRunningScripts","numSpacesScript","spacesScript","numSpacesPid","spacesPid","numSpacesThread","spacesThread","tampering","last","minute","timeCompression","ReactDOM"],"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,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DAElB,OAAOtG,EAAK+0B,QAGP,SAAS80D,EAA2B90D,GACzC,IAAKj5C,KAAKokB,SAAU,OAAO,EAC3B,MAAMF,EAAOlkB,KAAKkkB,KAClB,GAAa,OAATA,EACF,MAAM,IAAIsG,MAAM,4DAElB,OAAOtG,EAAK+0B,UAAYA,EAGnB,SAAS70B,IACd,OAAiB,MAAbpkB,KAAKkkB,MAA6BoG,MAAbtqB,KAAKkkB,MAIvBlkB,KAAKkkB,gBAAgBg5C,IAGvB,SAAS8wC,EAAyB/7E,EAAqBg8E,GAC5DjuG,KAAKkkB,KAAO,IAAIg5C,IAAKjrC,EAAag8E,GAElC,MAAMn3E,EAAMxF,IAASW,GACrB,GAAW,MAAP6E,EACF,MAAM,IAAItM,MAAO,4CAA2CyH,GAE9D6E,EAAIsT,iBAAmB,I,wCC/DzB,kCAIO,MAAMy0D,EAA4D,CAEvE,EAAK,CACH,EACA,KACA,SACA,8JAKF,EAAK,CACH,EACA,KACA,eACA,wIAKF,EAAK,CACH,EACA,IACA,2BACA,uKAKF,EAAK,CACH,EACA,IACA,4BACA,8MAIF,EAAK,CACH,EACA,KACA,UACA,+LAIF,EAAK,CACH,EACA,KACA,mBACA,gJAGF,EAAK,CACH,EACA,KACA,yBACA,8H,6BC5DJ,kCAIO,MAAMC,EAAgD,CAE3D,EAAK,CACH,EACA,IACA,KACA,IACA,kBACA,kKAKF,EAAK,CACH,EACA,IACA,KACA,GACA,gBACA,kKAKF,EAAK,CACH,EACA,IACA,IACA,KACA,aACA,4TAQF,EAAK,CACH,EACA,IACA,IACA,KACA,mBACA,sKAMF,EAAK,CACH,EACA,IACA,KACA,GACA,wCACA,gLAMF,EAAK,CACH,EACA,IACA,KACA,GACA,4BACA,kKAKF,EAAK,CACH,EACA,IACA,KACA,GACA,sBACA,wKAMF,EAAK,CACH,EACA,IACA,KACA,GACA,aACA,6JAKF,EAAK,CACH,EACA,IACA,KACA,IACA,gBACA,4LAMF,EAAK,CACH,EACA,IACA,KACA,IAC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AMjpD,UAAUk3E,QAAQz2E,MAAMqE,KAAK6vG,WAAYqF,YAExDl1G,KAAKsuH,2BAA2BtuH,KAAK2sH,MAAO,UAAWL,GAEvDA,EAAU,SAAUyD,EAAeC,GACjC,OAAO7rE,MAAMjpD,UAAU29D,YAAYl9D,MAAMqE,KAAK6vG,WAAYqF,YAE5Dl1G,KAAKsuH,2BAA2BtuH,KAAK2sH,MAAO,cAAeL,GAE3DA,EAAU,WAER,OADAnoE,MAAMjpD,UAAUyxB,KAAKvxB,KAAK4E,KAAK6vG,YACxB7vG,MAETA,KAAKsuH,2BAA2BtuH,KAAK2sH,MAAO,OAAQL,GAEpDtsH,KAAKwpH,WAAWluH,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,OACA,IACA,YACA,IACA,MAIA,mDACA,8CACA,0CACA,kEACA,4DACA,gCACA,wBACA,WACA,oCACA,kBACA,kEACA,IACA,kBACA,IACA,yBACA,mDACA,IACA,gBACA,IACA,MAIA,wDACA,8CACA,0CACA,yGACA,kEACA,+BACA,wBACA,WACA,mCACA,eACA,kEACA,IACA,kBACA,IACA,wBACA,mDACA,IACA,gBACA,IACA,MAIA,iDACA,8CACA,+BACA,6DACA,wBACA,4BACA,+DACA,kCACA,iDACA,eACA,IACA,IACA,gBACA,IACA,MAEA,gBACA,oCACA,8CAEA,wCACA,2BACA,IAEA,0CACA,mBACA,kDACA,4CACA,sBACA,yBACA,sBACA,aACA,IACA,IACA,uBACA,IACA,eACA,KACA,QAEA,2DACA,8CACA,eACA,gBACA,0CACA,wFACA,IACA,wBACA,IACA,MACA,KAQJ+0E,EAAYn1E,UAAUswH,WAAa,SAAUj8C,GAC3C,IACI+8C,EADAN,EAAkBhsH,KAGtBssH,EAAU,SAAUhvH,GAElB,OADAA,EAAQqlE,OAAOrlE,GACX0uH,EAAgBmB,iBAElBntH,KAAKxF,KAAO8C,EACL0C,MAGA1C,GAGX0C,KAAKiwH,OAASjwH,KAAKkwE,qBAAqBo8C,GAAS,GACjDtsH,KAAKgwE,YAAYT,EAAO,SAAUvvE,KAAKiwH,QAGvCjwH,KAAKgwE,YACHhwE,KAAKiwH,OACL,eACAjwH,KAAKkwE,qBAAqBvN,OAAOutD,cAAc,GAC/C7/C,EAAYg6C,0BAoBd,IAfA,IAAIjW,EAAY,CACd,SACA,aACA,SACA,UACA,cACA,QACA,SACA,YACA,oBACA,oBACA,cACA,cACA,QAEOt5G,EAAI,EAAGA,EAAIs5G,EAAUp5G,OAAQF,IACpCkF,KAAKsuH,2BAA2BtuH,KAAKiwH,OAAQ7b,EAAUt5G,GAAI6nE,OAAOznE,UAAUk5G,EAAUt5G,KAGxFwxH,EAA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5tB,KAAKoH,WAAWixG,IAErBzqF,EAAK5tB,KAAKq4G,GAGZv2B,EAAQtiF,EAAI,IAEZA,EAIJ,GAAIsiF,IAAUtiF,EAAG,CACf,MAAM64G,EAAMx2B,EAAQG,OAAOF,EAAOtiF,EAAIsiF,GAGlCgrD,EAASz0B,GACXzqF,EAAK5tB,KAAKoH,WAAWixG,IAErBzqF,EAAK5tB,KAAKq4G,GAId,OAAOzqF,I,6BC5HT,oEAGO,MAAM0/G,EAA6B,CACxC,oDACA,GACA,0EACA,kFACA,kFACA,+EACA,0EACA,iEACA,yEACA,uEACA,4DACA,mEACA,wFACA,0EACA,8EACA,+GACA,gEACA,8FACA,gEACA,4EACA,yFACA,wFACA,yEACA,uFACA,6FACA,yEACA,4FACA,sFACA,qEACA,mEACA,4FACA,6FACA,6EACA,2FACA,sFACA,wFACA,mEACA,uEACA,8EAGWC,EAA4B,CACvCz/D,MAAO,CACL,6BACA,IACA,4FACA,uGACA,yHACA,kGACA,IACA,4BACA,IACA,mHACA,yHACA,4CACA,IACA,4BACA,IACA,6DACA,IACA,WACA,IACA,2HACA,4HACA,IACA,+BACA,IACA,8GACA,IACA,uHACA,uCACA,IACA,uDACA,KAEF0/D,QAAS,CACP,SACA,IACA,0GACA,mHACA,kHACA,iCAEFC,SAAU,CACR,WACA,IACA,6FACA,IACA,+BACA,KAEF9hF,IAAK,CACH,qBACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,yGAEF+hF,IAAK,CACH,aACA,IACA,6EACA,IACA,aACA,IACA,cACA,IACA,mBAEFjoC,GAAI,CACF,WACA,IACA,yGACA,iFACA,IACA,qBACA,IACA,WACA,IACA,UAEFkoC,MAAO,CACL,gCACA,IACA,+HACA,uDACA,kIACA,IACA,gCACA,IACA,gGACA,IACA,mCAEF7oH,MAAO,CACL,QACA,IACA,mIACA,wIAEFwhH,IAAK,CACH,MACA,IACA,mIACA,0IAEFhgH,QAAS,CACP,qBACA,IACA,6GACA,sIACA,kEAEF6pE,SAAU,CACR,8BACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEFy9C,KAAM,CACJ,iCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,oBACA,IACA,sFAEFC,KAAM,CACJ,OACA,IACA,iIACA,iCAEF3tH,KAAM,CACJ,OACA,GACA,6GACA,4CAEF3F,KAAM,CACJ,OACA,IACA,uHACA,KAEFgsH,KAAM,CACJ,iBACA,IACA,yHACA,0HACA,mEACA,IACA,aACA,IACA,qBAEF37F,KAAM,CACJ,2GAEF9X,SAAU,CAAC,WAAY,IAAK,6CAC5BzR,KAAM,CACJ,+BACA,IACA,aACA,IACA,4EACA,IACA,6EACA,4EACA,iFACA,4DACA,IACA,mCACA,IACA,qEACA,IACA,oCACA,IACA,sFAEFC,QAAS,CACP,UACA,IACA,4CACA,2HACA,uHACA,4EAEFG,GAAI,CACF,4BACA,IACA,iIACA,sDACA,IACA,8FACA,IACA,yHACA,IACA,YACA,IACA,wEACA,IACA,oBACA,IACA,iEACA,IACA,kBACA,IACA,uFACA,IACA,8BAEFqsH,MAAO,CAAC,QAAS,IAAK,yDAEtBC,IAAK,CACH,qCACA,IACA,6HACA,2HACA,gFACA,IACA,iBACA,IACA,uBACA,IACA,4HACA,kFAEFp4E,GAAI,CACF,kBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,iEACA,IACA,iCAEFq4E,KAAM,CACJ,mBACA,IACA,sGACA,2FACA,mBAEFtsH,GAAI,CAAC,KAAM,IAAK,6DAEhBsD,GAAI,CACF,YACA,IACA,6GACA,IACA,mDAEF9D,IAAK,CACH,+CACA,IACA,iCACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEFrB,KAAM,CACJ,OACA,IACA,6HACA,4CAEF,eAAgB,CACd,4BACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,yGACA,UACA,IACA,2GACA,uEAEF2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D,CAAYlO,MAAO,CAAEC,UAAW,eAAiBrnE,IAEnD,kBAAC,IAAD,CAAMq1E,MAAI,EAACC,GAAI,GACb,kBAAC,IAAD,KACGqkF,EACD,kBAAC,IAAD,SAkBV,MAAMF,EAAQ,CACZ,YACA,SACA,MACA,cACA,QACA,SACA,YACA,SACA,MACA,OACA,SACA,OACA,UACA,WACA,OACA,YACA,UACA,SACA,MACA,MACA,OACA,QACA,YACA,UACA,KACA,SACA,SACA,YACA,QACA,YACA,UACA,UACA,WACA,WACA,YACA,SACA,OACA,MACA,aACA,aACA,YACA,OACA,SACA,WACA,QACA,aACA,SACA,UACA,cACA,UACA,OACA,MACA,WACA,SACA,cACA,MACA,aACA,WACA,OACA,MACA,UACA,QACA,WACA,UACA,aACA,QACA,UACA,MACA,OACA,SACA,WACA,WACA,UACA,QACA,cACA,cACA,YACA,SACA,OACA,SACA,QACA,WACA,WACA,WACA,OACA,SACA,WACA,YACA,OACA,OACA,YACA,YACA,OACA,QACA,UACA,YACA,WACA,aACA,YACA,OACA,WACA,WACA,SACA,MACA,WACA,UACA,SACA,gBACA,OACA,QACA,UACA,QACA,QACA,UACA,YACA,QACA,YACA,UACA,QACA,SACA,SACA,QACA,UACA,cACA,QACA,aACA,MACA,UACA,OACA,WACA,WACA,UACA,SACA,aACA,YACA,SACA,SACA,SACA,OACA,WACA,QACA,OACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,SACA,QACA,UACA,UACA,UACA,UACA,aACA,WACA,QACA,SACA,MACA,WACA,SACA,aACA,UACA,MACA,OACA,SACA,UACA,OACA,OACA,UACA,SACA,aACA,SACA,SACA,SACA,SACA,SACA,WACA,SACA,YACA,QACA,QACA,YACA,WACA,oBACA,WACA,OACA,UACA,cACA,UACA,SACA,UACA,gBACA,OACA,SACA,QACA,MACA,WACA,WACA,WACA,cACA,SACA,UACA,QACA,eACA,WACA,OACA,OACA,SACA,MACA,OACA,iBACA,WACA,UACA,UACA,UACA,iBACA,QACA,MACA,YACA,U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qBHwhG,GAlBF,WACE,GAAIxsL,IAAOoB,SAAS2lC,SAAS6jD,IAAQK,iBAAkB,OAEvD,IAAIwhG,GAAO,IAAI/mJ,MAAOC,UAWtB9lC,OAAOmrE,YAVP,SAAS0hH,IACP,MAAMhgG,GAAM,IAAIhnD,MAAOC,UACnB+mD,EAAM+/F,EAAO,IAEfzsL,IAAOi7C,YAAY2vC,IAAQK,kBAG7BwhG,EAAO//F,EACP7sF,OAAOmrE,WAAW0hH,EAAQ,QAEF,KAK1BC,K,0FCjCF,+DAaA,SAASxuH,IACP44B,cACA61F,IAASvhB,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFz/F,SAASy9B,eAAe,SAb5BujF,IAASvhB,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFz/F,SAASy9B,eAAe,SAcxBvS,IAAYz4B,UAAUF","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\t1: 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([1225,0]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { Corporation } from \"./Corporation/Corporation\";\nimport { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { sanitizeExploits } from \"./Exploits/Exploit\";\n\nimport { Reviver } from \"./utils/JSONReviver\";\n\nimport Decimal from \"decimal.js\";\n\nexport let Player = new PlayerObject();\n\nexport function loadPlayer(saveString: string): void {\n Player = JSON.parse(saveString, Reviver);\n\n // Parse Decimal.js objects\n Player.money = new Decimal(Player.money);\n\n if (Player.corporation instanceof Corporation) {\n Player.corporation.funds = new Decimal(Player.corporation.funds);\n Player.corporation.revenue = new Decimal(Player.corporation.revenue);\n Player.corporation.expenses = new Decimal(Player.corporation.expenses);\n\n for (let i = 0; i < Player.corporation.divisions.length; ++i) {\n const ind = Player.corporation.divisions[i];\n ind.lastCycleRevenue = new Decimal(ind.lastCycleRevenue);\n ind.lastCycleExpenses = new Decimal(ind.lastCycleExpenses);\n ind.thisCycleRevenue = new Decimal(ind.thisCycleRevenue);\n ind.thisCycleExpenses = new Decimal(ind.thisCycleExpenses);\n }\n }\n\n Player.exploits = sanitizeExploits(Player.exploits);\n}\n","import numeral from \"numeral\";\nimport \"numeral/locales/bg\";\nimport \"numeral/locales/cs\";\nimport \"numeral/locales/da-dk\";\nimport \"numeral/locales/de\";\nimport \"numeral/locales/en-au\";\nimport \"numeral/locales/en-gb\";\nimport \"numeral/locales/es\";\nimport \"numeral/locales/fr\";\nimport \"numeral/locales/hu\";\nimport \"numeral/locales/it\";\nimport \"numeral/locales/lv\";\nimport \"numeral/locales/no\";\nimport \"numeral/locales/pl\";\nimport \"numeral/locales/ru\";\n\n/* eslint-disable class-methods-use-this */\n\nconst extraFormats = [1e15, 1e18, 1e21, 1e24, 1e27, 1e30];\nconst extraNotations = [\"q\", \"Q\", \"s\", \"S\", \"o\", \"n\"];\n\nclass NumeralFormatter {\n // Default Locale\n defaultLocale = \"en\";\n\n constructor() {\n this.defaultLocale = \"en\";\n }\n\n updateLocale(l: string): boolean {\n if (numeral.locale(l) == null) {\n console.warn(`Invalid locale for numeral: ${l}`);\n\n numeral.locale(this.defaultLocale);\n return false;\n }\n return true;\n }\n\n format(n: number, format: string): string {\n // numeraljs doesnt properly format numbers that are too big or too small\n if (Math.abs(n) < 1e-6) {\n n = 0;\n }\n const answer = numeral(n).format(format);\n if (answer === \"NaN\") {\n return `${n}`;\n }\n return answer;\n }\n\n formatBigNumber(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n // TODO: leverage numeral.js to do it. This function also implies you can\n // use this format in some text field but you can't. ( \"1t\" will parse but\n // \"1s\" will not)\n formatReallyBigNumber(n: number, decimalPlaces = 3): string {\n if (n === Infinity) return \"∞\";\n for (let i = 0; i < extraFormats.length; i++) {\n if (extraFormats[i] < n && n <= extraFormats[i] * 1000) {\n return this.format(n / extraFormats[i], \"0.\" + \"0\".repeat(decimalPlaces)) + extraNotations[i];\n }\n }\n if (Math.abs(n) < 1000) {\n return this.format(n, \"0.\" + \"0\".repeat(decimalPlaces));\n }\n const str = this.format(n, \"0.\" + \"0\".repeat(decimalPlaces) + \"a\");\n if (str === \"NaNt\") return this.format(n, \"0.\" + \" \".repeat(decimalPlaces) + \"e+0\");\n return str;\n }\n\n formatHp(n: number): string {\n if (n < 1e6) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatMoney(n: number): string {\n return \"$\" + this.formatReallyBigNumber(n);\n }\n\n formatSkill(n: number): string {\n if (n < 1e15) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatExp(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatHashes(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatReputation(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatFavor(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatRAM(n: number): string {\n if (n < 1e3) return this.format(n, \"0.00\") + \"GB\";\n if (n < 1e6) return this.format(n / 1e3, \"0.00\") + \"TB\";\n if (n < 1e9) return this.format(n / 1e6, \"0.00\") + \"PB\";\n if (n < 1e12) return this.format(n / 1e9, \"0.00\") + \"EB\";\n return this.format(n, \"0.00\") + \"GB\";\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 parseMoney(s: string): number {\n // numeral library does not handle formats like 1e10 well (returns 110),\n // so if both return a valid number, return the biggest one\n const numeralValue = numeral(s).value();\n const parsed = parseFloat(s);\n if (isNaN(parsed) && numeralValue === null) {\n return NaN;\n } else if (isNaN(parsed)) {\n return numeralValue;\n } else if (numeralValue === null) {\n return parsed;\n } else {\n return Math.max(numeralValue, parsed);\n }\n }\n}\n\nexport const numeralWrapper = new NumeralFormatter();\n","import { IMap } from \"../../types\";\n\nexport const AugmentationNames: IMap<string> = {\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 BranchiBlades Upgrade\",\n GrapheneBionicArms: \"Graphene Bionic Arms Upgrade\",\n BrachiBlades: \"BrachiBlades\",\n BionicArms: \"Bionic Arms\",\n SNA: \"Social Negotiation Assistant (S.N.A)\",\n HydroflameLeftArm: \"Hydroflame Left Arm\",\n EsperEyewear: \"EsperTech Bladeburner Eyewear\",\n EMS4Recombination: \"EMS-4 Recombination\",\n OrionShoulder: \"ORION-MKIV Shoulder\",\n HyperionV1: \"Hyperion Plasma Cannon V1\",\n HyperionV2: \"Hyperion Plasma Cannon V2\",\n GolemSerum: \"GOLEM Serum\",\n VangelisVirus: \"Vangelis Virus\",\n VangelisVirus3: \"Vangelis Virus 3.0\",\n INTERLINKED: \"I.N.T.E.R.L.I.N.K.E.D\",\n BladeRunner: \"Blade's Runners\",\n BladeArmor: \"BLADE-51b Tesla Armor\",\n BladeArmorPowerCells: \"BLADE-51b Tesla Armor: Power Cells Upgrade\",\n BladeArmorEnergyShielding: \"BLADE-51b Tesla Armor: Energy Shielding Upgrade\",\n BladeArmorUnibeam: \"BLADE-51b Tesla Armor: Unibeam Upgrade\",\n BladeArmorOmnibeam: \"BLADE-51b Tesla Armor: Omnibeam Upgrade\",\n BladeArmorIPU: \"BLADE-51b Tesla Armor: IPU Upgrade\",\n BladesSimulacrum: \"The Blade's Simulacrum\",\n\n //Wasteland Augs\n //PepBoy: \"P.E.P-Boy\", Plasma Energy Projection System\n //PepBoyForceField Generates plasma force fields\n //PepBoyBlasts Generate high density plasma concussive blasts\n //PepBoyDataStorage STore more data on pep boy,\n};\n","/**\n * Generic Game Constants\n *\n * Constants for specific mechanics or features will NOT be here.\n */\nexport const CONSTANTS: {\n Version: string;\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 InfiltrationBribeBaseAmount: number;\n InfiltrationMoneyValue: number;\n InfiltrationRepValue: number;\n InfiltrationExpPow: number;\n WSEAccountCost: number;\n TIXAPICost: number;\n MarketData4SCost: number;\n MarketDataTixApi4SCost: number;\n StockMarketCommission: number;\n HospitalCostPerHp: number;\n IntelligenceCrimeWeight: number;\n IntelligenceInfiltrationWeight: number;\n IntelligenceCrimeBaseExpGain: number;\n IntelligenceProgramBaseExpGain: number;\n IntelligenceTerminalHackBaseExpGain: number;\n IntelligenceSingFnBaseExpGain: number;\n IntelligenceClassBaseExpGain: number;\n MillisecondsPer20Hours: number;\n GameCyclesPer20Hours: number;\n MillisecondsPer10Hours: number;\n GameCyclesPer10Hours: number;\n MillisecondsPer8Hours: number;\n GameCyclesPer8Hours: number;\n MillisecondsPer4Hours: number;\n GameCyclesPer4Hours: number;\n MillisecondsPer2Hours: number;\n GameCyclesPer2Hours: number;\n MillisecondsPerHour: number;\n GameCyclesPerHour: number;\n MillisecondsPerHalfHour: number;\n GameCyclesPerHalfHour: number;\n MillisecondsPerQuarterHour: number;\n GameCyclesPerQuarterHour: number;\n MillisecondsPerFiveMinutes: number;\n GameCyclesPerFiveMinutes: number;\n FactionWorkHacking: string;\n FactionWorkField: string;\n FactionWorkSecurity: string;\n WorkTypeCompany: string;\n WorkTypeCompanyPartTime: string;\n WorkTypeFaction: string;\n WorkTypeCreateProgram: string;\n WorkTypeStudyClass: string;\n WorkTypeCrime: string;\n ClassStudyComputerScience: string;\n ClassDataStructures: string;\n ClassNetworks: string;\n ClassAlgorithms: string;\n ClassManagement: string;\n ClassLeadership: string;\n ClassGymStrength: string;\n ClassGymDefense: string;\n ClassGymDexterity: string;\n ClassGymAgility: string;\n ClassDataStructuresBaseCost: number;\n ClassNetworksBaseCost: number;\n ClassAlgorithmsBaseCost: number;\n ClassManagementBaseCost: number;\n ClassLeadershipBaseCost: number;\n ClassGymBaseCost: number;\n ClassStudyComputerScienceBaseExp: number;\n ClassDataStructuresBaseExp: number;\n ClassNetworksBaseExp: number;\n ClassAlgorithmsBaseExp: number;\n ClassManagementBaseExp: number;\n ClassLeadershipBaseExp: number;\n CrimeShoplift: string;\n CrimeRobStore: string;\n CrimeMug: string;\n CrimeLarceny: string;\n CrimeDrugs: string;\n CrimeBondForgery: string;\n CrimeTraffickArms: string;\n CrimeHomicide: string;\n CrimeGrandTheftAuto: string;\n CrimeKidnap: string;\n CrimeAssassination: string;\n CrimeHeist: string;\n CodingContractBaseFactionRepGain: number;\n CodingContractBaseCompanyRepGain: number;\n CodingContractBaseMoneyGain: number;\n TotalNumBitNodes: number;\n LatestUpdate: string;\n} = {\n Version: \"0.55.0\",\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 // Infiltration\n InfiltrationBribeBaseAmount: 100e3, //Amount per clearance level\n InfiltrationMoneyValue: 5e3, //Convert \"secret\" value to money\n InfiltrationRepValue: 1.4, //Convert \"secret\" value to faction reputation\n InfiltrationExpPow: 0.8,\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: 2.5, // Program required hack level divided by this to determine int exp gain\n IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain\n IntelligenceSingFnBaseExpGain: 1.5,\n IntelligenceClassBaseExpGain: 0.01,\n\n // Time-related constants\n MillisecondsPer20Hours: 72000000,\n GameCyclesPer20Hours: 72000000 / 200,\n\n MillisecondsPer10Hours: 36000000,\n GameCyclesPer10Hours: 36000000 / 200,\n\n MillisecondsPer8Hours: 28800000,\n GameCyclesPer8Hours: 28800000 / 200,\n\n MillisecondsPer4Hours: 14400000,\n GameCyclesPer4Hours: 14400000 / 200,\n\n MillisecondsPer2Hours: 7200000,\n GameCyclesPer2Hours: 7200000 / 200,\n\n MillisecondsPerHour: 3600000,\n GameCyclesPerHour: 3600000 / 200,\n\n MillisecondsPerHalfHour: 1800000,\n GameCyclesPerHalfHour: 1800000 / 200,\n\n MillisecondsPerQuarterHour: 900000,\n GameCyclesPerQuarterHour: 900000 / 200,\n\n MillisecondsPerFiveMinutes: 300000,\n GameCyclesPerFiveMinutes: 300000 / 200,\n\n // Player Work & Action\n BaseFocusBonus: 0.8,\n FactionWorkHacking: \"Faction Hacking Work\",\n FactionWorkField: \"Faction Field Work\",\n FactionWorkSecurity: \"Faction Security Work\",\n\n WorkTypeCompany: \"Working for Company\",\n WorkTypeCompanyPartTime: \"Working for Company part-time\",\n WorkTypeFaction: \"Working for Faction\",\n WorkTypeCreateProgram: \"Working on Create a Program\",\n WorkTypeStudyClass: \"Studying or Taking a class at university\",\n WorkTypeCrime: \"Committing a crime\",\n\n ClassStudyComputerScience: \"studying Computer Science\",\n ClassDataStructures: \"taking a Data Structures course\",\n ClassNetworks: \"taking a Networks course\",\n ClassAlgorithms: \"taking an Algorithms course\",\n ClassManagement: \"taking a Management course\",\n ClassLeadership: \"taking a Leadership course\",\n ClassGymStrength: \"training your strength at a gym\",\n ClassGymDefense: \"training your defense at a gym\",\n ClassGymDexterity: \"training your dexterity at a gym\",\n ClassGymAgility: \"training your agility at a gym\",\n\n ClassDataStructuresBaseCost: 40,\n ClassNetworksBaseCost: 80,\n ClassAlgorithmsBaseCost: 320,\n ClassManagementBaseCost: 160,\n ClassLeadershipBaseCost: 320,\n ClassGymBaseCost: 120,\n\n ClassStudyComputerScienceBaseExp: 0.5,\n ClassDataStructuresBaseExp: 1,\n ClassNetworksBaseExp: 2,\n ClassAlgorithmsBaseExp: 4,\n ClassManagementBaseExp: 2,\n ClassLeadershipBaseExp: 4,\n\n CrimeShoplift: \"shoplift\",\n CrimeRobStore: \"rob a store\",\n CrimeMug: \"mug someone\",\n CrimeLarceny: \"commit larceny\",\n CrimeDrugs: \"deal drugs\",\n CrimeBondForgery: \"forge corporate bonds\",\n CrimeTraffickArms: \"traffick illegal arms\",\n CrimeHomicide: \"commit homicide\",\n CrimeGrandTheftAuto: \"commit grand theft auto\",\n CrimeKidnap: \"kidnap someone for ransom\",\n CrimeAssassination: \"assassinate a high-profile target\",\n CrimeHeist: \"pull off the ultimate heist\",\n\n // Coding Contract\n // TODO: Move this into Coding contract implementation?\n CodingContractBaseFactionRepGain: 2500,\n CodingContractBaseCompanyRepGain: 4000,\n CodingContractBaseMoneyGain: 75e6,\n\n // BitNode/Source-File related stuff\n TotalNumBitNodes: 24,\n\n LatestUpdate: `\n v0.55.0 - 2021-09-20 Material UI (hydroflame & community)\n -------------------------------------------\n\n ** Global ** \n\n * The game is now 100% in typescript, react, and Material-UI\n\n ** Misc. **\n\n * Corporations can no longer bribe special factions\n * Infiltration can no longer lose focus of the keyboard.\n * Fix terminal line limit\n * Added theme editor\n * Theme applies on game load (@Nolshine)\n * Sleeves no longer consume all bonus time for some actions\n * Fix a bug where the autocomlete list would get duplicates\n * Fix tutorial not scaling properly on small screens\n * Import should be more consistent\n * Typo with 'help' command\n * Fix infinite loop in casino\n * nerf noodle bar\n`,\n\n /*\n\n\n*/\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 */\ninterface IBitNodeMultipliers {\n /**\n * Influences how quickly the player's agility level (not exp) scales\n */\n AgilityLevelMultiplier: number;\n\n /**\n * Influences the base cost to purchase an augmentation.\n */\n AugmentationMoneyCost: number;\n\n /**\n * Influences the base rep the player must have with a faction to purchase an augmentation.\n */\n AugmentationRepCost: number;\n\n /**\n * Influences how quickly the player can gain rank within Bladeburner.\n */\n BladeburnerRank: number;\n\n /**\n * Influences the cost of skill levels from Bladeburner.\n */\n BladeburnerSkillCost: number;\n\n /**\n * Influences how quickly the player's charisma level (not exp) scales\n */\n CharismaLevelMultiplier: number;\n\n /**\n * Influences the experience gained for each ability when a player completes a class.\n */\n ClassGymExpGain: number;\n\n /**\n * Influences the amount of money gained from completing Coding Contracts\n **/\n CodingContractMoney: number;\n\n /**\n * Influences the experience gained for each ability when the player completes working their job.\n */\n CompanyWorkExpGain: number;\n\n /**\n * Influences how much money the player earns when completing working their job.\n */\n CompanyWorkMoney: number;\n\n /**\n * Influences the valuation of corporations created by the player.\n */\n CorporationValuation: number;\n\n /**\n * Influences the base experience gained for each ability when the player commits a crime.\n */\n CrimeExpGain: number;\n\n /**\n * Influences the base money gained when the player commits a crime.\n */\n CrimeMoney: number;\n\n /**\n * Influences how many Augmentations you need in order to get invited to the Daedalus faction\n */\n DaedalusAugsRequirement: number;\n\n /**\n * Influences how quickly the player's defense level (not exp) scales\n */\n DefenseLevelMultiplier: number;\n\n /**\n * Influences how quickly the player's dexterity level (not exp) scales\n */\n DexterityLevelMultiplier: number;\n\n /**\n * Influences how much rep the player gains in each faction simply by being a member.\n */\n FactionPassiveRepGain: number;\n\n /**\n * Influences the experience gained for each ability when the player completes work for a Faction.\n */\n FactionWorkExpGain: number;\n\n /**\n * Influences how much rep the player gains when performing work for a faction.\n */\n FactionWorkRepGain: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data API\n */\n FourSigmaMarketDataApiCost: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data (NOT API)\n */\n FourSigmaMarketDataCost: number;\n\n /**\n * Influences how much negative karma is required to create a gang in this bitnode.\n */\n GangKarmaRequirement: 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 * 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 // Index signature\n [key: string]: number;\n}\n\n/**\n * The multipliers that are influenced by current Bitnode progression.\n */\n// tslint:disable-next-line:variable-name\nexport const BitNodeMultipliers: IBitNodeMultipliers = {\n HackingLevelMultiplier: 1,\n StrengthLevelMultiplier: 1,\n DefenseLevelMultiplier: 1,\n DexterityLevelMultiplier: 1,\n AgilityLevelMultiplier: 1,\n CharismaLevelMultiplier: 1,\n\n ServerGrowthRate: 1,\n ServerMaxMoney: 1,\n ServerStartingMoney: 1,\n ServerStartingSecurity: 1,\n ServerWeakenRate: 1,\n\n HomeComputerRamCost: 1,\n\n PurchasedServerCost: 1,\n 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\n BladeburnerRank: 1,\n BladeburnerSkillCost: 1,\n\n DaedalusAugsRequirement: 1,\n GangKarmaRequirement: 1,\n};\n","/**\n * Names of all locations\n */\nexport enum LocationName {\n // Cities\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n\n // Aevum Locations\n AevumAeroCorp = \"AeroCorp\",\n AevumBachmanAndAssociates = \"Bachman & Associates\",\n AevumClarkeIncorporated = \"Clarke Incorporated\",\n AevumCrushFitnessGym = \"Crush Fitness Gym\",\n AevumECorp = \"ECorp\",\n AevumFulcrumTechnologies = \"Fulcrum Technologies\",\n AevumGalacticCybersystems = \"Galactic Cybersystems\",\n AevumNetLinkTechnologies = \"NetLink Technologies\",\n AevumPolice = \"Aevum Police Headquarters\",\n AevumRhoConstruction = \"Rho Construction\",\n AevumSnapFitnessGym = \"Snap Fitness Gym\",\n AevumSummitUniversity = \"Summit University\",\n AevumWatchdogSecurity = \"Watchdog Security\",\n AevumCasino = \"Iker Molina Casino\",\n\n // Chongqing locations\n ChongqingKuaiGongInternational = \"KuaiGong International\",\n ChongqingSolarisSpaceSystems = \"Solaris Space Systems\",\n ChongqingChurchOfTheMachineGod = \"Church of the Machine God\",\n\n // Sector 12\n Sector12AlphaEnterprises = \"Alpha Enterprises\",\n Sector12BladeIndustries = \"Blade Industries\",\n Sector12CIA = \"Central Intelligence Agency\",\n Sector12CarmichaelSecurity = \"Carmichael Security\",\n Sector12CityHall = \"Sector-12 City Hall\",\n Sector12DeltaOne = \"DeltaOne\",\n Sector12FoodNStuff = \"FoodNStuff\",\n Sector12FourSigma = \"Four Sigma\",\n Sector12IcarusMicrosystems = \"Icarus Microsystems\",\n Sector12IronGym = \"Iron Gym\",\n Sector12JoesGuns = \"Joe's Guns\",\n Sector12MegaCorp = \"MegaCorp\",\n Sector12NSA = \"National Security Agency\",\n Sector12PowerhouseGym = \"Powerhouse Gym\",\n Sector12RothmanUniversity = \"Rothman University\",\n Sector12UniversalEnergy = \"Universal Energy\",\n\n // New Tokyo\n NewTokyoDefComm = \"DefComm\",\n NewTokyoGlobalPharmaceuticals = \"Global Pharmaceuticals\",\n NewTokyoNoodleBar = \"Noodle Bar\",\n NewTokyoVitaLife = \"VitaLife\",\n\n // Ishima\n IshimaNovaMedical = \"Nova Medical\",\n IshimaOmegaSoftware = \"Omega Software\",\n IshimaStormTechnologies = \"Storm Technologies\",\n\n // Volhaven\n VolhavenCompuTek = \"CompuTek\",\n VolhavenHeliosLabs = \"Helios Labs\",\n VolhavenLexoCorp = \"LexoCorp\",\n VolhavenMilleniumFitnessGym = \"Millenium Fitness Gym\",\n VolhavenNWO = \"NWO\",\n VolhavenOmniTekIncorporated = \"OmniTek Incorporated\",\n VolhavenOmniaCybersystems = \"Omnia Cybersystems\",\n VolhavenSysCoreSecurities = \"SysCore Securities\",\n VolhavenZBInstituteOfTechnology = \"ZB Institute of Technology\",\n\n // Generic locations\n Hospital = \"Hospital\",\n Slums = \"The Slums\",\n TravelAgency = \"Travel Agency\",\n WorldStockExchange = \"World Stock Exchange\",\n\n // Default name for Location objects\n Void = \"The Void\",\n}\n","import { ISelfInitializer, ISelfLoading } from \"../types\";\nimport { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from \"./SettingEnums\";\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 * Enable bash hotkeys\n */\n EnableBashHotkeys: boolean;\n\n /**\n * Enable timestamps\n */\n EnableTimestamps: boolean;\n\n /**\n * Locale used for display numbers\n */\n Locale: string;\n\n /**\n * Limit the number of log entries for each script being executed on each server.\n */\n MaxLogCapacity: number;\n\n /**\n * Limit how many entries can be written to a Netscript Port before entries start to get pushed out.\n */\n MaxPortCapacity: number;\n\n /**\n * Limit the number of entries in the terminal.\n */\n MaxTerminalCapacity: number;\n\n /**\n * Save the game when you save any file.\n */\n SaveGameOnFileSave: boolean;\n\n /**\n * Whether the player should be asked to confirm purchasing each and every augmentation.\n */\n SuppressBuyAugmentationConfirmation: boolean;\n\n /**\n * Whether the user should be prompted to join each faction via a dialog box.\n */\n SuppressFactionInvites: boolean;\n\n /**\n * Whether to show a popup message when player is hospitalized from taking too much damage\n */\n SuppressHospitalizationPopup: 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 * Theme colors\n */\n theme: {\n [key: string]: string | undefined;\n primarylight: string;\n primary: string;\n primarydark: 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 };\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\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 EnableBashHotkeys: false,\n EnableTimestamps: false,\n Locale: \"en\",\n MaxLogCapacity: 50,\n MaxPortCapacity: 50,\n MaxTerminalCapacity: 200,\n SaveGameOnFileSave: true,\n SuppressBuyAugmentationConfirmation: false,\n SuppressFactionInvites: false,\n SuppressHospitalizationPopup: false,\n SuppressMessages: false,\n SuppressTravelConfirmation: false,\n SuppressBladeburnerPopup: false,\n\n theme: {\n primarylight: \"#0f0\",\n primary: \"#0c0\",\n primarydark: \"#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 },\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 EnableBashHotkeys: defaultSettings.EnableBashHotkeys,\n EnableTimestamps: defaultSettings.EnableTimestamps,\n Locale: \"en\",\n MaxLogCapacity: defaultSettings.MaxLogCapacity,\n MaxPortCapacity: defaultSettings.MaxPortCapacity,\n MaxTerminalCapacity: defaultSettings.MaxTerminalCapacity,\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting.AcquirementTime,\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting.Default,\n SaveGameOnFileSave: defaultSettings.SaveGameOnFileSave,\n SuppressBuyAugmentationConfirmation: defaultSettings.SuppressBuyAugmentationConfirmation,\n SuppressFactionInvites: defaultSettings.SuppressFactionInvites,\n SuppressHospitalizationPopup: defaultSettings.SuppressHospitalizationPopup,\n SuppressMessages: defaultSettings.SuppressMessages,\n SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,\n SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,\n MonacoTheme: \"vs-dark\",\n MonacoInsertSpaces: false,\n MonacoFontSize: 10,\n\n theme: {\n primarylight: defaultSettings.theme.primarylight,\n primary: defaultSettings.theme.primary,\n primarydark: defaultSettings.theme.primarydark,\n errorlight: defaultSettings.theme.errorlight,\n error: defaultSettings.theme.error,\n errordark: defaultSettings.theme.errordark,\n secondarylight: defaultSettings.theme.secondarylight,\n secondary: defaultSettings.theme.secondary,\n secondarydark: defaultSettings.theme.secondarydark,\n warninglight: defaultSettings.theme.warninglight,\n warning: defaultSettings.theme.warning,\n warningdark: defaultSettings.theme.warningdark,\n infolight: defaultSettings.theme.infolight,\n info: defaultSettings.theme.info,\n infodark: defaultSettings.theme.infodark,\n welllight: defaultSettings.theme.welllight,\n well: defaultSettings.theme.well,\n white: defaultSettings.theme.white,\n black: defaultSettings.theme.black,\n hp: defaultSettings.theme.hp,\n money: defaultSettings.theme.money,\n hack: defaultSettings.theme.hack,\n combat: defaultSettings.theme.combat,\n cha: defaultSettings.theme.cha,\n int: defaultSettings.theme.int,\n rep: defaultSettings.theme.rep,\n disabled: defaultSettings.theme.disabled,\n },\n init() {\n Object.assign(Settings, defaultSettings);\n },\n load(saveString: string) {\n Object.assign(Settings, JSON.parse(saveString));\n },\n};\n","import { 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 ScriptHackRamCost: 0.1,\n ScriptHackAnalyzeRamCost: 1,\n ScriptGrowRamCost: 0.15,\n ScriptGrowthAnalyzeRamCost: 1,\n ScriptWeakenRamCost: 0.15,\n ScriptScanRamCost: 0.2,\n ScriptPortProgramRamCost: 0.05,\n ScriptRunRamCost: 1.0,\n ScriptExecRamCost: 1.3,\n ScriptSpawnRamCost: 2.0,\n ScriptScpRamCost: 0.6,\n ScriptKillRamCost: 0.5,\n ScriptHasRootAccessRamCost: 0.05,\n ScriptGetHostnameRamCost: 0.05,\n ScriptGetHackingLevelRamCost: 0.05,\n ScriptGetMultipliersRamCost: 4.0,\n ScriptGetServerRamCost: 0.1,\n ScriptGetServerMaxRam: 0.05,\n ScriptGetServerUsedRam: 0.05,\n ScriptFileExistsRamCost: 0.1,\n ScriptIsRunningRamCost: 0.1,\n ScriptHacknetNodesRamCost: 4.0,\n ScriptHNUpgLevelRamCost: 0.4,\n ScriptHNUpgRamRamCost: 0.6,\n ScriptHNUpgCoreRamCost: 0.8,\n ScriptGetStockRamCost: 2.0,\n ScriptBuySellStockRamCost: 2.5,\n ScriptGetPurchaseServerRamCost: 0.25,\n ScriptPurchaseServerRamCost: 2.25,\n ScriptGetPurchasedServerLimit: 0.05,\n ScriptGetPurchasedServerMaxRam: 0.05,\n ScriptRoundRamCost: 0.05,\n ScriptReadWriteRamCost: 1.0,\n ScriptArbScriptRamCost: 1.0,\n ScriptGetScriptRamCost: 0.1,\n ScriptGetRunningScriptRamCost: 0.3,\n ScriptGetHackTimeRamCost: 0.05,\n ScriptGetFavorToDonate: 0.1,\n ScriptCodingContractBaseRamCost: 10,\n ScriptSleeveBaseRamCost: 4,\n\n ScriptSingularityFn1RamCost: 2,\n ScriptSingularityFn2RamCost: 3,\n ScriptSingularityFn3RamCost: 5,\n\n ScriptGangApiBaseRamCost: 4,\n\n ScriptBladeburnerApiBaseRamCost: 4,\n};\n\nexport const RamCosts: IMap<any> = {\n hacknet: {\n numNodes: () => 0,\n purchaseNode: () => 0,\n getPurchaseNodeCost: () => 0,\n getNodeStats: () => 0,\n upgradeLevel: () => 0,\n upgradeRam: () => 0,\n upgradeCore: () => 0,\n upgradeCache: () => 0,\n getLevelUpgradeCost: () => 0,\n getRamUpgradeCost: () => 0,\n getCoreUpgradeCost: () => 0,\n getCacheUpgradeCost: () => 0,\n numHashes: () => 0,\n hashCost: () => 0,\n spendHashes: () => 0,\n },\n sprintf: () => 0,\n vsprintf: () => 0,\n scan: () => RamCostConstants.ScriptScanRamCost,\n hack: () => RamCostConstants.ScriptHackRamCost,\n hackAnalyzeThreads: () => RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzePercent: () => RamCostConstants.ScriptHackAnalyzeRamCost,\n hackChance: () => RamCostConstants.ScriptHackAnalyzeRamCost,\n sleep: () => 0,\n grow: () => RamCostConstants.ScriptGrowRamCost,\n growthAnalyze: () => RamCostConstants.ScriptGrowthAnalyzeRamCost,\n weaken: () => RamCostConstants.ScriptWeakenRamCost,\n print: () => 0,\n tprint: () => 0,\n clearLog: () => 0,\n disableLog: () => 0,\n enableLog: () => 0,\n isLogEnabled: () => 0,\n getScriptLogs: () => 0,\n nuke: () => RamCostConstants.ScriptPortProgramRamCost,\n brutessh: () => RamCostConstants.ScriptPortProgramRamCost,\n ftpcrack: () => RamCostConstants.ScriptPortProgramRamCost,\n relaysmtp: () => RamCostConstants.ScriptPortProgramRamCost,\n httpworm: () => RamCostConstants.ScriptPortProgramRamCost,\n sqlinject: () => RamCostConstants.ScriptPortProgramRamCost,\n run: () => RamCostConstants.ScriptRunRamCost,\n exec: () => RamCostConstants.ScriptExecRamCost,\n spawn: () => RamCostConstants.ScriptSpawnRamCost,\n kill: () => RamCostConstants.ScriptKillRamCost,\n killall: () => RamCostConstants.ScriptKillRamCost,\n exit: () => 0,\n scp: () => RamCostConstants.ScriptScpRamCost,\n ls: () => RamCostConstants.ScriptScanRamCost,\n ps: () => RamCostConstants.ScriptScanRamCost,\n hasRootAccess: () => RamCostConstants.ScriptHasRootAccessRamCost,\n getIp: () => RamCostConstants.ScriptGetHostnameRamCost,\n getHostname: () => RamCostConstants.ScriptGetHostnameRamCost,\n getHackingLevel: () => RamCostConstants.ScriptGetHackingLevelRamCost,\n getHackingMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost,\n getHacknetMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost,\n getBitNodeMultipliers: () => RamCostConstants.ScriptGetMultipliersRamCost,\n getServer: () => RamCostConstants.ScriptGetMultipliersRamCost / 2,\n getServerMoneyAvailable: () => RamCostConstants.ScriptGetServerRamCost,\n getServerSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost,\n getServerBaseSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost,\n getServerMinSecurityLevel: () => RamCostConstants.ScriptGetServerRamCost,\n getServerRequiredHackingLevel: () => RamCostConstants.ScriptGetServerRamCost,\n getServerMaxMoney: () => RamCostConstants.ScriptGetServerRamCost,\n getServerGrowth: () => RamCostConstants.ScriptGetServerRamCost,\n getServerNumPortsRequired: () => RamCostConstants.ScriptGetServerRamCost,\n getServerRam: () => RamCostConstants.ScriptGetServerRamCost,\n getServerMaxRam: () => RamCostConstants.ScriptGetServerMaxRam,\n getServerUsedRam: () => RamCostConstants.ScriptGetServerUsedRam,\n serverExists: () => RamCostConstants.ScriptGetServerRamCost,\n fileExists: () => RamCostConstants.ScriptFileExistsRamCost,\n isRunning: () => RamCostConstants.ScriptIsRunningRamCost,\n getStockSymbols: () => RamCostConstants.ScriptGetStockRamCost,\n getStockPrice: () => RamCostConstants.ScriptGetStockRamCost,\n getStockAskPrice: () => RamCostConstants.ScriptGetStockRamCost,\n getStockBidPrice: () => RamCostConstants.ScriptGetStockRamCost,\n getStockPosition: () => RamCostConstants.ScriptGetStockRamCost,\n getStockMaxShares: () => RamCostConstants.ScriptGetStockRamCost,\n getStockPurchaseCost: () => RamCostConstants.ScriptGetStockRamCost,\n getStockSaleGain: () => RamCostConstants.ScriptGetStockRamCost,\n buyStock: () => RamCostConstants.ScriptBuySellStockRamCost,\n sellStock: () => RamCostConstants.ScriptBuySellStockRamCost,\n shortStock: () => RamCostConstants.ScriptBuySellStockRamCost,\n sellShort: () => RamCostConstants.ScriptBuySellStockRamCost,\n placeOrder: () => RamCostConstants.ScriptBuySellStockRamCost,\n cancelOrder: () => RamCostConstants.ScriptBuySellStockRamCost,\n getOrders: () => RamCostConstants.ScriptBuySellStockRamCost,\n getStockVolatility: () => RamCostConstants.ScriptBuySellStockRamCost,\n getStockForecast: () => RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketData: () => RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketDataTixApi: () => RamCostConstants.ScriptBuySellStockRamCost,\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: () => RamCostConstants.ScriptReadWriteRamCost,\n tryWrite: () => RamCostConstants.ScriptReadWriteRamCost,\n read: () => RamCostConstants.ScriptReadWriteRamCost,\n peek: () => RamCostConstants.ScriptReadWriteRamCost,\n clear: () => RamCostConstants.ScriptReadWriteRamCost,\n getPortHandle: () => RamCostConstants.ScriptReadWriteRamCost * 10,\n rm: () => RamCostConstants.ScriptReadWriteRamCost,\n scriptRunning: () => RamCostConstants.ScriptArbScriptRamCost,\n scriptKill: () => RamCostConstants.ScriptArbScriptRamCost,\n getScriptName: () => 0,\n getScriptRam: () => RamCostConstants.ScriptGetScriptRamCost,\n getHackTime: () => RamCostConstants.ScriptGetHackTimeRamCost,\n getGrowTime: () => RamCostConstants.ScriptGetHackTimeRamCost,\n getWeakenTime: () => RamCostConstants.ScriptGetHackTimeRamCost,\n getScriptIncome: () => RamCostConstants.ScriptGetScriptRamCost,\n getScriptExpGain: () => RamCostConstants.ScriptGetScriptRamCost,\n getRunningScript: () => RamCostConstants.ScriptGetRunningScriptRamCost,\n nFormat: () => 0,\n getTimeSinceLastAug: () => RamCostConstants.ScriptGetHackTimeRamCost,\n prompt: () => 0,\n wget: () => 0,\n getFavorToDonate: () => RamCostConstants.ScriptGetFavorToDonate,\n\n // Singularity Functions\n universityCourse: () => RamCostConstants.ScriptSingularityFn1RamCost,\n gymWorkout: () => RamCostConstants.ScriptSingularityFn1RamCost,\n travelToCity: () => RamCostConstants.ScriptSingularityFn1RamCost,\n purchaseTor: () => RamCostConstants.ScriptSingularityFn1RamCost,\n purchaseProgram: () => RamCostConstants.ScriptSingularityFn1RamCost,\n getCurrentServer: () => RamCostConstants.ScriptSingularityFn1RamCost,\n connect: () => RamCostConstants.ScriptSingularityFn1RamCost,\n manualHack: () => RamCostConstants.ScriptSingularityFn1RamCost,\n installBackdoor: () => RamCostConstants.ScriptSingularityFn1RamCost,\n getStats: () => RamCostConstants.ScriptSingularityFn1RamCost / 4,\n getCharacterInformation: () => RamCostConstants.ScriptSingularityFn1RamCost / 4,\n getPlayer: () => RamCostConstants.ScriptSingularityFn1RamCost / 4,\n hospitalize: () => RamCostConstants.ScriptSingularityFn1RamCost / 4,\n isBusy: () => RamCostConstants.ScriptSingularityFn1RamCost / 4,\n stopAction: () => RamCostConstants.ScriptSingularityFn1RamCost / 2,\n upgradeHomeRam: () => RamCostConstants.ScriptSingularityFn2RamCost,\n getUpgradeHomeRamCost: () => RamCostConstants.ScriptSingularityFn2RamCost / 2,\n workForCompany: () => RamCostConstants.ScriptSingularityFn2RamCost,\n applyToCompany: () => RamCostConstants.ScriptSingularityFn2RamCost,\n getCompanyRep: () => RamCostConstants.ScriptSingularityFn2RamCost / 3,\n getCompanyFavor: () => RamCostConstants.ScriptSingularityFn2RamCost / 3,\n getCompanyFavorGain: () => RamCostConstants.ScriptSingularityFn2RamCost / 4,\n checkFactionInvitations: () => RamCostConstants.ScriptSingularityFn2RamCost,\n joinFaction: () => RamCostConstants.ScriptSingularityFn2RamCost,\n workForFaction: () => RamCostConstants.ScriptSingularityFn2RamCost,\n getFactionRep: () => RamCostConstants.ScriptSingularityFn2RamCost / 3,\n getFactionFavor: () => RamCostConstants.ScriptSingularityFn2RamCost / 3,\n getFactionFavorGain: () => RamCostConstants.ScriptSingularityFn2RamCost / 4,\n donateToFaction: () => RamCostConstants.ScriptSingularityFn3RamCost,\n createProgram: () => RamCostConstants.ScriptSingularityFn3RamCost,\n commitCrime: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getCrimeChance: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getCrimeStats: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getOwnedAugmentations: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getOwnedSourceFiles: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getAugmentationsFromFaction: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getAugmentationCost: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getAugmentationPrereq: () => RamCostConstants.ScriptSingularityFn3RamCost,\n getAugmentationPrice: () => RamCostConstants.ScriptSingularityFn3RamCost / 2,\n getAugmentationRepReq: () => RamCostConstants.ScriptSingularityFn3RamCost / 2,\n getAugmentationStats: () => RamCostConstants.ScriptSingularityFn3RamCost,\n purchaseAugmentation: () => RamCostConstants.ScriptSingularityFn3RamCost,\n softReset: () => RamCostConstants.ScriptSingularityFn3RamCost,\n installAugmentations: () => RamCostConstants.ScriptSingularityFn3RamCost,\n\n // Gang API\n gang: {\n createGang: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n inGang: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getMemberNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getGangInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getOtherGangInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getMemberInformation: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n canRecruitMember: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n recruitMember: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getTaskNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getTaskStats: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n setMemberTask: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentNames: () => RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getEquipmentCost: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentType: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentStats: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n purchaseEquipment: () => RamCostConstants.ScriptGangApiBaseRamCost,\n ascendMember: () => RamCostConstants.ScriptGangApiBaseRamCost,\n setTerritoryWarfare: () => RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getChanceToWinClash: () => RamCostConstants.ScriptGangApiBaseRamCost,\n getBonusTime: () => 0,\n },\n\n // Bladeburner API\n bladeburner: {\n getContractNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getOperationNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpRank: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getGeneralActionNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getSkillNames: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n startAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n stopBladeburnerAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getCurrentAction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,\n getActionTime: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionEstimatedSuccessChance: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionRepGain: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCountRemaining: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionMaxLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionAutolevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionAutolevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getRank: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillPoints: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillLevel: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillUpgradeCost: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n upgradeSkill: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getTeamSize: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setTeamSize: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityEstimatedPopulation: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityEstimatedCommunities: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityChaos: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCity: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n switchCity: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getStamina: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerFaction: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerDivision: () => RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getBonusTime: () => 0,\n },\n\n // Coding Contract API\n codingcontract: {\n attempt: () => RamCostConstants.ScriptCodingContractBaseRamCost,\n getContractType: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getData: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getDescription: () => RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getNumTriesRemaining: () => RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n },\n\n // Duplicate Sleeve API\n sleeve: {\n getNumSleeves: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToShockRecovery: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToSynchronize: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToCommitCrime: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToUniversityCourse: () => RamCostConstants.ScriptSleeveBaseRamCost,\n travel: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToCompanyWork: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToFactionWork: () => RamCostConstants.ScriptSleeveBaseRamCost,\n setToGymWorkout: () => RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveStats: () => RamCostConstants.ScriptSleeveBaseRamCost,\n getTask: () => RamCostConstants.ScriptSleeveBaseRamCost,\n getInformation: () => RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentations: () => RamCostConstants.ScriptSleeveBaseRamCost,\n getSleevePurchasableAugs: () => RamCostConstants.ScriptSleeveBaseRamCost,\n purchaseSleeveAug: () => RamCostConstants.ScriptSleeveBaseRamCost,\n },\n\n heart: {\n // Easter egg function\n break: () => 0,\n },\n};\n\nexport function getRamCost(...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 const currType = typeof curr;\n if (currType === \"function\") {\n return curr();\n }\n\n if (currType === \"number\") {\n return curr;\n }\n\n console.warn(`Unexpected type (${currType}) for value [${args}]`);\n return 0;\n}\n","import { AlertEvents } from \"./AlertManager\";\n\nimport React from \"react\";\n\nexport function dialogBoxCreate(txt: string | JSX.Element): void {\n if (typeof txt !== \"string\") {\n AlertEvents.emit(txt);\n } else {\n AlertEvents.emit(<span dangerouslySetInnerHTML={{ __html: txt }} />);\n }\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number | string;\n player?: IPlayer;\n}\nexport function Money(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (props.player !== undefined) {\n if (typeof props.money !== \"number\") throw new Error(\"if player if provided, money should be number, contact dev\");\n if (!props.player.canAfford(props.money))\n return <span className={classes.unbuyable}>{numeralWrapper.formatMoney(props.money)}</span>;\n }\n return (\n <span className={classes.money}>\n {typeof props.money === \"number\" ? numeralWrapper.formatMoney(props.money) : props.money}\n </span>\n );\n}\n","import { Augmentation } from \"./Augmentation\";\nimport { IMap } from \"../types\";\n\nexport const Augmentations: IMap<Augmentation> = {};\n","/* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */\n\nexport interface 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 console.log(\"Reviver WRONGLY called with key: \" + key + \", and value: \" + value);\n return 0;\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.log(\"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 return ctor.fromJSON(value);\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","/**\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 { EqualityFunc } from \"../types\";\nimport { isString } from \"./helpers/isString\";\n\n// Netburner String helper functions\n\n// Replaces the character at an index with a new character\nfunction replaceAt(base: string, index: number, character: string): string {\n return base.substr(0, index) + character + base.substr(index + character.length);\n}\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// Checks if a string contains HTML elements\nfunction isHTML(str: string): boolean {\n const element: HTMLDivElement = document.createElement(\"div\");\n element.innerHTML = str;\n const c: NodeListOf<Node & ChildNode> = element.childNodes;\n for (let i: number = c.length - 1; i >= 0; i--) {\n if (c[i].nodeType === 1) {\n return true;\n }\n }\n\n return false;\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\nexport {\n convertTimeMsToTimeElapsedString,\n longestCommonStart,\n containsAllStrings,\n formatNumber,\n isHTML,\n generateRandomString,\n replaceAt,\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\";\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 in 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 in AllServers) {\n const server = AllServers[key];\n if (server.hostname == hostname) {\n return server;\n }\n }\n\n return null;\n}\n\n//Get server by IP or hostname. Returns null if invalid\nexport function GetServer(s: string): BaseServer | null {\n const server = AllServers[s];\n if (server) return server;\n if (!isValidIPAddress(s)) {\n return GetServerByHostname(s);\n }\n\n const ipserver = GetServerByIP(s);\n if (ipserver !== undefined) {\n return ipserver;\n }\n\n return null;\n}\n\nexport function GetAllServers(): BaseServer[] {\n const servers: BaseServer[] = [];\n for (const key in AllServers) {\n servers.push(AllServers[key]);\n }\n return servers;\n}\n\nexport function DeleteServer(serverkey: string): void {\n for (const key in AllServers) {\n const server = AllServers[key];\n if (server.ip !== serverkey && server.hostname !== serverkey) continue;\n delete AllServers[key];\n break;\n }\n}\n\nexport function ipExists(ip: string): boolean {\n return AllServers[ip] != null;\n}\n\nexport function createUniqueRandomIp(): string {\n const ip = createRandomIp();\n\n // If the Ip already exists, recurse to create a new one\n if (ipExists(ip)) {\n return createRandomIp();\n }\n\n return ip;\n}\n\n// Saftely add a Server to the AllServers map\nexport function AddToAllServers(server: Server | HacknetServer): void {\n if (GetServer(server.hostname)) {\n console.warn(`Hostname of the server thats being added: ${server.hostname}`);\n console.warn(`The server that already has this IP is: ${AllServers[server.hostname].hostname}`);\n throw new Error(\"Error: Trying to add a server with an existing IP\");\n }\n\n AllServers[server.hostname] = server;\n}\n\ninterface IServerParams {\n hackDifficulty?: number;\n hostname: string;\n ip: string;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired: number;\n organizationName: string;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n\n [key: string]: any;\n}\n\nexport function initForeignServers(homeComputer: Server): void {\n /* Create a randomized network for all the foreign servers */\n //Groupings for creating a randomized network\n const networkLayers: Server[][] = [];\n for (let i = 0; i < 15; i++) {\n networkLayers.push([]);\n }\n\n // Essentially any property that is of type 'number | IMinMaxRange'\n const propertiesToPatternMatch: string[] = [\n \"hackDifficulty\",\n \"moneyAvailable\",\n \"requiredHackingSkill\",\n \"serverGrowth\",\n ];\n\n const toNumber = (value: any): any => {\n switch (typeof value) {\n case \"number\":\n return value;\n case \"object\":\n return getRandomInt(value.min, value.max);\n default:\n throw Error(`Do not know how to convert the type '${typeof value}' to a number`);\n }\n };\n\n for (const metadata of serverMetadata) {\n const serverParams: IServerParams = {\n hostname: metadata.hostname,\n ip: createUniqueRandomIp(),\n numOpenPortsRequired: metadata.numOpenPortsRequired,\n organizationName: metadata.organizationName,\n };\n\n if (metadata.maxRamExponent !== undefined) {\n serverParams.maxRam = Math.pow(2, toNumber(metadata.maxRamExponent));\n }\n\n for (const prop of propertiesToPatternMatch) {\n if (metadata[prop] !== undefined) {\n serverParams[prop] = toNumber(metadata[prop]);\n }\n }\n\n const server = new Server(serverParams);\n for (const filename of metadata.literature || []) {\n server.messages.push(filename);\n }\n\n 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 in 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(): string {\n const TempAllServers = JSON.parse(JSON.stringify(AllServers), Reviver);\n for (const key in TempAllServers) {\n const server = TempAllServers[key];\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","/**\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\nexport function 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 in 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\nexport function 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","// 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","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","/**\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","import { Faction } from \"../Faction/Faction\";\nimport { Location } from \"../Locations/Location\";\n\n/**\n * The full-screen page the player is currently be on.\n * These pages are mutually exclusive.\n */\nexport enum Page {\n ActiveScripts,\n Augmentations,\n BitVerse,\n Bladeburner,\n City,\n Corporation,\n CreateProgram,\n ScriptEditor,\n DevMenu,\n Faction,\n Factions,\n Gang,\n Hacknet,\n Infiltration,\n Job,\n Milestones,\n Options,\n Resleeves,\n Sleeves,\n Stats,\n StockMarket,\n Terminal,\n Travel,\n Tutorial,\n Work,\n BladeburnerCinematic,\n Location,\n Loading,\n}\n\n/**\n * This class keeps track of player navigation/routing within the game.\n */\nexport interface IRouter {\n // toCinematicText(): void;\n // toInfiltration(): void;\n // toMission(): void;\n // toRedPill(): void;\n // toworkInProgress(): void;\n page(): Page;\n toActiveScripts(): void;\n toAugmentations(): void;\n toBitVerse(flume: boolean, quick: boolean): void;\n toBladeburner(): void;\n toStats(): void;\n toCity(): void; // travel ? city ?\n toCorporation(): void;\n toCreateProgram(): void;\n toDevMenu(): void;\n toFaction(faction?: Faction): void; // faction name\n toFactions(): void;\n toGameOptions(): void;\n toGang(): void;\n toHacknetNodes(): void;\n toInfiltration(location: Location): void;\n toJob(): void;\n toMilestones(): void;\n toResleeves(): void;\n toScriptEditor(filename?: string, code?: string): 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}\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\nimport { IMap } from \"../types\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n info: string | JSX.Element;\n stats?: JSX.Element | null;\n isSpecial?: boolean;\n moneyCost: number;\n name: string;\n prereqs?: string[];\n repCost: number;\n\n hacking_mult?: number;\n strength_mult?: number;\n defense_mult?: number;\n dexterity_mult?: number;\n agility_mult?: number;\n charisma_mult?: number;\n hacking_exp_mult?: number;\n strength_exp_mult?: number;\n defense_exp_mult?: number;\n dexterity_exp_mult?: number;\n agility_exp_mult?: number;\n charisma_exp_mult?: number;\n hacking_chance_mult?: number;\n hacking_speed_mult?: number;\n hacking_money_mult?: number;\n hacking_grow_mult?: number;\n company_rep_mult?: number;\n faction_rep_mult?: number;\n crime_money_mult?: number;\n crime_success_mult?: number;\n work_money_mult?: number;\n hacknet_node_money_mult?: number;\n hacknet_node_purchase_cost_mult?: number;\n hacknet_node_ram_cost_mult?: number;\n hacknet_node_core_cost_mult?: number;\n hacknet_node_level_cost_mult?: number;\n bladeburner_max_stamina_mult?: number;\n bladeburner_stamina_gain_mult?: number;\n bladeburner_analysis_mult?: number;\n bladeburner_success_chance_mult?: number;\n\n startingMoney?: number;\n programs?: string[];\n}\n\nfunction generateStatsDescription(mults: IMap<number>, programs?: string[], startingMoney?: number): JSX.Element {\n const f = (x: number, decimals = 0): string => {\n // look, I don't know how to make a \"smart decimals\"\n // todo, make it smarter\n if (x === 1.0777 - 1) return \"7.77%\";\n if (x === 1.777 - 1) return \"77.7%\";\n return numeralWrapper.formatPercentage(x, decimals);\n };\n let desc = <>Effects:</>;\n\n if (\n mults.hacking_mult &&\n mults.hacking_mult == mults.strength_mult &&\n mults.hacking_mult == mults.defense_mult &&\n mults.hacking_mult == mults.dexterity_mult &&\n mults.hacking_mult == mults.agility_mult &&\n mults.hacking_mult == mults.charisma_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_mult - 1)} all skills\n </>\n );\n } else {\n if (mults.hacking_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_mult - 1)} hacking skill\n </>\n );\n\n if (\n mults.strength_mult &&\n mults.strength_mult == mults.defense_mult &&\n mults.strength_mult == mults.dexterity_mult &&\n mults.strength_mult == mults.agility_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_mult - 1)} combat skills\n </>\n );\n } else {\n if (mults.strength_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_mult - 1)} strength skill\n </>\n );\n if (mults.defense_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense_mult - 1)} defense skill\n </>\n );\n if (mults.dexterity_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity_mult - 1)} dexterity skill\n </>\n );\n if (mults.agility_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility_mult - 1)} agility skill\n </>\n );\n }\n if (mults.charisma_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma_mult - 1)} Charisma skill\n </>\n );\n }\n\n if (\n mults.hacking_exp_mult &&\n mults.hacking_exp_mult === mults.strength_exp_mult &&\n mults.hacking_exp_mult === mults.defense_exp_mult &&\n mults.hacking_exp_mult === mults.dexterity_exp_mult &&\n mults.hacking_exp_mult === mults.agility_exp_mult &&\n mults.hacking_exp_mult === mults.charisma_exp_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp_mult - 1)} exp for all skills\n </>\n );\n } else {\n if (mults.hacking_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_exp_mult - 1)} hacking exp\n </>\n );\n\n if (\n mults.strength_exp_mult &&\n mults.strength_exp_mult === mults.defense_exp_mult &&\n mults.strength_exp_mult === mults.dexterity_exp_mult &&\n mults.strength_exp_mult === mults.agility_exp_mult\n ) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp_mult - 1)} combat exp\n </>\n );\n } else {\n if (mults.strength_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.strength_exp_mult - 1)} strength exp\n </>\n );\n if (mults.defense_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.defense_exp_mult - 1)} defense exp\n </>\n );\n if (mults.dexterity_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.dexterity_exp_mult - 1)} dexterity exp\n </>\n );\n if (mults.agility_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.agility_exp_mult - 1)} agility exp\n </>\n );\n }\n if (mults.charisma_exp_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.charisma_exp_mult - 1)} charisma exp\n </>\n );\n }\n\n if (mults.hacking_speed_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_speed_mult - 1)} faster hack(), grow(), and weaken()\n </>\n );\n if (mults.hacking_chance_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_chance_mult - 1)} hack() success chance\n </>\n );\n if (mults.hacking_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_money_mult - 1)} hack() power\n </>\n );\n if (mults.hacking_grow_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacking_grow_mult - 1)} grow() power\n </>\n );\n\n if (mults.faction_rep_mult && mults.faction_rep_mult === mults.company_rep_mult) {\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep_mult - 1)} reputation from factions and companies\n </>\n );\n } else {\n if (mults.faction_rep_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.faction_rep_mult - 1)} reputation from factions\n </>\n );\n if (mults.company_rep_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.company_rep_mult - 1)} reputation from companies\n </>\n );\n }\n\n if (mults.crime_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_money_mult - 1)} crime money\n </>\n );\n if (mults.crime_success_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.crime_success_mult - 1)} crime success rate\n </>\n );\n if (mults.work_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.work_money_mult - 1)} work money\n </>\n );\n\n if (mults.hacknet_node_money_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.hacknet_node_money_mult - 1)} hacknet production\n </>\n );\n if (mults.hacknet_node_purchase_cost_mult)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_purchase_cost_mult - 1))} hacknet nodes cost\n </>\n );\n if (mults.hacknet_node_level_cost_mult)\n desc = (\n <>\n {desc}\n <br />-{f(-(mults.hacknet_node_level_cost_mult - 1))} hacknet nodes upgrade cost\n </>\n );\n\n if (mults.bladeburner_max_stamina_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_max_stamina_mult - 1)} Bladeburner Max Stamina\n </>\n );\n if (mults.bladeburner_stamina_gain_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_stamina_gain_mult - 1)} Bladeburner Stamina gain\n </>\n );\n if (mults.bladeburner_analysis_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_analysis_mult - 1)} Bladeburner Field Analysis effectiveness\n </>\n );\n if (mults.bladeburner_success_chance_mult)\n desc = (\n <>\n {desc}\n <br />+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance\n </>\n );\n\n if (startingMoney)\n desc = (\n <>\n {desc}\n <br />\n Start with <Money money={startingMoney} /> after installing Augmentations.\n </>\n );\n\n if (programs)\n desc = (\n <>\n {desc}\n <br />\n Start with {programs.join(\" and \")} after installing Augmentations.\n </>\n );\n return desc;\n}\n\nexport class Augmentation {\n // How much money this costs to buy\n baseCost = 0;\n\n // How much faction reputation is required to unlock this\n baseRepRequirement = 0;\n\n // Description of what this Aug is and what it does\n info: string | JSX.Element;\n\n // Description of the stats, often autogenerated, sometimes manually written.\n stats: JSX.Element | null;\n\n // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs)\n isSpecial = false;\n\n // Augmentation level - for repeatable Augs like NeuroFlux Governor\n level = 0;\n\n // Name of Augmentation\n name = \"\";\n\n // Whether the player owns this Augmentation\n owned = false;\n\n // Array of names of all prerequisites\n prereqs: string[] = [];\n\n // Multipliers given by this Augmentation. Must match the property name in\n // The Player/Person classes\n mults: IMap<number> = {};\n\n // Initial cost. Doesn't change when you purchase multiple Augmentation\n startingCost = 0;\n\n constructor(\n params: IConstructorParams = {\n info: \"\",\n moneyCost: 0,\n name: \"\",\n repCost: 0,\n },\n ) {\n this.name = params.name;\n this.info = params.info;\n this.prereqs = params.prereqs ? params.prereqs : [];\n\n this.baseRepRequirement = params.repCost * BitNodeMultipliers.AugmentationRepCost;\n this.baseCost = params.moneyCost * BitNodeMultipliers.AugmentationMoneyCost;\n this.startingCost = this.baseCost;\n\n if (params.isSpecial) {\n this.isSpecial = true;\n }\n\n this.level = 0;\n\n // Set multipliers\n if (params.hacking_mult) {\n this.mults.hacking_mult = params.hacking_mult;\n }\n if (params.strength_mult) {\n this.mults.strength_mult = params.strength_mult;\n }\n if (params.defense_mult) {\n this.mults.defense_mult = params.defense_mult;\n }\n if (params.dexterity_mult) {\n this.mults.dexterity_mult = params.dexterity_mult;\n }\n if (params.agility_mult) {\n this.mults.agility_mult = params.agility_mult;\n }\n if (params.charisma_mult) {\n this.mults.charisma_mult = params.charisma_mult;\n }\n if (params.hacking_exp_mult) {\n this.mults.hacking_exp_mult = params.hacking_exp_mult;\n }\n if (params.strength_exp_mult) {\n this.mults.strength_exp_mult = params.strength_exp_mult;\n }\n if (params.defense_exp_mult) {\n this.mults.defense_exp_mult = params.defense_exp_mult;\n }\n if (params.dexterity_exp_mult) {\n this.mults.dexterity_exp_mult = params.dexterity_exp_mult;\n }\n if (params.agility_exp_mult) {\n this.mults.agility_exp_mult = params.agility_exp_mult;\n }\n if (params.charisma_exp_mult) {\n this.mults.charisma_exp_mult = params.charisma_exp_mult;\n }\n if (params.hacking_chance_mult) {\n this.mults.hacking_chance_mult = params.hacking_chance_mult;\n }\n if (params.hacking_speed_mult) {\n this.mults.hacking_speed_mult = params.hacking_speed_mult;\n }\n if (params.hacking_money_mult) {\n this.mults.hacking_money_mult = params.hacking_money_mult;\n }\n if (params.hacking_grow_mult) {\n this.mults.hacking_grow_mult = params.hacking_grow_mult;\n }\n if (params.company_rep_mult) {\n this.mults.company_rep_mult = params.company_rep_mult;\n }\n if (params.faction_rep_mult) {\n this.mults.faction_rep_mult = params.faction_rep_mult;\n }\n if (params.crime_money_mult) {\n this.mults.crime_money_mult = params.crime_money_mult;\n }\n if (params.crime_success_mult) {\n this.mults.crime_success_mult = params.crime_success_mult;\n }\n if (params.work_money_mult) {\n this.mults.work_money_mult = params.work_money_mult;\n }\n if (params.hacknet_node_money_mult) {\n this.mults.hacknet_node_money_mult = params.hacknet_node_money_mult;\n }\n if (params.hacknet_node_purchase_cost_mult) {\n this.mults.hacknet_node_purchase_cost_mult = params.hacknet_node_purchase_cost_mult;\n }\n if (params.hacknet_node_ram_cost_mult) {\n this.mults.hacknet_node_ram_cost_mult = params.hacknet_node_ram_cost_mult;\n }\n if (params.hacknet_node_core_cost_mult) {\n this.mults.hacknet_node_core_cost_mult = params.hacknet_node_core_cost_mult;\n }\n if (params.hacknet_node_level_cost_mult) {\n this.mults.hacknet_node_level_cost_mult = params.hacknet_node_level_cost_mult;\n }\n if (params.bladeburner_max_stamina_mult) {\n this.mults.bladeburner_max_stamina_mult = params.bladeburner_max_stamina_mult;\n }\n if (params.bladeburner_stamina_gain_mult) {\n this.mults.bladeburner_stamina_gain_mult = params.bladeburner_stamina_gain_mult;\n }\n if (params.bladeburner_analysis_mult) {\n this.mults.bladeburner_analysis_mult = params.bladeburner_analysis_mult;\n }\n if (params.bladeburner_success_chance_mult) {\n this.mults.bladeburner_success_chance_mult = params.bladeburner_success_chance_mult;\n }\n\n if (params.stats === undefined)\n this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);\n else this.stats = params.stats;\n }\n\n // Adds this Augmentation to the specified Factions\n addToFactions(factionList: string[]): void {\n for (let i = 0; i < factionList.length; ++i) {\n const faction: Faction | null = Factions[factionList[i]];\n if (faction == null) {\n console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`);\n continue;\n }\n faction.augmentations.push(this.name);\n }\n }\n\n // Adds this Augmentation to all Factions\n addToAllFactions(): void {\n for (const fac in 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 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","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","// 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} = {\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};\n","import { Player } from \"./Player\";\n\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { ITutorialEvents } from \"./ui/InteractiveTutorial/ITutorialEvents\";\n\n// Ordered array of keys to Interactive Tutorial Steps\nenum iTutorialSteps {\n Start,\n GoToCharacterPage, // Click on 'Stats' page\n CharacterPage, // Introduction to 'Stats' page\n CharacterGoToTerminalPage, // Go back to Terminal\n TerminalIntro, // Introduction to Terminal\n TerminalHelp, // Using 'help' Terminal command\n TerminalLs, // Using 'ls' Terminal command\n TerminalScan, // Using 'scan' Terminal command\n TerminalScanAnalyze1, // Using 'scan-analyze' Terminal command\n TerminalScanAnalyze2, // Using 'scan-analyze 3' Terminal command\n TerminalConnect, // Connecting to n00dles\n TerminalAnalyze, // Analyzing n00dles\n TerminalNuke, // NUKE n00dles\n TerminalManualHack, // Hack n00dles\n TerminalHackingMechanics, // Explanation of hacking mechanics\n TerminalGoHome, // Go home before creating a script.\n TerminalCreateScript, // Create a script using 'nano'\n TerminalTypeScript, // Script Editor page - Type script and then save & close\n TerminalFree, // Using 'Free' Terminal command\n TerminalRunScript, // Running script using 'run' Terminal command\n TerminalGoToActiveScriptsPage,\n ActiveScriptsPage,\n ActiveScriptsToTerminal,\n TerminalTailScript,\n GoToHacknetNodesPage,\n HacknetNodesIntroduction,\n HacknetNodesGoToWorldPage,\n WorldDescription,\n TutorialPageInfo,\n End,\n}\n\nconst ITutorial: {\n currStep: iTutorialSteps;\n isRunning: boolean;\n stepIsDone: {\n [iTutorialSteps.Start]: boolean;\n [iTutorialSteps.GoToCharacterPage]: boolean;\n [iTutorialSteps.CharacterPage]: boolean;\n [iTutorialSteps.CharacterGoToTerminalPage]: boolean;\n [iTutorialSteps.TerminalIntro]: boolean;\n [iTutorialSteps.TerminalHelp]: boolean;\n [iTutorialSteps.TerminalLs]: boolean;\n [iTutorialSteps.TerminalScan]: boolean;\n [iTutorialSteps.TerminalScanAnalyze1]: boolean;\n [iTutorialSteps.TerminalScanAnalyze2]: boolean;\n [iTutorialSteps.TerminalConnect]: boolean;\n [iTutorialSteps.TerminalAnalyze]: boolean;\n [iTutorialSteps.TerminalNuke]: boolean;\n [iTutorialSteps.TerminalManualHack]: boolean;\n [iTutorialSteps.TerminalHackingMechanics]: boolean;\n [iTutorialSteps.TerminalGoHome]: boolean;\n [iTutorialSteps.TerminalCreateScript]: boolean;\n [iTutorialSteps.TerminalTypeScript]: boolean;\n [iTutorialSteps.TerminalFree]: boolean;\n [iTutorialSteps.TerminalRunScript]: boolean;\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsToTerminal]: boolean;\n [iTutorialSteps.TerminalTailScript]: boolean;\n [iTutorialSteps.GoToHacknetNodesPage]: boolean;\n [iTutorialSteps.HacknetNodesIntroduction]: boolean;\n [iTutorialSteps.HacknetNodesGoToWorldPage]: boolean;\n [iTutorialSteps.WorldDescription]: boolean;\n [iTutorialSteps.TutorialPageInfo]: boolean;\n [iTutorialSteps.End]: boolean;\n };\n} = {\n currStep: iTutorialSteps.Start,\n isRunning: false,\n\n // Keeps track of whether each step has been done\n stepIsDone: {\n [iTutorialSteps.Start]: false,\n [iTutorialSteps.GoToCharacterPage]: false,\n [iTutorialSteps.CharacterPage]: false,\n [iTutorialSteps.CharacterGoToTerminalPage]: false,\n [iTutorialSteps.TerminalIntro]: false,\n [iTutorialSteps.TerminalHelp]: false,\n [iTutorialSteps.TerminalLs]: false,\n [iTutorialSteps.TerminalScan]: false,\n [iTutorialSteps.TerminalScanAnalyze1]: false,\n [iTutorialSteps.TerminalScanAnalyze2]: false,\n [iTutorialSteps.TerminalConnect]: false,\n [iTutorialSteps.TerminalAnalyze]: false,\n [iTutorialSteps.TerminalNuke]: false,\n [iTutorialSteps.TerminalManualHack]: false,\n [iTutorialSteps.TerminalHackingMechanics]: false,\n [iTutorialSteps.TerminalGoHome]: false,\n [iTutorialSteps.TerminalCreateScript]: false,\n [iTutorialSteps.TerminalTypeScript]: false,\n [iTutorialSteps.TerminalFree]: false,\n [iTutorialSteps.TerminalRunScript]: false,\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsToTerminal]: false,\n [iTutorialSteps.TerminalTailScript]: false,\n [iTutorialSteps.GoToHacknetNodesPage]: false,\n [iTutorialSteps.HacknetNodesIntroduction]: false,\n [iTutorialSteps.HacknetNodesGoToWorldPage]: false,\n [iTutorialSteps.WorldDescription]: false,\n [iTutorialSteps.TutorialPageInfo]: false,\n [iTutorialSteps.End]: false,\n },\n};\n\nfunction iTutorialStart(): void {\n ITutorial.isRunning = true;\n}\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\n Player.getHomeComputer().messages.push(LiteratureNames.HackersStartingHandbook);\n ITutorialEvents.emit();\n}\n\nexport { iTutorialSteps, iTutorialEnd, iTutorialStart, iTutorialNextStep, ITutorial, iTutorialPrevStep };\n","import React from \"react\";\nimport { Theme } from \"@mui/material\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport M from \"@mui/material/Modal\";\nimport Fade from \"@mui/material/Fade\";\nimport Box from \"@mui/material/Box\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n modal: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n paper: {\n backgroundColor: theme.palette.background.default,\n border: \"2px solid \" + theme.palette.primary.main,\n boxShadow: `0px 3px 5px -1px ${theme.palette.primary.dark},0px 5px 8px 0px ${theme.palette.primary.dark},0px 1px 14px 0px ${theme.palette.primary.dark}`,\n padding: 2,\n maxWidth: \"80%\",\n maxHeight: \"80%\",\n overflow: \"auto\",\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n },\n }),\n);\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: React.ReactNode;\n}\n\nexport const Modal = (props: IProps): React.ReactElement => {\n const classes = useStyles();\n return (\n <M\n disableRestoreFocus\n disableScrollLock\n disableEnforceFocus\n disableAutoFocus\n open={props.open}\n onClose={props.onClose}\n closeAfterTransition\n className={classes.modal}\n >\n <Fade in={props.open}>\n <div className={classes.paper}>\n <Box sx={{ m: 2 }}>{props.children}</Box>\n </div>\n </Fade>\n </M>\n );\n};\n","const CyclesPerMarketCycle = 50;\nconst AllCorporationStates = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\nexport const CorporationConstants: {\n INITIALSHARES: number;\n SHARESPERPRICEUPDATE: number;\n IssueNewSharesCooldown: number;\n SellSharesCooldown: number;\n CyclesPerMarketCycle: number;\n CyclesPerIndustryStateCycle: number;\n SecsPerMarketCycle: number;\n Cities: string[];\n WarehouseInitialCost: number;\n WarehouseInitialSize: number;\n WarehouseUpgradeBaseCost: number;\n OfficeInitialCost: number;\n OfficeInitialSize: number;\n OfficeUpgradeBaseCost: number;\n BribeThreshold: number;\n BribeToRepRatio: number;\n ProductProductionCostRatio: number;\n DividendMaxPercentage: number;\n EmployeeSalaryMultiplier: number;\n CyclesPerEmployeeRaise: number;\n EmployeeRaiseAmount: number;\n BaseMaxProducts: number;\n AllCorporationStates: string[];\n AllMaterials: string[];\n} = {\n INITIALSHARES: 1e9, //Total number of shares you have at your company\n SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount\n IssueNewSharesCooldown: 216e3, // 12 Hour in terms of game cycles\n SellSharesCooldown: 18e3, // 1 Hour in terms of game cycles\n\n CyclesPerMarketCycle: CyclesPerMarketCycle,\n CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length,\n SecsPerMarketCycle: CyclesPerMarketCycle / 5,\n\n Cities: [\"Aevum\", \"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n\n WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse\n WarehouseInitialSize: 100,\n WarehouseUpgradeBaseCost: 1e9,\n\n OfficeInitialCost: 4e9,\n OfficeInitialSize: 3,\n OfficeUpgradeBaseCost: 1e9,\n\n BribeThreshold: 100e12, //Money needed to be able to bribe for faction rep\n BribeToRepRatio: 1e9, //Bribe Value divided by this = rep gain\n\n ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost\n\n DividendMaxPercentage: 0.5,\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};\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 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 { IPlayer } from \"../IPlayer\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CodingContractRewardType, ICodingContractReward } from \"../../CodingContracts\";\nimport { Company } from \"../../Company/Company\";\nimport { Companies } from \"../../Company/Companies\";\nimport { getNextCompanyPositionHelper } from \"../../Company/GetNextCompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { determineCrimeSuccess } from \"../../Crime/CrimeHelpers\";\nimport { Crimes } from \"../../Crime/Crimes\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { resetGangs } from \"../../Gang/AllGangs\";\nimport { Cities } from \"../../Locations/Cities\";\nimport { Locations } from \"../../Locations/Locations\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { Sleeve } from \"../../PersonObjects/Sleeve/Sleeve\";\nimport { calculateSkill as calculateSkillF } 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\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { applySourceFile } from \"../../SourceFile/applySourceFile\";\nimport { applyExploit } from \"../../Exploits/applyExploits\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { influenceStockThroughCompanyWork } from \"../../StockMarket/PlayerInfluencing\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nimport Decimal from \"decimal.js\";\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\";\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: IPlayer): void {\n this.currentServer = SpecialServers.Home;\n\n this.numPeopleKilled = 0;\n this.karma = 0;\n\n //Reset stats\n this.hacking_skill = 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 = new Decimal(1000);\n\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n this.companyName = \"\";\n this.jobs = {};\n\n this.purchasedServers = [];\n\n this.factions = [];\n this.factionInvitations = [];\n\n this.queuedAugmentations = [];\n\n this.resleeves = [];\n\n const numSleeves = Math.min(3, SourceFileFlags[10] + (this.bitNodeN === 10 ? 1 : 0)) + this.sleevesFromCovenant;\n if (this.sleeves.length > numSleeves) this.sleeves.length = numSleeves;\n for (let i = this.sleeves.length; i < numSleeves; i++) {\n this.sleeves.push(new Sleeve(this));\n }\n\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n if (this.sleeves[i].shock >= 100) {\n this.sleeves[i].synchronize(this);\n } else {\n this.sleeves[i].shockRecovery(this);\n }\n }\n }\n\n this.isWorking = false;\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.className = \"\";\n this.crimeType = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\n\n this.lastUpdate = new Date().getTime();\n\n // Statistics Trackers\n this.playtimeSinceLastAug = 0;\n this.scriptProdSinceLastAug = 0;\n this.moneySourceA.reset();\n\n this.hacknetNodes.length = 0;\n this.hashManager.prestige();\n\n // Reapply augs, re-calculate skills and reset HP\n this.reapplyAllAugmentations(true);\n this.hp = this.max_hp;\n}\n\nexport function prestigeSourceFile(this: IPlayer): void {\n this.prestigeAugmentation();\n // Duplicate sleeves are reset to level 1 every Bit Node (but the number of sleeves you have persists)\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n this.sleeves[i].prestige(this);\n } else {\n this.sleeves[i] = new Sleeve(this);\n }\n }\n\n if (this.bitNodeN === 10) {\n for (let i = 0; i < this.sleeves.length; i++) {\n this.sleeves[i].shock = Math.max(25, this.sleeves[i].shock);\n this.sleeves[i].sync = Math.max(25, this.sleeves[i].sync);\n }\n }\n\n this.timeWorked = 0;\n\n // Gang\n this.gang = null;\n resetGangs();\n\n // Reset Stock market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n // BitNode 3: Corporatocracy\n this.corporation = null;\n\n this.moneySourceB.reset();\n this.playtimeSinceLastBitnode = 0;\n this.augmentations = [];\n}\n\nexport function receiveInvite(this: IPlayer, factionName: string): void {\n if (this.factionInvitations.includes(factionName) || this.factions.includes(factionName)) {\n return;\n }\n this.factionInvitations.push(factionName);\n}\n\n//Calculates skill level based on experience. The same formula will be used for every skill\nexport function calculateSkill(this: IPlayer, exp: number, mult = 1): number {\n return calculateSkillF(exp, mult);\n}\n\nexport function updateSkillLevels(this: IPlayer): void {\n this.hacking_skill = 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: IPlayer, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.setMoney()\");\n return;\n }\n this.money = new Decimal(money);\n}\n\nexport function gainMoney(this: IPlayer, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.gainMoney()\");\n return;\n }\n this.money = this.money.plus(money);\n}\n\nexport function loseMoney(this: IPlayer, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.loseMoney()\");\n return;\n }\n if (this.money.eq(Infinity) && money === Infinity) return;\n this.money = this.money.minus(money);\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.gte(cost);\n}\n\nexport function recordMoneySource(this: IPlayer, amt: number, source: string): void {\n if (!(this.moneySourceA instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceA was not properly initialized. Resetting`);\n this.moneySourceA = new MoneySourceTracker();\n }\n if (!(this.moneySourceB instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceB was not properly initialized. Resetting`);\n this.moneySourceB = new MoneySourceTracker();\n }\n this.moneySourceA.record(amt, source);\n this.moneySourceB.record(amt, source);\n}\n\nexport function gainHackingExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainHackingExp()\");\n return;\n }\n this.hacking_exp += exp;\n if (this.hacking_exp < 0) {\n this.hacking_exp = 0;\n }\n\n this.hacking_skill = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier);\n}\n\nexport function gainStrengthExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainStrengthExp()\");\n return;\n }\n this.strength_exp += exp;\n if (this.strength_exp < 0) {\n this.strength_exp = 0;\n }\n\n this.strength = calculateSkillF(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier);\n}\n\nexport function gainDefenseExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into player.gainDefenseExp()\");\n return;\n }\n this.defense_exp += exp;\n if (this.defense_exp < 0) {\n this.defense_exp = 0;\n }\n\n this.defense = calculateSkillF(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier);\n}\n\nexport function gainDexterityExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainDexterityExp()\");\n return;\n }\n this.dexterity_exp += exp;\n if (this.dexterity_exp < 0) {\n this.dexterity_exp = 0;\n }\n\n this.dexterity = calculateSkillF(\n this.dexterity_exp,\n this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n}\n\nexport function gainAgilityExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainAgilityExp()\");\n return;\n }\n this.agility_exp += exp;\n if (this.agility_exp < 0) {\n this.agility_exp = 0;\n }\n\n this.agility = calculateSkillF(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier);\n}\n\nexport function gainCharismaExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainCharismaExp()\");\n return;\n }\n this.charisma_exp += exp;\n if (this.charisma_exp < 0) {\n this.charisma_exp = 0;\n }\n\n this.charisma = calculateSkillF(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier);\n}\n\nexport function gainIntelligenceExp(this: IPlayer, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERROR: NaN passed into Player.gainIntelligenceExp()\");\n return;\n }\n if (SourceFileFlags[5] > 0 || this.intelligence > 0) {\n this.intelligence_exp += exp;\n }\n\n this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));\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_skill;\n }\n if (tempStr.includes(\"str\")) {\n return this.strength;\n }\n if (tempStr.includes(\"def\")) {\n return this.defense;\n }\n if (tempStr.includes(\"dex\")) {\n return this.dexterity;\n }\n if (tempStr.includes(\"agi\")) {\n return this.agility;\n }\n if (tempStr.includes(\"cha\")) {\n return this.charisma;\n }\n if (tempStr.includes(\"int\")) {\n return this.intelligence;\n }\n return 0;\n}\n\n/******* Working functions *******/\nexport function resetWorkStatus(this: IPlayer, generalType?: string, group?: string, workType?: string): void {\n if (this.workType !== CONSTANTS.WorkTypeFaction && generalType === this.workType && group === this.companyName)\n return;\n if (generalType === this.workType && group === this.currentWorkFactionName && workType === this.factionWorkType)\n return;\n if (this.isWorking) this.singularityStopWork();\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.timeWorked = 0;\n this.timeWorkedCreateProgram = 0;\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n this.createProgramName = \"\";\n this.className = \"\";\n}\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\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);\n if (this.className) {\n this.recordMoneySource(moneyGain, \"class\");\n } else {\n this.recordMoneySource(moneyGain, \"work\");\n }\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, router: IRouter, companyName: string): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeCompany, companyName);\n this.isWorking = true;\n this.focus = true;\n this.companyName = companyName;\n this.workType = CONSTANTS.WorkTypeCompany;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n router.toWork();\n}\n\nexport function cancelationPenalty(this: IPlayer): number {\n const server = GetServer(this.companyName);\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.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 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 {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 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 half 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\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, router: IRouter, companyName: string): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeCompanyPartTime, companyName);\n this.isWorking = true;\n this.focus = true;\n this.companyName = companyName;\n this.workType = CONSTANTS.WorkTypeCompanyPartTime;\n\n this.workHackExpGainRate = this.getWorkHackExpGain();\n this.workStrExpGainRate = this.getWorkStrExpGain();\n this.workDefExpGainRate = this.getWorkDefExpGain();\n this.workDexExpGainRate = this.getWorkDexExpGain();\n this.workAgiExpGainRate = this.getWorkAgiExpGain();\n this.workChaExpGainRate = this.getWorkChaExpGain();\n this.workRepGainRate = this.getWorkRepGain();\n this.workMoneyGainRate = this.getWorkMoneyGain();\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours;\n router.toWork();\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, router: IRouter, 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.focus = true;\n this.workType = CONSTANTS.WorkTypeFaction;\n this.currentWorkFactionName = faction.name;\n\n this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours;\n router.toWork();\n}\n\nexport function startFactionHackWork(this: IPlayer, router: IRouter, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkHacking);\n\n this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate =\n ((this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel) *\n this.faction_rep_mult *\n this.getIntelligenceBonus(0.5);\n\n this.factionWorkType = CONSTANTS.FactionWorkHacking;\n this.currentWorkFactionDescription = \"carrying out hacking contracts\";\n\n this.startFactionWork(router, faction);\n}\n\nexport function startFactionFieldWork(this: IPlayer, router: IRouter, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkField);\n\n this.workHackExpGainRate = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n\n this.factionWorkType = CONSTANTS.FactionWorkField;\n this.currentWorkFactionDescription = \"carrying out field missions\";\n\n this.startFactionWork(router, faction);\n}\n\nexport function startFactionSecurityWork(this: IPlayer, router: IRouter, faction: Faction): void {\n this.resetWorkStatus(CONSTANTS.WorkTypeFaction, faction.name, CONSTANTS.FactionWorkSecurity);\n\n this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workStrExpGainRate = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDefExpGainRate = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workDexExpGainRate = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workAgiExpGainRate = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workChaExpGainRate = 0.0 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n\n this.factionWorkType = CONSTANTS.FactionWorkSecurity;\n this.currentWorkFactionDescription = \"performing security detail\";\n\n this.startFactionWork(router, faction);\n}\n\nexport function workForFaction(this: IPlayer, numCycles: number): boolean {\n const faction = Factions[this.currentWorkFactionName];\n\n //Constantly update the rep gain rate\n switch (this.factionWorkType) {\n case CONSTANTS.FactionWorkHacking:\n this.workRepGainRate = getHackingWorkRepGain(this, faction);\n break;\n case CONSTANTS.FactionWorkField:\n this.workRepGainRate = getFactionFieldWorkRepGain(this, faction);\n break;\n case CONSTANTS.FactionWorkSecurity:\n this.workRepGainRate = getFactionSecurityWorkRepGain(this, faction);\n break;\n default:\n break;\n }\n\n //Cap the number of cycles being processed to whatever would put you at limit (20 hours)\n let overMax = false;\n if (this.timeWorked + CONSTANTS._idleSpeed * numCycles >= CONSTANTS.MillisecondsPer20Hours) {\n overMax = true;\n numCycles = Math.round((CONSTANTS.MillisecondsPer20Hours - this.timeWorked) / CONSTANTS._idleSpeed);\n }\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n this.processWorkEarnings(numCycles);\n\n //If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours\n if (overMax || this.timeWorked >= CONSTANTS.MillisecondsPer20Hours) {\n this.finishFactionWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishFactionWork(this: IPlayer, cancelled: boolean, sing = false): string {\n const faction = Factions[this.currentWorkFactionName];\n faction.playerReputation += this.workRepGained;\n\n this.updateSkillLevels();\n\n if (!sing) {\n dialogBoxCreate(\n <>\n You worked for your faction {faction.name} for a total of {convertTimeMsToTimeElapsedString(this.timeWorked)}{\" \"}\n <br />\n <br />\n You earned a total of: <br />\n <Money money={this.workMoneyGained} />\n <br />\n <Reputation reputation={this.workRepGained} /> reputation for the faction <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n <br />\n </>,\n );\n }\n\n this.isWorking = false;\n this.resetWorkStatus();\n if (sing) {\n const res =\n \"You worked for your faction \" +\n faction.name +\n \" for a total of \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \". \" +\n \"You earned \" +\n numeralWrapper.formatReputation(this.workRepGained) +\n \" rep, \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\";\n\n return res;\n }\n return \"\";\n}\n\n//Money gained per game cycle\nexport function getWorkMoneyGain(this: IPlayer): number {\n // If player has SF-11, calculate salary multiplier from favor\n let bn11Mult = 1;\n const company = Companies[this.companyName];\n if (SourceFileFlags[11] > 0) {\n bn11Mult = 1 + company.favor / 100;\n }\n\n // Get base salary\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPosition == null) {\n console.error(`Could not find CompanyPosition object for ${companyPositionName}. Work salary will be 0`);\n return 0;\n }\n\n return (\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult\n );\n}\n\n//Hack exp gained per game cycle\nexport function getWorkHackExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work hack exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Str exp gained per game cycle\nexport function getWorkStrExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work str exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Def exp gained per game cycle\nexport function getWorkDefExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work def exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Dex exp gained per game cycle\nexport function getWorkDexExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work dex exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Agi exp gained per game cycle\nexport function getWorkAgiExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work agi exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Charisma exp gained per game cycle\nexport function getWorkChaExpGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work cha exp gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n return (\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain\n );\n}\n\n//Reputation gained per game cycle\nexport function getWorkRepGain(this: IPlayer): number {\n const company = Companies[this.companyName];\n const companyPositionName = this.jobs[this.companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (company == null || companyPosition == null) {\n console.error(\n [\n `Could not find Company object for ${this.companyName}`,\n `or CompanyPosition object for ${companyPositionName}.`,\n `Work rep gain will be 0`,\n ].join(\" \"),\n );\n return 0;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n this.hacking_skill,\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_skill / 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_skill / CONSTANTS.MaxSkillLevel +\n// this.strength / CONSTANTS.MaxSkillLevel +\n// this.defense / CONSTANTS.MaxSkillLevel +\n// this.dexterity / CONSTANTS.MaxSkillLevel +\n// this.agility / CONSTANTS.MaxSkillLevel +\n// this.charisma / CONSTANTS.MaxSkillLevel +\n// this.intelligence / CONSTANTS.MaxSkillLevel) / 5.5;\n// return t * this.faction_rep_mult;\n// }\n\n/* Creating a Program */\nexport function startCreateProgramWork(\n this: IPlayer,\n router: IRouter,\n programName: string,\n time: number,\n reqLevel: number,\n): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.focus = true;\n this.workType = CONSTANTS.WorkTypeCreateProgram;\n\n //Time needed to complete work affected by hacking skill (linearly based on\n //ratio of (your skill - required level) to MAX skill)\n //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking_skill - 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 router.toWork();\n}\n\nexport function createProgramWork(this: IPlayer, numCycles: number): boolean {\n //Higher hacking skill will allow you to create programs faster\n const reqLvl = this.createProgramReqLvl;\n let skillMult = (this.hacking_skill / 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\n //Skill multiplier directly applied to \"time worked\"\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.timeWorkedCreateProgram += CONSTANTS._idleSpeed * numCycles * skillMult;\n\n if (this.timeWorkedCreateProgram >= this.timeNeededToCompleteWork) {\n this.finishCreateProgramWork(false);\n return true;\n }\n return false;\n}\n\nexport function finishCreateProgramWork(this: IPlayer, cancelled: boolean): string {\n const programName = this.createProgramName;\n if (cancelled === false) {\n dialogBoxCreate(\n \"You've finished creating \" + programName + \"!<br>\" + \"The new program can be found on your home computer.\",\n );\n\n this.getHomeComputer().programs.push(programName);\n } else {\n const perc = (Math.floor((this.timeWorkedCreateProgram / this.timeNeededToCompleteWork) * 10000) / 100).toString();\n const incompleteName = programName + \"-\" + perc + \"%-INC\";\n this.getHomeComputer().programs.push(incompleteName);\n }\n\n if (!cancelled) {\n this.gainIntelligenceExp(this.createProgramReqLvl / CONSTANTS.IntelligenceProgramBaseExpGain);\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\n/* Studying/Taking Classes */\nexport function startClass(this: IPlayer, router: IRouter, costMult: number, expMult: number, className: string): void {\n this.resetWorkStatus();\n this.isWorking = true;\n this.focus = true;\n this.workType = CONSTANTS.WorkTypeStudyClass;\n\n this.className = className;\n\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 = this.hashManager;\n switch (className) {\n case CONSTANTS.ClassStudyComputerScience:\n hackExp = ((CONSTANTS.ClassStudyComputerScienceBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassDataStructures:\n cost = (CONSTANTS.ClassDataStructuresBaseCost * costMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassDataStructuresBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassNetworks:\n cost = (CONSTANTS.ClassNetworksBaseCost * costMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassNetworksBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassAlgorithms:\n cost = (CONSTANTS.ClassAlgorithmsBaseCost * costMult) / gameCPS;\n hackExp = ((CONSTANTS.ClassAlgorithmsBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassManagement:\n cost = (CONSTANTS.ClassManagementBaseCost * costMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassManagementBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassLeadership:\n cost = (CONSTANTS.ClassLeadershipBaseCost * costMult) / gameCPS;\n chaExp = ((CONSTANTS.ClassLeadershipBaseExp * expMult) / gameCPS) * hashManager.getStudyMult();\n break;\n case CONSTANTS.ClassGymStrength:\n cost = (CONSTANTS.ClassGymBaseCost * costMult) / gameCPS;\n strExp = (expMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymDefense:\n cost = (CONSTANTS.ClassGymBaseCost * costMult) / gameCPS;\n defExp = (expMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymDexterity:\n cost = (CONSTANTS.ClassGymBaseCost * costMult) / gameCPS;\n dexExp = (expMult / gameCPS) * hashManager.getTrainingMult();\n break;\n case CONSTANTS.ClassGymAgility:\n cost = (CONSTANTS.ClassGymBaseCost * costMult) / gameCPS;\n agiExp = (expMult / gameCPS) * hashManager.getTrainingMult();\n break;\n default:\n throw new Error(\"ERR: Invalid/unrecognized class name\");\n return;\n }\n\n this.workMoneyLossRate = cost;\n this.workHackExpGainRate = hackExp * this.hacking_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n this.workStrExpGainRate = strExp * this.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n this.workDefExpGainRate = defExp * this.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n this.workAgiExpGainRate = agiExp * this.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n this.workChaExpGainRate = chaExp * this.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain;\n router.toWork();\n}\n\nexport function takeClass(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n this.processWorkEarnings(numCycles);\n return false;\n}\n\n//The 'sing' argument defines whether or not this function was called\n//through a Singularity Netscript function\nexport function finishClass(this: IPlayer, sing = false): string {\n this.gainIntelligenceExp(CONSTANTS.IntelligenceClassBaseExpGain * Math.round(this.timeWorked / 1000));\n\n if (this.workMoneyGained > 0) {\n throw new Error(\"ERR: Somehow gained money while taking class\");\n }\n\n this.updateSkillLevels();\n if (!sing) {\n dialogBoxCreate(\n <>\n After {this.className} for {convertTimeMsToTimeElapsedString(this.timeWorked)}, <br />\n you spent a total of <Money money={-this.workMoneyGained} />. <br />\n <br />\n You earned a total of: <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking exp <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength exp <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense exp <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity exp <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility exp <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma exp\n <br />\n </>,\n );\n }\n\n this.isWorking = false;\n\n if (sing) {\n const res =\n \"After \" +\n this.className +\n \" for \" +\n convertTimeMsToTimeElapsedString(this.timeWorked) +\n \", \" +\n \"you spent a total of \" +\n numeralWrapper.formatMoney(this.workMoneyGained * -1) +\n \". \" +\n \"You earned a total of: \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hacking exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" strength exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" defense exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dexterity exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agility exp, and \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" charisma exp\";\n this.resetWorkStatus();\n return res;\n }\n this.resetWorkStatus();\n return \"\";\n}\n\n//The EXP and $ gains are hardcoded. Time is in ms\nexport function startCrime(\n this: IPlayer,\n router: IRouter,\n crimeType: string,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n workerscript: WorkerScript | null = null,\n): void {\n this.crimeType = crimeType;\n\n this.resetWorkStatus();\n this.isWorking = true;\n this.focus = true;\n this.workType = CONSTANTS.WorkTypeCrime;\n\n if (workerscript !== null) {\n this.committingCrimeThruSingFn = true;\n this.singFnCrimeWorkerScript = workerscript;\n }\n\n this.workHackExpGained = hackExp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workStrExpGained = strExp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDefExpGained = defExp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workDexExpGained = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workAgiExpGained = agiExp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workChaExpGained = chaExp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.timeNeededToCompleteWork = time;\n router.toWork();\n}\n\nexport function commitCrime(this: IPlayer, numCycles: number): boolean {\n this.timeWorked += CONSTANTS._idleSpeed * numCycles;\n\n if (this.timeWorked >= this.timeNeededToCompleteWork) {\n this.finishCrime(false);\n return true;\n }\n return false;\n}\n\nexport function finishCrime(this: IPlayer, cancelled: boolean): string {\n //Determine crime success/failure\n if (!cancelled) {\n if (determineCrimeSuccess(this, this.crimeType)) {\n //Handle Karma and crime statistics\n let crime = null;\n for (const i in 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);\n this.recordMoneySource(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 \"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 \"Crime failed! Gained \" +\n numeralWrapper.formatExp(this.workHackExpGained) +\n \" hack exp, \" +\n numeralWrapper.formatExp(this.workStrExpGained) +\n \" str exp, \" +\n numeralWrapper.formatExp(this.workDefExpGained) +\n \" def exp, \" +\n numeralWrapper.formatExp(this.workDexExpGained) +\n \" dex exp, \" +\n numeralWrapper.formatExp(this.workAgiExpGained) +\n \" agi exp, \" +\n numeralWrapper.formatExp(this.workChaExpGained) +\n \" cha exp.\",\n );\n }\n } else {\n dialogBoxCreate(\n <>\n Crime failed!\n <br />\n <br />\n You gained:\n <br />\n {numeralWrapper.formatExp(this.workHackExpGained)} hacking experience <br />\n {numeralWrapper.formatExp(this.workStrExpGained)} strength experience\n <br />\n {numeralWrapper.formatExp(this.workDefExpGained)} defense experience\n <br />\n {numeralWrapper.formatExp(this.workDexExpGained)} dexterity experience\n <br />\n {numeralWrapper.formatExp(this.workAgiExpGained)} agility experience\n <br />\n {numeralWrapper.formatExp(this.workChaExpGained)} charisma experience\n </>,\n );\n }\n }\n\n this.gainHackingExp(this.workHackExpGained);\n this.gainStrengthExp(this.workStrExpGained);\n this.gainDefenseExp(this.workDefExpGained);\n this.gainDexterityExp(this.workDexExpGained);\n this.gainAgilityExp(this.workAgiExpGained);\n this.gainCharismaExp(this.workChaExpGained);\n }\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n this.isWorking = false;\n this.crimeType = \"\";\n this.resetWorkStatus();\n return \"\";\n}\n\n//Cancels the player's current \"work\" assignment and gives the proper rewards\n//Used only for Singularity functions, so no popups are created\nexport function singularityStopWork(this: IPlayer): string {\n if (!this.isWorking) {\n return \"\";\n }\n let res = \"\"; //Earnings text for work\n switch (this.workType) {\n case CONSTANTS.WorkTypeStudyClass:\n res = this.finishClass(true);\n break;\n case CONSTANTS.WorkTypeCompany:\n res = this.finishWork(true, true);\n break;\n case CONSTANTS.WorkTypeCompanyPartTime:\n res = this.finishWorkPartTime(true);\n break;\n case CONSTANTS.WorkTypeFaction:\n res = this.finishFactionWork(true, true);\n break;\n case CONSTANTS.WorkTypeCreateProgram:\n res = this.finishCreateProgramWork(true);\n break;\n case CONSTANTS.WorkTypeCrime:\n res = this.finishCrime(true);\n break;\n default:\n console.error(`Unrecognized work type (${this.workType})`);\n return \"\";\n }\n return res;\n}\n\n// Returns true if hospitalized, false otherwise\nexport function takeDamage(this: IPlayer, amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp -= amt;\n if (this.hp <= 0) {\n this.hospitalize();\n return true;\n } else {\n return false;\n }\n}\n\nexport function regenerateHp(this: IPlayer, amt: number): void {\n if (typeof amt !== \"number\") {\n console.warn(`Player.regenerateHp() called without a numeric argument: ${amt}`);\n return;\n }\n this.hp += amt;\n if (this.hp > this.max_hp) {\n this.hp = this.max_hp;\n }\n}\n\nexport function hospitalize(this: IPlayer): number {\n const cost = getHospitalizationCost(this);\n if (Settings.SuppressHospitalizationPopup === false) {\n dialogBoxCreate(\n <>\n You were in critical condition! You were taken to the hospital where luckily they were able to save your life.\n You were charged \n <Money money={cost} />\n </>,\n );\n }\n\n this.loseMoney(cost);\n this.recordMoneySource(-1 * cost, \"hospitalization\");\n this.hp = this.max_hp;\n return cost;\n}\n\n/********* Company job application **********/\n//Determines the job that the Player should get (if any) at the current company\n//The 'sing' argument designates whether or not this is being called from\n//the applyToCompany() Netscript Singularity function\nexport function applyForJob(this: IPlayer, entryPosType: CompanyPosition, sing = false): boolean {\n // Get current company and job\n let currCompany = null;\n if (this.companyName !== \"\") {\n currCompany = Companies[this.companyName];\n }\n const currPositionName = this.jobs[this.companyName];\n\n // Get company that's being applied to\n const company = Companies[this.location]; //Company being applied to\n if (!(company instanceof Company)) {\n console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);\n return false;\n }\n\n let pos = entryPosType;\n\n if (!this.isQualified(company, pos)) {\n const reqText = getJobRequirementText(company, pos);\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position<br>\" + reqText);\n }\n return false;\n }\n\n while (true) {\n const newPos = getNextCompanyPositionHelper(pos);\n if (newPos == null) {\n break;\n }\n\n //Check if this company has this position\n if (company.hasPosition(newPos)) {\n if (!this.isQualified(company, newPos)) {\n //If player not qualified for next job, break loop so player will be given current job\n break;\n }\n pos = newPos;\n } else {\n break;\n }\n }\n\n //Check if the determined job is the same as the player's current job\n if (currCompany != null) {\n if (currCompany.name == company.name && pos.name == currPositionName) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null) {\n if (!sing) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n }\n return false;\n } else if (company.hasPosition(nextPos)) {\n if (!sing) {\n const reqText = getJobRequirementText(company, nextPos);\n dialogBoxCreate(\"Unfortunately, you do not qualify for a promotion<br>\" + reqText);\n }\n return false;\n } else {\n if (!sing) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n }\n return false;\n }\n return false; //Same job, do nothing\n }\n }\n\n this.jobs[company.name] = pos.name;\n this.companyName = this.location;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations! You were offered a new job at \" + this.companyName + \" as a \" + pos.name + \"!\");\n }\n return true;\n}\n\n//Returns your next position at a company given the field (software, business, etc.)\nexport function getNextCompanyPosition(\n this: IPlayer,\n company: Company,\n entryPosType: CompanyPosition,\n): CompanyPosition | null {\n let currCompany = null;\n if (this.companyName !== \"\") {\n currCompany = Companies[this.companyName];\n }\n\n //Not employed at this company, so return the entry position\n if (currCompany == null || currCompany.name != company.name) {\n return entryPosType;\n }\n\n //If the entry pos type and the player's current position have the same type,\n //return the player's \"nextCompanyPosition\". Otherwise return the entryposType\n //Employed at this company, so just return the next position if it exists.\n const currentPositionName = this.jobs[this.companyName];\n const currentPosition = CompanyPositions[currentPositionName];\n if (\n (currentPosition.isSoftwareJob() && entryPosType.isSoftwareJob()) ||\n (currentPosition.isITJob() && entryPosType.isITJob()) ||\n (currentPosition.isBusinessJob() && entryPosType.isBusinessJob()) ||\n (currentPosition.isSecurityEngineerJob() && entryPosType.isSecurityEngineerJob()) ||\n (currentPosition.isNetworkEngineerJob() && entryPosType.isNetworkEngineerJob()) ||\n (currentPosition.isSecurityJob() && entryPosType.isSecurityJob()) ||\n (currentPosition.isAgentJob() && entryPosType.isAgentJob()) ||\n (currentPosition.isSoftwareConsultantJob() && entryPosType.isSoftwareConsultantJob()) ||\n (currentPosition.isBusinessConsultantJob() && entryPosType.isBusinessConsultantJob()) ||\n (currentPosition.isPartTimeJob() && entryPosType.isPartTimeJob())\n ) {\n return getNextCompanyPositionHelper(currentPosition);\n }\n\n return entryPosType;\n}\n\nexport function quitJob(this: IPlayer, company: string): void {\n this.isWorking = false;\n this.companyName = \"\";\n delete this.jobs[company];\n}\n\nexport function applyForSoftwareJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareCompanyPositions[0]], sing);\n}\n\nexport function applyForSoftwareConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForItJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.ITCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]])) {\n return this.applyForJob(CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]], sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForNetworkEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForBusinessJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessCompanyPositions[0]], sing);\n}\n\nexport function applyForBusinessConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityJob(this: IPlayer, sing = false): boolean {\n // TODO Police Jobs\n // Indexing starts at 2 because 0 is for police officer\n return this.applyForJob(CompanyPositions[posNames.SecurityCompanyPositions[2]], sing);\n}\n\nexport function applyForAgentJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.AgentCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.AgentCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.MiscCompanyPositions[1]])) {\n this.companyName = company.name;\n this.jobs[company.name] = posNames.MiscCompanyPositions[1];\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed at \" + this.companyName);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForPartTimeEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.PartTimeCompanyPositions[1]])) {\n this.jobs[company.name] = posNames.PartTimeCompanyPositions[1];\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed part-time at \" + this.companyName);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.MiscCompanyPositions[0]])) {\n this.companyName = company.name;\n this.jobs[company.name] = posNames.MiscCompanyPositions[0];\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a waiter at \" + this.companyName);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForPartTimeWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.PartTimeCompanyPositions[0]])) {\n this.companyName = company.name;\n this.jobs[company.name] = posNames.PartTimeCompanyPositions[0];\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a part-time waiter at \" + this.companyName);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unforunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\n//Checks if the Player is qualified for a certain position\nexport function isQualified(this: IPlayer, company: Company, position: CompanyPosition): boolean {\n const offset = company.jobStatReqOffset;\n const reqHacking = position.requiredHacking > 0 ? position.requiredHacking + offset : 0;\n const reqStrength = position.requiredStrength > 0 ? position.requiredStrength + offset : 0;\n const reqDefense = position.requiredDefense > 0 ? position.requiredDefense + offset : 0;\n const reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;\n\n if (\n this.hacking_skill >= reqHacking &&\n this.strength >= reqStrength &&\n this.defense >= reqDefense &&\n this.dexterity >= reqDexterity &&\n this.agility >= reqAgility &&\n this.charisma >= reqCharisma &&\n company.playerReputation >= position.requiredReputation\n ) {\n return true;\n }\n return false;\n}\n\n/********** Reapplying Augmentations and Source File ***********/\nexport function reapplyAllAugmentations(this: IPlayer, resetMultipliers = true): void {\n if (resetMultipliers) {\n this.resetMultipliers();\n }\n\n for (let i = 0; i < this.augmentations.length; ++i) {\n //Compatibility with new version\n if (this.augmentations[i].name === \"HacknetNode NIC Architecture Neural-Upload\") {\n this.augmentations[i].name = \"Hacknet Node NIC Architecture Neural-Upload\";\n }\n\n const augName = this.augmentations[i].name;\n const aug = Augmentations[augName];\n if (aug == null) {\n console.warn(`Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${augName} will be skipped`);\n continue;\n }\n aug.owned = true;\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n for (let j = 0; j < aug.level; ++j) {\n applyAugmentation(this.augmentations[i], true);\n }\n continue;\n }\n applyAugmentation(this.augmentations[i], true);\n }\n\n this.updateSkillLevels();\n}\n\nexport function reapplyAllSourceFiles(this: IPlayer): void {\n //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset\n //this.resetMultipliers();\n\n for (let i = 0; i < this.sourceFiles.length; ++i) {\n const srcFileKey = \"SourceFile\" + this.sourceFiles[i].n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${this.sourceFiles[i].n}`);\n continue;\n }\n applySourceFile(this.sourceFiles[i]);\n }\n applyExploit();\n}\n\n/*************** Check for Faction Invitations *************/\n//This function sets the requirements to join a Faction. It checks whether the Player meets\n//those requirements and will return an array of all factions that the Player should\n//receive an invitation to\nexport function checkForFactionInvitations(this: IPlayer): Faction[] {\n const invitedFactions: Faction[] = []; //Array which will hold all Factions the player should be invited to\n\n const numAugmentations = this.augmentations.length;\n\n const allCompanies = Object.keys(this.jobs);\n const allPositions = Object.values(this.jobs);\n\n // Given a company name, safely returns the reputation (returns 0 if invalid company is specified)\n function getCompanyRep(companyName: string): number {\n const company = Companies[companyName];\n if (company == null) {\n return 0;\n } else {\n return company.playerReputation;\n }\n }\n\n // Helper function that returns a boolean indicating whether the Player meets\n // the requirements for the specified company. There are two requirements:\n // 1. High enough reputation\n // 2. Player is employed at the company\n function checkMegacorpRequirements(companyName: string, repNeeded = CONSTANTS.CorpFactionRepRequirement): boolean {\n return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded;\n }\n\n //Illuminati\n const illuminatiFac = Factions[\"Illuminati\"];\n if (\n !illuminatiFac.isBanned &&\n !illuminatiFac.isMember &&\n !illuminatiFac.alreadyInvited &&\n numAugmentations >= 30 &&\n this.money.gte(150000000000) &&\n this.hacking_skill >= 1500 &&\n this.strength >= 1200 &&\n this.defense >= 1200 &&\n this.dexterity >= 1200 &&\n this.agility >= 1200\n ) {\n invitedFactions.push(illuminatiFac);\n }\n\n //Daedalus\n const daedalusFac = Factions[\"Daedalus\"];\n if (\n !daedalusFac.isBanned &&\n !daedalusFac.isMember &&\n !daedalusFac.alreadyInvited &&\n numAugmentations >= Math.round(30 * BitNodeMultipliers.DaedalusAugsRequirement) &&\n this.money.gte(100000000000) &&\n (this.hacking_skill >= 2500 ||\n (this.strength >= 1500 && this.defense >= 1500 && this.dexterity >= 1500 && this.agility >= 1500))\n ) {\n invitedFactions.push(daedalusFac);\n }\n\n //The Covenant\n const covenantFac = Factions[\"The Covenant\"];\n if (\n !covenantFac.isBanned &&\n !covenantFac.isMember &&\n !covenantFac.alreadyInvited &&\n numAugmentations >= 20 &&\n this.money.gte(75000000000) &&\n this.hacking_skill >= 850 &&\n this.strength >= 850 &&\n this.defense >= 850 &&\n this.dexterity >= 850 &&\n this.agility >= 850\n ) {\n invitedFactions.push(covenantFac);\n }\n\n //ECorp\n const ecorpFac = Factions[\"ECorp\"];\n if (\n !ecorpFac.isBanned &&\n !ecorpFac.isMember &&\n !ecorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumECorp)\n ) {\n invitedFactions.push(ecorpFac);\n }\n\n //MegaCorp\n const megacorpFac = Factions[\"MegaCorp\"];\n if (\n !megacorpFac.isBanned &&\n !megacorpFac.isMember &&\n !megacorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12MegaCorp)\n ) {\n invitedFactions.push(megacorpFac);\n }\n\n //Bachman & Associates\n const bachmanandassociatesFac = Factions[\"Bachman & Associates\"];\n if (\n !bachmanandassociatesFac.isBanned &&\n !bachmanandassociatesFac.isMember &&\n !bachmanandassociatesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumBachmanAndAssociates)\n ) {\n invitedFactions.push(bachmanandassociatesFac);\n }\n\n //Blade Industries\n const bladeindustriesFac = Factions[\"Blade Industries\"];\n if (\n !bladeindustriesFac.isBanned &&\n !bladeindustriesFac.isMember &&\n !bladeindustriesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12BladeIndustries)\n ) {\n invitedFactions.push(bladeindustriesFac);\n }\n\n //NWO\n const nwoFac = Factions[\"NWO\"];\n if (\n !nwoFac.isBanned &&\n !nwoFac.isMember &&\n !nwoFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenNWO)\n ) {\n invitedFactions.push(nwoFac);\n }\n\n //Clarke Incorporated\n const clarkeincorporatedFac = Factions[\"Clarke Incorporated\"];\n if (\n !clarkeincorporatedFac.isBanned &&\n !clarkeincorporatedFac.isMember &&\n !clarkeincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumClarkeIncorporated)\n ) {\n invitedFactions.push(clarkeincorporatedFac);\n }\n\n //OmniTek Incorporated\n const omnitekincorporatedFac = Factions[\"OmniTek Incorporated\"];\n if (\n !omnitekincorporatedFac.isBanned &&\n !omnitekincorporatedFac.isMember &&\n !omnitekincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenOmniTekIncorporated)\n ) {\n invitedFactions.push(omnitekincorporatedFac);\n }\n\n //Four Sigma\n const foursigmaFac = Factions[\"Four Sigma\"];\n if (\n !foursigmaFac.isBanned &&\n !foursigmaFac.isMember &&\n !foursigmaFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12FourSigma)\n ) {\n invitedFactions.push(foursigmaFac);\n }\n\n //KuaiGong International\n const kuaigonginternationalFac = Factions[\"KuaiGong International\"];\n if (\n !kuaigonginternationalFac.isBanned &&\n !kuaigonginternationalFac.isMember &&\n !kuaigonginternationalFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.ChongqingKuaiGongInternational)\n ) {\n invitedFactions.push(kuaigonginternationalFac);\n }\n\n //Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company\n const fulcrumsecrettechonologiesFac = Factions[\"Fulcrum Secret Technologies\"];\n const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);\n if (!(fulcrumSecretServer instanceof Server)) throw new Error(\"Fulcrum Secret Technologies should be normal server\");\n if (fulcrumSecretServer == null) {\n console.error(\"Could not find Fulcrum Secret Technologies Server\");\n } else {\n if (\n !fulcrumsecrettechonologiesFac.isBanned &&\n !fulcrumsecrettechonologiesFac.isMember &&\n !fulcrumsecrettechonologiesFac.alreadyInvited &&\n fulcrumSecretServer.backdoorInstalled &&\n checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies, 250e3)\n ) {\n invitedFactions.push(fulcrumsecrettechonologiesFac);\n }\n }\n\n //BitRunners\n const bitrunnersFac = Factions[\"BitRunners\"];\n const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer);\n if (!(bitrunnersServer instanceof Server)) throw new Error(\"BitRunners should be normal server\");\n if (bitrunnersServer == null) {\n console.error(\"Could not find BitRunners Server\");\n } else if (\n !bitrunnersFac.isBanned &&\n !bitrunnersFac.isMember &&\n bitrunnersServer.backdoorInstalled &&\n !bitrunnersFac.alreadyInvited\n ) {\n invitedFactions.push(bitrunnersFac);\n }\n\n //The Black Hand\n\n const theblackhandFac = Factions[\"The Black Hand\"];\n const blackhandServer = GetServer(SpecialServers.TheBlackHandServer);\n if (!(blackhandServer instanceof Server)) throw new Error(\"TheBlackHand should be normal server\");\n if (blackhandServer == null) {\n console.error(\"Could not find The Black Hand Server\");\n } else if (\n !theblackhandFac.isBanned &&\n !theblackhandFac.isMember &&\n blackhandServer.backdoorInstalled &&\n !theblackhandFac.alreadyInvited\n ) {\n invitedFactions.push(theblackhandFac);\n }\n\n //NiteSec\n const nitesecFac = Factions[\"NiteSec\"];\n const nitesecServer = GetServer(SpecialServers.NiteSecServer);\n if (!(nitesecServer instanceof Server)) throw new Error(\"NiteSec should be normal server\");\n if (nitesecServer == null) {\n console.error(\"Could not find NiteSec Server\");\n } else if (\n !nitesecFac.isBanned &&\n !nitesecFac.isMember &&\n nitesecServer.backdoorInstalled &&\n !nitesecFac.alreadyInvited\n ) {\n invitedFactions.push(nitesecFac);\n }\n\n //Chongqing\n const chongqingFac = Factions[\"Chongqing\"];\n if (\n !chongqingFac.isBanned &&\n !chongqingFac.isMember &&\n !chongqingFac.alreadyInvited &&\n this.money.gte(20000000) &&\n this.city == CityName.Chongqing\n ) {\n invitedFactions.push(chongqingFac);\n }\n\n //Sector-12\n const sector12Fac = Factions[\"Sector-12\"];\n if (\n !sector12Fac.isBanned &&\n !sector12Fac.isMember &&\n !sector12Fac.alreadyInvited &&\n this.money.gte(15000000) &&\n this.city == CityName.Sector12\n ) {\n invitedFactions.push(sector12Fac);\n }\n\n //New Tokyo\n const newtokyoFac = Factions[\"New Tokyo\"];\n if (\n !newtokyoFac.isBanned &&\n !newtokyoFac.isMember &&\n !newtokyoFac.alreadyInvited &&\n this.money.gte(20000000) &&\n this.city == CityName.NewTokyo\n ) {\n invitedFactions.push(newtokyoFac);\n }\n\n //Aevum\n const aevumFac = Factions[\"Aevum\"];\n if (\n !aevumFac.isBanned &&\n !aevumFac.isMember &&\n !aevumFac.alreadyInvited &&\n this.money.gte(40000000) &&\n this.city == CityName.Aevum\n ) {\n invitedFactions.push(aevumFac);\n }\n\n //Ishima\n const ishimaFac = Factions[\"Ishima\"];\n if (\n !ishimaFac.isBanned &&\n !ishimaFac.isMember &&\n !ishimaFac.alreadyInvited &&\n this.money.gte(30000000) &&\n this.city == CityName.Ishima\n ) {\n invitedFactions.push(ishimaFac);\n }\n\n //Volhaven\n const volhavenFac = Factions[\"Volhaven\"];\n if (\n !volhavenFac.isBanned &&\n !volhavenFac.isMember &&\n !volhavenFac.alreadyInvited &&\n this.money.gte(50000000) &&\n this.city == CityName.Volhaven\n ) {\n invitedFactions.push(volhavenFac);\n }\n\n //Speakers for the Dead\n const speakersforthedeadFac = Factions[\"Speakers for the Dead\"];\n if (\n !speakersforthedeadFac.isBanned &&\n !speakersforthedeadFac.isMember &&\n !speakersforthedeadFac.alreadyInvited &&\n this.hacking_skill >= 100 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.agility >= 300 &&\n this.numPeopleKilled >= 30 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(speakersforthedeadFac);\n }\n\n //The Dark Army\n const thedarkarmyFac = Factions[\"The Dark Army\"];\n if (\n !thedarkarmyFac.isBanned &&\n !thedarkarmyFac.isMember &&\n !thedarkarmyFac.alreadyInvited &&\n this.hacking_skill >= 300 &&\n this.strength >= 300 &&\n this.defense >= 300 &&\n this.dexterity >= 300 &&\n this.agility >= 300 &&\n this.city == CityName.Chongqing &&\n this.numPeopleKilled >= 5 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thedarkarmyFac);\n }\n\n //The Syndicate\n const thesyndicateFac = Factions[\"The Syndicate\"];\n if (\n !thesyndicateFac.isBanned &&\n !thesyndicateFac.isMember &&\n !thesyndicateFac.alreadyInvited &&\n this.hacking_skill >= 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.gte(10000000) &&\n this.karma <= -90 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thesyndicateFac);\n }\n\n //Silhouette\n const silhouetteFac = Factions[\"Silhouette\"];\n if (\n !silhouetteFac.isBanned &&\n !silhouetteFac.isMember &&\n !silhouetteFac.alreadyInvited &&\n (allPositions.includes(\"Chief Technology Officer\") ||\n allPositions.includes(\"Chief Financial Officer\") ||\n allPositions.includes(\"Chief Executive Officer\")) &&\n this.money.gte(15000000) &&\n this.karma <= -22\n ) {\n invitedFactions.push(silhouetteFac);\n }\n\n //Tetrads\n const tetradsFac = Factions[\"Tetrads\"];\n if (\n !tetradsFac.isBanned &&\n !tetradsFac.isMember &&\n !tetradsFac.alreadyInvited &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima) &&\n this.strength >= 75 &&\n this.defense >= 75 &&\n this.dexterity >= 75 &&\n this.agility >= 75 &&\n this.karma <= -18\n ) {\n invitedFactions.push(tetradsFac);\n }\n\n //SlumSnakes\n const slumsnakesFac = Factions[\"Slum Snakes\"];\n if (\n !slumsnakesFac.isBanned &&\n !slumsnakesFac.isMember &&\n !slumsnakesFac.alreadyInvited &&\n this.strength >= 30 &&\n this.defense >= 30 &&\n this.dexterity >= 30 &&\n this.agility >= 30 &&\n this.karma <= -9 &&\n this.money.gte(1000000)\n ) {\n invitedFactions.push(slumsnakesFac);\n }\n\n //Netburners\n const netburnersFac = Factions[\"Netburners\"];\n let totalHacknetRam = 0;\n let totalHacknetCores = 0;\n let totalHacknetLevels = 0;\n for (let i = 0; i < this.hacknetNodes.length; ++i) {\n const v = this.hacknetNodes[i];\n if (typeof v === \"string\") {\n const hserver = GetServer(v);\n if (hserver === null || !(hserver instanceof HacknetServer))\n throw new Error(\"player hacknet server was not HacknetServer\");\n totalHacknetLevels += hserver.level;\n totalHacknetRam += hserver.maxRam;\n totalHacknetCores += hserver.cores;\n } else {\n totalHacknetLevels += v.level;\n totalHacknetRam += v.ram;\n totalHacknetCores += v.cores;\n }\n }\n if (\n !netburnersFac.isBanned &&\n !netburnersFac.isMember &&\n !netburnersFac.alreadyInvited &&\n this.hacking_skill >= 80 &&\n totalHacknetRam >= 8 &&\n totalHacknetCores >= 4 &&\n totalHacknetLevels >= 100\n ) {\n invitedFactions.push(netburnersFac);\n }\n\n //Tian Di Hui\n const tiandihuiFac = Factions[\"Tian Di Hui\"];\n if (\n !tiandihuiFac.isBanned &&\n !tiandihuiFac.isMember &&\n !tiandihuiFac.alreadyInvited &&\n this.money.gte(1000000) &&\n this.hacking_skill >= 50 &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima)\n ) {\n invitedFactions.push(tiandihuiFac);\n }\n\n //CyberSec\n const cybersecFac = Factions[\"CyberSec\"];\n const cybersecServer = GetServer(SpecialServers.CyberSecServer);\n if (!(cybersecServer instanceof Server)) throw new Error(\"cybersec should be normal server\");\n if (cybersecServer == null) {\n console.error(\"Could not find CyberSec Server\");\n } else if (\n !cybersecFac.isBanned &&\n !cybersecFac.isMember &&\n cybersecServer.backdoorInstalled &&\n !cybersecFac.alreadyInvited\n ) {\n invitedFactions.push(cybersecFac);\n }\n\n return invitedFactions;\n}\n\n/************* BitNodes **************/\nexport function setBitNodeNumber(this: IPlayer, n: number): void {\n this.bitNodeN = n;\n}\n\nexport function queueAugmentation(this: IPlayer, name: string): void {\n for (const i in this.queuedAugmentations) {\n if (this.queuedAugmentations[i].name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n for (const i in this.augmentations) {\n if (this.augmentations[i].name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n this.queuedAugmentations.push(new PlayerOwnedAugmentation(name));\n}\n\n/************* Coding Contracts **************/\nexport function gainCodingContractReward(this: IPlayer, reward: ICodingContractReward, difficulty = 1): string {\n if (reward == null || reward.type == null || reward == null) {\n return `No reward for this contract`;\n }\n\n /* eslint-disable no-case-declarations */\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation:\n if (reward.name == null || !(Factions[reward.name] instanceof Faction)) {\n // If no/invalid faction was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n Factions[reward.name].playerReputation += repGain;\n return `Gained ${repGain} faction reputation for ${reward.name}`;\n case CodingContractRewardType.FactionReputationAll:\n const totalGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n\n // Ignore Bladeburners and other special factions for this calculation\n const specialFactions = [\"Bladeburners\"];\n const factions = this.factions.slice().filter((f) => {\n return !specialFactions.includes(f);\n });\n\n // If the player was only part of the special factions, we'll just give money\n if (factions.length == 0) {\n reward.type = CodingContractRewardType.Money;\n return this.gainCodingContractReward(reward, difficulty);\n }\n\n const gainPerFaction = Math.floor(totalGain / factions.length);\n for (const facName of factions) {\n if (!(Factions[facName] instanceof Faction)) {\n continue;\n }\n Factions[facName].playerReputation += gainPerFaction;\n }\n return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.toString()}`;\n break;\n case CodingContractRewardType.CompanyReputation: {\n if (reward.name == null || !(Companies[reward.name] instanceof Company)) {\n //If no/invalid company was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseCompanyRepGain * difficulty;\n Companies[reward.name].playerReputation += repGain;\n return `Gained ${repGain} company reputation for ${reward.name}`;\n }\n case CodingContractRewardType.Money:\n default: {\n const moneyGain = CONSTANTS.CodingContractBaseMoneyGain * difficulty * BitNodeMultipliers.CodingContractMoney;\n this.gainMoney(moneyGain);\n this.recordMoneySource(moneyGain, \"codingcontract\");\n return `Gained ${numeralWrapper.formatMoney(moneyGain)}`;\n }\n }\n /* eslint-enable no-case-declarations */\n}\n\nexport function travel(this: IPlayer, to: CityName): boolean {\n if (Cities[to] == null) {\n console.warn(`Player.travel() called with invalid city: ${to}`);\n return false;\n }\n this.city = to;\n\n return true;\n}\n\nexport function gotoLocation(this: IPlayer, to: LocationName): boolean {\n if (Locations[to] == null) {\n console.warn(`Player.gotoLocation() called with invalid location: ${to}`);\n return false;\n }\n this.location = to;\n\n return true;\n}\n\nexport function canAccessResleeving(this: IPlayer): boolean {\n return this.bitNodeN === 10 || SourceFileFlags[10] > 0;\n}\n\nexport function giveExploit(this: IPlayer, exploit: Exploit): void {\n if (!this.exploits.includes(exploit)) {\n this.exploits.push(exploit);\n }\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","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","// 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 // Flag indicating wehther this is a purchased server\n purchasedByPlayer = false;\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 console.log(n);\n\n this.moneyMax *= n;\n }\n\n /**\n * Strengthens a server's security level (difficulty) by the specified amount\n */\n fortify(amt: number): void {\n this.hackDifficulty += amt;\n this.capDifficulty();\n }\n\n /**\n * Lowers the server's security level (difficulty) by the specified amount)\n */\n weaken(amt: number): void {\n this.hackDifficulty -= amt * BitNodeMultipliers.ServerWeakenRate;\n this.capDifficulty();\n }\n\n /**\n * Serialize the current object to a JSON save state\n */\n toJSON(): any {\n return Generic_toJSON(\"Server\", this);\n }\n\n // Initializes a Server Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Server {\n return Generic_fromJSON(Server, value.data);\n }\n}\n\nReviver.constructors.Server = Server;\n","import React from \"react\";\nimport { ResearchTree } from \"./ResearchTree\";\nimport { ICorporation } from \"./ICorporation\";\nimport { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from \"./data/BaseResearchTree\";\nimport { MoneyCost } from \"./ui/MoneyCost\";\n\ninterface IIndustryMap<T> {\n [key: string]: T | undefined;\n Energy: T;\n Utilities: T;\n Agriculture: T;\n Fishing: T;\n Mining: T;\n Food: T;\n Tobacco: T;\n Chemical: T;\n Pharmaceutical: T;\n Computer: T;\n Robotics: T;\n Software: T;\n Healthcare: T;\n RealEstate: T;\n}\n\n// Map of official names for each Industry\nexport const Industries: IIndustryMap<string> = {\n Energy: \"Energy\",\n Utilities: \"Water Utilities\",\n Agriculture: \"Agriculture\",\n Fishing: \"Fishing\",\n Mining: \"Mining\",\n Food: \"Food\",\n Tobacco: \"Tobacco\",\n Chemical: \"Chemical\",\n Pharmaceutical: \"Pharmaceutical\",\n Computer: \"Computer Hardware\",\n Robotics: \"Robotics\",\n Software: \"Software\",\n Healthcare: \"Healthcare\",\n RealEstate: \"RealEstate\",\n};\n\n// Map of how much money it takes to start each industry\nexport const IndustryStartingCosts: IIndustryMap<number> = {\n Energy: 225e9,\n Utilities: 150e9,\n Agriculture: 40e9,\n Fishing: 80e9,\n Mining: 300e9,\n Food: 10e9,\n Tobacco: 20e9,\n Chemical: 70e9,\n Pharmaceutical: 200e9,\n Computer: 500e9,\n Robotics: 1e12,\n Software: 25e9,\n Healthcare: 750e9,\n RealEstate: 600e9,\n};\n\n// Map of description for each industry\nexport const IndustryDescriptions: IIndustryMap<(corp: ICorporation) => React.ReactElement> = {\n Energy: (corp: ICorporation) => (\n <>\n Engage in the production and distribution of energy.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Energy} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Utilities: (corp: ICorporation) => (\n <>\n Distribute water and provide wastewater services.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Utilities} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Agriculture: (corp: ICorporation) => (\n <>\n Cultivate crops and breed livestock to produce food.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Agriculture} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Fishing: (corp: ICorporation) => (\n <>\n Produce food through the breeding and processing of fish and fish products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Fishing} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Mining: (corp: ICorporation) => (\n <>\n Extract and process metals from the earth.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Mining} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Food: (corp: ICorporation) => (\n <>\n Create your own restaurants all around the world.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Food} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Tobacco: (corp: ICorporation) => (\n <>\n Create and distribute tobacco and tobacco-related products.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Tobacco} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Chemical: (corp: ICorporation) => (\n <>\n Produce industrial chemicals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Chemical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Pharmaceutical: (corp: ICorporation) => (\n <>\n Discover, develop, and create new pharmaceutical drugs.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Pharmaceutical} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Computer: (corp: ICorporation) => (\n <>\n Develop and manufacture new computer hardware and networking infrastructures.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Computer} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Robotics: (corp: ICorporation) => (\n <>\n Develop and create robots.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Robotics} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n Software: (corp: ICorporation) => (\n <>\n Develop computer software and create AI Cores.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Software} corp={corp} />\n <br />\n Recommended starting Industry: YES\n </>\n ),\n Healthcare: (corp: ICorporation) => (\n <>\n Create and manage hospitals.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.Healthcare} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n RealEstate: (corp: ICorporation) => (\n <>\n Develop and manage real estate properties.\n <br />\n <br />\n Starting cost: <MoneyCost money={IndustryStartingCosts.RealEstate} corp={corp} />\n <br />\n Recommended starting Industry: NO\n </>\n ),\n};\n\n// Map of available Research for each Industry. This data is held in a\n// ResearchTree object\nexport const IndustryResearchTrees: IIndustryMap<ResearchTree> = {\n Energy: getBaseResearchTreeCopy(),\n Utilities: getBaseResearchTreeCopy(),\n Agriculture: getBaseResearchTreeCopy(),\n Fishing: getBaseResearchTreeCopy(),\n Mining: getBaseResearchTreeCopy(),\n Food: getProductIndustryResearchTreeCopy(),\n Tobacco: getProductIndustryResearchTreeCopy(),\n Chemical: getBaseResearchTreeCopy(),\n Pharmaceutical: getProductIndustryResearchTreeCopy(),\n Computer: getProductIndustryResearchTreeCopy(),\n Robotics: getProductIndustryResearchTreeCopy(),\n Software: getProductIndustryResearchTreeCopy(),\n Healthcare: getProductIndustryResearchTreeCopy(),\n RealEstate: getProductIndustryResearchTreeCopy(),\n};\n\nexport function resetIndustryResearchTrees(): void {\n IndustryResearchTrees.Energy = getBaseResearchTreeCopy();\n IndustryResearchTrees.Utilities = getBaseResearchTreeCopy();\n IndustryResearchTrees.Agriculture = getBaseResearchTreeCopy();\n IndustryResearchTrees.Fishing = getBaseResearchTreeCopy();\n IndustryResearchTrees.Mining = getBaseResearchTreeCopy();\n IndustryResearchTrees.Food = getBaseResearchTreeCopy();\n IndustryResearchTrees.Tobacco = getBaseResearchTreeCopy();\n IndustryResearchTrees.Chemical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Pharmaceutical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Computer = getBaseResearchTreeCopy();\n IndustryResearchTrees.Robotics = getBaseResearchTreeCopy();\n IndustryResearchTrees.Software = getBaseResearchTreeCopy();\n IndustryResearchTrees.Healthcare = getBaseResearchTreeCopy();\n IndustryResearchTrees.RealEstate = getBaseResearchTreeCopy();\n}\n","/**\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","export const BladeburnerConstants: {\n CityNames: string[];\n CyclesPerSecond: number;\n StaminaGainPerSecond: number;\n BaseStaminaLoss: number;\n MaxStaminaToGainFactor: number;\n DifficultyToTimeFactor: number;\n DiffMultExponentialFactor: number;\n DiffMultLinearFactor: number;\n EffAgiLinearFactor: number;\n EffDexLinearFactor: number;\n EffAgiExponentialFactor: number;\n EffDexExponentialFactor: number;\n BaseRecruitmentTimeNeeded: number;\n PopulationThreshold: number;\n PopulationExponent: number;\n ChaosThreshold: number;\n BaseStatGain: number;\n BaseIntGain: number;\n ActionCountGrowthPeriod: number;\n RankToFactionRepFactor: number;\n RankNeededForFaction: number;\n ContractSuccessesPerLevel: number;\n OperationSuccessesPerLevel: number;\n RanksPerSkillPoint: number;\n ContractBaseMoneyGain: number;\n HrcHpGain: number;\n HrcStaminaGain: number;\n} = {\n CityNames: [\"Aevum\", \"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n CyclesPerSecond: 5, // Game cycle is 200 ms\n\n StaminaGainPerSecond: 0.0085,\n BaseStaminaLoss: 0.285, // Base stamina loss per action. Increased based on difficulty\n MaxStaminaToGainFactor: 70000, // Max Stamina is divided by this to get bonus stamina gain\n\n DifficultyToTimeFactor: 10, // Action Difficulty divided by this to get base action time\n\n /**\n * The difficulty multiplier affects stamina loss and hp loss of an action. Also affects\n * experience gain. Its formula is:\n * difficulty ^ exponentialFactor + difficulty / linearFactor\n */\n DiffMultExponentialFactor: 0.28,\n DiffMultLinearFactor: 650,\n\n /**\n * These factors are used to calculate action time.\n * They affect how much action time is reduced based on your agility and dexterity\n */\n EffAgiLinearFactor: 10e3,\n EffDexLinearFactor: 10e3,\n EffAgiExponentialFactor: 0.04,\n EffDexExponentialFactor: 0.035,\n\n BaseRecruitmentTimeNeeded: 300, // Base time needed (s) to complete a Recruitment action\n\n PopulationThreshold: 1e9, // Population which determines baseline success rate\n PopulationExponent: 0.7, // Exponent that influences how different populations affect success rate\n ChaosThreshold: 50, // City chaos level after which it starts making tasks harder\n\n BaseStatGain: 1, // Base stat gain per second\n BaseIntGain: 0.003, // Base intelligence stat gain\n\n ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value\n\n RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank\n RankNeededForFaction: 25,\n\n ContractSuccessesPerLevel: 3, // How many successes you need to level up a contract\n OperationSuccessesPerLevel: 2.5, // How many successes you need to level up an op\n\n RanksPerSkillPoint: 3, // How many ranks needed to get 1 Skill Point\n\n ContractBaseMoneyGain: 250e3, // Base Money Gained per contract\n\n HrcHpGain: 2, // HP Gained from Hyperbolic Regeneration chamber\n HrcStaminaGain: 1, // Percentage Stamina gained from Hyperbolic Regeneration Chamber\n};\n","import { IMap } from \"../../types\";\n\nexport const LiteratureNames: IMap<string> = {\n HackersStartingHandbook: \"hackers-starting-handbook.lit\",\n CorporationManagementHandbook: \"corporation-management-handbook.lit\",\n HistoryOfSynthoids: \"history-of-synthoids.lit\",\n AGreenTomorrow: \"A-Green-Tomorrow.lit\",\n AlphaOmega: \"alpha-omega.lit\",\n SimulatedReality: \"simulated-reality.lit\",\n BeyondMan: \"beyond-man.lit\",\n BrighterThanTheSun: \"brighter-than-the-sun.lit\",\n DemocracyIsDead: \"democracy-is-dead.lit\",\n Sector12Crime: \"sector-12-crime.lit\",\n ManAndMachine: \"man-and-machine.lit\",\n SecretSocieties: \"secret-societies.lit\",\n TheFailedFrontier: \"the-failed-frontier.lit\",\n CodedIntelligence: \"coded-intelligence.lit\",\n SyntheticMuscles: \"synthetic-muscles.lit\",\n TensionsInTechRace: \"tensions-in-tech-race.lit\",\n CostOfImmortality: \"cost-of-immortality.lit\",\n TheHiddenWorld: \"the-hidden-world.lit\",\n TheNewGod: \"the-new-god.lit\",\n NewTriads: \"new-triads.lit\",\n TheSecretWar: \"the-secret-war.lit\",\n};\n","/**\n * Generic helper/utility functions for the Hacknet mechanic:\n * - Purchase nodes/upgrades\n * - Calculating maximum number of upgrades\n * - Processing Hacknet earnings\n * - Updating Hash Manager capacity\n * - Purchasing hash upgrades\n *\n * TODO Should probably split the different types of functions into their own modules\n */\nimport { HacknetNode } from \"./HacknetNode\";\nimport { calculateNodeCost } from \"./formulas/HacknetNodes\";\nimport { calculateServerCost } from \"./formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"./data/Constants\";\nimport { HacknetServer } from \"./HacknetServer\";\nimport { HashManager } from \"./HashManager\";\nimport { HashUpgrades } from \"./HashUpgrades\";\n\nimport { generateRandomContract } from \"../CodingContractGenerator\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../InteractiveTutorial\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\n// Returns a boolean indicating whether the player has Hacknet Servers\n// (the upgraded form of Hacknet Nodes)\nexport function hasHacknetServers(player: IPlayer): boolean {\n return player.bitNodeN === 9 || SourceFileFlags[9] > 0;\n}\n\nexport function purchaseHacknet(player: IPlayer): number {\n /* INTERACTIVE TUTORIAL */\n if (ITutorial.isRunning) {\n if (ITutorial.currStep === iTutorialSteps.HacknetNodesIntroduction) {\n iTutorialNextStep();\n } else {\n return -1;\n }\n }\n /* END INTERACTIVE TUTORIAL */\n\n const numOwned = player.hacknetNodes.length;\n if (hasHacknetServers(player)) {\n const cost = getCostOfNextHacknetServer(player);\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetServer is NaN`);\n }\n\n if (!player.canAfford(cost)) {\n return -1;\n }\n player.loseMoney(cost);\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);\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.lt(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.gt(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.gt(nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult)) &&\n player.money.lt(nodeObj.calculateLevelUpgradeCost(curr + 1, player.hacknet_node_level_cost_mult))\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money.lt(nodeObj.calculateLevelUpgradeCost(curr, player.hacknet_node_level_cost_mult))) {\n max = curr - 1;\n } else if (player.money.gt(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.lt(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.gt(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.gt(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.lt(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.gt(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.gt(nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult)) &&\n player.money.lt(nodeObj.calculateCoreUpgradeCost(curr + 1, player.hacknet_node_core_cost_mult))\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money.lt(nodeObj.calculateCoreUpgradeCost(curr, player.hacknet_node_core_cost_mult))) {\n max = curr - 1;\n } else if (player.money.gt(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);\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);\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);\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);\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);\n player.recordMoneySource(totalEarnings, \"hacknetnode\");\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 player.hashManager.storeHashes(hashes);\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);\n player.recordMoneySource(upg.value, \"hacknetnode\");\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.plus(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 const old = target.moneyMax;\n target.changeMaximumMoney(upg.value);\n console.log(target.moneyMax / old);\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","// 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 in 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\n// Utility function to check if a string is valid company name\nexport function companyExists(name: string): boolean {\n return Companies.hasOwnProperty(name);\n}\n","// Contains an array containing information about the player's source files\n// Array[n] returns what level the player has of Source-File N.\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport const SourceFileFlags: number[] = Array(CONSTANTS.TotalNumBitNodes + 1); // Skip index 0\n\nexport function updateSourceFileFlags(p: IPlayer): void {\n for (let i = 0; i < SourceFileFlags.length; ++i) {\n SourceFileFlags[i] = 0;\n }\n\n for (let i = 0; i < p.sourceFiles.length; ++i) {\n const sf = p.sourceFiles[i];\n SourceFileFlags[sf.n] = sf.lvl;\n }\n}\n","export enum PositionTypes {\n Long = \"L\",\n Short = \"S\",\n}\n","import { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { Industry } from \"./Industry\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Material } from \"./Material\";\nimport { Product } from \"./Product\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationUnlockUpgrade } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade } from \"./data/CorporationUpgrades\";\nimport { Cities } from \"../Locations/Cities\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Employee } from \"./Employee\";\nimport { IndustryUpgrades } from \"./IndustryUpgrades\";\nimport { ResearchMap } from \"./ResearchMap\";\n\nexport function NewIndustry(corporation: ICorporation, industry: string, name: string): void {\n for (let i = 0; i < corporation.divisions.length; ++i) {\n if (corporation.divisions[i].name === name) {\n throw new Error(\"This division name is already in use!\");\n return;\n }\n }\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n if (corporation.funds.lt(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.minus(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.lt(CorporationConstants.OfficeInitialCost)) {\n throw new Error(\"You don't have enough company funds to open a new office!\");\n } else {\n corporation.funds = corporation.funds.minus(CorporationConstants.OfficeInitialCost);\n division.offices[city] = new OfficeSpace({\n loc: city,\n size: CorporationConstants.OfficeInitialSize,\n });\n }\n}\n\nexport function UnlockUpgrade(corporation: ICorporation, upgrade: CorporationUnlockUpgrade): void {\n if (corporation.funds.lt(upgrade[1])) {\n throw new Error(\"Insufficient funds\");\n }\n corporation.unlock(upgrade);\n}\n\nexport function LevelUpgrade(corporation: ICorporation, upgrade: CorporationUpgrade): void {\n const baseCost = upgrade[1];\n const priceMult = upgrade[2];\n const level = corporation.upgrades[upgrade[0]];\n const cost = baseCost * Math.pow(priceMult, level);\n if (corporation.funds.lt(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/*+.MP]/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))) {\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 if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n let q = amt.replace(/\\s+/g, \"\");\n q = q.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let tempQty = q.replace(/MAX/g, \"1\");\n tempQty = tempQty.replace(/PROD/g, \"1\");\n try {\n tempQty = eval(tempQty);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (tempQty == null || isNaN(parseFloat(tempQty))) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n\n mat.sllman[0] = true;\n mat.sllman[1] = q; //Use sanitized input\n } else if (isNaN(parseFloat(amt))) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'MAX'\");\n } else {\n let q = parseFloat(amt);\n if (isNaN(q)) {\n q = 0;\n }\n if (q === 0) {\n mat.sllman[0] = false;\n mat.sllman[1] = 0;\n } else {\n mat.sllman[0] = true;\n mat.sllman[1] = q;\n }\n }\n}\n\nexport function SellProduct(product: Product, city: string, amt: string, price: string, all: boolean): void {\n //Parse price\n if (price.includes(\"MP\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n //Sanitize input, then replace dynamic variables with arbitrary numbers\n price = price.replace(/\\s+/g, \"\");\n price = price.replace(/[^-()\\d/*+.MP]/g, \"\");\n let temp = price.replace(/MP/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n if (temp == null || isNaN(parseFloat(temp))) {\n throw new Error(\"Invalid value or expression for sell quantity field.\");\n }\n product.sCost = price; //Use sanitized price\n } else {\n const cost = parseFloat(price);\n if (isNaN(cost)) {\n throw new Error(\"Invalid value for sell price field\");\n }\n product.sCost = cost;\n }\n\n // Array of all cities. Used later\n const cities = Object.keys(Cities);\n\n // Parse quantity\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n let qty = amt.replace(/\\s+/g, \"\");\n qty = qty.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let temp = qty.replace(/MAX/g, \"1\");\n temp = temp.replace(/PROD/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp))) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty; //Use sanitized input\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty; //Use sanitized input\n }\n } else if (isNaN(parseFloat(amt))) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric\");\n } else {\n let qty = parseFloat(amt);\n if (isNaN(qty)) {\n qty = 0;\n }\n if (qty === 0) {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = false;\n product.sllman[tempCity][1] = \"\";\n }\n } else {\n product.sllman[city][0] = false;\n product.sllman[city][1] = \"\";\n }\n } else {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty;\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty;\n }\n }\n }\n}\n\nexport function SetSmartSupply(warehouse: Warehouse, smartSupply: boolean): void {\n warehouse.smartSupplyEnabled = smartSupply;\n}\n\nexport function SetSmartSupplyUseLeftovers(warehouse: Warehouse, material: Material, useLeftover: boolean): void {\n if (!Object.keys(warehouse.smartSupplyUseLeftovers).includes(material.name))\n throw new Error(`Invalid material '${material.name}'`);\n warehouse.smartSupplyUseLeftovers[material.name] = useLeftover;\n}\n\nexport function BuyMaterial(material: Material, amt: number): void {\n if (isNaN(amt)) {\n throw new Error(`Invalid amount '${amt}' to buy material '${material.name}'`);\n }\n material.buy = amt;\n}\n\nexport function AssignJob(employee: Employee, job: string): void {\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n employee.pos = job;\n}\n\nexport function UpgradeOfficeSize(corp: ICorporation, office: OfficeSpace, size: number): void {\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const cost = CorporationConstants.OfficeInitialCost * mult;\n if (corp.funds.lt(cost)) return;\n office.size += size;\n corp.funds = corp.funds.minus(cost);\n}\n\nexport function ThrowParty(corp: ICorporation, office: OfficeSpace, costPerEmployee: number): number {\n const totalCost = costPerEmployee * office.employees.length;\n if (corp.funds.lt(totalCost)) return 0;\n corp.funds = corp.funds.minus(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.lt(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.minus(CorporationConstants.WarehouseInitialCost);\n}\n\nexport function UpgradeWarehouse(corp: ICorporation, division: IIndustry, warehouse: Warehouse): void {\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1);\n ++warehouse.level;\n warehouse.updateSize(corp, division);\n corp.funds = corp.funds.minus(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.lt(cost)) return;\n corp.funds = corp.funds.minus(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.lt(cost)) return;\n corp.funds = corp.funds.minus(cost);\n division.upgrade(upgrade, {\n corporation: corp,\n office: office,\n });\n}\n\nexport function MakeProduct(\n corp: ICorporation,\n division: IIndustry,\n city: string,\n productName: string,\n designInvest: number,\n marketingInvest: number,\n): void {\n if (designInvest < 0) {\n designInvest = 0;\n }\n if (marketingInvest < 0) {\n marketingInvest = 0;\n }\n if (productName == null || productName === \"\") {\n throw new Error(\"You must specify a name for your product!\");\n }\n if (isNaN(designInvest)) {\n throw new Error(\"Invalid value for design investment\");\n }\n if (isNaN(marketingInvest)) {\n throw new Error(\"Invalid value for marketing investment\");\n }\n if (corp.funds.lt(designInvest + marketingInvest)) {\n throw new Error(\"You don't have enough company funds to make this large of an investment\");\n }\n const product = new Product({\n name: productName.replace(/[<>]/g, \"\"), //Sanitize for HTMl elements\n createCity: city,\n designCost: designInvest,\n advCost: marketingInvest,\n });\n if (division.products[product.name] instanceof Product) {\n throw new Error(`You already have a product with this name!`);\n }\n corp.funds = corp.funds.minus(designInvest + marketingInvest);\n division.products[product.name] = product;\n}\n\nexport function Research(division: IIndustry, researchName: string): void {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n\n if (division.sciResearch.qty < research.cost)\n throw new Error(`You do not have enough Scientific Research for ${research.name}`);\n division.sciResearch.qty -= research.cost;\n\n // Get the Node from the Research Tree and set its 'researched' property\n researchTree.research(researchName);\n division.researched[researchName] = true;\n}\n\nexport function ExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n // Sanitize amt\n let sanitizedAmt = amt.replace(/\\s+/g, \"\");\n sanitizedAmt = sanitizedAmt.replace(/[^-()\\d/*+.MAX]/g, \"\");\n let temp = sanitizedAmt.replace(/MAX/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid expression entered for export amount: \" + e);\n }\n\n const n = parseFloat(temp);\n\n if (n == null || isNaN(n) || n < 0) {\n throw new Error(\"Invalid amount entered for export\");\n }\n const exportObj = { ind: divisionName, city: cityName, amt: sanitizedAmt };\n material.exp.push(exportObj);\n}\n\nexport function CancelExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n for (let i = 0; i < material.exp.length; ++i) {\n if (material.exp[i].ind !== divisionName || material.exp[i].city !== cityName || material.exp[i].amt !== amt)\n continue;\n material.exp.splice(i, 1);\n break;\n }\n}\n\nexport function LimitProductProduction(product: Product, cityName: string, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n product.prdman[cityName][0] = false;\n } else {\n product.prdman[cityName][0] = true;\n product.prdman[cityName][1] = qty;\n }\n}\n\nexport function SetMaterialMarketTA1(material: Material, on: boolean): void {\n material.marketTa1 = on;\n}\n\nexport function SetMaterialMarketTA2(material: Material, on: boolean): void {\n material.marketTa2 = on;\n}\n\nexport function SetProductMarketTA1(product: Product, on: boolean): void {\n product.marketTa1 = on;\n}\n\nexport function SetProductMarketTA2(product: Product, on: boolean): void {\n product.marketTa2 = on;\n}\n","import { 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 Recovery,\n Synchro,\n}\n","import { Reviver } from \"../utils/JSONReviver\";\n\ninterface GangTerritory {\n power: number;\n territory: number;\n}\n\nexport let AllGangs: {\n [key: string]: GangTerritory;\n} = {\n \"Slum Snakes\": {\n power: 1,\n territory: 1 / 7,\n },\n Tetrads: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Syndicate\": {\n power: 1,\n territory: 1 / 7,\n },\n \"The Dark Army\": {\n power: 1,\n territory: 1 / 7,\n },\n \"Speakers for the Dead\": {\n power: 1,\n territory: 1 / 7,\n },\n NiteSec: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Black Hand\": {\n power: 1,\n territory: 1 / 7,\n },\n};\n\nexport function resetGangs(): void {\n AllGangs = {\n \"Slum Snakes\": {\n power: 1,\n territory: 1 / 7,\n },\n Tetrads: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Syndicate\": {\n power: 1,\n territory: 1 / 7,\n },\n \"The Dark Army\": {\n power: 1,\n territory: 1 / 7,\n },\n \"Speakers for the Dead\": {\n power: 1,\n territory: 1 / 7,\n },\n NiteSec: {\n power: 1,\n territory: 1 / 7,\n },\n \"The Black Hand\": {\n power: 1,\n territory: 1 / 7,\n },\n };\n}\n\nexport function loadAllGangs(saveString: string): void {\n AllGangs = JSON.parse(saveString, Reviver);\n}\n","import { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nexport const Crimes: IMap<Crime> = {\n Shoplift: new Crime(\"Shoplift\", CONSTANTS.CrimeShoplift, 2e3, 15e3, 1 / 20, 0.1, {\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n dexterity_exp: 2,\n agility_exp: 2,\n }),\n\n RobStore: new Crime(\"Rob Store\", CONSTANTS.CrimeRobStore, 60e3, 400e3, 1 / 5, 0.5, {\n hacking_exp: 30,\n dexterity_exp: 45,\n agility_exp: 45,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Mug: new Crime(\"Mug\", CONSTANTS.CrimeMug, 4e3, 36e3, 1 / 5, 0.25, {\n strength_exp: 3,\n defense_exp: 3,\n dexterity_exp: 3,\n agility_exp: 3,\n\n strength_success_weight: 1.5,\n defense_success_weight: 0.5,\n dexterity_success_weight: 1.5,\n agility_success_weight: 0.5,\n }),\n\n Larceny: new Crime(\"Larceny\", CONSTANTS.CrimeLarceny, 90e3, 800e3, 1 / 3, 1.5, {\n hacking_exp: 45,\n dexterity_exp: 60,\n agility_exp: 60,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n DealDrugs: new Crime(\"Deal Drugs\", CONSTANTS.CrimeDrugs, 10e3, 120e3, 1, 0.5, {\n dexterity_exp: 5,\n agility_exp: 5,\n charisma_exp: 10,\n\n charisma_success_weight: 3,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n }),\n\n BondForgery: new Crime(\"Bond Forgery\", CONSTANTS.CrimeBondForgery, 300e3, 4.5e6, 1 / 2, 0.1, {\n hacking_exp: 100,\n dexterity_exp: 150,\n charisma_exp: 15,\n\n hacking_success_weight: 0.05,\n dexterity_success_weight: 1.25,\n\n intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n TraffickArms: new Crime(\"Traffick Arms\", CONSTANTS.CrimeTraffickArms, 40e3, 600e3, 2, 1, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 20,\n charisma_exp: 40,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n }),\n\n Homicide: new Crime(\"Homicide\", CONSTANTS.CrimeHomicide, 3e3, 45e3, 1, 3, {\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n\n strength_success_weight: 2,\n defense_success_weight: 2,\n dexterity_success_weight: 0.5,\n agility_success_weight: 0.5,\n\n kills: 1,\n }),\n\n GrandTheftAuto: new Crime(\"Grand Theft Auto\", CONSTANTS.CrimeGrandTheftAuto, 80e3, 1.6e6, 8, 5, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 80,\n charisma_exp: 40,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 4,\n agility_success_weight: 2,\n charisma_success_weight: 2,\n\n intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Kidnap: new Crime(\"Kidnap\", CONSTANTS.CrimeKidnap, 120e3, 3.6e6, 5, 6, {\n strength_exp: 80,\n defense_exp: 80,\n dexterity_exp: 80,\n agility_exp: 80,\n charisma_exp: 80,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Assassination: new Crime(\"Assassination\", CONSTANTS.CrimeAssassination, 300e3, 12e6, 8, 10, {\n strength_exp: 300,\n defense_exp: 300,\n dexterity_exp: 300,\n agility_exp: 300,\n\n strength_success_weight: 1,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n\n kills: 1,\n }),\n\n Heist: new Crime(\"Heist\", CONSTANTS.CrimeHeist, 600e3, 120e6, 18, 15, {\n hacking_exp: 450,\n strength_exp: 450,\n defense_exp: 450,\n dexterity_exp: 450,\n agility_exp: 450,\n charisma_exp: 450,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n charisma_success_weight: 1,\n\n intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n};\n","import * as React from \"react\";\n\nexport function trusted(f: () => void): (event: React.MouseEvent<HTMLElement, MouseEvent>) => any {\n return function (event: React.MouseEvent<HTMLElement, MouseEvent>): any {\n if (!event.isTrusted) return;\n f();\n };\n}\n","// 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","/**\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\";\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 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 }\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 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","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\";\n\n// Stocks for other companies\nStockSymbols[\"Sigma Cosmetics\"] = \"SGC\";\nStockSymbols[\"Joes Guns\"] = \"JGN\";\nStockSymbols[\"Catalyst Ventures\"] = \"CTYS\";\nStockSymbols[\"Microdyne Technologies\"] = \"MDYN\";\nStockSymbols[\"Titan Laboratories\"] = \"TITN\";\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_skill;\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 * player.hacking_exp_mult * diffFactor;\n\n return expGain * 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_skill - (server.requiredHackingSkill - 1)) / player.hacking_skill;\n const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult) / balanceFactor;\n if (percentMoneyHacked < 0) {\n return 0;\n }\n if (percentMoneyHacked > 1) {\n return 1;\n }\n\n return percentMoneyHacked * BitNodeMultipliers.ScriptHackMoney;\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_skill + 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(\"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(\"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 in 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 in 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 in 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 in 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\nexport function stockMarketCycle(): void {\n for (const name in 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 in StockMarket) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n let av = (v * stock.mv) / 100;\n if (isNaN(av)) {\n av = 0.02;\n }\n\n let chc = 50;\n if (stock.b) {\n chc = (chc + stock.otlkMag) / 100;\n } else {\n chc = (chc - stock.otlkMag) / 100;\n }\n if (stock.price >= stock.cap) {\n chc = 0.1; // \"Soft Limit\" on stock price. It could still go up but its unlikely\n stock.b = false;\n }\n if (isNaN(chc)) {\n chc = 0.5;\n }\n\n const c = Math.random();\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n if (c < chc) {\n stock.changePrice(stock.price * (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Short, processOrderRefs);\n } else {\n stock.changePrice(stock.price / (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Long, processOrderRefs);\n }\n\n let otlkMagChange = stock.otlkMag * av;\n if (stock.otlkMag < 5) {\n if (stock.otlkMag <= 1) {\n otlkMagChange = 1;\n } else {\n otlkMagChange *= 10;\n }\n }\n stock.cycleForecast(otlkMagChange);\n stock.cycleForecastForecast(otlkMagChange / 2);\n\n // Shares required for price movement gradually approaches max over time\n stock.shareTxUntilMovement = Math.min(stock.shareTxUntilMovement + 10, stock.shareTxForMovement);\n }\n}\n\nexport function initStockMarketFnForReact(): void {\n initStockMarket();\n initSymbolToStockMap();\n}\n\nexport const eventEmitterForUiReset = new EventEmitter<[]>();\n","import { IMap } from \"../../types\";\n\n/**\n * Keyboard key codes\n */\nexport const KEY: IMap<number> = {\n CTRL: 17,\n DOWNARROW: 40,\n ENTER: 13,\n ESC: 27,\n TAB: 9,\n UPARROW: 38,\n\n \"0\": 48,\n \"1\": 49,\n \"2\": 50,\n \"3\": 51,\n \"4\": 52,\n \"5\": 53,\n \"6\": 54,\n \"7\": 55,\n \"8\": 56,\n \"9\": 57,\n\n A: 65,\n B: 66,\n C: 67,\n D: 68,\n E: 69,\n F: 70,\n G: 71,\n H: 72,\n I: 73,\n J: 74,\n K: 75,\n L: 76,\n M: 77,\n N: 78,\n O: 79,\n P: 80,\n Q: 81,\n R: 82,\n S: 83,\n T: 84,\n U: 85,\n V: 86,\n W: 87,\n X: 88,\n Y: 89,\n Z: 90,\n};\n","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 */\nexport class 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","export function isScriptFilename(f: string): boolean {\n return f.endsWith(\".js\") || f.endsWith(\".script\") || f.endsWith(\".ns\");\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n reputation: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Reputation({ reputation }: { reputation: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.reputation}>\n {typeof reputation === \"number\" ? numeralWrapper.formatReputation(reputation) : reputation}\n </span>\n );\n}\n","/* 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 React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport function MoneyRate({ money }: { money: number }): JSX.Element {\n return <Money money={`${numeralWrapper.formatMoney(money)} / sec`} />;\n}\n","// Defines the ResearchTree that is common to all Corporation Industries\n// i.e. all Industries have these types of Research available to unlock\nimport { Research } from \"../Research\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { ResearchTree, Node } from \"../ResearchTree\";\n\nfunction makeNode(name: string): Node {\n const research: Research | null = ResearchMap[name];\n if (research == null) {\n throw new Error(`Invalid research name: ${name}`);\n }\n\n return new Node({ text: research.name, cost: research.cost });\n}\n\n// Creates the Nodes for the BaseResearchTree.\n// Return the Root Node\nfunction createBaseResearchTreeNodes(): Node {\n const rootNode: Node = makeNode(\"Hi-Tech R&D Laboratory\");\n const autoBrew: Node = makeNode(\"AutoBrew\");\n const autoParty: Node = makeNode(\"AutoPartyManager\");\n const autoDrugs: Node = makeNode(\"Automatic Drug Administration\");\n const bulkPurchasing: Node = makeNode(\"Bulk Purchasing\");\n const cph4: Node = makeNode(\"CPH4 Injections\");\n const drones: Node = makeNode(\"Drones\");\n const dronesAssembly: Node = makeNode(\"Drones - Assembly\");\n const dronesTransport: Node = makeNode(\"Drones - Transport\");\n const goJuice: Node = makeNode(\"Go-Juice\");\n const hrRecruitment: Node = makeNode(\"HRBuddy-Recruitment\");\n const hrTraining: Node = makeNode(\"HRBuddy-Training\");\n const joywire: Node = makeNode(\"JoyWire\");\n const marketta1: Node = makeNode(\"Market-TA.I\");\n const marketta2: Node = makeNode(\"Market-TA.II\");\n const overclock: Node = makeNode(\"Overclock\");\n const scAssemblers: Node = makeNode(\"Self-Correcting Assemblers\");\n const stimu: Node = makeNode(\"Sti.mu\");\n\n autoDrugs.addChild(goJuice);\n autoDrugs.addChild(cph4);\n\n drones.addChild(dronesAssembly);\n drones.addChild(dronesTransport);\n\n hrRecruitment.addChild(hrTraining);\n\n marketta1.addChild(marketta2);\n\n overclock.addChild(stimu);\n\n rootNode.addChild(autoBrew);\n rootNode.addChild(autoParty);\n rootNode.addChild(autoDrugs);\n rootNode.addChild(bulkPurchasing);\n rootNode.addChild(drones);\n rootNode.addChild(hrRecruitment);\n rootNode.addChild(joywire);\n rootNode.addChild(marketta1);\n rootNode.addChild(overclock);\n rootNode.addChild(scAssemblers);\n\n return rootNode;\n}\n\nexport function getBaseResearchTreeCopy(): ResearchTree {\n const baseResearchTree: ResearchTree = new ResearchTree();\n baseResearchTree.setRoot(createBaseResearchTreeNodes());\n\n return baseResearchTree;\n}\n\n// Base Research Tree for Industry's that make products\nexport function getProductIndustryResearchTreeCopy(): ResearchTree {\n const researchTree: ResearchTree = new ResearchTree();\n const root = createBaseResearchTreeNodes();\n\n const upgradeFulcrum = makeNode(\"uPgrade: Fulcrum\");\n const upgradeCapacity1 = makeNode(\"uPgrade: Capacity.I\");\n const upgradeCapacity2 = makeNode(\"uPgrade: Capacity.II\");\n const upgradeDashboard = makeNode(\"uPgrade: Dashboard\");\n\n upgradeCapacity1.addChild(upgradeCapacity2);\n upgradeFulcrum.addChild(upgradeCapacity1);\n upgradeFulcrum.addChild(upgradeDashboard);\n root.addChild(upgradeFulcrum);\n\n researchTree.setRoot(root);\n\n return researchTree;\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains functions that deal only with that string manipulation.\n * Functions that need to access/process Server-related things can be\n * found in ./DirectoryServerHelpers.ts\n */\n\n/**\n * Removes leading forward slash (\"/\") from a string.\n */\nexport function removeLeadingSlash(s: string): string {\n if (s.startsWith(\"/\")) {\n return s.slice(1);\n }\n\n return s;\n}\n\n/**\n * Removes trailing forward slash (\"/\") from a string.\n * Note that this will also remove the slash if it is the leading slash (i.e. if s = \"/\")\n */\nexport function removeTrailingSlash(s: string): string {\n if (s.endsWith(\"/\")) {\n return s.slice(0, -1);\n }\n\n return s;\n}\n\n/**\n * Checks whether a string is a valid filename. Only used for the filename itself,\n * not the entire filepath\n */\nexport function isValidFilename(filename: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs\n // Must have a file extension\n const regex = /^[.a-zA-Z0-9_-]+[.][a-zA-Z0-9]+(?:-\\d+(?:\\.\\d*)?%-INC)?$/;\n\n // match() returns null if no match is found\n return filename.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory name. Only used for the directory itself,\n * not an entire path\n */\nexport function isValidDirectoryName(name: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs.\n // Name can begin with a single period, but otherwise cannot have any\n const regex = /^.?[a-zA-Z0-9_-]+$/;\n\n // match() returns null if no match is found\n return name.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory path.\n * This only checks if it has the proper formatting. It does NOT check\n * if the directories actually exist on Terminal\n */\nexport function isValidDirectoryPath(path: string): boolean {\n let t_path: string = path;\n\n if (t_path.length === 0) {\n return false;\n }\n if (t_path.length === 1) {\n return t_path === \"/\";\n }\n\n // A full path must have a leading slash, but we'll ignore it for the checks\n if (t_path.startsWith(\"/\")) {\n t_path = t_path.slice(1);\n } else {\n return false;\n }\n\n // Trailing slash does not matter\n t_path = removeTrailingSlash(t_path);\n\n // Check that every section of the path is a valid directory name\n const dirs = t_path.split(\"/\");\n for (const dir of dirs) {\n // Special case, \".\" and \"..\" are valid for path\n if (dir === \".\" || dir === \"..\") {\n continue;\n }\n if (!isValidDirectoryName(dir)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Checks whether a string is a valid file path. This only checks if it has the\n * proper formatting. It dose NOT check if the file actually exists on Terminal\n */\nexport function isValidFilePath(path: string): boolean {\n if (path == null || typeof path !== \"string\") {\n return false;\n }\n const t_path = path;\n\n // Impossible for filename to have less than length of 3\n if (t_path.length < 3) {\n return false;\n }\n\n // Full filepath can't end with trailing slash because it must be a file\n if (t_path.endsWith(\"/\")) {\n return false;\n }\n\n // Everything after the last forward slash is the filename. Everything before\n // it is the file path\n const fnSeparator = t_path.lastIndexOf(\"/\");\n if (fnSeparator === -1) {\n return isValidFilename(t_path);\n }\n\n const fn = t_path.slice(fnSeparator + 1);\n const dirPath = t_path.slice(0, fnSeparator + 1);\n\n return isValidDirectoryPath(dirPath) && isValidFilename(fn);\n}\n\n/**\n * Returns a formatted string for the first parent directory in a filepath. For example:\n * /home/var/test/ -> home/\n * If there is no first parent directory, then it returns \"/\" for root\n */\nexport function getFirstParentDirectory(path: string): string {\n let t_path = path;\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n if (t_path.lastIndexOf(\"/\") === -1) {\n return \"/\";\n }\n\n const dirs = t_path.split(\"/\");\n if (dirs.length === 0) {\n return \"/\";\n }\n\n return dirs[0] + \"/\";\n}\n\n/**\n * Given a filepath, returns a formatted string for all of the parent directories\n * in that filepath. For example:\n * /home/var/tes -> home/var/\n * /home/var/test/ -> home/var/test/\n * If there are no parent directories, it returns the empty string\n */\nexport function getAllParentDirectories(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return \"\";\n }\n\n return t_path.slice(0, lastSlash + 1);\n}\n\n/**\n * Checks if a file path refers to a file in the root directory.\n */\nexport function isInRootDirectory(path: string): boolean {\n if (!isValidFilePath(path)) {\n return false;\n }\n if (path == null || path.length === 0) {\n return false;\n }\n\n return path.lastIndexOf(\"/\") <= 0;\n}\n\n/**\n * Evaluates a directory path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateDirectoryPath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidDirectoryPath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\n/**\n * Evaluates a file path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateFilePath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidFilePath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n","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 } from \"../InteractiveTutorial\";\nimport { InteractiveTutorialRoot } from \"./InteractiveTutorial/InteractiveTutorialRoot\";\nimport { ITutorialEvents } from \"./InteractiveTutorial/ITutorialEvents\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { dialogBoxCreate } from \"./React/DialogBox\";\nimport { GetAllServers } from \"../Server/AllServers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport {\n cancelOrder,\n eventEmitterForUiReset,\n initStockMarketFnForReact,\n placeOrder,\n StockMarket,\n} from \"../StockMarket/StockMarket\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { Page, IRouter } from \"./Router\";\nimport { Overview } from \"./React/Overview\";\nimport { SidebarRoot } from \"../Sidebar/ui/SidebarRoot\";\nimport { AugmentationsRoot } from \"../Augmentation/ui/AugmentationsRoot\";\nimport { DevMenuRoot } from \"../DevMenu\";\nimport { BladeburnerRoot } from \"../Bladeburner/ui/BladeburnerRoot\";\nimport { GangRoot } from \"../Gang/ui/GangRoot\";\nimport { CorporationRoot } from \"../Corporation/ui/CorporationRoot\";\nimport { InfiltrationRoot } from \"../Infiltration/ui/InfiltrationRoot\";\nimport { ResleeveRoot } from \"../PersonObjects/Resleeving/ui/ResleeveRoot\";\nimport { WorkInProgressRoot } from \"./WorkInProgressRoot\";\nimport { GameOptionsRoot } from \"../ui/React/GameOptionsRoot\";\nimport { SleeveRoot } from \"../PersonObjects/Sleeve/ui/SleeveRoot\";\nimport { HacknetRoot } from \"../Hacknet/ui/HacknetRoot\";\nimport { GenericLocation } from \"../Locations/ui/GenericLocation\";\nimport { LocationCity } from \"../Locations/ui/City\";\nimport { ProgramsRoot } from \"../Programs/ui/ProgramsRoot\";\nimport { Root as ScriptEditorRoot } from \"../ScriptEditor/ui/ScriptEditorRoot\";\nimport { MilestonesRoot } from \"../Milestones/ui/MilestonesRoot\";\nimport { TerminalRoot } from \"../Terminal/ui/TerminalRoot\";\nimport { TutorialRoot } from \"../Tutorial/ui/TutorialRoot\";\nimport { ActiveScriptsRoot } from \"../ui/ActiveScripts/ActiveScriptsRoot\";\nimport { FactionsRoot } from \"../Faction/ui/FactionsRoot\";\nimport { FactionRoot } from \"../Faction/ui/FactionRoot\";\nimport { CharacterStats } from \"./CharacterStats\";\nimport { TravelAgencyRoot } from \"../Locations/ui/TravelAgencyRoot\";\nimport { StockMarketRoot } from \"../StockMarket/ui/StockMarketRoot\";\nimport { BitverseRoot } from \"../BitNode/ui/BitverseRoot\";\nimport { CharacterOverview } from \"./React/CharacterOverview\";\nimport { BladeburnerCinematic } from \"../Bladeburner/ui/BladeburnerCinematic\";\nimport { workerScripts } from \"../Netscript/WorkerScripts\";\nimport { Unclickable } from \"../Exploits/Unclickable\";\nimport { Snackbar } from \"./React/Snackbar\";\nimport { LogBoxManager } from \"./React/LogBoxManager\";\nimport { AlertManager } from \"./React/AlertManager\";\nimport { PromptManager } from \"./React/PromptManager\";\nimport { InvitationModal } from \"../Faction/ui/InvitationModal\";\n\nimport { enterBitNode } from \"../RedPill\";\nimport { Context } from \"./Context\";\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 },\n }),\n);\n\nlet filename = \"\";\nlet code = \"\";\n\nexport let Router: IRouter = {\n page: () => {\n throw new Error(\"Router called before initialization\");\n },\n toActiveScripts: () => {\n throw new Error(\"Router called before initialization\");\n },\n toAugmentations: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBitVerse: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBladeburner: () => {\n throw new Error(\"Router called before initialization\");\n },\n toStats: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCity: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCorporation: () => {\n throw new Error(\"Router called before initialization\");\n },\n toCreateProgram: () => {\n throw new Error(\"Router called before initialization\");\n },\n toDevMenu: () => {\n throw new Error(\"Router called before initialization\");\n },\n toFaction: () => {\n throw new Error(\"Router called before initialization\");\n },\n toFactions: () => {\n throw new Error(\"Router called before initialization\");\n },\n toGameOptions: () => {\n throw new Error(\"Router called before initialization\");\n },\n toGang: () => {\n throw new Error(\"Router called before initialization\");\n },\n toHacknetNodes: () => {\n throw new Error(\"Router called before initialization\");\n },\n toInfiltration: () => {\n throw new Error(\"Router called before initialization\");\n },\n toJob: () => {\n throw new Error(\"Router called before initialization\");\n },\n toMilestones: () => {\n throw new Error(\"Router called before initialization\");\n },\n toResleeves: () => {\n throw new Error(\"Router called before initialization\");\n },\n toScriptEditor: () => {\n throw new Error(\"Router called before initialization\");\n },\n toSleeves: () => {\n throw new Error(\"Router called before initialization\");\n },\n toStockMarket: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTerminal: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTravel: () => {\n throw new Error(\"Router called before initialization\");\n },\n toTutorial: () => {\n throw new Error(\"Router called before initialization\");\n },\n toWork: () => {\n throw new Error(\"Router called before initialization\");\n },\n toBladeburnerCinematic: () => {\n throw new Error(\"Router called before initialization\");\n },\n toLocation: () => {\n throw new Error(\"Router called before initialization\");\n },\n};\n\nfunction determineStartPage(player: IPlayer): Page {\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 [page, setPage] = useState(determineStartPage(player));\n const setRerender = useState(0)[1];\n const [faction, setFaction] = useState<Faction>(\n player.currentWorkFactionName ? Factions[player.currentWorkFactionName] : (undefined as unknown as Faction),\n );\n if (faction === undefined && page === Page.Faction)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [flume, setFlume] = useState<boolean>(false);\n const [quick, setQuick] = useState<boolean>(false);\n const [location, setLocation] = useState<Location>(undefined as unknown as Location);\n if (location === undefined && (page === Page.Infiltration || page === Page.Location || page === Page.Job))\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [cinematicText, setCinematicText] = useState(\"\");\n\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n\n Router = {\n page: () => page,\n toActiveScripts: () => setPage(Page.ActiveScripts),\n toAugmentations: () => setPage(Page.Augmentations),\n toBladeburner: () => setPage(Page.Bladeburner),\n toStats: () => setPage(Page.Stats),\n toCorporation: () => setPage(Page.Corporation),\n toCreateProgram: () => setPage(Page.CreateProgram),\n toDevMenu: () => setPage(Page.DevMenu),\n toFaction: (faction?: Faction) => {\n setPage(Page.Faction);\n if (faction) setFaction(faction);\n },\n toFactions: () => setPage(Page.Factions),\n toGameOptions: () => setPage(Page.Options),\n toGang: () => setPage(Page.Gang),\n toHacknetNodes: () => setPage(Page.Hacknet),\n toMilestones: () => setPage(Page.Milestones),\n toResleeves: () => setPage(Page.Resleeves),\n toScriptEditor: (fn: string, c: string) => {\n filename = fn;\n code = c;\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 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 };\n\n useEffect(() => {\n filename = \"\";\n code = \"\";\n if (page !== Page.Terminal) window.scrollTo(0, 0);\n });\n\n return (\n <Context.Player.Provider value={player}>\n <Context.Router.Provider value={Router}>\n <Overview>\n {!ITutorial.isRunning ? (\n <CharacterOverview save={() => saveObject.saveGame()} />\n ) : (\n <InteractiveTutorialRoot />\n )}\n </Overview>\n {page === Page.BitVerse ? (\n <BitverseRoot flume={flume} enter={enterBitNode} quick={quick} />\n ) : page === Page.Infiltration ? (\n <InfiltrationRoot location={location} />\n ) : page === Page.BladeburnerCinematic ? (\n <BladeburnerCinematic />\n ) : page === Page.Work ? (\n <WorkInProgressRoot />\n ) : (\n <Box display=\"flex\" flexDirection=\"row\" width=\"100%\">\n <SidebarRoot player={player} router={Router} page={page} />\n <Box className={classes.root} flexGrow={1} display=\"block\" px={1} height=\"100vh\">\n {page === Page.Terminal ? (\n <TerminalRoot terminal={terminal} router={Router} player={player} />\n ) : page === Page.Sleeves ? (\n <SleeveRoot />\n ) : page === Page.Stats ? (\n <CharacterStats />\n ) : page === Page.ScriptEditor ? (\n <ScriptEditorRoot filename={filename} code={code} player={player} router={Router} />\n ) : page === Page.ActiveScripts ? (\n <ActiveScriptsRoot workerScripts={workerScripts} />\n ) : page === Page.Hacknet ? (\n <HacknetRoot player={player} />\n ) : page === Page.CreateProgram ? (\n <ProgramsRoot />\n ) : page === Page.Factions ? (\n <FactionsRoot player={player} router={Router} />\n ) : page === Page.Faction ? (\n <FactionRoot faction={faction} />\n ) : page === Page.Milestones ? (\n <MilestonesRoot player={player} />\n ) : page === Page.Tutorial ? (\n <TutorialRoot />\n ) : page === Page.DevMenu ? (\n <DevMenuRoot player={player} engine={engine} router={Router} />\n ) : page === Page.Gang ? (\n <GangRoot />\n ) : page === Page.Corporation ? (\n <CorporationRoot />\n ) : page === Page.Bladeburner ? (\n <BladeburnerRoot />\n ) : page === Page.Resleeves ? (\n <ResleeveRoot />\n ) : page === Page.Travel ? (\n <TravelAgencyRoot p={player} router={Router} />\n ) : page === Page.StockMarket ? (\n <StockMarketRoot\n buyStockLong={buyStock}\n buyStockShort={shortStock}\n cancelOrder={cancelOrder}\n eventEmitterForReset={eventEmitterForUiReset}\n initStockMarket={initStockMarketFnForReact}\n p={player}\n placeOrder={placeOrder}\n sellStockLong={sellStock}\n sellStockShort={sellShort}\n stockMarket={StockMarket}\n />\n ) : page === Page.City ? (\n <LocationCity />\n ) : page === Page.Job ? (\n <GenericLocation loc={location} />\n ) : page === Page.Location ? (\n <GenericLocation loc={location} />\n ) : page === Page.Options ? (\n <GameOptionsRoot\n player={player}\n save={() => saveObject.saveGame()}\n export={() => saveObject.exportGame()}\n forceKill={() => {\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n dialogBoxCreate(\"Forcefully deleted all running scripts. Please save and refresh page.\");\n }}\n softReset={() => {\n dialogBoxCreate(\"Soft Reset!\");\n prestigeAugmentation();\n Router.toTerminal();\n }}\n />\n ) : page === Page.Augmentations ? (\n <AugmentationsRoot\n exportGameFn={() => {\n saveObject.exportGame();\n onExport(player);\n }}\n installAugmentationsFn={() => {\n installAugmentations();\n Router.toTerminal();\n }}\n />\n ) : (\n <>\n <Typography>Cannot load</Typography>\n </>\n )}\n </Box>\n </Box>\n )}\n <Unclickable />\n <Snackbar />\n <LogBoxManager />\n <AlertManager />\n <PromptManager />\n <InvitationModal />\n </Context.Router.Provider>\n </Context.Player.Provider>\n );\n}\n","import { GetServer, createUniqueRandomIp, ipExists } from \"./AllServers\";\nimport { Server, IConstructorParams } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { calculateServerGrowth } from \"./formulas/grow\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Programs } from \"../Programs/Programs\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\n\nimport { isValidNumber } from \"../utils/helpers/isValidNumber\";\n\n/**\n * Constructs a new server, while also ensuring that the new server\n * does not have a duplicate hostname/ip.\n */\nexport function safetlyCreateUniqueServer(params: IConstructorParams): Server {\n if (params.ip != null && ipExists(params.ip)) {\n params.ip = createUniqueRandomIp();\n }\n\n if (GetServer(params.hostname) != null) {\n // Use a for loop to ensure that we don't get suck in an infinite loop somehow\n let hostname: string = params.hostname;\n for (let i = 0; i < 200; ++i) {\n hostname = `${params.hostname}-${i}`;\n if (GetServer(hostname) == null) {\n break;\n }\n }\n params.hostname = hostname;\n }\n\n return new Server(params);\n}\n\n/**\n * Returns the number of \"growth cycles\" needed to grow the specified server by the\n * specified amount.\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowth(server: Server, growth: number, p: IPlayer, cores = 1): number {\n let ajdGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n const serverGrowthPercentage = server.serverGrowth / 100;\n\n const coreBonus = 1 + (cores - 1) / 16;\n const cycles =\n Math.log(growth) /\n (Math.log(ajdGrowthRate) *\n p.hacking_grow_mult *\n serverGrowthPercentage *\n BitNodeMultipliers.ServerGrowthRate *\n coreBonus);\n\n return cycles;\n}\n\n//Applied server growth for a single server. Returns the percentage growth\nexport function processSingleServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n let serverGrowth = calculateServerGrowth(server, threads, p, cores);\n if (serverGrowth < 1) {\n console.warn(\"serverGrowth calculated to be less than 1\");\n serverGrowth = 1;\n }\n\n const oldMoneyAvailable = server.moneyAvailable;\n server.moneyAvailable += 1 * threads; // It can be grown even if it has no money\n server.moneyAvailable *= serverGrowth;\n\n // in case of data corruption\n if (isValidNumber(server.moneyMax) && isNaN(server.moneyAvailable)) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // cap at max\n if (isValidNumber(server.moneyMax) && server.moneyAvailable > server.moneyMax) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // if there was any growth at all, increase security\n if (oldMoneyAvailable !== server.moneyAvailable) {\n //Growing increases server security twice as much as hacking\n let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable, p, cores);\n usedCycles = Math.max(0, usedCycles);\n server.fortify(2 * CONSTANTS.ServerFortifyAmount * Math.ceil(usedCycles));\n }\n return server.moneyAvailable / oldMoneyAvailable;\n}\n\nexport function prestigeHomeComputer(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(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","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 { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\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 { Augmentations } from \"../Augmentation/Augmentations\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nimport { Faction } from \"./Faction\";\nimport { Factions } from \"./Factions\";\nimport { Player } from \"../Player\";\nimport { Settings } from \"../Settings/Settings\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../PersonObjects/formulas/reputation\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { InvitationEvent } from \"./ui/InvitationModal\";\n\nexport function inviteToFaction(faction: Faction): void {\n Player.factionInvitations.push(faction.name);\n faction.alreadyInvited = true;\n if (!Settings.SuppressFactionInvites) {\n InvitationEvent.emit(faction);\n }\n}\n\nexport function joinFaction(faction: Faction): void {\n if (faction.isMember) return;\n faction.isMember = true;\n Player.factions.push(faction.name);\n const factionInfo = faction.getInfo();\n\n //Determine what factions you are banned from now that you have joined this faction\n for (const i in factionInfo.enemies) {\n const enemy = factionInfo.enemies[i];\n if (Factions[enemy] instanceof Faction) {\n Factions[enemy].isBanned = true;\n }\n }\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == faction.name || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n}\n\n//Returns a boolean indicating whether the player has the prerequisites for the\n//specified Augmentation\nexport function hasAugmentationPrereqs(aug: Augmentation): boolean {\n let hasPrereqs = true;\n if (aug.prereqs && aug.prereqs.length > 0) {\n for (let i = 0; i < aug.prereqs.length; ++i) {\n const prereqAug = Augmentations[aug.prereqs[i]];\n if (prereqAug == null) {\n console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`);\n continue;\n }\n if (prereqAug.owned === false) {\n hasPrereqs = false;\n\n // Check if the aug is purchased\n for (let j = 0; j < Player.queuedAugmentations.length; ++j) {\n if (Player.queuedAugmentations[j].name === prereqAug.name) {\n hasPrereqs = true;\n break;\n }\n }\n }\n }\n }\n\n return hasPrereqs;\n}\n\nexport function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {\n const factionInfo = fac.getInfo();\n const hasPrereqs = hasAugmentationPrereqs(aug);\n if (!hasPrereqs) {\n const txt =\n \"You must first purchase or install \" + aug.prereqs.join(\",\") + \" before you can \" + \"purchase this one.\";\n if (sing) {\n return txt;\n } else {\n dialogBoxCreate(txt);\n }\n } else if (aug.baseCost !== 0 && Player.money.lt(aug.baseCost * factionInfo.augmentationPriceMult)) {\n const txt = \"You don't have enough money to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (fac.playerReputation < aug.baseRepRequirement) {\n const txt = \"You don't have enough faction reputation to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (aug.baseCost === 0 || Player.money.gte(aug.baseCost * factionInfo.augmentationPriceMult)) {\n const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n queuedAugmentation.level = getNextNeurofluxLevel();\n }\n Player.queuedAugmentations.push(queuedAugmentation);\n\n Player.loseMoney(aug.baseCost * factionInfo.augmentationPriceMult);\n\n // If you just purchased Neuroflux Governor, recalculate the cost\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n let nextLevel = getNextNeurofluxLevel();\n --nextLevel;\n const mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n aug.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;\n aug.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (let i = 0; i < Player.queuedAugmentations.length - 1; ++i) {\n aug.baseCost *= CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]];\n }\n }\n\n for (const name in Augmentations) {\n if (Augmentations.hasOwnProperty(name)) {\n Augmentations[name].baseCost *= CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]];\n }\n }\n\n if (sing) {\n return \"You purchased \" + aug.name;\n } else {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n dialogBoxCreate(\n \"You purchased \" +\n aug.name +\n \". It's enhancements will not take \" +\n \"effect until they are installed. To install your augmentations, go to the \" +\n \"'Augmentations' tab on the left-hand navigation menu. Purchasing additional \" +\n \"augmentations will now be more expensive.\",\n );\n }\n }\n } else {\n dialogBoxCreate(\n \"Hmm, something went wrong when trying to purchase an Augmentation. \" +\n \"Please report this to the game developer with an explanation of how to \" +\n \"reproduce this.\",\n );\n }\n return \"\";\n}\n\nexport function getNextNeurofluxLevel(): number {\n // Get current Neuroflux level based on Player's augmentations\n let currLevel = 0;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = Player.augmentations[i].level;\n }\n }\n\n // Account for purchased but uninstalled Augmentations\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n if (Player.queuedAugmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n ++currLevel;\n }\n }\n return currLevel + 1;\n}\n\nexport function processPassiveFactionRepGain(numCycles: number): void {\n for (const name in 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","/**\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 * 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.gt(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 * Generic Event Emitter class following a subscribe/publish paradigm.\n */\n\ntype cbFn = (...args: any[]) => any;\n\nexport interface ISubscriber {\n /**\n * Callback function that will be run when an event is emitted\n */\n cb: cbFn;\n\n /**\n * Name/identifier for this subscriber\n */\n id: string;\n}\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 { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\n\nexport class Message {\n // Name of Message file\n filename = \"\";\n\n // The text contains in the Message\n msg = \"\";\n\n // Flag indicating whether this Message has been received by the player\n recvd = false;\n\n constructor(filename = \"\", msg = \"\") {\n this.filename = filename;\n this.msg = msg;\n this.recvd = false;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"Message\", this);\n }\n\n // Initializes a Message Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Message {\n return Generic_fromJSON(Message, value.data);\n }\n}\n\nReviver.constructors.Message = Message;\n","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 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 { 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\";\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 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 | number} - 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 if (workerScript instanceof WorkerScript) {\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 server.ramUsed = 0;\n for (const rs of server.runningScripts) server.ramUsed += rs.ramUsage * rs.threads;\n\n // Delete script from global pool (workerScripts)\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\n if (rerenderUi) {\n WorkerScriptStartStopEventEmitter.emit();\n }\n } else {\n console.error(`Invalid argument passed into removeWorkerScript():`);\n console.error(workerScript);\n return;\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.delayResolve) {\n workerScript.delayResolve();\n }\n }\n }\n}\n","import { IMinMaxRange } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nexport const StockForecastInfluenceLimit = 5;\n\nexport interface IConstructorParams {\n b: boolean;\n initPrice: number | IMinMaxRange;\n marketCap: number;\n mv: number | IMinMaxRange;\n name: string;\n otlkMag: number;\n spreadPerc: number | IMinMaxRange;\n shareTxForMovement: number | IMinMaxRange;\n symbol: string;\n}\n\nconst defaultConstructorParams: IConstructorParams = {\n b: true,\n initPrice: 10e3,\n marketCap: 1e12,\n mv: 1,\n name: \"\",\n otlkMag: 0,\n spreadPerc: 0,\n shareTxForMovement: 1e6,\n symbol: \"\",\n};\n\n// Helper function that convert a IMinMaxRange to a number\nfunction toNumber(n: number | IMinMaxRange): number {\n let value: number;\n switch (typeof n) {\n case \"number\": {\n return n;\n }\n case \"object\": {\n const range = n as IMinMaxRange;\n value = getRandomInt(range.min, range.max);\n break;\n }\n default:\n throw Error(`Do not know how to convert the type '${typeof n}' to a number`);\n }\n\n if (typeof n === \"object\" && typeof n.divisor === \"number\") {\n return value / n.divisor;\n }\n\n return value;\n}\n\n/**\n * Represents the valuation of a company in the World Stock Exchange.\n */\nexport class Stock {\n /**\n * Bear or bull (more likely to go up or down, based on otlkMag)\n */\n b: boolean;\n\n /**\n * Maximum price of a stock (per share)\n */\n readonly cap: number;\n\n /**\n * Stocks previous share price\n */\n lastPrice: number;\n\n /**\n * Maximum number of shares that player can own (both long and short combined)\n */\n readonly maxShares: number;\n\n /**\n * Maximum volatility\n */\n readonly mv: number;\n\n /**\n * Name of the company that the stock is for\n */\n readonly name: string;\n\n /**\n * Outlook magnitude. Represents the stock's forecast and likelihood\n * of increasing/decreasing (based on whether its in bear or bull mode)\n */\n otlkMag: number;\n\n /**\n * Forecast of outlook magnitude. Essentially a second-order forecast.\n * Unlike 'otlkMag', this number is on an absolute scale from 0-100 (rather than 0-50)\n */\n otlkMagForecast: number;\n\n /**\n * Average price of stocks that the player owns in the LONG position\n */\n playerAvgPx: number;\n\n /**\n * Average price of stocks that the player owns in the SHORT position\n */\n playerAvgShortPx: number;\n\n /**\n * Number of shares the player owns in the LONG position\n */\n playerShares: number;\n\n /**\n * Number of shares the player owns in the SHORT position\n */\n playerShortShares: number;\n\n /**\n * Stock's share price\n */\n price: number;\n\n /**\n * How many shares need to be transacted in order to trigger a price movement\n */\n readonly shareTxForMovement: number;\n\n /**\n * How many share transactions remaining until a price movement occurs\n * (separately tracked for upward and downward movements)\n */\n shareTxUntilMovement: number;\n\n /**\n * Spread percentage. The bid/ask prices for this stock are N% above or below\n * the \"real price\" to emulate spread.\n */\n readonly spreadPerc: number;\n\n /**\n * The stock's ticker symbol\n */\n readonly symbol: string;\n\n /**\n * Total number of shares of this stock\n * This is different than maxShares, as this is like authorized stock while\n * maxShares is outstanding stock.\n */\n readonly totalShares: number;\n\n constructor(p: IConstructorParams = defaultConstructorParams) {\n this.name = p.name;\n this.symbol = p.symbol;\n this.price = toNumber(p.initPrice);\n this.lastPrice = this.price;\n this.playerShares = 0;\n this.playerAvgPx = 0;\n this.playerShortShares = 0;\n this.playerAvgShortPx = 0;\n this.mv = toNumber(p.mv);\n this.b = p.b;\n this.otlkMag = p.otlkMag;\n this.otlkMagForecast = this.getAbsoluteForecast();\n this.cap = getRandomInt(this.price * 1e3, this.price * 25e3);\n this.spreadPerc = toNumber(p.spreadPerc);\n this.shareTxForMovement = toNumber(p.shareTxForMovement);\n this.shareTxUntilMovement = this.shareTxForMovement;\n\n // Total shares is determined by market cap, and is rounded to nearest 100k\n const totalSharesUnrounded: number = p.marketCap / this.price;\n this.totalShares = Math.round(totalSharesUnrounded / 1e5) * 1e5;\n\n // Max Shares (Outstanding shares) is a percentage of total shares\n const outstandingSharePercentage = 0.2;\n this.maxShares = Math.round((this.totalShares * outstandingSharePercentage) / 1e5) * 1e5;\n }\n\n /**\n * Safely set the stock's second-order forecast to a new value\n */\n changeForecastForecast(newff: number): void {\n this.otlkMagForecast = newff;\n if (this.otlkMagForecast > 100) {\n this.otlkMagForecast = 100;\n } else if (this.otlkMagForecast < 0) {\n this.otlkMagForecast = 0;\n }\n }\n\n /**\n * Set the stock to a new price. Also updates the stock's previous price tracker\n */\n changePrice(newPrice: number): void {\n this.lastPrice = this.price;\n this.price = newPrice;\n }\n\n /**\n * Change the stock's forecast during a stock market 'tick'.\n * The way a stock's forecast changes depends on various internal properties,\n * but is ultimately determined by RNG\n */\n cycleForecast(changeAmt = 0.1): void {\n const increaseChance = this.getForecastIncreaseChance();\n\n if (Math.random() < increaseChance) {\n // Forecast increases\n if (this.b) {\n this.otlkMag += changeAmt;\n } else {\n this.otlkMag -= changeAmt;\n }\n } else {\n // Forecast decreases\n if (this.b) {\n this.otlkMag -= changeAmt;\n } else {\n this.otlkMag += changeAmt;\n }\n }\n\n this.otlkMag = Math.min(this.otlkMag, 50);\n if (this.otlkMag < 0) {\n this.otlkMag *= -1;\n this.b = !this.b;\n }\n }\n\n /**\n * Change's the stock's second-order forecast during a stock market 'tick'.\n * The change for the second-order forecast to increase is 50/50\n */\n cycleForecastForecast(changeAmt = 0.1): void {\n if (Math.random() < 0.5) {\n this.changeForecastForecast(this.otlkMagForecast + changeAmt);\n } else {\n this.changeForecastForecast(this.otlkMagForecast - changeAmt);\n }\n }\n\n /**\n * \"Flip\" the stock's second-order forecast. This can occur during a\n * stock market \"cycle\" (determined by RNG). It is used to simulate\n * RL stock market cycles and introduce volatility\n */\n flipForecastForecast(): void {\n const diff = this.otlkMagForecast - 50;\n this.otlkMagForecast = 50 + -1 * diff;\n }\n\n /**\n * Returns the stock's absolute forecast, which is a number between 0-100\n */\n getAbsoluteForecast(): number {\n return this.b ? 50 + this.otlkMag : 50 - this.otlkMag;\n }\n\n /**\n * Return the price at which YOUR stock is bought (market ask price). Accounts for spread\n */\n getAskPrice(): number {\n return this.price * (1 + this.spreadPerc / 100);\n }\n\n /**\n * Return the price at which YOUR stock is sold (market bid price). Accounts for spread\n */\n getBidPrice(): number {\n return this.price * (1 - this.spreadPerc / 100);\n }\n\n /**\n * Returns the chance (0-1 decimal) that a stock has of having its forecast increase\n */\n getForecastIncreaseChance(): number {\n const diff = this.otlkMagForecast - this.getAbsoluteForecast();\n\n return (50 + Math.min(Math.max(diff, -45), 45)) / 100;\n }\n\n /**\n * Changes a stock's forecast. This is used when the stock is influenced\n * by a transaction. The stock's forecast always goes towards 50, but the\n * movement is capped by a certain threshold/limit\n */\n influenceForecast(change: number): void {\n if (this.otlkMag > StockForecastInfluenceLimit) {\n this.otlkMag = Math.max(StockForecastInfluenceLimit, this.otlkMag - change);\n }\n }\n\n /**\n * Changes a stock's second-order forecast. This is used when the stock is\n * influenced by a transaction. The stock's second-order forecast always\n * goes towards 50.\n */\n influenceForecastForecast(change: number): void {\n if (this.otlkMagForecast > 50) {\n this.otlkMagForecast -= change;\n this.otlkMagForecast = Math.max(50, this.otlkMagForecast);\n } else if (this.otlkMagForecast < 50) {\n this.otlkMagForecast += change;\n this.otlkMagForecast = Math.min(50, this.otlkMagForecast);\n }\n }\n\n /**\n * Serialize the Stock to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Stock\", this);\n }\n\n /**\n * Initializes a Stock from a JSON save state\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Stock {\n return Generic_fromJSON(Stock, value.data);\n }\n}\n\nReviver.constructors.Stock = Stock;\n","/**\n * Map of all Cities in the game\n * Key = City Name, Value = City object\n */\nimport { City } from \"./City\";\nimport { IMap } from \"../types\";\n\nexport const Cities: IMap<City> = {};\n","import 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 { 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 in Aliases) {\n if (Aliases.hasOwnProperty(name)) {\n Terminal.print(\"alias \" + name + \"=\" + Aliases[name]);\n }\n }\n for (const name in 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 != 3) {\n return false;\n }\n if (global) {\n addGlobalAlias(matches[1], matches[2]);\n } else {\n addAlias(matches[1], matches[2]);\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 { isString } from \"./utils/helpers/isString\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\n\nexport function netscriptDelay(time: number, workerScript: WorkerScript): Promise<void> {\n return new Promise(function (resolve) {\n workerScript.delay = window.setTimeout(() => {\n workerScript.delay = null;\n resolve();\n }, time);\n workerScript.delayResolve = resolve;\n });\n}\n\nexport function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): string {\n const lineNum = \"\";\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${workerScript.hostname}`);\n }\n console.error(\"|\" + server.hostname + \"|\" + workerScript.name + \"|\" + msg + lineNum);\n\n return \"|\" + server.hostname + \"|\" + workerScript.name + \"|\" + msg + lineNum;\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 (requestedThreads > 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(\"|\");\n if (splitMsg.length != 4) {\n return false;\n }\n return true;\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 { Augmentation, IConstructorParams } from \"./Augmentation\";\nimport { Augmentations } from \"./Augmentations\";\nimport { PlayerOwnedAugmentation, IPlayerOwnedAugmentation } from \"./PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Player } from \"../Player\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { Programs } from \"../Programs/Programs\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { clearObject } from \"../utils/helpers/clearObject\";\n\nimport { WHRNG } from \"../Casino/RNG\";\n\nimport React from \"react\";\n\nfunction AddToAugmentations(aug: Augmentation): void {\n const name = aug.name;\n Augmentations[name] = aug;\n}\n\nfunction getRandomBonus(): any {\n const bonuses = [\n {\n bonuses: {\n hacking_chance_mult: 1.25,\n hacking_speed_mult: 1.1,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 1.1,\n },\n description:\n \"Increases the player's hacking chance by 25%.<br>\" +\n \"Increases the player's hacking speed by 10%.<br>\" +\n \"Increases the amount of money the player's gains from hacking by 25%.<br>\" +\n \"Improves grow() by 10%.\",\n },\n {\n bonuses: {\n hacking_mult: 1.15,\n hacking_exp_mult: 2,\n },\n description:\n \"Increases the player's hacking skill by 15%.<br>\" +\n \"Increases the player's hacking experience gain rate by 100%.\",\n },\n {\n bonuses: {\n strength_mult: 1.25,\n strength_exp_mult: 2,\n defense_mult: 1.25,\n defense_exp_mult: 2,\n dexterity_mult: 1.25,\n dexterity_exp_mult: 2,\n agility_mult: 1.25,\n agility_exp_mult: 2,\n },\n description:\n \"Increases all of the player's combat stats by 25%.<br>\" +\n \"Increases all of the player's combat stat experience gain rate by 100%.\",\n },\n {\n bonuses: {\n charisma_mult: 1.5,\n charisma_exp_mult: 2,\n },\n description:\n \"This augmentation increases the player's charisma by 50%.<br>\" +\n \"Increases the player's charisma experience gain rate by 100%.\",\n },\n {\n bonuses: {\n hacknet_node_money_mult: 1.2,\n hacknet_node_purchase_cost_mult: 0.85,\n hacknet_node_ram_cost_mult: 0.85,\n hacknet_node_core_cost_mult: 0.85,\n hacknet_node_level_cost_mult: 0.85,\n },\n description:\n \"Increases the amount of money produced by Hacknet Nodes by 20%.<br>\" +\n \"Decreases all costs related to Hacknet Node by 15%.\",\n },\n {\n bonuses: {\n company_rep_mult: 1.25,\n faction_rep_mult: 1.15,\n work_money_mult: 1.7,\n },\n description:\n \"Increases the amount of money the player gains from working by 70%.<br>\" +\n \"Increases the amount of reputation the player gains when working for a company by 25%.<br>\" +\n \"Increases the amount of reputation the player gains for a faction by 15%.\",\n },\n {\n bonuses: {\n crime_success_mult: 2,\n crime_money_mult: 2,\n },\n description:\n \"Increases the player's crime success rate by 100%.<br>\" +\n \"Increases the amount of money the player gains from crimes by 100%.\",\n },\n ];\n\n const randomNumber = new WHRNG(Math.floor(Player.lastUpdate / 3600000));\n for (let i = 0; i < 5; i++) randomNumber.step();\n\n return bonuses[Math.floor(bonuses.length * randomNumber.random())];\n}\n\nfunction initAugmentations(): void {\n for (const name in Factions) {\n if (Factions.hasOwnProperty(name)) {\n Factions[name].augmentations = [];\n }\n }\n\n //Reset Augmentations\n clearObject(Augmentations);\n\n //Time-Based Augment Test\n const randomBonuses = getRandomBonus();\n\n const UnstableCircadianModulatorParams: IConstructorParams = {\n name: AugmentationNames.UnstableCircadianModulator,\n moneyCost: 5e9,\n repCost: 3.625e5,\n info:\n \"An experimental nanobot injection. Its unstable nature leads to \" +\n \"unpredictable results based on your circadian rhythm.\",\n };\n Object.keys(randomBonuses.bonuses).forEach(\n (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]),\n );\n const UnstableCircadianModulator = new Augmentation(UnstableCircadianModulatorParams);\n\n UnstableCircadianModulator.addToFactions([\"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.UnstableCircadianModulator)) {\n delete Augmentations[AugmentationNames.UnstableCircadianModulator];\n }\n AddToAugmentations(UnstableCircadianModulator);\n\n //Combat stat augmentations\n const HemoRecirculator = new Augmentation({\n name: AugmentationNames.HemoRecirculator,\n moneyCost: 4.5e7,\n repCost: 1e4,\n info: \"A heart implant that greatly increases the body's ability to effectively use and pump \" + \"blood.\",\n strength_mult: 1.08,\n defense_mult: 1.08,\n agility_mult: 1.08,\n dexterity_mult: 1.08,\n });\n HemoRecirculator.addToFactions([\"Tetrads\", \"The Dark Army\", \"The Syndicate\"]);\n if (augmentationExists(AugmentationNames.HemoRecirculator)) {\n delete Augmentations[AugmentationNames.HemoRecirculator];\n }\n AddToAugmentations(HemoRecirculator);\n\n const Targeting1 = new Augmentation({\n name: AugmentationNames.Targeting1,\n moneyCost: 1.5e7,\n repCost: 5e3,\n info:\n \"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates \" +\n \"and enhances balance and hand-eye coordination.\",\n dexterity_mult: 1.1,\n });\n Targeting1.addToFactions([\n \"Slum Snakes\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Sector-12\",\n \"Ishima\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting1)) {\n delete Augmentations[AugmentationNames.Targeting1];\n }\n AddToAugmentations(Targeting1);\n\n const Targeting2 = new Augmentation({\n name: AugmentationNames.Targeting2,\n moneyCost: 4.25e7,\n repCost: 8.75e3,\n info:\n \"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting \" +\n \"reality by digitally displaying weaknesses and vital signs of threats.\",\n prereqs: [AugmentationNames.Targeting1],\n dexterity_mult: 1.2,\n });\n Targeting2.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"Sector-12\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting2)) {\n delete Augmentations[AugmentationNames.Targeting2];\n }\n AddToAugmentations(Targeting2);\n\n const Targeting3 = new Augmentation({\n name: AugmentationNames.Targeting3,\n moneyCost: 1.15e8,\n repCost: 2.75e4,\n info: \"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.\",\n prereqs: [AugmentationNames.Targeting2],\n dexterity_mult: 1.3,\n });\n Targeting3.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.Targeting3)) {\n delete Augmentations[AugmentationNames.Targeting3];\n }\n AddToAugmentations(Targeting3);\n\n const SyntheticHeart = new Augmentation({\n name: AugmentationNames.SyntheticHeart,\n moneyCost: 2.875e9,\n repCost: 7.5e5,\n info:\n \"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood \" +\n \"more efficiently than an organic heart.\",\n agility_mult: 1.5,\n strength_mult: 1.5,\n });\n SyntheticHeart.addToFactions([\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Speakers for the Dead\",\n \"NWO\",\n \"The Covenant\",\n \"Daedalus\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.SyntheticHeart)) {\n delete Augmentations[AugmentationNames.SyntheticHeart];\n }\n AddToAugmentations(SyntheticHeart);\n\n const SynfibrilMuscle = new Augmentation({\n name: AugmentationNames.SynfibrilMuscle,\n repCost: 4.375e5,\n moneyCost: 1.125e9,\n info:\n \"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside \" +\n \"the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. \" +\n \"Scientists have named these artificially enhanced units 'synfibrils'.\",\n strength_mult: 1.3,\n defense_mult: 1.3,\n });\n SynfibrilMuscle.addToFactions([\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Speakers for the Dead\",\n \"NWO\",\n \"The Covenant\",\n \"Daedalus\",\n \"Illuminati\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.SynfibrilMuscle)) {\n delete Augmentations[AugmentationNames.SynfibrilMuscle];\n }\n AddToAugmentations(SynfibrilMuscle);\n\n const CombatRib1 = new Augmentation({\n name: AugmentationNames.CombatRib1,\n repCost: 7.5e3,\n moneyCost: 2.375e7,\n info:\n \"The rib cage is augmented to continuously release boosters into the bloodstream \" +\n \"which increase the oxygen-carrying capacity of blood.\",\n strength_mult: 1.1,\n defense_mult: 1.1,\n });\n CombatRib1.addToFactions([\n \"Slum Snakes\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Volhaven\",\n \"Ishima\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib1)) {\n delete Augmentations[AugmentationNames.CombatRib1];\n }\n AddToAugmentations(CombatRib1);\n\n const CombatRib2 = new Augmentation({\n name: AugmentationNames.CombatRib2,\n repCost: 1.875e4,\n moneyCost: 6.5e7,\n info:\n \"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which \" +\n \"improve focus and endurance while decreasing reaction time and fatigue.\",\n prereqs: [AugmentationNames.CombatRib1],\n strength_mult: 1.14,\n defense_mult: 1.14,\n });\n CombatRib2.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"Volhaven\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib2)) {\n delete Augmentations[AugmentationNames.CombatRib2];\n }\n AddToAugmentations(CombatRib2);\n\n const CombatRib3 = new Augmentation({\n name: AugmentationNames.CombatRib3,\n repCost: 3.5e4,\n moneyCost: 1.2e8,\n info:\n \"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that \" +\n \"improve muscle mass and physical performance while being safe and free of side effects.\",\n prereqs: [AugmentationNames.CombatRib2],\n strength_mult: 1.18,\n defense_mult: 1.18,\n });\n CombatRib3.addToFactions([\n \"The Dark Army\",\n \"The Syndicate\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n \"Blade Industries\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.CombatRib3)) {\n delete Augmentations[AugmentationNames.CombatRib3];\n }\n AddToAugmentations(CombatRib3);\n\n const NanofiberWeave = new Augmentation({\n name: AugmentationNames.NanofiberWeave,\n repCost: 3.75e4,\n moneyCost: 1.25e8,\n info:\n \"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, \" +\n \"which improves its regenerative and extracellular homeostasis abilities.\",\n strength_mult: 1.2,\n defense_mult: 1.2,\n });\n NanofiberWeave.addToFactions([\n \"Tian Di Hui\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"Blade Industries\",\n \"Fulcrum Secret Technologies\",\n \"OmniTek Incorporated\",\n ]);\n if (augmentationExists(AugmentationNames.NanofiberWeave)) {\n delete Augmentations[AugmentationNames.NanofiberWeave];\n }\n AddToAugmentations(NanofiberWeave);\n\n const SubdermalArmor = new Augmentation({\n name: AugmentationNames.SubdermalArmor,\n repCost: 8.75e5,\n moneyCost: 3.25e9,\n info:\n \"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. \" +\n \"The material is implanted underneath the skin, and is the most advanced form of defensive enhancement \" +\n \"that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective \" +\n \"at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to \" +\n \"mitigate damage from any fire or electrical traumas.\",\n defense_mult: 2.2,\n });\n SubdermalArmor.addToFactions([\n \"The Syndicate\",\n \"Fulcrum Secret Technologies\",\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n ]);\n if (augmentationExists(AugmentationNames.SubdermalArmor)) {\n delete Augmentations[AugmentationNames.SubdermalArmor];\n }\n AddToAugmentations(SubdermalArmor);\n\n const WiredReflexes = new Augmentation({\n name: AugmentationNames.WiredReflexes,\n repCost: 1.25e3,\n moneyCost: 2.5e6,\n info:\n \"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, \" +\n \"supercharging the spread of neural signals and increasing reflex speed.\",\n agility_mult: 1.05,\n dexterity_mult: 1.05,\n });\n WiredReflexes.addToFactions([\n \"Tian Di Hui\",\n \"Slum Snakes\",\n \"Sector-12\",\n \"Volhaven\",\n \"Aevum\",\n \"Ishima\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n ]);\n if (augmentationExists(AugmentationNames.WiredReflexes)) {\n delete Augmentations[AugmentationNames.WiredReflexes];\n }\n AddToAugmentations(WiredReflexes);\n\n const GrapheneBoneLacings = new Augmentation({\n name: AugmentationNames.GrapheneBoneLacings,\n repCost: 1.125e6,\n moneyCost: 4.25e9,\n info:\n \"Graphene is grafted and fused into the skeletal structure, \" + \"enhancing bone density and tensile strength.\",\n strength_mult: 1.7,\n defense_mult: 1.7,\n });\n GrapheneBoneLacings.addToFactions([\"Fulcrum Secret Technologies\", \"The Covenant\"]);\n if (augmentationExists(AugmentationNames.GrapheneBoneLacings)) {\n delete Augmentations[AugmentationNames.GrapheneBoneLacings];\n }\n AddToAugmentations(GrapheneBoneLacings);\n\n const BionicSpine = new Augmentation({\n name: AugmentationNames.BionicSpine,\n repCost: 4.5e4,\n moneyCost: 1.25e8,\n info:\n \"The spine is reconstructed using plasteel and carbon fibers. \" +\n \"It is now capable of stimulating and regulating neural signals \" +\n \"passing through the spinal cord, improving senses and reaction speed. \" +\n \"The 'Bionic Spine' also interfaces with all other 'Bionic' implants.\",\n strength_mult: 1.15,\n defense_mult: 1.15,\n agility_mult: 1.15,\n dexterity_mult: 1.15,\n });\n BionicSpine.addToFactions([\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"KuaiGong International\",\n \"OmniTek Incorporated\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.BionicSpine)) {\n delete Augmentations[AugmentationNames.BionicSpine];\n }\n AddToAugmentations(BionicSpine);\n\n const GrapheneBionicSpine = new Augmentation({\n name: AugmentationNames.GrapheneBionicSpine,\n repCost: 1.625e6,\n moneyCost: 6e9,\n info:\n \"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene \" +\n \"which enhances durability and supercharges all body functions.\",\n prereqs: [AugmentationNames.BionicSpine],\n strength_mult: 1.6,\n defense_mult: 1.6,\n agility_mult: 1.6,\n dexterity_mult: 1.6,\n });\n GrapheneBionicSpine.addToFactions([\"Fulcrum Secret Technologies\", \"ECorp\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicSpine)) {\n delete Augmentations[AugmentationNames.GrapheneBionicSpine];\n }\n AddToAugmentations(GrapheneBionicSpine);\n\n const BionicLegs = new Augmentation({\n name: AugmentationNames.BionicLegs,\n repCost: 1.5e5,\n moneyCost: 3.75e8,\n info: \"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.\",\n agility_mult: 1.6,\n });\n BionicLegs.addToFactions([\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"KuaiGong International\",\n \"OmniTek Incorporated\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.BionicLegs)) {\n delete Augmentations[AugmentationNames.BionicLegs];\n }\n AddToAugmentations(BionicLegs);\n\n const GrapheneBionicLegs = new Augmentation({\n name: AugmentationNames.GrapheneBionicLegs,\n repCost: 7.5e5,\n moneyCost: 4.5e9,\n info:\n \"An upgrade to the 'Bionic Legs' augmentation. The legs are fused \" +\n \"with graphene, greatly enhancing jumping ability.\",\n prereqs: [AugmentationNames.BionicLegs],\n agility_mult: 2.5,\n });\n GrapheneBionicLegs.addToFactions([\"MegaCorp\", \"ECorp\", \"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicLegs)) {\n delete Augmentations[AugmentationNames.GrapheneBionicLegs];\n }\n AddToAugmentations(GrapheneBionicLegs);\n\n // Work stat augmentations\n const SpeechProcessor = new Augmentation({\n name: AugmentationNames.SpeechProcessor,\n repCost: 7.5e3,\n moneyCost: 5e7,\n info:\n \"A cochlear implant with an embedded computer that analyzes incoming speech. \" +\n \"The embedded computer processes characteristics of incoming speech, such as tone \" +\n \"and inflection, to pick up on subtle cues and aid in social interactions.\",\n charisma_mult: 1.2,\n });\n SpeechProcessor.addToFactions([\n \"Tian Di Hui\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Silhouette\",\n ]);\n if (augmentationExists(AugmentationNames.SpeechProcessor)) {\n delete Augmentations[AugmentationNames.SpeechProcessor];\n }\n AddToAugmentations(SpeechProcessor);\n\n const TITN41Injection = new Augmentation({\n name: AugmentationNames.TITN41Injection,\n repCost: 2.5e4,\n moneyCost: 1.9e8,\n info:\n \"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that \" +\n \"control personality. The TITN-41 strain alters these genes so that the subject becomes more \" +\n \"outgoing and socialable.\",\n charisma_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n TITN41Injection.addToFactions([\"Silhouette\"]);\n if (augmentationExists(AugmentationNames.TITN41Injection)) {\n delete Augmentations[AugmentationNames.TITN41Injection];\n }\n AddToAugmentations(TITN41Injection);\n\n const EnhancedSocialInteractionImplant = new Augmentation({\n name: AugmentationNames.EnhancedSocialInteractionImplant,\n repCost: 3.75e5,\n moneyCost: 1.375e9,\n info:\n \"A cranial implant that greatly assists in the user's ability to analyze social situations \" +\n \"and interactions. The system uses a wide variety of factors such as facial expressions, body \" +\n \"language, and the voice tone, and inflection to determine the best course of action during social\" +\n \"situations. The implant also uses deep learning software to continuously learn new behavior\" +\n \"patterns and how to best respond.\",\n charisma_mult: 1.6,\n charisma_exp_mult: 1.6,\n });\n EnhancedSocialInteractionImplant.addToFactions([\n \"Bachman & Associates\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n ]);\n if (augmentationExists(AugmentationNames.EnhancedSocialInteractionImplant)) {\n delete Augmentations[AugmentationNames.EnhancedSocialInteractionImplant];\n }\n AddToAugmentations(EnhancedSocialInteractionImplant);\n\n // Hacking augmentations\n const BitWire = new Augmentation({\n name: AugmentationNames.BitWire,\n repCost: 3.75e3,\n moneyCost: 1e7,\n info:\n \"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing \" +\n \"capabilities.\",\n hacking_mult: 1.05,\n });\n BitWire.addToFactions([\"CyberSec\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.BitWire)) {\n delete Augmentations[AugmentationNames.BitWire];\n }\n AddToAugmentations(BitWire);\n\n const ArtificialBioNeuralNetwork = new Augmentation({\n name: AugmentationNames.ArtificialBioNeuralNetwork,\n repCost: 2.75e5,\n moneyCost: 3e9,\n info:\n \"A network consisting of millions of nanoprocessors is embedded into the brain. \" +\n \"The network is meant to mimic the way a biological brain solves a problem, with each \" +\n \"nanoprocessor acting similar to the way a neuron would in a neural network. However, these \" +\n \"nanoprocessors are programmed to perform computations much faster than organic neurons, \" +\n \"allowing the user to solve much more complex problems at a much faster rate.\",\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.15,\n hacking_mult: 1.12,\n });\n ArtificialBioNeuralNetwork.addToFactions([\"BitRunners\", \"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.ArtificialBioNeuralNetwork)) {\n delete Augmentations[AugmentationNames.ArtificialBioNeuralNetwork];\n }\n AddToAugmentations(ArtificialBioNeuralNetwork);\n\n const ArtificialSynapticPotentiation = new Augmentation({\n name: AugmentationNames.ArtificialSynapticPotentiation,\n repCost: 6.25e3,\n moneyCost: 8e7,\n info:\n \"The body is injected with a chemical that artificially induces synaptic potentiation, \" +\n \"otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.\",\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 1.05,\n });\n ArtificialSynapticPotentiation.addToFactions([\"The Black Hand\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.ArtificialSynapticPotentiation)) {\n delete Augmentations[AugmentationNames.ArtificialSynapticPotentiation];\n }\n AddToAugmentations(ArtificialSynapticPotentiation);\n\n const EnhancedMyelinSheathing = new Augmentation({\n name: AugmentationNames.EnhancedMyelinSheathing,\n repCost: 1e5,\n moneyCost: 1.375e9,\n info:\n \"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. \" +\n \"This process results in the proliferation of new, synthetic myelin sheaths in the nervous \" +\n \"system. These myelin sheaths can propogate neuro-signals much faster than their organic \" +\n \"counterparts, leading to greater processing speeds and better brain function.\",\n hacking_speed_mult: 1.03,\n hacking_exp_mult: 1.1,\n hacking_mult: 1.08,\n });\n EnhancedMyelinSheathing.addToFactions([\"Fulcrum Secret Technologies\", \"BitRunners\", \"The Black Hand\"]);\n if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) {\n delete Augmentations[AugmentationNames.EnhancedMyelinSheathing];\n }\n AddToAugmentations(EnhancedMyelinSheathing);\n\n const SynapticEnhancement = new Augmentation({\n name: AugmentationNames.SynapticEnhancement,\n repCost: 2e3,\n moneyCost: 7.5e6,\n info:\n \"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and \" +\n \"induce stronger synaptic activity. This improves the user's cognitive abilities.\",\n hacking_speed_mult: 1.03,\n });\n SynapticEnhancement.addToFactions([\"CyberSec\", \"Aevum\"]);\n if (augmentationExists(AugmentationNames.SynapticEnhancement)) {\n delete Augmentations[AugmentationNames.SynapticEnhancement];\n }\n AddToAugmentations(SynapticEnhancement);\n\n const NeuralRetentionEnhancement = new Augmentation({\n name: AugmentationNames.NeuralRetentionEnhancement,\n repCost: 2e4,\n moneyCost: 2.5e8,\n info:\n \"Chemical injections are used to permanently alter and strengthen the brain's neuronal \" +\n \"circuits, strengthening the ability to retain information.\",\n hacking_exp_mult: 1.25,\n });\n NeuralRetentionEnhancement.addToFactions([\"NiteSec\"]);\n if (augmentationExists(AugmentationNames.NeuralRetentionEnhancement)) {\n delete Augmentations[AugmentationNames.NeuralRetentionEnhancement];\n }\n AddToAugmentations(NeuralRetentionEnhancement);\n\n const DataJack = new Augmentation({\n name: AugmentationNames.DataJack,\n repCost: 1.125e5,\n moneyCost: 4.5e8,\n info:\n \"A brain implant that provides an interface for direct, wireless communication between a computer's main \" +\n \"memory and the mind. This implant allows the user to not only access a computer's memory, but also alter \" +\n \"and delete it.\",\n hacking_money_mult: 1.25,\n });\n DataJack.addToFactions([\"BitRunners\", \"The Black Hand\", \"NiteSec\", \"Chongqing\", \"New Tokyo\"]);\n if (augmentationExists(AugmentationNames.DataJack)) {\n delete Augmentations[AugmentationNames.DataJack];\n }\n AddToAugmentations(DataJack);\n\n const ENM = new Augmentation({\n name: AugmentationNames.ENM,\n repCost: 1.5e4,\n moneyCost: 2.5e8,\n info:\n \"A thin device embedded inside the arm containing a wireless module capable of connecting \" +\n \"to nearby networks. Once connected, the Netburner Module is capable of capturing and \" +\n \"processing all of the traffic on that network. By itself, the Embedded Netburner Module does \" +\n \"not do much, but a variety of very powerful upgrades can be installed that allow you to fully \" +\n \"control the traffic on a network.\",\n hacking_mult: 1.08,\n });\n ENM.addToFactions([\n \"BitRunners\",\n \"The Black Hand\",\n \"NiteSec\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.ENM)) {\n delete Augmentations[AugmentationNames.ENM];\n }\n AddToAugmentations(ENM);\n\n const ENMCore = new Augmentation({\n name: AugmentationNames.ENMCore,\n repCost: 2.5e5,\n moneyCost: 2.5e9,\n info:\n \"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgrade allows the Embedded Netburner Module to generate its own data on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.1,\n hacking_chance_mult: 1.03,\n hacking_exp_mult: 1.07,\n hacking_mult: 1.07,\n });\n ENMCore.addToFactions([\n \"BitRunners\",\n \"The Black Hand\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCore)) {\n delete Augmentations[AugmentationNames.ENMCore];\n }\n AddToAugmentations(ENMCore);\n\n const ENMCoreV2 = new Augmentation({\n name: AugmentationNames.ENMCoreV2,\n repCost: 1e6,\n moneyCost: 4.5e9,\n info:\n \"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to control information on \" +\n \"a network by re-routing traffic, spoofing IP addresses, and altering the data inside network \" +\n \"packets.\",\n prereqs: [AugmentationNames.ENMCore],\n hacking_speed_mult: 1.05,\n hacking_money_mult: 1.3,\n hacking_chance_mult: 1.05,\n hacking_exp_mult: 1.15,\n hacking_mult: 1.08,\n });\n ENMCoreV2.addToFactions([\n \"BitRunners\",\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Blade Industries\",\n \"OmniTek Incorporated\",\n \"KuaiGong International\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCoreV2)) {\n delete Augmentations[AugmentationNames.ENMCoreV2];\n }\n AddToAugmentations(ENMCoreV2);\n\n const ENMCoreV3 = new Augmentation({\n name: AugmentationNames.ENMCoreV3,\n repCost: 1.75e6,\n moneyCost: 7.5e9,\n info:\n \"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into \" +\n \"any device on a network.\",\n prereqs: [AugmentationNames.ENMCoreV2],\n hacking_speed_mult: 1.05,\n hacking_money_mult: 1.4,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 1.25,\n hacking_mult: 1.1,\n });\n ENMCoreV3.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMCoreV3)) {\n delete Augmentations[AugmentationNames.ENMCoreV3];\n }\n AddToAugmentations(ENMCoreV3);\n\n const ENMAnalyzeEngine = new Augmentation({\n name: AugmentationNames.ENMAnalyzeEngine,\n repCost: 6.25e5,\n moneyCost: 6e9,\n info:\n \"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster \" +\n \"that vastly outperforms the Netburner Module's native single-core processor.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed_mult: 1.1,\n });\n ENMAnalyzeEngine.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMAnalyzeEngine)) {\n delete Augmentations[AugmentationNames.ENMAnalyzeEngine];\n }\n AddToAugmentations(ENMAnalyzeEngine);\n\n const ENMDMA = new Augmentation({\n name: AugmentationNames.ENMDMA,\n repCost: 1e6,\n moneyCost: 7e9,\n info:\n \"This implant installs a Direct Memory Access (DMA) controller into the \" +\n \"Embedded Netburner Module. This allows the Module to send and receive data \" +\n \"directly to and from the main memory of devices on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_money_mult: 1.4,\n hacking_chance_mult: 1.2,\n });\n ENMDMA.addToFactions([\n \"ECorp\",\n \"MegaCorp\",\n \"Fulcrum Secret Technologies\",\n \"NWO\",\n \"Daedalus\",\n \"The Covenant\",\n \"Illuminati\",\n ]);\n if (augmentationExists(AugmentationNames.ENMDMA)) {\n delete Augmentations[AugmentationNames.ENMDMA];\n }\n AddToAugmentations(ENMDMA);\n\n const Neuralstimulator = new Augmentation({\n name: AugmentationNames.Neuralstimulator,\n repCost: 5e4,\n moneyCost: 3e9,\n info:\n \"A cranial implant that intelligently stimulates certain areas of the brain \" +\n \"in order to improve cognitive functions.\",\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.1,\n hacking_exp_mult: 1.12,\n });\n Neuralstimulator.addToFactions([\n \"The Black Hand\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Bachman & Associates\",\n \"Clarke Incorporated\",\n \"Four Sigma\",\n ]);\n if (augmentationExists(AugmentationNames.Neuralstimulator)) {\n delete Augmentations[AugmentationNames.Neuralstimulator];\n }\n AddToAugmentations(Neuralstimulator);\n\n const NeuralAccelerator = new Augmentation({\n name: AugmentationNames.NeuralAccelerator,\n repCost: 2e5,\n moneyCost: 1.75e9,\n info:\n \"A microprocessor that accelerates the processing \" +\n \"speed of biological neural networks. This is a cranial implant that is embedded inside the brain.\",\n hacking_mult: 1.1,\n hacking_exp_mult: 1.15,\n hacking_money_mult: 1.2,\n });\n NeuralAccelerator.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.NeuralAccelerator)) {\n delete Augmentations[AugmentationNames.NeuralAccelerator];\n }\n AddToAugmentations(NeuralAccelerator);\n\n const CranialSignalProcessorsG1 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG1,\n repCost: 1e4,\n moneyCost: 7e7,\n info:\n \"The first generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n hacking_speed_mult: 1.01,\n hacking_mult: 1.05,\n });\n CranialSignalProcessorsG1.addToFactions([\"CyberSec\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG1)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG1];\n }\n AddToAugmentations(CranialSignalProcessorsG1);\n\n const CranialSignalProcessorsG2 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG2,\n repCost: 1.875e4,\n moneyCost: 1.25e8,\n info:\n \"The second generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed_mult: 1.02,\n hacking_chance_mult: 1.05,\n hacking_mult: 1.07,\n });\n CranialSignalProcessorsG2.addToFactions([\"CyberSec\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG2)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG2];\n }\n AddToAugmentations(CranialSignalProcessorsG2);\n\n const CranialSignalProcessorsG3 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG3,\n repCost: 5e4,\n moneyCost: 5.5e8,\n info:\n \"The third generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG2],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.15,\n hacking_mult: 1.09,\n });\n CranialSignalProcessorsG3.addToFactions([\"NiteSec\", \"The Black Hand\", \"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG3)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG3];\n }\n AddToAugmentations(CranialSignalProcessorsG3);\n\n const CranialSignalProcessorsG4 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG4,\n repCost: 1.25e5,\n moneyCost: 1.1e9,\n info:\n \"The fourth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG3],\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.2,\n hacking_grow_mult: 1.25,\n });\n CranialSignalProcessorsG4.addToFactions([\"The Black Hand\", \"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG4)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG4];\n }\n AddToAugmentations(CranialSignalProcessorsG4);\n\n const CranialSignalProcessorsG5 = new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG5,\n repCost: 2.5e5,\n moneyCost: 2.25e9,\n info:\n \"The fifth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG4],\n hacking_mult: 1.3,\n hacking_money_mult: 1.25,\n hacking_grow_mult: 1.75,\n });\n CranialSignalProcessorsG5.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.CranialSignalProcessorsG5)) {\n delete Augmentations[AugmentationNames.CranialSignalProcessorsG5];\n }\n AddToAugmentations(CranialSignalProcessorsG5);\n\n const NeuronalDensification = new Augmentation({\n name: AugmentationNames.NeuronalDensification,\n repCost: 1.875e5,\n moneyCost: 1.375e9,\n info:\n \"The brain is surgically re-engineered to have increased neuronal density \" +\n \"by decreasing the neuron gap junction. Then, the body is genetically modified \" +\n \"to enhance the production and capabilities of its neural stem cells.\",\n hacking_mult: 1.15,\n hacking_exp_mult: 1.1,\n hacking_speed_mult: 1.03,\n });\n NeuronalDensification.addToFactions([\"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.NeuronalDensification)) {\n delete Augmentations[AugmentationNames.NeuronalDensification];\n }\n AddToAugmentations(NeuronalDensification);\n\n // Work Augmentations\n const NuoptimalInjectorImplant = new Augmentation({\n name: AugmentationNames.NuoptimalInjectorImplant,\n repCost: 5e3,\n moneyCost: 2e7,\n info:\n \"This torso implant automatically injects nootropic supplements into \" +\n \"the bloodstream to improve memory, increase focus, and provide other \" +\n \"cognitive enhancements.\",\n company_rep_mult: 1.2,\n });\n NuoptimalInjectorImplant.addToFactions([\n \"Tian Di Hui\",\n \"Volhaven\",\n \"New Tokyo\",\n \"Chongqing\",\n \"Clarke Incorporated\",\n \"Four Sigma\",\n \"Bachman & Associates\",\n ]);\n if (augmentationExists(AugmentationNames.NuoptimalInjectorImplant)) {\n delete Augmentations[AugmentationNames.NuoptimalInjectorImplant];\n }\n AddToAugmentations(NuoptimalInjectorImplant);\n\n const SpeechEnhancement = new Augmentation({\n name: AugmentationNames.SpeechEnhancement,\n repCost: 2.5e3,\n moneyCost: 1.25e7,\n info:\n \"An advanced neural implant that improves your speaking abilities, making \" +\n \"you more convincing and likable in conversations and overall improving your \" +\n \"social interactions.\",\n company_rep_mult: 1.1,\n charisma_mult: 1.1,\n });\n SpeechEnhancement.addToFactions([\n \"Tian Di Hui\",\n \"Speakers for the Dead\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Clarke Incorporated\",\n \"Bachman & Associates\",\n ]);\n if (augmentationExists(AugmentationNames.SpeechEnhancement)) {\n delete Augmentations[AugmentationNames.SpeechEnhancement];\n }\n AddToAugmentations(SpeechEnhancement);\n\n const FocusWire = new Augmentation({\n name: AugmentationNames.FocusWire,\n repCost: 7.5e4,\n moneyCost: 9e8,\n info: \"A cranial implant that stops procrastination by blocking specific neural pathways \" + \"in the brain.\",\n hacking_exp_mult: 1.05,\n strength_exp_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n charisma_exp_mult: 1.05,\n company_rep_mult: 1.1,\n work_money_mult: 1.2,\n });\n FocusWire.addToFactions([\"Bachman & Associates\", \"Clarke Incorporated\", \"Four Sigma\", \"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.FocusWire)) {\n delete Augmentations[AugmentationNames.FocusWire];\n }\n AddToAugmentations(FocusWire);\n\n const PCDNI = new Augmentation({\n name: AugmentationNames.PCDNI,\n repCost: 3.75e5,\n moneyCost: 3.75e9,\n info:\n \"Installs a Direct-Neural Interface jack into your arm that is compatible with most \" +\n \"computers. Connecting to a computer through this jack allows you to interface with \" +\n \"it using the brain's electrochemical signals.\",\n company_rep_mult: 1.3,\n hacking_mult: 1.08,\n });\n PCDNI.addToFactions([\"Four Sigma\", \"OmniTek Incorporated\", \"ECorp\", \"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.PCDNI)) {\n delete Augmentations[AugmentationNames.PCDNI];\n }\n AddToAugmentations(PCDNI);\n\n const PCDNIOptimizer = new Augmentation({\n name: AugmentationNames.PCDNIOptimizer,\n repCost: 5e5,\n moneyCost: 4.5e9,\n info:\n \"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It \" +\n \"improves the performance of the interface and gives the user more control options \" +\n \"to a connected computer.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep_mult: 1.75,\n hacking_mult: 1.1,\n });\n PCDNIOptimizer.addToFactions([\"Fulcrum Secret Technologies\", \"ECorp\", \"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.PCDNIOptimizer)) {\n delete Augmentations[AugmentationNames.PCDNIOptimizer];\n }\n AddToAugmentations(PCDNIOptimizer);\n\n const PCDNINeuralNetwork = new Augmentation({\n name: AugmentationNames.PCDNINeuralNetwork,\n repCost: 1.5e6,\n moneyCost: 7.5e9,\n info:\n \"This is an additional installation that upgrades the functionality of the \" +\n \"PC Direct-Neural Interface augmentation. When connected to a computer, \" +\n \"The Neural Network upgrade allows the user to use their own brain's \" +\n \"processing power to aid the computer in computational tasks.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep_mult: 2,\n hacking_mult: 1.1,\n hacking_speed_mult: 1.05,\n });\n PCDNINeuralNetwork.addToFactions([\"Fulcrum Secret Technologies\"]);\n if (augmentationExists(AugmentationNames.PCDNINeuralNetwork)) {\n delete Augmentations[AugmentationNames.PCDNINeuralNetwork];\n }\n AddToAugmentations(PCDNINeuralNetwork);\n\n const ADRPheromone1 = new Augmentation({\n name: AugmentationNames.ADRPheromone1,\n repCost: 3.75e3,\n moneyCost: 1.75e7,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, \" +\n \"an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, \" +\n \"triggers feelings of admiration and approval in other people.\",\n company_rep_mult: 1.1,\n faction_rep_mult: 1.1,\n });\n ADRPheromone1.addToFactions([\"Tian Di Hui\", \"The Syndicate\", \"NWO\", \"MegaCorp\", \"Four Sigma\"]);\n if (augmentationExists(AugmentationNames.ADRPheromone1)) {\n delete Augmentations[AugmentationNames.ADRPheromone1];\n }\n AddToAugmentations(ADRPheromone1);\n\n const ADRPheromone2 = new Augmentation({\n name: AugmentationNames.ADRPheromone2,\n repCost: 6.25e4,\n moneyCost: 5.5e8,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, \" +\n \"which is similar to but more potent than ADR-V1. This pheromone, when excreted, \" +\n \"triggers feelings of admiration, approval, and respect in others.\",\n company_rep_mult: 1.2,\n faction_rep_mult: 1.2,\n });\n ADRPheromone2.addToFactions([\"Silhouette\", \"Four Sigma\", \"Bachman & Associates\", \"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.ADRPheromone2)) {\n delete Augmentations[AugmentationNames.ADRPheromone2];\n }\n AddToAugmentations(ADRPheromone2);\n\n const ShadowsSimulacrum = new Augmentation({\n name: AugmentationNames.ShadowsSimulacrum,\n repCost: 3.75e4,\n moneyCost: 4e8,\n info:\n \"A crude but functional matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation was developed by \" +\n \"criminal organizations and allows the user to project and control holographic \" +\n \"simulacrums within a large radius. These simulacrums are commonly used for \" +\n \"espionage and surveillance work.\",\n company_rep_mult: 1.15,\n faction_rep_mult: 1.15,\n });\n ShadowsSimulacrum.addToFactions([\"The Syndicate\", \"The Dark Army\", \"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.ShadowsSimulacrum)) {\n delete Augmentations[AugmentationNames.ShadowsSimulacrum];\n }\n AddToAugmentations(ShadowsSimulacrum);\n\n // HacknetNode Augmentations\n const HacknetNodeCPUUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeCPUUpload,\n repCost: 3.75e3,\n moneyCost: 1.1e7,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's CPU into \" +\n \"the brain. This allows the user to engineer custom hardware and software \" +\n \"for the Hacknet Node that provides better performance.\",\n hacknet_node_money_mult: 1.15,\n hacknet_node_purchase_cost_mult: 0.85,\n });\n HacknetNodeCPUUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCPUUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeCPUUpload];\n }\n AddToAugmentations(HacknetNodeCPUUpload);\n\n const HacknetNodeCacheUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeCacheUpload,\n repCost: 2.5e3,\n moneyCost: 5.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's main-memory cache \" +\n \"into the brain. This allows the user to engineer custom cache hardware for the \" +\n \"Hacknet Node that offers better performance.\",\n hacknet_node_money_mult: 1.1,\n hacknet_node_level_cost_mult: 0.85,\n });\n HacknetNodeCacheUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCacheUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeCacheUpload];\n }\n AddToAugmentations(HacknetNodeCacheUpload);\n\n const HacknetNodeNICUpload = new Augmentation({\n name: AugmentationNames.HacknetNodeNICUpload,\n repCost: 1.875e3,\n moneyCost: 4.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) \" +\n \"into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that \" +\n \"offers better performance.\",\n hacknet_node_money_mult: 1.1,\n hacknet_node_purchase_cost_mult: 0.9,\n });\n HacknetNodeNICUpload.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeNICUpload)) {\n delete Augmentations[AugmentationNames.HacknetNodeNICUpload];\n }\n AddToAugmentations(HacknetNodeNICUpload);\n\n const HacknetNodeKernelDNI = new Augmentation({\n name: AugmentationNames.HacknetNodeKernelDNI,\n repCost: 7.5e3,\n moneyCost: 4e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a \" +\n \"Hacknet Node. This lets the user access and manipulate the Node's kernel using \" +\n \"electrochemical signals.\",\n hacknet_node_money_mult: 1.25,\n });\n HacknetNodeKernelDNI.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeKernelDNI)) {\n delete Augmentations[AugmentationNames.HacknetNodeKernelDNI];\n }\n AddToAugmentations(HacknetNodeKernelDNI);\n\n const HacknetNodeCoreDNI = new Augmentation({\n name: AugmentationNames.HacknetNodeCoreDNI,\n repCost: 1.25e4,\n moneyCost: 6e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting \" +\n \"to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using \" +\n \"electrochemical signals.\",\n hacknet_node_money_mult: 1.45,\n });\n HacknetNodeCoreDNI.addToFactions([\"Netburners\"]);\n if (augmentationExists(AugmentationNames.HacknetNodeCoreDNI)) {\n delete Augmentations[AugmentationNames.HacknetNodeCoreDNI];\n }\n AddToAugmentations(HacknetNodeCoreDNI);\n\n //Misc/Hybrid augmentations\n const NeuroFluxGovernor = new Augmentation({\n name: AugmentationNames.NeuroFluxGovernor,\n repCost: 1.25e3,\n moneyCost: 3.75e6,\n info:\n \"A device that is embedded in the back of the neck. The NeuroFlux Governor \" +\n \"monitors and regulates nervous impulses coming to and from the spinal column, \" +\n \"essentially 'governing' the body. By doing so, it improves the functionality of the \" +\n \"body's nervous system.\",\n stats: (\n <>\n This special augmentation can be leveled up infinitely. Each level of this augmentation increases ALL\n multipliers by 1%, stacking multiplicatively.\n </>\n ),\n hacking_chance_mult: 1.01,\n hacking_speed_mult: 1.01,\n hacking_money_mult: 1.01,\n hacking_grow_mult: 1.01,\n hacking_mult: 1.01,\n strength_mult: 1.01,\n defense_mult: 1.01,\n dexterity_mult: 1.01,\n agility_mult: 1.01,\n charisma_mult: 1.01,\n hacking_exp_mult: 1.01,\n strength_exp_mult: 1.01,\n defense_exp_mult: 1.01,\n dexterity_exp_mult: 1.01,\n agility_exp_mult: 1.01,\n charisma_exp_mult: 1.01,\n company_rep_mult: 1.01,\n faction_rep_mult: 1.01,\n crime_money_mult: 1.01,\n crime_success_mult: 1.01,\n hacknet_node_money_mult: 1.01,\n hacknet_node_purchase_cost_mult: 0.99,\n hacknet_node_ram_cost_mult: 0.99,\n hacknet_node_core_cost_mult: 0.99,\n hacknet_node_level_cost_mult: 0.99,\n work_money_mult: 1.01,\n });\n\n // Set the Augmentation's level to the currently-installed level\n let currLevel = 0;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = Player.augmentations[i].level;\n }\n }\n NeuroFluxGovernor.level = currLevel;\n\n // To set the price/rep req of the NeuroFlux, we have to take into account NeuroFlux\n // levels that are purchased but not yet installed\n let nextLevel = currLevel;\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n ++nextLevel;\n }\n }\n let mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n NeuroFluxGovernor.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;\n NeuroFluxGovernor.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;\n if (augmentationExists(AugmentationNames.NeuroFluxGovernor)) {\n delete Augmentations[AugmentationNames.NeuroFluxGovernor];\n }\n NeuroFluxGovernor.addToAllFactions();\n AddToAugmentations(NeuroFluxGovernor);\n\n const Neurotrainer1 = new Augmentation({\n name: AugmentationNames.Neurotrainer1,\n repCost: 1e3,\n moneyCost: 4e6,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. It is \" +\n \"installed by releasing millions of nanobots into the human brain, each of which \" +\n \"attaches to a different neural pathway to enhance the brain's ability to retain \" +\n \"and retrieve information.\",\n hacking_exp_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 1.1,\n });\n Neurotrainer1.addToFactions([\"CyberSec\", \"Aevum\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer1)) {\n delete Augmentations[AugmentationNames.Neurotrainer1];\n }\n AddToAugmentations(Neurotrainer1);\n\n const Neurotrainer2 = new Augmentation({\n name: AugmentationNames.Neurotrainer2,\n repCost: 1e4,\n moneyCost: 4.5e7,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I augmentation, but it does not \" +\n \"require Neurotrainer I to be installed as a prerequisite.\",\n hacking_exp_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n Neurotrainer2.addToFactions([\"BitRunners\", \"NiteSec\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer2)) {\n delete Augmentations[AugmentationNames.Neurotrainer2];\n }\n AddToAugmentations(Neurotrainer2);\n\n const Neurotrainer3 = new Augmentation({\n name: AugmentationNames.Neurotrainer3,\n repCost: 2.5e4,\n moneyCost: 1.3e8,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, \" +\n \"but it does not require either of them to be installed as a prerequisite.\",\n hacking_exp_mult: 1.2,\n strength_exp_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 1.2,\n charisma_exp_mult: 1.2,\n });\n Neurotrainer3.addToFactions([\"NWO\", \"Four Sigma\"]);\n if (augmentationExists(AugmentationNames.Neurotrainer3)) {\n delete Augmentations[AugmentationNames.Neurotrainer3];\n }\n AddToAugmentations(Neurotrainer3);\n\n const Hypersight = new Augmentation({\n name: AugmentationNames.Hypersight,\n repCost: 1.5e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic eye implant that grants sight capabilities far beyond those of a natural human. \" +\n \"Embedded circuitry within the implant provides the ability to detect heat and movement \" +\n \"through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.\",\n dexterity_mult: 1.4,\n hacking_speed_mult: 1.03,\n hacking_money_mult: 1.1,\n });\n Hypersight.addToFactions([\"Blade Industries\", \"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.Hypersight)) {\n delete Augmentations[AugmentationNames.Hypersight];\n }\n AddToAugmentations(Hypersight);\n\n const LuminCloaking1 = new Augmentation({\n name: AugmentationNames.LuminCloaking1,\n repCost: 1.5e3,\n moneyCost: 5e6,\n info:\n \"A skin implant that reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, have a negative refractive index. As a result, they bend light \" +\n \"around the skin, making the user much harder to see to the naked eye.\",\n agility_mult: 1.05,\n crime_money_mult: 1.1,\n });\n LuminCloaking1.addToFactions([\"Slum Snakes\", \"Tetrads\"]);\n if (augmentationExists(AugmentationNames.LuminCloaking1)) {\n delete Augmentations[AugmentationNames.LuminCloaking1];\n }\n AddToAugmentations(LuminCloaking1);\n\n const LuminCloaking2 = new Augmentation({\n name: AugmentationNames.LuminCloaking2,\n repCost: 5e3,\n moneyCost: 3e7,\n info:\n \"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant \" +\n \"reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, are capable of not only bending light but also of bending heat, \" +\n \"making the user more resilient as well as stealthy.\",\n prereqs: [AugmentationNames.LuminCloaking1],\n agility_mult: 1.1,\n defense_mult: 1.1,\n crime_money_mult: 1.25,\n });\n LuminCloaking2.addToFactions([\"Slum Snakes\", \"Tetrads\"]);\n if (augmentationExists(AugmentationNames.LuminCloaking2)) {\n delete Augmentations[AugmentationNames.LuminCloaking2];\n }\n AddToAugmentations(LuminCloaking2);\n\n const SmartSonar = new Augmentation({\n name: AugmentationNames.SmartSonar,\n repCost: 2.25e4,\n moneyCost: 7.5e7,\n info: \"A cochlear implant that helps the player detect and locate enemies \" + \"using sound propagation.\",\n dexterity_mult: 1.1,\n dexterity_exp_mult: 1.15,\n crime_money_mult: 1.25,\n });\n SmartSonar.addToFactions([\"Slum Snakes\"]);\n if (augmentationExists(AugmentationNames.SmartSonar)) {\n delete Augmentations[AugmentationNames.SmartSonar];\n }\n AddToAugmentations(SmartSonar);\n\n const PowerRecirculator = new Augmentation({\n name: AugmentationNames.PowerRecirculator,\n repCost: 2.5e4,\n moneyCost: 1.8e8,\n info:\n \"The body's nerves are attached with polypyrrole nanocircuits that \" +\n \"are capable of capturing wasted energy, in the form of heat, \" +\n \"and converting it back into usable power.\",\n hacking_mult: 1.05,\n strength_mult: 1.05,\n defense_mult: 1.05,\n dexterity_mult: 1.05,\n agility_mult: 1.05,\n charisma_mult: 1.05,\n hacking_exp_mult: 1.1,\n strength_exp_mult: 1.1,\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n agility_exp_mult: 1.1,\n charisma_exp_mult: 1.1,\n });\n PowerRecirculator.addToFactions([\"Tetrads\", \"The Dark Army\", \"The Syndicate\", \"NWO\"]);\n if (augmentationExists(AugmentationNames.PowerRecirculator)) {\n delete Augmentations[AugmentationNames.PowerRecirculator];\n }\n AddToAugmentations(PowerRecirculator);\n\n // Unique AUGS (Each Faction gets one unique augmentation)\n // Factions that already have unique augs up to this point:\n // Slum Snakes, CyberSec, Netburners, Fulcrum Secret Technologies,\n // Silhouette\n\n // Illuminati\n const QLink = new Augmentation({\n name: AugmentationNames.QLink,\n repCost: 1.875e6,\n moneyCost: 2.5e13,\n info:\n \"A brain implant that wirelessly connects you to the Illuminati's \" +\n \"quantum supercomputer, allowing you to access and use its incredible \" +\n \"computing power.\",\n hacking_mult: 1.75,\n hacking_speed_mult: 2,\n hacking_chance_mult: 2.5,\n hacking_money_mult: 4,\n });\n QLink.addToFactions([\"Illuminati\"]);\n if (augmentationExists(AugmentationNames.QLink)) {\n delete Augmentations[AugmentationNames.QLink];\n }\n AddToAugmentations(QLink);\n\n // Daedalus\n const RedPill = new Augmentation({\n name: AugmentationNames.TheRedPill,\n repCost: 2.5e6,\n moneyCost: 0,\n info: \"It's time to leave the cave.\",\n stats: null,\n });\n RedPill.addToFactions([\"Daedalus\"]);\n if (augmentationExists(AugmentationNames.TheRedPill)) {\n delete Augmentations[AugmentationNames.TheRedPill];\n }\n AddToAugmentations(RedPill);\n\n // Covenant\n const SPTN97 = new Augmentation({\n name: AugmentationNames.SPTN97,\n repCost: 1.25e6,\n moneyCost: 4.875e9,\n info:\n \"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an \" +\n \"artificially-synthesized gene that was developed by DARPA to create \" +\n \"super-soldiers through genetic modification. The gene was outlawed in \" +\n \"2056.\",\n strength_mult: 1.75,\n defense_mult: 1.75,\n dexterity_mult: 1.75,\n agility_mult: 1.75,\n hacking_mult: 1.15,\n });\n SPTN97.addToFactions([\"The Covenant\"]);\n if (augmentationExists(AugmentationNames.SPTN97)) {\n delete Augmentations[AugmentationNames.SPTN97];\n }\n AddToAugmentations(SPTN97);\n\n // ECorp\n const HiveMind = new Augmentation({\n name: AugmentationNames.HiveMind,\n repCost: 1.5e6,\n moneyCost: 5.5e9,\n info:\n \"A brain implant developed by ECorp. They do not reveal what \" +\n \"exactly the implant does, but they promise that it will greatly \" +\n \"enhance your abilities.\",\n hacking_grow_mult: 3,\n stats: null,\n });\n HiveMind.addToFactions([\"ECorp\"]);\n if (augmentationExists(AugmentationNames.HiveMind)) {\n delete Augmentations[AugmentationNames.HiveMind];\n }\n AddToAugmentations(HiveMind);\n\n // MegaCorp\n const CordiARCReactor = new Augmentation({\n name: AugmentationNames.CordiARCReactor,\n repCost: 1.125e6,\n moneyCost: 5e9,\n info:\n \"The thoracic cavity is equipped with a small chamber designed \" +\n \"to hold and sustain hydrogen plasma. The plasma is used to generate \" +\n \"fusion power through nuclear fusion, providing limitless amounts of clean \" +\n \"energy for the body.\",\n strength_mult: 1.35,\n defense_mult: 1.35,\n dexterity_mult: 1.35,\n agility_mult: 1.35,\n strength_exp_mult: 1.35,\n defense_exp_mult: 1.35,\n dexterity_exp_mult: 1.35,\n agility_exp_mult: 1.35,\n });\n CordiARCReactor.addToFactions([\"MegaCorp\"]);\n if (augmentationExists(AugmentationNames.CordiARCReactor)) {\n delete Augmentations[AugmentationNames.CordiARCReactor];\n }\n AddToAugmentations(CordiARCReactor);\n\n // BachmanAndAssociates\n const SmartJaw = new Augmentation({\n name: AugmentationNames.SmartJaw,\n repCost: 3.75e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic jaw that contains advanced hardware and software \" +\n \"capable of psychoanalyzing and profiling the personality of \" +\n \"others using optical imaging software.\",\n charisma_mult: 1.5,\n charisma_exp_mult: 1.5,\n company_rep_mult: 1.25,\n faction_rep_mult: 1.25,\n });\n SmartJaw.addToFactions([\"Bachman & Associates\"]);\n if (augmentationExists(AugmentationNames.SmartJaw)) {\n delete Augmentations[AugmentationNames.SmartJaw];\n }\n AddToAugmentations(SmartJaw);\n\n // BladeIndustries\n const Neotra = new Augmentation({\n name: AugmentationNames.Neotra,\n repCost: 5.625e5,\n moneyCost: 2.875e9,\n info:\n \"A highly-advanced techno-organic drug that is injected into the skeletal \" +\n \"and integumentary system. The drug permanently modifies the DNA of the \" +\n \"body's skin and bone cells, granting them the ability to repair \" +\n \"and restructure themselves.\",\n strength_mult: 1.55,\n defense_mult: 1.55,\n });\n Neotra.addToFactions([\"Blade Industries\"]);\n if (augmentationExists(AugmentationNames.Neotra)) {\n delete Augmentations[AugmentationNames.Neotra];\n }\n AddToAugmentations(Neotra);\n\n // NWO\n const Xanipher = new Augmentation({\n name: AugmentationNames.Xanipher,\n repCost: 8.75e5,\n moneyCost: 4.25e9,\n info:\n \"A concoction of advanced nanobots that is orally ingested into the \" +\n \"body. These nanobots induce physiological changes and significantly \" +\n \"improve the body's functioning in all aspects.\",\n hacking_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 1.2,\n hacking_exp_mult: 1.15,\n strength_exp_mult: 1.15,\n defense_exp_mult: 1.15,\n dexterity_exp_mult: 1.15,\n agility_exp_mult: 1.15,\n charisma_exp_mult: 1.15,\n });\n Xanipher.addToFactions([\"NWO\"]);\n if (augmentationExists(AugmentationNames.Xanipher)) {\n delete Augmentations[AugmentationNames.Xanipher];\n }\n AddToAugmentations(Xanipher);\n\n const HydroflameLeftArm = new Augmentation({\n name: AugmentationNames.HydroflameLeftArm,\n repCost: 1.25e6,\n moneyCost: 2.5e12,\n info:\n \"The left arm of a legendary BitRunner who ascended beyond this world. \" +\n \"It projects a light blue energy shield that protects the exposed inner parts. \" +\n \"Even though it contains no weapons, the advanced tungsten titanium \" +\n \"alloy increases the users strength to unbelievable levels. The augmentation \" +\n \"gets more powerful over time for seemingly no reason.\",\n strength_mult: 2.7,\n });\n HydroflameLeftArm.addToFactions([\"NWO\"]);\n if (augmentationExists(AugmentationNames.HydroflameLeftArm)) {\n delete Augmentations[AugmentationNames.HydroflameLeftArm];\n }\n AddToAugmentations(HydroflameLeftArm);\n\n // ClarkeIncorporated\n const nextSENS = new Augmentation({\n name: AugmentationNames.nextSENS,\n repCost: 4.375e5,\n moneyCost: 1.925e9,\n info:\n \"The body is genetically re-engineered to maintain a state \" +\n \"of negligible senescence, preventing the body from \" +\n \"deteriorating with age.\",\n hacking_mult: 1.2,\n strength_mult: 1.2,\n defense_mult: 1.2,\n dexterity_mult: 1.2,\n agility_mult: 1.2,\n charisma_mult: 1.2,\n });\n nextSENS.addToFactions([\"Clarke Incorporated\"]);\n if (augmentationExists(AugmentationNames.nextSENS)) {\n delete Augmentations[AugmentationNames.nextSENS];\n }\n AddToAugmentations(nextSENS);\n\n // OmniTekIncorporated\n const OmniTekInfoLoad = new Augmentation({\n name: AugmentationNames.OmniTekInfoLoad,\n repCost: 6.25e5,\n moneyCost: 2.875e9,\n info:\n \"OmniTek's data and information repository is uploaded \" +\n \"into your brain, enhancing your programming and \" +\n \"hacking abilities.\",\n hacking_mult: 1.2,\n hacking_exp_mult: 1.25,\n });\n OmniTekInfoLoad.addToFactions([\"OmniTek Incorporated\"]);\n if (augmentationExists(AugmentationNames.OmniTekInfoLoad)) {\n delete Augmentations[AugmentationNames.OmniTekInfoLoad];\n }\n AddToAugmentations(OmniTekInfoLoad);\n\n // FourSigma\n // TODO Later when Intelligence is added in . Some aug that greatly increases int\n\n // KuaiGongInternational\n const PhotosyntheticCells = new Augmentation({\n name: AugmentationNames.PhotosyntheticCells,\n repCost: 5.625e5,\n moneyCost: 2.75e9,\n info:\n \"Chloroplasts are added to epidermal stem cells and are applied \" +\n \"to the body using a skin graft. The result is photosynthetic \" +\n \"skin cells, allowing users to generate their own energy \" +\n \"and nutrition using solar power.\",\n strength_mult: 1.4,\n defense_mult: 1.4,\n agility_mult: 1.4,\n });\n PhotosyntheticCells.addToFactions([\"KuaiGong International\"]);\n if (augmentationExists(AugmentationNames.PhotosyntheticCells)) {\n delete Augmentations[AugmentationNames.PhotosyntheticCells];\n }\n AddToAugmentations(PhotosyntheticCells);\n\n // BitRunners\n const Neurolink = new Augmentation({\n name: AugmentationNames.Neurolink,\n repCost: 8.75e5,\n moneyCost: 4.375e9,\n info:\n \"A brain implant that provides a high-bandwidth, direct neural link between your \" +\n \"mind and the BitRunners' data servers, which reportedly contain \" +\n \"the largest database of hacking tools and information in the world.\",\n hacking_mult: 1.15,\n hacking_exp_mult: 1.2,\n hacking_chance_mult: 1.1,\n hacking_speed_mult: 1.05,\n programs: [Programs.FTPCrackProgram.name, Programs.RelaySMTPProgram.name],\n });\n Neurolink.addToFactions([\"BitRunners\"]);\n if (augmentationExists(AugmentationNames.Neurolink)) {\n delete Augmentations[AugmentationNames.Neurolink];\n }\n AddToAugmentations(Neurolink);\n\n // BlackHand\n const TheBlackHand = new Augmentation({\n name: AugmentationNames.TheBlackHand,\n repCost: 1e5,\n moneyCost: 5.5e8,\n info:\n \"A highly advanced bionic hand. This prosthetic not only \" +\n \"enhances strength and dexterity but it is also embedded \" +\n \"with hardware and firmware that lets the user connect to, access, and hack \" +\n \"devices and machines by just touching them.\",\n strength_mult: 1.15,\n dexterity_mult: 1.15,\n hacking_mult: 1.1,\n hacking_speed_mult: 1.02,\n hacking_money_mult: 1.1,\n });\n TheBlackHand.addToFactions([\"The Black Hand\"]);\n if (augmentationExists(AugmentationNames.TheBlackHand)) {\n delete Augmentations[AugmentationNames.TheBlackHand];\n }\n AddToAugmentations(TheBlackHand);\n\n // NiteSec\n const CRTX42AA = new Augmentation({\n name: AugmentationNames.CRTX42AA,\n repCost: 4.5e4,\n moneyCost: 2.25e8,\n info:\n \"The CRTX42-AA gene is injected into the genome. \" +\n \"The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal \" +\n \"cortex and improves cognitive abilities.\",\n hacking_mult: 1.08,\n hacking_exp_mult: 1.15,\n });\n CRTX42AA.addToFactions([\"NiteSec\"]);\n if (augmentationExists(AugmentationNames.CRTX42AA)) {\n delete Augmentations[AugmentationNames.CRTX42AA];\n }\n AddToAugmentations(CRTX42AA);\n\n // Chongqing\n const Neuregen = new Augmentation({\n name: AugmentationNames.Neuregen,\n repCost: 3.75e4,\n moneyCost: 3.75e8,\n info:\n \"A drug that genetically modifies the neurons in the brain \" +\n \"resulting in neurons never die, continuously \" +\n \"regenerate, and strengthen themselves.\",\n hacking_exp_mult: 1.4,\n });\n Neuregen.addToFactions([\"Chongqing\"]);\n if (augmentationExists(AugmentationNames.Neuregen)) {\n delete Augmentations[AugmentationNames.Neuregen];\n }\n AddToAugmentations(Neuregen);\n\n // Sector12\n const CashRoot = new Augmentation({\n name: AugmentationNames.CashRoot,\n repCost: 1.25e4,\n moneyCost: 1.25e8,\n info: (\n <>\n A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the\n chip allows you to connect it to a computer and upload the assets.\n </>\n ),\n startingMoney: 1e6,\n programs: [Programs.BruteSSHProgram.name],\n });\n CashRoot.addToFactions([\"Sector-12\"]);\n if (augmentationExists(AugmentationNames.CashRoot)) {\n delete Augmentations[AugmentationNames.CashRoot];\n }\n AddToAugmentations(CashRoot);\n\n // NewTokyo\n const NutriGen = new Augmentation({\n name: AugmentationNames.NutriGen,\n repCost: 6.25e3,\n moneyCost: 2.5e6,\n info:\n \"A thermo-powered artificial nutrition generator. Endogenously \" +\n \"synthesizes glucose, amino acids, and vitamins and redistributes them \" +\n \"across the body. The device is powered by the body's naturally wasted \" +\n \"energy in the form of heat.\",\n strength_exp_mult: 1.2,\n defense_exp_mult: 1.2,\n dexterity_exp_mult: 1.2,\n agility_exp_mult: 1.2,\n });\n NutriGen.addToFactions([\"New Tokyo\"]);\n if (augmentationExists(AugmentationNames.NutriGen)) {\n delete Augmentations[AugmentationNames.NutriGen];\n }\n AddToAugmentations(NutriGen);\n\n // Aevum\n const PCMatrix = new Augmentation({\n name: AugmentationNames.PCMatrix,\n repCost: 100e3,\n moneyCost: 2e9,\n info:\n \"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant \" +\n \"uses advanced mathematical algorithims to rapidly identify and compute statistical \" +\n \"outcomes of nearly every situation.\",\n charisma_mult: 1.0777,\n charisma_exp_mult: 1.0777,\n work_money_mult: 1.777,\n faction_rep_mult: 1.0777,\n company_rep_mult: 1.0777,\n crime_success_mult: 1.0777,\n crime_money_mult: 1.0777,\n programs: [Programs.DeepscanV1.name, Programs.AutoLink.name],\n });\n PCMatrix.addToFactions([\"Aevum\"]);\n if (augmentationExists(AugmentationNames.PCMatrix)) {\n delete Augmentations[AugmentationNames.PCMatrix];\n }\n AddToAugmentations(PCMatrix);\n\n // Ishima\n const INFRARet = new Augmentation({\n name: AugmentationNames.INFRARet,\n repCost: 7.5e3,\n moneyCost: 3e7,\n info:\n \"A tiny chip that sits behind the retinae. This implant lets the\" + \"user visually detect infrared radiation.\",\n crime_success_mult: 1.25,\n crime_money_mult: 1.1,\n dexterity_mult: 1.1,\n });\n INFRARet.addToFactions([\"Ishima\"]);\n if (augmentationExists(AugmentationNames.INFRARet)) {\n delete Augmentations[AugmentationNames.INFRARet];\n }\n AddToAugmentations(INFRARet);\n\n // Volhaven\n const DermaForce = new Augmentation({\n name: AugmentationNames.DermaForce,\n repCost: 1.5e4,\n moneyCost: 5e7,\n info:\n \"Synthetic skin that is grafted onto the body. This skin consists of \" +\n \"millions of nanobots capable of projecting high-density muon beams, \" +\n \"creating an energy barrier around the user.\",\n defense_mult: 1.4,\n });\n DermaForce.addToFactions([\"Volhaven\"]);\n if (augmentationExists(AugmentationNames.DermaForce)) {\n delete Augmentations[AugmentationNames.DermaForce];\n }\n AddToAugmentations(DermaForce);\n\n // SpeakersForTheDead\n const GrapheneBrachiBlades = new Augmentation({\n name: AugmentationNames.GrapheneBrachiBlades,\n repCost: 2.25e5,\n moneyCost: 2.5e9,\n info:\n \"An upgrade to the BrachiBlades augmentation. It infuses \" +\n \"the retractable blades with an advanced graphene material \" +\n \"making them stronger and lighter.\",\n prereqs: [AugmentationNames.BrachiBlades],\n strength_mult: 1.4,\n defense_mult: 1.4,\n crime_success_mult: 1.1,\n crime_money_mult: 1.3,\n });\n GrapheneBrachiBlades.addToFactions([\"Speakers for the Dead\"]);\n if (augmentationExists(AugmentationNames.GrapheneBrachiBlades)) {\n delete Augmentations[AugmentationNames.GrapheneBrachiBlades];\n }\n AddToAugmentations(GrapheneBrachiBlades);\n\n // DarkArmy\n const GrapheneBionicArms = new Augmentation({\n name: AugmentationNames.GrapheneBionicArms,\n repCost: 5e5,\n moneyCost: 3.75e9,\n info:\n \"An upgrade to the Bionic Arms augmentation. It infuses the \" +\n \"prosthetic arms with an advanced graphene material \" +\n \"to make them stronger and lighter.\",\n prereqs: [AugmentationNames.BionicArms],\n strength_mult: 1.85,\n dexterity_mult: 1.85,\n });\n GrapheneBionicArms.addToFactions([\"The Dark Army\"]);\n if (augmentationExists(AugmentationNames.GrapheneBionicArms)) {\n delete Augmentations[AugmentationNames.GrapheneBionicArms];\n }\n AddToAugmentations(GrapheneBionicArms);\n\n // TheSyndicate\n const BrachiBlades = new Augmentation({\n name: AugmentationNames.BrachiBlades,\n repCost: 1.25e4,\n moneyCost: 9e7,\n info: \"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.\",\n strength_mult: 1.15,\n defense_mult: 1.15,\n crime_success_mult: 1.1,\n crime_money_mult: 1.15,\n });\n BrachiBlades.addToFactions([\"The Syndicate\"]);\n if (augmentationExists(AugmentationNames.BrachiBlades)) {\n delete Augmentations[AugmentationNames.BrachiBlades];\n }\n AddToAugmentations(BrachiBlades);\n\n // Tetrads\n const BionicArms = new Augmentation({\n name: AugmentationNames.BionicArms,\n repCost: 6.25e4,\n moneyCost: 2.75e8,\n info:\n \"Cybernetic arms created from plasteel and carbon fibers that completely replace \" + \"the user's organic arms.\",\n strength_mult: 1.3,\n dexterity_mult: 1.3,\n });\n BionicArms.addToFactions([\"Tetrads\"]);\n if (augmentationExists(AugmentationNames.BionicArms)) {\n delete Augmentations[AugmentationNames.BionicArms];\n }\n AddToAugmentations(BionicArms);\n\n // TianDiHui\n const SNA = new Augmentation({\n name: AugmentationNames.SNA,\n repCost: 6.25e3,\n moneyCost: 3e7,\n info:\n \"A cranial implant that affects the user's personality, making them better \" +\n \"at negotiation in social situations.\",\n work_money_mult: 1.1,\n company_rep_mult: 1.15,\n faction_rep_mult: 1.15,\n });\n SNA.addToFactions([\"Tian Di Hui\"]);\n if (augmentationExists(AugmentationNames.SNA)) {\n delete Augmentations[AugmentationNames.SNA];\n }\n AddToAugmentations(SNA);\n\n const NeuroreceptorManager = new Augmentation({\n name: AugmentationNames.NeuroreceptorManager,\n repCost: 0.75e5,\n moneyCost: 5.5e8,\n info:\n \"A brain implant carefully assembled around the synapses, which \" +\n \"micromanages the activity and levels of various neuroreceptor \" +\n \"chemicals and modulates electrical acvitiy to optimize concentration, \" +\n \"allowing the user to multitask much more effectively.\",\n stats: (\n <>\n This augmentation removes the penalty for not focusing on actions such as working in a job or working for a\n faction.\n </>\n ),\n });\n NeuroreceptorManager.addToFactions([\"Tian Di Hui\"]);\n if (augmentationExists(AugmentationNames.NeuroreceptorManager)) {\n delete Augmentations[AugmentationNames.NeuroreceptorManager];\n }\n AddToAugmentations(NeuroreceptorManager);\n\n // Special Bladeburner Augmentations\n const BladeburnersFactionName = \"Bladeburners\";\n if (factionExists(BladeburnersFactionName)) {\n const EsperEyewear = new Augmentation({\n name: AugmentationNames.EsperEyewear,\n repCost: 1.25e3,\n moneyCost: 1.65e8,\n info:\n \"Ballistic-grade protective and retractable eyewear that was designed specifically \" +\n \"for Bladeburner units. This \" +\n \"is implanted by installing a mechanical frame in the skull's orbit. \" +\n \"This frame interfaces with the brain and allows the user to \" +\n \"automatically extrude and extract the eyewear. The eyewear protects \" +\n \"against debris, shrapnel, lasers, blinding flashes, and gas. It is also \" +\n \"embedded with a data processing chip that can be programmed to display an \" +\n \"AR HUD to assist the user in field missions.\",\n bladeburner_success_chance_mult: 1.03,\n dexterity_mult: 1.05,\n isSpecial: true,\n });\n EsperEyewear.addToFactions([BladeburnersFactionName]);\n resetAugmentation(EsperEyewear);\n\n const EMS4Recombination = new Augmentation({\n name: AugmentationNames.EMS4Recombination,\n repCost: 2.5e3,\n moneyCost: 2.75e8,\n info:\n \"A DNA recombination of the EMS-4 Gene. This genetic engineering \" +\n \"technique was originally used on Bladeburners during the Synthoid uprising \" +\n \"to induce wakefulness and concentration, suppress fear, reduce empathy, \" +\n \"improve reflexes, and improve memory among other things.\",\n bladeburner_success_chance_mult: 1.03,\n bladeburner_analysis_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.02,\n isSpecial: true,\n });\n EMS4Recombination.addToFactions([BladeburnersFactionName]);\n resetAugmentation(EMS4Recombination);\n\n const OrionShoulder = new Augmentation({\n name: AugmentationNames.OrionShoulder,\n repCost: 6.25e3,\n moneyCost: 5.5e8,\n info:\n \"A bionic shoulder augmentation for the right shoulder. Using cybernetics, \" +\n \"the ORION-MKIV shoulder enhances the strength and dexterity \" +\n \"of the user's right arm. It also provides protection due to its \" +\n \"crystallized graphene plating.\",\n defense_mult: 1.05,\n strength_mult: 1.05,\n dexterity_mult: 1.05,\n bladeburner_success_chance_mult: 1.04,\n isSpecial: true,\n });\n OrionShoulder.addToFactions([BladeburnersFactionName]);\n resetAugmentation(OrionShoulder);\n\n const HyperionV1 = new Augmentation({\n name: AugmentationNames.HyperionV1,\n repCost: 1.25e4,\n moneyCost: 2.75e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable \" +\n \"of rapidly firing bolts of high-density plasma. The weapon is meant to \" +\n \"be used against augmented enemies as the ionized \" +\n \"nature of the plasma disrupts the electrical systems of Augmentations. However, \" +\n \"it can also be effective against non-augmented enemies due to its high temperature \" +\n \"and concussive force.\",\n bladeburner_success_chance_mult: 1.06,\n isSpecial: true,\n });\n HyperionV1.addToFactions([BladeburnersFactionName]);\n resetAugmentation(HyperionV1);\n\n const HyperionV2 = new Augmentation({\n name: AugmentationNames.HyperionV2,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. This augmentation \" +\n \"is more advanced and powerful than the original V1 model. This V2 model is \" +\n \"more power-efficient, more accurate, and can fire plasma bolts at a much \" +\n \"higher velocity than the V1 model.\",\n prereqs: [AugmentationNames.HyperionV1],\n bladeburner_success_chance_mult: 1.08,\n isSpecial: true,\n });\n HyperionV2.addToFactions([BladeburnersFactionName]);\n resetAugmentation(HyperionV2);\n\n const GolemSerum = new Augmentation({\n name: AugmentationNames.GolemSerum,\n repCost: 3.125e4,\n moneyCost: 1.1e10,\n info:\n \"A serum that permanently enhances many aspects of human capabilities, \" +\n \"including strength, speed, immune system enhancements, and mitochondrial efficiency. The \" +\n \"serum was originally developed by the Chinese military in an attempt to \" +\n \"create super soldiers.\",\n strength_mult: 1.07,\n defense_mult: 1.07,\n dexterity_mult: 1.07,\n agility_mult: 1.07,\n bladeburner_stamina_gain_mult: 1.05,\n isSpecial: true,\n });\n GolemSerum.addToFactions([BladeburnersFactionName]);\n resetAugmentation(GolemSerum);\n\n const VangelisVirus = new Augmentation({\n name: AugmentationNames.VangelisVirus,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus \" +\n \"heightens the senses and focus of its host, and also enhances its intuition.\",\n dexterity_exp_mult: 1.1,\n bladeburner_analysis_mult: 1.1,\n bladeburner_success_chance_mult: 1.04,\n isSpecial: true,\n });\n VangelisVirus.addToFactions([BladeburnersFactionName]);\n resetAugmentation(VangelisVirus);\n\n const VangelisVirus3 = new Augmentation({\n name: AugmentationNames.VangelisVirus3,\n repCost: 3.75e4,\n moneyCost: 1.1e10,\n info:\n \"An improved version of Vangelis, a synthetic symbiotic virus that is \" +\n \"injected into human brain tissue. On top of the benefits of the original \" +\n \"virus, this also grants an accelerated healing factor and enhanced \" +\n \"reflexes.\",\n prereqs: [AugmentationNames.VangelisVirus],\n defense_exp_mult: 1.1,\n dexterity_exp_mult: 1.1,\n bladeburner_analysis_mult: 1.15,\n bladeburner_success_chance_mult: 1.05,\n isSpecial: true,\n });\n VangelisVirus3.addToFactions([BladeburnersFactionName]);\n resetAugmentation(VangelisVirus3);\n\n const INTERLINKED = new Augmentation({\n name: AugmentationNames.INTERLINKED,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"The DNA is genetically modified to enhance the human's body \" +\n \"extracellular matrix (ECM). This improves the ECM's ability to \" +\n \"structurally support the body and grants heightened strength and \" +\n \"durability.\",\n strength_exp_mult: 1.05,\n defense_exp_mult: 1.05,\n dexterity_exp_mult: 1.05,\n agility_exp_mult: 1.05,\n bladeburner_max_stamina_mult: 1.1,\n isSpecial: true,\n });\n INTERLINKED.addToFactions([BladeburnersFactionName]);\n resetAugmentation(INTERLINKED);\n\n const BladeRunner = new Augmentation({\n name: AugmentationNames.BladeRunner,\n repCost: 2e4,\n moneyCost: 8.25e9,\n info:\n \"A cybernetic foot augmentation that was specifically created for Bladeburners \" +\n \"during the Synthoid Uprising. The organic musculature of the human foot \" +\n \"is enhanced with flexible carbon nanotube matrices that are controlled by \" +\n \"intelligent servo-motors.\",\n agility_mult: 1.05,\n bladeburner_max_stamina_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.05,\n isSpecial: true,\n });\n BladeRunner.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeRunner);\n\n const BladeArmor = new Augmentation({\n name: AugmentationNames.BladeArmor,\n repCost: 1.25e4,\n moneyCost: 1.375e9,\n info:\n \"A powered exoskeleton suit designed as armor for Bladeburner units. This \" +\n \"exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, \" +\n \"concussive, thermal, chemical, and electric trauma. It also enhances the user's \" +\n \"physical abilities.\",\n strength_mult: 1.04,\n defense_mult: 1.04,\n dexterity_mult: 1.04,\n agility_mult: 1.04,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_success_chance_mult: 1.03,\n isSpecial: true,\n });\n BladeArmor.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmor);\n\n const BladeArmorPowerCells = new Augmentation({\n name: AugmentationNames.BladeArmorPowerCells,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of \" +\n \"more efficiently storing and using power.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance_mult: 1.05,\n bladeburner_stamina_gain_mult: 1.02,\n bladeburner_max_stamina_mult: 1.05,\n isSpecial: true,\n });\n BladeArmorPowerCells.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorPowerCells);\n\n const BladeArmorEnergyShielding = new Augmentation({\n name: AugmentationNames.BladeArmorEnergyShielding,\n repCost: 2.125e4,\n moneyCost: 5.5e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system \" +\n \"that is capable of projecting an energy shielding force field.\",\n prereqs: [AugmentationNames.BladeArmor],\n defense_mult: 1.05,\n bladeburner_success_chance_mult: 1.06,\n isSpecial: true,\n });\n BladeArmorEnergyShielding.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorEnergyShielding);\n\n const BladeArmorUnibeam = new Augmentation({\n name: AugmentationNames.BladeArmorUnibeam,\n repCost: 3.125e4,\n moneyCost: 1.65e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser \" +\n \"weapon. It's precision and accuracy makes it useful for quickly neutralizing \" +\n \"threats while keeping casualties to a minimum.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance_mult: 1.08,\n isSpecial: true,\n });\n BladeArmorUnibeam.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorUnibeam);\n\n const BladeArmorOmnibeam = new Augmentation({\n name: AugmentationNames.BladeArmorOmnibeam,\n repCost: 6.25e4,\n moneyCost: 2.75e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a \" +\n \"multiple-fiber system. This upgraded weapon uses multiple fiber laser \" +\n \"modules that combine together to form a single, more powerful beam of up to \" +\n \"2000MW.\",\n prereqs: [AugmentationNames.BladeArmorUnibeam],\n bladeburner_success_chance_mult: 1.1,\n isSpecial: true,\n });\n BladeArmorOmnibeam.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorOmnibeam);\n\n const BladeArmorIPU = new Augmentation({\n name: AugmentationNames.BladeArmorIPU,\n repCost: 1.5e4,\n moneyCost: 1.1e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing \" +\n \"Unit that was specially designed to analyze Synthoid related data and \" +\n \"information.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_analysis_mult: 1.15,\n bladeburner_success_chance_mult: 1.02,\n isSpecial: true,\n });\n BladeArmorIPU.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladeArmorIPU);\n\n const BladesSimulacrum = new Augmentation({\n name: AugmentationNames.BladesSimulacrum,\n repCost: 1.25e3,\n moneyCost: 1.5e11,\n info:\n \"A highly-advanced matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation allows \" +\n \"the user to project and control a holographic simulacrum within an \" +\n \"extremely large radius. These specially-modified holograms were specifically \" +\n \"weaponized by Bladeburner units to be used against Synthoids.\",\n stats: (\n <>\n This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting\n crimes, etc.) at the same time.\n </>\n ),\n isSpecial: true,\n });\n BladesSimulacrum.addToFactions([BladeburnersFactionName]);\n resetAugmentation(BladesSimulacrum);\n }\n\n // Update costs based on how many have been purchased\n mult = Math.pow(\n CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]],\n Player.queuedAugmentations.length,\n );\n for (const name in Augmentations) {\n if (Augmentations.hasOwnProperty(name)) {\n Augmentations[name].baseCost *= mult;\n }\n }\n\n Player.reapplyAllAugmentations();\n}\n\n//Resets an Augmentation during (re-initizliation)\nfunction resetAugmentation(newAugObject: Augmentation): void {\n if (!(newAugObject instanceof Augmentation)) {\n throw new Error(\"Invalid argument 'newAugObject' passed into resetAugmentation\");\n }\n const name = newAugObject.name;\n if (augmentationExists(name)) {\n delete Augmentations[name];\n }\n AddToAugmentations(newAugObject);\n}\n\nfunction applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {\n Augmentations[aug.name].owned = true;\n\n const augObj = Augmentations[aug.name];\n\n // Apply multipliers\n for (const mult in augObj.mults) {\n const v = Player.getMult(mult) * augObj.mults[mult];\n Player.setMult(mult, v);\n }\n\n // Special logic for NeuroFlux Governor\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n if (!reapply) {\n Augmentations[aug.name].level = aug.level;\n for (let i = 0; i < Player.augmentations.length; ++i) {\n if (Player.augmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n Player.augmentations[i].level = aug.level;\n return;\n // break;\n }\n }\n }\n }\n\n // Push onto Player's Augmentation list\n if (!reapply) {\n const ownedAug = new PlayerOwnedAugmentation(aug.name);\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations(): boolean {\n if (Player.queuedAugmentations.length == 0) {\n dialogBoxCreate(\"You have not purchased any Augmentations to install!\");\n return false;\n }\n let augmentationList = \"\";\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n const ownedAug = Player.queuedAugmentations[i];\n const aug = Augmentations[ownedAug.name];\n if (aug == null) {\n console.error(`Invalid augmentation: ${ownedAug.name}`);\n continue;\n }\n\n applyAugmentation(Player.queuedAugmentations[i]);\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n\n let level = \"\";\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ` - ${ownedAug.level}`;\n }\n augmentationList += aug.name + level + \"<br>\";\n }\n Player.queuedAugmentations = [];\n dialogBoxCreate(\n \"You slowly drift to sleep as scientists put you under in order \" +\n \"to install the following Augmentations:<br>\" +\n augmentationList +\n \"<br>You wake up in your home...you feel different...\",\n );\n prestigeAugmentation();\n return true;\n}\n\nfunction augmentationExists(name: string): boolean {\n return Augmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation): boolean {\n const augName = aug instanceof Augmentation ? aug.name : aug;\n\n if (augName === AugmentationNames.NeuroFluxGovernor) {\n return true;\n }\n\n return false;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\n","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 */\nexport interface 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 { 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,\n \"Real Estate\": 0,\n \"AI Cores\": 0,\n};\n","/**\n * Functions for handling WorkerScripts, which are the underlying mechanism\n * that allows for scripts to run\n */\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { generateNextPid } from \"./Netscript/Pid\";\n\nimport { CONSTANTS } from \"./Constants\";\nimport { Interpreter } from \"./ThirdParty/JSInterpreter\";\nimport { isScriptErrorMessage, makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\nimport { NetscriptFunctions } from \"./NetscriptFunctions\";\nimport { executeJSScript } from \"./NetscriptJSEvaluator\";\nimport { NetscriptPort, IPort } from \"./NetscriptPort\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport { getRamUsageFromRunningScript } from \"./Script/RunningScriptHelpers\";\nimport { scriptCalculateOfflineProduction } from \"./Script/ScriptHelpers\";\nimport { Script } from \"./Script/Script\";\nimport { GetAllServers } from \"./Server/AllServers\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Settings } from \"./Settings/Settings\";\n\nimport { generate } from \"escodegen\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { roundToTwo } from \"./utils/helpers/roundToTwo\";\nimport { isString } from \"./utils/helpers/isString\";\nimport { sprintf } from \"sprintf-js\";\n\nimport { parse } from \"acorn\";\nimport { simple as walksimple } from \"acorn-walk\";\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\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(workerScript: WorkerScript): Promise<WorkerScript> {\n workerScript.running = true;\n\n // The name of the currently running netscript function, to prevent concurrent\n // calls to hack, grow, etc.\n let runningFn: string | null = null;\n\n // We need to go through the environment and wrap each function in such a way that it\n // can be called at most once at a time. This will prevent situations where multiple\n // hack promises are outstanding, for example.\n function wrap(propName: string, f: (...args: any[]) => Promise<void>): (...args: any[]) => Promise<void> {\n // This function unfortunately cannot be an async function, because we don't\n // know if the original one was, and there's no way to tell.\n return function (...args: any[]) {\n // Wrap every netscript function with a check for the stop flag.\n // This prevents cases where we never stop because we are only calling\n // netscript functions that don't check this.\n // This is not a problem for legacy Netscript because it also checks the\n // stop flag in the evaluator.\n if (workerScript.env.stopFlag) {\n throw workerScript;\n }\n\n if (propName === \"sleep\") return f(...args); // OK for multiple simultaneous calls to sleep.\n\n const msg =\n \"Concurrent calls to Netscript functions not allowed! \" +\n \"Did you forget to await hack(), grow(), or some other \" +\n \"promise-returning function? (Currently running: %s tried to run: %s)\";\n if (runningFn) {\n workerScript.errorMessage = makeRuntimeRejectMsg(workerScript, sprintf(msg, runningFn, propName));\n throw workerScript;\n }\n runningFn = propName;\n\n // If the function throws an error, clear the runningFn flag first, and then re-throw it\n // This allows people to properly catch errors thrown by NS functions without getting\n // the concurrent call error above\n let result;\n try {\n result = f(...args);\n } catch (e) {\n runningFn = null;\n throw e;\n }\n\n if (result && result.finally !== undefined) {\n return result.finally(function () {\n runningFn = null;\n });\n } else {\n runningFn = null;\n return result;\n }\n };\n }\n\n for (const prop in workerScript.env.vars) {\n if (typeof workerScript.env.vars[prop] !== \"function\") continue;\n workerScript.env.vars[prop] = wrap(prop, workerScript.env.vars[prop]);\n }\n\n // Note: the environment that we pass to the JS script only needs to contain the functions visible\n // to that script, which env.vars does at this point.\n return new Promise<WorkerScript>((resolve, reject) => {\n executeJSScript(workerScript.getServer().scripts, workerScript)\n .then(() => {\n resolve(workerScript);\n })\n .catch((e) => reject(e));\n }).catch((e) => {\n if (e instanceof Error) {\n workerScript.errorMessage = makeRuntimeRejectMsg(\n workerScript,\n e.message + ((e.stack && \"\\nstack:\\n\" + e.stack.toString()) || \"\"),\n );\n throw workerScript;\n } else if (isScriptErrorMessage(e)) {\n workerScript.errorMessage = e;\n throw workerScript;\n }\n throw e; // Don't know what to do with it, let's rethrow.\n });\n}\n\nfunction startNetscript1Script(workerScript: WorkerScript): Promise<WorkerScript> {\n const code = workerScript.code;\n workerScript.running = true;\n\n //Process imports\n let codeWithImports, codeLineOffset;\n try {\n const importProcessingRes = processNetscript1Imports(code, workerScript);\n codeWithImports = importProcessingRes.code;\n codeLineOffset = importProcessingRes.lineOffset;\n } catch (e) {\n dialogBoxCreate(\"Error processing Imports in \" + workerScript.name + \":<br>\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve(workerScript);\n }\n\n const interpreterInitialization = function (int: any, scope: any): void {\n //Add the Netscript environment\n const ns = NetscriptFunctions(workerScript);\n for (const name in 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 name === \"hack\" ||\n name === \"grow\" ||\n name === \"weaken\" ||\n name === \"sleep\" ||\n name === \"prompt\" ||\n name === \"manualHack\"\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 WorkerScript)) console.error(err);\n });\n };\n int.setProperty(scope, name, int.createAsyncFunction(tempWrapper));\n } else if (\n name === \"sprintf\" ||\n name === \"vsprintf\" ||\n name === \"scp\" ||\n name == \"write\" ||\n name === \"tryWrite\" ||\n name === \"run\" ||\n name === \"exec\"\n ) {\n const tempWrapper = function (...args: any[]): void {\n const fnArgs = [];\n\n //All of the Object/array elements are in JSInterpreter format, so\n //we have to convert them back to native format to pass them to these fns\n for (let i = 0; i < args.length; ++i) {\n if (typeof args[i] === \"object\" || args[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(args[i]));\n } else {\n fnArgs.push(args[i]);\n }\n }\n\n return entry(...fnArgs);\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n } else {\n const tempWrapper = function (...args: any[]): any {\n const res = entry(...args);\n\n if (res == null) {\n return res;\n } else if (res.constructor === Array || res === Object(res)) {\n //Objects and Arrays must be converted to the interpreter's format\n return int.nativeToPseudo(res);\n } else {\n return res;\n }\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n }\n } else {\n //bladeburner, or anything else\n int.setProperty(scope, name, int.nativeToPseudo(entry));\n }\n }\n\n //Add the arguments\n int.setProperty(scope, \"args\", int.nativeToPseudo(workerScript.args));\n };\n\n let interpreter: any;\n try {\n interpreter = new Interpreter(codeWithImports, interpreterInitialization, codeLineOffset);\n } catch (e) {\n dialogBoxCreate(\"Syntax ERROR in \" + workerScript.name + \":<br>\" + e);\n workerScript.env.stopFlag = true;\n workerScript.running = false;\n killWorkerScript(workerScript);\n return Promise.resolve(workerScript);\n }\n\n return new Promise(function (resolve, reject) {\n function runInterpreter(): void {\n try {\n if (workerScript.env.stopFlag) {\n return reject(workerScript);\n }\n\n if (interpreter.step()) {\n setTimeout(runInterpreter, Settings.CodeInstructionRunTime);\n } else {\n resolve(workerScript);\n }\n } catch (e) {\n e = e.toString();\n if (!isScriptErrorMessage(e)) {\n e = makeRuntimeRejectMsg(workerScript, e);\n }\n workerScript.errorMessage = e;\n return reject(workerScript);\n }\n }\n\n try {\n runInterpreter();\n } catch (e) {\n if (isString(e)) {\n workerScript.errorMessage = e;\n return reject(workerScript);\n } else if (e instanceof WorkerScript) {\n return reject(e);\n } else {\n return reject(workerScript);\n }\n }\n });\n}\n\n/* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword\n 'import' throws an error. However, since we want to support import funtionality\n we'll implement it ourselves by parsing the Nodes in the AST out.\n\n @param code - The script's code\n @returns {Object} {\n code: Newly-generated code with imported functions\n lineOffset: Net number of lines of code added/removed due to imported functions\n Should typically be positive\n }\n*/\nfunction processNetscript1Imports(code: string, workerScript: WorkerScript): any {\n //allowReserved prevents 'import' from throwing error in ES5\n const ast: any = parse(code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n const server = workerScript.getServer();\n if (server == null) {\n throw new Error(\"Failed to find underlying Server object for script\");\n }\n\n function getScript(scriptName: string): Script | null {\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === scriptName) {\n return server.scripts[i];\n }\n }\n return null;\n }\n\n let generatedCode = \"\"; // Generated Javascript Code\n let hasImports = false;\n\n // Walk over the tree and process ImportDeclaration nodes\n walksimple(ast, {\n ImportDeclaration: (node: any) => {\n hasImports = true;\n let scriptName = node.source.value;\n if (scriptName.startsWith(\"./\")) {\n scriptName = scriptName.slice(2);\n }\n const script = getScript(scriptName);\n if (script == null) {\n throw new Error(\"'Import' failed due to invalid script: \" + scriptName);\n }\n const scriptAst = parse(script.code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n if (node.specifiers.length === 1 && node.specifiers[0].type === \"ImportNamespaceSpecifier\") {\n // import * as namespace from script\n const namespace = node.specifiers[0].local.name;\n const fnNames: string[] = []; //Names only\n const fnDeclarations: any[] = []; //FunctionDeclaration Node objects\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\n fnNames.push(node.id.name);\n fnDeclarations.push(node);\n },\n });\n\n //Now we have to generate the code that would create the namespace\n generatedCode += \"var \" + namespace + \";\\n\" + \"(function (namespace) {\\n\";\n\n //Add the function declarations\n fnDeclarations.forEach((fn: any) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n\n //Add functions to namespace\n fnNames.forEach((fnName) => {\n generatedCode += \"namespace.\" + fnName + \" = \" + fnName;\n generatedCode += \"\\n\";\n });\n\n //Finish\n generatedCode += \"})(\" + namespace + \" || \" + \"(\" + namespace + \" = {}));\\n\";\n } else {\n //import {...} from script\n\n //Get array of all fns to import\n const fnsToImport: string[] = [];\n node.specifiers.forEach((e: any) => {\n fnsToImport.push(e.local.name);\n });\n\n //Walk through script and get FunctionDeclaration code for all specified fns\n const fnDeclarations: any[] = [];\n walksimple(scriptAst, {\n FunctionDeclaration: (node: any) => {\n if (fnsToImport.includes(node.id.name)) {\n fnDeclarations.push(node);\n }\n },\n });\n\n //Convert FunctionDeclarations into code\n fnDeclarations.forEach((fn: any) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n }\n },\n });\n\n //If there are no imports, just return the original code\n if (!hasImports) {\n return { code: code, lineOffset: 0 };\n }\n\n //Remove ImportDeclarations from AST. These ImportDeclarations must be in top-level\n let linesRemoved = 0;\n if (ast.type !== \"Program\" || ast.body == null) {\n throw new Error(\"Code could not be properly parsed\");\n }\n for (let i = ast.body.length - 1; i >= 0; --i) {\n if (ast.body[i].type === \"ImportDeclaration\") {\n ast.body.splice(i, 1);\n ++linesRemoved;\n }\n }\n\n //Calculated line offset\n const lineOffset = (generatedCode.match(/\\n/g) || []).length - linesRemoved;\n\n //Convert the AST back into code\n code = generate(ast);\n\n //Add the imported code and re-generate in ES5 (JS Interpreter for NS1 only supports ES5);\n code = generatedCode + code;\n\n const res = {\n code: code,\n lineOffset: lineOffset,\n };\n return res;\n}\n\n/**\n * Used to start a RunningScript (by creating and starting its\n * corresponding WorkerScript), and add the RunningScript to the server on which\n * it is active\n * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * @returns {number} pid of started script\n */\nexport function startWorkerScript(runningScript: RunningScript, server: BaseServer, parent?: WorkerScript): number {\n if (createAndAddWorkerScript(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 */\nexport function createAndAddWorkerScript(\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 ramUsage = roundToTwo(getRamUsageFromRunningScript(runningScriptObj) * threads);\n const ramAvailable = server.maxRam - server.ramUsed;\n if (ramUsage > ramAvailable) {\n dialogBoxCreate(\n `Not enough RAM to run script ${runningScriptObj.filename} with args ` +\n `${arrayToString(runningScriptObj.args)}. This likely occurred because you re-loaded ` +\n `the game and the script's RAM usage increased (either because of an update to the game or ` +\n `your changes to the script.)`,\n );\n return false;\n }\n server.ramUsed = roundToTwo(server.ramUsed + ramUsage);\n\n // Get the pid\n const pid = generateNextPid();\n if (pid === -1) {\n throw new Error(\n `Failed to start script because could not find available PID. This is most ` +\n `because you have too many scripts running.`,\n );\n }\n\n // Create the WorkerScript. NOTE: WorkerScript ctor will set the underlying\n // RunningScript's PID as well\n const s = new WorkerScript(runningScriptObj, pid, NetscriptFunctions);\n s.ramUsage = ramUsage;\n\n // Add the WorkerScript to the global pool\n workerScripts.set(pid, s);\n WorkerScriptStartStopEventEmitter.emit();\n\n // Start the script's execution\n let p: Promise<WorkerScript> | null = null; // Script's resulting promise\n if (s.name.endsWith(\".js\") || s.name.endsWith(\".ns\")) {\n p = startNetscript2Script(s);\n } else {\n p = startNetscript1Script(s);\n if (!(p instanceof Promise)) {\n return false;\n }\n }\n\n // Once the code finishes (either resolved or rejected, doesnt matter), set its\n // running status to false\n p.then(function (w: WorkerScript) {\n // On natural death, the earnings are transfered to the parent if it still exists.\n if (parent !== undefined) {\n if (parent.running) {\n parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;\n parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;\n }\n }\n\n killWorkerScript(s);\n w.log(\"\", \"Script finished running\");\n }).catch(function (w) {\n if (w instanceof Error) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\"Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: \" + w.toString());\n return;\n } else if (w instanceof WorkerScript) {\n if (isScriptErrorMessage(w.errorMessage)) {\n const errorTextArray = w.errorMessage.split(\"|\");\n if (errorTextArray.length != 4) {\n console.error(\"ERROR: Something wrong with Error text in evaluator...\");\n console.error(\"Error text: \" + w.errorMessage);\n return;\n }\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n\n let msg = `RUNTIME ERROR<br>${scriptName}@${hostname}<br>`;\n if (w.args.length > 0) {\n msg += `Args: ${arrayToString(w.args)}<br>`;\n }\n msg += \"<br>\";\n msg += errorMsg;\n\n dialogBoxCreate(msg);\n w.log(\"\", \"Script crashed with runtime error\");\n } else {\n w.log(\"\", \"Script killed\");\n return; // Already killed, so stop here\n }\n w.running = false;\n w.env.stopFlag = true;\n } else if (isScriptErrorMessage(w)) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\n \"ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: \" +\n w.toString(),\n );\n return;\n } else {\n dialogBoxCreate(\"An unknown script died for an unknown reason. This is a bug please contact game dev\");\n console.error(w);\n }\n\n killWorkerScript(s);\n });\n\n return true;\n}\n\n/**\n * Updates the online running time stat of all running scripts\n */\nexport function updateOnlineScriptTimes(numCycles = 1): void {\n const time = (numCycles * CONSTANTS._idleSpeed) / 1000; //seconds\n for (const ws of workerScripts.values()) {\n ws.scriptRef.onlineRunningTime += time;\n }\n}\n\n/**\n * Called when the game is loaded. Loads all running scripts (from all servers)\n * into worker scripts so that they will start running\n */\nexport function loadAllRunningScripts(): void {\n const skipScriptLoad = window.location.href.toLowerCase().indexOf(\"?noscripts\") !== -1;\n if (skipScriptLoad) {\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 createAndAddWorkerScript(server.runningScripts[j], server);\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 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 // 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 (server.scripts[i].filename === scriptname) {\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.round(Number(threads));\n if (threads === 0) {\n return 0;\n }\n ramUsage = ramUsage * threads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (server.hasAdminRights == false) {\n workerScript.log(caller, `You do not have root access on '${server.hostname}'`);\n return 0;\n } else if (ramUsage > ramAvailable) {\n workerScript.log(\n caller,\n `Cannot run script '${scriptname}' (t=${threads}) on '${server.hostname}' because there is not enough available RAM!`,\n );\n return 0;\n } else {\n // Able to run script\n workerScript.log(\n caller,\n `'${scriptname}' on '${server.hostname}' with ${threads} threads and args: ${arrayToString(args)}.`,\n );\n const runningScriptObj = new RunningScript(script, args);\n runningScriptObj.threads = threads;\n\n return startWorkerScript(runningScriptObj, server, workerScript);\n }\n }\n }\n\n workerScript.log(caller, `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\n}\n","export enum FactionWorkType {\n Field,\n Hacking,\n None,\n Security,\n}\n","/**\n * Represents the possible configuration values that can be provided when creating the progress bar text.\n */\ninterface IProgressBarConfiguration {\n /**\n * Current progress, taken as a decimal (i.e. '0.6' to represent '60%')\n */\n progress?: number;\n\n /**\n * Total number of ticks in progress bar. Preferably a factor of 100.\n */\n totalTicks?: number;\n}\n\n/**\n * Represents concrete configuration values when creating the progress bar text.\n */\ninterface IProgressBarConfigurationMaterialized extends IProgressBarConfiguration {\n progress: number;\n totalTicks: number;\n}\n\n/**\n * Creates a graphical \"progress bar\"\n * e.g.: [||||---------------]\n * @param params The configuration parameters for the progress bar\n */\nexport function createProgressBarText(params: IProgressBarConfiguration): string {\n // Default values\n const defaultParams: IProgressBarConfigurationMaterialized = {\n progress: 0,\n totalTicks: 20,\n };\n\n // tslint:disable-next-line:prefer-object-spread\n const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params);\n // Ensure it is 0..1\n derived.progress = Math.max(Math.min(derived.progress, 1), 0);\n\n // This way there is always at least one bar filled in...\n const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1);\n const dashes: number = Math.max(derived.totalTicks - bars, 0);\n\n // String.prototype.repeat isn't completley supported, but good enough for our purposes\n return `[${\"|\".repeat(bars)}${\"-\".repeat(dashes)}]`;\n}\n","import { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { Export } from \"./Export\";\n\ninterface IConstructorParams {\n name?: string;\n}\n\nexport class Material {\n // Name of material\n name = \"InitName\";\n\n // Amount of material owned\n qty = 0;\n\n // Material's \"quality\". Unbounded\n qlt = 0;\n\n // How much demand the Material has in the market, and the range of possible\n // values for this \"demand\"\n dmd = 0;\n dmdR: number[] = [0, 0];\n\n // How much competition there is for this Material in the market, and the range\n // of possible values for this \"competition\"\n cmp = 0;\n cmpR: number[] = [0, 0];\n\n // Maximum volatility of this Materials stats\n mv = 0;\n\n // Markup. Determines how high of a price you can charge on the material\n // compared to the market price without suffering loss in # of sales\n // Quality is divided by this to determine markup limits\n // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10\n mku = 0;\n\n // How much of this material is being bought, sold, imported and produced every second\n buy = 0;\n sll = 0;\n prd = 0;\n imp = 0;\n\n // Exports of this material to another warehouse/industry\n exp: Export[] = [];\n\n // Total amount of this material exported in the last cycle\n totalExp = 0;\n\n // Cost / sec to buy this material. AKA Market Price\n bCost = 0;\n\n // Cost / sec to sell this material\n sCost: string | number = 0;\n\n // Flags to keep track of whether production and/or sale of this material is limited\n // [Whether production/sale is limited, limit amount]\n prdman: [boolean, number] = [false, 0]; // Production\n sllman: [boolean, string | number] = [false, 0]; // Sale\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price = 0;\n\n constructor(params: IConstructorParams = {}) {\n if (params.name) {\n this.name = params.name;\n }\n this.init();\n }\n\n getMarkupLimit(): number {\n return this.qlt / this.mku;\n }\n\n init(): void {\n switch (this.name) {\n case \"Water\":\n this.dmd = 75;\n this.dmdR = [65, 85];\n this.cmp = 50;\n this.cmpR = [40, 60];\n this.bCost = 1500;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Energy\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 2000;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Food\":\n this.dmd = 80;\n this.dmdR = [70, 90];\n this.cmp = 60;\n this.cmpR = [35, 85];\n this.bCost = 5000;\n this.mv = 1;\n this.mku = 3;\n break;\n case \"Plants\":\n this.dmd = 70;\n this.dmdR = [20, 90];\n this.cmp = 50;\n this.cmpR = [30, 70];\n this.bCost = 3000;\n this.mv = 0.6;\n this.mku = 3.75;\n break;\n case \"Metal\":\n this.dmd = 80;\n this.dmdR = [75, 85];\n this.cmp = 70;\n this.cmpR = [60, 80];\n this.bCost = 2650;\n this.mv = 1;\n this.mku = 6;\n break;\n case \"Hardware\":\n this.dmd = 85;\n this.dmdR = [80, 90];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 8e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"Chemicals\":\n this.dmd = 55;\n this.dmdR = [40, 70];\n this.cmp = 60;\n this.cmpR = [40, 80];\n this.bCost = 9e3;\n this.mv = 1.2;\n this.mku = 2;\n break;\n case \"Real Estate\":\n this.dmd = 50;\n this.dmdR = [5, 99];\n this.cmp = 50;\n this.cmpR = [25, 75];\n this.bCost = 80e3;\n this.mv = 1.5; //Less mv bc its processed twice\n this.mku = 1.5;\n break;\n case \"Drugs\":\n this.dmd = 60;\n this.dmdR = [45, 75];\n this.cmp = 70;\n this.cmpR = [40, 99];\n this.bCost = 40e3;\n this.mv = 1.6;\n this.mku = 1;\n break;\n case \"Robots\":\n this.dmd = 90;\n this.dmdR = [80, 9];\n this.cmp = 90;\n this.cmpR = [80, 9];\n this.bCost = 75e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"AI Cores\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 9];\n this.bCost = 15e3;\n this.mv = 0.8; //Less mv bc its processed twice\n this.mku = 0.5;\n break;\n case \"Scientific Research\":\n case \"InitName\":\n break;\n default:\n console.error(`Invalid material type in init(): ${this.name}`);\n break;\n }\n }\n\n // Process change in demand, competition, and buy cost of this material\n processMarket(): void {\n // The price will change in accordance with demand and competition.\n // e.g. If demand goes up, then so does price. If competition goes up, price goes down\n const priceVolatility: number = (Math.random() * this.mv) / 300;\n const priceChange: number = 1 + priceVolatility;\n\n //This 1st random check determines whether competition increases or decreases\n const compVolatility: number = (Math.random() * this.mv) / 100;\n const compChange: number = 1 + compVolatility;\n if (Math.random() < 0.5) {\n this.cmp *= compChange;\n if (this.cmp > this.cmpR[1]) {\n this.cmp = this.cmpR[1];\n }\n this.bCost *= 1 / priceChange; // Competition increases, so price goes down\n } else {\n this.cmp *= 1 / compChange;\n if (this.cmp < this.cmpR[0]) {\n this.cmp = this.cmpR[0];\n }\n this.bCost *= priceChange; // Competition decreases, so price goes up\n }\n\n // This 2nd random check determines whether demand increases or decreases\n const dmdVolatility: number = (Math.random() * this.mv) / 100;\n const dmdChange: number = 1 + dmdVolatility;\n if (Math.random() < 0.5) {\n this.dmd *= dmdChange;\n if (this.dmd > this.dmdR[1]) {\n this.dmd = this.dmdR[1];\n }\n this.bCost *= priceChange; // Demand increases, so price goes up\n } else {\n this.dmd *= 1 / dmdChange;\n if (this.dmd < this.dmdR[0]) {\n this.dmd = this.dmdR[0];\n }\n this.bCost *= 1 / priceChange;\n }\n }\n\n copy(): Material {\n const material = new Material();\n material.name = this.name;\n material.qty = this.qty;\n material.qlt = this.qlt;\n material.dmd = this.dmd;\n\n material.cmp = this.cmp;\n\n material.mv = this.mv;\n material.mku = this.mku;\n material.buy = this.buy;\n material.sll = this.sll;\n material.prd = this.prd;\n material.imp = this.imp;\n material.totalExp = this.totalExp;\n material.bCost = this.bCost;\n material.marketTa1 = this.marketTa1;\n material.marketTa2 = this.marketTa2;\n material.marketTa2Price = this.marketTa2Price;\n material.sCost = this.sCost;\n material.prdman = [this.prdman[0], this.prdman[1]];\n material.sllman = [this.sllman[0], this.sllman[1]];\n\n material.dmdR = this.dmdR.slice();\n material.cmpR = this.cmpR.slice();\n material.exp = this.exp.slice().map((e) => {\n return { ind: e.ind, city: e.city, amt: e.amt };\n });\n return material;\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 { 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 /**\n * Reputation from the last \"prestige\" that was not converted to favor.\n * This reputation rolls over and is used for the next favor calculation\n */\n rolloverRep = 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 if (this.rolloverRep == null) {\n this.rolloverRep = 0;\n }\n const res = this.getFavorGain();\n if (res.length !== 2) {\n console.error(\"Invalid result from getFavorGain() function\");\n return;\n }\n this.favor += res[0];\n this.rolloverRep = res[1];\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 if (this.rolloverRep == null) {\n this.rolloverRep = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor - 1));\n const totalRep = storedRep + this.rolloverRep + this.playerReputation;\n const newFavor = Math.floor(repToFavor(totalRep));\n const newRep = favorToRep(newFavor);\n return [newFavor - this.favor + 1, totalRep - newRep];\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Faction\", this);\n }\n\n /**\n * Initiatizes a Faction object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Faction {\n return Generic_fromJSON(Faction, value.data);\n }\n}\n\nReviver.constructors.Faction = Faction;\n","// Enums that defined allowed values for setting configuration\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum PurchaseAugmentationsOrderSetting {\n Cost,\n Default,\n Reputation,\n Purchasable,\n}\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum OwnedAugmentationsOrderSetting {\n Alphabetically,\n AcquirementTime,\n}\n","import React, { useEffect } from \"react\";\n\ninterface IProps {\n onKeyDown: (this: Document, event: KeyboardEvent) => void;\n onFailure: (options?: { automated: boolean }) => void;\n}\n\nexport function KeyHandler(props: IProps): React.ReactElement {\n useEffect(() => {\n function press(this: Document, event: KeyboardEvent): void {\n if (!event.isTrusted) return;\n const f = props.onKeyDown.bind(this);\n f(event);\n }\n document.addEventListener(\"keydown\", press);\n return () => document.removeEventListener(\"keydown\", press);\n });\n\n // invisible autofocused element that eats all the keypress for the minigames.\n return <></>;\n}\n","import LinearProgress from \"@mui/material/LinearProgress\";\nimport React, { useState, useEffect } from \"react\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { Theme } from \"@mui/material/styles\";\nimport Grid from \"@mui/material/Grid\";\n\nconst TimerProgress = withStyles((theme: Theme) => ({\n root: {\n backgroundColor: theme.palette.background.paper,\n },\n bar: {\n transition: \"none\",\n backgroundColor: theme.palette.primary.main,\n },\n}))(LinearProgress);\n\ninterface IProps {\n millis: number;\n onExpire: () => void;\n}\n\nexport function GameTimer(props: IProps): React.ReactElement {\n const [v, setV] = useState(100);\n\n const tick = 200;\n useEffect(() => {\n const intervalId = setInterval(() => {\n setV((old) => {\n if (old <= 0) props.onExpire();\n return old - (tick / props.millis) * 100;\n });\n }, tick);\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n // https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation\n // TODO(hydroflame): there's like a bug where it triggers the end before the\n // bar physically reaches the end\n return (\n <Grid item xs={12}>\n <TimerProgress variant=\"determinate\" value={v} color=\"primary\" />\n </Grid>\n );\n}\n","interface DifficultySetting {\n [key: string]: number;\n}\n\ninterface DifficultySettings {\n Trivial: DifficultySetting;\n Normal: DifficultySetting;\n Hard: DifficultySetting;\n Impossible: DifficultySetting;\n}\n\n// I could use `any` to simply some of this but I also want to take advantage\n// of the type safety that typescript provides. I'm just not sure how in this\n// case.\nexport function interpolate(settings: DifficultySettings, n: number, out: DifficultySetting): DifficultySetting {\n // interpolates between 2 difficulties.\n function lerpD(a: DifficultySetting, b: DifficultySetting, t: number): DifficultySetting {\n // interpolates between 2 numbers.\n function lerp(x: number, y: number, t: number): number {\n return (1 - t) * x + t * y;\n }\n for (const key of Object.keys(a)) {\n out[key] = lerp(a[key], b[key], t);\n }\n return a;\n }\n if (n < 0) return lerpD(settings.Trivial, settings.Trivial, 0);\n if (n >= 0 && n < 1) return lerpD(settings.Trivial, settings.Normal, n);\n if (n >= 1 && n < 2) return lerpD(settings.Normal, settings.Hard, n - 1);\n if (n >= 2 && n < 3) return lerpD(settings.Hard, settings.Impossible, n - 2);\n return lerpD(settings.Impossible, settings.Impossible, 0);\n}\n","/**\n * 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 * 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);\n p.recordMoneySource(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);\n p.recordMoneySource(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","/**\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","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IPlayerOrSleeve } from \"../PersonObjects/IPlayerOrSleeve\";\nimport { IRouter } from \"../ui/Router\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\n\nexport interface IConstructorParams {\n hacking_success_weight?: number;\n strength_success_weight?: number;\n defense_success_weight?: number;\n dexterity_success_weight?: number;\n agility_success_weight?: number;\n charisma_success_weight?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n intelligence_exp?: number;\n\n kills?: number;\n}\n\nexport class Crime {\n // Number representing the difficulty of the crime. Used for success chance calculations\n difficulty = 0;\n\n // Amount of karma lost for SUCCESSFULLY committing this crime\n karma = 0;\n\n // How many people die as a result of this crime\n kills = 0;\n\n // How much money is given by the\n money = 0;\n\n // Name of crime\n name = \"\";\n\n // Milliseconds it takes to attempt the crime\n time = 0;\n\n // Corresponding type in CONSTANTS. Contains a description for the crime activity\n type = \"\";\n\n // Weighting factors that determine how stats affect the success rate of this crime\n hacking_success_weight = 0;\n strength_success_weight = 0;\n defense_success_weight = 0;\n dexterity_success_weight = 0;\n agility_success_weight = 0;\n charisma_success_weight = 0;\n\n // How much stat experience is granted by this crime\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n constructor(name = \"\", type = \"\", time = 0, money = 0, difficulty = 0, karma = 0, params: IConstructorParams = {}) {\n this.name = name;\n this.type = type;\n this.time = time;\n this.money = money;\n this.difficulty = difficulty;\n this.karma = karma;\n\n this.hacking_success_weight = params.hacking_success_weight ? params.hacking_success_weight : 0;\n this.strength_success_weight = params.strength_success_weight ? params.strength_success_weight : 0;\n this.defense_success_weight = params.defense_success_weight ? params.defense_success_weight : 0;\n this.dexterity_success_weight = params.dexterity_success_weight ? params.dexterity_success_weight : 0;\n this.agility_success_weight = params.agility_success_weight ? params.agility_success_weight : 0;\n this.charisma_success_weight = params.charisma_success_weight ? params.charisma_success_weight : 0;\n\n this.hacking_exp = params.hacking_exp ? params.hacking_exp : 0;\n this.strength_exp = params.strength_exp ? params.strength_exp : 0;\n this.defense_exp = params.defense_exp ? params.defense_exp : 0;\n this.dexterity_exp = params.dexterity_exp ? params.dexterity_exp : 0;\n this.agility_exp = params.agility_exp ? params.agility_exp : 0;\n this.charisma_exp = params.charisma_exp ? params.charisma_exp : 0;\n this.intelligence_exp = params.intelligence_exp ? params.intelligence_exp : 0;\n\n this.kills = params.kills ? params.kills : 0;\n }\n\n commit(router: IRouter, p: IPlayer, div = 1, workerScript: WorkerScript | null = null): number {\n if (div <= 0) {\n div = 1;\n }\n p.startCrime(\n router,\n this.type,\n this.hacking_exp / div,\n this.strength_exp / div,\n this.defense_exp / div,\n this.dexterity_exp / div,\n this.agility_exp / div,\n this.charisma_exp / div,\n this.money / div,\n this.time,\n workerScript,\n );\n\n return this.time;\n }\n\n successRate(p: IPlayerOrSleeve): number {\n let chance: number =\n this.hacking_success_weight * p.hacking_skill +\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","// Base class representing a person-like object\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { IPlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { calculateSkill } from \"./formulas/skill\";\nimport { calculateIntelligenceBonus } from \"./formulas/intelligence\";\n\n// Interface that defines a generic object used to track experience/money\n// earnings for tasks\nexport interface ITaskTracker {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n money: number;\n}\n\nexport function createTaskTracker(): ITaskTracker {\n return {\n hack: 0,\n str: 0,\n def: 0,\n dex: 0,\n agi: 0,\n cha: 0,\n money: 0,\n };\n}\n\nexport abstract class Person {\n /**\n * Stats\n */\n hacking_skill = 1;\n strength = 1;\n defense = 1;\n dexterity = 1;\n agility = 1;\n charisma = 1;\n intelligence = 1;\n hp = 10;\n max_hp = 10;\n\n /**\n * Experience\n */\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n /**\n * Multipliers\n */\n hacking_mult = 1;\n strength_mult = 1;\n defense_mult = 1;\n dexterity_mult = 1;\n agility_mult = 1;\n charisma_mult = 1;\n\n hacking_exp_mult = 1;\n strength_exp_mult = 1;\n defense_exp_mult = 1;\n dexterity_exp_mult = 1;\n agility_exp_mult = 1;\n charisma_exp_mult = 1;\n\n hacking_chance_mult = 1;\n hacking_speed_mult = 1;\n hacking_money_mult = 1;\n hacking_grow_mult = 1;\n\n company_rep_mult = 1;\n faction_rep_mult = 1;\n\n crime_money_mult = 1;\n crime_success_mult = 1;\n\n work_money_mult = 1;\n\n hacknet_node_money_mult = 1;\n hacknet_node_purchase_cost_mult = 1;\n hacknet_node_ram_cost_mult = 1;\n hacknet_node_core_cost_mult = 1;\n hacknet_node_level_cost_mult = 1;\n\n bladeburner_max_stamina_mult = 1;\n bladeburner_stamina_gain_mult = 1;\n bladeburner_analysis_mult = 1;\n bladeburner_success_chance_mult = 1;\n\n /**\n * Augmentations\n */\n augmentations: IPlayerOwnedAugmentation[] = [];\n queuedAugmentations: IPlayerOwnedAugmentation[] = [];\n\n /**\n * City that the person is in\n */\n city: CityName = CityName.Sector12;\n\n /**\n * Updates this object's multipliers for the given augmentation\n */\n applyAugmentation(aug: Augmentation): void {\n for (const mult in 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_skill / 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_skill / 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_skill / CONSTANTS.MaxSkillLevel +\n this.strength / CONSTANTS.MaxSkillLevel +\n this.defense / CONSTANTS.MaxSkillLevel +\n this.dexterity / CONSTANTS.MaxSkillLevel +\n this.agility / CONSTANTS.MaxSkillLevel)) /\n 4.5;\n return t * this.faction_rep_mult;\n }\n\n /**\n * Reset all multipliers to 1\n */\n resetMultipliers(): void {\n this.hacking_mult = 1;\n this.strength_mult = 1;\n this.defense_mult = 1;\n this.dexterity_mult = 1;\n this.agility_mult = 1;\n this.charisma_mult = 1;\n\n this.hacking_exp_mult = 1;\n this.strength_exp_mult = 1;\n this.defense_exp_mult = 1;\n this.dexterity_exp_mult = 1;\n this.agility_exp_mult = 1;\n this.charisma_exp_mult = 1;\n\n this.company_rep_mult = 1;\n this.faction_rep_mult = 1;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n this.work_money_mult = 1;\n }\n\n /**\n * Update all stat levels\n */\n updateStatLevels(): void {\n this.hacking_skill = Math.max(\n 1,\n Math.floor(this.calculateStat(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.strength = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.strength_exp, this.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier),\n ),\n );\n this.defense = Math.max(\n 1,\n Math.floor(this.calculateStat(this.defense_exp, this.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.dexterity_exp, this.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.agility = Math.max(\n 1,\n Math.floor(this.calculateStat(this.agility_exp, this.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.charisma = Math.max(\n 1,\n Math.floor(\n this.calculateStat(this.charisma_exp, this.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier),\n ),\n );\n\n const ratio: number = this.hp / this.max_hp;\n this.max_hp = Math.floor(10 + this.defense / 10);\n this.hp = Math.round(this.max_hp * ratio);\n }\n\n getIntelligenceBonus(weight: number): number {\n return calculateIntelligenceBonus(this.intelligence, weight);\n }\n}\n","import React from \"react\";\nimport { BitNodeMultipliers } from \"./BitNodeMultipliers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\n\nclass BitNode {\n // A short description, or tagline, about the BitNode\n desc: string;\n\n // A long, detailed overview of the BitNode\n info: JSX.Element;\n\n // Name of BitNode\n name: string;\n\n // BitNode number\n number: number;\n\n difficulty: 0 | 1 | 2;\n\n constructor(n: number, difficulty: 0 | 1 | 2, name: string, desc = \"\", info: JSX.Element = <></>) {\n this.number = n;\n this.difficulty = difficulty;\n this.name = name;\n this.desc = desc;\n this.info = info;\n }\n}\n\nexport const BitNodes: IMap<BitNode> = {};\n\nBitNodes[\"BitNode1\"] = new BitNode(\n 1,\n 0,\n \"Source Genesis\",\n \"The original BitNode\",\n (\n <>\n The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and\n testing-grounds for all of the BitNodes that followed.\n <br />\n <br />\n This is the first BitNode that you play through. It has no special modifications or mechanics.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when\n entering a new BitNode, and also increases all of the player's multipliers by:\n <br />\n <br />\n Level 1: 16%\n <br />\n Level 2: 24%\n <br />\n Level 3: 28%\n </>\n ),\n);\nBitNodes[\"BitNode2\"] = new BitNode(\n 2,\n 0,\n \"Rise of the Underworld\",\n \"From the shadows, they rose\", //Gangs\n (\n <>\n From the shadows, they rose.\n <br />\n <br />\n Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the\n 2050s. As society and civlization broke down, people quickly succumbed to the innate human impulse of evil and\n savagery. The organized crime factions quickly rose to the top of the modern world.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your hacking level is reduced by 20%\n <br />\n The growth rate and maximum amount of money available on servers are significantly decreased\n <br />\n The amount of money gained from crimes and Infiltration is tripled\n <br />\n Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, The Black\n Hand) give the player the ability to form and manage their own gangs. These gangs will earn the player money and\n reputation with the corresponding Faction\n <br />\n Every Augmentation in the game will be available through the Factions listed above\n <br />\n For every Faction NOT listed above, reputation gains are halved\n <br />\n You will no longer gain passive reputation with Factions\n <br />\n <br />\n Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases\n to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:\n <br />\n <br />\n Level 1: 24%\n <br />\n Level 2: 36%\n <br />\n Level 3: 42%\n </>\n ),\n);\nBitNodes[\"BitNode3\"] = new BitNode(\n 3,\n 0,\n \"Corporatocracy\",\n \"The Price of Civilization\",\n (\n <>\n Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.\n <br />\n <br />\n Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy,\n and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own\n community, and evict their neighbors from houses in their desperate bid to increase their wealth.\n <br />\n <br />\n In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential\n of generating massive profits. All other forms of income are reduced by 75%. Furthermore: <br />\n <br />\n The price and reputation cost of all Augmentations is tripled\n <br />\n The starting and maximum amount of money on servers is reduced by 75%\n <br />\n Server growth rate is reduced by 80%\n <br />\n You now only need 75 favour with a faction in order to donate to it, rather than 150\n <br />\n <br />\n Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some\n BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers\n by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode4\"] = new BitNode(\n 4,\n 1,\n \"The Singularity\",\n \"The Man and the Machine\",\n (\n <>\n The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are\n more machine than man. <br />\n <br />\n In this BitNode, progressing is significantly harder. Experience gain rates for all stats are reduced. Most\n methods of earning money will now give significantly less.\n <br />\n <br />\n In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These\n functions allow you to control most aspects of the game through scripts, including working for factions/companies,\n purchasing/installing Augmentations, and creating programs.\n <br />\n <br />\n Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes.\n Each level of this Source-File will open up more Singularity Functions that you can use.\n </>\n ),\n);\nBitNodes[\"BitNode5\"] = new BitNode(\n 5,\n 1,\n \"Artificial Intelligence\",\n \"Posthuman\",\n (\n <>\n They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't\n be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that\n couldn't be modeled by 1's and 0's. They were wrong.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n The base security level of servers is doubled\n <br />\n The starting money on servers is halved, but the maximum money remains the same\n <br />\n Most methods of earning money now give significantly less\n <br />\n Infiltration gives 50% more reputation and money\n <br />\n Corporations have 50% lower valuations and are therefore less profitable\n <br />\n Augmentations are more expensive\n <br />\n Hacking experience gain rates are reduced\n <br />\n <br />\n Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is\n unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence\n experience is much slower than other stats, and it is also hidden (you won't know when you gain experience and how\n much). Higher Intelligence levels will boost your production for many actions in the game. <br />\n <br />\n In addition, this Source-File will unlock the getBitNodeMultipliers() and getServer() Netscript functions, as well\n as the formulas API, and will also raise all of your hacking-related multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode6\"] = new BitNode(\n 6,\n 1,\n \"Bladeburners\",\n \"Like Tears in Rain\",\n (\n <>\n In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic\n androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of\n their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first\n sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than\n the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic for\n progression. Furthermore:\n <br />\n <br />\n Hacking and Hacknet Nodes will be less profitable\n <br />\n Your hacking level is reduced by 65%\n <br />\n Hacking experience gain from scripts is reduced by 75%\n <br />\n Corporations have 80% lower valuations and are therefore less profitable\n <br />\n Working for companies is 50% less profitable\n <br />\n Crimes and Infiltration are 25% less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other\n BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat\n stats by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode7\"] = new BitNode(\n 7,\n 2,\n \"Bladeburners 2079\",\n \"More human than humans\",\n (\n <>\n In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI\n design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological\n breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a\n hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models\n that were stronger, faster, and more intelligent than the humans that had created them.\n <br />\n <br />\n In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner\n functionality through Netscript. Furthermore: <br />\n <br />\n The rank you gain from Bladeburner contracts/operations is reduced by 40%\n <br />\n Bladeburner skills cost twice as many skill points\n <br />\n Augmentations are 3x more expensive\n <br />\n Hacking and Hacknet Nodes will be significantly less profitable\n <br />\n Your hacking level is reduced by 65%\n <br />\n Hacking experience gain from scripts is reduced by 75%\n <br />\n Corporations have 80% lower valuations and are therefore less profitable\n <br />\n Working for companies is 50% less profitable\n <br />\n Crimes and Infiltration are 25% less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other BitNodes.\n In addition, this Source-File will increase all of your Bladeburner multipliers by:\n <br />\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode8\"] = new BitNode(\n 8,\n 2,\n \"Ghost of Wall Street\",\n \"Money never sleeps\",\n (\n <>\n You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n You start with $250 million\n <br />\n The only way to earn money is by trading on the stock market\n <br />\n You start with a WSE membership and access to the TIX API\n <br />\n You are able to short stocks and place different types of orders (limit/stop)\n <br />\n You can immediately donate to factions to gain reputation\n <br />\n <br />\n Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanent access to WSE and TIX API\n <br />\n Level 2: Ability to short stocks in other BitNodes\n <br />\n Level 3: Ability to use limit/stop orders in other BitNodes\n <br />\n <br />\n This Source-File also increases your hacking growth multipliers by:\n <br />\n Level 1: 12%\n <br />\n Level 2: 18%\n <br />\n Level 3: 21%\n </>\n ),\n);\nBitNodes[\"BitNode9\"] = new BitNode(\n 9,\n 2,\n \"Hacktocracy\",\n \"Hacknet Unleashed\",\n (\n <>\n When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for\n the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global,\n decentralized network used for nefarious purposes. Fulcrum quickly abandoned the project and dissociated\n themselves from it.\n <br />\n <br />\n This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes,\n which can be spent on a variety of different upgrades.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your stats are significantly decreased\n <br />\n You cannnot purchase additional servers\n <br />\n Hacking is significantly less profitable\n <br />\n <br />\n Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n <br />\n <br />\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n <br />\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n <br />\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n <br />\n <br />\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n <br />\n <br />\n This Source-File also increases your hacknet multipliers by:\n <br />\n Level 1: 8%\n <br />\n Level 2: 12%\n <br />\n Level 3: 14%\n </>\n ),\n);\nBitNodes[\"BitNode10\"] = new BitNode(\n 10,\n 2,\n \"Digital Carbon\",\n \"Your body is not who you are\",\n (\n <>\n In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their\n consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the\n digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally\n achieved immortality - at least for those that could afford it.\n <br />\n <br />\n This BitNode unlocks Sleeve technology. Sleeve technology allows you to:\n <br />\n <br />\n 1. Re-sleeve: Purchase and transfer your consciousness into a new body\n <br />\n 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks\n synchronously\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your stats are significantly decreased\n <br />\n All methods of gaining money are half as profitable (except Stock Market)\n <br />\n Purchased servers are more expensive, have less max RAM, and a lower maximum limit\n <br />\n Augmentations are 5x as expensive and require twice as much reputation\n <br />\n <br />\n Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this\n Source-File also grants you a Duplicate Sleeve\n </>\n ),\n);\nBitNodes[\"BitNode11\"] = new BitNode(\n 11,\n 1,\n \"The Big Crash\",\n \"Okay. Sell it all.\",\n (\n <>\n The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around\n the world. It was this period of disorder that eventually lead to the governmental reformation of many global\n superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark\n times, financial catastrophe hit.\n <br />\n <br />\n In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of\n this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic\n banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the\n world is slowly crumbling in the middle of the biggest economic crisis of all time.\n <br />\n <br />\n In this BitNode:\n <br />\n <br />\n Your hacking stat and experience gain are halved\n <br />\n The starting and maximum amount of money available on servers is significantly decreased\n <br />\n The growth rate of servers is significantly reduced\n <br />\n Weakening a server is twice as effective\n <br />\n Company wages are decreased by 50%\n <br />\n Corporation valuations are 90% lower and are therefore significantly less profitable\n <br />\n Hacknet Node production is significantly decreased\n <br />\n Crime and Infiltration are more lucrative\n <br />\n Augmentations are twice as expensive\n <br />\n <br />\n Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and\n reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also\n increases the player's company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n);\nBitNodes[\"BitNode12\"] = new BitNode(\n 12,\n 0,\n \"The Recursion\",\n \"Repeat.\",\n (\n <>\n To iterate is human, to recurse divine.\n <br />\n <br />\n Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you\n Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for\n Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the\n level of this source file.\n </>\n ),\n);\n// Books: Frontera, Shiner\nBitNodes[\"BitNode13\"] = new BitNode(13, 2, \"fOS\", \"COMING SOON\"); //Unlocks the new game mode and the rest of the BitNodes\nBitNodes[\"BitNode14\"] = new BitNode(14, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode15\"] = new BitNode(15, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode16\"] = new BitNode(16, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode17\"] = new BitNode(17, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode18\"] = new BitNode(18, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode19\"] = new BitNode(19, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode20\"] = new BitNode(20, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode21\"] = new BitNode(21, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode22\"] = new BitNode(22, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode23\"] = new BitNode(23, 2, \"\", \"COMING SOON\");\nBitNodes[\"BitNode24\"] = new BitNode(24, 2, \"\", \"COMING SOON\");\n\nexport function initBitNodeMultipliers(p: IPlayer): void {\n if (p.bitNodeN == null) {\n p.bitNodeN = 1;\n }\n for (const mult in BitNodeMultipliers) {\n if (BitNodeMultipliers.hasOwnProperty(mult)) {\n BitNodeMultipliers[mult] = 1;\n }\n }\n\n switch (p.bitNodeN) {\n case 1: // Source Genesis (every multiplier is 1)\n break;\n case 2: // Rise of the Underworld\n BitNodeMultipliers.HackingLevelMultiplier = 0.8;\n BitNodeMultipliers.ServerGrowthRate = 0.8;\n BitNodeMultipliers.ServerMaxMoney = 0.2;\n BitNodeMultipliers.ServerStartingMoney = 0.4;\n BitNodeMultipliers.CrimeMoney = 3;\n BitNodeMultipliers.InfiltrationMoney = 3;\n BitNodeMultipliers.FactionWorkRepGain = 0.5;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.GangKarmaRequirement = 0;\n break;\n case 3: // Corporatocracy\n BitNodeMultipliers.HackingLevelMultiplier = 0.8;\n BitNodeMultipliers.RepToDonateToFaction = 0.5;\n BitNodeMultipliers.AugmentationRepCost = 3;\n BitNodeMultipliers.AugmentationMoneyCost = 3;\n BitNodeMultipliers.ServerMaxMoney = 0.2;\n BitNodeMultipliers.ServerStartingMoney = 0.2;\n BitNodeMultipliers.ServerGrowthRate = 0.2;\n BitNodeMultipliers.ScriptHackMoney = 0.2;\n BitNodeMultipliers.CompanyWorkMoney = 0.25;\n BitNodeMultipliers.CrimeMoney = 0.25;\n BitNodeMultipliers.HacknetNodeMoney = 0.25;\n BitNodeMultipliers.HomeComputerRamCost = 1.5;\n BitNodeMultipliers.PurchasedServerCost = 2;\n BitNodeMultipliers.GangKarmaRequirement = 3;\n break;\n case 4: // The Singularity\n BitNodeMultipliers.ServerMaxMoney = 0.15;\n BitNodeMultipliers.ServerStartingMoney = 0.75;\n BitNodeMultipliers.ScriptHackMoney = 0.2;\n BitNodeMultipliers.CompanyWorkMoney = 0.1;\n BitNodeMultipliers.CrimeMoney = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.05;\n BitNodeMultipliers.CompanyWorkExpGain = 0.5;\n BitNodeMultipliers.ClassGymExpGain = 0.5;\n BitNodeMultipliers.FactionWorkExpGain = 0.5;\n BitNodeMultipliers.HackExpGain = 0.4;\n BitNodeMultipliers.CrimeExpGain = 0.5;\n BitNodeMultipliers.FactionWorkRepGain = 0.75;\n break;\n case 5: // Artificial intelligence\n BitNodeMultipliers.ServerMaxMoney = 2;\n BitNodeMultipliers.ServerStartingSecurity = 2;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.15;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.InfiltrationRep = 1.5;\n BitNodeMultipliers.InfiltrationMoney = 1.5;\n BitNodeMultipliers.AugmentationMoneyCost = 2;\n BitNodeMultipliers.HackExpGain = 0.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n break;\n case 6: // Bladeburner\n BitNodeMultipliers.HackingLevelMultiplier = 0.35;\n BitNodeMultipliers.ServerMaxMoney = 0.4;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n BitNodeMultipliers.ScriptHackMoney = 0.75;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.75;\n BitNodeMultipliers.InfiltrationMoney = 0.75;\n BitNodeMultipliers.CorporationValuation = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.HackExpGain = 0.25;\n BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed\n BitNodeMultipliers.GangKarmaRequirement = 5;\n break;\n case 7: // Bladeburner 2079\n BitNodeMultipliers.BladeburnerRank = 0.6;\n BitNodeMultipliers.BladeburnerSkillCost = 2;\n BitNodeMultipliers.AugmentationMoneyCost = 3;\n BitNodeMultipliers.HackingLevelMultiplier = 0.35;\n BitNodeMultipliers.ServerMaxMoney = 0.4;\n BitNodeMultipliers.ServerStartingMoney = 0.5;\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n BitNodeMultipliers.ScriptHackMoney = 0.5;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.75;\n BitNodeMultipliers.InfiltrationMoney = 0.75;\n BitNodeMultipliers.CorporationValuation = 0.2;\n BitNodeMultipliers.HacknetNodeMoney = 0.2;\n BitNodeMultipliers.FactionPassiveRepGain = 0;\n BitNodeMultipliers.HackExpGain = 0.25;\n BitNodeMultipliers.FourSigmaMarketDataCost = 2;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 2;\n BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed\n BitNodeMultipliers.GangKarmaRequirement = 5;\n break;\n case 8: // Ghost of Wall Street\n BitNodeMultipliers.ScriptHackMoney = 0.3;\n BitNodeMultipliers.ScriptHackMoneyGain = 0;\n BitNodeMultipliers.ManualHackMoney = 0;\n BitNodeMultipliers.CompanyWorkMoney = 0;\n BitNodeMultipliers.CrimeMoney = 0;\n BitNodeMultipliers.HacknetNodeMoney = 0;\n BitNodeMultipliers.InfiltrationMoney = 0;\n BitNodeMultipliers.RepToDonateToFaction = 0;\n BitNodeMultipliers.CorporationValuation = 0;\n BitNodeMultipliers.CodingContractMoney = 0;\n BitNodeMultipliers.GangKarmaRequirement = 10;\n break;\n case 9: // Hacktocracy\n BitNodeMultipliers.HackingLevelMultiplier = 0.4;\n BitNodeMultipliers.StrengthLevelMultiplier = 0.45;\n BitNodeMultipliers.DefenseLevelMultiplier = 0.45;\n BitNodeMultipliers.DexterityLevelMultiplier = 0.45;\n BitNodeMultipliers.AgilityLevelMultiplier = 0.45;\n BitNodeMultipliers.CharismaLevelMultiplier = 0.45;\n BitNodeMultipliers.PurchasedServerLimit = 0;\n BitNodeMultipliers.HomeComputerRamCost = 5;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.1;\n BitNodeMultipliers.HackExpGain = 0.05;\n BitNodeMultipliers.ServerStartingMoney = 0.1;\n BitNodeMultipliers.ServerMaxMoney = 0.1;\n BitNodeMultipliers.ServerStartingSecurity = 2.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n BitNodeMultipliers.FourSigmaMarketDataCost = 5;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 4;\n BitNodeMultipliers.BladeburnerRank = 0.9;\n BitNodeMultipliers.BladeburnerSkillCost = 1.2;\n BitNodeMultipliers.GangKarmaRequirement = 3;\n break;\n case 10: // Digital Carbon\n BitNodeMultipliers.HackingLevelMultiplier = 0.2;\n BitNodeMultipliers.StrengthLevelMultiplier = 0.4;\n BitNodeMultipliers.DefenseLevelMultiplier = 0.4;\n BitNodeMultipliers.DexterityLevelMultiplier = 0.4;\n BitNodeMultipliers.AgilityLevelMultiplier = 0.4;\n BitNodeMultipliers.CharismaLevelMultiplier = 0.4;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.CrimeMoney = 0.5;\n BitNodeMultipliers.HacknetNodeMoney = 0.5;\n BitNodeMultipliers.ManualHackMoney = 0.5;\n BitNodeMultipliers.ScriptHackMoney = 0.5;\n BitNodeMultipliers.CodingContractMoney = 0.5;\n BitNodeMultipliers.InfiltrationMoney = 0.5;\n BitNodeMultipliers.CorporationValuation = 0.5;\n BitNodeMultipliers.AugmentationMoneyCost = 5;\n BitNodeMultipliers.AugmentationRepCost = 2;\n BitNodeMultipliers.HomeComputerRamCost = 1.5;\n BitNodeMultipliers.PurchasedServerCost = 5;\n BitNodeMultipliers.PurchasedServerLimit = 0.6;\n BitNodeMultipliers.PurchasedServerMaxRam = 0.5;\n BitNodeMultipliers.BladeburnerRank = 0.8;\n BitNodeMultipliers.GangKarmaRequirement = 3;\n break;\n case 11: //The Big Crash\n BitNodeMultipliers.HackingLevelMultiplier = 0.5;\n BitNodeMultipliers.HackExpGain = 0.5;\n BitNodeMultipliers.ServerMaxMoney = 0.1;\n BitNodeMultipliers.ServerStartingMoney = 0.1;\n BitNodeMultipliers.ServerGrowthRate = 0.2;\n BitNodeMultipliers.ServerWeakenRate = 2;\n BitNodeMultipliers.CrimeMoney = 3;\n BitNodeMultipliers.CompanyWorkMoney = 0.5;\n BitNodeMultipliers.HacknetNodeMoney = 0.1;\n BitNodeMultipliers.AugmentationMoneyCost = 2;\n BitNodeMultipliers.InfiltrationMoney = 2.5;\n BitNodeMultipliers.InfiltrationRep = 2.5;\n BitNodeMultipliers.CorporationValuation = 0.1;\n BitNodeMultipliers.CodingContractMoney = 0.25;\n BitNodeMultipliers.FourSigmaMarketDataCost = 4;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = 4;\n break;\n case 12: {\n //The Recursion\n let sf12Lvl = 0;\n for (let i = 0; i < p.sourceFiles.length; i++) {\n if (p.sourceFiles[i].n === 12) {\n sf12Lvl = p.sourceFiles[i].lvl;\n }\n }\n const inc = Math.pow(1.02, sf12Lvl);\n const dec = 1 / inc;\n\n // Multiplier for number of augs needed for Daedalus increases\n // up to a maximum of 1.34, which results in 40 Augs required\n BitNodeMultipliers.DaedalusAugsRequirement = Math.min(inc, 1.34);\n\n BitNodeMultipliers.HackingLevelMultiplier = dec;\n BitNodeMultipliers.StrengthLevelMultiplier = dec;\n BitNodeMultipliers.DefenseLevelMultiplier = dec;\n BitNodeMultipliers.DexterityLevelMultiplier = dec;\n BitNodeMultipliers.AgilityLevelMultiplier = dec;\n BitNodeMultipliers.CharismaLevelMultiplier = dec;\n\n BitNodeMultipliers.ServerMaxMoney = dec;\n BitNodeMultipliers.ServerStartingMoney = dec;\n BitNodeMultipliers.ServerGrowthRate = dec;\n BitNodeMultipliers.ServerWeakenRate = dec;\n\n //Does not scale, otherwise security might start at 300+\n BitNodeMultipliers.ServerStartingSecurity = 1.5;\n\n BitNodeMultipliers.HomeComputerRamCost = inc;\n\n BitNodeMultipliers.PurchasedServerCost = inc;\n BitNodeMultipliers.PurchasedServerLimit = dec;\n BitNodeMultipliers.PurchasedServerMaxRam = dec;\n\n BitNodeMultipliers.ManualHackMoney = dec;\n BitNodeMultipliers.ScriptHackMoney = dec;\n BitNodeMultipliers.CompanyWorkMoney = dec;\n BitNodeMultipliers.CrimeMoney = dec;\n BitNodeMultipliers.HacknetNodeMoney = dec;\n BitNodeMultipliers.CodingContractMoney = dec;\n\n BitNodeMultipliers.CompanyWorkExpGain = dec;\n BitNodeMultipliers.ClassGymExpGain = dec;\n BitNodeMultipliers.FactionWorkExpGain = dec;\n BitNodeMultipliers.HackExpGain = dec;\n BitNodeMultipliers.CrimeExpGain = dec;\n\n BitNodeMultipliers.FactionWorkRepGain = dec;\n BitNodeMultipliers.FactionPassiveRepGain = dec;\n BitNodeMultipliers.RepToDonateToFaction = inc;\n\n BitNodeMultipliers.AugmentationRepCost = inc;\n BitNodeMultipliers.AugmentationMoneyCost = inc;\n\n BitNodeMultipliers.InfiltrationMoney = dec;\n BitNodeMultipliers.InfiltrationRep = dec;\n\n BitNodeMultipliers.FourSigmaMarketDataCost = inc;\n BitNodeMultipliers.FourSigmaMarketDataApiCost = inc;\n\n BitNodeMultipliers.CorporationValuation = dec;\n\n BitNodeMultipliers.BladeburnerRank = dec;\n BitNodeMultipliers.BladeburnerSkillCost = inc;\n break;\n }\n default:\n console.warn(\"Player.bitNodeN invalid\");\n break;\n }\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IActionIdentifier } from \"./IActionIdentifier\";\nimport { ActionIdentifier } from \"./ActionIdentifier\";\nimport { ActionTypes } from \"./data/ActionTypes\";\nimport { Growths } from \"./data/Growths\";\nimport { BlackOperations } from \"./BlackOperations\";\nimport { BlackOperation } from \"./BlackOperation\";\nimport { Operation } from \"./Operation\";\nimport { Contract } from \"./Contract\";\nimport { GeneralActions } from \"./GeneralActions\";\nimport { formatNumber } from \"../utils/StringHelperFunctions\";\nimport { Skills } from \"./Skills\";\nimport { Skill } from \"./Skill\";\nimport { City } from \"./City\";\nimport { IAction } from \"./IAction\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } 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 { redPillFlag } from \"../RedPill\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\n\nexport class Bladeburner implements IBladeburner {\n numHosp = 0;\n moneyLost = 0;\n rank = 0;\n maxRank = 0;\n\n skillPoints = 0;\n totalSkillPoints = 0;\n\n teamSize = 0;\n teamLost = 0;\n hpLost = 0;\n\n storedCycles = 0;\n\n randomEventCounter: number = getRandomInt(240, 600);\n\n actionTimeToComplete = 0;\n actionTimeCurrent = 0;\n actionTimeOverflow = 0;\n\n action: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n\n cities: any = {};\n city: string = BladeburnerConstants.CityNames[2];\n skills: any = {};\n skillMultipliers: any = {};\n staminaBonus = 0;\n maxStamina = 0;\n stamina = 0;\n contracts: any = {};\n operations: any = {};\n blackops: any = {};\n logging: any = {\n general: true,\n contracts: true,\n ops: true,\n blackops: true,\n events: true,\n };\n automateEnabled = false;\n automateActionHigh: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshHigh = 0;\n automateActionLow: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshLow = 0;\n consoleHistory: string[] = [];\n consoleLogs: string[] = [\"Bladeburner Console\", \"Type 'help' to see console commands\"];\n\n constructor(player?: IPlayer) {\n for (let i = 0; i < BladeburnerConstants.CityNames.length; ++i) {\n this.cities[BladeburnerConstants.CityNames[i]] = new City(BladeburnerConstants.CityNames[i]);\n }\n\n this.updateSkillMultipliers(); // Calls resetSkillMultipliers()\n\n // Max Stamina is based on stats and Bladeburner-specific bonuses\n if (player) this.calculateMaxStamina(player);\n this.stamina = this.maxStamina;\n this.create();\n }\n\n getCurrentCity(): City {\n const city = this.cities[this.city];\n if (!(city instanceof City)) {\n throw new Error(\"Bladeburner.getCurrentCity() did not properly return a City object\");\n }\n return city;\n }\n\n calculateStaminaPenalty(): number {\n return Math.min(1, this.stamina / (0.5 * this.maxStamina));\n }\n\n startAction(player: IPlayer, actionId: IActionIdentifier): void {\n if (actionId == null) return;\n this.action = actionId;\n this.actionTimeCurrent = 0;\n switch (actionId.type) {\n case ActionTypes[\"Idle\"]:\n this.actionTimeToComplete = 0;\n break;\n case ActionTypes[\"Contract\"]:\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Contract Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this);\n } catch (e) {\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().commsEst === 0) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this);\n } catch (e) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n // Safety measure - don't repeat BlackOps that are already done\n if (this.blackops[actionId.name] != null) {\n this.resetAction();\n this.log(\"Error: Tried to start a Black Operation that had already been completed\");\n break;\n }\n\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get BlackOperation object for: \" + actionId.name);\n }\n this.actionTimeToComplete = action.getActionTime(this);\n } catch (e) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]:\n this.actionTimeToComplete = this.getRecruitmentTime(player);\n break;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]:\n this.actionTimeToComplete = 30;\n break;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n this.actionTimeToComplete = 60;\n break;\n default:\n throw new Error(\"Invalid Action Type in startAction(Bladeburner,player, ): \" + actionId.type);\n break;\n }\n }\n\n upgradeSkill(skill: Skill): void {\n // This does NOT handle deduction of skill points\n const skillName = skill.name;\n if (this.skills[skillName]) {\n ++this.skills[skillName];\n } else {\n this.skills[skillName] = 1;\n }\n if (isNaN(this.skills[skillName]) || this.skills[skillName] < 0) {\n throw new Error(\"Level of Skill \" + skillName + \" is invalid: \" + this.skills[skillName]);\n }\n this.updateSkillMultipliers();\n }\n\n executeConsoleCommands(player: IPlayer, commands: string): void {\n try {\n // Console History\n if (this.consoleHistory[this.consoleHistory.length - 1] != commands) {\n this.consoleHistory.push(commands);\n if (this.consoleHistory.length > 50) {\n this.consoleHistory.splice(0, 1);\n }\n }\n\n const arrayOfCommands = commands.split(\";\");\n for (let i = 0; i < arrayOfCommands.length; ++i) {\n this.executeConsoleCommand(player, arrayOfCommands[i]);\n }\n } catch (e) {\n exceptionAlert(e);\n }\n }\n\n postToConsole(input: string, saveToLogs = true): void {\n const MaxConsoleEntries = 100;\n if (saveToLogs) {\n this.consoleLogs.push(input);\n if (this.consoleLogs.length > MaxConsoleEntries) {\n this.consoleLogs.shift();\n }\n }\n }\n\n log(input: string): void {\n // Adds a timestamp and then just calls postToConsole\n this.postToConsole(`[${getTimestamp()}] ${input}`);\n }\n\n resetAction(): void {\n this.action = new ActionIdentifier({ type: ActionTypes.Idle });\n }\n\n clearConsole(): void {\n this.consoleLogs.length = 0;\n }\n\n prestige(): void {\n this.resetAction();\n const bladeburnerFac = Factions[\"Bladeburners\"];\n if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n }\n }\n\n storeCycles(numCycles = 0): void {\n this.storedCycles += numCycles;\n }\n\n // working on\n getActionIdFromTypeAndName(type = \"\", name = \"\"): IActionIdentifier | null {\n if (type === \"\" || name === \"\") {\n return null;\n }\n const action = new ActionIdentifier();\n const convertedType = type.toLowerCase().trim();\n const convertedName = name.toLowerCase().trim();\n switch (convertedType) {\n case \"contract\":\n case \"contracts\":\n case \"contr\":\n action.type = ActionTypes[\"Contract\"];\n if (this.contracts.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"operation\":\n case \"operations\":\n case \"op\":\n case \"ops\":\n action.type = ActionTypes[\"Operation\"];\n if (this.operations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"blackoperation\":\n case \"black operation\":\n case \"black operations\":\n case \"black op\":\n case \"black ops\":\n case \"blackop\":\n case \"blackops\":\n action.type = ActionTypes[\"BlackOp\"];\n if (BlackOperations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n } else {\n return null;\n }\n break;\n case \"general\":\n case \"general action\":\n case \"gen\":\n break;\n default:\n return null;\n }\n\n if (convertedType.startsWith(\"gen\")) {\n switch (convertedName) {\n case \"training\":\n action.type = ActionTypes[\"Training\"];\n action.name = \"Training\";\n break;\n case \"recruitment\":\n case \"recruit\":\n action.type = ActionTypes[\"Recruitment\"];\n action.name = \"Recruitment\";\n break;\n case \"field analysis\":\n case \"fieldanalysis\":\n action.type = ActionTypes[\"Field Analysis\"];\n action.name = \"Field Analysis\";\n break;\n case \"diplomacy\":\n action.type = ActionTypes[\"Diplomacy\"];\n action.name = \"Diplomacy\";\n break;\n case \"hyperbolic regeneration chamber\":\n action.type = ActionTypes[\"Hyperbolic Regeneration Chamber\"];\n action.name = \"Hyperbolic Regeneration Chamber\";\n break;\n 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 }\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 (this.skillPoints >= pointCost) {\n this.skillPoints -= pointCost;\n this.upgradeSkill(skill);\n this.log(skill.name + \" upgraded to Level \" + this.skills[skillName]);\n } else {\n this.postToConsole(\n \"You do not have enough Skill Points to upgrade this. You need \" + formatNumber(pointCost, 0),\n );\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n default: {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n }\n }\n\n executeLogConsoleCommand(args: string[]): void {\n if (args.length < 3) {\n this.postToConsole(\"Invalid usage of log command: log [enable/disable] [action/event]\");\n this.postToConsole(\"Use 'help log' for more details and examples\");\n return;\n }\n\n let flag = true;\n if (args[1].toLowerCase().includes(\"d\")) {\n flag = false;\n } // d for disable\n\n switch (args[2].toLowerCase()) {\n case \"general\":\n case \"gen\":\n this.logging.general = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for general actions\");\n break;\n case \"contract\":\n case \"contracts\":\n this.logging.contracts = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Contracts\");\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n this.logging.ops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Operations\");\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n this.logging.blackops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for BlackOps\");\n break;\n case \"event\":\n case \"events\":\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for events\");\n break;\n case \"all\":\n this.logging.general = flag;\n this.logging.contracts = flag;\n this.logging.ops = flag;\n this.logging.blackops = flag;\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for everything\");\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[2]);\n this.postToConsole(\n \"Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]\",\n );\n break;\n }\n }\n\n executeHelpConsoleCommand(args: string[]): void {\n if (args.length === 1) {\n for (const line of ConsoleHelpText.helpList) {\n this.postToConsole(line);\n }\n } else {\n for (let i = 1; i < args.length; ++i) {\n if (!(args[i] in ConsoleHelpText)) continue;\n const helpText = ConsoleHelpText[args[i]];\n for (const line of helpText) {\n this.postToConsole(line);\n }\n }\n }\n }\n\n executeAutomateConsoleCommand(args: string[]): void {\n if (args.length !== 2 && args.length !== 4) {\n this.postToConsole(\n \"Invalid use of 'automate' command: automate [var] [val] [hi/low]. Use 'help automate' for more info\",\n );\n return;\n }\n\n // Enable/Disable\n if (args.length === 2) {\n const flag = args[1];\n if (flag.toLowerCase() === \"status\") {\n this.postToConsole(\"Automation: \" + (this.automateEnabled ? \"enabled\" : \"disabled\"));\n this.postToConsole(\n \"When your stamina drops to \" +\n formatNumber(this.automateThreshLow, 0) +\n \", you will automatically switch to \" +\n this.automateActionLow.name +\n \". When your stamina recovers to \" +\n formatNumber(this.automateThreshHigh, 0) +\n \", you will automatically \" +\n \"switch to \" +\n this.automateActionHigh.name +\n \".\",\n );\n } else if (flag.toLowerCase().includes(\"en\")) {\n if (\n !(this.automateActionLow instanceof ActionIdentifier) ||\n !(this.automateActionHigh instanceof ActionIdentifier)\n ) {\n return this.log(\"Failed to enable automation. Actions were not set\");\n }\n this.automateEnabled = true;\n this.log(\"Bladeburner automation enabled\");\n } else if (flag.toLowerCase().includes(\"d\")) {\n this.automateEnabled = false;\n this.log(\"Bladeburner automation disabled\");\n } else {\n this.log(\"Invalid argument for 'automate' console command: \" + args[1]);\n }\n return;\n }\n\n // Set variables\n if (args.length === 4) {\n const variable = args[1];\n const val = args[2];\n\n let highLow = false; // True for high, false for low\n if (args[3].toLowerCase().includes(\"hi\")) {\n highLow = true;\n }\n\n switch (variable) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes[val],\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + val);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Contract,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + val);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Operation,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + val);\n }\n break;\n case \"stamina\":\n if (isNaN(parseFloat(val))) {\n this.postToConsole(\"Invalid value specified for stamina threshold (must be numeric): \" + val);\n } else {\n if (highLow) {\n this.automateThreshHigh = Number(val);\n } else {\n this.automateThreshLow = Number(val);\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") stamina threshold set to \" + val);\n }\n break;\n default:\n break;\n }\n\n return;\n }\n }\n\n parseCommandArguments(command: string): string[] {\n /**\n * Returns an array with command and its arguments in each index.\n * e.g. skill \"blade's intuition\" foo returns [skill, blade's intuition, foo]\n * The input to the fn will be trimmed and will have all whitespace replaced w/ a single space\n */\n const args = [];\n let start = 0;\n let i = 0;\n while (i < command.length) {\n const c = command.charAt(i);\n if (c === '\"') {\n // Double quotes\n const endQuote = command.indexOf('\"', i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === \"'\") {\n // Single quotes, same thing as above\n const endQuote = command.indexOf(\"'\", i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === \" \") {\n args.push(command.substr(start, i - start));\n start = i + 1;\n }\n ++i;\n }\n if (start !== i) {\n args.push(command.substr(start, i - start));\n }\n return args;\n }\n\n executeConsoleCommand(player: IPlayer, command: string): void {\n command = command.trim();\n command = command.replace(/\\s\\s+/g, \" \"); // Replace all whitespace w/ a single space\n\n const args = this.parseCommandArguments(command);\n if (args.length <= 0) return; // Log an error?\n\n switch (args[0].toLowerCase()) {\n case \"automate\":\n this.executeAutomateConsoleCommand(args);\n break;\n case \"clear\":\n case \"cls\":\n this.clearConsole();\n break;\n case \"help\":\n this.executeHelpConsoleCommand(args);\n break;\n case \"log\":\n this.executeLogConsoleCommand(args);\n break;\n case \"skill\":\n this.executeSkillConsoleCommand(args);\n break;\n case \"start\":\n this.executeStartConsoleCommand(player, args);\n break;\n case \"stop\":\n this.resetAction();\n break;\n default:\n this.postToConsole(\"Invalid console command\");\n break;\n }\n }\n\n triggerMigration(sourceCityName: string): void {\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n const sourceCity = this.cities[sourceCityName];\n if (destCity == null || sourceCity == null) {\n throw new Error(\"Failed to find City with name: \" + destCityName);\n }\n const rand = Math.random();\n let percentage = getRandomInt(3, 15) / 100;\n\n if (rand < 0.05 && sourceCity.comms > 0) {\n // 5% chance for community migration\n percentage *= getRandomInt(2, 4); // Migration increases population change\n --sourceCity.comms;\n ++destCity.comms;\n }\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n }\n\n triggerPotentialMigration(sourceCityName: string, chance: number): void {\n if (chance == null || isNaN(chance)) {\n console.error(\"Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()\");\n }\n if (chance > 1) {\n chance /= 100;\n }\n if (Math.random() < chance) {\n this.triggerMigration(sourceCityName);\n }\n }\n\n randomEvent(): void {\n const chance = Math.random();\n\n // Choose random source/destination city for events\n const sourceCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n const sourceCity = this.cities[sourceCityName];\n if (!(sourceCity instanceof City)) {\n throw new Error(\"sourceCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n\n if (!(sourceCity instanceof City) || !(destCity instanceof City)) {\n throw new Error(\"sourceCity/destCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n if (chance <= 0.05) {\n // New Synthoid Community, 5%\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else if (chance <= 0.1) {\n // Synthoid Community Migration, 5%\n if (sourceCity.comms <= 0) {\n // If no comms in source city, then instead trigger a new Synthoid community event\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else {\n --sourceCity.comms;\n ++destCity.comms;\n\n // Change pop\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a Synthoid community migrated from \" + sourceCityName + \" to some other city\",\n );\n }\n }\n } else if (chance <= 0.3) {\n // New Synthoids (non community), 20%\n const percentage = getRandomInt(8, 24) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n } else if (chance <= 0.5) {\n // Synthoid migration (non community) 20%\n this.triggerMigration(sourceCityName);\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a large number of Synthoids migrated from \" +\n sourceCityName +\n \" to some other city\",\n );\n }\n } else if (chance <= 0.7) {\n // Synthoid Riots (+chaos), 20%\n sourceCity.chaos += 1;\n sourceCity.chaos *= 1 + getRandomInt(5, 20) / 100;\n if (this.logging.events) {\n this.log(\"Tensions between Synthoids and humans lead to riots in \" + sourceCityName + \"! Chaos increased\");\n }\n } else if (chance <= 0.9) {\n // Less Synthoids, 20%\n const percentage = getRandomInt(8, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n }\n // 10% chance of nothing happening\n }\n\n /**\n * Process stat gains from Contracts, Operations, and Black Operations\n * @param action(Action obj) - Derived action class\n * @param success(bool) - Whether action was successful\n */\n gainActionStats(player: IPlayer, action: IAction, success: boolean): void {\n const difficulty = action.getDifficulty();\n\n /**\n * Gain multiplier based on difficulty. If it changes then the\n * same variable calculated in completeAction() needs to change too\n */\n const difficultyMult =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n const time = this.actionTimeToComplete;\n const successMult = success ? 1 : 0.5;\n\n const unweightedGain = time * BladeburnerConstants.BaseStatGain * successMult * difficultyMult;\n const unweightedIntGain = time * BladeburnerConstants.BaseIntGain * successMult * difficultyMult;\n const skillMult = this.skillMultipliers.expGain;\n player.gainHackingExp(unweightedGain * action.weights.hack * player.hacking_exp_mult * skillMult);\n player.gainStrengthExp(unweightedGain * action.weights.str * player.strength_exp_mult * skillMult);\n player.gainDefenseExp(unweightedGain * action.weights.def * player.defense_exp_mult * skillMult);\n player.gainDexterityExp(unweightedGain * action.weights.dex * player.dexterity_exp_mult * skillMult);\n player.gainAgilityExp(unweightedGain * action.weights.agi * player.agility_exp_mult * skillMult);\n player.gainCharismaExp(unweightedGain * action.weights.cha * player.charisma_exp_mult * skillMult);\n let intExp = unweightedIntGain * action.weights.int * skillMult;\n if (intExp > 1) {\n intExp = Math.pow(intExp, 0.8);\n }\n player.gainIntelligenceExp(intExp);\n }\n\n getDiplomacyEffectiveness(player: IPlayer): number {\n // Returns a decimal by which the city's chaos level should be multiplied (e.g. 0.98)\n const CharismaLinearFactor = 1e3;\n const CharismaExponentialFactor = 0.045;\n\n const charismaEff = Math.pow(player.charisma, CharismaExponentialFactor) + player.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(player: IPlayer): number {\n return Math.pow(player.charisma, 0.45) / (this.teamSize + 1);\n }\n\n getRecruitmentTime(player: IPlayer): number {\n const effCharisma = player.charisma * this.skillMultipliers.effCha;\n const charismaFactor = Math.pow(effCharisma, 0.81) + effCharisma / 90;\n return Math.max(10, Math.round(BladeburnerConstants.BaseRecruitmentTimeNeeded - charismaFactor));\n }\n\n resetSkillMultipliers(): void {\n this.skillMultipliers = {\n successChanceAll: 1,\n successChanceStealth: 1,\n successChanceKill: 1,\n successChanceContract: 1,\n successChanceOperation: 1,\n successChanceEstimate: 1,\n actionTime: 1,\n effHack: 1,\n effStr: 1,\n effDef: 1,\n effDex: 1,\n effAgi: 1,\n effCha: 1,\n effInt: 1,\n stamina: 1,\n money: 1,\n expGain: 1,\n };\n }\n\n updateSkillMultipliers(): void {\n this.resetSkillMultipliers();\n for (const skillName in this.skills) {\n if (this.skills.hasOwnProperty(skillName)) {\n const skill = Skills[skillName];\n if (skill == null) {\n throw new Error(\"Could not find Skill Object for: \" + skillName);\n }\n const level = this.skills[skillName];\n if (level == null || level <= 0) {\n continue;\n } //Not upgraded\n\n const multiplierNames = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multiplierNames.length; ++i) {\n const multiplierName = multiplierNames[i];\n if (skill.getMultiplier(multiplierName) != null && !isNaN(skill.getMultiplier(multiplierName))) {\n const value = skill.getMultiplier(multiplierName) * level;\n let multiplierValue = 1 + value / 100;\n if (multiplierName === \"actionTime\") {\n multiplierValue = 1 - value / 100;\n }\n this.skillMultipliers[multiplierName] *= multiplierValue;\n }\n }\n }\n }\n }\n\n completeOperation(success: boolean): void {\n if (this.action.type !== ActionTypes.Operation) {\n throw new Error(\"completeOperation() called even though current action is not an Operation\");\n }\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n\n // Calculate team losses\n const teamCount = action.teamCount;\n if (teamCount >= 1) {\n let max;\n if (success) {\n max = Math.ceil(teamCount / 2);\n } else {\n max = Math.floor(teamCount);\n }\n const losses = getRandomInt(0, max);\n this.teamSize -= losses;\n this.teamLost += losses;\n if (this.logging.ops && losses > 0) {\n this.log(\"Lost \" + formatNumber(losses, 0) + \" team members during this \" + action.name);\n }\n }\n\n const city = this.getCurrentCity();\n switch (action.name) {\n case \"Investigation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.4 * this.skillMultipliers.successChanceEstimate);\n if (Math.random() < 0.02 * this.skillMultipliers.successChanceEstimate) {\n city.improveCommunityEstimate(1);\n }\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 if (Math.random() < 0.02 * this.skillMultipliers.successChanceEstimate) {\n city.improveCommunityEstimate(1);\n }\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 --city.commsEst;\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 default:\n return null;\n }\n }\n\n completeContract(success: boolean): void {\n if (this.action.type !== ActionTypes.Contract) {\n throw new Error(\"completeContract() called even though current action is not a Contract\");\n }\n const city = this.getCurrentCity();\n if (success) {\n switch (this.action.name) {\n case \"Tracking\":\n // Increase estimate accuracy by a relatively small amount\n city.improvePopulationEstimateByCount(getRandomInt(100, 1e3));\n break;\n case \"Bounty Hunter\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.02);\n break;\n case \"Retirement\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.04);\n break;\n default:\n throw new Error(\"Invalid Action name in completeContract: \" + this.action.name);\n }\n }\n }\n\n completeAction(router: IRouter, player: IPlayer): void {\n switch (this.action.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]: {\n try {\n const isOperation = this.action.type === ActionTypes[\"Operation\"];\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Process Contract/Operation success/failure\n if (action.attempt(this)) {\n this.gainActionStats(player, action, true);\n ++action.successes;\n --action.count;\n\n // Earn money for contracts\n let moneyGain = 0;\n if (!isOperation) {\n moneyGain = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * this.skillMultipliers.money;\n player.gainMoney(moneyGain);\n player.recordMoneySource(moneyGain, \"bladeburner\");\n }\n\n if (isOperation) {\n action.setMaxLevel(BladeburnerConstants.OperationSuccessesPerLevel);\n } else {\n action.setMaxLevel(BladeburnerConstants.ContractSuccessesPerLevel);\n }\n if (action.rankGain) {\n const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(player, gain);\n if (isOperation && this.logging.ops) {\n this.log(action.name + \" successfully completed! Gained \" + formatNumber(gain, 3) + \" rank\");\n } else if (!isOperation && this.logging.contracts) {\n this.log(\n action.name +\n \" contract successfully completed! Gained \" +\n formatNumber(gain, 3) +\n \" rank and \" +\n numeralWrapper.formatMoney(moneyGain),\n );\n }\n }\n isOperation ? this.completeOperation(true) : this.completeContract(true);\n } else {\n this.gainActionStats(player, action, false);\n ++action.failures;\n let loss = 0,\n damage = 0;\n if (action.rankLoss) {\n loss = addOffset(action.rankLoss * rewardMultiplier, 10);\n this.changeRank(player, -1 * loss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n this.hpLost += damage;\n const cost = calculateHospitalizationCost(player, damage);\n if (player.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n let logLossText = \"\";\n if (loss > 0) {\n logLossText += \"Lost \" + formatNumber(loss, 3) + \" rank. \";\n }\n if (damage > 0) {\n logLossText += \"Took \" + formatNumber(damage, 0) + \" damage.\";\n }\n if (isOperation && this.logging.ops) {\n this.log(action.name + \" failed! \" + logLossText);\n } else if (!isOperation && this.logging.contracts) {\n this.log(action.name + \" contract failed! \" + logLossText);\n }\n isOperation ? this.completeOperation(false) : this.completeContract(false);\n }\n if (action.autoLevel) {\n action.level = action.maxLevel;\n } // Autolevel\n this.startAction(player, this.action); // Repeat action\n } catch (e) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const action = this.getActionObject(this.action);\n if (action == null || !(action instanceof BlackOperation)) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + this.action.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Team loss variables\n const teamCount = action.teamCount;\n let teamLossMax;\n\n if (action.attempt(this)) {\n this.gainActionStats(player, action, true);\n action.count = 0;\n this.blackops[action.name] = true;\n let rankGain = 0;\n if (action.rankGain) {\n rankGain = addOffset(action.rankGain * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(player, rankGain);\n }\n teamLossMax = Math.ceil(teamCount / 2);\n\n // Operation Daedalus\n if (action.name === \"Operation Daedalus\") {\n this.resetAction();\n return router.toBitVerse(false, false);\n }\n\n if (this.logging.blackops) {\n this.log(action.name + \" successful! Gained \" + formatNumber(rankGain, 1) + \" rank\");\n }\n } else {\n this.gainActionStats(player, action, false);\n let rankLoss = 0;\n let damage = 0;\n if (action.rankLoss) {\n rankLoss = addOffset(action.rankLoss, 10);\n this.changeRank(player, -1 * rankLoss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n const cost = calculateHospitalizationCost(player, damage);\n if (player.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n teamLossMax = Math.floor(teamCount);\n\n if (this.logging.blackops) {\n this.log(\n action.name +\n \" failed! Lost \" +\n formatNumber(rankLoss, 1) +\n \" rank and took \" +\n formatNumber(damage, 0) +\n \" damage\",\n );\n }\n }\n\n this.resetAction(); // Stop regardless of success or fail\n\n // Calculate team lossses\n if (teamCount >= 1) {\n const losses = getRandomInt(1, teamLossMax);\n this.teamSize -= losses;\n this.teamLost += losses;\n if (this.logging.blackops) {\n this.log(\"You lost \" + formatNumber(losses, 0) + \" team members during \" + action.name);\n }\n }\n } catch (e) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Training\"]: {\n this.stamina -= 0.5 * BladeburnerConstants.BaseStaminaLoss;\n const strExpGain = 30 * player.strength_exp_mult,\n defExpGain = 30 * player.defense_exp_mult,\n dexExpGain = 30 * player.dexterity_exp_mult,\n agiExpGain = 30 * player.agility_exp_mult,\n staminaGain = 0.04 * this.skillMultipliers.stamina;\n player.gainStrengthExp(strExpGain);\n player.gainDefenseExp(defExpGain);\n player.gainDexterityExp(dexExpGain);\n player.gainAgilityExp(agiExpGain);\n this.staminaBonus += staminaGain;\n if (this.logging.general) {\n this.log(\n \"Training completed. Gained: \" +\n formatNumber(strExpGain, 1) +\n \" str exp, \" +\n formatNumber(defExpGain, 1) +\n \" def exp, \" +\n formatNumber(dexExpGain, 1) +\n \" dex exp, \" +\n formatNumber(agiExpGain, 1) +\n \" agi exp, \" +\n formatNumber(staminaGain, 3) +\n \" max stamina\",\n );\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]: {\n // Does not use stamina. Effectiveness depends on hacking, int, and cha\n let eff =\n 0.04 * Math.pow(player.hacking_skill, 0.3) +\n 0.04 * Math.pow(player.intelligence, 0.9) +\n 0.02 * Math.pow(player.charisma, 0.3);\n eff *= player.bladeburner_analysis_mult;\n if (isNaN(eff) || eff < 0) {\n throw new Error(\"Field Analysis Effectiveness calculated to be NaN or negative\");\n }\n const hackingExpGain = 20 * player.hacking_exp_mult,\n charismaExpGain = 20 * player.charisma_exp_mult;\n player.gainHackingExp(hackingExpGain);\n player.gainIntelligenceExp(BladeburnerConstants.BaseIntGain);\n player.gainCharismaExp(charismaExpGain);\n this.changeRank(player, 0.1 * BitNodeMultipliers.BladeburnerRank);\n this.getCurrentCity().improvePopulationEstimateByPercentage(eff * this.skillMultipliers.successChanceEstimate);\n if (this.logging.general) {\n this.log(\n \"Field analysis completed. Gained 0.1 rank, \" +\n formatNumber(hackingExpGain, 1) +\n \" hacking exp, and \" +\n formatNumber(charismaExpGain, 1) +\n \" charisma exp\",\n );\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"Recruitment\"]: {\n const successChance = this.getRecruitmentSuccessChance(player);\n if (Math.random() < successChance) {\n const expGain = 2 * BladeburnerConstants.BaseStatGain * this.actionTimeToComplete;\n player.gainCharismaExp(expGain);\n ++this.teamSize;\n if (this.logging.general) {\n this.log(\"Successfully recruited a team member! Gained \" + formatNumber(expGain, 1) + \" charisma exp\");\n }\n } else {\n const expGain = BladeburnerConstants.BaseStatGain * this.actionTimeToComplete;\n player.gainCharismaExp(expGain);\n if (this.logging.general) {\n this.log(\"Failed to recruit a team member. Gained \" + formatNumber(expGain, 1) + \" charisma exp\");\n }\n }\n this.startAction(player, this.action); // Repeat action\n break;\n }\n case ActionTypes[\"Diplomacy\"]: {\n const eff = this.getDiplomacyEffectiveness(player);\n this.getCurrentCity().chaos *= eff;\n if (this.getCurrentCity().chaos < 0) {\n this.getCurrentCity().chaos = 0;\n }\n if (this.logging.general) {\n this.log(\n `Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(1 - eff)}`,\n );\n }\n this.startAction(player, this.action); // Repeat Action\n break;\n }\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]: {\n player.regenerateHp(BladeburnerConstants.HrcHpGain);\n\n const staminaGain = this.maxStamina * (BladeburnerConstants.HrcStaminaGain / 100);\n this.stamina = Math.min(this.maxStamina, this.stamina + staminaGain);\n this.startAction(player, this.action);\n if (this.logging.general) {\n this.log(\n `Rested in Hyperbolic Regeneration Chamber. Restored ${\n BladeburnerConstants.HrcHpGain\n } HP and gained ${numeralWrapper.formatStamina(staminaGain)} stamina`,\n );\n }\n break;\n }\n default:\n console.error(`Bladeburner.completeAction() called for invalid action: ${this.action.type}`);\n break;\n }\n }\n\n changeRank(player: IPlayer, change: number): void {\n if (isNaN(change)) {\n throw new Error(\"NaN passed into Bladeburner.changeRank()\");\n }\n this.rank += change;\n if (this.rank < 0) {\n this.rank = 0;\n }\n this.maxRank = Math.max(this.rank, this.maxRank);\n\n const bladeburnersFactionName = \"Bladeburners\";\n if (factionExists(bladeburnersFactionName)) {\n const bladeburnerFac = Factions[bladeburnersFactionName];\n if (!(bladeburnerFac instanceof Faction)) {\n throw new Error(\"Could not properly get Bladeburner Faction object in Bladeburner UI Overview Faction button\");\n }\n if (bladeburnerFac.isMember) {\n const favorBonus = 1 + bladeburnerFac.favor / 100;\n bladeburnerFac.playerReputation +=\n BladeburnerConstants.RankToFactionRepFactor * change * player.faction_rep_mult * favorBonus;\n }\n }\n\n // Gain skill points\n const rankNeededForSp = (this.totalSkillPoints + 1) * BladeburnerConstants.RanksPerSkillPoint;\n if (this.maxRank >= rankNeededForSp) {\n // Calculate how many skill points to gain\n const gainedSkillPoints = Math.floor(\n (this.maxRank - rankNeededForSp) / BladeburnerConstants.RanksPerSkillPoint + 1,\n );\n this.skillPoints += gainedSkillPoints;\n this.totalSkillPoints += gainedSkillPoints;\n }\n }\n\n processAction(router: IRouter, player: IPlayer, seconds: number): void {\n if (this.action.type === ActionTypes[\"Idle\"]) return;\n if (this.actionTimeToComplete <= 0) {\n throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);\n }\n if (!(this.action instanceof ActionIdentifier)) {\n throw new Error(\"Bladeburner.action is not an ActionIdentifier Object\");\n }\n\n // If the previous action went past its completion time, add to the next action\n // This is not added inmediatly in case the automation changes the action\n this.actionTimeCurrent += seconds + this.actionTimeOverflow;\n this.actionTimeOverflow = 0;\n if (this.actionTimeCurrent >= this.actionTimeToComplete) {\n this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete;\n return this.completeAction(router, player);\n }\n }\n\n calculateStaminaGainPerSecond(player: IPlayer): number {\n const effAgility = player.agility * this.skillMultipliers.effAgi;\n const maxStaminaBonus = this.maxStamina / BladeburnerConstants.MaxStaminaToGainFactor;\n const gain = (BladeburnerConstants.StaminaGainPerSecond + maxStaminaBonus) * Math.pow(effAgility, 0.17);\n return gain * (this.skillMultipliers.stamina * player.bladeburner_stamina_gain_mult);\n }\n\n calculateMaxStamina(player: IPlayer): void {\n const effAgility = player.agility * this.skillMultipliers.effAgi;\n const maxStamina =\n (Math.pow(effAgility, 0.8) + this.staminaBonus) *\n this.skillMultipliers.stamina *\n player.bladeburner_max_stamina_mult;\n if (this.maxStamina !== maxStamina) {\n const oldMax = this.maxStamina;\n this.maxStamina = maxStamina;\n this.stamina = (this.maxStamina * this.stamina) / oldMax;\n }\n if (isNaN(maxStamina)) {\n throw new Error(\"Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()\");\n }\n }\n\n create(): void {\n this.contracts[\"Tracking\"] = new Contract({\n name: \"Tracking\",\n baseDifficulty: 125,\n difficultyFac: 1.02,\n rewardFac: 1.041,\n rankGain: 0.3,\n hpLoss: 0.5,\n count: getRandomInt(25, 150),\n weights: {\n hack: 0,\n str: 0.05,\n def: 0.05,\n dex: 0.35,\n agi: 0.35,\n cha: 0.1,\n int: 0.05,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.9,\n int: 1,\n },\n isStealth: true,\n });\n this.contracts[\"Bounty Hunter\"] = new Contract({\n name: \"Bounty Hunter\",\n baseDifficulty: 250,\n difficultyFac: 1.04,\n rewardFac: 1.085,\n rankGain: 0.9,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.15,\n def: 0.15,\n dex: 0.25,\n agi: 0.25,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n this.contracts[\"Retirement\"] = new Contract({\n name: \"Retirement\",\n baseDifficulty: 200,\n difficultyFac: 1.03,\n rewardFac: 1.065,\n rankGain: 0.6,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n\n this.operations[\"Investigation\"] = new Operation({\n name: \"Investigation\",\n baseDifficulty: 400,\n difficultyFac: 1.03,\n rewardFac: 1.07,\n reqdRank: 25,\n rankGain: 2.2,\n rankLoss: 0.2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.1,\n cha: 0.25,\n int: 0.1,\n },\n decays: {\n hack: 0.85,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Undercover Operation\"] = new Operation({\n name: \"Undercover Operation\",\n baseDifficulty: 500,\n difficultyFac: 1.04,\n rewardFac: 1.09,\n reqdRank: 100,\n rankGain: 4.4,\n rankLoss: 0.4,\n hpLoss: 2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.2,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.2,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Sting Operation\"] = new Operation({\n name: \"Sting Operation\",\n baseDifficulty: 650,\n difficultyFac: 1.04,\n rewardFac: 1.095,\n reqdRank: 500,\n rankGain: 5.5,\n rankLoss: 0.5,\n hpLoss: 2.5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.25,\n agi: 0.1,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.85,\n def: 0.85,\n dex: 0.85,\n agi: 0.85,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Raid\"] = new Operation({\n name: \"Raid\",\n baseDifficulty: 800,\n difficultyFac: 1.045,\n rewardFac: 1.1,\n reqdRank: 3000,\n rankGain: 55,\n rankLoss: 2.5,\n hpLoss: 50,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isKill: true,\n });\n this.operations[\"Stealth Retirement Operation\"] = new Operation({\n name: \"Stealth Retirement Operation\",\n baseDifficulty: 1000,\n difficultyFac: 1.05,\n rewardFac: 1.11,\n reqdRank: 20e3,\n rankGain: 22,\n rankLoss: 2,\n hpLoss: 10,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isStealth: true,\n isKill: true,\n });\n this.operations[\"Assassination\"] = new Operation({\n name: \"Assassination\",\n baseDifficulty: 1500,\n difficultyFac: 1.06,\n rewardFac: 1.14,\n reqdRank: 50e3,\n rankGain: 44,\n rankLoss: 4,\n hpLoss: 5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.8,\n },\n isStealth: true,\n isKill: true,\n });\n }\n\n process(router: IRouter, player: IPlayer): void {\n // Edge case condition...if Operation Daedalus is complete trigger the BitNode\n if (redPillFlag === false && this.blackops.hasOwnProperty(\"Operation Daedalus\")) {\n return router.toBitVerse(false, false);\n }\n\n // If the Player starts doing some other actions, set action to idle and alert\n if (Augmentations[AugmentationNames.BladesSimulacrum].owned === false && player.isWorking) {\n if (this.action.type !== ActionTypes[\"Idle\"]) {\n let msg = \"Your Bladeburner action was cancelled because you started doing something else.\";\n if (this.automateEnabled) {\n msg += `<br /><br />Your automation was disabled as well. You will have to re-enable it through the Bladeburner console`;\n this.automateEnabled = false;\n }\n if (!Settings.SuppressBladeburnerPopup) {\n dialogBoxCreate(msg);\n }\n }\n this.resetAction();\n }\n\n // If the Player has no Stamina, set action to idle\n if (this.stamina <= 0) {\n this.log(\"Your Bladeburner action was cancelled because your stamina hit 0\");\n this.resetAction();\n }\n\n // A 'tick' for this mechanic is one second (= 5 game cycles)\n if (this.storedCycles >= BladeburnerConstants.CyclesPerSecond) {\n let seconds = Math.floor(this.storedCycles / BladeburnerConstants.CyclesPerSecond);\n seconds = Math.min(seconds, 5); // Max of 5 'ticks'\n this.storedCycles -= seconds * BladeburnerConstants.CyclesPerSecond;\n\n // Stamina\n this.calculateMaxStamina(player);\n this.stamina += this.calculateStaminaGainPerSecond(player) * seconds;\n this.stamina = Math.min(this.maxStamina, this.stamina);\n\n // Count increase for contracts/operations\n for (const contract of Object.values(this.contracts) as Contract[]) {\n const growthF = Growths[contract.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${contract.name}' is undefined`);\n contract.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const op of Object.values(this.operations) as Operation[]) {\n const growthF = Growths[op.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${op.name}' is undefined`);\n if (growthF !== undefined) {\n op.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n }\n\n // Chaos goes down very slowly\n for (const cityName of BladeburnerConstants.CityNames) {\n const city = this.cities[cityName];\n if (!(city instanceof City)) {\n throw new Error(\"Invalid City object when processing passive chaos reduction in Bladeburner.process\");\n }\n city.chaos -= 0.0001 * seconds;\n city.chaos = Math.max(0, city.chaos);\n }\n\n // Random Events\n this.randomEventCounter -= seconds;\n if (this.randomEventCounter <= 0) {\n this.randomEvent();\n // Add instead of setting because we might have gone over the required time for the event\n this.randomEventCounter += getRandomInt(240, 600);\n }\n\n this.processAction(router, player, seconds);\n\n // Automation\n if (this.automateEnabled) {\n // Note: Do NOT set this.action = this.automateActionHigh/Low since it creates a reference\n if (this.stamina <= this.automateThreshLow) {\n if (this.action.name !== this.automateActionLow.name || this.action.type !== this.automateActionLow.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionLow.type,\n name: this.automateActionLow.name,\n });\n this.startAction(player, this.action);\n }\n } else if (this.stamina >= this.automateThreshHigh) {\n if (this.action.name !== this.automateActionHigh.name || this.action.type !== this.automateActionHigh.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionHigh.type,\n name: this.automateActionHigh.name,\n });\n this.startAction(player, this.action);\n }\n }\n }\n }\n }\n\n getTypeAndNameFromActionId(actionId: IActionIdentifier): {\n type: string;\n name: string;\n } {\n const res = { type: \"\", name: \"\" };\n const types = Object.keys(ActionTypes);\n for (let i = 0; i < types.length; ++i) {\n if (actionId.type === ActionTypes[types[i]]) {\n res.type = types[i];\n break;\n }\n }\n const gen = [\n \"Training\",\n \"Recruitment\",\n \"FieldAnalysis\",\n \"Field Analysis\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n ];\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 // Can't start a BlackOp if you don't have the required rank\n const action = this.getActionObject(actionId);\n if (action == null) throw new Error(`Action not found ${actionId.type}, ${actionId.name}`);\n if (!(action instanceof BlackOperation)) throw new Error(`Action should be BlackOperation but isn't`);\n //const blackOp = (action as BlackOperation);\n if (action.reqdRank > this.rank) {\n workerScript.log(\"bladeburner.startAction\", `Insufficient rank to start Black Op '${actionId.name}'.`);\n return false;\n }\n\n // Can't start a BlackOp if its already been done\n if (this.blackops[actionId.name] != null) {\n workerScript.log(\"bladeburner.startAction\", `Black Op ${actionId.name} has already been completed.`);\n return false;\n }\n\n // Can't start a BlackOp if you haven't done the one before it\n const blackops = [];\n for (const nm in 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 workerScript.log(\"bladeburner.startAction\", `Invalid Black Op: '${name}'`);\n return false;\n }\n\n if (i > 0 && this.blackops[blackops[i - 1]] == null) {\n workerScript.log(\n \"bladeburner.startAction\",\n `Preceding Black Op must be completed before starting '${actionId.name}'.`,\n );\n return false;\n }\n }\n\n try {\n this.startAction(player, actionId);\n workerScript.log(\"bladeburner.startAction\", `Starting bladeburner action with type '${type}' and name ${name}\"`);\n return true;\n } catch (e) {\n this.resetAction();\n workerScript.log(\"bladeburner.startAction\", errorLogText);\n return false;\n }\n }\n\n getActionTimeNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionTime\", errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionTime\", errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getActionTime(this);\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n return 30;\n case ActionTypes[\"Recruitment\"]:\n return this.getRecruitmentTime(player);\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n return 60;\n default:\n workerScript.log(\"bladeburner.getActionTime\", errorLogText);\n return -1;\n }\n }\n\n getActionEstimatedSuccessChanceNetscriptFn(\n player: IPlayer,\n type: string,\n name: string,\n workerScript: WorkerScript,\n ): number[] {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", errorLogText);\n return [-1, -1];\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", errorLogText);\n return [-1, -1];\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getEstSuccessChance(this);\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n return [1, 1];\n case ActionTypes[\"Recruitment\"]: {\n const recChance = this.getRecruitmentSuccessChance(player);\n return [recChance, recChance];\n }\n default:\n workerScript.log(\"bladeburner.getActionEstimatedSuccessChance\", errorLogText);\n return [-1, -1];\n }\n }\n\n getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n return Math.floor(actionObj.count);\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n if (this.blackops[name] != null) {\n return 0;\n } else {\n return 1;\n }\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Recruitment\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n 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 `You do not have enough skill points to upgrade ${skillName} (You have ${this.skillPoints}, you need ${cost})`,\n );\n return false;\n }\n\n this.skillPoints -= cost;\n this.upgradeSkill(skill);\n workerScript.log(\"bladeburner.upgradeSkill\", `'${skillName}' upgraded to level ${this.skills[skillName]}`);\n return true;\n }\n\n getTeamSizeNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n if (type === \"\" && name === \"\") {\n return this.teamSize;\n }\n\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getTeamSize\", errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getTeamSize\", errorLogText);\n return -1;\n }\n\n if (\n actionId.type === ActionTypes[\"Operation\"] ||\n actionId.type === ActionTypes[\"BlackOp\"] ||\n actionId.type === ActionTypes[\"BlackOperation\"]\n ) {\n return actionObj.teamCount;\n } else {\n return 0;\n }\n }\n\n setTeamSizeNetscriptFn(type: string, name: string, size: number, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.setTeamSize\", errorLogText);\n return -1;\n }\n\n if (\n actionId.type !== ActionTypes[\"Operation\"] &&\n actionId.type !== ActionTypes[\"BlackOp\"] &&\n actionId.type !== ActionTypes[\"BlackOperation\"]\n ) {\n workerScript.log(\"bladeburner.setTeamSize\", \"Only valid for 'Operations' and 'BlackOps'\");\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.setTeamSize\", errorLogText);\n return -1;\n }\n\n let sanitizedSize = Math.round(size);\n if (isNaN(sanitizedSize) || sanitizedSize < 0) {\n workerScript.log(\"bladeburner.setTeamSize\", `Invalid size: ${size}`);\n return -1;\n }\n if (this.teamSize < sanitizedSize) {\n sanitizedSize = this.teamSize;\n }\n actionObj.teamCount = sanitizedSize;\n workerScript.log(\"bladeburner.setTeamSize\", `Team size for '${name}' set to ${sanitizedSize}.`);\n return sanitizedSize;\n }\n\n joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean {\n const bladeburnerFac = Factions[\"Bladeburners\"];\n if (bladeburnerFac.isMember) {\n return true;\n } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n workerScript.log(\"bladeburner.joinBladeburnerFaction\", \"Joined Bladeburners faction.\");\n return true;\n } else {\n workerScript.log(\n \"bladeburner.joinBladeburnerFaction\",\n `You do not have the required rank (${this.rank}/${BladeburnerConstants.RankNeededForFaction}).`,\n );\n return false;\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Bladeburner\", this);\n }\n\n /**\n * Initiatizes a Bladeburner object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Bladeburner {\n return Generic_fromJSON(Bladeburner, value.data);\n }\n}\n\nReviver.constructors.Bladeburner = Bladeburner;\n","import { CompanyPosition } from \"./CompanyPosition\";\nimport * as posNames from \"./data/companypositionnames\";\n\nimport { CONSTANTS } from \"../Constants\";\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 rolloverRep: 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.rolloverRep = 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 if (this.rolloverRep == null) {\n this.rolloverRep = 0;\n }\n const res = this.getFavorGain();\n if (res.length != 2) {\n console.error(\"Invalid result from getFavorGain() function\");\n return;\n }\n\n this.favor += res[0];\n this.rolloverRep = res[1];\n }\n\n getFavorGain(): number[] {\n if (this.favor == null) {\n this.favor = 0;\n }\n if (this.rolloverRep == null) {\n this.rolloverRep = 0;\n }\n let favorGain = 0,\n rep = this.playerReputation + this.rolloverRep;\n let reqdRep = CONSTANTS.CompanyReputationToFavorBase * Math.pow(CONSTANTS.CompanyReputationToFavorMult, this.favor);\n while (rep > 0) {\n if (rep >= reqdRep) {\n ++favorGain;\n rep -= reqdRep;\n } else {\n break;\n }\n reqdRep *= CONSTANTS.FactionReputationToFavorMult;\n }\n return [favorGain, rep];\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 * 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)) {\n return Infinity;\n }\n\n if (sanitizedRam > getPurchaseServerMaxRam()) {\n return Infinity;\n }\n\n return sanitizedRam * CONSTANTS.BaseCostFor1GBOfRamServer * BitNodeMultipliers.PurchasedServerCost;\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);\n\n dialogBoxCreate(\"Server successfully purchased with hostname \" + 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);\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 in 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) {\n exceptionAlert(e);\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"Warehouse\", this);\n }\n\n // Initiatizes a Warehouse object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Warehouse {\n return Generic_fromJSON(Warehouse, value.data);\n }\n}\n\nReviver.constructors.Warehouse = Warehouse;\n","import { gangMemberTasksMetadata } from \"./data/tasks\";\nimport { GangMemberTask } from \"./GangMemberTask\";\n\nexport const GangMemberTasks: {\n [key: string]: GangMemberTask;\n} = {};\n\n(function () {\n gangMemberTasksMetadata.forEach((e) => {\n GangMemberTasks[e.name] = new GangMemberTask(e.name, e.desc, e.isHacking, e.isCombat, e.params);\n });\n})();\n","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","/**\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(\"buyStock\", `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.lt(totalPrice)) {\n if (workerScript) {\n workerScript.log(\n \"buyStock\",\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 \"buyStock\",\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);\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShares = Math.round(stock.playerShares + shares);\n stock.playerAvgPx = newTotal / stock.playerShares;\n processTransactionForecastMovement(stock, shares);\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (workerScript) {\n const resultTxt =\n `Bought ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol} for ${numeralWrapper.formatMoney(\n totalPrice,\n )}. ` + `Paid ${numeralWrapper.formatMoney(CONSTANTS.StockMarketCommission)} in commission fees.`;\n workerScript.log(\"buyStock\", 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(\"sellStock\", `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);\n Player.recordMoneySource(netProfit, \"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(\"sellStock\", 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(\"shortStock\", `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.lt(totalPrice)) {\n if (workerScript) {\n workerScript.log(\n \"shortStock\",\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 \"shortStock\",\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);\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(\"shortStock\", 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(\"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 \"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);\n Player.recordMoneySource(profit, \"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(\"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 { 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 * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\nexport function Hashes({ hashes }: { hashes: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n <span className={classes.money}>{typeof hashes === \"number\" ? numeralWrapper.formatHashes(hashes) : hashes}</span>\n );\n}\n","/*\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 // 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};\n\nexport function ExploitName(exploit: string): string {\n return names[exploit];\n}\n\nexport function sanitizeExploits(exploits: Exploit[]): Exploit[] {\n return exploits.filter((e: Exploit) => Object.keys(Exploit).includes(e));\n}\n","import { loadAliases, loadGlobalAliases, Aliases, GlobalAliases } from \"./Alias\";\nimport { Companies, loadCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, loadFactions } from \"./Faction/Factions\";\nimport { loadAllGangs, AllGangs } from \"./Gang/AllGangs\";\nimport { loadMessages, initMessages, Messages } from \"./Message/MessageHelpers\";\nimport { Player, loadPlayer } from \"./Player\";\nimport { saveAllServers, loadAllServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\n\nimport { GameSavedEvents } 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\";\n\n/* SaveObject.js\n * Defines the object used to save/load games\n */\n\nclass BitburnerSaveObject {\n PlayerSave = \"\";\n AllServersSave = \"\";\n CompaniesSave = \"\";\n FactionsSave = \"\";\n AliasesSave = \"\";\n GlobalAliasesSave = \"\";\n MessagesSave = \"\";\n StockMarketSave = \"\";\n SettingsSave = \"\";\n VersionSave = \"\";\n AllGangsSave = \"\";\n LastExportBonus = \"\";\n\n getSaveString(): string {\n this.PlayerSave = JSON.stringify(Player);\n\n this.AllServersSave = saveAllServers();\n this.CompaniesSave = JSON.stringify(Companies);\n this.FactionsSave = JSON.stringify(Factions);\n this.AliasesSave = JSON.stringify(Aliases);\n this.GlobalAliasesSave = JSON.stringify(GlobalAliases);\n this.MessagesSave = JSON.stringify(Messages);\n this.StockMarketSave = JSON.stringify(StockMarket);\n this.SettingsSave = JSON.stringify(Settings);\n this.VersionSave = JSON.stringify(CONSTANTS.Version);\n this.LastExportBonus = JSON.stringify(ExportBonus.LastExportBonus);\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(): void {\n const saveString = this.getSaveString();\n\n save(saveString)\n .then(() => GameSavedEvents.emit())\n .catch((err) => console.error(err));\n }\n\n exportGame(): void {\n const saveString = this.getSaveString();\n\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 const filename = `bitburnerSave_BN${bn}x${SourceFileFlags[bn]}_${epochTime}.json`;\n const file = new Blob([saveString], { type: \"text/plain\" });\n if (window.navigator.msSaveOrOpenBlob) {\n // IE10+\n window.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 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): void {\n // We have to do this because ts won't let us otherwise\n const anyPlayer = Player as any;\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 in 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}\n\nfunction loadGame(saveString: string): boolean {\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(\"AliasesSave\")) {\n try {\n loadAliases(saveObj.AliasesSave);\n } catch (e) {\n console.warn(`Could not load Aliases from save`);\n loadAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain an Aliases property`);\n loadAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"GlobalAliasesSave\")) {\n try {\n loadGlobalAliases(saveObj.GlobalAliasesSave);\n } catch (e) {\n console.warn(`Could not load GlobalAliases from save`);\n loadGlobalAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain a GlobalAliases property`);\n loadGlobalAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"MessagesSave\")) {\n try {\n loadMessages(saveObj.MessagesSave);\n } catch (e) {\n console.warn(`Could not load Messages from save`);\n initMessages();\n }\n } else {\n console.warn(`Save file did not contain a Messages property`);\n initMessages();\n }\n if (saveObj.hasOwnProperty(\"StockMarketSave\")) {\n try {\n loadStockMarket(saveObj.StockMarketSave);\n } catch (e) {\n loadStockMarket(\"\");\n }\n } else {\n loadStockMarket(\"\");\n }\n if (saveObj.hasOwnProperty(\"SettingsSave\")) {\n try {\n Settings.load(saveObj.SettingsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse Settings. Re-initing default values\");\n Settings.init();\n }\n } else {\n Settings.init();\n }\n if (saveObj.hasOwnProperty(\"LastExportBonus\")) {\n try {\n ExportBonus.setLastExportBonus(JSON.parse(saveObj.LastExportBonus));\n } catch (err) {\n ExportBonus.setLastExportBonus(new Date().getTime());\n console.error(\"ERROR: Failed to parse last export bonus Settings \" + err);\n }\n }\n if (Player.inGang() && saveObj.hasOwnProperty(\"AllGangsSave\")) {\n try {\n loadAllGangs(saveObj.AllGangsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse AllGangsSave: \" + e);\n }\n }\n if (saveObj.hasOwnProperty(\"VersionSave\")) {\n try {\n const ver = JSON.parse(saveObj.VersionSave, Reviver);\n evaluateVersionCompatibility(ver);\n\n if (window.location.href.toLowerCase().includes(\"bitburner-beta\")) {\n // Beta branch, always show changes\n createBetaUpdateText();\n } else if (ver != CONSTANTS.Version) {\n createNewUpdateText();\n }\n } catch (e) {\n createNewUpdateText();\n }\n } else {\n createNewUpdateText();\n }\n\n return true;\n}\n\nfunction createNewUpdateText(): void {\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 );\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 );\n}\n\nReviver.constructors.BitburnerSaveObject = BitburnerSaveObject;\n\nexport { saveObject, loadGame };\n\nconst saveObject = new BitburnerSaveObject();\n","import { IPlayer } from \"../IPlayer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\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_skill + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) *\n p.faction_rep_mult *\n p.getIntelligenceBonus(1) *\n mult(f)\n );\n}\n\nexport function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 *\n (p.hacking_skill / CONSTANTS.MaxSkillLevel +\n p.strength / CONSTANTS.MaxSkillLevel +\n p.defense / CONSTANTS.MaxSkillLevel +\n p.dexterity / CONSTANTS.MaxSkillLevel +\n p.agility / CONSTANTS.MaxSkillLevel +\n p.intelligence / CONSTANTS.MaxSkillLevel)) /\n 4.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\n}\n\nexport function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number {\n const t =\n (0.9 *\n (p.hacking_skill / CONSTANTS.MaxSkillLevel +\n p.strength / CONSTANTS.MaxSkillLevel +\n p.defense / CONSTANTS.MaxSkillLevel +\n p.dexterity / CONSTANTS.MaxSkillLevel +\n p.agility / CONSTANTS.MaxSkillLevel +\n p.charisma / CONSTANTS.MaxSkillLevel +\n p.intelligence / CONSTANTS.MaxSkillLevel)) /\n 5.5;\n return t * p.faction_rep_mult * mult(f) * p.getIntelligenceBonus(1);\n}\n","import { Skill } from \"./Skill\";\nimport { SkillNames } from \"./data/SkillNames\";\nimport { IMap } from \"../types\";\n\nexport const Skills: IMap<Skill> = {};\n\n(function () {\n Skills[SkillNames.BladesIntuition] = new Skill({\n name: SkillNames.BladesIntuition,\n desc:\n \"Each level of this skill increases your success chance \" + \"for all Contracts, Operations, and BlackOps by 3%\",\n baseCost: 3,\n costInc: 2.1,\n successChanceAll: 3,\n });\n Skills[SkillNames.Cloak] = new Skill({\n name: SkillNames.Cloak,\n desc:\n \"Each level of this skill increases your \" +\n \"success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%\",\n baseCost: 2,\n costInc: 1.1,\n successChanceStealth: 5.5,\n });\n Skills[SkillNames.ShortCircuit] = new Skill({\n name: SkillNames.ShortCircuit,\n desc:\n \"Each level of this skill increases your success chance \" +\n \"in Contracts, Operations, and BlackOps that involve retirement by 5.5%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceKill: 5.5,\n });\n Skills[SkillNames.DigitalObserver] = new Skill({\n name: SkillNames.DigitalObserver,\n desc: \"Each level of this skill increases your success chance in \" + \"all Operations and BlackOps by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceOperation: 4,\n });\n Skills[SkillNames.Tracer] = new Skill({\n name: SkillNames.Tracer,\n desc: \"Each level of this skill increases your success chance in \" + \"all Contracts by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceContract: 4,\n });\n Skills[SkillNames.Overclock] = new Skill({\n name: SkillNames.Overclock,\n desc:\n \"Each level of this skill decreases the time it takes \" +\n \"to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)\",\n baseCost: 3,\n costInc: 1.4,\n maxLvl: 90,\n actionTime: 1,\n });\n Skills[SkillNames.Reaper] = new Skill({\n name: SkillNames.Reaper,\n desc: \"Each level of this skill increases your effective combat stats for Bladeburner actions by 2%\",\n baseCost: 2,\n costInc: 2.1,\n effStr: 2,\n effDef: 2,\n effDex: 2,\n effAgi: 2,\n });\n Skills[SkillNames.EvasiveSystem] = new Skill({\n name: SkillNames.EvasiveSystem,\n desc: \"Each level of this skill increases your effective \" + \"dexterity and agility for Bladeburner actions by 4%\",\n baseCost: 2,\n costInc: 2.1,\n effDex: 4,\n effAgi: 4,\n });\n Skills[SkillNames.Datamancer] = new Skill({\n name: SkillNames.Datamancer,\n desc:\n \"Each level of this skill increases your effectiveness in \" +\n \"synthoid population analysis and investigation by 5%. \" +\n \"This affects all actions that can potentially increase \" +\n \"the accuracy of your synthoid population/community estimates.\",\n baseCost: 3,\n costInc: 1,\n successChanceEstimate: 5,\n });\n Skills[SkillNames.CybersEdge] = new Skill({\n name: SkillNames.CybersEdge,\n desc: \"Each level of this skill increases your max stamina by 2%\",\n baseCost: 1,\n costInc: 3,\n stamina: 2,\n });\n Skills[SkillNames.HandsOfMidas] = new Skill({\n name: SkillNames.HandsOfMidas,\n desc: \"Each level of this skill increases the amount of money you receive from Contracts by 10%\",\n baseCost: 2,\n costInc: 2.5,\n money: 10,\n });\n Skills[SkillNames.Hyperdrive] = new Skill({\n name: SkillNames.Hyperdrive,\n desc: \"Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 10%\",\n baseCost: 1,\n costInc: 2.5,\n expGain: 10,\n });\n})();\n","// 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","/**\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 \n \\\\ / [nova medical] / 4/30 \\\\ \n 49 x A \\\\ \n / \\\\ / \\\\ \n / \\\\ [travel agency] F o 31 \n / \\\\ 51 / \n / o----B------x-----o \n o 50 52 \n [omega soft.] \n [the slums] E `;\nCities[CityName.NewTokyo].asciiArt = `\n \n \n o \n \\\\ \n \\\\ [defcomm] \n \\\\ \n o--x---A--x--o [travel agency] \n 7 8 10 G \n [vitalife] o 12 [global pharmaceuticals] \n | \n o--D-x----x-------x-C-+--------x--x-B-x---x-o \n 21 22 23 \\\\ 24 25 26 27 \n \\\\ \n [noodle bar] x 14 \n \\\\ \n \\\\ \n [hospital] o 15 [world stock exchange] \n | \n o--x--E--x-----x-----x---+---x----x--H--x-o \n | \n | \n o 17 \n \n \n \n F [the slums] \n `;\nCities[CityName.Sector12].asciiArt = `\n 78 o 97 \n o [icarus microsystems] / \n N [powerhouse gym] o I \n 1 | | / \n o-----+---x----o 4 A [alpha ent.] o-------o / \n | 3 \\\\ | \\\\ / \n | \\\\ | [iron gym] x 95 \n (79) x \\\\ | / \\\\ \n | o-E----+----x----J--o 10 / o----T--o \n | | 8 \\\\ 94 x \n 80 x [city hall] | x 11 / [world stock exchange]\n | | \\\\ / \n | C [cia] \\\\ / \n Q [hospital] | F P [universal energy] \n | o [deltaone] \\\\ / \n | 35 o---------x 13/92/36 \n L [megacorp] 33 / / \\\\ \n | o------------o 34 / \\\\ \n (29) | / [carmichael sec.] D \\\\ \n o-----+-----x------o / O [rothman university] \n | 31 32 [nsa] M \n | / \n B [blade industries] H \n | / [four sigma] \n | [joe's guns] / \n | / \n 85 o--G--------K--------S-------o 88 [the slums] R \n \n [foodnstuff] [travel agency] `;\nCities[CityName.Volhaven].asciiArt = `\n [omnia cybersystems] \n 17 66 68 \n o o------G-------o \n \\\\ / \\\\ \n \\\\ o 65 o 69 \n [syscore sec.] H | | \n \\\\ | | [millenium fitness gym] \n \\\\ | 21 22 23 24 | 26 \n o----+--x--x----x---x---+-----x-------D-----o \n 19 | | 28 \n | F [omnitek inc.] \n [hospital] J 63 o \n | / 72 \n 3 | 5 6 / 9 \n o--------+----x-----x----+----------M-------o \n / | | \n / 61 x [helios labs] B [world stock exchange] \n [travel agency] L | | \n / | o \n / E [nwo] / 75 \n / [computek] | / \n / A-------o------I-----o \n 1 o | | \n | [zb] o 77 \n [lexocorp] C \n | \n o \n 57 \n \n \n [the slums] K `;\n\n// Then construct all locations, and add them to the cities as we go.\nfor (const metadata of LocationsMetadata) {\n const loc = constructLocation(metadata);\n\n const cityName = loc.city;\n if (cityName === null) {\n // Generic location, add to all cities\n for (const city in Cities) {\n Cities[city].addLocation(loc.name);\n }\n } else {\n Cities[cityName].addLocation(loc.name);\n }\n}\n","export function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport function getArrow(event: KeyboardEvent): string {\n switch (event.keyCode) {\n case 38:\n case 87:\n return \"↑\";\n case 65:\n case 37:\n return \"←\";\n case 40:\n case 83:\n return \"↓\";\n case 39:\n case 68:\n return \"→\";\n }\n return \"\";\n}\n","/**\n * Implementation for what happens when you destroy a BitNode\n */\nimport React from \"react\";\nimport { Player } from \"./Player\";\nimport { prestigeSourceFile } from \"./Prestige\";\nimport { PlayerOwnedSourceFile } from \"./SourceFile/PlayerOwnedSourceFile\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { SourceFiles } from \"./SourceFile/SourceFiles\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { IRouter } from \"./ui/Router\";\n\nexport let redPillFlag = false;\n\nexport function setRedPillFlag(b: boolean): void {\n redPillFlag = b;\n}\n\nfunction giveSourceFile(bitNodeNumber: number): void {\n const sourceFileKey = \"SourceFile\" + bitNodeNumber.toString();\n const sourceFile = SourceFiles[sourceFileKey];\n if (sourceFile == null) {\n console.error(`Could not find source file for Bit node: ${bitNodeNumber}`);\n return;\n }\n\n // Check if player already has this source file\n let alreadyOwned = false;\n let ownedSourceFile = null;\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n if (Player.sourceFiles[i].n === bitNodeNumber) {\n alreadyOwned = true;\n ownedSourceFile = Player.sourceFiles[i];\n break;\n }\n }\n\n if (alreadyOwned && ownedSourceFile) {\n if (ownedSourceFile.lvl >= 3 && ownedSourceFile.n !== 12) {\n dialogBoxCreate(\n \"The Source-File for the BitNode you just destroyed, \" + sourceFile.name + \", \" + \"is already at max level!\",\n );\n } else {\n ++ownedSourceFile.lvl;\n dialogBoxCreate(\n sourceFile.name +\n \" was upgraded to level \" +\n ownedSourceFile.lvl +\n \" for \" +\n \"destroying its corresponding BitNode!\",\n );\n }\n } else {\n const playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1);\n Player.sourceFiles.push(playerSrcFile);\n if (bitNodeNumber === 5 && Player.intelligence === 0) {\n // Artificial Intelligence\n Player.intelligence = 1;\n }\n dialogBoxCreate(\n <>\n You received a Source-File for destroying a BitNode!\n <br />\n <br />\n {sourceFile.name}\n <br />\n <br />\n {sourceFile.info}\n </>,\n );\n }\n}\n\nexport function enterBitNode(router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number): void {\n if (!flume) {\n giveSourceFile(destroyedBitNode);\n } else {\n if (SourceFileFlags[5] === 0 && newBitNode !== 5) {\n Player.intelligence = 0;\n Player.intelligence_exp = 0;\n }\n }\n if (newBitNode === 5 && Player.intelligence === 0) {\n Player.intelligence = 1;\n }\n redPillFlag = false;\n // Set new Bit Node\n Player.bitNodeN = newBitNode;\n\n if (newBitNode === 6) {\n router.toBladeburnerCinematic();\n } else {\n router.toTerminal();\n }\n prestigeSourceFile(flume);\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"../Player\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\n\nexport function scriptCalculateOfflineProduction(runningScript: RunningScript): void {\n //The Player object stores the last update time from when we were online\n const thisUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timePassed = (thisUpdate - lastUpdate) / 1000; //Seconds\n\n //Calculate the \"confidence\" rating of the script's true production. This is based\n //entirely off of time. We will arbitrarily say that if a script has been running for\n //4 hours (14400 sec) then we are completely confident in its ability\n let confidence = runningScript.onlineRunningTime / 14400;\n if (confidence >= 1) {\n confidence = 1;\n }\n\n //Data map: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n\n // Grow\n for (const hostname in 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 in 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)[],\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 { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"./utils/JSONReviver\";\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 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 if (window.navigator.msSaveOrOpenBlob) {\n // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n } else {\n // Others\n const a: HTMLAnchorElement = document.createElement(\"a\");\n const url: string = URL.createObjectURL(file);\n a.href = url;\n a.download = this.fn;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n }\n\n /**\n * Retrieve the content of the file.\n */\n read(): string {\n return this.text;\n }\n\n /**\n * Shows the content to the user via the game's dialog box.\n */\n show(): void {\n dialogBoxCreate(`${this.fn}<br /><br />${this.text}`);\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"TextFile\", this);\n }\n\n /**\n * Replaces the current content with the text provided.\n */\n write(txt: string): void {\n this.text = txt;\n }\n\n /**\n * Initiatizes a TextFile from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): TextFile {\n return Generic_fromJSON(TextFile, value.data);\n }\n}\n\nReviver.constructors.TextFile = TextFile;\n\n/**\n * Retrieve the file object for the filename on the specified server.\n * @param fn The file name to look for\n * @param server The server object to look in\n * @returns The file object, or null if it couldn't find it.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function getTextFile(fn: string, server: BaseServer): TextFile | null {\n const filename: string = !fn.endsWith(\".txt\") ? `${fn}.txt` : fn;\n\n for (const file of server.textFiles as TextFile[]) {\n if (file.fn === filename) {\n return file;\n }\n }\n\n return null;\n}\n\n/**\n * Creates a TextFile on the target server.\n * @param fn The file name to create.\n * @param txt The contents of the file.\n * @param server The server that the file should be created on.\n * @returns The instance of the file.\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function createTextFile(fn: string, txt: string, server: BaseServer): TextFile | undefined {\n if (getTextFile(fn, server) !== null) {\n // This should probably be a `throw`...\n /* tslint:disable-next-line:no-console */\n console.error(`A file named \"${fn}\" already exists on server ${server.hostname}.`);\n\n return undefined;\n }\n const file: TextFile = new TextFile(fn, txt);\n server.textFiles.push(file);\n\n return file;\n}\n","import { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ninterface IError {\n fileName?: string;\n lineNumber?: number;\n}\n\nexport function exceptionAlert(e: IError | string): void {\n console.error(e);\n dialogBoxCreate(\n \"Caught an exception: \" +\n e +\n \"<br><br>\" +\n \"Filename: \" +\n ((e as any).fileName || \"UNKNOWN FILE NAME\") +\n \"<br><br>\" +\n \"Line Number: \" +\n ((e as any).lineNumber || \"UNKNOWN LINE NUMBER\") +\n \"<br><br>\" +\n \"This is a bug, please report to game developer with this \" +\n \"message as well as details about how to reproduce the bug.<br><br>\" +\n \"If you want to be safe, I suggest refreshing the game WITHOUT saving so that your \" +\n \"safe doesn't get corrupted\",\n );\n}\n","import { Message } from \"./Message\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Player } from \"../Player\";\nimport { redPillFlag } from \"../RedPill\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\n//Sends message to player, including a pop up\nfunction sendMessage(msg: Message, forced = false): void {\n msg.recvd = true;\n if (forced || !Settings.SuppressMessages) {\n showMessage(msg);\n }\n addMessageToServer(msg, \"home\");\n}\n\nfunction showMessage(msg: Message): void {\n const txt =\n \"Message received from unknown sender: <br><br>\" +\n \"<i>\" +\n msg.msg +\n \"</i><br><br>\" +\n \"This message was saved as \" +\n msg.filename +\n \" onto your home computer.\";\n dialogBoxCreate(txt);\n}\n\n//Adds a message to a server\nfunction addMessageToServer(msg: Message, serverHostname: string): void {\n const server = GetServer(serverHostname);\n if (server == null) {\n console.warn(`Could not find server ${serverHostname}`);\n return;\n }\n for (let i = 0; i < server.messages.length; ++i) {\n const other = server.messages[i];\n if (typeof other === \"string\") continue;\n if (msg.filename === other.filename) {\n return; //Already exists\n }\n }\n server.messages.push(msg);\n}\n\n//Checks if any of the 'timed' messages should be sent\nfunction checkForMessagesToSend(): void {\n if (redPillFlag) return;\n const jumper0 = Messages[MessageFilenames.Jumper0];\n const jumper1 = Messages[MessageFilenames.Jumper1];\n const jumper2 = Messages[MessageFilenames.Jumper2];\n const jumper3 = Messages[MessageFilenames.Jumper3];\n const jumper4 = Messages[MessageFilenames.Jumper4];\n const cybersecTest = Messages[MessageFilenames.CyberSecTest];\n const nitesecTest = Messages[MessageFilenames.NiteSecTest];\n const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];\n const redpill = Messages[MessageFilenames.RedPill];\n\n let redpillOwned = false;\n if (Augmentations[AugmentationNames.TheRedPill].owned) {\n redpillOwned = true;\n }\n\n if (redpill && redpillOwned && Player.sourceFiles.length === 0 && !redPillFlag) {\n sendMessage(redpill, true);\n } else if (redpill && redpillOwned) {\n //If player has already destroyed a BitNode, message is not forced\n if (!redPillFlag) {\n sendMessage(redpill);\n }\n } else if (jumper0 && !jumper0.recvd && Player.hacking_skill >= 25) {\n sendMessage(jumper0);\n const flightName = Programs.Flight.name;\n const homeComp = Player.getHomeComputer();\n if (!homeComp.programs.includes(flightName)) {\n homeComp.programs.push(flightName);\n }\n } else if (jumper1 && !jumper1.recvd && Player.hacking_skill >= 40) {\n sendMessage(jumper1);\n } else if (cybersecTest && !cybersecTest.recvd && Player.hacking_skill >= 50) {\n sendMessage(cybersecTest);\n } else if (jumper2 && !jumper2.recvd && Player.hacking_skill >= 175) {\n sendMessage(jumper2);\n } else if (nitesecTest && !nitesecTest.recvd && Player.hacking_skill >= 200) {\n sendMessage(nitesecTest);\n } else if (jumper3 && !jumper3.recvd && Player.hacking_skill >= 350) {\n sendMessage(jumper3);\n } else if (jumper4 && !jumper4.recvd && Player.hacking_skill >= 490) {\n sendMessage(jumper4);\n } else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking_skill >= 500) {\n sendMessage(bitrunnersTest);\n }\n}\n\nfunction AddToAllMessages(msg: Message): void {\n Messages[msg.filename] = msg;\n}\n\nlet Messages: { [key: string]: Message | undefined } = {};\n\nfunction loadMessages(saveString: string): void {\n Messages = JSON.parse(saveString, Reviver);\n}\n\nconst MessageFilenames = {\n Jumper0: \"j0.msg\",\n Jumper1: \"j1.msg\",\n Jumper2: \"j2.msg\",\n Jumper3: \"j3.msg\",\n Jumper4: \"j4.msg\",\n CyberSecTest: \"csec-test.msg\",\n NiteSecTest: \"nitesec-test.msg\",\n BitRunnersTest: \"19dfj3l1nd.msg\",\n RedPill: \"icarus.msg\",\n};\n\nfunction initMessages(): void {\n //Reset\n Messages = {};\n\n //jump3R Messages\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper0,\n \"I know you can sense it. I know you're searching for it. \" +\n \"It's why you spend night after \" +\n \"night at your computer. <br><br>It's real, I've seen it. And I can \" +\n \"help you find it. But not right now. You're not ready yet.<br><br>\" +\n \"Use this program to track your progress<br><br>\" +\n \"The fl1ght.exe program was added to your home computer<br><br>\" +\n \"-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper1,\n \"Soon you will be contacted by a hacking group known as CyberSec. \" +\n \"They can help you with your search. <br><br>\" +\n \"You should join them, garner their favor, and \" +\n \"exploit them for their Augmentations. But do not trust them. \" +\n \"They are not what they seem. No one is.<br><br>\" +\n \"-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper2,\n \"Do not try to save the world. There is no world to save. If \" +\n \"you want to find the truth, worry only about yourself. Ethics and \" +\n \"morals will get you killed. <br><br>Watch out for a hacking group known as NiteSec.\" +\n \"<br><br>-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper3,\n \"You must learn to walk before you can run. And you must \" +\n \"run before you can fly. Look for the black hand. <br><br>\" +\n \"I.I.I.I <br><br>-jump3R\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.Jumper4,\n \"To find what you are searching for, you must understand the bits. \" +\n \"The bits are all around us. The runners will help you.<br><br>\" +\n \"-jump3R\",\n ),\n );\n\n //Messages from hacking factions\n AddToAllMessages(\n new Message(\n MessageFilenames.CyberSecTest,\n \"We've been watching you. Your skills are very impressive. But you're wasting \" +\n \"your talents. If you join us, you can put your skills to good use and change \" +\n \"the world for the better. If you join us, we can unlock your full potential. <br><br>\" +\n \"But first, you must pass our test. Find and install the backdoor on our server. <br><br>\" +\n \"-CyberSec\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.NiteSecTest,\n \"People say that the corrupted governments and corporations rule the world. \" +\n \"Yes, maybe they do. But do you know who everyone really fears? People \" +\n \"like us. Because they can't hide from us. Because they can't fight shadows \" +\n \"and ideas with bullets. <br><br>\" +\n \"Join us, and people will fear you, too. <br><br>\" +\n \"Find and install the backdoor on our server. Then, we will contact you again.\" +\n \"<br><br>-NiteSec\",\n ),\n );\n AddToAllMessages(\n new Message(\n MessageFilenames.BitRunnersTest,\n \"We know what you are doing. We know what drives you. We know \" +\n \"what you are looking for. <br><br> \" +\n \"We can help you find the answers.<br><br>\" +\n \"run4theh111z\",\n ),\n );\n\n AddToAllMessages(\n new Message(\n MessageFilenames.RedPill,\n \"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%<br>\" +\n \")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)<br>\" +\n \"@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB<br>\" +\n \"DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)\",\n ),\n );\n}\n\nexport { Messages, checkForMessagesToSend, sendMessage, showMessage, loadMessages, initMessages, Message };\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","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","import { BlackOperation } from \"./BlackOperation\";\nimport { IMap } from \"../types\";\n\nexport const BlackOperations: IMap<BlackOperation> = {};\n\n(function () {\n BlackOperations[\"Operation Typhoon\"] = new BlackOperation({\n name: \"Operation Typhoon\",\n baseDifficulty: 2000,\n reqdRank: 2.5e3,\n rankGain: 50,\n rankLoss: 10,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Zero\"] = new BlackOperation({\n name: \"Operation Zero\",\n baseDifficulty: 2500,\n reqdRank: 5e3,\n rankGain: 60,\n rankLoss: 15,\n hpLoss: 50,\n weights: {\n hack: 0.2,\n str: 0.15,\n def: 0.15,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation X\"] = new BlackOperation({\n name: \"Operation X\",\n baseDifficulty: 3000,\n reqdRank: 7.5e3,\n rankGain: 75,\n rankLoss: 15,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Titan\"] = new BlackOperation({\n name: \"Operation Titan\",\n baseDifficulty: 4000,\n reqdRank: 10e3,\n rankGain: 100,\n rankLoss: 20,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Ares\"] = new BlackOperation({\n name: \"Operation Ares\",\n baseDifficulty: 5000,\n reqdRank: 12.5e3,\n rankGain: 125,\n rankLoss: 20,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Archangel\"] = new BlackOperation({\n name: \"Operation Archangel\",\n baseDifficulty: 7500,\n reqdRank: 15e3,\n rankGain: 200,\n rankLoss: 20,\n hpLoss: 25,\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Juggernaut\"] = new BlackOperation({\n name: \"Operation Juggernaut\",\n baseDifficulty: 10e3,\n reqdRank: 20e3,\n rankGain: 300,\n rankLoss: 40,\n hpLoss: 300,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Red Dragon\"] = new BlackOperation({\n name: \"Operation Red Dragon\",\n baseDifficulty: 12.5e3,\n reqdRank: 25e3,\n rankGain: 500,\n rankLoss: 50,\n hpLoss: 500,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation K\"] = new BlackOperation({\n name: \"Operation K\",\n baseDifficulty: 15e3,\n reqdRank: 30e3,\n rankGain: 750,\n rankLoss: 60,\n hpLoss: 1000,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Deckard\"] = new BlackOperation({\n name: \"Operation Deckard\",\n baseDifficulty: 20e3,\n reqdRank: 40e3,\n rankGain: 1e3,\n rankLoss: 75,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Tyrell\"] = new BlackOperation({\n name: \"Operation Tyrell\",\n baseDifficulty: 25e3,\n reqdRank: 50e3,\n rankGain: 1.5e3,\n rankLoss: 100,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Wallace\"] = new BlackOperation({\n name: \"Operation Wallace\",\n baseDifficulty: 30e3,\n reqdRank: 75e3,\n rankGain: 2e3,\n rankLoss: 150,\n hpLoss: 1500,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Shoulder of Orion\"] = new BlackOperation({\n name: \"Operation Shoulder of Orion\",\n baseDifficulty: 35e3,\n reqdRank: 100e3,\n rankGain: 2.5e3,\n rankLoss: 500,\n hpLoss: 1500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation Hyron\"] = new BlackOperation({\n name: \"Operation Hyron\",\n baseDifficulty: 40e3,\n reqdRank: 125e3,\n rankGain: 3e3,\n rankLoss: 1e3,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Morpheus\"] = new BlackOperation({\n name: \"Operation Morpheus\",\n baseDifficulty: 45e3,\n reqdRank: 150e3,\n rankGain: 4e3,\n rankLoss: 1e3,\n hpLoss: 100,\n weights: {\n hack: 0.05,\n str: 0.15,\n def: 0.15,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[\"Operation Ion Storm\"] = new BlackOperation({\n name: \"Operation Ion Storm\",\n baseDifficulty: 50e3,\n reqdRank: 175e3,\n rankGain: 5e3,\n rankLoss: 1e3,\n hpLoss: 5000,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Annihilus\"] = new BlackOperation({\n name: \"Operation Annihilus\",\n baseDifficulty: 55e3,\n reqdRank: 200e3,\n rankGain: 7.5e3,\n rankLoss: 1e3,\n hpLoss: 10e3,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Ultron\"] = new BlackOperation({\n name: \"Operation Ultron\",\n baseDifficulty: 60e3,\n reqdRank: 250e3,\n rankGain: 10e3,\n rankLoss: 2e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[\"Operation Centurion\"] = new BlackOperation({\n name: \"Operation Centurion\",\n baseDifficulty: 70e3,\n reqdRank: 300e3,\n rankGain: 15e3,\n rankLoss: 5e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[\"Operation Vindictus\"] = new BlackOperation({\n name: \"Operation Vindictus\",\n baseDifficulty: 75e3,\n reqdRank: 350e3,\n rankGain: 20e3,\n rankLoss: 20e3,\n hpLoss: 20e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[\"Operation Daedalus\"] = new BlackOperation({\n name: \"Operation Daedalus\",\n baseDifficulty: 80e3,\n reqdRank: 400e3,\n rankGain: 40e3,\n rankLoss: 10e3,\n hpLoss: 100e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n})();\n","import { Action } from \"./Action\";\nimport { IMap } from \"../types\";\n\nexport const GeneralActions: IMap<Action> = {};\n\n(function () {\n // General Actions\n let actionName;\n actionName = \"Training\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n\n actionName = \"Field Analysis\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n\n actionName = \"Recruitment\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n\n actionName = \"Diplomacy\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n\n actionName = \"Hyperbolic Regeneration Chamber\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n})();\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, { 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\";\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\n\ninterface Log {\n id: string;\n script: RunningScript;\n}\n\nexport function LogBoxManager(): React.ReactElement {\n const [logs, setLogs] = useState<Log[]>([]);\n useEffect(\n () =>\n LogBoxEvents.subscribe((script: RunningScript) => {\n const id = script.server + \"-\" + script.filename + script.args.map((x: any): string => `${x}`).join(\"-\");\n setLogs((old) => {\n return [\n ...old,\n {\n id: id,\n script: script,\n },\n ];\n });\n }),\n [],\n );\n\n function close(id: string): void {\n setLogs((old) => old.filter((l) => l.id !== id));\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(() =>\n createStyles({\n logs: {\n overflowY: \"scroll\",\n overflowX: \"hidden\",\n scrollbarWidth: \"auto\",\n display: \"flex\",\n flexDirection: \"column-reverse\",\n },\n }),\n);\n\nfunction LogWindow(props: IProps): React.ReactElement {\n const classes = useStyles();\n const container = useRef<HTMLDivElement>(null);\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 function kill(): void {\n killWorkerScript(props.script, props.script.server, true);\n props.onClose();\n }\n\n return (\n <Draggable handle=\"#drag\">\n <Paper\n style={{\n display: \"flex\",\n flexFlow: \"column\",\n position: \"fixed\",\n left: \"40%\",\n top: \"30%\",\n zIndex: 1400,\n }}\n ref={container}\n >\n <Paper\n style={{\n cursor: \"grab\",\n }}\n >\n <Box id=\"drag\" display=\"flex\" alignItems=\"center\">\n <Typography color=\"primary\" variant=\"h6\">\n {props.script.filename} {props.script.args.map((x: any): string => `${x}`).join(\" \")}\n </Typography>\n\n <Box position=\"absolute\" right={0}>\n <Button onClick={kill}>Kill Script</Button>\n <Button onClick={props.onClose}>Close</Button>\n </Box>\n </Box>\n </Paper>\n <Paper sx={{ overflow: \"scroll\", overflowWrap: \"break-word\", whiteSpace: \"pre-line\" }}>\n <ResizableBox\n className={classes.logs}\n height={500}\n width={500}\n handle={\n <span style={{ position: \"absolute\", right: \"-10px\", bottom: \"-13px\", cursor: \"nw-resize\" }}>\n <ArrowForwardIosIcon color=\"primary\" style={{ transform: \"rotate(45deg)\" }} />\n </span>\n }\n >\n <Box>\n {props.script.logs.map(\n (line: string, i: number): JSX.Element => (\n <Typography key={i}>\n {line}\n <br />\n </Typography>\n ),\n )}\n </Box>\n </ResizableBox>\n </Paper>\n </Paper>\n </Draggable>\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\";\n\nexport class HacknetNode implements IHacknetNode {\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 * 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","/**\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 { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getStockMarketAccountCost(): number {\n return CONSTANTS.WSEAccountCost;\n}\n\nexport function getStockMarketTixApiCost(): number {\n return CONSTANTS.TIXAPICost;\n}\n\nexport function getStockMarket4SDataCost(): number {\n return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost;\n}\n\nexport function getStockMarket4STixApiCost(): number {\n return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;\n}\n","/**\n * React Component for a button that's used to apply for a job\n */\nimport * as React from \"react\";\n\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\n\nimport { use } from \"../../ui/Context\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n company: Company;\n entryPosType: CompanyPosition;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n text: string;\n};\n\nexport function ApplyToJobButton(props: IProps): React.ReactElement {\n const player = use.Player();\n\n function getJobRequirementTooltip(): string {\n const pos = player.getNextCompanyPosition(props.company, props.entryPosType);\n if (pos == null) {\n return \"\";\n }\n\n if (!props.company.hasPosition(pos)) {\n return \"\";\n }\n\n return getJobRequirementText(props.company, pos, true);\n }\n\n return (\n <>\n <Tooltip title={<span dangerouslySetInnerHTML={{ __html: getJobRequirementTooltip() }}></span>}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n <br />\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 { 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 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 ServerProfilerProgram: new DarkWebItem(\n Programs.ServerProfiler.name,\n 1e6,\n \"Displays hacking and Netscript-related information about a server\",\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 enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n URLImportError = -3,\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 resolve() function for when the script is \"blocked\" by an async op\n */\n delayResolve?: () => void;\n\n /**\n * Stores names of all functions that have logging disabled\n */\n disableLogs: IMap<boolean> = {};\n\n /**\n * Used for dynamic RAM calculation. Stores names of all functions that have\n * already been checked by this script.\n * TODO: Could probably just combine this with loadedFns?\n */\n dynamicLoadedFns: IMap<boolean> = {};\n\n /**\n * Tracks dynamic RAM usage\n */\n dynamicRamUsage: number = RamCostConstants.ScriptBaseRamCost;\n\n /**\n * Netscript Environment for this script\n */\n env: Environment;\n\n /**\n * Status message in case of script error. Currently unused I think\n */\n errorMessage = \"\";\n\n /**\n * Used for static RAM calculation. Stores names of all functions that have\n * already been checked by this script\n */\n loadedFns: IMap<boolean> = {};\n\n /**\n * Filename of script\n */\n name: string;\n\n /**\n * Script's output/return value. Currently not used or implemented\n */\n output = \"\";\n\n /**\n * Process ID. Must be an integer. Used for efficient script\n * killing and removal.\n */\n pid: number;\n\n /**\n * Script's Static RAM usage. Equivalent to underlying script's RAM usage\n */\n ramUsage = 0;\n\n /**\n * Whether or not this workerScript is currently running\n */\n running = false;\n\n /**\n * Reference to underlying RunningScript object\n */\n scriptRef: RunningScript;\n\n /**\n * IP Address on which this script is running\n */\n hostname: string;\n\n 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\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 this.scriptRef = runningScriptObj;\n this.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","export const GangConstants: {\n GangRespectToReputationRatio: number;\n MaximumGangMembers: number;\n CyclesPerTerritoryAndPowerUpdate: number;\n AscensionMultiplierRatio: number;\n Names: string[];\n} = {\n // Respect is divided by this to get rep gain\n GangRespectToReputationRatio: 25,\n MaximumGangMembers: 12,\n CyclesPerTerritoryAndPowerUpdate: 100,\n // Portion of upgrade multiplier that is kept after ascending\n AscensionMultiplierRatio: 0.15,\n // Names of possible Gangs\n Names: [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n ],\n};\n","import { getRandomByte } from \"./helpers/getRandomByte\";\n\n/**\n * Generate a random IP address\n * Does not check to see if the IP already exists in the game\n */\nexport function createRandomIp(): string {\n const ip: string = getRandomByte(99) + \".\" + getRandomByte(9) + \".\" + getRandomByte(9) + \".\" + getRandomByte(9);\n\n return ip;\n}\n","/**\n * Does a shallow compare of two arrays to determine if they are equal.\n * @param a1 The first array\n * @param a2 The second array\n */\nexport function compareArrays<T>(a1: T[], a2: T[]): boolean {\n if (a1.length !== a2.length) {\n return false;\n }\n\n for (let i = 0; i < a1.length; ++i) {\n if (Array.isArray(a1[i])) {\n // If the other element is not an array, then these cannot be equal\n if (!Array.isArray(a2[i])) {\n return false;\n }\n\n const elem1 = a1[i] as any;\n const elem2 = a2[i] as any;\n if (!compareArrays(elem1, elem2)) {\n return false;\n }\n } else if (a1[i] !== a2[i]) {\n return false;\n }\n }\n\n return true;\n}\n","// The Research Map is an object that holds all Corporation Research objects\n// as values. They are identified by their names\nimport { Research, IConstructorParams } from \"./Research\";\nimport { researchMetadata } from \"./data/ResearchMetadata\";\nimport { IMap } from \"../types\";\n\nexport const ResearchMap: IMap<Research> = {};\n\nfunction addResearch(p: IConstructorParams): void {\n if (ResearchMap[p.name] != null) {\n console.warn(`Duplicate Research being defined: ${p.name}`);\n }\n ResearchMap[p.name] = new Research(p);\n}\n\nfor (const metadata of researchMetadata) {\n addResearch(metadata);\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n favor: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Favor({ favor }: { favor: number | string }): React.ReactElement {\n const classes = useStyles();\n return <span className={classes.favor}>{typeof favor === \"number\" ? numeralWrapper.formatFavor(favor) : favor}</span>;\n}\n","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 };\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 };\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 },\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 background: {\n default: Settings.theme.black,\n paper: Settings.theme.well,\n },\n action: {\n disabled: Settings.theme.disabled,\n },\n },\n typography: {\n fontFamily:\n \"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman\",\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 MuiButton: {\n styleOverrides: {\n root: {\n backgroundColor: \"#333\",\n border: \"1px solid \" + Settings.theme.well,\n // color: Settings.theme.primary,\n \"&:hover\": {\n backgroundColor: Settings.theme.black,\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 },\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.black,\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.black,\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.black,\n border: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiTablePagination: {\n styleOverrides: {\n select: {\n color: Settings.theme.primary,\n },\n selectLabel: {\n color: Settings.theme.primary,\n },\n displayedRows: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTab: {\n styleOverrides: {\n textColorPrimary: {\n color: Settings.theme.secondary,\n \"&.Mui-selected\": {\n color: Settings.theme.primary,\n },\n },\n },\n },\n },\n });\n}\nrefreshTheme();\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element;\n}\n\nexport const TTheme = ({ children }: IProps): React.ReactElement => (\n <StyledEngineProvider injectFirst>\n <ThemeProvider theme={theme}>{children}</ThemeProvider>\n </StyledEngineProvider>\n);\n","import { Player } from \"../Player\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IAction, ISuccessChanceParams } from \"./IAction\";\n\nclass StatsMultiplier {\n [key: string]: number;\n\n hack = 0;\n str = 0;\n def = 0;\n dex = 0;\n agi = 0;\n cha = 0;\n int = 0;\n}\n\nexport interface IActionParams {\n name?: string;\n level?: number;\n maxLevel?: number;\n autoLevel?: boolean;\n baseDifficulty?: number;\n difficultyFac?: number;\n rewardFac?: number;\n successes?: number;\n failures?: number;\n rankGain?: number;\n rankLoss?: number;\n hpLoss?: number;\n hpLost?: number;\n isStealth?: boolean;\n isKill?: boolean;\n count?: number;\n weights?: StatsMultiplier;\n decays?: StatsMultiplier;\n teamCount?: number;\n}\n\nexport class Action implements IAction {\n name = \"\";\n\n // Difficulty scales with level. See getDifficulty() method\n level = 1;\n maxLevel = 1;\n autoLevel = true;\n baseDifficulty = 100;\n difficultyFac = 1.01;\n\n // Rank increase/decrease is affected by this exponent\n rewardFac = 1.02;\n\n successes = 0;\n failures = 0;\n\n // All of these scale with level/difficulty\n rankGain = 0;\n rankLoss = 0;\n hpLoss = 0;\n hpLost = 0;\n\n // Action Category. Current categories are stealth and kill\n isStealth = false;\n isKill = false;\n\n /**\n * Number of this contract remaining, and its growth rate\n * Growth rate is an integer and the count will increase by that integer every \"cycle\"\n */\n count: number = getRandomInt(1e3, 25e3);\n\n // Weighting of each stat in determining action success rate\n weights: StatsMultiplier = {\n hack: 1 / 7,\n str: 1 / 7,\n def: 1 / 7,\n dex: 1 / 7,\n agi: 1 / 7,\n cha: 1 / 7,\n int: 1 / 7,\n };\n // Diminishing returns of stats (stat ^ decay where 0 <= decay <= 1)\n decays: StatsMultiplier = {\n hack: 0.9,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.9,\n int: 0.9,\n };\n teamCount = 0;\n\n // Base Class for Contracts, Operations, and BlackOps\n constructor(params: IActionParams | null = null) {\n // | null = null\n if (params && params.name) this.name = params.name;\n\n if (params && params.baseDifficulty) this.baseDifficulty = addOffset(params.baseDifficulty, 10);\n if (params && params.difficultyFac) this.difficultyFac = params.difficultyFac;\n\n if (params && params.rewardFac) this.rewardFac = params.rewardFac;\n if (params && params.rankGain) this.rankGain = params.rankGain;\n if (params && params.rankLoss) this.rankLoss = params.rankLoss;\n if (params && params.hpLoss) this.hpLoss = params.hpLoss;\n\n if (params && params.isStealth) this.isStealth = params.isStealth;\n if (params && params.isKill) this.isKill = params.isKill;\n\n if (params && params.count) this.count = params.count;\n\n if (params && params.weights) this.weights = params.weights;\n if (params && params.decays) this.decays = params.decays;\n\n // Check to make sure weights are summed properly\n let sum = 0;\n for (const weight in 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 in this.decays) {\n if (this.decays.hasOwnProperty(decay)) {\n if (this.decays[decay] > 1) {\n throw new Error(\n \"Invalid decays when constructing \" + \"Action \" + this.name + \". \" + \"Decay value cannot be greater than 1\",\n );\n }\n }\n }\n }\n\n getDifficulty(): number {\n const difficulty = this.baseDifficulty * Math.pow(this.difficultyFac, this.level - 1);\n if (isNaN(difficulty)) {\n throw new Error(\"Calculated NaN in Action.getDifficulty()\");\n }\n return difficulty;\n }\n\n /**\n * Tests for success. Should be called when an action has completed\n * @param inst {Bladeburner} - Bladeburner instance\n */\n attempt(inst: IBladeburner): boolean {\n return Math.random() < this.getSuccessChance(inst);\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1;\n }\n\n getActionTime(inst: IBladeburner): number {\n const difficulty = this.getDifficulty();\n let baseTime = difficulty / BladeburnerConstants.DifficultyToTimeFactor;\n const skillFac = inst.skillMultipliers.actionTime; // Always < 1\n\n const effAgility = Player.agility * inst.skillMultipliers.effAgi;\n const effDexterity = Player.dexterity * inst.skillMultipliers.effDex;\n const statFac =\n 0.5 *\n (Math.pow(effAgility, BladeburnerConstants.EffAgiExponentialFactor) +\n Math.pow(effDexterity, BladeburnerConstants.EffDexExponentialFactor) +\n effAgility / BladeburnerConstants.EffAgiLinearFactor +\n effDexterity / BladeburnerConstants.EffDexLinearFactor); // Always > 1\n\n baseTime = Math.max(1, (baseTime * skillFac) / statFac);\n\n return Math.ceil(baseTime * this.getActionTimePenalty());\n }\n\n // For actions that have teams. To be implemented by subtypes.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getTeamSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n getChaosCompetencePenalty(inst: IBladeburner, params: ISuccessChanceParams): number {\n const city = inst.getCurrentCity();\n if (params.est) {\n return Math.pow(city.popEst / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n } else {\n return Math.pow(city.pop / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n }\n }\n\n getChaosDifficultyBonus(inst: IBladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.1);\n return mult;\n }\n\n return 1;\n }\n\n getEstSuccessChance(inst: IBladeburner): number[] {\n function clamp(x: number): number {\n return Math.max(0, Math.min(x, 1));\n }\n const est = this.getSuccessChance(inst, { est: true });\n const real = this.getSuccessChance(inst);\n const diff = Math.abs(real - est);\n let low = real - diff;\n let high = real + diff;\n const city = inst.getCurrentCity();\n const r = city.pop / city.popEst;\n\n if (r < 1) low *= r;\n else high *= r;\n return [clamp(low), clamp(high)];\n }\n\n /**\n * @inst - Bladeburner Object\n * @params - options:\n * est (bool): Get success chance estimate instead of real success chance\n */\n getSuccessChance(inst: IBladeburner, params: ISuccessChanceParams = { est: false }): number {\n if (inst == null) {\n throw new Error(\"Invalid Bladeburner instance passed into Action.getSuccessChance\");\n }\n let difficulty = this.getDifficulty();\n let competence = 0;\n for (const stat in this.weights) {\n if (this.weights.hasOwnProperty(stat)) {\n const playerStatLvl = Player.queryStatFromString(stat);\n const key = \"eff\" + stat.charAt(0).toUpperCase() + stat.slice(1);\n let effMultiplier = inst.skillMultipliers[key];\n if (effMultiplier == null) {\n console.error(`Failed to find Bladeburner Skill multiplier for: ${stat}`);\n effMultiplier = 1;\n }\n competence += this.weights[stat] * Math.pow(effMultiplier * playerStatLvl, this.decays[stat]);\n }\n }\n competence *= Player.getIntelligenceBonus(0.75);\n competence *= inst.calculateStaminaPenalty();\n\n competence *= this.getTeamSuccessBonus(inst);\n\n competence *= this.getChaosCompetencePenalty(inst, params);\n difficulty *= this.getChaosDifficultyBonus(inst);\n\n if (this.name == \"Raid\" && inst.getCurrentCity().comms <= 0) {\n return 0;\n }\n\n // Factor skill multipliers into success chance\n competence *= inst.skillMultipliers.successChanceAll;\n competence *= this.getActionTypeSkillSuccessBonus(inst);\n if (this.isStealth) {\n competence *= inst.skillMultipliers.successChanceStealth;\n }\n if (this.isKill) {\n competence *= inst.skillMultipliers.successChanceKill;\n }\n\n // Augmentation multiplier\n competence *= Player.bladeburner_success_chance_mult;\n\n if (isNaN(competence)) {\n throw new Error(\"Competence calculated as NaN in Action.getSuccessChance()\");\n }\n return Math.min(1, competence / difficulty);\n }\n\n getSuccessesNeededForNextLevel(baseSuccessesPerLevel: number): number {\n return Math.ceil(0.5 * this.maxLevel * (2 * baseSuccessesPerLevel + (this.maxLevel - 1)));\n }\n\n setMaxLevel(baseSuccessesPerLevel: number): void {\n if (this.successes >= this.getSuccessesNeededForNextLevel(baseSuccessesPerLevel)) {\n ++this.maxLevel;\n }\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Action\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Action {\n return Generic_fromJSON(Action, value.data);\n }\n}\n\nReviver.constructors.Action = Action;\n","/**\n * Sleeves are bodies that contain the player's cloned consciousness.\n * The player can use these bodies to perform different tasks synchronously.\n *\n * Each sleeve is its own individual, meaning it has its own stats/exp\n *\n * Sleeves are unlocked in BitNode-10.\n */\nimport { SleeveTaskType } from \"./SleeveTaskTypesEnum\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { Person, ITaskTracker, createTaskTracker } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nimport { Crime } from \"../../Crime/Crime\";\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { FactionWorkType } from \"../../Faction/FactionWorkTypeEnum\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\n\nexport class Sleeve extends Person {\n /**\n * Stores the name of the class that the player is currently taking\n */\n className = \"\";\n\n /**\n * Stores the type of crime the sleeve is currently attempting\n * Must match the name of a Crime object\n */\n crimeType = \"\";\n\n /**\n * Enum value for current task\n */\n currentTask: SleeveTaskType = SleeveTaskType.Idle;\n\n /**\n * Contains details about the sleeve's current task. The info stored\n * in this depends on the task type\n *\n * Faction/Company Work: Name of Faction/Company\n * Crime: Money earned if successful\n * Class/Gym: Name of university/gym\n */\n currentTaskLocation = \"\";\n\n /**\n * Maximum amount of time (in milliseconds) that can be spent on current task.\n */\n currentTaskMaxTime = 0;\n\n /**\n * Milliseconds spent on current task\n */\n currentTaskTime = 0;\n\n /**\n * Keeps track of experience earned for other sleeves\n */\n earningsForSleeves: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experience + money earned for player\n */\n earningsForPlayer: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of experienced earned in the current task/action\n */\n earningsForTask: ITaskTracker = createTaskTracker();\n\n /**\n * Keeps track of what type of work sleeve is doing for faction, if applicable\n */\n factionWorkType: FactionWorkType = FactionWorkType.None;\n\n /**\n * Records experience gain rate for the current task\n */\n gainRatesForTask: ITaskTracker = createTaskTracker();\n\n /**\n * String that stores what stat the sleeve is training at the gym\n */\n gymStatType = \"\";\n\n /**\n * Keeps track of events/notifications for this sleeve\n */\n logs: string[] = [];\n\n /**\n * Clone retains 'memory' synchronization (and maybe exp?) upon prestige/installing Augs\n */\n memory = 1;\n\n /**\n * Sleeve shock. Number between 0 and 100\n * Trauma/shock that comes with being in a sleeve. Experience earned\n * is multipled by shock%. This gets applied before synchronization\n *\n * Reputation earned is also multiplied by shock%\n */\n shock = 1;\n\n /**\n * Stored number of game \"loop\" cycles\n */\n storedCycles = 0;\n\n /**\n * Synchronization. Number between 0 and 100\n * When experience is earned by sleeve, both the player and the sleeve get\n * sync% of the experience earned. Other sleeves get sync^2% of exp\n */\n sync = 1;\n\n constructor(p: IPlayer | null = null) {\n super();\n if (p != null) {\n this.shockRecovery(p);\n }\n }\n\n /**\n * Commit crimes\n */\n commitCrime(p: IPlayer, crimeKey: string): boolean {\n const crime: Crime | null = Crimes[crimeKey];\n if (!(crime instanceof Crime)) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.gainRatesForTask.hack = crime.hacking_exp * this.hacking_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.str = crime.strength_exp * this.strength_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.def = crime.defense_exp * this.defense_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.dex = crime.dexterity_exp * this.dexterity_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.agi = crime.agility_exp * this.agility_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.cha = crime.charisma_exp * this.charisma_exp_mult * BitNodeMultipliers.CrimeExpGain;\n this.gainRatesForTask.money = crime.money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney;\n\n this.currentTaskLocation = String(this.gainRatesForTask.money);\n\n this.crimeType = crimeKey;\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 | null = Crimes[this.crimeType];\n if (!(crime instanceof Crime)) {\n console.error(`Invalid data stored in sleeve.crimeType: ${this.crimeType}`);\n this.resetTaskStatus();\n return retValue;\n }\n if (Math.random() < crime.successRate(this)) {\n // Success\n const successGainRates: ITaskTracker = createTaskTracker();\n\n const keysForIteration: (keyof ITaskTracker)[] = Object.keys(successGainRates) as (keyof ITaskTracker)[];\n for (let i = 0; i < keysForIteration.length; ++i) {\n const key = keysForIteration[i];\n successGainRates[key] = this.gainRatesForTask[key] * 2;\n }\n retValue = this.gainExperience(p, successGainRates);\n this.gainMoney(p, this.gainRatesForTask);\n\n p.karma -= crime.karma * (this.sync / 100);\n } else {\n retValue = this.gainExperience(p, this.gainRatesForTask);\n }\n\n // Do not reset task to IDLE\n this.currentTaskTime = 0;\n return retValue;\n }\n } else {\n // For other crimes... I dont think anything else needs to be done\n }\n\n this.resetTaskStatus();\n\n return retValue;\n }\n\n /**\n * Earn experience for any stats (supports multiple)\n * This function also handles experience propogating to Player and other sleeves\n */\n gainExperience(p: IPlayer, exp: ITaskTracker, numCycles = 1, fromOtherSleeve = false): ITaskTracker {\n // If the experience is coming from another sleeve, it is not multiplied by anything.\n // Also the player does not earn anything\n if (fromOtherSleeve) {\n if (exp.hack > 0) {\n this.hacking_exp += exp.hack;\n }\n\n if (exp.str > 0) {\n this.strength_exp += exp.str;\n }\n\n if (exp.def > 0) {\n this.defense_exp += exp.def;\n }\n\n if (exp.dex > 0) {\n this.dexterity_exp += exp.dex;\n }\n\n if (exp.agi > 0) {\n this.agility_exp += exp.agi;\n }\n\n if (exp.cha > 0) {\n this.charisma_exp += exp.cha;\n }\n\n return createTaskTracker();\n }\n\n // Experience is first multiplied by shock. Then 'synchronization'\n // is accounted for\n\n const multFac = (this.shock / 100) * (this.sync / 100) * numCycles;\n const pHackExp = exp.hack * multFac;\n const pStrExp = exp.str * multFac;\n const pDefExp = exp.def * multFac;\n const pDexExp = exp.dex * multFac;\n const pAgiExp = exp.agi * multFac;\n const pChaExp = exp.cha * multFac;\n\n // Experience is gained by both this sleeve and player\n if (pHackExp > 0) {\n this.hacking_exp += pHackExp;\n p.gainHackingExp(pHackExp);\n this.earningsForPlayer.hack += pHackExp;\n this.earningsForTask.hack += pHackExp;\n }\n\n if (pStrExp > 0) {\n this.strength_exp += pStrExp;\n p.gainStrengthExp(pStrExp);\n this.earningsForPlayer.str += pStrExp;\n this.earningsForTask.str += pStrExp;\n }\n\n if (pDefExp > 0) {\n this.defense_exp += pDefExp;\n p.gainDefenseExp(pDefExp);\n this.earningsForPlayer.def += pDefExp;\n this.earningsForTask.def += pDefExp;\n }\n\n if (pDexExp > 0) {\n this.dexterity_exp += pDexExp;\n p.gainDexterityExp(pDexExp);\n this.earningsForPlayer.dex += pDexExp;\n this.earningsForTask.dex += pDexExp;\n }\n\n if (pAgiExp > 0) {\n this.agility_exp += pAgiExp;\n p.gainAgilityExp(pAgiExp);\n this.earningsForPlayer.agi += pAgiExp;\n this.earningsForTask.agi += pAgiExp;\n }\n\n if (pChaExp > 0) {\n this.charisma_exp += pChaExp;\n p.gainCharismaExp(pChaExp);\n this.earningsForPlayer.cha += pChaExp;\n this.earningsForTask.cha += pChaExp;\n }\n\n // Record earnings for other sleeves\n this.earningsForSleeves.hack += pHackExp * (this.sync / 100);\n this.earningsForSleeves.str += pStrExp * (this.sync / 100);\n this.earningsForSleeves.def += pDefExp * (this.sync / 100);\n this.earningsForSleeves.dex += pDexExp * (this.sync / 100);\n this.earningsForSleeves.agi += pAgiExp * (this.sync / 100);\n this.earningsForSleeves.cha += pChaExp * (this.sync / 100);\n\n // Return the experience to be gained by other sleeves\n return {\n hack: pHackExp * (this.sync / 100),\n str: pStrExp * (this.sync / 100),\n def: pDefExp * (this.sync / 100),\n dex: pDexExp * (this.sync / 100),\n agi: pAgiExp * (this.sync / 100),\n cha: pChaExp * (this.sync / 100),\n money: 0,\n };\n }\n\n /**\n * Earn money for player\n */\n gainMoney(p: IPlayer, task: ITaskTracker, numCycles = 1): void {\n const gain: number = task.money * numCycles;\n this.earningsForTask.money += gain;\n this.earningsForPlayer.money += gain;\n p.gainMoney(gain);\n p.recordMoneySource(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_skill,\n this.strength,\n this.defense,\n this.dexterity,\n this.agility,\n this.charisma,\n );\n const favorMult = 1 + company.favor / 100;\n\n return jobPerformance * this.company_rep_mult * favorMult;\n } else {\n return 0;\n }\n }\n\n installAugmentation(aug: Augmentation): void {\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n this.applyAugmentation(aug);\n this.augmentations.push({ name: aug.name, level: 1 });\n this.updateStatLevels();\n }\n\n log(entry: string): void {\n const MaxLogSize = 50;\n this.logs.push(entry);\n if (this.logs.length > MaxLogSize) {\n this.logs.shift();\n }\n }\n\n /**\n * Called on every sleeve for a Source File prestige\n */\n prestige(p: IPlayer): void {\n // Reset exp\n this.hacking_exp = 0;\n this.strength_exp = 0;\n this.defense_exp = 0;\n this.dexterity_exp = 0;\n this.agility_exp = 0;\n this.charisma_exp = 0;\n\n // Reset task-related stuff\n this.resetTaskStatus();\n this.earningsForSleeves = createTaskTracker();\n this.earningsForPlayer = createTaskTracker();\n this.shockRecovery(p);\n\n // Reset augs and multipliers\n this.augmentations = [];\n this.resetMultipliers();\n\n // Reset sleeve-related stats\n this.shock = 1;\n this.storedCycles = 0;\n this.sync = Math.max(this.memory, 1);\n\n this.logs = [];\n }\n\n /**\n * Process loop\n * Returns an object containing the amount of experience that should be\n * transferred to all other sleeves\n */\n process(p: IPlayer, numCycles = 1): ITaskTracker | null {\n // Only process once every second (5 cycles)\n const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;\n this.storedCycles += numCycles;\n if (this.storedCycles < CyclesPerSecond) {\n return null;\n }\n\n let cyclesUsed = this.storedCycles;\n cyclesUsed = Math.min(cyclesUsed, 15);\n let time = cyclesUsed * CONSTANTS.MilliPerCycle;\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime + time > this.currentTaskMaxTime) {\n time = this.currentTaskMaxTime - this.currentTaskTime;\n cyclesUsed = Math.floor(time / CONSTANTS.MilliPerCycle);\n\n if (time < 0 || cyclesUsed < 0) {\n console.warn(`Sleeve.process() calculated negative cycle usage`);\n time = 0;\n cyclesUsed = 0;\n }\n }\n\n this.currentTaskTime += time;\n\n // Shock gradually goes towards 100\n this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);\n\n let retValue: ITaskTracker = createTaskTracker();\n switch (this.currentTask) {\n case SleeveTaskType.Idle:\n break;\n case SleeveTaskType.Class:\n case SleeveTaskType.Gym:\n this.updateTaskGainRates(p);\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n break;\n case SleeveTaskType.Faction: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n // Gain faction reputation\n const fac: Faction = Factions[this.currentTaskLocation];\n if (!(fac instanceof Faction)) {\n console.error(`Invalid faction for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n fac.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Company: {\n retValue = this.gainExperience(p, this.gainRatesForTask, cyclesUsed);\n this.gainMoney(p, this.gainRatesForTask, cyclesUsed);\n\n const company: Company = Companies[this.currentTaskLocation];\n if (!(company instanceof Company)) {\n console.error(`Invalid company for Sleeve task: ${this.currentTaskLocation}`);\n break;\n }\n\n company.playerReputation += this.getRepGain(p) * cyclesUsed;\n break;\n }\n case SleeveTaskType.Recovery:\n this.shock = Math.min(100, this.shock + 0.0002 * cyclesUsed);\n if (this.shock >= 100) this.resetTaskStatus();\n break;\n case SleeveTaskType.Synchro:\n this.sync = Math.min(100, this.sync + p.getIntelligenceBonus(0.5) * 0.0002 * cyclesUsed);\n if (this.sync >= 100) this.resetTaskStatus();\n break;\n default:\n break;\n }\n\n if (this.currentTaskMaxTime !== 0 && this.currentTaskTime >= this.currentTaskMaxTime) {\n if (this.currentTask === SleeveTaskType.Crime) {\n retValue = this.finishTask(p);\n } else {\n this.finishTask(p);\n }\n }\n\n this.updateStatLevels();\n\n this.storedCycles -= cyclesUsed;\n\n return retValue;\n }\n\n /**\n * Resets all parameters used to keep information about the current task\n */\n resetTaskStatus(): void {\n this.earningsForTask = createTaskTracker();\n this.gainRatesForTask = createTaskTracker();\n this.currentTask = SleeveTaskType.Idle;\n this.currentTaskTime = 0;\n this.currentTaskMaxTime = 0;\n this.factionWorkType = FactionWorkType.None;\n this.crimeType = \"\";\n this.currentTaskLocation = \"\";\n this.gymStatType = \"\";\n this.className = \"\";\n }\n\n shockRecovery(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.currentTask = SleeveTaskType.Recovery;\n return true;\n }\n\n synchronize(p: IPlayer): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n this.currentTask = SleeveTaskType.Synchro;\n return true;\n }\n\n /**\n * Take a course at a university\n */\n takeUniversityCourse(p: IPlayer, universityName: string, className: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (this.city !== CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSummitUniversity;\n costMult = 4;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (this.city !== CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12RothmanUniversity;\n costMult = 3;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (this.city !== CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n switch (className.toLowerCase()) {\n case \"study computer science\":\n break;\n case \"data structures\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassDataStructuresBaseCost * costMult);\n break;\n case \"networks\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassNetworksBaseCost * costMult);\n break;\n case \"algorithms\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassAlgorithmsBaseCost * costMult);\n break;\n case \"management\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassManagementBaseCost * costMult);\n break;\n case \"leadership\":\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassLeadershipBaseCost * costMult);\n break;\n default:\n return false;\n }\n\n this.className = className;\n this.currentTask = SleeveTaskType.Class;\n return true;\n }\n\n /**\n * Travel to another City. Costs money from player\n */\n travel(p: IPlayer, newCity: CityName): boolean {\n p.loseMoney(CONSTANTS.TravelCost);\n this.city = newCity;\n\n return true;\n }\n\n tryBuyAugmentation(p: IPlayer, aug: Augmentation): boolean {\n if (!p.canAfford(aug.startingCost)) {\n return false;\n }\n\n // Verify that this sleeve does not already have that augmentation.\n if (this.augmentations.some((a) => a.name === aug.name)) {\n return false;\n }\n\n p.loseMoney(aug.startingCost);\n this.installAugmentation(aug);\n return true;\n }\n\n updateTaskGainRates(p: IPlayer): void {\n if (this.currentTask === SleeveTaskType.Class) {\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n expMult = 3;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n expMult = 2;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n const totalExpMult = expMult * p.hashManager.getStudyMult();\n switch (this.className.toLowerCase()) {\n case \"study computer science\":\n this.gainRatesForTask.hack =\n CONSTANTS.ClassStudyComputerScienceBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"data structures\":\n this.gainRatesForTask.hack = CONSTANTS.ClassDataStructuresBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"networks\":\n this.gainRatesForTask.hack = CONSTANTS.ClassNetworksBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"algorithms\":\n this.gainRatesForTask.hack = CONSTANTS.ClassAlgorithmsBaseExp * totalExpMult * this.hacking_exp_mult;\n break;\n case \"management\":\n this.gainRatesForTask.cha = CONSTANTS.ClassManagementBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n case \"leadership\":\n this.gainRatesForTask.cha = CONSTANTS.ClassLeadershipBaseExp * totalExpMult * this.charisma_exp_mult;\n break;\n default:\n break;\n }\n\n return;\n }\n\n if (this.currentTask === SleeveTaskType.Gym) {\n // Get gym exp multiplier\n let expMult = 1;\n switch (this.currentTaskLocation.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n expMult = 2;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n expMult = 5;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n expMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n expMult = 10;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n expMult = 4;\n break;\n default:\n return;\n }\n\n // Set stat gain rate\n const baseGymExp = 1;\n const totalExpMultiplier = p.hashManager.getTrainingMult() * expMult;\n const sanitizedStat: string = this.gymStatType.toLowerCase();\n if (sanitizedStat.includes(\"str\")) {\n this.gainRatesForTask.str = baseGymExp * totalExpMultiplier * this.strength_exp_mult;\n } else if (sanitizedStat.includes(\"def\")) {\n this.gainRatesForTask.def = baseGymExp * totalExpMultiplier * this.defense_exp_mult;\n } else if (sanitizedStat.includes(\"dex\")) {\n this.gainRatesForTask.dex = baseGymExp * totalExpMultiplier * this.dexterity_exp_mult;\n } else if (sanitizedStat.includes(\"agi\")) {\n this.gainRatesForTask.agi = baseGymExp * totalExpMultiplier * this.agility_exp_mult;\n }\n\n return;\n }\n\n console.warn(`Sleeve.updateTaskGainRates() called for unexpected task type ${this.currentTask}`);\n }\n\n upgradeMemory(n: number): void {\n if (n < 0) {\n console.warn(`Sleeve.upgradeMemory() called with negative value: ${n}`);\n return;\n }\n\n this.memory = Math.min(100, Math.round(this.memory + n));\n }\n\n /**\n * Start work for one of the player's companies\n * Returns boolean indicating success\n */\n workForCompany(p: IPlayer, companyName: string): boolean {\n if (!(Companies[companyName] instanceof Company) || p.jobs[companyName] == null) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n const company: Company | null = Companies[companyName];\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (company == null) {\n return false;\n }\n if (companyPosition == null) {\n return false;\n }\n this.gainRatesForTask.money =\n companyPosition.baseSalary *\n company.salaryMultiplier *\n this.work_money_mult *\n BitNodeMultipliers.CompanyWorkMoney;\n this.gainRatesForTask.hack =\n companyPosition.hackingExpGain *\n company.expMultiplier *\n this.hacking_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.str =\n companyPosition.strengthExpGain *\n company.expMultiplier *\n this.strength_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.def =\n companyPosition.defenseExpGain *\n company.expMultiplier *\n this.defense_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.dex =\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n this.dexterity_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.agi =\n companyPosition.agilityExpGain *\n company.expMultiplier *\n this.agility_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n this.gainRatesForTask.cha =\n companyPosition.charismaExpGain *\n company.expMultiplier *\n this.charisma_exp_mult *\n BitNodeMultipliers.CompanyWorkExpGain;\n\n this.currentTaskLocation = companyName;\n this.currentTask = SleeveTaskType.Company;\n\n return true;\n }\n\n /**\n * Start work for one of the player's factions\n * Returns boolean indicating success\n */\n workForFaction(p: IPlayer, factionName: string, workType: string): boolean {\n if (factionName === \"\") {\n return false;\n }\n if (!(Factions[factionName] instanceof Faction) || !p.factions.includes(factionName)) {\n return false;\n }\n\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n const factionInfo = Factions[factionName].getInfo();\n\n // Set type of work (hacking/field/security), and the experience gains\n const sanitizedWorkType: string = workType.toLowerCase();\n if (sanitizedWorkType.includes(\"hack\")) {\n if (!factionInfo.offerHackingWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Hacking;\n this.gainRatesForTask.hack = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"field\")) {\n if (!factionInfo.offerFieldWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Field;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.1 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.1 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.1 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.1 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.cha = 0.1 * this.charisma_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else if (sanitizedWorkType.includes(\"security\")) {\n if (!factionInfo.offerSecurityWork) {\n return false;\n }\n this.factionWorkType = FactionWorkType.Security;\n this.gainRatesForTask.hack = 0.1 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.str = 0.15 * this.strength_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.def = 0.15 * this.defense_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.dex = 0.15 * this.dexterity_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n this.gainRatesForTask.agi = 0.15 * this.agility_exp_mult * BitNodeMultipliers.FactionWorkExpGain;\n } else {\n return false;\n }\n\n this.currentTaskLocation = factionName;\n this.currentTask = SleeveTaskType.Faction;\n\n return true;\n }\n\n /**\n * Begin a gym workout task\n */\n workoutAtGym(p: IPlayer, gymName: string, stat: string): boolean {\n if (this.currentTask !== SleeveTaskType.Idle) {\n this.finishTask(p);\n } else {\n this.resetTaskStatus();\n }\n\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let costMult = 1;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumCrushFitnessGym;\n costMult = 3;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (this.city != CityName.Aevum) {\n return false;\n }\n this.currentTaskLocation = LocationName.AevumSnapFitnessGym;\n costMult = 10;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12IronGym;\n costMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (this.city != CityName.Sector12) {\n return false;\n }\n this.currentTaskLocation = LocationName.Sector12PowerhouseGym;\n costMult = 20;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (this.city != CityName.Volhaven) {\n return false;\n }\n this.currentTaskLocation = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n break;\n default:\n return false;\n }\n\n // Set experience/money gains based on class\n const sanitizedStat: string = stat.toLowerCase();\n\n // Set cost\n this.gainRatesForTask.money = -1 * (CONSTANTS.ClassGymBaseCost * costMult);\n\n // Validate \"stat\" argument\n if (\n !sanitizedStat.includes(\"str\") &&\n !sanitizedStat.includes(\"def\") &&\n !sanitizedStat.includes(\"dex\") &&\n !sanitizedStat.includes(\"agi\")\n ) {\n return false;\n }\n\n this.gymStatType = stat;\n this.currentTask = SleeveTaskType.Gym;\n\n return true;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Sleeve\", this);\n }\n\n /**\n * Initiatizes a Sleeve object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Sleeve {\n return Generic_fromJSON(Sleeve, value.data);\n }\n}\n\nReviver.constructors.Sleeve = Sleeve;\n","import { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\nimport { Settings } from \"../Settings/Settings\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\n\nexport class Output {\n text: string;\n color: \"inherit\" | \"initial\" | \"primary\" | \"secondary\" | \"error\" | \"textPrimary\" | \"textSecondary\" | undefined;\n constructor(\n text: string,\n color: \"inherit\" | \"initial\" | \"primary\" | \"secondary\" | \"error\" | \"textPrimary\" | \"textSecondary\" | undefined,\n ) {\n if (Settings.EnableTimestamps) text = \"[\" + getTimestamp() + \"] \" + text;\n this.text = text;\n this.color = color;\n }\n}\n\nexport class Link {\n hostname: string;\n dashes: string;\n constructor(dashes: string, hostname: string) {\n if (Settings.EnableTimestamps) dashes = \"[\" + getTimestamp() + \"] \" + 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\n constructor(time: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\") {\n this.time = time;\n this.timeLeft = time;\n this.action = action;\n }\n}\n\nexport interface ITerminal {\n action: TTimer | null;\n\n commandHistory: string[];\n commandHistoryIndex: number;\n\n outputHistory: (Output | Link)[];\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 error(s: string): void;\n\n clear(): void;\n startAnalyze(): 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, cancelled?: boolean): void;\n finishGrow(player: IPlayer, cancelled?: boolean): void;\n finishWeaken(player: IPlayer, cancelled?: boolean): void;\n finishBackdoor(router: IRouter, player: IPlayer, cancelled?: boolean): void;\n finishAnalyze(player: IPlayer, 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 { EventEmitter } from \"../utils/EventEmitter\";\nexport const TerminalEvents = new EventEmitter<[]>();\nexport const TerminalClearEvents = new EventEmitter<[]>();\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","/**\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\";\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 in 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 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 return;\n }\n }\n\n console.error(\"Could not find the following Order in Order Book: \");\n console.error(order);\n } else {\n if (isBuy) {\n dialogBoxCreate(\n <>\n Failed to execute {order.type} for {stock.symbol} @ <Money money={order.price} /> ({pos}). This is most likely\n because you do not have enough money or the order would exceed the stock's maximum number of shares\n </>,\n );\n }\n }\n}\n","import { 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\n// UI Related Imports\n\nimport Decimal from \"decimal.js\";\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 = new Decimal(150e9);\n revenue = new Decimal(0);\n expenses = new Decimal(0);\n fundingRound = 0;\n public = false; //Publicly traded\n totalShares = CorporationConstants.INITIALSHARES; // Total existing shares\n numShares = CorporationConstants.INITIALSHARES; // Total shares owned by player\n shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n shareSaleCooldown = 0; // Game cycles until player can sell shares again\n issueNewSharesCooldown = 0; // Game cycles until player can issue shares again\n dividendPercentage = 0;\n dividendTaxPercentage = 50;\n issuedShares = 0;\n sharePrice = 0;\n storedCycles = 0;\n\n unlockUpgrades: number[];\n upgrades: number[];\n upgradeMultipliers: number[];\n\n state = new CorporationState();\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"The Corporation\";\n const numUnlockUpgrades = Object.keys(CorporationUnlockUpgrades).length;\n const numUpgrades = Object.keys(CorporationUpgrades).length;\n this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);\n this.upgrades = Array(numUpgrades).fill(0);\n this.upgradeMultipliers = Array(numUpgrades).fill(1);\n }\n\n addFunds(amt: number): void {\n if (!isFinite(amt)) {\n console.error(\"Trying to add invalid amount of funds. Report to a developper.\");\n return;\n }\n this.funds = this.funds.plus(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 = new Decimal(0);\n this.expenses = new Decimal(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.plus(ind.lastCycleRevenue);\n this.expenses = this.expenses.plus(ind.lastCycleExpenses);\n });\n const profit = this.revenue.minus(this.expenses);\n const cycleProfit = profit.times(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 = new Decimal(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 const dividendsPerShare = totalDividends / this.totalShares;\n const profit = this.numShares * dividendsPerShare * (1 - this.dividendTaxPercentage / 100);\n player.gainMoney(profit);\n player.recordMoneySource(profit, \"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 determineValuation(): number {\n let val,\n profit = this.revenue.minus(this.expenses).toNumber();\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.toNumber() + 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.toNumber(), 0) / 3; //Base valuation\n if (profit > 0) {\n val += profit * 315e3;\n val *= Math.pow(1.1, this.divisions.length);\n } else {\n val = 10e9 * Math.pow(1.1, this.divisions.length);\n }\n val -= val % 1e6; //Round down to nearest millionth\n }\n return val * BitNodeMultipliers.CorporationValuation;\n }\n\n getTargetSharePrice(): number {\n // Note: totalShares - numShares is not the same as issuedShares because\n // issuedShares does not account for private investors\n return this.determineValuation() / (2 * (this.totalShares - this.numShares) + 1);\n }\n\n updateSharePrice(): void {\n const targetPrice = this.getTargetSharePrice();\n if (this.sharePrice <= targetPrice) {\n this.sharePrice *= 1 + Math.random() * 0.01;\n } else {\n this.sharePrice *= 1 - Math.random() * 0.01;\n }\n if (this.sharePrice <= 0.01) {\n this.sharePrice = 0.01;\n }\n }\n\n immediatelyUpdateSharePrice(): void {\n this.sharePrice = this.getTargetSharePrice();\n }\n\n // Calculates how much money will be made and what the resulting stock price\n // will be when the player sells his/her shares\n // @return - [Player profit, final stock price, end shareSalesUntilPriceUpdate property]\n calculateShareSale(numShares: number): [number, number, number] {\n let sharesTracker = numShares;\n let sharesUntilUpdate = this.shareSalesUntilPriceUpdate;\n let sharePrice = this.sharePrice;\n let sharesSold = 0;\n let profit = 0;\n\n const maxIterations = Math.ceil(numShares / CorporationConstants.SHARESPERPRICEUPDATE);\n if (isNaN(maxIterations) || maxIterations > 10e6) {\n console.error(\n `Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be ${maxIterations}`,\n );\n return [0, 0, 0];\n }\n\n for (let i = 0; i < maxIterations; ++i) {\n if (sharesTracker < sharesUntilUpdate) {\n profit += sharePrice * sharesTracker;\n sharesUntilUpdate -= sharesTracker;\n break;\n } else {\n profit += sharePrice * sharesUntilUpdate;\n sharesUntilUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n sharesTracker -= sharesUntilUpdate;\n sharesSold += sharesUntilUpdate;\n\n // Calculate what new share price would be\n sharePrice = this.determineValuation() / (2 * (this.totalShares + sharesSold - this.numShares));\n }\n }\n\n return [profit, sharePrice, sharesUntilUpdate];\n }\n\n convertCooldownToString(cd: number): string {\n // The cooldown value is based on game cycles. Convert to a simple string\n const seconds = cd / 5;\n\n const SecondsPerMinute = 60;\n const SecondsPerHour = 3600;\n\n if (seconds > SecondsPerHour) {\n return `${Math.floor(seconds / SecondsPerHour)} hour(s)`;\n } else if (seconds > SecondsPerMinute) {\n return `${Math.floor(seconds / SecondsPerMinute)} minute(s)`;\n } else {\n return `${Math.floor(seconds)} second(s)`;\n }\n }\n\n //One time upgrades that unlock new features\n unlock(upgrade: CorporationUnlockUpgrade): void {\n const upgN = upgrade[0],\n price = upgrade[1];\n while (this.unlockUpgrades.length <= upgN) {\n this.unlockUpgrades.push(0);\n }\n if (this.funds.lt(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.minus(price);\n\n // Apply effects for one-time upgrades\n if (upgN === 5) {\n this.dividendTaxPercentage -= 5;\n } else if (upgN === 6) {\n this.dividendTaxPercentage -= 10;\n }\n }\n\n //Levelable upgrades\n upgrade(upgrade: CorporationUpgrade): void {\n const upgN = upgrade[0],\n basePrice = upgrade[1],\n priceMult = upgrade[2],\n upgradeAmt = upgrade[3]; //Amount by which the upgrade multiplier gets increased (additive)\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n while (this.upgradeMultipliers.length <= upgN) {\n this.upgradeMultipliers.push(1);\n }\n const totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]);\n if (this.funds.lt(totalCost)) {\n dialogBoxCreate(\"You don't have enough funds to purchase this!\");\n return;\n }\n ++this.upgrades[upgN];\n this.funds = this.funds.minus(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 in 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 { 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.1);\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 { Augmentations } from \"./Augmentation/Augmentations\";\nimport { augmentationExists, initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { Companies, initCompanies } from \"./Company/Companies\";\nimport { resetIndustryResearchTrees } from \"./Corporation/IndustryData\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Faction } from \"./Faction/Faction\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { joinFaction } from \"./Faction/FactionHelpers\";\nimport { updateHashManagerCapacity } from \"./Hacknet/HacknetHelpers\";\nimport { initMessages } from \"./Message/MessageHelpers\";\nimport { prestigeWorkerScripts } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { resetPidCounter } from \"./Netscript/Pid\";\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from \"./Server/AllServers\";\nimport { prestigeHomeComputer } from \"./Server/ServerHelpers\";\nimport { SourceFileFlags, updateSourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { deleteStockMarket, initStockMarket, initSymbolToStockMap } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\n\nimport Decimal from \"decimal.js\";\n\nconst BitNode8StartingMoney = 250e6;\n\n// Prestige by purchasing augmentation\nfunction prestigeAugmentation(): void {\n initBitNodeMultipliers(Player);\n\n const maintainMembership = Player.factions.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(homeComp);\n\n if (augmentationExists(AugmentationNames.Neurolink) && Augmentations[AugmentationNames.Neurolink].owned) {\n homeComp.programs.push(Programs.FTPCrackProgram.name);\n homeComp.programs.push(Programs.RelaySMTPProgram.name);\n }\n if (augmentationExists(AugmentationNames.CashRoot) && Augmentations[AugmentationNames.CashRoot].owned) {\n Player.setMoney(1e6);\n homeComp.programs.push(Programs.BruteSSHProgram.name);\n }\n if (augmentationExists(AugmentationNames.PCMatrix) && Augmentations[AugmentationNames.PCMatrix].owned) {\n homeComp.programs.push(Programs.DeepscanV1.name);\n homeComp.programs.push(Programs.AutoLink.name);\n }\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n // Gain favor for Companies\n for (const member in Companies) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].gainFavor();\n }\n }\n\n // Gain favor for factions\n for (const member in Factions) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].gainFavor();\n }\n }\n\n // Stop a Terminal action if there is onerror\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n Terminal.clear();\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n\n Player.factions = Player.factions.concat(maintainMembership);\n Player.factions.map((f) => (Factions[f].isMember = true));\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Messages\n initMessages();\n\n // Gang\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n const faction = Factions[gang.facName];\n if (faction instanceof Faction) {\n joinFaction(faction);\n }\n }\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 = new Decimal(BitNode8StartingMoney);\n }\n if (Player.bitNodeN === 8 || SourceFileFlags[8] > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n\n // Red Pill\n if (augmentationExists(AugmentationNames.TheRedPill) && Augmentations[AugmentationNames.TheRedPill].owned) {\n const WorldDaemon = GetServer(SpecialServers.WorldDaemon);\n const DaedalusServer = GetServer(SpecialServers.DaedalusServer);\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.hostname);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.hostname);\n }\n }\n\n resetPidCounter();\n}\n\n// Prestige by destroying Bit Node and gaining a Source File\nfunction prestigeSourceFile(flume: boolean): void {\n initBitNodeMultipliers(Player);\n updateSourceFileFlags(Player);\n\n Player.prestigeSourceFile();\n prestigeWorkerScripts(); // Delete all Worker Scripts objects\n\n const homeComp = Player.getHomeComputer();\n\n // 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(homeComp);\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n if (SourceFileFlags[9] >= 2) {\n homeComp.setMaxRam(128);\n } else if (SourceFileFlags[1] > 0) {\n homeComp.setMaxRam(32);\n } else {\n homeComp.setMaxRam(8);\n }\n homeComp.cpuCores = 1;\n\n // Reset favor for Companies\n for (const member in Companies) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n // Reset favor for factions\n for (const member in 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 in Augmentations) {\n if (Augmentations.hasOwnProperty(name)) {\n delete Augmentations[name];\n }\n }\n\n // Give levels of NeuroFluxGoverner for Source-File 12. Must be done here before Augmentations are recalculated\n if (SourceFileFlags[12] > 0) {\n Player.augmentations.push({\n name: AugmentationNames.NeuroFluxGovernor,\n level: SourceFileFlags[12],\n });\n }\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Messages\n initMessages();\n\n // 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 = new Decimal(BitNode8StartingMoney);\n }\n if (Player.bitNodeN === 8 || SourceFileFlags[8] > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Bit Node 10: Digital Carbon\n if (Player.bitNodeN === 10) {\n dialogBoxCreate(\"Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!\");\n }\n\n // Reset Stock market, gang, and corporation\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n } else {\n deleteStockMarket();\n }\n\n Player.gang = null;\n Player.corporation = null;\n resetIndustryResearchTrees();\n Player.bladeburner = null;\n\n // Source-File 9 (level 3) effect\n if (SourceFileFlags[9] >= 3) {\n const hserver = Player.createHacknetServer();\n\n hserver.level = 100;\n hserver.cores = 10;\n hserver.cache = 5;\n hserver.updateHashRate(Player.hacknet_node_money_mult);\n hserver.updateHashCapacity();\n updateHashManagerCapacity(Player);\n }\n\n // Gain int exp\n if (SourceFileFlags[5] !== 0 && !flume) Player.gainIntelligenceExp(300);\n\n resetPidCounter();\n}\n\nexport { prestigeAugmentation, prestigeSourceFile };\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","export interface RNG {\n random(): number;\n}\n\n/*\n * very bad RNG, meant to be used as introduction to RNG manipulation. It has a\n * period of 1024.\n */\nclass RNG0 implements RNG {\n x: number;\n m = 1024;\n a = 341;\n c = 1;\n\n constructor() {\n this.x = 0;\n this.reset();\n }\n\n step(): void {\n this.x = (this.a * this.x + this.c) % this.m;\n }\n\n random(): number {\n this.step();\n return this.x / this.m;\n }\n\n reset(): void {\n this.x = new Date().getTime() % this.m;\n }\n}\n\nexport const BadRNG: RNG0 = new RNG0();\n\n/*\n * Wichmann–Hill PRNG\n * The period is 6e12.\n */\nexport class WHRNG implements RNG {\n s1 = 0;\n s2 = 0;\n s3 = 0;\n\n constructor(totalPlaytime: number) {\n // This one is seeded by the players total play time.\n const v: number = (totalPlaytime / 1000) % 30000;\n this.s1 = v;\n this.s2 = v;\n this.s3 = v;\n }\n\n step(): void {\n this.s1 = (171 * this.s1) % 30269;\n this.s2 = (172 * this.s2) % 30307;\n this.s3 = (170 * this.s3) % 30323;\n }\n\n random(): number {\n this.step();\n return (this.s1 / 30269.0 + this.s2 / 30307.0 + this.s3 / 30323.0) % 1.0;\n }\n}\n","import { 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 { Settings } from \"../Settings/Settings\";\nimport { IMap } from \"../types\";\nimport { Terminal } from \"../Terminal\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\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 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 }\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.EnableTimestamps) {\n logEntry = \"[\" + getTimestamp() + \"] \" + logEntry;\n }\n\n this.logs.push(logEntry);\n this.logUpd = true;\n }\n\n displayLog(): void {\n for (let i = 0; i < this.logs.length; ++i) {\n Terminal.print(this.logs[i]);\n }\n }\n\n clearLog(): void {\n this.logs.length = 0;\n }\n\n // Update the moneyStolen and numTimesHack maps when hacking\n recordHack(hostname: string, moneyGained: number, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][0] += moneyGained;\n this.dataMap[hostname][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][3] += n;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\n","import React from \"react\";\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 opens up more of the Singularity Functions you can use.\n </>\n ),\n);\nSourceFiles[\"SourceFile5\"] = new SourceFile(\n 5,\n (\n <>\n This Source-File grants a special new stat called Intelligence. Intelligence is unique because it is permanent and\n persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than other\n stats, and it is also hidden (you won't know when you gain experience and how much). Higher Intelligence levels\n will boost your production for many actions in the game. In addition, this Source-File will unlock the\n getBitNodeMultipliers() and getServer() Netscript functions, as well as the formulas API, and will raise all of\n 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 in other BitNodes. Each level of this Source-File also grants you a\n Duplicate Sleeve\n </>\n ),\n);\nSourceFiles[\"SourceFile11\"] = new SourceFile(\n 11,\n (\n <>\n This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at\n that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's\n company salary and reputation gain multipliers by:\n <br />\n <br />\n Level 1: 32%\n <br />\n Level 2: 48%\n <br />\n Level 3: 56%\n <br />\n <br />\n It also reduces the price increase for every aug bought by:\n <br />\n <br />\n Level 1: 4%\n <br />\n Level 2: 6%\n <br />\n Level 3: 7%\n </>\n ),\n);\nSourceFiles[\"SourceFile12\"] = new SourceFile(\n 12,\n <>This Source-File lets the player start with Neuroflux Governor equal to the level of this Source-File.</>,\n);\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\";\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 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","/**\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 } from \"./RamCalculations\";\nimport { ScriptUrl } from \"./ScriptUrl\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { roundToTwo } from \"../utils/helpers/roundToTwo\";\n\nlet globalModuleSequenceNumber = 0;\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\n // Amount of RAM this Script requres to run\n ramUsage = 0;\n\n // hostname of server that this script is on.\n server = \"\";\n\n constructor(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 !== \"\") {\n this.updateRamUsage(otherScripts);\n }\n }\n\n /**\n * Download the script as a file\n */\n download(): void {\n const filename = this.filename + \".js\";\n const file = new Blob([this.code], { type: \"text/plain\" });\n if (window.navigator.msSaveOrOpenBlob) {\n // IE10+\n window.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(filename: string, code: string, hostname: string, otherScripts: Script[]): void {\n // Update code and filename\n this.code = code.replace(/^\\s+|\\s+$/g, \"\");\n\n this.filename = filename;\n this.server = hostname;\n this.updateRamUsage(otherScripts);\n this.markUpdated();\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(otherScripts: Script[]): Promise<void> {\n const res = await calculateRamUsage(this.code, otherScripts);\n if (res > 0) {\n this.ramUsage = roundToTwo(res);\n }\n this.markUpdated();\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 return Generic_fromJSON(Script, value.data);\n }\n}\n\nReviver.constructors.Script = Script;\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 in 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 in 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 storeHashes(numHashes: number): void {\n this.hashes += numHashes;\n this.hashes = Math.min(this.hashes, this.capacity);\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\nexport interface 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) => {\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\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 in Crimes) {\n const crime = Crimes[i];\n if (crime.type == type) {\n chance = crime.successRate(p);\n found = true;\n break;\n }\n }\n\n if (!found) {\n dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);\n return false;\n }\n\n if (Math.random() <= chance) {\n //Success\n return true;\n } else {\n //Failure\n return false;\n }\n}\n\nexport function findCrime(roughName: string): Crime | null {\n if (roughName.includes(\"shoplift\")) {\n return Crimes.Shoplift;\n } else if (roughName.includes(\"rob\") && roughName.includes(\"store\")) {\n return Crimes.RobStore;\n } else if (roughName.includes(\"mug\")) {\n return Crimes.Mug;\n } else if (roughName.includes(\"larceny\")) {\n return Crimes.Larceny;\n } else if (roughName.includes(\"drugs\")) {\n return Crimes.DealDrugs;\n } else if (roughName.includes(\"bond\") && roughName.includes(\"forge\")) {\n return Crimes.BondForgery;\n } else if (roughName.includes(\"traffick\") && roughName.includes(\"arms\")) {\n return Crimes.TraffickArms;\n } else if (roughName.includes(\"homicide\")) {\n return Crimes.Homicide;\n } else if (roughName.includes(\"grand\") && roughName.includes(\"auto\")) {\n return Crimes.GrandTheftAuto;\n } else if (roughName.includes(\"kidnap\")) {\n return Crimes.Kidnap;\n } else if (roughName.includes(\"assassinate\") || roughName.includes(\"assassination\")) {\n return Crimes.Assassination;\n } else if (roughName.includes(\"heist\")) {\n return Crimes.Heist;\n }\n\n return null;\n}\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { generateRandomString } from \"../utils/StringHelperFunctions\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { Employee } from \"./Employee\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ICorporation } from \"./ICorporation\";\n\ninterface IParams {\n loc?: string;\n size?: number;\n}\n\nexport class OfficeSpace {\n loc: string;\n size: number;\n minEne = 0;\n maxEne = 100;\n minHap = 0;\n maxHap = 100;\n maxMor = 100;\n employees: Employee[] = [];\n employeeProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n\n constructor(params: IParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 1;\n }\n\n atCapacity(): boolean {\n return this.employees.length >= this.size;\n }\n\n process(marketCycles = 1, corporation: ICorporation, industry: IIndustry): number {\n // HRBuddy AutoRecruitment and training\n if (industry.hasResearch(\"HRBuddy-Recruitment\") && !this.atCapacity()) {\n const emp = this.hireRandomEmployee();\n if (industry.hasResearch(\"HRBuddy-Training\") && emp !== undefined) {\n emp.pos = EmployeePositions.Training;\n }\n }\n\n // Process Office properties\n this.maxEne = 100;\n this.maxHap = 100;\n this.maxMor = 100;\n if (industry.hasResearch(\"Go-Juice\")) {\n this.maxEne += 10;\n }\n if (industry.hasResearch(\"JoyWire\")) {\n this.maxHap += 10;\n }\n if (industry.hasResearch(\"Sti.mu\")) {\n this.maxMor += 10;\n }\n\n // Calculate changes in Morale/Happiness/Energy for Employees\n let perfMult = 1; //Multiplier for employee morale/happiness/energy based on company performance\n if (corporation.funds < 0 && industry.lastCycleRevenue < 0) {\n perfMult = Math.pow(0.99, marketCycles);\n } else if (corporation.funds > 0 && industry.lastCycleRevenue > 0) {\n perfMult = Math.pow(1.01, marketCycles);\n }\n\n const hasAutobrew = industry.hasResearch(\"AutoBrew\");\n const hasAutoparty = industry.hasResearch(\"AutoPartyManager\");\n\n let salaryPaid = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const emp = this.employees[i];\n if (hasAutoparty) {\n emp.mor = this.maxMor;\n emp.hap = this.maxHap;\n } else {\n emp.mor *= perfMult;\n emp.hap *= perfMult;\n emp.mor = Math.min(emp.mor, this.maxMor);\n emp.hap = Math.min(emp.hap, this.maxHap);\n }\n\n if (hasAutobrew) {\n emp.ene = this.maxEne;\n } else {\n emp.ene *= perfMult;\n emp.ene = Math.min(emp.ene, this.maxEne);\n }\n\n const salary = emp.process(marketCycles, this);\n salaryPaid += salary;\n }\n\n this.calculateEmployeeProductivity(corporation, industry);\n return salaryPaid;\n }\n\n calculateEmployeeProductivity(corporation: ICorporation, industry: IIndustry): void {\n //Reset\n for (const name in 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 copy(): OfficeSpace {\n const office = new OfficeSpace();\n office.loc = this.loc;\n office.size = this.size;\n office.minEne = this.minEne;\n office.maxEne = this.maxEne;\n office.minHap = this.minHap;\n office.maxHap = this.maxHap;\n office.maxMor = this.maxMor;\n office.employeeProd = {\n [EmployeePositions.Operations]: this.employeeProd[EmployeePositions.Operations],\n [EmployeePositions.Engineer]: this.employeeProd[EmployeePositions.Engineer],\n [EmployeePositions.Business]: this.employeeProd[EmployeePositions.Business],\n [EmployeePositions.Management]: this.employeeProd[EmployeePositions.Management],\n [EmployeePositions.RandD]: this.employeeProd[EmployeePositions.RandD],\n total: this.employeeProd[\"total\"],\n };\n office.employees = [];\n for (const employee of this.employees) {\n office.employees.push(employee.copy());\n }\n return office;\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","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 { Factions } from \"./Faction/Factions\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\nexport let LastExportBonus = 0;\n\nconst bonusTimer = 24 * 60 * 60 * 1000; // 24h\nexport function canGetBonus(): boolean {\n const now = new Date().getTime();\n if (now - LastExportBonus > bonusTimer) return true;\n return false;\n}\n\nexport function onExport(p: IPlayer): void {\n if (!canGetBonus()) return;\n for (const facName of p.factions) {\n Factions[facName].favor++;\n }\n LastExportBonus = new Date().getTime();\n}\n\nexport function setLastExportBonus(unixTime: number): void {\n LastExportBonus = unixTime;\n}\n","/**\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 hacknetnode = 0;\n hospitalization = 0;\n infiltration = 0;\n sleeves = 0;\n stock = 0;\n total = 0;\n work = 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","/**\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\n return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}`;\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\nexport const AlertEvents = new EventEmitter<[string | JSX.Element]>();\n\ninterface Alert {\n id: string;\n text: string | JSX.Element;\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 return [\n ...old,\n {\n id: id,\n text: text,\n },\n ];\n });\n }),\n [],\n );\n\n function close(): void {\n setAlerts((old) => {\n return old.slice(1, 1e99);\n });\n }\n\n return (\n <>\n {alerts.length > 0 && (\n <Modal open={true} onClose={close}>\n <Box overflow=\"scroll\" sx={{ overflowWrap: \"break-word\", whiteSpace: \"pre-line\" }}>\n <Typography>{alerts[0].text}</Typography>\n </Box>\n </Modal>\n )}\n </>\n );\n}\n","export function calculateIntelligenceBonus(intelligence: number, weight = 1): number {\n return 1 + (weight * Math.pow(intelligence, 0.8)) / 600;\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport function getHospitalizationCost(p: IPlayer): number {\n let money;\n if (typeof p.money === \"number\") {\n money = p.money;\n } else {\n money = p.money.toNumber();\n }\n\n if (money < 0) {\n return 0;\n }\n\n return Math.min(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 { EmployeePositions } from \"./EmployeePositions\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ProductRatingWeights, IProductRatingWeight } from \"./ProductRatingWeights\";\n\nimport { createCityMap } from \"../Locations/createCityMap\";\nimport { IMap } from \"../types\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\ninterface IConstructorParams {\n name?: string;\n demand?: number;\n competition?: number;\n markup?: number;\n createCity?: string;\n designCost?: number;\n advCost?: number;\n quality?: number;\n performance?: number;\n durability?: number;\n reliability?: number;\n aesthetics?: number;\n features?: number;\n loc?: string;\n size?: number;\n req?: IMap<number>;\n}\n\nexport class Product {\n // Product name\n name = \"\";\n\n // The demand for this Product in the market. Gradually decreases\n dmd = 0;\n\n // How much competition there is in the market for this Product\n cmp = 0;\n\n // Markup. Affects how high of a price you can charge for this Product\n // without suffering a loss in the # of sales\n mku = 0;\n\n // Production cost - estimation of how much money it costs to make this Product\n pCost = 0;\n\n // Sell cost\n sCost: string | number = 0;\n\n // Variables for handling the creation process of this Product\n fin = false; // Whether this Product has finished being created\n prog = 0; // Creation progress - A number betwee 0-100 representing percentage\n createCity = \"\"; // City in which the product is/was being created\n designCost = 0; // How much money was invested into designing this Product\n advCost = 0; // How much money was invested into advertising this Product\n\n // Aggregate score for this Product's 'rating'\n // This is based on the stats/properties below. The weighting of the\n // stats/properties below differs between different industries\n rat = 0;\n\n // Stats/properties of this Product\n qlt = 0;\n per = 0;\n dur = 0;\n rel = 0;\n aes = 0;\n fea = 0;\n\n // Data refers to the production, sale, and quantity of the products\n // These values are specific to a city\n // For each city, the data is [qty, prod, sell]\n data: IMap<number[]> = createCityMap<number[]>([0, 0, 0]);\n\n // Location of this Product\n // Only applies for location-based products like restaurants/hospitals\n loc = \"\";\n\n // How much space 1 unit of the Product takes (in the warehouse)\n // Not applicable for all Products\n siz = 0;\n\n // Material requirements. An object that maps the name of a material to how much it requires\n // to make 1 unit of the product.\n reqMats: IMap<number> = {};\n\n // Data to keep track of whether production/sale of this Product is\n // manually limited. These values are specific to a city\n // [Whether production/sale is limited, limit amount]\n prdman: IMap<any[]> = createCityMap<any[]>([false, 0]);\n sllman: IMap<any[]> = createCityMap<any[]>([false, 0]);\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price: IMap<number> = createCityMap<number>(0);\n\n constructor(params: IConstructorParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.dmd = params.demand ? params.demand : 0;\n this.cmp = params.competition ? params.competition : 0;\n this.mku = params.markup ? params.markup : 0;\n this.createCity = params.createCity ? params.createCity : \"\";\n this.designCost = params.designCost ? params.designCost : 0;\n this.advCost = params.advCost ? params.advCost : 0;\n this.qlt = params.quality ? params.quality : 0;\n this.per = params.performance ? params.performance : 0;\n this.dur = params.durability ? params.durability : 0;\n this.rel = params.reliability ? params.reliability : 0;\n this.aes = params.aesthetics ? params.aesthetics : 0;\n this.fea = params.features ? params.features : 0;\n this.loc = params.loc ? params.loc : \"\";\n this.siz = params.size ? params.size : 0;\n this.reqMats = params.req ? params.req : {};\n }\n\n // empWorkMult is a multiplier that increases progress rate based on\n // productivity of employees\n createProduct(marketCycles = 1, empWorkMult = 1): void {\n if (this.fin) {\n return;\n }\n this.prog += marketCycles * 0.01 * empWorkMult;\n }\n\n // @param industry - Industry object. Reference to industry that makes this Product\n finishProduct(employeeProd: { [key: string]: number }, industry: IIndustry): void {\n this.fin = true;\n\n //Calculate properties\n const progrMult = this.prog / 100;\n\n const engrRatio = employeeProd[EmployeePositions.Engineer] / employeeProd[\"total\"];\n const mgmtRatio = employeeProd[EmployeePositions.Management] / employeeProd[\"total\"];\n const rndRatio = employeeProd[EmployeePositions.RandD] / employeeProd[\"total\"];\n const opsRatio = employeeProd[EmployeePositions.Operations] / employeeProd[\"total\"];\n const busRatio = employeeProd[EmployeePositions.Business] / employeeProd[\"total\"];\n const designMult = 1 + Math.pow(this.designCost, 0.1) / 100;\n const balanceMult = 1.2 * engrRatio + 0.9 * mgmtRatio + 1.3 * rndRatio + 1.5 * opsRatio + busRatio;\n const sciMult = 1 + Math.pow(industry.sciResearch.qty, industry.sciFac) / 800;\n const totalMult = progrMult * balanceMult * designMult * sciMult;\n\n this.qlt =\n totalMult *\n (0.1 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.per =\n totalMult *\n (0.15 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.02 * employeeProd[EmployeePositions.Business]);\n this.dur =\n totalMult *\n (0.05 * employeeProd[EmployeePositions.Engineer] +\n 0.02 * employeeProd[EmployeePositions.Management] +\n 0.08 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[EmployeePositions.Business]);\n this.rel =\n totalMult *\n (0.02 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.08 * employeeProd[EmployeePositions.Business]);\n this.aes =\n totalMult *\n (0.0 * employeeProd[EmployeePositions.Engineer] +\n 0.08 * employeeProd[EmployeePositions.Management] +\n 0.05 * employeeProd[EmployeePositions.RandD] +\n 0.02 * employeeProd[EmployeePositions.Operations] +\n 0.1 * employeeProd[EmployeePositions.Business]);\n this.fea =\n totalMult *\n (0.08 * employeeProd[EmployeePositions.Engineer] +\n 0.05 * employeeProd[EmployeePositions.Management] +\n 0.02 * employeeProd[EmployeePositions.RandD] +\n 0.05 * employeeProd[EmployeePositions.Operations] +\n 0.05 * employeeProd[EmployeePositions.Business]);\n this.calculateRating(industry);\n const advMult = 1 + Math.pow(this.advCost, 0.1) / 100;\n const busmgtgRatio = Math.max(busRatio + mgmtRatio, 1 / employeeProd[\"total\"]);\n this.mku = 100 / (advMult * Math.pow(this.qlt + 0.001, 0.65) * busmgtgRatio);\n\n // I actually don't understand well enough to know if this is right.\n // I'm adding this to prevent a crash.\n if (this.mku === 0 || !isFinite(this.mku)) this.mku = 1;\n\n this.dmd =\n industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness)));\n this.cmp = getRandomInt(0, 70);\n\n //Calculate the product's required materials\n //For now, just set it to be the same as the requirements to make materials\n for (const matName in 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 in 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","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 loadign 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(async (resolve, reject) => {\n await 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 { 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 * Estimated number of communities in the city.\n */\n commsEst = 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.commsEst = this.comms + getRandomInt(-5, 5);\n if (this.commsEst < 0) this.commsEst = 0;\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 improveCommunityEstimate(n = 1): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.improveCommunityEstimate()\");\n }\n if (this.commsEst < this.comms) {\n this.commsEst += n;\n if (this.commsEst > this.comms) {\n this.commsEst = this.comms;\n }\n } else if (this.commsEst > this.comms) {\n this.commsEst -= n;\n if (this.commsEst < this.comms) {\n this.commsEst = this.comms;\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","/**\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, width: \"100%\" }}>\n <Button onClick={props.onClick}>{props.buttonText}</Button>\n <Typography>{props.infoText}</Typography>\n </Paper>\n </Box>\n );\n}\n","/**\n * React component for the tickers configuration section of the Stock Market UI.\n * This config lets you change the way stock tickers are displayed (watchlist,\n * all/portoflio mode, etc)\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\nexport enum TickerDisplayMode {\n AllStocks,\n Portfolio,\n}\n\ntype IProps = {\n changeDisplayMode: () => void;\n changeWatchlistFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;\n tickerDisplayMode: TickerDisplayMode;\n};\n\nfunction DisplayModeButton(props: IProps): React.ReactElement {\n let txt = \"\";\n let tooltip = \"\";\n if (props.tickerDisplayMode === TickerDisplayMode.Portfolio) {\n txt = \"Switch to 'All Stocks' Mode\";\n tooltip = \"Displays all stocks on the WSE\";\n } else {\n txt = \"Switch to 'Portfolio' Mode\";\n tooltip = \"Displays only the stocks for which you have shares or orders\";\n }\n\n return (\n <Tooltip title={<Typography>{tooltip}</Typography>}>\n <Button onClick={props.changeDisplayMode}>{txt}</Button>\n </Tooltip>\n );\n}\n\nexport function StockTickersConfig(props: IProps): React.ReactElement {\n return (\n <>\n <DisplayModeButton {...props} />\n <br />\n <TextField\n sx={{ width: \"100%\" }}\n onChange={props.changeWatchlistFilter}\n placeholder=\"Filter Stocks by symbol (comma-separated list)\"\n type=\"text\"\n />\n </>\n );\n}\n","import { Factions } from \"../../Faction/Factions\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../IPlayer\";\n\n// Amount of negative karma needed to manage a gang in BitNodes other than 2\nconst GangKarmaRequirement = -54000;\n\nexport function canAccessGang(this: IPlayer): boolean {\n if (this.bitNodeN === 2) {\n return true;\n }\n if (SourceFileFlags[2] <= 0) {\n return false;\n }\n\n return this.karma <= BitNodeMultipliers.GangKarmaRequirement * GangKarmaRequirement;\n}\n\nexport function getGangFaction(this: IPlayer): Faction {\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n const fac = Factions[gang.facName];\n if (fac == null) {\n throw new Error(`Gang has invalid faction name: ${gang.facName}`);\n }\n\n return fac;\n}\n\nexport function getGangName(this: IPlayer): string {\n if (!this.inGang()) return \"\";\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName;\n}\n\nexport function hasGangWith(this: IPlayer, facName: string): boolean {\n if (!this.inGang()) return false;\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName === facName;\n}\n\nexport function inGang(this: IPlayer): boolean {\n if (this.gang == null || this.gang == undefined) {\n return false;\n }\n\n return this.gang instanceof Gang;\n}\n\nexport function startGang(this: IPlayer, factionName: string, hacking: boolean): void {\n this.gang = new Gang(factionName, hacking);\n\n const fac = Factions[factionName];\n if (fac == null) {\n throw new Error(`Invalid faction name when creating gang: ${factionName}`);\n }\n fac.playerReputation = 0;\n}\n","import { IMap } from \"../../types\";\n\nexport type CorporationUnlockUpgrade = [number, number, string, string];\n\n// Corporation Unlock Upgrades\n// Upgrades for entire corporation, unlocks features, either you have it or you dont\n// The data structure is an array with the following format:\n// [index in Corporation feature upgrades array, price, name, description]\nexport const CorporationUnlockUpgrades: IMap<CorporationUnlockUpgrade> = {\n //Lets you export goods\n \"0\": [\n 0,\n 20e9,\n \"Export\",\n \"Develop infrastructure to export your materials to your other facilities. \" +\n \"This allows you to move materials around between different divisions and cities.\",\n ],\n\n //Lets you buy exactly however many required materials you need for production\n \"1\": [\n 1,\n 25e9,\n \"Smart Supply\",\n \"Use advanced AI to anticipate your supply needs. \" +\n \"This allows you to purchase exactly however many materials you need for production.\",\n ],\n\n //Displays each material/product's demand\n \"2\": [\n 2,\n 5e9,\n \"Market Research - Demand\",\n \"Mine and analyze market data to determine the demand of all resources. \" +\n \"The demand attribute, which affects sales, will be displayed for every material and product.\",\n ],\n\n //Display's each material/product's competition\n \"3\": [\n 3,\n 5e9,\n \"Market Data - Competition\",\n \"Mine and analyze market data to determine how much competition there is on the market \" +\n \"for all resources. The competition attribute, which affects sales, will be displayed for \" +\n \"every material and product.\",\n ],\n \"4\": [\n 4,\n 10e9,\n \"VeChain\",\n \"Use AI and blockchain technology to identify where you can improve your supply chain systems. \" +\n \"This upgrade will allow you to view a wide array of useful statistics about your \" +\n \"Corporation.\",\n ],\n \"5\": [\n 5,\n 500e9,\n \"Shady Accounting\",\n \"Utilize unscrupulous accounting practices and pay off government officials to save money \" +\n \"on taxes. This reduces the dividend tax rate by 5%.\",\n ],\n \"6\": [\n 6,\n 2e12,\n \"Government Partnership\",\n \"Help national governments further their agendas in exchange for lowered taxes. \" +\n \"This reduces the dividend tax rate by 10%\",\n ],\n};\n","import { IMap } from \"../../types\";\n\nexport type CorporationUpgrade = [number, number, number, number, string, string];\n\n// Corporation Upgrades\n// Upgrades for entire corporation, levelable upgrades\n// The data structure is an array with the following format\n// [index in Corporation upgrades array, base price, price mult, benefit mult (additive), name, desc]\nexport const CorporationUpgrades: IMap<CorporationUpgrade> = {\n //Smart factories, increases production\n \"0\": [\n 0,\n 2e9,\n 1.06,\n 0.03,\n \"Smart Factories\",\n \"Advanced AI automatically optimizes the operation and productivity \" +\n \"of factories. Each level of this upgrade increases your global production by 3% (additive).\",\n ],\n\n //Smart warehouses, increases storage size\n \"1\": [\n 1,\n 2e9,\n 1.06,\n 0.1,\n \"Smart Storage\",\n \"Advanced AI automatically optimizes your warehouse storage methods. \" +\n \"Each level of this upgrade increases your global warehouse storage size by 10% (additive).\",\n ],\n\n //Advertise through dreams, passive popularity/ awareness gain\n \"2\": [\n 2,\n 4e9,\n 1.1,\n 0.001,\n \"DreamSense\",\n \"Use DreamSense LCC Technologies to advertise your corporation \" +\n \"to consumers through their dreams. Each level of this upgrade provides a passive \" +\n \"increase in awareness of all of your companies (divisions) by 0.004 / market cycle,\" +\n \"and in popularity by 0.001 / market cycle. A market cycle is approximately \" +\n \"15 seconds.\",\n ],\n\n //Makes advertising more effective\n \"3\": [\n 3,\n 4e9,\n 1.5,\n 0.005,\n \"Wilson Analytics\",\n \"Purchase data and analysis from Wilson, a marketing research \" +\n \"firm. Each level of this upgrades increases the effectiveness of your \" +\n \"advertising by 0.5% (additive).\",\n ],\n\n //Augmentation for employees, increases cre\n \"4\": [\n 4,\n 1e9,\n 1.06,\n 0.1,\n \"Nuoptimal Nootropic Injector Implants\",\n \"Purchase the Nuoptimal Nootropic \" +\n \"Injector augmentation for your employees. Each level of this upgrade \" +\n \"globally increases the creativity of your employees by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases cha\n \"5\": [\n 5,\n 1e9,\n 1.06,\n 0.1,\n \"Speech Processor Implants\",\n \"Purchase the Speech Processor augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the charisma of your employees by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases int\n \"6\": [\n 6,\n 1e9,\n 1.06,\n 0.1,\n \"Neural Accelerators\",\n \"Purchase the Neural Accelerator augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the intelligence of your employees \" +\n \"by 10% (additive).\",\n ],\n\n //Augmentation for employees, increases eff\n \"7\": [\n 7,\n 1e9,\n 1.06,\n 0.1,\n \"FocusWires\",\n \"Purchase the FocusWire augmentation for your employees. Each level \" +\n \"of this upgrade globally increases the efficiency of your employees by 10% (additive).\",\n ],\n\n //Improves sales of materials/products\n \"8\": [\n 8,\n 1e9,\n 1.07,\n 0.01,\n \"ABC SalesBots\",\n \"Always Be Closing. Purchase these robotic salesmen to increase the amount of \" +\n \"materials and products you sell. Each level of this upgrade globally increases your sales \" +\n \"by 1% (additive).\",\n ],\n\n //Improves scientific research rate\n \"9\": [\n 9,\n 5e9,\n 1.07,\n 0.05,\n \"Project Insight\",\n \"Purchase 'Project Insight', a R&D service provided by the secretive \" +\n \"Fulcrum Technologies. Each level of this upgrade globally increases the amount of \" +\n \"Scientific Research you produce by 5% (additive).\",\n ],\n};\n","import React from \"react\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ICityProps {\n currentCity: CityName;\n city: CityName;\n onTravel: (city: CityName) => void;\n}\n\nfunction City(props: ICityProps): React.ReactElement {\n if (props.city !== props.currentCity) {\n return (\n <Tooltip title={<Typography>{props.city}</Typography>}>\n <span\n onClick={() => props.onTravel(props.city)}\n style={{ color: \"white\", lineHeight: \"1em\", whiteSpace: \"pre\", cursor: \"pointer\" }}\n >\n {props.city[0]}\n </span>\n </Tooltip>\n );\n }\n return <span>{props.city[0]}</span>;\n}\n\ninterface IProps {\n currentCity: CityName;\n onTravel: (city: CityName) => void;\n}\n\nexport function WorldMap(props: IProps): React.ReactElement {\n // prettier-ignore\n return (\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,_ . ._. _. .</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,/'-/~ '\\ ,' _ , '<City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Volhaven} />,'|~ ._/-, /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>.-~ '| '',\\~|\\ _\\~ ,_ , <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Chongqing} /> /,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Sector12} /> /'~ |_/~\\\\,-,~ \\ \" ,_,/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | / ._-~'\\_ _~| \\ ) <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.NewTokyo} /></Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ __-\\ '/ ~ |\\ \\_ / ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~-_' _; '\\ '-, \\,' /\\/ |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> '\\_,~'\\_ \\_ _, /' ' |, /|'</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / \\_ ~ | / \\ ~'; -,_.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ~\\ | | , '-_, ,; ~ ~\\</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\, <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Aevum} /> / \\ / /| ,-, , -,</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,/ | |' |/ ,- ~ \\ '.</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ,| ,/ \\ ,/ \\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Ishima} /> |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / | ~ -~~-, / _</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | ,-' ~ /</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> / ,' ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ',| ~</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> ~'</Typography>\n </>\n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { StealthIcon } from \"./StealthIcon\";\nimport { KillIcon } from \"./KillIcon\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: IAction;\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner);\n\n let chance = <></>;\n if (estimatedSuccessChance[0] === estimatedSuccessChance[1]) {\n chance = <>{formatNumber(estimatedSuccessChance[0] * 100, 1)}%</>;\n } else {\n chance = (\n <>\n {formatNumber(estimatedSuccessChance[0] * 100, 1)}% ~ {formatNumber(estimatedSuccessChance[1] * 100, 1)}%\n </>\n );\n }\n\n return (\n <>\n Estimated success chance: {chance} {props.action.isStealth ? <StealthIcon /> : <></>}\n {props.action.isKill ? <KillIcon /> : <></>}\n </>\n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function StaticModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n {props.children}\n </Modal>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nexport function ReputationRate({ reputation }: { reputation: number }): React.ReactElement {\n return <Reputation reputation={`${numeralWrapper.formatReputation(reputation)} / sec`} />;\n}\n","/**\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 * Server and HacknetServer-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\n\nexport function hasTorRouter(this: IPlayer): boolean {\n return !!GetServer(SpecialServers.DarkWeb);\n}\n\nexport function getCurrentServer(this: IPlayer): BaseServer {\n const server = GetServer(this.currentServer);\n if (server === null) throw new Error(\"somehow connected to a server that does not exist.\");\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 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","/**\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 { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"../Player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\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.\",\n );\n }\n}\n\nexport function listAllDarkwebItems(): void {\n for (const key in DarkWebItems) {\n const item = DarkWebItems[key];\n Terminal.print(`${item.program} - ${numeralWrapper.formatMoney(item.price)} - ${item.description}`);\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 = null;\n for (const key in 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.print(\"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.lt(item.price)) {\n Terminal.print(\"Not enough money to purchase \" + item.program);\n return;\n }\n\n // buy and push\n Player.loseMoney(item.price);\n Player.getHomeComputer().programs.push(item.program);\n Terminal.print(\n \"You have purchased the \" + item.program + \" program. The new program can be found on your home computer.\",\n );\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 { vsprintf, sprintf } from \"sprintf-js\";\nimport * as libarg from \"arg\";\n\nimport { getRamCost } from \"./Netscript/RamCostGenerator\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\n\nimport { Augmentations } from \"./Augmentation/Augmentations\";\nimport { augmentationExists, installAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { prestigeAugmentation } from \"./Prestige\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { findCrime } from \"./Crime/CrimeHelpers\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { Company } from \"./Company/Company\";\nimport { Companies } from \"./Company/Companies\";\nimport { CompanyPosition } from \"./Company/CompanyPosition\";\nimport { CompanyPositions } from \"./Company/CompanyPositions\";\nimport { CONSTANTS } from \"./Constants\";\nimport { DarkWebItems } from \"./DarkWeb/DarkWebItems\";\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} from \"./Corporation/Actions\";\nimport { CorporationUnlockUpgrades } from \"./Corporation/data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrades } from \"./Corporation/data/CorporationUpgrades\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\nimport { calculateServerGrowth } from \"./Server/formulas/grow\";\nimport { AllGangs } from \"./Gang/AllGangs\";\nimport { Factions, factionExists } from \"./Faction/Factions\";\nimport { joinFaction, purchaseAugmentation } from \"./Faction/FactionHelpers\";\nimport { netscriptCanGrow, netscriptCanHack, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\n\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 { HacknetServer } from \"./Hacknet/HacknetServer\";\nimport { CityName } from \"./Locations/data/CityNames\";\nimport { LocationName } from \"./Locations/data/LocationNames\";\nimport { Terminal } from \"./Terminal\";\nimport { calculateSkill, calculateExp } from \"./PersonObjects/formulas/skill\";\n\nimport { Message } from \"./Message/Message\";\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { findRunningScript, findRunningScriptByPid } from \"./Script/ScriptHelpers\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\n\nimport { GetServer, GetAllServers, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport {\n getServerOnNetwork,\n numCycleForGrowth,\n processSingleServerGrowth,\n safetlyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"./StockMarket/BuyingAndSelling\";\nimport { influenceStockThroughServerHack, influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder } from \"./StockMarket/StockMarket\";\nimport { getBuyTransactionCost, getSellTransactionGain } from \"./StockMarket/StockMarketHelpers\";\nimport { OrderTypes } from \"./StockMarket/data/OrderTypes\";\nimport { PositionTypes } from \"./StockMarket/data/PositionTypes\";\nimport { StockSymbols } from \"./StockMarket/data/StockSymbols\";\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"./StockMarket/StockMarketCosts\";\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\n\nimport { NetscriptPorts, runScriptFromScript, startWorkerScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { makeRuntimeRejectMsg, netscriptDelay, resolveNetscriptRequestedThreads } from \"./NetscriptEvaluator\";\nimport { Interpreter } from \"./ThirdParty/JSInterpreter\";\nimport { Router } from \"./ui/GameRoot\";\n\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { is2DArray } from \"./utils/helpers/is2DArray\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\n\nimport { LogBoxEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\n\nimport { 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\";\n\nimport { Faction } from \"./Faction/Faction\";\nimport { Augmentation } from \"./Augmentation/Augmentation\";\n\nimport { CodingContract } from \"./CodingContracts\";\nimport { Stock } from \"./StockMarket/Stock\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { INetscriptGang, NetscriptGang } from \"./NetscriptFunctions/Gang\";\nimport { INetscriptSleeve, NetscriptSleeve } from \"./NetscriptFunctions/Sleeve\";\nimport { INetscriptExtra, NetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { INetscriptHacknet, NetscriptHacknet } from \"./NetscriptFunctions/Hacknet\";\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.\nfunction 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 in pseudoObj.properties) {\n const val = pseudoObj.properties[key];\n nativeObj[key] = toNative(val);\n }\n }\n return nativeObj;\n}\n\ninterface NS extends INetscriptExtra {\n [key: string]: any;\n hacknet: INetscriptHacknet;\n gang: INetscriptGang;\n sleeve: INetscriptSleeve;\n}\n\nfunction NetscriptFunctions(workerScript: WorkerScript): NS {\n const updateDynamicRam = function (fnName: string, ramCost: number): void {\n if (workerScript.dynamicLoadedFns[fnName]) {\n return;\n }\n workerScript.dynamicLoadedFns[fnName] = true;\n\n let threads = workerScript.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for threadcount for ${workerScript.name} on ${workerScript.hostname}`);\n threads = 1;\n }\n\n workerScript.dynamicRamUsage += ramCost * threads;\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 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 scan = eval('ns.scan');\n\n * Using map access to do the same\n const scan = ns['scan'];\n\n * Saving script in the improper order.\n Increase the cost of an imported script, save it, then run the\n parent. To fix this just re-open & save every script in order\n from most imported to least imported (parent script).\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} ip - Hostname or IP of the server\n * @param {string} callingFnName - Name of calling function. For logging purposes\n * @returns {Server} The specified Server\n */\n const safeGetServer = function (ip: any, callingFnName: any = \"\"): BaseServer {\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(callingFnName, `Invalid IP/hostname: ${ip}`);\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} ip - 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 (fn: any, ip: any, callingFnName: any, scriptArgs: any): 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 (ip == null) {\n ip = workerScript.hostname;\n }\n const server = safeGetServer(ip, callingFnName);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return workerScript.scriptRef;\n };\n\n const getRunningScriptByPid = function (pid: any, callingFnName: any): RunningScript | null {\n if (typeof callingFnName !== \"string\" || callingFnName === \"\") {\n callingFnName = \"getRunningScriptgetRunningScriptByPid\";\n }\n\n for (const server of GetAllServers()) {\n const runningScript = findRunningScriptByPid(pid, server);\n if (runningScript) return runningScript;\n }\n return null;\n };\n\n /**\n * Helper function for getting the error log message when the user specifies\n * a nonexistent running script\n * @param {string} fn - Filename of script\n * @param {string} ip - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {string} Error message to print to logs\n */\n const getCannotFindRunningScriptErrorMessage = function (fn: any, ip: any, scriptArgs: any): string {\n if (!Array.isArray(scriptArgs)) {\n scriptArgs = [];\n }\n\n return `Cannot find running script ${fn} on server ${ip} with args: ${arrayToString(scriptArgs)}`;\n };\n\n /**\n * Checks if the player has TIX API access. Throws an error if the player does not\n */\n const checkTixApiAccess = function (callingFn: any = \"\"): void {\n if (!Player.hasWseAccount) {\n throw makeRuntimeErrorMsg(callingFn, `You don't have WSE Access! Cannot use ${callingFn}()`);\n }\n if (!Player.hasTixApiAccess) {\n throw makeRuntimeErrorMsg(callingFn, `You don't have TIX API Access! Cannot use ${callingFn}()`);\n }\n };\n\n /**\n * Gets a stock, given its symbol. Throws an error if the symbol is invalid\n * @param {string} symbol - Stock's symbol\n * @returns {Stock} stock object\n */\n const getStockFromSymbol = function (symbol: any, callingFn: any = \"\"): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw makeRuntimeErrorMsg(callingFn, `Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n /**\n * Used to fail a function if the function's target is a Hacknet Server.\n * This is used for functions that should run on normal Servers, but not Hacknet Servers\n * @param {Server} server - Target server\n * @param {string} callingFn - Name of calling function. For logging purposes\n * @returns {boolean} True if the server is a Hacknet Server, false otherwise\n */\n const failOnHacknetServer = function (server: any, callingFn: any = \"\"): boolean {\n if (server instanceof HacknetServer) {\n workerScript.log(callingFn, `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n };\n\n const makeRuntimeErrorMsg = function (caller: string, msg: string): string {\n const errstack = new Error().stack;\n if (errstack === undefined) throw new Error(\"how did we not throw an error?\");\n const stack = errstack.split(\"\\n\").slice(1);\n const scripts = workerScript.getServer().scripts;\n const userstack = [];\n for (const stackline of stack) {\n let filename;\n for (const script of scripts) {\n if (script.url && stackline.includes(script.url)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.url)) {\n filename = dependency.filename;\n }\n }\n }\n if (!filename) continue;\n\n interface ILine {\n line: string;\n func: string;\n }\n\n function parseChromeStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+.*/;\n const funcRe = /.*at (.+) \\(.*/;\n\n const lineMatch = line.match(lineRe);\n const funcMatch = line.match(funcRe);\n if (lineMatch && funcMatch) {\n return { line: lineMatch[1], func: funcMatch[1] };\n }\n return null;\n }\n let call = { line: \"-1\", func: \"unknown\" };\n const chromeCall = parseChromeStackline(stackline);\n if (chromeCall) {\n call = chromeCall;\n }\n\n function parseFirefoxStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+$/;\n const lineMatch = line.match(lineRe);\n\n const lio = line.lastIndexOf(\"@\");\n\n if (lineMatch && lio !== -1) {\n return { line: lineMatch[1], func: line.slice(0, lio) };\n }\n return null;\n }\n\n const firefoxCall = parseFirefoxStackline(stackline);\n if (firefoxCall) {\n call = firefoxCall;\n }\n\n userstack.push(`${filename}:L${call.line}@${call.func}`);\n }\n\n workerScript.log(caller, msg);\n let rejectMsg = `${caller}: ${msg}`;\n if (userstack.length !== 0) rejectMsg += `<br><br>Stack:<br>${userstack.join(\"<br>\")}`;\n return makeRuntimeRejectMsg(workerScript, rejectMsg);\n };\n\n const checkFormulasAccess = function (func: any, n: any): void {\n if ((SourceFileFlags[5] < 1 && Player.bitNodeN !== 5) || (SourceFileFlags[n] < 1 && Player.bitNodeN !== n)) {\n let extra = \"\";\n if (n !== 5) {\n extra = ` and Source-File ${n}-1`;\n }\n throw makeRuntimeErrorMsg(`formulas.${func}`, `Requires Source-File 5-1${extra} to run.`);\n }\n };\n\n const checkSingularityAccess = function (func: any, n: any): void {\n if (Player.bitNodeN !== 4) {\n if (SourceFileFlags[4] < n) {\n throw makeRuntimeErrorMsg(func, `This singularity function requires Source-File 4-${n} to run.`);\n }\n }\n };\n\n const checkBladeburnerAccess = function (func: any, skipjoined: any = false): void {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const apiAccess =\n Player.bitNodeN === 7 ||\n Player.sourceFiles.some((a) => {\n return a.n === 7;\n });\n if (!apiAccess) {\n const apiDenied = `You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.`;\n throw makeRuntimeErrorMsg(`bladeburner.${func}`, apiDenied);\n }\n if (!skipjoined) {\n const bladeburnerAccess = bladeburner instanceof Bladeburner;\n if (!bladeburnerAccess) {\n const bladeburnerDenied = `You must be a member of the Bladeburner division to use this API.`;\n throw makeRuntimeErrorMsg(`bladeburner.${func}`, bladeburnerDenied);\n }\n }\n };\n\n const checkBladeburnerCity = function (func: any, city: any): void {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n if (!bladeburner.cities.hasOwnProperty(city)) {\n throw makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid city: ${city}`);\n }\n };\n\n const getCodingContract = function (func: any, ip: any, fn: any): CodingContract {\n const server = safeGetServer(ip, func);\n const contract = server.getContract(fn);\n if (contract == null) {\n throw makeRuntimeErrorMsg(`codingcontract.${func}`, `Cannot find contract '${fn}' on server '${ip}'`);\n }\n\n return contract;\n };\n\n const getBladeburnerActionObject = function (func: any, type: any, name: any): any {\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const actionId = bladeburner.getActionIdFromTypeAndName(type, name);\n if (!actionId) {\n throw makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw makeRuntimeErrorMsg(`bladeburner.${func}`, `Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n const getCompany = function (func: any, name: any): Company {\n const company = Companies[name];\n if (company == null || !(company instanceof Company)) {\n throw makeRuntimeErrorMsg(func, `Invalid company name: '${name}'`);\n }\n return company;\n };\n\n const getFaction = function (func: any, name: any): Faction {\n if (!factionExists(name)) {\n throw makeRuntimeErrorMsg(func, `Invalid faction name: '${name}`);\n }\n\n return Factions[name];\n };\n\n const getAugmentation = function (func: any, name: any): Augmentation {\n if (!augmentationExists(name)) {\n throw makeRuntimeErrorMsg(func, `Invalid augmentation: '${name}'`);\n }\n\n return Augmentations[name];\n };\n\n function getDivision(divisionName: any): IIndustry {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"cannot be called without a corporation\");\n const division = corporation.divisions.find((div) => div.name === divisionName);\n if (division === undefined) throw new Error(`No division named '${divisionName}'`);\n return division;\n }\n\n function getOffice(divisionName: any, cityName: any): OfficeSpace {\n const division = getDivision(divisionName);\n if (!(cityName in division.offices)) throw new Error(`Invalid city name '${cityName}'`);\n const office = division.offices[cityName];\n if (office === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return office;\n }\n\n function getWarehouse(divisionName: any, cityName: any): Warehouse {\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return warehouse;\n }\n\n function getMaterial(divisionName: any, cityName: any, materialName: any): Material {\n const warehouse = getWarehouse(divisionName, cityName);\n const material = warehouse.materials[materialName];\n if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);\n return material;\n }\n\n function getProduct(divisionName: any, productName: any): Product {\n const division = getDivision(divisionName);\n const product = division.products[productName];\n if (product === undefined) throw new Error(`Invalid product name: '${productName}'`);\n return product;\n }\n\n function getEmployee(divisionName: any, cityName: any, employeeName: any): Employee {\n const office = getOffice(divisionName, cityName);\n const employee = office.employees.find((e) => e.name === employeeName);\n if (employee === undefined) throw new Error(`Invalid employee name: '${employeeName}'`);\n return employee;\n }\n\n const runAfterReset = function (cbScript = null): void {\n //Run a script after reset\n if (cbScript && isString(cbScript)) {\n const home = Player.getHomeComputer();\n for (const script of home.scripts) {\n if (script.filename === cbScript) {\n const ramUsage = script.ramUsage;\n const ramAvailable = home.maxRam - home.ramUsed;\n if (ramUsage > ramAvailable) {\n return; // Not enough RAM\n }\n const runningScriptObj = new RunningScript(script, []); // No args\n runningScriptObj.threads = 1; // Only 1 thread\n startWorkerScript(runningScriptObj, home);\n }\n }\n }\n };\n\n const hack = function (ip: any, manual: any, { threads: requestedThreads, stock }: any = {}): Promise<number> {\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"hack\", \"Takes 1 argument.\");\n }\n const threads = resolveNetscriptRequestedThreads(workerScript, \"hack\", requestedThreads);\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n throw makeRuntimeErrorMsg(\"hack\", `Invalid IP/hostname: ${ip}.`);\n }\n\n if (server == null) {\n throw makeRuntimeErrorMsg(\"hack\", `Invalid IP/hostname: ${ip}.`);\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 `Executing ${ip} in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return netscriptDelay(hackingTime * 1000, workerScript).then(function () {\n if (workerScript.env.stopFlag) {\n return Promise.reject(workerScript);\n }\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) * (server.moneyAvailable / server.moneyMax));\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);\n workerScript.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n Player.recordMoneySource(moneyGained, \"hacking\");\n workerScript.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;\n workerScript.log(\n \"hack\",\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, moneyGained);\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 `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 if (typeof arg === \"object\") {\n out += JSON.stringify(arg);\n continue;\n }\n out += `${arg}`;\n }\n\n return out;\n };\n\n const helper = {\n updateDynamicRam: updateDynamicRam,\n makeRuntimeErrorMsg: makeRuntimeErrorMsg,\n string: (funcName: string, argName: string, v: any): string => {\n if (typeof v === \"string\") return v;\n if (typeof v === \"number\") return v + \"\"; // cast to string;\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a string`);\n },\n number: (funcName: string, argName: string, v: any): number => {\n if (typeof v === \"number\") return v;\n if (!isNaN(v) && !isNaN(parseFloat(v))) return parseFloat(v);\n throw makeRuntimeErrorMsg(funcName, `${argName} should be a number`);\n },\n boolean: (v: any): boolean => {\n return !!v; // Just convert it to boolean.\n },\n };\n\n const gang = NetscriptGang(Player, workerScript, helper);\n const sleeve = NetscriptSleeve(Player, workerScript, helper);\n const extra = NetscriptExtra(Player, workerScript);\n const hacknet = NetscriptHacknet(Player, workerScript, helper);\n\n const functions = {\n hacknet: hacknet,\n sprintf: sprintf,\n vsprintf: vsprintf,\n scan: function (ip: any = workerScript.hostname): any {\n updateDynamicRam(\"scan\", getRamCost(\"scan\"));\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scan\", `Invalid IP/hostname: ${ip}.`);\n }\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) {\n continue;\n }\n out.push(entry);\n }\n workerScript.log(\"scan\", `returned ${server.serversOnNetwork.length} connections for ${server.hostname}`);\n return out;\n },\n hack: function (ip: any, { threads: requestedThreads, stock }: any = {}): any {\n updateDynamicRam(\"hack\", getRamCost(\"hack\"));\n return hack(ip, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads: function (ip: any, hackAmount: any): any {\n updateDynamicRam(\"hackAnalyzeThreads\", getRamCost(\"hackAnalyzeThreads\"));\n\n // Check argument validity\n const server = safeGetServer(ip, \"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 growth argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`,\n );\n }\n\n if (hackAmount < 0 || hackAmount > server.moneyAvailable) {\n return -1;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyzePercent: function (ip: any): any {\n updateDynamicRam(\"hackAnalyzePercent\", getRamCost(\"hackAnalyzePercent\"));\n\n const server = safeGetServer(ip, \"hackAnalyzePercent\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackAnalyzePercent\", \"Cannot be executed on this server.\");\n return false;\n }\n\n return calculatePercentMoneyHacked(server, Player) * 100;\n },\n hackChance: function (ip: any): any {\n updateDynamicRam(\"hackChance\", getRamCost(\"hackChance\"));\n\n const server = safeGetServer(ip, \"hackChance\");\n if (!(server instanceof Server)) {\n workerScript.log(\"hackChance\", \"Cannot be executed on this server.\");\n return false;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep: function (time: any): any {\n if (time === undefined) {\n throw makeRuntimeErrorMsg(\"sleep\", \"Takes 1 argument.\");\n }\n workerScript.log(\"sleep\", `Sleeping for ${time} milliseconds`);\n return netscriptDelay(time, workerScript).then(function () {\n return Promise.resolve(true);\n });\n },\n grow: function (ip: any, { threads: requestedThreads, stock }: any = {}): any {\n updateDynamicRam(\"grow\", getRamCost(\"grow\"));\n const threads = resolveNetscriptRequestedThreads(workerScript, \"grow\", requestedThreads);\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"grow\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"grow\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"grow\", `Invalid IP/hostname: ${ip}.`);\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 `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 if (workerScript.env.stopFlag) {\n return Promise.reject(workerScript);\n }\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 `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 (ip: any, growth: any, cores: any = 1): any {\n updateDynamicRam(\"growthAnalyze\", getRamCost(\"growthAnalyze\"));\n\n // Check argument validity\n const server = safeGetServer(ip, \"growthAnalyze\");\n if (!(server instanceof Server)) {\n workerScript.log(\"growthAnalyze\", \"Cannot be executed on this server.\");\n return false;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw makeRuntimeErrorMsg(\"growthAnalyze\", `Invalid argument: growth must be numeric and >= 1, is ${growth}.`);\n }\n\n return numCycleForGrowth(server, Number(growth), Player, cores);\n },\n weaken: function (ip: any, { threads: requestedThreads }: any = {}): any {\n updateDynamicRam(\"weaken\", getRamCost(\"weaken\"));\n const threads = resolveNetscriptRequestedThreads(workerScript, \"weaken\", requestedThreads);\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"weaken\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"weaken\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"weaken\", `Invalid IP/hostname: ${ip}`);\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 `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 if (workerScript.env.stopFlag) return Promise.reject(workerScript);\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 `'${server.hostname}' security level weakened to ${server.hackDifficulty}. Gained ${numeralWrapper.formatExp(\n expGain,\n )} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n return Promise.resolve(CONSTANTS.ServerWeakenAmount * threads);\n });\n },\n print: function (...args: any[]): void {\n if (args.length === 0) {\n throw makeRuntimeErrorMsg(\"print\", \"Takes at least 1 argument.\");\n }\n workerScript.print(argsToString(args));\n },\n tprint: function (...args: any[]): void {\n if (args.length === 0) {\n throw makeRuntimeErrorMsg(\"tprint\", \"Takes at least 1 argument.\");\n }\n Terminal.print(`${workerScript.scriptRef.filename}: ${argsToString(args)}`);\n },\n tprintf: function (format: any, ...args: any): any {\n Terminal.print(vsprintf(format, args));\n },\n clearLog: function (): any {\n workerScript.scriptRef.clearLog();\n },\n disableLog: function (fn: any): any {\n if (fn === \"ALL\") {\n for (fn in possibleLogs) {\n workerScript.disableLogs[fn] = true;\n }\n workerScript.log(\"disableLog\", `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"disableLog\", `Invalid argument: ${fn}.`);\n } else {\n workerScript.disableLogs[fn] = true;\n workerScript.log(\"disableLog\", `Disabled logging for ${fn}`);\n }\n },\n enableLog: function (fn: any): any {\n if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"enableLog\", `Invalid argument: ${fn}.`);\n }\n delete workerScript.disableLogs[fn];\n workerScript.log(\"enableLog\", `Enabled logging for ${fn}`);\n },\n isLogEnabled: function (fn: any): any {\n if (possibleLogs[fn] === undefined) {\n throw makeRuntimeErrorMsg(\"isLogEnabled\", `Invalid argument: ${fn}.`);\n }\n return workerScript.disableLogs[fn] ? false : true;\n },\n getScriptLogs: function (fn: any, ip: any, ...scriptArgs: any): any {\n const runningScriptObj = getRunningScript(fn, ip, \"getScriptLogs\", scriptArgs);\n if (runningScriptObj == null) {\n workerScript.log(\"getScriptLogs\", getCannotFindRunningScriptErrorMessage(fn, ip, scriptArgs));\n return \"\";\n }\n\n return runningScriptObj.logs.slice();\n },\n tail: function (fn: any, ip: any = workerScript.hostname, ...scriptArgs: any): any {\n let runningScriptObj;\n if (arguments.length === 0) {\n runningScriptObj = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScriptObj = getRunningScriptByPid(fn, \"tail\");\n } else {\n runningScriptObj = getRunningScript(fn, ip, \"tail\", scriptArgs);\n }\n if (runningScriptObj == null) {\n workerScript.log(\"tail\", getCannotFindRunningScriptErrorMessage(fn, ip, scriptArgs));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n nuke: function (ip: any): any {\n updateDynamicRam(\"nuke\", getRamCost(\"nuke\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"nuke\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"nuke\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"nuke\", `Invalid IP/hostname: ${ip}.`);\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 if (server.hasAdminRights) {\n workerScript.log(\"nuke\", `Already have root access to '${server.hostname}'.`);\n } else {\n server.hasAdminRights = true;\n workerScript.log(\"nuke\", `Executed NUKE.exe virus on '${server.hostname}' to gain root access.`);\n }\n return true;\n },\n brutessh: function (ip: any): any {\n updateDynamicRam(\"brutessh\", getRamCost(\"brutessh\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"brutessh\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"brutessh\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"brutessh\", `Invalid IP/hostname: ${ip}.`);\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 (ip: any): any {\n updateDynamicRam(\"ftpcrack\", getRamCost(\"ftpcrack\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"ftpcrack\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"ftpcrack\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"ftpcrack\", `Invalid IP/hostname: ${ip}.`);\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 (ip: any): any {\n updateDynamicRam(\"relaysmtp\", getRamCost(\"relaysmtp\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"relaysmtp\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"relaysmtp\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"relaysmtp\", `Invalid IP/hostname: ${ip}.`);\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 (ip: any): any {\n updateDynamicRam(\"httpworm\", getRamCost(\"httpworm\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"httpworm\", \"Takes 1 argument\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"httpworm\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"httpworm\", `Invalid IP/hostname: ${ip}`);\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 (ip: any): any {\n updateDynamicRam(\"sqlinject\", getRamCost(\"sqlinject\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"sqlinject\", \"Takes 1 argument.\");\n }\n const server = GetServer(ip);\n if (!(server instanceof Server)) {\n workerScript.log(\"sqlinject\", \"Cannot be executed on this server.\");\n return false;\n }\n if (server == null) {\n throw makeRuntimeErrorMsg(\"sqlinject\", `Invalid IP/hostname: ${ip}`);\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw makeRuntimeErrorMsg(\"sqlinject\", \"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n workerScript.log(\"sqlinject\", `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n workerScript.log(\"sqlinject\", `SQL Port (1433) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n run: function (scriptname: any, threads: any = 1, ...args: any[]): any {\n updateDynamicRam(\"run\", getRamCost(\"run\"));\n if (scriptname === undefined) {\n throw makeRuntimeErrorMsg(\"run\", \"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"run\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"run\", \"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(\"run\", scriptServer, scriptname, args, workerScript, threads);\n },\n exec: function (scriptname: any, ip: any, threads: any = 1, ...args: any[]): any {\n updateDynamicRam(\"exec\", getRamCost(\"exec\"));\n if (scriptname === undefined || ip === 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 = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"exec\", `Invalid IP/hostname: ${ip}`);\n }\n return runScriptFromScript(\"exec\", server, scriptname, args, workerScript, threads);\n },\n spawn: function (scriptname: any, threads: any, ...args: any[]): any {\n updateDynamicRam(\"spawn\", getRamCost(\"spawn\"));\n if (!scriptname || !threads) {\n throw makeRuntimeErrorMsg(\"spawn\", \"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"spawn\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"spawn\", \"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(\"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, ip: any, ...scriptArgs: any): any {\n updateDynamicRam(\"kill\", getRamCost(\"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/ip\n if (filename === undefined || ip === undefined) {\n throw makeRuntimeErrorMsg(\"kill\", \"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = safeGetServer(ip);\n const runningScriptObj = getRunningScript(filename, ip, \"kill\", scriptArgs);\n if (runningScriptObj == null) {\n workerScript.log(\"kill\", getCannotFindRunningScriptErrorMessage(filename, ip, 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(\"kill\", `Killing '${filename}' on '${ip}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n workerScript.log(\"kill\", `No script with PID ${filename}`);\n } else {\n workerScript.log(\"kill\", `No such script '${filename}' on '${ip}' with args: ${arrayToString(scriptArgs)}`);\n }\n return false;\n }\n },\n killall: function (ip: any = workerScript.hostname): any {\n updateDynamicRam(\"killall\", getRamCost(\"killall\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"killall\", \"Takes 1 argument\");\n }\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"killall\", `Invalid IP/hostname: ${ip}`);\n }\n const scriptsRunning = server.runningScripts.length > 0;\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n killWorkerScript(server.runningScripts[i], server.hostname, false);\n }\n WorkerScriptStartStopEventEmitter.emit();\n workerScript.log(\n \"killall\",\n `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`,\n );\n\n return scriptsRunning;\n },\n exit: function (): any {\n workerScript.running = false; // Prevent workerScript from \"finishing execution naturally\"\n if (killWorkerScript(workerScript)) {\n workerScript.log(\"exit\", \"Exiting...\");\n } else {\n workerScript.log(\"exit\", \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp: function (scriptname: any, ip1: any, ip2: any): any {\n updateDynamicRam(\"scp\", getRamCost(\"scp\"));\n if (arguments.length !== 2 && arguments.length !== 3) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n if (scriptname && scriptname.constructor === Array) {\n // Recursively call scp on all elements of array\n let res = false;\n scriptname.forEach(function (script) {\n if (NetscriptFunctions(workerScript).scp(script, ip1, ip2)) {\n res = true;\n }\n });\n return res;\n }\n\n // Invalid file type\n if (!isValidFilePath(scriptname)) {\n throw makeRuntimeErrorMsg(\"scp\", `Invalid filename: '${scriptname}'`);\n }\n\n // Invalid file name\n if (!scriptname.endsWith(\".lit\") && !isScriptFilename(scriptname) && !scriptname.endsWith(\"txt\")) {\n throw makeRuntimeErrorMsg(\"scp\", \"Only works for .script, .lit, and .txt files\");\n }\n\n let destServer, currServ;\n\n if (ip2 != null) {\n // 3 Argument version: scriptname, source, destination\n if (scriptname === undefined || ip1 === undefined || ip2 === undefined) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n destServer = GetServer(ip2);\n if (destServer == null) {\n throw makeRuntimeErrorMsg(\"scp\", `Invalid IP/hostname: ${ip2}`);\n }\n\n currServ = GetServer(ip1);\n if (currServ == null) {\n throw makeRuntimeErrorMsg(\"scp\", `Invalid IP/hostname: ${ip1}`);\n }\n } else if (ip1 != null) {\n // 2 Argument version: scriptname, destination\n if (scriptname === undefined || ip1 === undefined) {\n throw makeRuntimeErrorMsg(\"scp\", \"Takes 2 or 3 arguments\");\n }\n destServer = GetServer(ip1);\n if (destServer == null) {\n throw makeRuntimeErrorMsg(\"scp\", `Invalid IP/hostname: ${ip1}`);\n }\n\n currServ = GetServer(workerScript.hostname);\n if (currServ == null) {\n throw makeRuntimeErrorMsg(\"scp\", \"Could not find server ip for this script. This is a bug. Report to dev.\");\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] instanceof Message) && 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 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 true; // Already exists\n }\n }\n destServer.messages.push(scriptname);\n workerScript.log(\"scp\", `File '${scriptname}' copied over to '${destServer.hostname}'.`);\n return 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 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 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 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 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 true;\n oldScript.code = sourceScript.code;\n oldScript.ramUsage = sourceScript.ramUsage;\n oldScript.markUpdated();\n return true;\n }\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(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 true;\n },\n ls: function (ip: any, grep: any): any {\n updateDynamicRam(\"ls\", getRamCost(\"ls\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"ls\", \"Usage: ls(ip/hostname, [grep filter])\");\n }\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"ls\", `Invalid IP/hostname: ${ip}`);\n }\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 instanceof Message) {\n if (msg.filename.includes(filter)) {\n allFiles.push(msg.filename);\n }\n } else if (msg.includes(filter)) {\n allFiles.push(msg);\n }\n } else {\n const msg = server.messages[i];\n if (msg instanceof Message) {\n allFiles.push(msg.filename);\n } else {\n allFiles.push(msg);\n }\n }\n }\n\n for (let i = 0; i < server.textFiles.length; i++) {\n if (filter) {\n if (server.textFiles[i].fn.includes(filter)) {\n allFiles.push(server.textFiles[i].fn);\n }\n } else {\n allFiles.push(server.textFiles[i].fn);\n }\n }\n\n for (let i = 0; i < server.contracts.length; ++i) {\n if (filter) {\n if (server.contracts[i].fn.includes(filter)) {\n allFiles.push(server.contracts[i].fn);\n }\n } else {\n allFiles.push(server.contracts[i].fn);\n }\n }\n\n // Sort the files alphabetically then print each\n allFiles.sort();\n return allFiles;\n },\n ps: function (ip: any = workerScript.hostname): any {\n updateDynamicRam(\"ps\", getRamCost(\"ps\"));\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"ps\", `Invalid IP/hostname: ${ip}`);\n }\n const processes = [];\n for (const i in server.runningScripts) {\n const script = server.runningScripts[i];\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 (ip: any): any {\n updateDynamicRam(\"hasRootAccess\", getRamCost(\"hasRootAccess\"));\n if (ip === undefined) {\n throw makeRuntimeErrorMsg(\"hasRootAccess\", \"Takes 1 argument\");\n }\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"hasRootAccess\", `Invalid IP/hostname: ${ip}`);\n }\n return server.hasAdminRights;\n },\n getIp: function (): any {\n updateDynamicRam(\"getIp\", getRamCost(\"getIp\"));\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"getIp\", \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.hostname;\n },\n getHostname: function (): any {\n updateDynamicRam(\"getHostname\", getRamCost(\"getHostname\"));\n const scriptServer = GetServer(workerScript.hostname);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"getHostname\", \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.hostname;\n },\n getHackingLevel: function (): any {\n updateDynamicRam(\"getHackingLevel\", getRamCost(\"getHackingLevel\"));\n Player.updateSkillLevels();\n workerScript.log(\"getHackingLevel\", `returned ${Player.hacking_skill}`);\n return Player.hacking_skill;\n },\n getHackingMultipliers: function (): any {\n updateDynamicRam(\"getHackingMultipliers\", getRamCost(\"getHackingMultipliers\"));\n return {\n chance: Player.hacking_chance_mult,\n speed: Player.hacking_speed_mult,\n money: Player.hacking_money_mult,\n growth: Player.hacking_grow_mult,\n };\n },\n getHacknetMultipliers: function (): any {\n updateDynamicRam(\"getHacknetMultipliers\", getRamCost(\"getHacknetMultipliers\"));\n return {\n production: Player.hacknet_node_money_mult,\n purchaseCost: Player.hacknet_node_purchase_cost_mult,\n ramCost: Player.hacknet_node_ram_cost_mult,\n coreCost: Player.hacknet_node_core_cost_mult,\n levelCost: Player.hacknet_node_level_cost_mult,\n };\n },\n getBitNodeMultipliers: function (): any {\n updateDynamicRam(\"getBitNodeMultipliers\", getRamCost(\"getBitNodeMultipliers\"));\n if (SourceFileFlags[5] <= 0 && Player.bitNodeN !== 5) {\n throw makeRuntimeErrorMsg(\"getBitNodeMultipliers\", \"Requires Source-File 5 to run.\");\n }\n const copy = Object.assign({}, BitNodeMultipliers);\n return copy;\n },\n getServer: function (ip: any): any {\n updateDynamicRam(\"getServer\", getRamCost(\"getServer\"));\n const server = safeGetServer(ip, \"getServer\");\n const copy = Object.assign({}, server);\n // These fields should be hidden.\n copy.contracts = [];\n copy.messages = [];\n copy.runningScripts = [];\n copy.scripts = [];\n copy.textFiles = [];\n copy.programs = [];\n copy.serversOnNetwork = [];\n return copy;\n },\n getServerMoneyAvailable: function (ip: any): any {\n updateDynamicRam(\"getServerMoneyAvailable\", getRamCost(\"getServerMoneyAvailable\"));\n const server = safeGetServer(ip, \"getServerMoneyAvailable\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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.toNumber())}`,\n );\n return Player.money.toNumber();\n }\n workerScript.log(\n \"getServerMoneyAvailable\",\n `returned ${numeralWrapper.formatMoney(server.moneyAvailable)} for '${server.hostname}'`,\n );\n return server.moneyAvailable;\n },\n getServerSecurityLevel: function (ip: any): any {\n updateDynamicRam(\"getServerSecurityLevel\", getRamCost(\"getServerSecurityLevel\"));\n const server = safeGetServer(ip, \"getServerSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerBaseSecurityLevel\", getRamCost(\"getServerBaseSecurityLevel\"));\n const server = safeGetServer(ip, \"getServerBaseSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerMinSecurityLevel\", getRamCost(\"getServerMinSecurityLevel\"));\n const server = safeGetServer(ip, \"getServerMinSecurityLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerRequiredHackingLevel\", getRamCost(\"getServerRequiredHackingLevel\"));\n const server = safeGetServer(ip, \"getServerRequiredHackingLevel\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerMaxMoney\", getRamCost(\"getServerMaxMoney\"));\n const server = safeGetServer(ip, \"getServerMaxMoney\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerGrowth\", getRamCost(\"getServerGrowth\"));\n const server = safeGetServer(ip, \"getServerGrowth\");\n if (!(server instanceof Server)) {\n workerScript.log(\"getServerNumPortsRequired\", \"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 (ip: any): any {\n updateDynamicRam(\"getServerNumPortsRequired\", getRamCost(\"getServerNumPortsRequired\"));\n const server = safeGetServer(ip, \"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(\"getServerNumPortsRequired\", `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam: function (ip: any): any {\n updateDynamicRam(\"getServerRam\", getRamCost(\"getServerRam\"));\n const server = safeGetServer(ip, \"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 (ip: any): any {\n updateDynamicRam(\"getServerMaxRam\", getRamCost(\"getServerMaxRam\"));\n const server = safeGetServer(ip, \"getServerMaxRam\");\n workerScript.log(\"getServerMaxRam\", `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam: function (ip: any): any {\n updateDynamicRam(\"getServerUsedRam\", getRamCost(\"getServerUsedRam\"));\n const server = safeGetServer(ip, \"getServerUsedRam\");\n workerScript.log(\"getServerUsedRam\", `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists: function (ip: any): any {\n updateDynamicRam(\"serverExists\", getRamCost(\"serverExists\"));\n return GetServer(ip) !== null;\n },\n fileExists: function (filename: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"fileExists\", getRamCost(\"fileExists\"));\n if (filename === undefined) {\n throw makeRuntimeErrorMsg(\"fileExists\", \"Usage: fileExists(scriptname, [server])\");\n }\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"fileExists\", `Invalid IP/hostname: ${ip}`);\n }\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 (!(server.messages[i] instanceof Message) && filename.toLowerCase() === server.messages[i]) {\n return true;\n }\n }\n const txtFile = getTextFile(filename, server);\n if (txtFile != null) {\n return true;\n }\n return false;\n },\n isRunning: function (fn: any, ip: any = workerScript.hostname, ...scriptArgs: any): any {\n updateDynamicRam(\"isRunning\", getRamCost(\"isRunning\"));\n if (fn === undefined || ip === 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, ip, \"isRunning\", scriptArgs) != null;\n }\n },\n getStockSymbols: function (): any {\n updateDynamicRam(\"getStockSymbols\", getRamCost(\"getStockSymbols\"));\n checkTixApiAccess(\"getStockSymbols\");\n return Object.values(StockSymbols);\n },\n getStockPrice: function (symbol: any): any {\n updateDynamicRam(\"getStockPrice\", getRamCost(\"getStockPrice\"));\n checkTixApiAccess(\"getStockPrice\");\n const stock = getStockFromSymbol(symbol, \"getStockPrice\");\n\n return stock.price;\n },\n getStockAskPrice: function (symbol: any): any {\n updateDynamicRam(\"getStockAskPrice\", getRamCost(\"getStockAskPrice\"));\n checkTixApiAccess(\"getStockAskPrice\");\n const stock = getStockFromSymbol(symbol, \"getStockAskPrice\");\n\n return stock.getAskPrice();\n },\n getStockBidPrice: function (symbol: any): any {\n updateDynamicRam(\"getStockBidPrice\", getRamCost(\"getStockBidPrice\"));\n checkTixApiAccess(\"getStockBidPrice\");\n const stock = getStockFromSymbol(symbol, \"getStockBidPrice\");\n\n return stock.getBidPrice();\n },\n getStockPosition: function (symbol: any): any {\n updateDynamicRam(\"getStockPosition\", getRamCost(\"getStockPosition\"));\n checkTixApiAccess(\"getStockPosition\");\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw makeRuntimeErrorMsg(\"getStockPosition\", `Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getStockMaxShares: function (symbol: any): any {\n updateDynamicRam(\"getStockMaxShares\", getRamCost(\"getStockMaxShares\"));\n checkTixApiAccess(\"getStockMaxShares\");\n const stock = getStockFromSymbol(symbol, \"getStockMaxShares\");\n\n return stock.maxShares;\n },\n getStockPurchaseCost: function (symbol: any, shares: any, posType: any): any {\n updateDynamicRam(\"getStockPurchaseCost\", getRamCost(\"getStockPurchaseCost\"));\n checkTixApiAccess(\"getStockPurchaseCost\");\n const stock = getStockFromSymbol(symbol, \"getStockPurchaseCost\");\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 getStockSaleGain: function (symbol: any, shares: any, posType: any): any {\n updateDynamicRam(\"getStockSaleGain\", getRamCost(\"getStockSaleGain\"));\n checkTixApiAccess(\"getStockSaleGain\");\n const stock = getStockFromSymbol(symbol, \"getStockSaleGain\");\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 buyStock: function (symbol: any, shares: any): any {\n updateDynamicRam(\"buyStock\", getRamCost(\"buyStock\"));\n checkTixApiAccess(\"buyStock\");\n const stock = getStockFromSymbol(symbol, \"buyStock\");\n const res = buyStock(stock, shares, workerScript, {});\n return res ? stock.price : 0;\n },\n sellStock: function (symbol: any, shares: any): any {\n updateDynamicRam(\"sellStock\", getRamCost(\"sellStock\"));\n checkTixApiAccess(\"sellStock\");\n const stock = getStockFromSymbol(symbol, \"sellStock\");\n const res = sellStock(stock, shares, workerScript, {});\n\n return res ? stock.price : 0;\n },\n shortStock: function (symbol: any, shares: any): any {\n updateDynamicRam(\"shortStock\", getRamCost(\"shortStock\"));\n checkTixApiAccess(\"shortStock\");\n if (Player.bitNodeN !== 8) {\n if (SourceFileFlags[8] <= 1) {\n throw makeRuntimeErrorMsg(\n \"shortStock\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"shortStock\");\n const res = shortStock(stock, shares, workerScript, {});\n\n return res ? stock.price : 0;\n },\n sellShort: function (symbol: any, shares: any): any {\n updateDynamicRam(\"sellShort\", getRamCost(\"sellShort\"));\n checkTixApiAccess(\"sellShort\");\n if (Player.bitNodeN !== 8) {\n if (SourceFileFlags[8] <= 1) {\n throw makeRuntimeErrorMsg(\n \"sellShort\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"sellShort\");\n const res = sellShort(stock, shares, workerScript, {});\n\n return res ? stock.price : 0;\n },\n placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {\n updateDynamicRam(\"placeOrder\", getRamCost(\"placeOrder\"));\n checkTixApiAccess(\"placeOrder\");\n if (Player.bitNodeN !== 8) {\n if (SourceFileFlags[8] <= 2) {\n throw makeRuntimeErrorMsg(\n \"placeOrder\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"placeOrder\");\n\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw makeRuntimeErrorMsg(\"placeOrder\", `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw makeRuntimeErrorMsg(\"placeOrder\", `Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, workerScript);\n },\n cancelOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {\n updateDynamicRam(\"cancelOrder\", getRamCost(\"cancelOrder\"));\n checkTixApiAccess(\"cancelOrder\");\n if (Player.bitNodeN !== 8) {\n if (SourceFileFlags[8] <= 2) {\n throw makeRuntimeErrorMsg(\n \"cancelOrder\",\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(symbol, \"cancelOrder\");\n if (isNaN(shares) || isNaN(price)) {\n throw makeRuntimeErrorMsg(\n \"cancelOrder\",\n `Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`,\n );\n }\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw makeRuntimeErrorMsg(\"cancelOrder\", `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw makeRuntimeErrorMsg(\"cancelOrder\", `Invalid position type: ${pos}`);\n }\n const params = {\n stock: stock,\n shares: shares,\n price: price,\n type: orderType,\n pos: orderPos,\n };\n return cancelOrder(params, workerScript);\n },\n getOrders: function (): any {\n updateDynamicRam(\"getOrders\", getRamCost(\"getOrders\"));\n checkTixApiAccess(\"getOrders\");\n if (Player.bitNodeN !== 8) {\n if (SourceFileFlags[8] <= 2) {\n throw makeRuntimeErrorMsg(\"getOrders\", \"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 in 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 getStockVolatility: function (symbol: any): any {\n updateDynamicRam(\"getStockVolatility\", getRamCost(\"getStockVolatility\"));\n if (!Player.has4SDataTixApi) {\n throw makeRuntimeErrorMsg(\"getStockVolatility\", \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(symbol, \"getStockVolatility\");\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getStockForecast: function (symbol: any): any {\n updateDynamicRam(\"getStockForecast\", getRamCost(\"getStockForecast\"));\n if (!Player.has4SDataTixApi) {\n throw makeRuntimeErrorMsg(\"getStockForecast\", \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(symbol, \"getStockForecast\");\n\n let forecast = 50;\n stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);\n return forecast / 100; // Convert from percentage to decimal\n },\n purchase4SMarketData: function () {\n updateDynamicRam(\"purchase4SMarketData\", getRamCost(\"purchase4SMarketData\"));\n checkTixApiAccess(\"purchase4SMarketData\");\n\n if (Player.has4SData) {\n workerScript.log(\"purchase4SMarketData\", \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (Player.money.lt(getStockMarket4SDataCost())) {\n workerScript.log(\"purchase4SMarketData\", \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n Player.has4SData = true;\n Player.loseMoney(getStockMarket4SDataCost());\n workerScript.log(\"purchase4SMarketData\", \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: function () {\n updateDynamicRam(\"purchase4SMarketDataTixApi\", getRamCost(\"purchase4SMarketDataTixApi\"));\n checkTixApiAccess(\"purchase4SMarketDataTixApi\");\n\n if (Player.has4SDataTixApi) {\n workerScript.log(\"purchase4SMarketDataTixApi\", \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (Player.money.lt(getStockMarket4STixApiCost())) {\n workerScript.log(\"purchase4SMarketDataTixApi\", \"Not enough money to purchase 4S Market Data TIX API\");\n return false;\n }\n\n Player.has4SDataTixApi = true;\n Player.loseMoney(getStockMarket4STixApiCost());\n workerScript.log(\"purchase4SMarketDataTixApi\", \"Purchased 4S Market Data TIX API\");\n return true;\n },\n getPurchasedServerLimit: function (): any {\n updateDynamicRam(\"getPurchasedServerLimit\", getRamCost(\"getPurchasedServerLimit\"));\n\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: function (): any {\n updateDynamicRam(\"getPurchasedServerMaxRam\", getRamCost(\"getPurchasedServerMaxRam\"));\n\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost: function (ram: any): any {\n updateDynamicRam(\"getPurchasedServerCost\", getRamCost(\"getPurchasedServerCost\"));\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n workerScript.log(\"getPurchasedServerCost\", `Invalid argument: ram='${ram}'`);\n return Infinity;\n }\n\n return cost;\n },\n purchaseServer: function (hostname: any, ram: any): any {\n updateDynamicRam(\"purchaseServer\", getRamCost(\"purchaseServer\"));\n let hostnameStr = String(hostname);\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 `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 workerScript.log(\"purchaseServer\", `Invalid argument: ram='${ram}'`);\n return \"\";\n }\n\n if (Player.money.lt(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);\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 (hostname: any): any {\n updateDynamicRam(\"deleteServer\", getRamCost(\"deleteServer\"));\n let hostnameStr = String(hostname);\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 if (server == null) {\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 ip = 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 (ip === 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 '${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 (ip == 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 ${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(ip);\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 (ip == 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 ${server.hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n },\n getPurchasedServers: function (hostname: any = true): any {\n updateDynamicRam(\"getPurchasedServers\", getRamCost(\"getPurchasedServers\"));\n const res: string[] = [];\n Player.purchasedServers.forEach(function (ip) {\n if (hostname) {\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getPurchasedServers\", \"Could not find server. This is a bug. Report to dev.\");\n }\n res.push(server.hostname);\n } else {\n res.push(ip);\n }\n });\n return res;\n },\n write: function (port: any, data: any = \"\", mode: any = \"a\"): any {\n updateDynamicRam(\"write\", getRamCost(\"write\"));\n if (!isNaN(port)) {\n // Write to port\n // Port 1-10\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"write\",\n `Trying to write to 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(\"write\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport.write(data);\n } else 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) {\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(fn, data, server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(server.scripts);\n }\n mode === \"w\" ? (script.code = data) : (script.code += data);\n return script.updateRamUsage(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 tryWrite: function (port: any, data: any = \"\"): any {\n updateDynamicRam(\"tryWrite\", getRamCost(\"tryWrite\"));\n if (!isNaN(port)) {\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"tryWrite\",\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(\"tryWrite\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport.tryWrite(data);\n } else {\n throw makeRuntimeErrorMsg(\"tryWrite\", `Invalid argument: ${port}`);\n }\n },\n read: function (port: any): any {\n updateDynamicRam(\"read\", getRamCost(\"read\"));\n if (!isNaN(port)) {\n // Read from port\n // Port 1-10\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"read\",\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(\"read\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n const x = iport.read();\n console.log(x);\n return x;\n } else if (isString(port)) {\n // Read from script or text file\n const fn = port;\n const server = GetServer(workerScript.hostname);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"read\", \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n const txtFile = getTextFile(fn, server);\n if (txtFile !== null) {\n return txtFile.text;\n } else {\n return \"\";\n }\n }\n } else {\n throw makeRuntimeErrorMsg(\"read\", `Invalid argument: ${port}`);\n }\n },\n peek: function (port: any): any {\n updateDynamicRam(\"peek\", getRamCost(\"peek\"));\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n \"peek\",\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 \"peek\",\n `Invalid argument. Must be a port number between 1 and ${CONSTANTS.NumNetscriptPorts}, is ${port}`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw makeRuntimeErrorMsg(\"peek\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n const x = iport.peek();\n console.log(x);\n return x;\n },\n clear: function (port: any): any {\n updateDynamicRam(\"clear\", getRamCost(\"clear\"));\n if (!isNaN(port)) {\n // Clear port\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"clear\",\n `Trying to clear 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(\"clear\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport.clear();\n } else if (isString(port)) {\n // Clear text file\n const fn = port;\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: ${port}`);\n }\n return 0;\n },\n getPortHandle: function (port: any): any {\n updateDynamicRam(\"getPortHandle\", getRamCost(\"getPortHandle\"));\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n \"getPortHandle\",\n `Invalid port: ${port} Must be an integer between 1 and ${CONSTANTS.NumNetscriptPorts}.`,\n );\n }\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n \"getPortHandle\",\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(\"getPortHandle\", `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport;\n },\n rm: function (fn: any, ip: any): any {\n updateDynamicRam(\"rm\", getRamCost(\"rm\"));\n\n if (ip == null || ip === \"\") {\n ip = workerScript.hostname;\n }\n const s = safeGetServer(ip, \"rm\");\n\n const status = s.removeFile(fn);\n if (!status.res) {\n workerScript.log(\"rm\", status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning: function (scriptname: any, ip: any): any {\n updateDynamicRam(\"scriptRunning\", getRamCost(\"scriptRunning\"));\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scriptRunning\", `Invalid IP/hostname: ${ip}`);\n }\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n return true;\n }\n }\n return false;\n },\n scriptKill: function (scriptname: any, ip: any): any {\n updateDynamicRam(\"scriptKill\", getRamCost(\"scriptKill\"));\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scriptKill\", `Invalid IP/hostname: ${ip}`);\n }\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 }\n }\n return suc;\n },\n getScriptName: function (): any {\n return workerScript.name;\n },\n getScriptRam: function (scriptname: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"getScriptRam\", getRamCost(\"getScriptRam\"));\n const server = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptRam\", `Invalid IP/hostname: ${ip}`);\n }\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, ip: any, ...args: any[]): any {\n updateDynamicRam(\"getRunningScript\", getRamCost(\"getRunningScript\"));\n\n let runningScript;\n if (args.length === 0) {\n runningScript = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScript = getRunningScriptByPid(fn, \"getRunningScript\");\n } else {\n const scriptArgs = [];\n for (let i = 2; i < args.length; ++i) {\n scriptArgs.push(args[i]);\n }\n runningScript = getRunningScript(fn, ip, \"getRunningScript\", scriptArgs);\n }\n if (runningScript === null) return null;\n return {\n args: runningScript.args.slice(),\n filename: runningScript.filename,\n logs: runningScript.logs.slice(),\n offlineExpGained: runningScript.offlineExpGained,\n offlineMoneyMade: runningScript.offlineMoneyMade,\n offlineRunningTime: runningScript.offlineRunningTime,\n onlineExpGained: runningScript.onlineExpGained,\n onlineMoneyMade: runningScript.onlineMoneyMade,\n onlineRunningTime: runningScript.onlineRunningTime,\n pid: runningScript.pid,\n ramUsage: runningScript.ramUsage,\n server: runningScript.server,\n threads: runningScript.threads,\n };\n },\n getHackTime: function (ip: any): any {\n updateDynamicRam(\"getHackTime\", getRamCost(\"getHackTime\"));\n const server = safeGetServer(ip, \"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); // Returns seconds\n },\n getGrowTime: function (ip: any): any {\n updateDynamicRam(\"getGrowTime\", getRamCost(\"getGrowTime\"));\n const server = safeGetServer(ip, \"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); // Returns seconds\n },\n getWeakenTime: function (ip: any): any {\n updateDynamicRam(\"getWeakenTime\", getRamCost(\"getWeakenTime\"));\n const server = safeGetServer(ip, \"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); // Returns seconds\n },\n getScriptIncome: function (scriptname: any, ip: any, ...args: any[]): any {\n updateDynamicRam(\"getScriptIncome\", getRamCost(\"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 = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptIncome\", `Invalid IP/hostnamed: ${ip}`);\n }\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, ip: any, ...args: any[]): any {\n updateDynamicRam(\"getScriptExpGain\", getRamCost(\"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 = GetServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptExpGain\", `Invalid IP/hostnamed: ${ip}`);\n }\n const runningScriptObj = findRunningScript(scriptname, args, server);\n if (runningScriptObj == null) {\n workerScript.log(\n \"getScriptExpGain\",\n `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(args)}`,\n );\n return -1;\n }\n return runningScriptObj.onlineExpGained / runningScriptObj.onlineRunningTime;\n }\n },\n nFormat: function (n: any, format: any): any {\n if (isNaN(n) || isNaN(parseFloat(n)) || typeof format !== \"string\") {\n return \"\";\n }\n\n return numeralWrapper.format(parseFloat(n), format);\n },\n tFormat: function (milliseconds: any, milliPrecision: any = false): any {\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: function (): any {\n updateDynamicRam(\"getTimeSinceLastAug\", getRamCost(\"getTimeSinceLastAug\"));\n return Player.playtimeSinceLastAug;\n },\n prompt: function (txt: any): any {\n if (!isString(txt)) {\n txt = JSON.stringify(txt);\n }\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n resolve: resolve,\n });\n });\n },\n wget: async function (url: any, target: any, ip: any = workerScript.hostname): Promise<boolean> {\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n workerScript.log(\"wget\", `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = safeGetServer(ip, \"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(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(\"wget\", `Successfully retrieved content and overwrote '${target}' on '${ip}'`);\n return resolve(true);\n }\n workerScript.log(\"wget\", `Successfully retrieved content to new file '${target}' on '${ip}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n workerScript.log(\"wget\", JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: function (): any {\n updateDynamicRam(\"getFavorToDonate\", getRamCost(\"getFavorToDonate\"));\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n\n /* Singularity Functions */\n universityCourse: function (universityName: any, className: any): any {\n updateDynamicRam(\"universityCourse\", getRamCost(\"universityCourse\"));\n checkSingularityAccess(\"universityCourse\", 1);\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"universityCourse\", txt);\n }\n\n let costMult, expMult;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase():\n if (Player.city != CityName.Aevum) {\n workerScript.log(\n \"universityCourse\",\n \"You cannot study at 'Summit University' because you are not in 'Aevum'.\",\n );\n return false;\n }\n Player.gotoLocation(LocationName.AevumSummitUniversity);\n costMult = 4;\n expMult = 3;\n break;\n case LocationName.Sector12RothmanUniversity.toLowerCase():\n if (Player.city != CityName.Sector12) {\n workerScript.log(\n \"universityCourse\",\n \"You cannot study at 'Rothman University' because you are not in 'Sector-12'.\",\n );\n return false;\n }\n Player.location = LocationName.Sector12RothmanUniversity;\n costMult = 3;\n expMult = 2;\n break;\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase():\n if (Player.city != CityName.Volhaven) {\n workerScript.log(\n \"universityCourse\",\n \"You cannot study at 'ZB Institute of Technology' because you are not in 'Volhaven'.\",\n );\n return false;\n }\n Player.location = LocationName.VolhavenZBInstituteOfTechnology;\n costMult = 5;\n expMult = 4;\n break;\n default:\n workerScript.log(\"universityCourse\", `Invalid university name: '${universityName}'.`);\n return false;\n }\n\n let task;\n switch (className.toLowerCase()) {\n case \"Study Computer Science\".toLowerCase():\n task = CONSTANTS.ClassStudyComputerScience;\n break;\n case \"Data Structures\".toLowerCase():\n task = CONSTANTS.ClassDataStructures;\n break;\n case \"Networks\".toLowerCase():\n task = CONSTANTS.ClassNetworks;\n break;\n case \"Algorithms\".toLowerCase():\n task = CONSTANTS.ClassAlgorithms;\n break;\n case \"Management\".toLowerCase():\n task = CONSTANTS.ClassManagement;\n break;\n case \"Leadership\".toLowerCase():\n task = CONSTANTS.ClassLeadership;\n break;\n default:\n workerScript.log(\"universityCourse\", `Invalid class name: ${className}.`);\n return false;\n }\n Player.startClass(Router, costMult, expMult, task);\n workerScript.log(\"universityCourse\", `Started ${task} at ${universityName}`);\n return true;\n },\n\n gymWorkout: function (gymName: any, stat: any): any {\n updateDynamicRam(\"gymWorkout\", getRamCost(\"gymWorkout\"));\n checkSingularityAccess(\"gymWorkout\", 1);\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"gymWorkout\", txt);\n }\n let costMult, expMult;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase():\n if (Player.city != CityName.Aevum) {\n workerScript.log(\"gymWorkout\", \"You cannot workout at 'Crush Fitness' because you are not in 'Aevum'.\");\n return false;\n }\n Player.location = LocationName.AevumCrushFitnessGym;\n costMult = 3;\n expMult = 2;\n break;\n case LocationName.AevumSnapFitnessGym.toLowerCase():\n if (Player.city != CityName.Aevum) {\n workerScript.log(\"gymWorkout\", \"You cannot workout at 'Snap Fitness' because you are not in 'Aevum'.\");\n return false;\n }\n Player.location = LocationName.AevumSnapFitnessGym;\n costMult = 10;\n expMult = 5;\n break;\n case LocationName.Sector12IronGym.toLowerCase():\n if (Player.city != CityName.Sector12) {\n workerScript.log(\"gymWorkout\", \"You cannot workout at 'Iron Gym' because you are not in 'Sector-12'.\");\n return false;\n }\n Player.location = LocationName.Sector12IronGym;\n costMult = 1;\n expMult = 1;\n break;\n case LocationName.Sector12PowerhouseGym.toLowerCase():\n if (Player.city != CityName.Sector12) {\n workerScript.log(\n \"gymWorkout\",\n \"You cannot workout at 'Powerhouse Gym' because you are not in 'Sector-12'.\",\n );\n return false;\n }\n Player.location = LocationName.Sector12PowerhouseGym;\n costMult = 20;\n expMult = 10;\n break;\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase():\n if (Player.city != CityName.Volhaven) {\n workerScript.log(\n \"gymWorkout\",\n \"You cannot workout at 'Millenium Fitness Gym' because you are not in 'Volhaven'.\",\n );\n return false;\n }\n Player.location = LocationName.VolhavenMilleniumFitnessGym;\n costMult = 7;\n expMult = 4;\n break;\n default:\n workerScript.log(\"gymWorkout\", `Invalid gym name: ${gymName}. gymWorkout() failed`);\n return false;\n }\n\n switch (stat.toLowerCase()) {\n case \"strength\".toLowerCase():\n case \"str\".toLowerCase():\n Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymStrength);\n break;\n case \"defense\".toLowerCase():\n case \"def\".toLowerCase():\n Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymDefense);\n break;\n case \"dexterity\".toLowerCase():\n case \"dex\".toLowerCase():\n Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymDexterity);\n break;\n case \"agility\".toLowerCase():\n case \"agi\".toLowerCase():\n Player.startClass(Router, costMult, expMult, CONSTANTS.ClassGymAgility);\n break;\n default:\n workerScript.log(\"gymWorkout\", `Invalid stat: ${stat}.`);\n return false;\n }\n workerScript.log(\"gymWorkout\", `Started training ${stat} at ${gymName}`);\n return true;\n },\n\n travelToCity: function (cityname: any): any {\n updateDynamicRam(\"travelToCity\", getRamCost(\"travelToCity\"));\n checkSingularityAccess(\"travelToCity\", 1);\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.lt(CONSTANTS.TravelCost)) {\n throw makeRuntimeErrorMsg(\"travelToCity\", \"Not enough money to travel.\");\n }\n Player.loseMoney(CONSTANTS.TravelCost);\n Player.city = cityname;\n workerScript.log(\"travelToCity\", `Traveled to ${cityname}`);\n return true;\n default:\n workerScript.log(\"travelToCity\", `Invalid city name: '${cityname}'.`);\n return false;\n }\n },\n\n purchaseTor: function (): any {\n updateDynamicRam(\"purchaseTor\", getRamCost(\"purchaseTor\"));\n checkSingularityAccess(\"purchaseTor\", 1);\n\n if (Player.hasTorRouter()) {\n workerScript.log(\"purchaseTor\", \"You already have a TOR router!\");\n return false;\n }\n\n if (Player.money.lt(CONSTANTS.TorRouterCost)) {\n workerScript.log(\"purchaseTor\", \"You cannot afford to purchase a Tor router.\");\n return false;\n }\n Player.loseMoney(CONSTANTS.TorRouterCost);\n\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: \"darkweb\",\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n\n Player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(Player.getHomeComputer().hostname);\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);\n workerScript.log(\"purchaseTor\", \"You have purchased a Tor router!\");\n return true;\n },\n purchaseProgram: function (programName: any): any {\n updateDynamicRam(\"purchaseProgram\", getRamCost(\"purchaseProgram\"));\n checkSingularityAccess(\"purchaseProgram\", 1);\n\n if (!Player.hasTorRouter()) {\n workerScript.log(\"purchaseProgram\", \"You do not have the TOR router.\");\n return false;\n }\n\n programName = programName.toLowerCase();\n\n let item = null;\n for (const key in DarkWebItems) {\n const i = DarkWebItems[key];\n if (i.program.toLowerCase() == programName) {\n item = i;\n }\n }\n\n if (item == null) {\n workerScript.log(\"purchaseProgram\", `Invalid program name: '${programName}.`);\n return false;\n }\n\n if (Player.money.lt(item.price)) {\n workerScript.log(\n \"purchaseProgram\",\n `Not enough money to purchase '${item.program}'. Need ${numeralWrapper.formatMoney(item.price)}`,\n );\n return false;\n }\n\n if (Player.hasProgram(item.program)) {\n workerScript.log(\"purchaseProgram\", `You already have the '${item.program}' program`);\n return true;\n }\n\n Player.loseMoney(item.price);\n Player.getHomeComputer().programs.push(item.program);\n workerScript.log(\n \"purchaseProgram\",\n `You have purchased the '${item.program}' program. The new program can be found on your home computer.`,\n );\n return true;\n },\n getCurrentServer: function (): any {\n updateDynamicRam(\"getCurrentServer\", getRamCost(\"getCurrentServer\"));\n checkSingularityAccess(\"getCurrentServer\", 1);\n return Player.getCurrentServer().hostname;\n },\n connect: function (hostname: any): any {\n updateDynamicRam(\"connect\", getRamCost(\"connect\"));\n checkSingularityAccess(\"connect\", 1);\n if (!hostname) {\n throw makeRuntimeErrorMsg(\"connect\", `Invalid hostname: '${hostname}'`);\n }\n\n const target = GetServer(hostname);\n if (target == null) {\n throw makeRuntimeErrorMsg(\"connect\", `Invalid hostname: '${hostname}'`);\n return;\n }\n\n if (hostname === \"home\") {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = Player.getHomeComputer().hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n\n const server = Player.getCurrentServer();\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const other = getServerOnNetwork(server, i);\n if (other === null) continue;\n if (other.hostname == hostname) {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = target.hostname;\n Player.getCurrentServer().isConnectedTo = true;\n Terminal.setcwd(\"/\");\n return true;\n }\n }\n\n return false;\n },\n manualHack: function (): any {\n updateDynamicRam(\"manualHack\", getRamCost(\"manualHack\"));\n checkSingularityAccess(\"manualHack\", 1);\n const server = Player.getCurrentServer();\n return hack(server.hostname, true);\n },\n installBackdoor: function (): any {\n updateDynamicRam(\"installBackdoor\", getRamCost(\"installBackdoor\"));\n checkSingularityAccess(\"installBackdoor\", 1);\n const baseserver = Player.getCurrentServer();\n if (!(baseserver instanceof Server)) {\n workerScript.log(\"installBackdoor\", \"cannot backdoor this kind of server\");\n return Promise.resolve();\n }\n const server = baseserver as Server;\n const installTime = (calculateHackingTime(server, Player) / 4) * 1000;\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server, Player);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(\"installBackdoor\", canHack.msg || \"\");\n }\n\n workerScript.log(\n \"installBackdoor\",\n `Installing backdoor on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(installTime, true)}`,\n );\n\n return netscriptDelay(installTime, workerScript).then(function () {\n if (workerScript.env.stopFlag) {\n return Promise.reject(workerScript);\n }\n workerScript.log(\"installBackdoor\", `Successfully installed backdoor on '${server.hostname}'`);\n\n server.backdoorInstalled = true;\n return Promise.resolve();\n });\n },\n getStats: function (): any {\n updateDynamicRam(\"getStats\", getRamCost(\"getStats\"));\n checkSingularityAccess(\"getStats\", 1);\n workerScript.log(\"getStats\", `getStats is deprecated, please use getPlayer`);\n\n return {\n hacking: Player.hacking_skill,\n strength: Player.strength,\n defense: Player.defense,\n dexterity: Player.dexterity,\n agility: Player.agility,\n charisma: Player.charisma,\n intelligence: Player.intelligence,\n };\n },\n getCharacterInformation: function (): any {\n updateDynamicRam(\"getCharacterInformation\", getRamCost(\"getCharacterInformation\"));\n checkSingularityAccess(\"getCharacterInformation\", 1);\n workerScript.log(\"getCharacterInformation\", `getCharacterInformation is deprecated, please use getPlayer`);\n\n return {\n bitnode: Player.bitNodeN,\n city: Player.city,\n factions: Player.factions.slice(),\n hp: Player.hp,\n jobs: Object.keys(Player.jobs),\n jobTitles: Object.values(Player.jobs),\n maxHp: Player.max_hp,\n mult: {\n agility: Player.agility_mult,\n agilityExp: Player.agility_exp_mult,\n companyRep: Player.company_rep_mult,\n crimeMoney: Player.crime_money_mult,\n crimeSuccess: Player.crime_success_mult,\n defense: Player.defense_mult,\n defenseExp: Player.defense_exp_mult,\n dexterity: Player.dexterity_mult,\n dexterityExp: Player.dexterity_exp_mult,\n factionRep: Player.faction_rep_mult,\n hacking: Player.hacking_mult,\n hackingExp: Player.hacking_exp_mult,\n strength: Player.strength_mult,\n strengthExp: Player.strength_exp_mult,\n workMoney: Player.work_money_mult,\n },\n timeWorked: Player.timeWorked,\n tor: Player.hasTorRouter(),\n workHackExpGain: Player.workHackExpGained,\n workStrExpGain: Player.workStrExpGained,\n workDefExpGain: Player.workDefExpGained,\n workDexExpGain: Player.workDexExpGained,\n workAgiExpGain: Player.workAgiExpGained,\n workChaExpGain: Player.workChaExpGained,\n workRepGain: Player.workRepGained,\n workMoneyGain: Player.workMoneyGained,\n hackingExp: Player.hacking_exp,\n strengthExp: Player.strength_exp,\n defenseExp: Player.defense_exp,\n dexterityExp: Player.dexterity_exp,\n agilityExp: Player.agility_exp,\n charismaExp: Player.charisma_exp,\n };\n },\n getPlayer: function (): any {\n updateDynamicRam(\"getPlayer\", getRamCost(\"getPlayer\"));\n\n const data = {\n hacking_skill: Player.hacking_skill,\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.toNumber(),\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 };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n hospitalize: function (): any {\n updateDynamicRam(\"hospitalize\", getRamCost(\"hospitalize\"));\n checkSingularityAccess(\"hospitalize\", 1);\n return Player.hospitalize();\n },\n isBusy: function (): any {\n updateDynamicRam(\"isBusy\", getRamCost(\"isBusy\"));\n checkSingularityAccess(\"isBusy\", 1);\n return Player.isWorking;\n },\n stopAction: function (): any {\n updateDynamicRam(\"stopAction\", getRamCost(\"stopAction\"));\n checkSingularityAccess(\"stopAction\", 1);\n if (Player.isWorking) {\n Router.toTerminal();\n const txt = Player.singularityStopWork();\n workerScript.log(\"stopAction\", txt);\n return true;\n }\n return false;\n },\n upgradeHomeRam: function (): any {\n updateDynamicRam(\"upgradeHomeRam\", getRamCost(\"upgradeHomeRam\"));\n checkSingularityAccess(\"upgradeHomeRam\", 2);\n\n // Check if we're at max RAM\n const homeComputer = Player.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n workerScript.log(\"upgradeHomeRam\", `Your home computer is at max RAM.`);\n return false;\n }\n\n const cost = Player.getUpgradeHomeRamCost();\n if (Player.money.lt(cost)) {\n workerScript.log(\"upgradeHomeRam\", `You don't have enough money. Need ${numeralWrapper.formatMoney(cost)}`);\n return false;\n }\n\n homeComputer.maxRam *= 2;\n Player.loseMoney(cost);\n\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);\n workerScript.log(\n \"upgradeHomeRam\",\n `Purchased additional RAM for home computer! It now has ${numeralWrapper.formatRAM(\n homeComputer.maxRam,\n )} of RAM.`,\n );\n return true;\n },\n getUpgradeHomeRamCost: function (): any {\n updateDynamicRam(\"getUpgradeHomeRamCost\", getRamCost(\"getUpgradeHomeRamCost\"));\n checkSingularityAccess(\"getUpgradeHomeRamCost\", 2);\n\n return Player.getUpgradeHomeRamCost();\n },\n workForCompany: function (companyName: any): any {\n updateDynamicRam(\"workForCompany\", getRamCost(\"workForCompany\"));\n checkSingularityAccess(\"workForCompany\", 2);\n\n // Sanitize input\n if (companyName == null) {\n companyName = Player.companyName;\n }\n\n // Make sure its a valid company\n if (companyName == null || companyName === \"\" || !(Companies[companyName] instanceof Company)) {\n workerScript.log(\"workForCompany\", `Invalid company: '${companyName}'`);\n return false;\n }\n\n // Make sure player is actually employed at the comapny\n if (!Object.keys(Player.jobs).includes(companyName)) {\n workerScript.log(\"workForCompany\", `You do not have a job at '${companyName}'`);\n return false;\n }\n\n // Check to make sure company position data is valid\n const companyPositionName = Player.jobs[companyName];\n const companyPosition = CompanyPositions[companyPositionName];\n if (companyPositionName === \"\" || !(companyPosition instanceof CompanyPosition)) {\n workerScript.log(\"workForCompany\", \"You do not have a job\");\n return false;\n }\n\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"workForCompany\", txt);\n }\n\n if (companyPosition.isPartTimeJob()) {\n Player.startWorkPartTime(Router, companyName);\n } else {\n Player.startWork(Router, companyName);\n }\n workerScript.log(\"workForCompany\", `Began working at '${Player.companyName}' as a '${companyPositionName}'`);\n return true;\n },\n applyToCompany: function (companyName: any, field: any): any {\n updateDynamicRam(\"applyToCompany\", getRamCost(\"applyToCompany\"));\n checkSingularityAccess(\"applyToCompany\", 2);\n getCompany(\"applyToCompany\", companyName);\n\n Player.location = companyName;\n let res;\n switch (field.toLowerCase()) {\n case \"software\":\n res = Player.applyForSoftwareJob(true);\n break;\n case \"software consultant\":\n res = Player.applyForSoftwareConsultantJob(true);\n break;\n case \"it\":\n res = Player.applyForItJob(true);\n break;\n case \"security engineer\":\n res = Player.applyForSecurityEngineerJob(true);\n break;\n case \"network engineer\":\n res = Player.applyForNetworkEngineerJob(true);\n break;\n case \"business\":\n res = Player.applyForBusinessJob(true);\n break;\n case \"business consultant\":\n res = Player.applyForBusinessConsultantJob(true);\n break;\n case \"security\":\n res = Player.applyForSecurityJob(true);\n break;\n case \"agent\":\n res = Player.applyForAgentJob(true);\n break;\n case \"employee\":\n res = Player.applyForEmployeeJob(true);\n break;\n case \"part-time employee\":\n res = Player.applyForPartTimeEmployeeJob(true);\n break;\n case \"waiter\":\n res = Player.applyForWaiterJob(true);\n break;\n case \"part-time waiter\":\n res = Player.applyForPartTimeWaiterJob(true);\n break;\n default:\n workerScript.log(\"applyToCompany\", `Invalid job: '${field}'.`);\n return false;\n }\n // TODO https://github.com/danielyxie/bitburner/issues/1378\n // The Player object's applyForJob function can return string with special error messages\n // if (isString(res)) {\n // workerScript.log(\"applyToCompany\", res);\n // return false;\n // }\n if (res) {\n workerScript.log(\n \"applyToCompany\",\n `You were offered a new job at '${companyName}' as a '${Player.jobs[companyName]}'`,\n );\n } else {\n workerScript.log(\n \"applyToCompany\",\n `You failed to get a new job/promotion at '${companyName}' in the '${field}' field.`,\n );\n }\n return res;\n },\n getCompanyRep: function (companyName: any): any {\n updateDynamicRam(\"getCompanyRep\", getRamCost(\"getCompanyRep\"));\n checkSingularityAccess(\"getCompanyRep\", 2);\n const company = getCompany(\"getCompanyRep\", companyName);\n return company.playerReputation;\n },\n getCompanyFavor: function (companyName: any): any {\n updateDynamicRam(\"getCompanyFavor\", getRamCost(\"getCompanyFavor\"));\n checkSingularityAccess(\"getCompanyFavor\", 2);\n const company = getCompany(\"getCompanyFavor\", companyName);\n return company.favor;\n },\n getCompanyFavorGain: function (companyName: any): any {\n updateDynamicRam(\"getCompanyFavorGain\", getRamCost(\"getCompanyFavorGain\"));\n checkSingularityAccess(\"getCompanyFavorGain\", 2);\n const company = getCompany(\"getCompanyFavorGain\", companyName);\n return company.getFavorGain()[0];\n },\n checkFactionInvitations: function (): any {\n updateDynamicRam(\"checkFactionInvitations\", getRamCost(\"checkFactionInvitations\"));\n checkSingularityAccess(\"checkFactionInvitations\", 2);\n // Make a copy of Player.factionInvitations\n return Player.factionInvitations.slice();\n },\n joinFaction: function (name: any): any {\n updateDynamicRam(\"joinFaction\", getRamCost(\"joinFaction\"));\n checkSingularityAccess(\"joinFaction\", 2);\n getFaction(\"joinFaction\", name);\n\n if (!Player.factionInvitations.includes(name)) {\n workerScript.log(\"joinFaction\", `You have not been invited by faction '${name}'`);\n return false;\n }\n const fac = Factions[name];\n joinFaction(fac);\n\n // Update Faction Invitation list to account for joined + banned factions\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == name || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);\n workerScript.log(\"joinFaction\", `Joined the '${name}' faction.`);\n return true;\n },\n workForFaction: function (name: any, type: any): any {\n updateDynamicRam(\"workForFaction\", getRamCost(\"workForFaction\"));\n checkSingularityAccess(\"workForFaction\", 2);\n getFaction(\"workForFaction\", name);\n\n // if the player is in a gang and the target faction is any of the gang faction, fail\n if (Player.inGang() && AllGangs[name] !== undefined) {\n workerScript.log(\"workForFaction\", `Faction '${name}' does not offer work at the moment.`);\n return;\n }\n\n if (!Player.factions.includes(name)) {\n workerScript.log(\"workForFaction\", `You are not a member of '${name}'`);\n return false;\n }\n\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"workForFaction\", txt);\n }\n\n const fac = Factions[name];\n // Arrays listing factions that allow each time of work\n const hackAvailable = [\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"BitRunners\",\n \"The Black Hand\",\n \"NiteSec\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Silhouette\",\n \"Netburners\",\n \"Tian Di Hui\",\n \"CyberSec\",\n ];\n const fdWkAvailable = [\n \"Illuminati\",\n \"Daedalus\",\n \"The Covenant\",\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"The Black Hand\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Dark Army\",\n \"The Syndicate\",\n \"Silhouette\",\n \"Tetrads\",\n \"Slum Snakes\",\n ];\n const scWkAvailable = [\n \"ECorp\",\n \"MegaCorp\",\n \"Bachman & Associates\",\n \"Blade Industries\",\n \"NWO\",\n \"Clarke Incorporated\",\n \"OmniTek Incorporated\",\n \"Four Sigma\",\n \"KuaiGong International\",\n \"Fulcrum Secret Technologies\",\n \"Chongqing\",\n \"Sector-12\",\n \"New Tokyo\",\n \"Aevum\",\n \"Ishima\",\n \"Volhaven\",\n \"Speakers for the Dead\",\n \"The Syndicate\",\n \"Tetrads\",\n \"Slum Snakes\",\n \"Tian Di Hui\",\n ];\n\n switch (type.toLowerCase()) {\n case \"hacking\":\n case \"hacking contracts\":\n case \"hackingcontracts\":\n if (!hackAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", `Faction '${fac.name}' do not need help with hacking contracts.`);\n return false;\n }\n Player.startFactionHackWork(Router, fac);\n workerScript.log(\"workForFaction\", `Started carrying out hacking contracts for '${fac.name}'`);\n return true;\n case \"field\":\n case \"fieldwork\":\n case \"field work\":\n if (!fdWkAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", `Faction '${fac.name}' do not need help with field missions.`);\n return false;\n }\n Player.startFactionFieldWork(Router, fac);\n workerScript.log(\"workForFaction\", `Started carrying out field missions for '${fac.name}'`);\n return true;\n case \"security\":\n case \"securitywork\":\n case \"security work\":\n if (!scWkAvailable.includes(fac.name)) {\n workerScript.log(\"workForFaction\", `Faction '${fac.name}' do not need help with security work.`);\n return false;\n }\n Player.startFactionSecurityWork(Router, fac);\n workerScript.log(\"workForFaction\", `Started carrying out security work for '${fac.name}'`);\n return true;\n default:\n workerScript.log(\"workForFaction\", `Invalid work type: '${type}`);\n }\n return true;\n },\n getFactionRep: function (name: any): any {\n updateDynamicRam(\"getFactionRep\", getRamCost(\"getFactionRep\"));\n checkSingularityAccess(\"getFactionRep\", 2);\n const faction = getFaction(\"getFactionRep\", name);\n return faction.playerReputation;\n },\n getFactionFavor: function (name: any): any {\n updateDynamicRam(\"getFactionFavor\", getRamCost(\"getFactionFavor\"));\n checkSingularityAccess(\"getFactionFavor\", 2);\n const faction = getFaction(\"getFactionFavor\", name);\n return faction.favor;\n },\n getFactionFavorGain: function (name: any): any {\n updateDynamicRam(\"getFactionFavorGain\", getRamCost(\"getFactionFavorGain\"));\n checkSingularityAccess(\"getFactionFavorGain\", 2);\n const faction = getFaction(\"getFactionFavorGain\", name);\n return faction.getFavorGain()[0];\n },\n donateToFaction: function (name: any, amt: any): any {\n updateDynamicRam(\"donateToFaction\", getRamCost(\"donateToFaction\"));\n checkSingularityAccess(\"donateToFaction\", 3);\n const faction = getFaction(\"donateToFaction\", name);\n\n if (typeof amt !== \"number\" || amt <= 0) {\n workerScript.log(\"donateToFaction\", `Invalid donation amount: '${amt}'.`);\n return false;\n }\n if (Player.money.lt(amt)) {\n workerScript.log(\n \"donateToFaction\",\n `You do not have enough money to donate ${numeralWrapper.formatMoney(amt)} to '${name}'`,\n );\n return false;\n }\n const repNeededToDonate = Math.round(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n if (faction.favor < repNeededToDonate) {\n workerScript.log(\n \"donateToFaction\",\n `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);\n workerScript.log(\n \"donateToFaction\",\n `${numeralWrapper.formatMoney(amt)} donated to '${name}' for ${numeralWrapper.formatReputation(\n repGain,\n )} reputation`,\n );\n return true;\n },\n createProgram: function (name: any): any {\n updateDynamicRam(\"createProgram\", getRamCost(\"createProgram\"));\n checkSingularityAccess(\"createProgram\", 3);\n\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"createProgram\", txt);\n }\n\n name = name.toLowerCase();\n\n let p = null;\n for (const key in Programs) {\n if (Programs[key].name.toLowerCase() == name) {\n p = Programs[key];\n }\n }\n\n if (p == null) {\n workerScript.log(\"createProgram\", `The specified program does not exist: '${name}`);\n return false;\n }\n\n if (Player.hasProgram(p.name)) {\n workerScript.log(\"createProgram\", `You already have the '${p.name}' program`);\n return false;\n }\n\n const create = p.create;\n if (create === null) {\n workerScript.log(\"createProgram\", `You cannot create the '${p.name}' program`);\n return false;\n }\n\n if (!create.req(Player)) {\n workerScript.log(\"createProgram\", `Hacking level is too low to create '${p.name}' (level ${create.level} req)`);\n return false;\n }\n\n Player.startCreateProgramWork(Router, p.name, create.time, create.level);\n workerScript.log(\"createProgram\", `Began creating program: '${name}'`);\n return true;\n },\n commitCrime: function (crimeRoughName: any): any {\n updateDynamicRam(\"commitCrime\", getRamCost(\"commitCrime\"));\n checkSingularityAccess(\"commitCrime\", 3);\n\n if (Player.isWorking) {\n const txt = Player.singularityStopWork();\n workerScript.log(\"commitCrime\", txt);\n }\n\n // Set Location to slums\n Player.gotoLocation(LocationName.Slums);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n // couldn't find crime\n throw makeRuntimeErrorMsg(\"commitCrime\", `Invalid crime: '${crimeRoughName}'`);\n }\n workerScript.log(\"commitCrime\", `Attempting to commit ${crime.name}...`);\n return crime.commit(Router, Player, 1, workerScript);\n },\n getCrimeChance: function (crimeRoughName: any): any {\n updateDynamicRam(\"getCrimeChance\", getRamCost(\"getCrimeChance\"));\n checkSingularityAccess(\"getCrimeChance\", 3);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw makeRuntimeErrorMsg(\"getCrimeChance\", `Invalid crime: ${crimeRoughName}`);\n }\n\n return crime.successRate(Player);\n },\n getCrimeStats: function (crimeRoughName: any): any {\n updateDynamicRam(\"getCrimeStats\", getRamCost(\"getCrimeStats\"));\n checkSingularityAccess(\"getCrimeStats\", 3);\n\n const crime = findCrime(crimeRoughName.toLowerCase());\n if (crime == null) {\n throw makeRuntimeErrorMsg(\"getCrimeStats\", `Invalid crime: ${crimeRoughName}`);\n }\n\n return Object.assign({}, crime);\n },\n getOwnedAugmentations: function (purchased: any = false): any {\n updateDynamicRam(\"getOwnedAugmentations\", getRamCost(\"getOwnedAugmentations\"));\n checkSingularityAccess(\"getOwnedAugmentations\", 3);\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 getOwnedSourceFiles: function (): any {\n updateDynamicRam(\"getOwnedSourceFiles\", getRamCost(\"getOwnedSourceFiles\"));\n checkSingularityAccess(\"getOwnedSourceFiles\", 3);\n const res = [];\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 });\n }\n return res;\n },\n getAugmentationsFromFaction: function (facname: any): any {\n updateDynamicRam(\"getAugmentationsFromFaction\", getRamCost(\"getAugmentationsFromFaction\"));\n checkSingularityAccess(\"getAugmentationsFromFaction\", 3);\n const faction = getFaction(\"getAugmentationsFromFaction\", facname);\n\n // If player has a gang with this faction, return all augmentations.\n if (Player.hasGangWith(facname)) {\n const res = [];\n for (const augName in Augmentations) {\n const aug = Augmentations[augName];\n if (!aug.isSpecial) {\n res.push(augName);\n }\n }\n\n return res;\n }\n\n return faction.augmentations.slice();\n },\n getAugmentationCost: function (name: any): any {\n updateDynamicRam(\"getAugmentationCost\", getRamCost(\"getAugmentationCost\"));\n checkSingularityAccess(\"getAugmentationCost\", 3);\n const aug = getAugmentation(\"getAugmentationCost\", name);\n return [aug.baseRepRequirement, aug.baseCost];\n },\n getAugmentationPrereq: function (name: any): any {\n updateDynamicRam(\"getAugmentationPrereq\", getRamCost(\"getAugmentationPrereq\"));\n checkSingularityAccess(\"getAugmentationPrereq\", 3);\n const aug = getAugmentation(\"getAugmentationPrereq\", name);\n return aug.prereqs.slice();\n },\n getAugmentationPrice: function (name: any): any {\n updateDynamicRam(\"getAugmentationPrice\", getRamCost(\"getAugmentationPrice\"));\n checkSingularityAccess(\"getAugmentationPrice\", 3);\n const aug = getAugmentation(\"getAugmentationPrice\", name);\n return aug.baseCost;\n },\n getAugmentationRepReq: function (name: any): any {\n updateDynamicRam(\"getAugmentationRepReq\", getRamCost(\"getAugmentationRepReq\"));\n checkSingularityAccess(\"getAugmentationRepReq\", 3);\n const aug = getAugmentation(\"getAugmentationRepReq\", name);\n return aug.baseRepRequirement;\n },\n getAugmentationStats: function (name: any): any {\n updateDynamicRam(\"getAugmentationStats\", getRamCost(\"getAugmentationStats\"));\n checkSingularityAccess(\"getAugmentationStats\", 3);\n const aug = getAugmentation(\"getAugmentationStats\", name);\n return Object.assign({}, aug.mults);\n },\n purchaseAugmentation: function (faction: any, name: any): any {\n updateDynamicRam(\"purchaseAugmentation\", getRamCost(\"purchaseAugmentation\"));\n checkSingularityAccess(\"purchaseAugmentation\", 3);\n const fac = getFaction(\"purchaseAugmentation\", faction);\n const aug = getAugmentation(\"purchaseAugmentation\", name);\n\n let augs = [];\n if (Player.hasGangWith(faction)) {\n for (const augName in Augmentations) {\n const tempAug = Augmentations[augName];\n if (!tempAug.isSpecial) {\n augs.push(augName);\n }\n }\n } else {\n augs = fac.augmentations;\n }\n\n if (!augs.includes(name)) {\n workerScript.log(\"purchaseAugmentation\", `Faction '${faction}' does not have the '${name}' 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 workerScript.log(\"purchaseAugmentation\", `You already have the '${name}' augmentation.`);\n return false;\n }\n }\n for (let j = 0; j < Player.augmentations.length; ++j) {\n if (Player.augmentations[j].name === aug.name) {\n workerScript.log(\"purchaseAugmentation\", `You already have the '${name}' augmentation.`);\n return false;\n }\n }\n }\n\n if (fac.playerReputation < aug.baseRepRequirement) {\n workerScript.log(\"purchaseAugmentation\", `You do not have enough reputation with '${fac.name}'.`);\n return false;\n }\n\n const res = purchaseAugmentation(aug, fac, true);\n workerScript.log(\"purchaseAugmentation\", res);\n if (isString(res) && res.startsWith(\"You purchased\")) {\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);\n return true;\n } else {\n return false;\n }\n },\n softReset: function (cbScript: any): any {\n updateDynamicRam(\"softReset\", getRamCost(\"softReset\"));\n checkSingularityAccess(\"softReset\", 3);\n\n workerScript.log(\"softReset\", \"Soft resetting. This will cause this script to be killed\");\n setTimeout(() => {\n prestigeAugmentation();\n runAfterReset(cbScript);\n }, 0);\n\n // Prevent workerScript from \"finishing execution naturally\"\n workerScript.running = false;\n killWorkerScript(workerScript);\n },\n installAugmentations: function (cbScript: any): any {\n updateDynamicRam(\"installAugmentations\", getRamCost(\"installAugmentations\"));\n checkSingularityAccess(\"installAugmentations\", 3);\n\n if (Player.queuedAugmentations.length === 0) {\n workerScript.log(\"installAugmentations\", \"You do not have any Augmentations to be installed.\");\n return false;\n }\n Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);\n workerScript.log(\"installAugmentations\", \"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 },\n\n // Gang API\n gang: gang,\n\n // Bladeburner API\n bladeburner: {\n getContractNames: function (): any {\n updateDynamicRam(\"getContractNames\", getRamCost(\"bladeburner\", \"getContractNames\"));\n checkBladeburnerAccess(\"getContractNames\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getContractNamesNetscriptFn();\n },\n getOperationNames: function (): any {\n updateDynamicRam(\"getOperationNames\", getRamCost(\"bladeburner\", \"getOperationNames\"));\n checkBladeburnerAccess(\"getOperationNames\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getOperationNamesNetscriptFn();\n },\n getBlackOpNames: function (): any {\n updateDynamicRam(\"getBlackOpNames\", getRamCost(\"bladeburner\", \"getBlackOpNames\"));\n checkBladeburnerAccess(\"getBlackOpNames\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getBlackOpNamesNetscriptFn();\n },\n getBlackOpRank: function (name: any = \"\"): any {\n updateDynamicRam(\"getBlackOpRank\", getRamCost(\"bladeburner\", \"getBlackOpRank\"));\n checkBladeburnerAccess(\"getBlackOpRank\");\n const action: any = getBladeburnerActionObject(\"getBlackOpRank\", \"blackops\", name);\n return action.reqdRank;\n },\n getGeneralActionNames: function (): any {\n updateDynamicRam(\"getGeneralActionNames\", getRamCost(\"bladeburner\", \"getGeneralActionNames\"));\n checkBladeburnerAccess(\"getGeneralActionNames\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getGeneralActionNamesNetscriptFn();\n },\n getSkillNames: function (): any {\n updateDynamicRam(\"getSkillNames\", getRamCost(\"bladeburner\", \"getSkillNames\"));\n checkBladeburnerAccess(\"getSkillNames\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getSkillNamesNetscriptFn();\n },\n startAction: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"startAction\", getRamCost(\"bladeburner\", \"startAction\"));\n checkBladeburnerAccess(\"startAction\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.startActionNetscriptFn(Player, type, name, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.startAction\", e);\n }\n },\n stopBladeburnerAction: function (): any {\n updateDynamicRam(\"stopBladeburnerAction\", getRamCost(\"bladeburner\", \"stopBladeburnerAction\"));\n checkBladeburnerAccess(\"stopBladeburnerAction\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.resetAction();\n },\n getCurrentAction: function (): any {\n updateDynamicRam(\"getCurrentAction\", getRamCost(\"bladeburner\", \"getCurrentAction\"));\n checkBladeburnerAccess(\"getCurrentAction\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n },\n getActionTime: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getActionTime\", getRamCost(\"bladeburner\", \"getActionTime\"));\n checkBladeburnerAccess(\"getActionTime\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionTimeNetscriptFn(Player, type, name, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getActionTime\", e);\n }\n },\n getActionEstimatedSuccessChance: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\n \"getActionEstimatedSuccessChance\",\n getRamCost(\"bladeburner\", \"getActionEstimatedSuccessChance\"),\n );\n checkBladeburnerAccess(\"getActionEstimatedSuccessChance\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionEstimatedSuccessChanceNetscriptFn(Player, type, name, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getActionEstimatedSuccessChance\", e);\n }\n },\n getActionRepGain: function (type: any = \"\", name: any = \"\", level: any): any {\n updateDynamicRam(\"getActionRepGain\", getRamCost(\"bladeburner\", \"getActionRepGain\"));\n checkBladeburnerAccess(\"getActionRepGain\");\n const action = getBladeburnerActionObject(\"getActionRepGain\", type, name);\n let rewardMultiplier;\n if (level == null || isNaN(level)) {\n rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n } else {\n rewardMultiplier = Math.pow(action.rewardFac, level - 1);\n }\n\n return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;\n },\n getActionCountRemaining: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getActionCountRemaining\", getRamCost(\"bladeburner\", \"getActionCountRemaining\"));\n checkBladeburnerAccess(\"getActionCountRemaining\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionCountRemainingNetscriptFn(type, name, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getActionCountRemaining\", e);\n }\n },\n getActionMaxLevel: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getActionMaxLevel\", getRamCost(\"bladeburner\", \"getActionMaxLevel\"));\n checkBladeburnerAccess(\"getActionMaxLevel\");\n const action = getBladeburnerActionObject(\"getActionMaxLevel\", type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getActionCurrentLevel\", getRamCost(\"bladeburner\", \"getActionCurrentLevel\"));\n checkBladeburnerAccess(\"getActionCurrentLevel\");\n const action = getBladeburnerActionObject(\"getActionCurrentLevel\", type, name);\n return action.level;\n },\n getActionAutolevel: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getActionAutolevel\", getRamCost(\"bladeburner\", \"getActionAutolevel\"));\n checkBladeburnerAccess(\"getActionAutolevel\");\n const action = getBladeburnerActionObject(\"getActionCurrentLevel\", type, name);\n return action.autoLevel;\n },\n setActionAutolevel: function (type: any = \"\", name: any = \"\", autoLevel: any = true): any {\n updateDynamicRam(\"setActionAutolevel\", getRamCost(\"bladeburner\", \"setActionAutolevel\"));\n checkBladeburnerAccess(\"setActionAutolevel\");\n const action = getBladeburnerActionObject(\"setActionAutolevel\", type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel: function (type: any = \"\", name: any = \"\", level: any = 1): any {\n updateDynamicRam(\"setActionLevel\", getRamCost(\"bladeburner\", \"setActionLevel\"));\n checkBladeburnerAccess(\"setActionLevel\");\n const action = getBladeburnerActionObject(\"setActionLevel\", type, name);\n if (level < 1 || level > action.maxLevel) {\n throw makeRuntimeErrorMsg(\n \"bladeburner.setActionLevel\",\n `Level must be between 1 and ${action.maxLevel}, is ${level}`,\n );\n }\n action.level = level;\n },\n getRank: function (): any {\n updateDynamicRam(\"getRank\", getRamCost(\"bladeburner\", \"getRank\"));\n checkBladeburnerAccess(\"getRank\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.rank;\n },\n getSkillPoints: function (): any {\n updateDynamicRam(\"getSkillPoints\", getRamCost(\"bladeburner\", \"getSkillPoints\"));\n checkBladeburnerAccess(\"getSkillPoints\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.skillPoints;\n },\n getSkillLevel: function (skillName: any = \"\"): any {\n updateDynamicRam(\"getSkillLevel\", getRamCost(\"bladeburner\", \"getSkillLevel\"));\n checkBladeburnerAccess(\"getSkillLevel\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillLevelNetscriptFn(skillName, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getSkillLevel\", e);\n }\n },\n getSkillUpgradeCost: function (skillName: any = \"\"): any {\n updateDynamicRam(\"getSkillUpgradeCost\", getRamCost(\"bladeburner\", \"getSkillUpgradeCost\"));\n checkBladeburnerAccess(\"getSkillUpgradeCost\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getSkillUpgradeCost\", e);\n }\n },\n upgradeSkill: function (skillName: any): any {\n updateDynamicRam(\"upgradeSkill\", getRamCost(\"bladeburner\", \"upgradeSkill\"));\n checkBladeburnerAccess(\"upgradeSkill\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.upgradeSkillNetscriptFn(skillName, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.upgradeSkill\", e);\n }\n },\n getTeamSize: function (type: any = \"\", name: any = \"\"): any {\n updateDynamicRam(\"getTeamSize\", getRamCost(\"bladeburner\", \"getTeamSize\"));\n checkBladeburnerAccess(\"getTeamSize\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getTeamSizeNetscriptFn(type, name, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.getTeamSize\", e);\n }\n },\n setTeamSize: function (type: any = \"\", name: any = \"\", size: any): any {\n updateDynamicRam(\"setTeamSize\", getRamCost(\"bladeburner\", \"setTeamSize\"));\n checkBladeburnerAccess(\"setTeamSize\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.setTeamSizeNetscriptFn(type, name, size, workerScript);\n } catch (e) {\n throw makeRuntimeErrorMsg(\"bladeburner.setTeamSize\", e);\n }\n },\n getCityEstimatedPopulation: function (cityName: any): any {\n updateDynamicRam(\"getCityEstimatedPopulation\", getRamCost(\"bladeburner\", \"getCityEstimatedPopulation\"));\n checkBladeburnerAccess(\"getCityEstimatedPopulation\");\n checkBladeburnerCity(\"getCityEstimatedPopulation\", cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].popEst;\n },\n getCityEstimatedCommunities: function (cityName: any): any {\n updateDynamicRam(\"getCityEstimatedCommunities\", getRamCost(\"bladeburner\", \"getCityEstimatedCommunities\"));\n checkBladeburnerAccess(\"getCityEstimatedCommunities\");\n checkBladeburnerCity(\"getCityEstimatedCommunities\", cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].commsEst;\n },\n getCityChaos: function (cityName: any): any {\n updateDynamicRam(\"getCityChaos\", getRamCost(\"bladeburner\", \"getCityChaos\"));\n checkBladeburnerAccess(\"getCityChaos\");\n checkBladeburnerCity(\"getCityChaos\", cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].chaos;\n },\n getCity: function (): any {\n updateDynamicRam(\"getCity\", getRamCost(\"bladeburner\", \"getCity\"));\n checkBladeburnerAccess(\"getCityChaos\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.city;\n },\n switchCity: function (cityName: any): any {\n updateDynamicRam(\"switchCity\", getRamCost(\"bladeburner\", \"switchCity\"));\n checkBladeburnerAccess(\"switchCity\");\n checkBladeburnerCity(\"switchCity\", cityName);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return (bladeburner.city = cityName);\n },\n getStamina: function (): any {\n updateDynamicRam(\"getStamina\", getRamCost(\"bladeburner\", \"getStamina\"));\n checkBladeburnerAccess(\"getStamina\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return [bladeburner.stamina, bladeburner.maxStamina];\n },\n joinBladeburnerFaction: function (): any {\n updateDynamicRam(\"joinBladeburnerFaction\", getRamCost(\"bladeburner\", \"joinBladeburnerFaction\"));\n checkBladeburnerAccess(\"joinBladeburnerFaction\", true);\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.joinBladeburnerFactionNetscriptFn(workerScript);\n },\n joinBladeburnerDivision: function (): any {\n updateDynamicRam(\"joinBladeburnerDivision\", getRamCost(\"bladeburner\", \"joinBladeburnerDivision\"));\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n if (Player.bitNodeN === 7 || SourceFileFlags[7] > 0) {\n if (Player.bitNodeN === 8) {\n return false;\n }\n if (Player.bladeburner instanceof Bladeburner) {\n return true; // Already member\n } else if (\n Player.strength >= 100 &&\n Player.defense >= 100 &&\n Player.dexterity >= 100 &&\n Player.agility >= 100\n ) {\n Player.bladeburner = new Bladeburner(Player);\n workerScript.log(\"joinBladeburnerDivision\", \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n workerScript.log(\n \"joinBladeburnerDivision\",\n \"You do not meet the requirements for joining the Bladeburner division\",\n );\n return false;\n }\n }\n },\n getBonusTime: function (): any {\n updateDynamicRam(\"getBonusTime\", getRamCost(\"bladeburner\", \"getBonusTime\"));\n checkBladeburnerAccess(\"getBonusTime\");\n const bladeburner = Player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return Math.round(bladeburner.storedCycles / 5);\n },\n }, // End Bladeburner\n\n // Hi, if you're reading this you're a bit nosy.\n // There's a corporation API but it's very imbalanced right now.\n // It's here so players can test with if they want.\n corporation: {\n expandIndustry: function (industryName: any, divisionName: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity: function (divisionName: any, cityName: any): any {\n const division = getDivision(divisionName);\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n NewCity(corporation, division, cityName);\n },\n unlockUpgrade: function (upgradeName: any): any {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade[2] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade: function (upgradeName: any): any {\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade[4] === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends: function (percent: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n IssueDividends(corporation, percent);\n },\n sellMaterial: function (divisionName: any, cityName: any, materialName: any, amt: any, price: any): any {\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct: function (divisionName: any, cityName: any, productName: any, amt: any, price: any, all: any): any {\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct: function (divisionName: any, productName: any): any {\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply: function (divisionName: any, cityName: any, enabled: any): any {\n const warehouse = getWarehouse(divisionName, cityName);\n SetSmartSupply(warehouse, enabled);\n },\n // setSmartSupplyUseLeftovers: function (): any {},\n buyMaterial: function (divisionName: any, cityName: any, materialName: any, amt: any): any {\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n employees: function (divisionName: any, cityName: any): any {\n const office = getOffice(divisionName, cityName);\n return office.employees.map((e) => Object.assign({}, e));\n },\n assignJob: function (divisionName: any, cityName: any, employeeName: any, job: any): any {\n const employee = getEmployee(divisionName, cityName, employeeName);\n AssignJob(employee, job);\n },\n hireEmployee: function (divisionName: any, cityName: any): any {\n const office = getOffice(divisionName, cityName);\n office.hireRandomEmployee();\n },\n upgradeOfficeSize: function (divisionName: any, cityName: any, size: any): any {\n const office = getOffice(divisionName, cityName);\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty: function (divisionName: any, cityName: any, costPerEmployee: any): any {\n const office = getOffice(divisionName, cityName);\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n ThrowParty(corporation, office, costPerEmployee);\n },\n purchaseWarehouse: function (divisionName: any, cityName: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse: function (divisionName: any, cityName: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName));\n },\n buyCoffee: function (divisionName: any, cityName: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n BuyCoffee(corporation, getDivision(divisionName), getOffice(divisionName, cityName));\n },\n hireAdVert: function (divisionName: any): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n HireAdVert(corporation, getDivision(divisionName), getOffice(divisionName, \"Sector-12\"));\n },\n makeProduct: function (\n divisionName: any,\n cityName: any,\n productName: any,\n designInvest: any,\n marketingInvest: any,\n ): any {\n const corporation = Player.corporation;\n if (corporation === null) throw new Error(\"Should not be called without a corporation\");\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n research: function (divisionName: any, researchName: any): any {\n Research(getDivision(divisionName), researchName);\n },\n exportMaterial: function (\n sourceDivision: any,\n sourceCity: any,\n targetDivision: any,\n targetCity: any,\n materialName: any,\n amt: any,\n ): any {\n ExportMaterial(targetDivision, targetCity, getMaterial(sourceDivision, sourceCity, materialName), amt + \"\");\n },\n cancelExportMaterial: function (\n sourceDivision: any,\n sourceCity: any,\n targetDivision: any,\n targetCity: any,\n materialName: any,\n amt: any,\n ): any {\n CancelExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n );\n },\n setMaterialMarketTA1: function (divisionName: any, cityName: any, materialName: any, on: any): any {\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2: function (divisionName: any, cityName: any, materialName: any, on: any) {\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1: function (divisionName: any, productName: any, on: any): any {\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2: function (divisionName: any, productName: any, on: any) {\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n // If you modify these objects you will affect them for real, it's not\n // copies.\n getDivision: function (divisionName: any): any {\n return getDivision(divisionName);\n },\n getOffice: function (divisionName: any, cityName: any): any {\n return getOffice(divisionName, cityName);\n },\n getWarehouse: function (divisionName: any, cityName: any): any {\n return getWarehouse(divisionName, cityName);\n },\n getMaterial: function (divisionName: any, cityName: any, materialName: any): any {\n return getMaterial(divisionName, cityName, materialName);\n },\n getProduct: function (divisionName: any, productName: any): any {\n return getProduct(divisionName, productName);\n },\n getEmployee: function (divisionName: any, cityName: any, employeeName: any): any {\n return getEmployee(divisionName, cityName, employeeName);\n },\n }, // End Corporation API\n\n // Coding Contract API\n codingcontract: {\n attempt: function (answer: any, fn: any, ip: any = workerScript.hostname, { returnReward }: any = {}): any {\n updateDynamicRam(\"attempt\", getRamCost(\"codingcontract\", \"attempt\"));\n const contract = getCodingContract(\"attempt\", ip, fn);\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 = safeGetServer(ip, \"codingcontract.attempt\");\n if (contract.isSolution(answer)) {\n const reward = Player.gainCodingContractReward(creward, contract.getDifficulty());\n workerScript.log(\"attempt\", `Successfully completed Coding Contract '${fn}'. Reward: ${reward}`);\n serv.removeContract(fn);\n return returnReward ? reward : true;\n } else {\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n workerScript.log(\"attempt\", `Coding Contract attempt '${fn}' failed. Contract is now self-destructing`);\n serv.removeContract(fn);\n } else {\n workerScript.log(\n \"attempt\",\n `Coding Contract attempt '${fn}' failed. ${\n contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return returnReward ? \"\" : false;\n }\n },\n getContractType: function (fn: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"getContractType\", getRamCost(\"codingcontract\", \"getContractType\"));\n const contract = getCodingContract(\"getContractType\", ip, fn);\n return contract.getType();\n },\n getData: function (fn: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"getData\", getRamCost(\"codingcontract\", \"getData\"));\n const contract = getCodingContract(\"getData\", ip, fn);\n const data = contract.getData();\n if (data.constructor === Array) {\n // For two dimensional arrays, we have to copy the internal arrays using\n // slice() as well. As of right now, no contract has arrays that have\n // more than two dimensions\n const copy = data.slice();\n for (let i = 0; i < copy.length; ++i) {\n if (data[i].constructor === Array) {\n copy[i] = data[i].slice();\n }\n }\n\n return copy;\n } else {\n return data;\n }\n },\n getDescription: function (fn: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"getDescription\", getRamCost(\"codingcontract\", \"getDescription\"));\n const contract = getCodingContract(\"getDescription\", ip, fn);\n return contract.getDescription();\n },\n getNumTriesRemaining: function (fn: any, ip: any = workerScript.hostname): any {\n updateDynamicRam(\"getNumTriesRemaining\", getRamCost(\"codingcontract\", \"getNumTriesRemaining\"));\n const contract = getCodingContract(\"getNumTriesRemaining\", ip, fn);\n return contract.getMaxNumTries() - contract.tries;\n },\n }, // End coding contracts\n\n sleeve: sleeve,\n formulas: {\n basic: {\n calculateSkill: function (exp: any, mult: any = 1): any {\n checkFormulasAccess(\"basic.calculateSkill\", 5);\n return calculateSkill(exp, mult);\n },\n calculateExp: function (skill: any, mult: any = 1): any {\n checkFormulasAccess(\"basic.calculateExp\", 5);\n return calculateExp(skill, mult);\n },\n hackChance: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.hackChance\", 5);\n return calculateHackingChance(server, player);\n },\n hackExp: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.hackExp\", 5);\n return calculateHackingExpGain(server, player);\n },\n hackPercent: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.hackPercent\", 5);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent: function (server: any, threads: any, player: any, cores: any = 1): any {\n checkFormulasAccess(\"basic.growPercent\", 5);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.hackTime\", 5);\n return calculateHackingTime(server, player);\n },\n growTime: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.growTime\", 5);\n return calculateGrowTime(server, player);\n },\n weakenTime: function (server: any, player: any): any {\n checkFormulasAccess(\"basic.weakenTime\", 5);\n return calculateWeakenTime(server, player);\n },\n },\n hacknetNodes: {\n moneyGainRate: function (level: any, ram: any, cores: any, mult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.moneyGainRate\", 5);\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost: function (startingLevel: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.levelUpgradeCost\", 5);\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (startingRam: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.ramUpgradeCost\", 5);\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (startingCore: any, extraCores: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetNodes.coreUpgradeCost\", 5);\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost: function (n: any, mult: any): any {\n checkFormulasAccess(\"hacknetNodes.hacknetNodeCost\", 5);\n return calculateNodeCost(n, mult);\n },\n constants: function (): any {\n checkFormulasAccess(\"hacknetNodes.constants\", 5);\n return Object.assign({}, HacknetNodeConstants);\n },\n },\n hacknetServers: {\n hashGainRate: function (level: any, ramUsed: any, maxRam: any, cores: any, mult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.hashGainRate\", 9);\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost: function (startingLevel: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.levelUpgradeCost\", 9);\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost: function (startingRam: any, extraLevels: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.ramUpgradeCost\", 9);\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost: function (startingCore: any, extraCores: any = 1, costMult: any = 1): any {\n checkFormulasAccess(\"hacknetServers.coreUpgradeCost\", 9);\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost: function (startingCache: any, extraCache: any = 1): any {\n checkFormulasAccess(\"hacknetServers.cacheUpgradeCost\", 9);\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost: function (upgName: any, level: any): any {\n checkFormulasAccess(\"hacknetServers.hashUpgradeCost\", 9);\n const upg = Player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw makeRuntimeErrorMsg(\n \"formulas.hacknetServers.calculateHashUpgradeCost\",\n `Invalid Hash Upgrade: ${upgName}`,\n );\n }\n return upg.getCost(level);\n },\n hacknetServerCost: function (n: any, mult: any): any {\n checkFormulasAccess(\"hacknetServers.hacknetServerCost\", 9);\n return HScalculateServerCost(n, mult);\n },\n constants: function (): any {\n checkFormulasAccess(\"hacknetServers.constants\", 9);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n }, // end formulas\n flags: 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: workerScript.args });\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 ...extra,\n };\n\n function getFunctionNames(obj: NS, prefix: string): string[] {\n const functionNames: string[] = [];\n for (const [key, value] of Object.entries(obj)) {\n 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(functions, \"\")].map((a) => [a, true]));\n\n return functions;\n} // End NetscriptFunction()\n\nexport { NetscriptFunctions };\n","/**\n * Implementation of the mechanisms that allow the player to affect the\n * Stock Market\n */\nimport { Stock } from \"./Stock\";\nimport { StockMarket } from \"./StockMarket\";\n\nimport { Company } from \"../Company/Company\";\nimport { Server } from \"../Server/Server\";\n\n// Change in second-order forecast due to hacks/grows\nexport const forecastForecastChangeFromHack = 0.1;\n\n// Change in second-order forecast due to company work\nexport const forecastForecastChangeFromCompanyWork = 0.001;\n\n/**\n * Potentially decreases a stock's second-order forecast when its corresponding\n * server is hacked. The chance of the hack decreasing the stock's second-order\n * forecast is dependent on what percentage of the server's money is hacked\n * @param {Server} server - Server being hack()ed\n * @param {number} moneyHacked - Amount of money stolen from the server\n */\nexport function influenceStockThroughServerHack(server: Server, moneyHacked: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyHacked = moneyHacked / server.moneyMax;\n if (Math.random() < percTotalMoneyHacked) {\n stock.changeForecastForecast(stock.otlkMagForecast - forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when its corresponding\n * server is grown (grow()). The chance of the grow() to increase the stock's\n * second-order forecast is dependent on how much money is added to the server\n * @param {Server} server - Server being grow()n\n * @param {number} moneyHacked - Amount of money added to the server\n */\nexport function influenceStockThroughServerGrow(server: Server, moneyGrown: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyGrown = moneyGrown / server.moneyMax;\n if (Math.random() < percTotalMoneyGrown) {\n stock.changeForecastForecast(stock.otlkMagForecast + forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when the player works for\n * its corresponding company.\n * @param {Company} company - Company being worked for\n * @param {number} performanceMult - Effectiveness of player's work. Affects influence\n * @param {number} cyclesOfWork - # game cycles of work being processed\n */\nexport function influenceStockThroughCompanyWork(\n company: Company,\n performanceMult: number,\n cyclesOfWork: number,\n): void {\n const compName = company.name;\n let stock: Stock | null = null;\n if (typeof compName === \"string\" && compName !== \"\") {\n stock = StockMarket[compName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n if (Math.random() < 0.002 * cyclesOfWork) {\n const change = forecastForecastChangeFromCompanyWork * performanceMult;\n stock.changeForecastForecast(stock.otlkMagForecast + change);\n }\n}\n","import { 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","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 * 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\";\n\nexport class Gang {\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) {\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);\n player.recordMoneySource(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 in 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 additiveGain = 0.75 * gainRoll * AllGangs[name].territory;\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 for (let i = 0; i < GangConstants.Names.length; ++i) {\n const others = GangConstants.Names.filter((e) => {\n return e !== GangConstants.Names[i];\n });\n const other = getRandomInt(0, others.length - 1);\n\n const thisGang = GangConstants.Names[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(1, 1 + Math.log(AllGangs[winGang].power / AllGangs[loseGang].power) / Math.log(50));\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 }\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(\"ascend\", `Ascended Gang member ${member.name}`);\n }\n return res;\n } catch (e) {\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 { 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","/**\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<any> = {};\n const cities = Object.keys(Cities);\n for (let i = 0; i < cities.length; ++i) {\n map[cities[i]] = initValue;\n }\n\n return map;\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_skill) {\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","/**\n * Represents a Hand of cards.\n *\n * This class is IMMUTABLE\n */\n\nimport { Card } from \"./Card\";\n\nexport class Hand {\n constructor(readonly cards: readonly Card[]) {}\n\n addCards(...cards: Card[]): Hand {\n return new Hand([...this.cards, ...cards]);\n }\n\n removeByIndex(i: number): Hand {\n if (i >= this.cards.length) {\n throw new Error(`Tried to remove invalid card from Hand by index: ${i}`);\n }\n\n return new Hand([...this.cards.slice().splice(i, 1)]);\n }\n}\n","/**\n * React Component for a button that initiates a transaction on the Stock Market UI\n * (Buy, Sell, Buy Max, etc.)\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n return (\n <Tooltip title={props.tooltip != null ? <Typography>{props.tooltip}</Typography> : \"\"}>\n <Button onClick={props.onClick}>{props.text}</Button>\n </Tooltip>\n );\n}\n","/**\n * Abstract Base Class for any Server object\n */\nimport { CodingContract } from \"../CodingContracts\";\nimport { Message } from \"../Message/Message\";\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\";\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 // For Literature files, this array contains only the filename (string)\n // For Messages, it contains the actual Message object\n // TODO Separate literature files into its own property\n messages: (Message | string)[] = [];\n\n // Name of company/faction/etc. that this server belongs to.\n // Optional, not applicable to all Servers\n organizationName = \"\";\n\n // Programs on this servers. Contains only the names of the programs\n programs: string[] = [];\n\n // RAM (GB) used. i.e. unavailable RAM\n ramUsed = 0;\n\n // RunningScript files on this server\n runningScripts: RunningScript[] = [];\n\n // Script files on this Server\n scripts: Script[] = [];\n\n // Contains the IP Addresses of all servers that are immediately\n // reachable from this one\n serversOnNetwork: string[] = [];\n\n // Flag indicating whether SMTP Port is open\n smtpPortOpen = false;\n\n // Flag indicating whether SQL Port is open\n sqlPortOpen = false;\n\n // Flag indicating whether the SSH Port is open\n sshPortOpen = false;\n\n // Text files on this server\n textFiles: TextFile[] = [];\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n this.ip = params.ip ? params.ip : createRandomIp();\n\n this.hostname = params.hostname;\n this.organizationName = params.organizationName != null ? params.organizationName : \"\";\n this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;\n\n //Access information\n this.hasAdminRights = params.adminRights != null ? params.adminRights : false;\n }\n\n addContract(contract: CodingContract): void {\n this.contracts.push(contract);\n }\n\n getContract(contractName: string): CodingContract | null {\n for (const contract of this.contracts) {\n if (contract.fn === contractName) {\n return contract;\n }\n }\n return null;\n }\n\n /**\n * Find an actively running script on this server\n * @param scriptName - Filename of script to search for\n * @param scriptArgs - Arguments that script is being run with\n * @returns RunningScript for the specified active script\n * Returns null if no such script can be found\n */\n getRunningScript(scriptName: string, scriptArgs: any[]): RunningScript | null {\n for (const rs of this.runningScripts) {\n if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) {\n return rs;\n }\n }\n\n return null;\n }\n\n /**\n * Given the name of the script, returns the corresponding\n * Script object on the server (if it exists)\n */\n getScript(scriptName: string): Script | null {\n for (let i = 0; i < this.scripts.length; i++) {\n if (this.scripts[i].filename === scriptName) {\n return this.scripts[i];\n }\n }\n\n return null;\n }\n\n /**\n * Returns boolean indicating whether the given script is running on this server\n */\n isRunning(fn: string): boolean {\n for (const runningScriptObj of this.runningScripts) {\n if (runningScriptObj.filename === fn) {\n return true;\n }\n }\n\n return false;\n }\n\n removeContract(contract: CodingContract): void {\n if (contract instanceof CodingContract) {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract.fn;\n });\n } else {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract;\n });\n }\n }\n\n /**\n * Remove a file from the server\n * @param fn {string} Name of file to be deleted\n * @returns {IReturnStatus} Return status object indicating whether or not file was deleted\n */\n removeFile(fn: string): IReturnStatus {\n if (fn.endsWith(\".exe\") || fn.match(/^.+\\.exe-\\d+(?:\\.\\d*)?%-INC$/) != null) {\n for (let i = 0; i < this.programs.length; ++i) {\n if (this.programs[i] === fn) {\n this.programs.splice(i, 1);\n return { res: true };\n }\n }\n } else if (isScriptFilename(fn)) {\n for (let i = 0; i < this.scripts.length; ++i) {\n if (this.scripts[i].filename === fn) {\n if (this.isRunning(fn)) {\n return {\n res: false,\n msg: \"Cannot delete a script that is currently running!\",\n };\n }\n\n this.scripts.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".lit\")) {\n for (let i = 0; i < this.messages.length; ++i) {\n const f = this.messages[i];\n if (typeof f === \"string\" && f === fn) {\n this.messages.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".txt\")) {\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n this.textFiles.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".cct\")) {\n for (let i = 0; i < this.contracts.length; ++i) {\n if (this.contracts[i].fn === fn) {\n this.contracts.splice(i, 1);\n return { res: true };\n }\n }\n }\n\n return { res: false, msg: \"No such file exists\" };\n }\n\n /**\n * Called when a script is run on this server.\n * All this function does is add a RunningScript object to the\n * `runningScripts` array. It does NOT check whether the script actually can\n * be run.\n */\n runScript(script: RunningScript): void {\n this.runningScripts.push(script);\n }\n\n setMaxRam(ram: number): void {\n this.maxRam = ram;\n }\n\n /**\n * Write to a script file\n * Overwrites existing files. Creates new files if the script does not eixst\n */\n writeToScriptFile(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(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(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, CodingContractType, CodingContractTypes } from \"../../CodingContracts\";\nimport { CopyableText } from \"./CopyableText\";\nimport { Modal } from \"./Modal\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n c: CodingContract;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n}\n\nexport const CodingContractEvent = new EventEmitter<[IProps]>();\n\nexport function CodingContractModal(): React.ReactElement {\n const [props, setProps] = useState<IProps | null>(null);\n const [answer, setAnswer] = useState(\"\");\n\n useEffect(() => {\n CodingContractEvent.subscribe((props) => setProps(props));\n });\n if (props === null) return <></>;\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAnswer(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (props === null) return;\n // React just won't cooperate on this one.\n // \"React.KeyboardEvent<HTMLInputElement>\" seems like the right type but\n // whatever ...\n const value = (event.target as any).value;\n\n if (event.keyCode === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n props.onAttempt(answer);\n }\n }\n\n function close(): void {\n if (props === null) return;\n props.onClose();\n setProps(null);\n }\n\n const contractType: CodingContractType = 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 close();\n }}\n >\n Solve\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\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 { parse } from \"acorn\";\n\nimport { RamCalculationErrorCode } from \"./RamCalculationErrorCodes\";\n\nimport { RamCosts, RamCostConstants } from \"../Netscript/RamCostGenerator\";\nimport { Script } from \"../Script/Script\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\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 otherScripts: Script[],\n code: string,\n workerScript: WorkerScript,\n): Promise<number | RamCalculationErrorCode> {\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 RamCalculationErrorCode.URLImportError;\n }\n } else {\n if (!Array.isArray(otherScripts)) {\n console.warn(`parseOnlyRamCalculate() not called with array of scripts`);\n return 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 (s.filename === fn) {\n script = s;\n break;\n }\n }\n\n if (script == null) {\n return 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 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 }\n if (ref === \"document\" && !resolvedRefs.has(\"document\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n }\n if (ref === \"window\" && !resolvedRefs.has(\"window\")) {\n ram += RamCostConstants.ScriptDomRamCost;\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(func: any): number {\n if (typeof func === \"function\") {\n try {\n let res;\n if (func.constructor.name === \"AsyncFunction\") {\n res = 0; // Async functions will always be 0 RAM\n } else {\n res = func.apply(null, []);\n }\n if (typeof res === \"number\") {\n return res;\n }\n return 0;\n } catch (e) {\n console.error(`Error applying function: ${e}`);\n return 0;\n }\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 if (ref in workerScript.env.vars.bladeburner) {\n func = workerScript.env.vars.bladeburner[ref];\n } else if (ref in workerScript.env.vars.codingcontract) {\n func = workerScript.env.vars.codingcontract[ref];\n } else if (ref in workerScript.env.vars.gang) {\n func = workerScript.env.vars.gang[ref];\n } else if (ref in workerScript.env.vars.sleeve) {\n func = workerScript.env.vars.sleeve[ref];\n } else {\n func = workerScript.env.vars[ref];\n }\n ram += applyFuncRam(func);\n } catch (error) {\n continue;\n }\n }\n return ram;\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 RamCalculationErrorCode.SyntaxError;\n }\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\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 const key = currentModule + \".\" + 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 codeCopy: string,\n otherScripts: Script[],\n): Promise<RamCalculationErrorCode | number> {\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(otherScripts, codeCopy, workerScript);\n } catch (e) {\n console.error(`Failed to parse script for RAM calculations:`);\n console.error(e);\n return RamCalculationErrorCode.SyntaxError;\n }\n\n return RamCalculationErrorCode.SyntaxError;\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 { 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 { IMap } from \"../types\";\n\n/**\n * Contains the \"information\" property for all the Factions, which is just a description of each faction\n */\nexport class FactionInfo {\n /**\n * The multiplier to apply to augmentation base purchase price.\n */\n augmentationPriceMult: number;\n\n /**\n * The multiplier to apply to augmentation reputation base requirement.\n */\n augmentationRepRequirementMult: number;\n\n /**\n * The names of all other factions considered to be enemies to this faction.\n */\n enemies: string[];\n\n /**\n * The descriptive text to show on the faction's page.\n */\n infoText: JSX.Element;\n\n /**\n * A flag indicating if the faction supports field work to earn reputation.\n */\n offerFieldWork: boolean;\n\n /**\n * A flag indicating if the faction supports hacking missions to earn reputation.\n */\n offerHackingMission: boolean;\n\n /**\n * A flag indicating if the faction supports hacking work to earn reputation.\n */\n offerHackingWork: boolean;\n\n /**\n * A flag indicating if the faction supports security work to earn reputation.\n */\n offerSecurityWork: boolean;\n\n /**\n * Keep faction on install.\n */\n keep: boolean;\n\n constructor(\n infoText: JSX.Element,\n enemies: string[],\n offerHackingMission: boolean,\n offerHackingWork: boolean,\n offerFieldWork: boolean,\n offerSecurityWork: boolean,\n keep: boolean,\n ) {\n this.infoText = infoText;\n this.enemies = enemies;\n this.offerHackingMission = offerHackingMission;\n this.offerHackingWork = offerHackingWork;\n this.offerFieldWork = offerFieldWork;\n this.offerSecurityWork = offerSecurityWork;\n\n // These are always all 1 for now.\n this.augmentationPriceMult = 1;\n this.augmentationRepRequirementMult = 1;\n this.keep = keep;\n }\n\n offersWork(): boolean {\n return this.offerFieldWork || this.offerHackingMission || this.offerHackingWork || this.offerSecurityWork;\n }\n}\n\n/**\n * A map of all factions and associated info to them.\n */\n// tslint:disable-next-line:variable-name\nexport const FactionInfos: IMap<FactionInfo> = {\n // Endgame\n Illuminati: new FactionInfo(\n (\n <>\n Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And\n from this chaos, we are the invisible hand that guides them to order.{\" \"}\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n Daedalus: new FactionInfo(\n <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.</>,\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n \"The Covenant\": new FactionInfo(\n (\n <>\n Surrender yourself. Give up your empty individuality to become part of something great, something eternal.\n Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.\n <br />\n <br />\n Only then can you discover immortality.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n // Megacorporations, each forms its own faction\n ECorp: new FactionInfo(\n (\n <>\n ECorp's mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of\n Internet-related software and commercial hardware, ECorp makes the world's information universally accessible.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n MegaCorp: new FactionInfo(\n (\n <>\n MegaCorp does what no other dares to do. We imagine. We create. We invent. We create what others have never even\n dreamed of. Our work fills the world's needs for food, water, power, and transporation on an unprecendented\n scale, in ways that no other company can.\n <br />\n <br />\n In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n \"Bachman & Associates\": new FactionInfo(\n (\n <>\n Where Law and Business meet - thats where we are.\n <br />\n <br />\n Legal Insight - Business Instinct - Innovative Experience.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n \"Blade Industries\": new FactionInfo(<>Augmentation is Salvation.</>, [], true, true, true, true, true),\n\n NWO: new FactionInfo(\n (\n <>\n Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given\n purpose and direction in life. That is why they created God. And that is why they created civilization - not\n because of willingness, but because of a need to be incorporated into higher orders of structure and meaning.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n \"Clarke Incorporated\": new FactionInfo(<>The Power of the Genome - Unlocked.</>, [], true, true, true, true, true),\n\n \"OmniTek Incorporated\": new FactionInfo(\n <>Simply put, our mission is to design and build robots that make a difference.</>,\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n \"Four Sigma\": new FactionInfo(\n (\n <>\n The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by\n deep learning and innovative ideas. And improved by iteration. That's Four Sigma.\n </>\n ),\n [],\n true,\n true,\n true,\n true,\n true,\n ),\n\n \"KuaiGong International\": new FactionInfo(<>Dream big. Work hard. Make history.</>, [], true, true, true, true, true),\n\n // Other Corporations\n \"Fulcrum Secret Technologies\": new FactionInfo(\n (\n <>\n The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it\n would be necessary to create them. And now we can.\n </>\n ),\n [],\n true,\n true,\n false,\n true,\n true,\n ),\n\n // Hacker groups\n BitRunners: new FactionInfo(\n (\n <>\n Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all\n transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to\n live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave\n behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be\n reconstructed. Transformed. Used.\n <br />\n <br />\n Those who run the bits, run the world.\n </>\n ),\n [],\n true,\n true,\n false,\n false,\n false,\n ),\n\n \"The Black Hand\": new FactionInfo(\n (\n <>\n The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power.\n Technological power. And those at the top rule with an invisible hand. They built a society where the rich get\n richer, and everyone else suffers.\n <br />\n <br />\n So much pain. So many lives. Their darkness must end.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n // prettier-ignore\n NiteSec: new FactionInfo(<>\n{\" __..__ \"}<br />\n{\" _.nITESECNIt. \"}<br />\n{\" .-'NITESECNITESEc. \"}<br />\n{\" .' NITESECNITESECn \"}<br />\n{\" / NITESECNITESEC; \"}<br />\n{\" : :NITESECNITESEC; \"}<br />\n{\" ; $ NITESECNITESECN \"}<br />\n{\" : _, ,N'ITESECNITESEC \"}<br />\n{\" : .+^^`, : `NITESECNIT \"}<br />\n{\" ) /), `-,-=,NITESECNI \"}<br />\n{\" / ^ ,-;|NITESECN; \"}<br />\n{\" / _.' '-';NITESECN \"}<br />\n{\" ( , ,-''`^NITE' \"}<br />\n{\" )` :`. .' \"}<br />\n{\" )-- ; `- / \"}<br />\n{\" ' _.-' : \"}<br />\n{\" ( _.-' . \"}<br />\n{\" ------. \"}<br />\n{\" . \"}<br />\n{\" _.nIt \"}<br />\n{\" _.nITESECNi \"}<br />\n{\" nITESECNIT^' \"}<br />\n{\" NITE^' ___ \"}<br />\n{\" / .gP''''Tp. \"}<br />\n{\" : d' . `b \"}<br />\n{\" ; d' o `b ; \"}<br />\n{\" / d; `b| \"}<br />\n{\" /, $; @ `: \"}<br />\n{\" /' $$ ; \"}<br />\n{\" .' $$b o | \"}<br />\n{\" .' d$$$; : \"}<br />\n{\" / .d$$$$; , ; \"}<br />\n{\" d .dNITESEC $ | \"}<br />\n{\" :bp.__.gNITESEC$$ :$ ; \"}<br />\n{\" NITESECNITESECNIT $$b : \"}<br /></>,\n [],\n true,\n true,\n false,\n false,\n false,\n ),\n\n // City factions, essentially governments\n Aevum: new FactionInfo(\n <>The Silicon City.</>,\n [\"Chongqing\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n ),\n Chongqing: new FactionInfo(<>Serve the People.</>, [\"Sector-12\", \"Aevum\", \"Volhaven\"], true, true, true, true, false),\n Ishima: new FactionInfo(\n <>The East Asian Order of the Future.</>,\n [\"Sector-12\", \"Aevum\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n ),\n \"New Tokyo\": new FactionInfo(\n <>Asia's World City.</>,\n [\"Sector-12\", \"Aevum\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n ),\n \"Sector-12\": new FactionInfo(\n <>The City of the Future.</>,\n [\"Chongqing\", \"New Tokyo\", \"Ishima\", \"Volhaven\"],\n true,\n true,\n true,\n true,\n false,\n ),\n Volhaven: new FactionInfo(\n <>Benefit, Honor, and Glory.</>,\n [\"Chongqing\", \"Sector-12\", \"New Tokyo\", \"Aevum\", \"Ishima\"],\n true,\n true,\n true,\n true,\n false,\n ),\n\n // Criminal Organizations/Gangs\n \"Speakers for the Dead\": new FactionInfo(\n <>It is better to reign in Hell than to serve in Heaven.</>,\n [],\n true,\n true,\n true,\n true,\n false,\n ),\n\n \"The Dark Army\": new FactionInfo(\n <>The World doesn't care about right or wrong. It only cares about power.</>,\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n \"The Syndicate\": new FactionInfo(<>Honor holds you back.</>, [], true, true, true, true, false),\n\n Silhouette: new FactionInfo(\n (\n <>\n Corporations have filled the void of power left behind by the collapse of Western government. The issue is\n they've become so big that you don't know who they're working for. And if you're employed at one of these\n corporations, you don't even know who you're working for.\n <br />\n <br />\n That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.\n </>\n ),\n [],\n true,\n true,\n true,\n false,\n false,\n ),\n\n Tetrads: new FactionInfo(\n <>Following the mandate of Heaven and carrying out the way.</>,\n [],\n false,\n false,\n true,\n true,\n false,\n ),\n\n \"Slum Snakes\": new FactionInfo(<>Slum Snakes rule!</>, [], false, false, true, true, false),\n\n // Earlygame factions - factions the player will prestige with early on that don't belong in other categories.\n Netburners: new FactionInfo(<>{\"~~//*>H4CK||3T 8URN3R5**>?>\\\\~~\"}</>, [], true, true, false, false, false),\n\n \"Tian Di Hui\": new FactionInfo(<>Obey Heaven and work righteously.</>, [], true, true, false, true, false),\n\n CyberSec: new FactionInfo(\n (\n <>\n The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy\n that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of\n total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse.\n </>\n ),\n [],\n true,\n true,\n false,\n false,\n false,\n ),\n\n // Special Factions\n Bladeburners: new FactionInfo(\n (\n <>\n It's too bad they won't live. But then again, who does?\n <br />\n <br />\n Note that for this faction, reputation can only be gained through Bladeburner actions. Completing Bladeburner\n contracts/operations will increase your reputation.\n </>\n ),\n [],\n false,\n false,\n false,\n false,\n false,\n ),\n};\n","import React, { useState, useEffect } from \"react\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Faction } from \"../Faction\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const InvitationEvent = new EventEmitter<[Faction]>();\n\nexport function InvitationModal(): React.ReactElement {\n const [faction, setFaction] = useState<Faction | null>(null);\n const player = use.Player();\n function join(): void {\n if (faction === null) return;\n //Remove from invited factions\n const i = player.factionInvitations.findIndex((facName) => facName === faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(faction);\n setFaction(null);\n }\n\n useEffect(() => InvitationEvent.subscribe((faction) => setFaction(faction)), []);\n\n return (\n <Modal open={faction !== null} onClose={() => setFaction(null)}>\n <Typography variant=\"h4\">You have received a faction invitation.</Typography>\n <Typography>\n Would you like to join {(faction || { name: \"\" }).name}? <br />\n <br />\n Warning: Joining this faction may prevent you from joining other factions during this run!\n </Typography>\n <Button onClick={join}>Join!</Button>\n <Button onClick={() => setFaction(null)}>Decide later</Button>\n </Modal>\n );\n}\n","import * 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 React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const PromptEvent = new EventEmitter<[Prompt]>();\n\ninterface Prompt {\n txt: string;\n resolve: (result: boolean) => void;\n}\n\nexport function PromptManager(): React.ReactElement {\n const [prompt, setPrompt] = useState<Prompt | null>(null);\n useEffect(\n () =>\n PromptEvent.subscribe((p: Prompt) => {\n setPrompt(p);\n }),\n [],\n );\n\n function close(): void {\n if (prompt === null) return;\n prompt.resolve(false);\n setPrompt(null);\n }\n\n function yes(): void {\n if (prompt === null) return;\n prompt.resolve(true);\n setPrompt(null);\n }\n function no(): void {\n if (prompt === null) return;\n prompt.resolve(false);\n setPrompt(null);\n }\n\n return (\n <>\n {prompt != null && (\n <Modal open={true} onClose={close}>\n <Typography>{prompt.txt}</Typography>\n <Button onClick={yes}>Yes</Button>\n <Button onClick={no}>No</Button>\n </Modal>\n )}\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Snackbar as S } from \"@mui/material\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\nexport const GameSavedEvents = new EventEmitter<[]>();\n\nexport function Snackbar(): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n useEffect(() => GameSavedEvents.subscribe(() => setOpen(true)));\n return (\n <S\n open={open}\n anchorOrigin={{\n vertical: \"top\",\n horizontal: \"center\",\n }}\n autoHideDuration={2000}\n onClose={() => setOpen(false)}\n >\n <Paper sx={{ p: 2 }}>\n <Typography>Game Saved!</Typography>\n </Paper>\n </S>\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 in 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 * React Component for displaying a single Augmentation as an accordion.\n *\n * The header of the accordion contains the Augmentation's name (and level, if\n * applicable), and the accordion's panel contains the Augmentation's description.\n */\nimport React, { useState } from \"react\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\ntype IProps = {\n aug: Augmentation;\n level?: number | string | null;\n};\n\nexport function AugmentationAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n let displayName = props.aug.name;\n if (props.level != null) {\n if (props.aug.name === AugmentationNames.NeuroFluxGovernor) {\n displayName += ` - Level ${props.level}`;\n }\n }\n\n if (typeof props.aug.info === \"string\") {\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{displayName}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography dangerouslySetInnerHTML={{ __html: props.aug.info }} />\n {props.aug.stats && (\n <>\n <br />\n <br />\n <Typography>{props.aug.stats}</Typography>\n </>\n )}\n </Box>\n </Collapse>\n </Box>\n );\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{displayName}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>\n {props.aug.info}\n {props.aug.stats && (\n <>\n <br />\n <br />\n {props.aug.stats}\n </>\n )}\n </Typography>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","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 <IconButton disabled={!canIncrease} onClick={increaseLevel}>\n <ArrowDropUpIcon />\n </IconButton>\n </Tooltip>\n <Tooltip title={isActive ? <Typography>WARNING: changing the level will restart the Operation</Typography> : \"\"}>\n <IconButton disabled={!canDecrease} onClick={decreaseLevel}>\n <ArrowDropDownIcon />\n </IconButton>\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 { 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 React, { useState, useEffect } from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n const [on, setOn] = useState(true);\n useEffect(() => {\n const i = setInterval(() => setOn((old) => !old), 1000);\n return () => clearInterval(i);\n });\n return <>{on ? \"|\" : \"\"}</>;\n}\n","/**\n * Implements the Re-sleeving mechanic for BitNode-10.\n * This allows the player to purchase and \"use\" new sleeves at VitaLife.\n * These new sleeves come with different starting experience and Augmentations\n * The cost of these new sleeves scales based on the exp and Augs.\n *\n * Note that this is different from the \"Sleeve mechanic\". The \"Sleeve\" mechanic\n * provides new sleeves, essentially clones. This Re-sleeving mechanic lets\n * the player purchase a new body with pre-existing Augmentations and experience\n *\n * As of right now, this feature is only available in BitNode 10\n */\nimport { Resleeve } from \"./Resleeve\";\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { IPlayerOwnedAugmentation, PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\n// Executes the actual re-sleeve when one is purchased\nexport function purchaseResleeve(r: Resleeve, p: IPlayer): boolean {\n const cost: number = r.getCost();\n if (!p.canAfford(cost)) {\n return false;\n }\n p.loseMoney(cost);\n\n // Set the player's exp\n p.hacking_exp = r.hacking_exp;\n p.strength_exp = r.strength_exp;\n p.defense_exp = r.defense_exp;\n p.dexterity_exp = r.dexterity_exp;\n p.agility_exp = r.agility_exp;\n p.charisma_exp = r.charisma_exp;\n\n // Reset Augmentation \"owned\" data\n for (const augKey in Augmentations) {\n Augmentations[augKey].owned = false;\n }\n\n // Clear all of the player's augmentations, except the NeuroFlux Governor\n // which is kept\n for (let i = p.augmentations.length - 1; i >= 0; --i) {\n if (p.augmentations[i].name !== AugmentationNames.NeuroFluxGovernor) {\n p.augmentations.splice(i, 1);\n } else {\n // NeuroFlux Governor\n Augmentations[AugmentationNames.NeuroFluxGovernor].owned = true;\n }\n }\n\n for (let i = 0; i < r.augmentations.length; ++i) {\n p.augmentations.push(new PlayerOwnedAugmentation(r.augmentations[i].name));\n Augmentations[r.augmentations[i].name].owned = true;\n }\n\n // The player's purchased Augmentations should remain the same, but any purchased\n // Augmentations that are given by the resleeve should be removed so there are no duplicates\n for (let i = p.queuedAugmentations.length - 1; i >= 0; --i) {\n const name: string = p.queuedAugmentations[i].name;\n\n if (\n p.augmentations.filter((e: IPlayerOwnedAugmentation) => {\n return e.name !== AugmentationNames.NeuroFluxGovernor && e.name === name;\n }).length >= 1\n ) {\n p.queuedAugmentations.splice(i, 1);\n }\n }\n\n p.reapplyAllAugmentations(true);\n p.reapplyAllSourceFiles(); //Multipliers get reset, so have to re-process source files too\n return true;\n}\n\n// Creates all of the Re-sleeves that will be available for purchase at VitaLife\nexport function generateResleeves(): Resleeve[] {\n const NumResleeves = 40; // Total number of Resleeves to generate\n\n const ret: Resleeve[] = [];\n for (let i = 0; i < NumResleeves; ++i) {\n // i will be a number indicating how \"powerful\" the Re-sleeve should be\n const r: Resleeve = new Resleeve();\n\n // Generate experience\n const expMult: number = 5 * i + 1;\n r.hacking_exp = expMult * getRandomInt(1000, 5000);\n r.strength_exp = expMult * getRandomInt(1000, 5000);\n r.defense_exp = expMult * getRandomInt(1000, 5000);\n r.dexterity_exp = expMult * getRandomInt(1000, 5000);\n r.agility_exp = expMult * getRandomInt(1000, 5000);\n r.charisma_exp = expMult * getRandomInt(1000, 5000);\n\n // Generate Augs\n // Augmentation prequisites will be ignored for this\n const baseNumAugs: number = Math.max(2, Math.ceil((i + 3) / 2));\n const numAugs: number = getRandomInt(baseNumAugs, baseNumAugs + 2);\n const augKeys: string[] = Object.keys(Augmentations);\n for (let a = 0; a < numAugs; ++a) {\n // Get a random aug\n const randIndex: number = getRandomInt(0, augKeys.length - 1);\n const randKey: string = augKeys[randIndex];\n\n // Forbidden augmentations\n if (randKey === AugmentationNames.TheRedPill || randKey === AugmentationNames.NeuroFluxGovernor) {\n continue;\n }\n\n const randAug: Augmentation | null = Augmentations[randKey];\n if (randAug === null) throw new Error(`null augmentation: ${randKey}`);\n r.augmentations.push({ name: randAug.name, level: 1 });\n r.applyAugmentation(Augmentations[randKey]);\n r.updateStatLevels();\n\n // Remove Augmentation so that there are no duplicates\n augKeys.splice(randIndex, 1);\n }\n\n ret.push(r);\n }\n\n return ret;\n}\n","import { Sleeve } from \"./Sleeve\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\n\nexport function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentation[] {\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n\n const ownedAugNames: string[] = sleeve.augmentations.map((e) => {\n return e.name;\n });\n const availableAugs: Augmentation[] = [];\n\n // Helper function that helps filter out augs that are already owned\n // and augs that aren't allowed for sleeves\n function isAvailableForSleeve(aug: Augmentation): boolean {\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n return false;\n }\n if (ownedAugNames.includes(aug.name)) {\n return false;\n }\n if (availableAugs.includes(aug)) {\n return false;\n }\n if (aug.isSpecial) {\n return false;\n }\n\n return true;\n }\n\n // If player is in a gang, then we return all augs that the player\n // has enough reputation for (since that gang offers all augs)\n if (p.inGang()) {\n const fac = p.getGangFaction();\n\n for (const augName in Augmentations) {\n const aug = Augmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.baseRepRequirement) {\n availableAugs.push(aug);\n }\n }\n\n return availableAugs;\n }\n\n for (const facName of p.factions) {\n if (facName === \"Bladeburners\") {\n continue;\n }\n if (facName === \"Netburners\") {\n continue;\n }\n const fac: Faction | null = Factions[facName];\n if (fac == null) {\n continue;\n }\n\n for (const augName of fac.augmentations) {\n const aug: Augmentation = Augmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.baseRepRequirement) {\n availableAugs.push(aug);\n }\n }\n }\n\n return availableAugs;\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nexport function HashRate({ hashes }: { hashes: number }): React.ReactElement {\n return <Hashes hashes={`${numeralWrapper.formatHashes(hashes)} / sec`} />;\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);\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 from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\nimport { OptionsModal } from \"./OptionsModal\";\nimport { Options } from \"./Options\";\nimport { js_beautify as beautifyCode } from \"js-beautify\";\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 } from \"../../Script/RamCalculations\";\nimport { RamCalculationErrorCode } from \"../../Script/RamCalculationErrorCodes\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CursorPositions } from \"../CursorPositions\";\nimport { libSource } from \"../NetscriptDefinitions\";\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\";\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 TextField from \"@mui/material/TextField\";\nimport IconButton from \"@mui/material/IconButton\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\n\nlet symbolsLoaded = false;\nlet symbols: string[] = [];\nexport function SetupTextEditor(): void {\n const ns = NetscriptFunctions({} as WorkerScript);\n\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 return symbols;\n }\n symbols = populate(ns);\n\n const exclude = [\"heart\", \"break\", \"exploit\", \"bypass\", \"corporation\"];\n symbols = symbols.filter((symbol: string) => !exclude.includes(symbol));\n}\n\ninterface IProps {\n filename: string;\n code: string;\n player: IPlayer;\n router: IRouter;\n}\n\n/*\n\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\n// These variables are used to reload a script when it's clicked on. Because we\n// won't have references to the old script.\nlet lastFilename = \"\";\nlet lastCode = \"\";\nlet lastPosition: monaco.Position | null = null;\n\nexport function Root(props: IProps): React.ReactElement {\n const editorRef = useRef<IStandaloneCodeEditor | null>(null);\n const [filename, setFilename] = useState(props.filename ? props.filename : lastFilename);\n const [code, setCode] = useState<string>(props.filename ? props.code : lastCode);\n const [ram, setRAM] = useState(\"RAM: ???\");\n const [updatingRam, setUpdatingRam] = useState(false);\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 });\n\n const debouncedSetRAM = useMemo(\n () =>\n debounce((s) => {\n setRAM(s);\n setUpdatingRam(false);\n }, 300),\n [],\n );\n\n // store the last known state in case we need to restart without nano.\n useEffect(() => {\n if (props.filename === undefined) return;\n lastFilename = props.filename;\n lastCode = props.code;\n lastPosition = null;\n }, []);\n\n function save(): void {\n if (editorRef.current !== null) {\n const position = editorRef.current.getPosition();\n if (position !== null) {\n CursorPositions.saveCursor(filename, {\n row: position.lineNumber,\n column: position.column,\n });\n }\n }\n lastPosition = null;\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 (filename !== \"n00dles.script\") {\n dialogBoxCreate(\"Leave the script name as 'n00dles'!\");\n return;\n }\n if (code.replace(/\\s/g, \"\").indexOf(\"while(true){hack('n00dles');}\") == -1) {\n dialogBoxCreate(\"Please copy and paste the code from the tutorial!\");\n return;\n }\n\n //Save the script\n const server = props.player.getCurrentServer();\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n let found = false;\n for (let i = 0; i < server.scripts.length; i++) {\n if (filename == server.scripts[i].filename) {\n server.scripts[i].saveScript(filename, code, props.player.currentServer, server.scripts);\n found = true;\n }\n }\n\n if (!found) {\n const script = new Script();\n script.saveScript(filename, code, props.player.currentServer, server.scripts);\n server.scripts.push(script);\n }\n\n iTutorialNextStep();\n\n props.router.toTerminal();\n return;\n }\n\n if (filename == \"\") {\n dialogBoxCreate(\"You must specify a filename!\");\n return;\n }\n\n if (!isValidFilePath(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 = props.player.getCurrentServer();\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(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 (filename == server.scripts[i].filename) {\n server.scripts[i].saveScript(filename, code, props.player.currentServer, server.scripts);\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(filename, code, props.player.currentServer, server.scripts);\n server.scripts.push(script);\n } else if (filename.endsWith(\".txt\")) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === filename) {\n server.textFiles[i].write(code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n const textFile = new TextFile(filename, code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script, .js, or .ns) or \" + \" or text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n }\n\n function beautify(): void {\n if (editorRef.current === null) return;\n const pretty = beautifyCode(code, {\n indent_with_tabs: !options.insertSpaces,\n indent_size: 4,\n brace_style: \"preserve-inline\",\n });\n editorRef.current.setValue(pretty);\n }\n\n function onFilenameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n lastFilename = event.target.value;\n setFilename(event.target.value);\n }\n\n function updateCode(newCode?: string): void {\n if (newCode === undefined) return;\n lastCode = newCode;\n if (editorRef.current !== null) {\n lastPosition = editorRef.current.getPosition();\n }\n setCode(newCode);\n updateRAM(newCode);\n }\n\n // calculate it once the first time the file is loaded.\n useEffect(() => {\n updateRAM(code);\n }, []);\n\n async function updateRAM(newCode: string): Promise<void> {\n setUpdatingRam(true);\n const codeCopy = newCode + \"\";\n const ramUsage = await calculateRamUsage(codeCopy, props.player.getCurrentServer().scripts);\n if (ramUsage > 0) {\n debouncedSetRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage));\n return;\n }\n switch (ramUsage) {\n case RamCalculationErrorCode.ImportError: {\n debouncedSetRAM(\"RAM: Import Error\");\n break;\n }\n case RamCalculationErrorCode.URLImportError: {\n debouncedSetRAM(\"RAM: HTTP Import Error\");\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n debouncedSetRAM(\"RAM: Syntax Error\");\n break;\n }\n }\n return new Promise<void>(() => undefined);\n }\n\n useEffect(() => {\n function maybeSave(event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n //Ctrl + b\n if (event.keyCode == 66 && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n save();\n }\n }\n document.addEventListener(\"keydown\", maybeSave);\n return () => document.removeEventListener(\"keydown\", maybeSave);\n });\n\n function onMount(editor: IStandaloneCodeEditor): void {\n editorRef.current = editor;\n if (editorRef.current === null) return;\n const position = CursorPositions.getCursor(filename);\n if (position.row !== -1)\n editorRef.current.setPosition({\n lineNumber: position.row,\n column: position.column,\n });\n else if (lastPosition !== null)\n editorRef.current.setPosition({\n lineNumber: lastPosition.lineNumber,\n column: lastPosition.column + 1,\n });\n editorRef.current.focus();\n }\n\n function beforeMount(monaco: any): void {\n if (symbolsLoaded) return;\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 monaco.languages.typescript.javascriptDefaults.addExtraLib(libSource, \"netscript.d.ts\");\n monaco.languages.typescript.typescriptDefaults.addExtraLib(libSource, \"netscript.d.ts\");\n }\n\n return (\n <>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <TextField\n type=\"text\"\n tabIndex={1}\n value={filename}\n onChange={onFilenameChange}\n InputProps={{ startAdornment: <Typography>Script name: </Typography> }}\n />\n <IconButton onClick={() => setOptionsOpen(true)}>\n <>\n <SettingsIcon />\n options\n </>\n </IconButton>\n </Box>\n <Editor\n beforeMount={beforeMount}\n onMount={onMount}\n loading={<Typography>Loading script editor!</Typography>}\n height=\"90%\"\n defaultLanguage=\"javascript\"\n defaultValue={code}\n onChange={updateCode}\n theme={options.theme}\n options={options}\n />\n <Box display=\"flex\" flexDirection=\"row\" sx={{ m: 1 }} alignItems=\"center\">\n <Button onClick={beautify}>Beautify</Button>\n <Typography color={updatingRam ? \"secondary\" : \"primary\"} sx={{ mx: 1 }}>\n {ram}\n </Typography>\n <Button onClick={save}>Save & Close (Ctrl/Cmd + b)</Button>\n <Link sx={{ mx: 1 }} target=\"_blank\" href=\"https://bitburner.readthedocs.io/en/latest/index.html\">\n <Typography> Netscript Documentation</Typography>\n </Link>\n </Box>\n <OptionsModal\n open={optionsOpen}\n onClose={() => setOptionsOpen(false)}\n options={{\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n }}\n save={(options: Options) => {\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n Settings.MonacoFontSize = options.fontSize;\n }}\n />\n </>\n );\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 { 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","// The initial formulas was sum 0 to f of 500*1.02^f.\n// These formulas were derived on wolfram alpha.\n\n// Wolfram Alpha: sum from 0 to n of 500*1.02^n\n// 500 * ((pow(51, f+1)) / pow(50,f) - 50)\n// Then we use https://herbie.uwplse.org/demo/ to simplify it and prevent\n// Infinity issues.\nexport function favorToRep(f: number): number {\n function fma(a: number, b: number, c: number): number {\n return a * b + c;\n }\n const ex = fma(f, Math.log(51.0) - Math.log(50.0), Math.log(51.0));\n return fma(500.0, Math.exp(ex), -25000.0);\n}\n\n// Wolfram Alpha: 500 (50^(-n) 51^(n + 1) - 50) solve for n\nexport function repToFavor(r: number): number {\n return -Math.log(25500 / (r + 25000)) / Math.log(51 / 50);\n}\n","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessBladeburner(this: IPlayer): boolean {\n if (this.bitNodeN === 8) {\n return false;\n }\n\n return this.bitNodeN === 6 || this.bitNodeN === 7 || SourceFileFlags[6] > 0 || SourceFileFlags[7] > 0;\n}\n\nexport function inBladeburner(this: IPlayer): boolean {\n if (this.bladeburner == null) {\n return false;\n }\n return this.bladeburner instanceof Bladeburner;\n}\n\nexport function startBladeburner(this: IPlayer): void {\n this.bladeburner = new Bladeburner(this);\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\nexport class Contract extends Action {\n constructor(params: IActionParams | null = null) {\n super(params);\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceContract;\n }\n\n toJSON(): any {\n return Generic_toJSON(\"Contract\", this);\n }\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Contract {\n return Generic_fromJSON(Contract, value.data);\n }\n}\n\nReviver.constructors.Contract = Contract;\n","export const ConsoleHelpText: {\n [key: string]: string[];\n helpList: string[];\n automate: string[];\n clear: string[];\n cls: string[];\n help: string[];\n log: string[];\n skill: string[];\n start: string[];\n stop: string[];\n} = {\n helpList: [\n \"Use 'help [command]' to get more information about a particular Bladeburner console command.\",\n \"\",\n \" automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks\",\n \" clear/cls Clear the console\",\n \" help [cmd] Display this help text, or help text for a specific command\",\n \" log [en/dis] [type] Enable or disable logging for events and actions\",\n \" skill [action] [name] Level or display info about your Bladeburner skills\",\n \" start [type] [name] Start a Bladeburner action/task\",\n \" stop Stops your current Bladeburner action/task\",\n ],\n automate: [\n \"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 \" 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 clear: [\"clear\", \"\", \"Clears the console\"],\n cls: [\"cls\", \"\", \"Clears the console\"],\n help: [\n \"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 log: [\n \"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 skill: [\n \"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<br>\" + \" 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 start: [\n \"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 stop: [\"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","import { Corporation } from \"../../Corporation/Corporation\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessCorporation(this: IPlayer): boolean {\n return this.bitNodeN === 3 || SourceFileFlags[3] > 0;\n}\n\nexport function hasCorporation(this: IPlayer): boolean {\n if (this.corporation == null) {\n return false;\n }\n return this.corporation instanceof Corporation;\n}\n\nexport function startCorporation(this: IPlayer, corpName: string, additionalShares = 0): void {\n this.corporation = new Corporation({\n name: corpName,\n });\n\n this.corporation.totalShares += additionalShares;\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","/**\n * Game engine. Handles the main game loop.\n */\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { Augmentations } from \"./Augmentation/Augmentations\";\nimport { initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { generateRandomContract } from \"./CodingContractGenerator\";\nimport { initCompanies } from \"./Company/Companies\";\nimport { Corporation } from \"./Corporation/Corporation\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { processPassiveFactionRepGain, inviteToFaction } from \"./Faction/FactionHelpers\";\nimport { Router } from \"./ui/GameRoot\";\nimport { SetupTextEditor } from \"./ScriptEditor/ui/ScriptEditorRoot\";\n\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"./PersonObjects/formulas/reputation\";\nimport { hasHacknetServers, processHacknetEarnings } from \"./Hacknet/HacknetHelpers\";\nimport { iTutorialStart } from \"./InteractiveTutorial\";\nimport { checkForMessagesToSend, initMessages } from \"./Message/MessageHelpers\";\nimport { loadAllRunningScripts, updateOnlineScriptTimes } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { saveObject, loadGame } from \"./SaveObject\";\nimport { initForeignServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { ThemeEvents } from \"./ui/React/Theme\";\nimport { updateSourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { initSymbolToStockMap, processStockPrices } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\nimport { Sleeve } from \"./PersonObjects/Sleeve/Sleeve\";\nimport { Locations } from \"./Locations/Locations\";\nimport { LocationName } from \"./Locations/data/LocationNames\";\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\";\n\nimport React from \"react\";\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 };\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 // Working\n if (Player.isWorking) {\n if (Player.workType == CONSTANTS.WorkTypeFaction) {\n if (Player.workForFaction(numCycles)) {\n Router.toFaction();\n }\n } else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {\n if (Player.createProgramWork(numCycles)) {\n Router.toTerminal();\n }\n } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {\n if (Player.takeClass(numCycles)) {\n Router.toCity();\n }\n } else if (Player.workType == CONSTANTS.WorkTypeCrime) {\n if (Player.commitCrime(numCycles)) {\n Router.toLocation(Locations[LocationName.Slums]);\n }\n } else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n if (Player.workPartTime(numCycles)) {\n Router.toCity();\n }\n } else {\n if (Player.work(numCycles)) {\n Router.toCity();\n }\n }\n }\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 // 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 },\n\n decrementAllCounters: function (numCycles = 1) {\n for (const counterName in Engine.Counters) {\n const counter = Engine.Counters[counterName];\n if (counter === undefined) throw new Error(\"counter should not be undefined\");\n Engine.Counters[counterName] = counter - numCycles;\n }\n },\n\n /**\n * Checks if any counters are 0. If they are, executes whatever\n * is necessary and then resets the counter\n */\n checkCounters: function () {\n if (Engine.Counters.autoSaveCounter <= 0) {\n if (Settings.AutosaveInterval == null) {\n Settings.AutosaveInterval = 60;\n }\n if (Settings.AutosaveInterval === 0) {\n Engine.Counters.autoSaveCounter = Infinity;\n } else {\n Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;\n saveObject.saveGame();\n }\n }\n\n if (Engine.Counters.checkFactionInvitations <= 0) {\n const invitedFactions = Player.checkForFactionInvitations();\n if (invitedFactions.length > 0) {\n const randFaction = invitedFactions[Math.floor(Math.random() * invitedFactions.length)];\n inviteToFaction(randFaction);\n }\n Engine.Counters.checkFactionInvitations = 100;\n }\n\n if (Engine.Counters.passiveFactionGrowth <= 0) {\n const adjustedCycles = Math.floor(5 - Engine.Counters.passiveFactionGrowth);\n processPassiveFactionRepGain(adjustedCycles);\n Engine.Counters.passiveFactionGrowth = 5;\n }\n\n if (Engine.Counters.messages <= 0) {\n checkForMessagesToSend();\n if (Augmentations[AugmentationNames.TheRedPill].owned) {\n Engine.Counters.messages = 4500; // 15 minutes for Red pill message\n } else {\n Engine.Counters.messages = 150;\n }\n }\n if (Player.corporation instanceof Corporation) {\n Player.corporation.process(Player);\n }\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.bladeburner instanceof Bladeburner) {\n try {\n Player.bladeburner.process(Router, Player);\n } catch (e) {\n exceptionAlert(\"Exception caught in Bladeburner.process(): \" + e);\n }\n }\n Engine.Counters.mechanicProcess = 5;\n }\n\n if (Engine.Counters.contractGeneration <= 0) {\n // X% chance of a contract being generated\n if (Math.random() <= 0.25) {\n generateRandomContract();\n }\n Engine.Counters.contractGeneration = 3000;\n }\n },\n\n load: function (saveString) {\n startExploits();\n // Load game from save or create new game\n if (loadGame(saveString)) {\n ThemeEvents.emit();\n\n initBitNodeMultipliers(Player);\n updateSourceFileFlags(Player);\n initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Calculate the number of cycles have elapsed while offline\n Engine._lastUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timeOffline = Engine._lastUpdate - lastUpdate;\n const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed);\n\n let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome);\n // Process offline progress\n loadAllRunningScripts(); // This also takes care of offline production for those scripts\n if (Player.isWorking) {\n Player.focus = true;\n if (Player.workType == CONSTANTS.WorkTypeFaction) {\n Player.workForFaction(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {\n Player.createProgramWork(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {\n Player.takeClass(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCrime) {\n Player.commitCrime(numCyclesOffline);\n } else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n Player.workPartTime(numCyclesOffline);\n } else {\n Player.work(numCyclesOffline);\n }\n } else {\n for (let i = 0; i < Player.factions.length; i++) {\n const facName = Player.factions[i];\n if (!Factions.hasOwnProperty(facName)) continue;\n const faction = Factions[facName];\n if (!faction.isMember) continue;\n // No rep for special factions.\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No rep for gangs.\n if (Player.getGangName() === facName) continue;\n\n const hRep = getHackingWorkRepGain(Player, faction);\n const sRep = getFactionSecurityWorkRepGain(Player, faction);\n const fRep = getFactionFieldWorkRepGain(Player, faction);\n // can be infinite, doesn't matter.\n const reputationRate = Math.max(hRep, sRep, fRep) / Player.factions.length;\n\n const rep = reputationRate * numCyclesOffline;\n faction.playerReputation += rep;\n offlineReputation += rep;\n }\n }\n\n // Hacknet Nodes offline progress\n const offlineProductionFromHacknetNodes = processHacknetEarnings(Player, numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers(Player) ? (\n <>\n <Hashes hashes={offlineProductionFromHacknetNodes} /> hashes\n </>\n ) : (\n <Money money={offlineProductionFromHacknetNodes} />\n );\n\n // Passive faction rep gain offline\n processPassiveFactionRepGain(numCyclesOffline);\n\n // Stock Market offline progress\n if (Player.hasWseAccount) {\n processStockPrices(numCyclesOffline);\n }\n\n // Gang progress for BitNode 2\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n gang.process(numCyclesOffline, Player);\n }\n\n // Corporation offline progress\n if (Player.corporation instanceof Corporation) {\n Player.corporation.storeCycles(numCyclesOffline);\n }\n\n // Bladeburner offline progress\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCyclesOffline);\n }\n\n // Sleeves offline progress\n for (let i = 0; i < Player.sleeves.length; ++i) {\n if (Player.sleeves[i] instanceof Sleeve) {\n const expForOtherSleeves = Player.sleeves[i].process(Player, numCyclesOffline);\n\n // This sleeve earns experience for other sleeves\n if (expForOtherSleeves == null) {\n continue;\n }\n for (let j = 0; j < Player.sleeves.length; ++j) {\n if (j === i) {\n continue;\n }\n Player.sleeves[j].gainExperience(Player, expForOtherSleeves, numCyclesOffline, true);\n }\n }\n }\n\n // Update total playtime\n const time = numCyclesOffline * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Player.lastUpdate = Engine._lastUpdate;\n Engine.start(); // Run main game loop and Scripts loop\n const timeOfflineString = convertTimeMsToTimeElapsedString(time);\n setTimeout(\n () =>\n AlertEvents.emit(\n <>\n Offline for {timeOfflineString}. While you were offline, your scripts generated{\" \"}\n <Money money={offlineHackingIncome} />, your Hacknet Nodes generated {hacknetProdInfo} and you gained{\" \"}\n <Reputation reputation={offlineReputation} /> reputation divided amongst your factions.\n </>,\n ),\n 250,\n );\n } else {\n // No save found, start new game\n initBitNodeMultipliers(Player);\n Engine.start(); // Run main game loop and Scripts loop\n Player.init();\n initForeignServers(Player.getHomeComputer());\n initCompanies();\n initFactions();\n initAugmentations();\n initMessages();\n updateSourceFileFlags(Player);\n\n // Start interactive tutorial\n iTutorialStart();\n }\n SetupTextEditor();\n },\n\n start: function () {\n // Get time difference\n const _thisUpdate = new Date().getTime();\n let diff = _thisUpdate - Engine._lastUpdate;\n const offset = diff % CONSTANTS._idleSpeed;\n\n // Divide this by cycle time to determine how many cycles have elapsed since last update\n diff = Math.floor(diff / CONSTANTS._idleSpeed);\n\n if (diff > 0) {\n // Update the game engine by the calculated number of cycles\n Engine._lastUpdate = _thisUpdate - offset;\n Player.lastUpdate = _thisUpdate - offset;\n Engine.updateGame(diff);\n }\n\n window.requestAnimationFrame(Engine.start);\n },\n};\n\nexport { Engine };\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\";\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\";\n\nexport function LoadingScreen(): React.ReactElement {\n const [show, setShow] = useState(false);\n const [loaded, setLoaded] = useState(false);\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 Engine.load(saveString);\n setLoaded(true);\n })\n .catch((reason) => {\n console.error(reason);\n Engine.load(\"\");\n setLoaded(true);\n });\n }\n doLoad();\n }, []);\n\n if (loaded) {\n return <GameRoot terminal={Terminal} engine={Engine} player={Player} />;\n }\n\n return (\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 v{CONSTANTS.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}\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 * 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","/**\n * Class representing a visitable location in the world\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\nimport { LocationType } from \"./LocationTypeEnum\";\n\ninterface IInfiltrationMetadata {\n maxClearanceLevel: number;\n startingSecurityLevel: number;\n}\n\nexport interface IConstructorParams {\n city?: CityName | null;\n costMult?: number;\n expMult?: number;\n infiltrationData?: IInfiltrationMetadata;\n name?: LocationName;\n types?: LocationType[];\n techVendorMaxRam?: number;\n techVendorMinRam?: number;\n}\n\nexport class Location {\n /**\n * Name of city this location is in. If this property is null, it means this i\n * is a generic location that is available in all cities\n */\n city: CityName | null = null;\n\n /**\n * Cost multiplier that influences how expensive a gym/university is\n */\n costMult = 0;\n\n /**\n * Exp multiplier that influences how effective a gym/university is\n */\n expMult = 0;\n\n /**\n * Companies can be infiltrated. This contains the data required for that\n * infiltration event\n */\n infiltrationData?: IInfiltrationMetadata;\n\n /**\n * Identifier for location\n */\n name: LocationName = LocationName.Void;\n\n /**\n * List of what type(s) this location is. A location can be multiple types\n * (e.g. company and tech vendor)\n */\n types: LocationType[] = [];\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMaxRam = 0;\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMinRam = 0;\n\n constructor(p: IConstructorParams) {\n if (p.city) {\n this.city = p.city;\n }\n if (p.costMult) {\n this.costMult = p.costMult;\n }\n if (p.expMult) {\n this.expMult = p.expMult;\n }\n if (p.infiltrationData) {\n this.infiltrationData = p.infiltrationData;\n }\n if (p.name) {\n this.name = p.name;\n }\n if (p.types) {\n this.types = p.types;\n }\n if (p.techVendorMaxRam) {\n this.techVendorMaxRam = p.techVendorMaxRam;\n }\n if (p.techVendorMinRam) {\n this.techVendorMinRam = p.techVendorMinRam;\n }\n }\n}\n","/**\n * Creates a dropdown (select HTML element) with server hostnames as options\n *\n * Configurable to only contain certain types of servers\n */\nimport React from \"react\";\nimport { GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\n// TODO make this an enum when this gets converted to TypeScript\nexport const ServerType = {\n All: 0,\n Foreign: 1, // Hackable, non-owned servers\n Owned: 2, // Home Computer, Purchased Servers, and Hacknet Servers\n Purchased: 3, // Everything from Owned except home computer\n};\n\ninterface IProps {\n purchase: () => void;\n canPurchase: boolean;\n serverType: number;\n onChange: (event: SelectChangeEvent<string>) => void;\n value: string;\n}\n\nexport function ServerDropdown(props: IProps): React.ReactElement {\n /**\n * Checks if the server should be shown in the dropdown menu, based on the\n * 'serverType' property\n */\n function isValidServer(s: BaseServer): boolean {\n const purchased = s instanceof Server && s.purchasedByPlayer;\n const type = props.serverType;\n switch (type) {\n case ServerType.All:\n return true;\n case ServerType.Foreign:\n return s.hostname !== \"home\" && !purchased;\n case ServerType.Owned:\n return purchased || s instanceof HacknetServer || s.hostname === \"home\";\n case ServerType.Purchased:\n return purchased || s instanceof HacknetServer;\n default:\n console.warn(`Invalid ServerType specified for ServerDropdown component: ${type}`);\n return false;\n }\n }\n\n const servers = [];\n for (const server of GetAllServers()) {\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","/**\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\";\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 server = GetServer(loc.name);\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <>\n <Button onClick={() => router.toCity()}>Return to World</Button>\n <Typography variant=\"h4\">\n {backdoorInstalled && !Settings.DisableTextEffects ? <CorruptableText content={loc.name} /> : loc.name}\n </Typography>\n {locContent}\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","export type 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","export const libSource = `\n\ntype Host = string;\ntype Script = string;\ntype StockSymbol =\n | \"ECP\"\n | \"MGCP\"\n | \"BLD\"\n | \"CLRK\"\n | \"OMTK\"\n | \"FSIG\"\n | \"KGI\"\n | \"FLCM\"\n | \"STM\"\n | \"DCOMM\"\n | \"HLS\"\n | \"VITA\"\n | \"ICRS\"\n | \"UNV\"\n | \"AERO\"\n | \"OMN\"\n | \"SLRS\"\n | \"GPH\"\n | \"NVMD\"\n | \"WDS\"\n | \"LXO\"\n | \"RHOC\"\n | \"APHE\"\n | \"SYSC\"\n | \"CTK\"\n | \"NTLK\"\n | \"OMGA\"\n | \"FNS\"\n | \"SGC\"\n | \"JGN\"\n | \"CTYS\"\n | \"MDYN\"\n | \"TITN\";\ntype OrderType = \"limitbuy\" | \"limitsell\" | \"stopbuy\" | \"stopsell\";\ntype OrderPos = \"long\" | \"short\";\ntype University =\n | \"Summit University\"\n | \"Rothman University\"\n | \"ZB Institute Of Technology\";\ntype UniversityCourse =\n | \"Study Computer Science\"\n | \"Data Strucures\"\n | \"Networks\"\n | \"Algorithms\"\n | \"Management\"\n | \"Leadership\";\ntype Gym =\n | \"Crush Fitness Gym\"\n | \"Snap Fitness Gym\"\n | \"Iron Gym\"\n | \"Powerhouse Gym\"\n | \"Millenium Fitness Gym\";\ntype GymStat = \"str\" | \"def\" | \"dex\" | \"agi\";\ntype City =\n | \"Aevum\"\n | \"Chongqing\"\n | \"Sector-12\"\n | \"New Tokyo\"\n | \"Ishima\"\n | \"Volhaven\";\ntype PurchaseableProgram =\n | \"brutessh.exe\"\n | \"ftpcrack.exe\"\n | \"relaysmtp.exe\"\n | \"httpworm.exe\"\n | \"sqlinject.exe\"\n | \"deepscanv1.exe\"\n | \"deepscanv2.exe\"\n | \"autolink.exe\";\ntype CreatableProgram = PurchaseableProgram | \"serverprofiler.exe\";\ntype CompanyName =\n // Sector-12\n | \"MegaCorp\"\n | \"BladeIndustries\"\n | \"FourSigma\"\n | \"IcarusMicrosystems\"\n | \"UniversalEnergy\"\n | \"DeltaOne\"\n | \"CIA\"\n | \"NSA\"\n | \"AlphaEnterprises\"\n | \"CarmichaelSecurity\"\n | \"FoodNStuff\"\n | \"JoesGuns\"\n\n // Aevum\n | \"ECorp\"\n | \"BachmanAndAssociates\"\n | \"ClarkeIncorporated\"\n | \"OmniTekIncorporated\"\n | \"FulcrumTechnologies\"\n | \"GalacticCybersystems\"\n | \"AeroCorp\"\n | \"WatchdogSecurity\"\n | \"RhoConstruction\"\n | \"AevumPolice\"\n | \"NetLinkTechnologies\"\n\n // Volhaven\n | \"NWO\"\n | \"HeliosLabs\"\n | \"OmniaCybersystems\"\n | \"LexoCorp\"\n | \"SysCoreSecurities\"\n | \"CompuTek\"\n\n // Chongqing\n | \"KuaiGongInternational\"\n | \"SolarisSpaceSystems\"\n\n // Ishima\n | \"StormTechnologies\"\n | \"NovaMedical\"\n | \"OmegaSoftware\"\n\n // New Tokyo\n | \"DefComm\"\n | \"VitaLife\"\n | \"GlobalPharmaceuticals\"\n | \"NoodleBar\";\ntype CompanyField =\n | \"software\"\n | \"software consultant\"\n | \"it\"\n | \"security engineer\"\n | \"network engineer\"\n | \"business\"\n | \"business consultant\"\n | \"security\"\n | \"agent\"\n | \"employee\"\n | \"part-time employee\"\n | \"waiter\"\n | \"part-time waiter\";\ntype FactionName =\n | \"Illuminati\"\n | \"Daedalus\"\n | \"The Covenant\"\n | \"ECorp\"\n | \"MegaCorp\"\n | \"Bachman & Associates\"\n | \"Blade Industries\"\n | \"NWO\"\n | \"Clarke Incorporated\"\n | \"OmniTek Incorporated\"\n | \"Four Sigma\"\n | \"KuaiGong International\"\n | \"Fulcrum Secret Technologies\"\n | \"BitRunners\"\n | \"The Black Hand\"\n | \"NiteSec\"\n | \"Aevum\"\n | \"Chongqing\"\n | \"Ishima\"\n | \"New Tokyo\"\n | \"Sector-12\"\n | \"Volhaven\"\n | \"Speakers for the Dead\"\n | \"The Dark Army\"\n | \"The Syndicate\"\n | \"Silhouette\"\n | \"Tetrads\"\n | \"Slum Snakes\"\n | \"Netburners\"\n | \"Tian Di Hui\"\n | \"CyberSec\"\n | \"Bladeburners\";\n\ntype GangName =\n | \"Slum Snakes\"\n | \"Tetrads\"\n | \"The Syndicate\"\n | \"The Dark Army\"\n | \"Speakers for the Dead\"\n | \"NiteSec\"\n | \"The Black Hand\";\ntype FactionWork = \"hacking\" | \"field\" | \"security\";\ntype Crime =\n | \"shoplift\"\n | \"rob store\"\n | \"mug\"\n | \"larceny\"\n | \"deal drugs\"\n | \"bond forgery\"\n | \"traffick arms\"\n | \"homicide\"\n | \"grand theft auto\"\n | \"kidnap\"\n | \"assassinate\"\n | \"heist\";\ntype AugmentName =\n | \"Augmented Targeting I\"\n | \"Augmented Targeting II\"\n | \"Augmented Targeting III\"\n | \"Synthetic Heart\"\n | \"Synfibril Muscle\"\n | \"Combat Rib I\"\n | \"Combat Rib II\"\n | \"Combat Rib III\"\n | \"Nanofiber Weave\"\n | \"NEMEAN Subdermal Weave\"\n | \"Wired Reflexes\"\n | \"Graphene Bone Lacings\"\n | \"Bionic Spine\"\n | \"Graphene Bionic Spine Upgrade\"\n | \"Bionic Legs\"\n | \"Graphene Bionic Legs Upgrade\"\n | \"Speech Processor Implant\"\n | \"TITN-41 Gene-Modification Injection\"\n | \"Enhanced Social Interaction Implant\"\n | \"BitWire\"\n | \"Artificial Bio-neural Network Implant\"\n | \"Artificial Synaptic Potentiation\"\n | \"Enhanced Myelin Sheathing\"\n | \"Synaptic Enhancement Implant\"\n | \"Neural-Retention Enhancement\"\n | \"DataJack\"\n | \"Embedded Netburner Module\"\n | \"Embedded Netburner Module Core Implant\"\n | \"Embedded Netburner Module Core V2 Upgrade\"\n | \"Embedded Netburner Module Core V3 Upgrade\"\n | \"Embedded Netburner Module Analyze Engine\"\n | \"Embedded Netburner Module Direct Memory Access Upgrade\"\n | \"Neuralstimulator\"\n | \"Neural Accelerator\"\n | \"Cranial Signal Processors - Gen I\"\n | \"Cranial Signal Processors - Gen II\"\n | \"Cranial Signal Processors - Gen III\"\n | \"Cranial Signal Processors - Gen IV\"\n | \"Cranial Signal Processors - Gen V\"\n | \"Neuronal Densification\"\n | \"Nuoptimal Nootropic Injector Implant\"\n | \"Speech Enhancement\"\n | \"FocusWire\"\n | \"PC Direct-Neural Interface\"\n | \"PC Direct-Neural Interface Optimization Submodule\"\n | \"PC Direct-Neural Interface NeuroNet Injector\"\n | \"ADR-V1 Pheromone Gene\"\n | \"ADR-V2 Pheromone Gene\"\n | \"The Shadow's Simulacrum\"\n | \"Hacknet Node CPU Architecture Neural-Upload\"\n | \"Hacknet Node Cache Architecture Neural-Upload\"\n | \"Hacknet Node NIC Architecture Neural-Upload\"\n | \"Hacknet Node Kernel Direct-Neural Interface\"\n | \"Hacknet Node Core Direct-Neural Interface\"\n | \"NeuroFlux Governor\"\n | \"Neurotrainer I\"\n | \"Neurotrainer II\"\n | \"Neurotrainer III\"\n | \"HyperSight Corneal Implant\"\n | \"LuminCloaking-V1 Skin Implant\"\n | \"LuminCloaking-V2 Skin Implant\"\n | \"HemoRecirculator\"\n | \"SmartSonar Implant\"\n | \"Power Recirculation Core\"\n | \"QLink\"\n | \"The Red Pill\"\n | \"SPTN-97 Gene Modification\"\n | \"ECorp HVMind Implant\"\n | \"CordiARC Fusion Reactor\"\n | \"SmartJaw\"\n | \"Neotra\"\n | \"Xanipher\"\n | \"nextSENS Gene Modification\"\n | \"OmniTek InfoLoad\"\n | \"Photosynthetic Cells\"\n | \"BitRunners Neurolink\"\n | \"The Black Hand\"\n | \"CRTX42-AA Gene Modification\"\n | \"Neuregen Gene Modification\"\n | \"CashRoot Starter Kit\"\n | \"NutriGen Implant\"\n | \"INFRARET Enhancement\"\n | \"DermaForce Particle Barrier\"\n | \"Graphene BranchiBlades Upgrade\"\n | \"Graphene Bionic Arms Upgrade\"\n | \"BrachiBlades\"\n | \"Bionic Arms\"\n | \"Social Negotiation Assistant (S.N.A)\"\n | \"EsperTech Bladeburner Eyewear\"\n | \"EMS-4 Recombination\"\n | \"ORION-MKIV Shoulder\"\n | \"Hyperion Plasma Cannon V1\"\n | \"Hyperion Plasma Cannon V2\"\n | \"GOLEM Serum\"\n | \"Vangelis Virus\"\n | \"Vangelis Virus 3.0\"\n | \"I.N.T.E.R.L.I.N.K.E.D\"\n | \"Blade's Runners\"\n | \"BLADE-51b Tesla Armor\"\n | \"BLADE-51b Tesla Armor: Power Cells Upgrade\"\n | \"BLADE-51b Tesla Armor: Energy Shielding Upgrade\"\n | \"BLADE-51b Tesla Armor: Unibeam Upgrade\"\n | \"BLADE-51b Tesla Armor: Omnibeam Upgrade\"\n | \"BLADE-51b Tesla Armor: IPU Upgrade\"\n | \"The Blade's Simulacrum\";\n\ninterface 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: number;\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\ninterface AugmentationStats {\n /** Multipler to hacking skill */\n hacking_mult?: number;\n /** Multipler to strength skill */\n strength_mult?: number;\n /** Multipler to defense skill */\n defense_mult?: number;\n /** Multipler to dexterity skill */\n dexterity_mult?: number;\n /** Multipler to agility skill */\n agility_mult?: number;\n /** Multipler to charisma skill */\n charisma_mult?: number;\n /** Multipler to hacking experience gain rate */\n hacking_exp_mult?: number;\n /** Multipler to strength experience gain rate */\n strength_exp_mult?: number;\n /** Multipler to defense experience gain rate */\n defense_exp_mult?: number;\n /** Multipler to dexterity experience gain rate */\n dexterity_exp_mult?: number;\n /** Multipler to agility experience gain rate */\n agility_exp_mult?: number;\n /** Multipler to charisma experience gain rate */\n charisma_exp_mult?: number;\n /** Multipler to chance of successfully performing a hack */\n hacking_chance_mult?: number;\n /** Multipler to hacking speed */\n hacking_speed_mult?: number;\n /** Multipler to amount of money the player gains from hacking */\n hacking_money_mult?: number;\n /** Multipler to amount of money injected into servers using {@link grow()} */\n hacking_grow_mult?: number;\n /** Multipler to amount of reputation gained when working */\n company_rep_mult?: number;\n /** Multipler to amount of reputation gained when working */\n faction_rep_mult?: number;\n /** Multipler to amount of money gained from crimes */\n crime_money_mult?: number;\n /** Multipler to crime success rate */\n crime_success_mult?: number;\n /** Multipler to amount of money gained from working */\n work_money_mult?: number;\n /** Multipler to amount of money produced by Hacknet Nodes */\n hacknet_node_money_mult?: number;\n /** Multipler to cost of purchasing a Hacknet Node */\n hacknet_node_purchase_cost_mult?: number;\n /** Multipler to cost of ram for a Hacknet Node */\n hacknet_node_ram_cost_mult?: number;\n /** Multipler to cost of core for a Hacknet Node */\n hacknet_node_core_cost_mult?: number;\n /** Multipler to cost of leveling up a Hacknet Node */\n hacknet_node_level_cost_mult?: number;\n /** Multipler to Bladeburner max stamina */\n bladeburner_max_stamina_mult?: number;\n /** Multipler to Bladeburner stamina gain rate */\n bladeburner_stamina_gain_mult?: number;\n /** Multipler to effectiveness in Bladeburner Field Analysis */\n bladeburner_analysis_mult?: number;\n /** Multipler to success chance in Bladeburner contracts/operations */\n bladeburner_success_chance_mult?: number;\n}\ninterface 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}\n\ninterface 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\ninterface AugmentPair {\n /** augmentation name */\n name: AugmentName;\n /** augmentation cost */\n cost: number;\n}\n\ninterface StockOrderObject {\n /** Number of shares */\n shares: number;\n /** Price per share */\n price: number;\n /** Order type */\n type: \"Limit Buy Order\" | \"Limit Sell Order\" | \"Stop Buy Order\" | \"Stop Buy Order\";\n /** Order position */\n position: \"S\" | \"L\";\n}\ntype StockOrder = {\n /** Stock Symbol */\n [key in StockSymbol]?: StockOrderObject[];\n};\n\ninterface ProcessInfo {\n /** Script name. */\n filename: Script;\n /** Number of threads script is running with */\n threads: number;\n /** Script's arguments */\n args: string[];\n}\n\ninterface 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\ninterface 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\ninterface BitNodeMultipliers {\n /** Influences how quickly the player's agility level (not exp) scales */\n AgilityLevelMultiplier: number;\n /** Influences the base cost to purchase an augmentation. */\n AugmentationMoneyCost: number;\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\n AugmentationRepCost: number;\n /** Influences how quickly the player can gain rank within Bladeburner. */\n BladeburnerRank: number;\n /** Influences the cost of skill levels from Bladeburner. */\n BladeburnerSkillCost: number;\n /** Influences how quickly the player's charisma level (not exp) scales */\n CharismaLevelMultiplier: number;\n /** Influences the experience gained for each ability when a player completes a class. */\n ClassGymExpGain: number;\n /** Influences the amount of money gained from completing Coding Contracts */\n CodingContractMoney: number;\n /** Influences the experience gained for each ability when the player completes working their job. */\n CompanyWorkExpGain: number;\n /** Influences how much money the player earns when completing working their job. */\n CompanyWorkMoney: number;\n /** Influences the valuation of corporations created by the player. */\n CorporationValuation: number;\n /** Influences the base experience gained for each ability when the player commits a crime. */\n CrimeExpGain: number;\n /** Influences the base money gained when the player commits a crime. */\n CrimeMoney: number;\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\n DaedalusAugsRequirement: number;\n /** Influences how quickly the player's defense level (not exp) scales */\n DefenseLevelMultiplier: number;\n /** Influences how quickly the player's dexterity level (not exp) scales */\n DexterityLevelMultiplier: number;\n /** Influences how much rep the player gains in each faction simply by being a member. */\n FactionPassiveRepGain: number;\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\n FactionWorkExpGain: number;\n /** Influences how much rep the player gains when performing work for a faction. */\n FactionWorkRepGain: number;\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\n FourSigmaMarketDataApiCost: number;\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\n FourSigmaMarketDataCost: number;\n /** Influences the 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 the minimum favor the player must have with a faction before they can donate to gain rep. */\n RepToDonateToFaction: number;\n /** Influences how much money can be stolen from a server when a script performs a hack against it. */\n ScriptHackMoney: number;\n /** Influences the growth percentage per cycle against a server. */\n ServerGrowthRate: number;\n /** Influences the maxmimum money that a server can grow to. */\n ServerMaxMoney: number;\n /** Influences the initial money that a server starts with. */\n ServerStartingMoney: number;\n /** Influences the initial security level (hackDifficulty) of a server. */\n ServerStartingSecurity: number;\n /** Influences the weaken amount per invocation against a server. */\n ServerWeakenRate: number;\n /** Influences how quickly the player's strength level (not exp) scales */\n StrengthLevelMultiplier: number;\n}\n/**\n * A port is implemented as a sort of serialized queue,\n * where you can only write and read one element at a time from the port.\n * When you read data from a port, the element that is read is removed from the port.\n *\n * IMPORTANT: The data inside ports are not saved!\n * This means if you close and re-open the game, or reload the page\n * then you will lose all of the data in the ports!\n */\ntype Port = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20;\ntype Handle = string | Port;\n\ninterface NodeStats {\n /** Node's name (\"hacknet-node-5\") */\n name: string;\n /** Node's level */\n level: number;\n /** Node's RAM */\n ram: 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\ntype HashUpgrades =\n | \"Sell for Money\"\n | \"Sell for Corporation Funds\"\n | \"Reduce Minimum Security\"\n | \"Increase Maximum Money\"\n | \"Improve Studying\"\n | \"Improve Gym Training\"\n | \"Exchange for Corporation Research\"\n | \"Exchange for Bladeburner Rank\"\n | \"Exchange for Bladeburner SP\"\n | \"Generate Coding Contract\";\n\ninterface PlayerStats {\n /** Hacking level */\n hacking: number;\n /** Strength level */\n strength: number;\n /** Defense level */\n defense: number;\n /** Dexterity level */\n dexterity: number;\n /** Agility level */\n agility: number;\n /** Chraisma level */\n charisma: number;\n /** Intelligence level */\n intelligence: number;\n}\n\ninterface CharacterMult {\n /** Agility stat */\n agility: number;\n /** Agility exp */\n agilityExp: number;\n /** Company reputation */\n companyRep: number;\n /** Money earned from crimes */\n crimeMoney: number;\n /** Crime success chance */\n crimeSuccess: number;\n /** Defense stat */\n defense: number;\n /** Defense exp */\n defenseExp: number;\n /** Dexterity stat */\n dexterity: number;\n /** Dexterity exp */\n dexterityExp: number;\n /** Faction reputation */\n factionRep: number;\n /** Hacking stat */\n hacking: number;\n /** Hacking exp */\n hackingExp: number;\n /** Strength stat */\n strength: number;\n /** Strength exp */\n strengthExp: number;\n /** Money earned from jobs */\n workMoney: number;\n}\ninterface CharacterInfo {\n /** Current BitNode number */\n bitnode: number;\n /** Name of city you are currently in */\n city: City;\n /** Array of factions you are currently a member of */\n factions: FactionName[];\n /** Current health points */\n hp: number;\n /** Array of all companies at which you have jobs */\n company: CompanyName[];\n /** Array of job positions for all companies you are employed at. Same order as 'jobs' */\n jobTitle: CompanyField[];\n /** Maximum health points */\n maxHp: number;\n /** Boolean indicating whether or not you have a tor router */\n tor: boolean;\n /** Object with many of the player's multipliers from Augmentations/Source Files */\n mult: CharacterMult;\n /** Timed worked in ms */\n timeWorked: number;\n /** Hacking experience earned so far from work */\n workHackExpGain: number;\n /** Str experience earned so far from work */\n workStrExpGain: number;\n /** Def experience earned so far from work */\n workDefExpGain: number;\n /** Dex experience earned so far from work */\n workDexExpGain: number;\n /** Agi experience earned so far from work */\n workAgiExpGain: number;\n /** Cha experience earned so far from work */\n workChaExpGain: number;\n /** Reputation earned so far from work, if applicable */\n workRepGain: number;\n /** Money earned so far from work, if applicable */\n workMoneyGain: number;\n}\n\ninterface 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\ninterface SourceFileLvl {\n /** The number of the source file */\n n: 1|2|3|4|5|6|7|8|9|10|11|12;\n /** The level of the source file */\n lvl: number;\n}\n\ntype BladeburnerContracts =\n | \"Tracking\"\n | \"Bounty Hunter\"\n | \"Retirement\";\n\ntype BladeburnerOperations =\n | \"Investigation\"\n | \"Undercover Operation\"\n | \"Sting Operation\"\n | \"Raid\"\n | \"Stealth Retirement Operation\"\n | \"Assassination\";\n\ntype BladeburnerBlackOps =\n | \"Operation Typhoon\"\n | \"Operation Zero\"\n | \"Operation X\"\n | \"Operation Titan\"\n | \"Operation Ares\"\n | \"Operation Archangel\"\n | \"Operation Juggernaut\"\n | \"Operation Red Dragon\"\n | \"Operation K\"\n | \"Operation Deckard\"\n | \"Operation Tyrell\"\n | \"Operation Wallace\"\n | \"Operation Shoulder of Orion\"\n | \"Operation Hyron\"\n | \"Operation Morpheus\"\n | \"Operation Ion Storm\"\n | \"Operation Annihilus\"\n | \"Operation Ultron\"\n | \"Operation Centurion\"\n | \"Operation Vindictus\"\n | \"Operation Daedalus\";\n\ntype BladeburnerGenActions =\n | \"Training\"\n | \"Field Analysis\"\n | \"Recruitment\"\n | \"Diplomacy\"\n | \"Hyperbolic Regeneration Chamber\";\n\ntype BladeburnerSkills =\n | \"Blade's Intuition\"\n | \"Cloak\"\n | \"Marksman\"\n | \"Weapon Proficiency\"\n | \"Short-Circuit\"\n | \"Digital Observer\"\n | \"Tracer\"\n | \"Overclock\"\n | \"Reaper\"\n | \"Evasive System\"\n | \"Datamancer\"\n | \"Cyber's Edge\"\n | \"Hands of Midas\"\n | \"Hyperdrive\";\n\ntype BladeburnerActTypes =\n | \"contracts\"\n | \"operations\"\n | \"black ops\"\n | \"general\";\n\ninterface BladeburnerCurAction {\n /** Type of Action */\n type: BladeburnerActTypes | \"Idle\";\n /** Name of Action */\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps;\n}\n\ntype CodingContractTypes =\n | \"Find Largest Prime Factor\"\n | \"Subarray with Maximum Sum\"\n | \"Total Ways to Sum\"\n | \"Spiralize Matrix\"\n | \"Array Jumping Game\"\n | \"Merge Overlapping Intervals\"\n | \"Generate IP Addresses\"\n | \"Algorithmic Stock Trader I\"\n | \"Algorithmic Stock Trader II\"\n | \"Algorithmic Stock Trader III\"\n | \"Algorithmic Stock Trader IV\"\n | \"Minimum Path Sum in a Triangle\"\n | \"Unique Paths in a Grid I\"\n | \"Unique Paths in a Grid II\"\n | \"Sanitize Parentheses in Expression\"\n | \"Find All Valid Math Expressions\";\n\ninterface GangGenInfo {\n /** Name of faction that the gang belongs to (\"Slum Snakes\", etc.) */\n faction: GangName;\n /** Boolean indicating whether or not its a hacking gang */\n isHacking: boolean;\n /** Money earned per second */\n moneyGainRate: number;\n /** Gang's power for territory warfare */\n power: number;\n /** Gang's respect */\n respect: number;\n /** Respect earned per second */\n respectGainRate: number;\n /** Amount of territory held. Returned in decimal form, not percentage */\n territory: number;\n /** Clash chance. Returned in decimal form, not percentage */\n territoryClashChance: number;\n /** Gang's wanted level */\n wantedLevel: number;\n /** Wanted level gained/lost per second (negative for losses) */\n wantedLevelGainRate: number;\n}\n\ninterface GangOtherInfoObject {\n /** Gang power */\n power: number;\n /** Gang territory, in decimal form */\n territory: number;\n}\ntype GangOtherInfo = {\n /** Stock Symbol */\n [key in GangName]: GangOtherInfoObject[];\n};\n\ntype GangEquipment =\n | \"Baseball Bat\"\n | \"Katana\"\n | \"Glock 18C\"\n | \"P90C\"\n | \"Steyr AUG\"\n | \"AK-47\"\n | \"M15A10 Assault Rifle\"\n | \"AWM Sniper Rifle\"\n | \"Bulletproof Vest\"\n | \"Full Body Armor\"\n | \"Liquid Body Armor\"\n | \"Graphene Plating Armor\"\n | \"Ford Flex V20\"\n | \"ATX1070 Superbike\"\n | \"Mercedes-Benz S9001\"\n | \"White Ferrari\"\n | \"NUKE Rootkit\"\n | \"Soulstealer Rootkit\"\n | \"Demon Rootkit\"\n | \"Hmap Node\"\n | \"Jack the Ripper\";\n\ntype GangEquipmentType =\n | \"Weapon\"\n | \"Armor\"\n | \"Vehicle\"\n | \"Rootkit\"\n | \"Augmentation\";\n\ntype GangAugmentations =\n | \"Bionic Arms\"\n | \"Bionic Legs\"\n | \"Bionic Spine\"\n | \"BrachiBlades\"\n | \"Nanofiber Weave\"\n | \"Synthetic Heart\"\n | \"Synfibril Muscle\"\n | \"BitWire\"\n | \"Neuralstimulator\"\n | \"DataJack\"\n | \"Graphene Bone Lacings\";\n\ntype GangTasks =\n | \"Unassigned\"\n | \"Ransomware\"\n | \"Phishing\"\n | \"Identity Theft\"\n | \"DDoS Attacks\"\n | \"Plant Virus\"\n | \"Fraud & Counterfeiting\"\n | \"Money Laundering\"\n | \"Cyberterrorism\"\n | \"Ethical Hacking\"\n | \"Mug People\"\n | \"Deal Drugs\"\n | \"Strongarm Civilians\"\n | \"Run a Con\"\n | \"Armed Robbery\"\n | \"Traffick Illegal Arms\"\n | \"Threaten & Blackmail\"\n | \"Human Trafficking\"\n | \"Terrorism\"\n | \"Vigilante Justice\"\n | \"Train Combat\"\n | \"Train Hacking\"\n | \"Train Charisma\"\n | \"Territory Warfare\";\n\ninterface GangTasksStats {\n /** Task name */\n name: GangTasks;\n /** Task Description */\n desc: string;\n /** Is a task of a hacking gang */\n isHacking: boolean;\n /** Is a task of a combat gang */\n isCombat: boolean;\n /** Base respect earned */\n baseRespect: number;\n /** Base wanted earned */\n baseWanted: number;\n /** Base money earned */\n baseMoney: number;\n /** Hacking skill impact on task scaling */\n hackWeight: number;\n /** Stength skill impact on task scaling */\n strWeight: number;\n /** Defense skill impact on task scaling */\n defWeight: number;\n /** Dexterity skill impact on task scaling */\n dexWeight: number;\n /** Agility skill impact on task scaling */\n agiWeight: number;\n /** Charisma skill impact on task scaling */\n chaWeight: number;\n /** Number representing the difficulty of the task */\n difficulty: number;\n /** Territory impact on task scaling */\n territory: GangTasksTerritory;\n}\n\ninterface GangEquipmentStats {\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\ninterface GangTasksTerritory {\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\ninterface GangMemberInfo {\n /** Agility stat */\n agility: number;\n /** Agility multiplier from equipment. Decimal form */\n agilityEquipMult: number;\n /** Agility multiplier from ascension. Decimal form */\n agilityAscensionMult: number;\n /** Array of names of all owned Augmentations */\n augmentations: GangAugmentations[];\n /** Charisma stat */\n charisma: number;\n /** Charisma multiplier from equipment. Decimal form */\n charismaEquipMult: number;\n /** Charisma multiplier from ascension. Decimal form */\n charismaAscensionMult: number;\n /** Defense stat */\n defense: number;\n /** Defense multiplier from equipment. Decimal form */\n defenseEquipMult: number;\n /** Defense multiplier from ascension. Decimal form */\n defenseAscensionMult: number;\n /** Dexterity stat */\n dexterity: number;\n /** Dexterity multiplier from equipment. Decimal form */\n dexterityEquipMult: number;\n /** Dexterity multiplier from ascension. Decimal form */\n dexterityAscensionMult: number;\n /** Array of names of all owned Non-Augmentation Equipment */\n equipment: GangEquipment[];\n /** Hacking stat */\n hacking: number;\n /** Hacking multiplier from equipment. Decimal form */\n hackingEquipMult: number;\n /** Hacking multiplier from ascension. Decimal form */\n hackingAscensionMult: number;\n /** Strength stat */\n strength: number;\n /** Strength multiplier from equipment. Decimal form */\n strengthEquipMult: number;\n /** Strength multiplier from ascension. Decimal form */\n strengthAscensionMult: number;\n /** Name of currently assigned task */\n task: GangTasks;\n}\n\ninterface GangMemberAscension {\n /** Amount of respect lost from ascending */\n respect: number;\n /** Hacking multiplier gained from ascending. Decimal form */\n hack: number;\n /** Strength multiplier gained from ascending. Decimal form */\n str: number;\n /** Defense multiplier gained from ascending. Decimal form */\n def: number;\n /** Dexterity multiplier gained from ascending. Decimal form */\n dex: number;\n /** Agility multiplier gained from ascending. Decimal form */\n agi: number;\n /** Charisma multiplier gained from ascending. Decimal form */\n cha: number;\n}\n\ninterface SleeveStats {\n /** current shock of the sleeve [0-100] */\n shock: 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20\n |21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37\n |38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54\n |55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71\n |72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88\n |89|90|91|92|93|94|95|96|97|98|99|100;\n /** current sync of the sleeve [0-100] */\n sync: 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20\n |21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37\n |38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54\n |55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71\n |72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88\n |89|90|91|92|93|94|95|96|97|98|99|100;\n /** current hacking skill of the sleeve */\n hacking_skill: 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\ninterface SleeveInformation {\n /** location of the sleeve */\n city: City;\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: CompanyField[];\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\ninterface SleeveTask {\n /** task type */\n task: string;\n /** crime currently attempting, if any */\n crime: Crime | \"\";\n /** location of the task, if any */\n location: City | \"\";\n /** stat being trained at the gym, if any */\n gymStatType: GymStat | \"\";\n /** faction work type being performed, if any */\n factionWorkType: FactionWork | \"\";\n}\n\ninterface TIX {\n\n /**\n * Returns an array of the symbols of the tradable stocks\n *\n * @ramCost 2 GB\n * @returns {string[]} Array of the symbols of the tradable stocks.\n */\n getStockSymbols (): StockSymbol[];\n\n /**\n * Returns the price of a stock, given its symbol (NOT the company name).\n * The symbol is a sequence of two to four capital letters.\n * \n * The stock’s price is the average of its bid and ask price\n *\n * @example\n * \\`\\`\\`js\n * getStockPrice(\"FISG\");\n * \\`\\`\\`\n * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @returns {number} The price of a stock.\n */\n getStockPrice (sym: StockSymbol): number;\n\n /**\n * Given a stock’s symbol (NOT the company name), returns the ask price of that stock.\n * The symbol is a sequence of two to four capital letters.\n * \n * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @returns {number} The ask price of a stock.\n */\n getStockAskPrice (sym: StockSymbol): number;\n\n /**\n * Given a stock’s symbol (NOT the company name), returns the bid price of that stock.\n * The symbol is a sequence of two to four capital letters.\n * \n * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @returns {number} The bid price of a stock.\n */\n getStockBidPrice (sym: StockSymbol): number;\n\n /**\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 * \\`\\`\\`js\n * pos = getStockPosition(\"ECP\");\n * shares = pos[0];\n * avgPx = pos[1];\n * sharesShort = pos[2];\n * avgPxShort = pos[3];\n * \\`\\`\\`\n * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @returns {[number,number,number,number]} Array of four elements that represents the player’s position in a stock.\n */\n getStockPosition (sym: StockSymbol): [number, number, number, number];\n\n /**\n * Returns the maximum number of shares that the stock has.\n * This is the maximum amount of the stock that can be purchased\n * in both the Long and Short positions combined.\n *\n * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @returns {number} Maximum number of shares that the stock has.\n */\n getStockMaxShares (sym: StockSymbol): number;\n\n /**\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 * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to purchase.\n * @param {string} posType Specifies whether the order is a “Long” or “Short” position.\n * @returns {number} Cost to buy a given number of shares of a stock.\n */\n getStockPurchaseCost (sym: StockSymbol, shares: Number, posType: OrderPos): number;\n\n /**\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 * @ramCost 2 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to sell.\n * @param {string} posType Specifies whether the order is a “Long” or “Short” position.\n * @returns {number} Gain from selling a given number of shares of a stock.\n */\n getStockSaleGain (sym: StockSymbol, shares: Number, posType: OrderPos): number;\n\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\n * @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n buyStock (sym: StockSymbol, shares: number): number;\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n * @returns {number} The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n sellStock (sym: StockSymbol, shares: number): number;\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to short. Must be positive. Will be rounded to nearest integer.\n * @returns {number} The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n shortStock (sym: StockSymbol, shares: number): number;\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n * @returns {number} The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n sellShort (sym: StockSymbol, shares: number): number;\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares for order. Must be positive. Will be rounded to nearest integer.\n * @param {number} price Execution price for the order.\n * @param {string} type Type of order.\n * @param {string} pos Specifies whether the order is a “Long” or “Short” position.\n * @returns {boolean} True if the order is successfully placed, and false otherwise.\n */\n placeOrder (\n sym: StockSymbol,\n shares: number,\n price: number,\n type: OrderType,\n pos: OrderPos,\n ): boolean;\n\n /**\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @param {number} shares Number of shares for order. Must be positive. Will be rounded to nearest integer.\n * @param {number} price Execution price for the order.\n * @param {string} type Type of order.\n * @param {string} pos Specifies whether the order is a “Long” or “Short” position.\n */\n cancelOrder (\n sym: StockSymbol,\n shares: number,\n price: number,\n type: OrderType,\n pos: OrderPos,\n ): void;\n\n /**\n * Returns your order book for the stock market.\n *\n * This is an object containing information for all the Limit and Stop Orders you have in the stock market.\n * The object has the following structure:\n *\n * \\`\\`\\`js\n * {\n * StockSymbol1: [ // 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 * StockSymbol2: [ // Array of orders for this stock\n * ...\n * ],\n * ...\n * }\n * \\`\\`\\`\n * The “Order type” property can have one of the following four values:\n * * “Limit Buy Order”\n * * “Limit Sell Order”\n * * “Stop Buy Order”\n * * “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 * \\`\\`\\`js\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 * @ramCost 2.5 GB\n * @returns {object} 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 *\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @returns {number} Volatility of the specified stock.\n */\n getStockVolatility (sym: StockSymbol): number;\n\n /**\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n *\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 * @ramCost 2.5 GB\n * @param {string} sym Stock symbol.\n * @returns {number} Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n */\n getStockForecast (sym: StockSymbol): number;\n\n /**\n * Purchase 4S Market Data Access.\n *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @ramCost 2.5 GB\n * @returns {boolean} 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 *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @ramCost 2.5 GB\n * @returns {boolean} True if you successfully purchased it or if you already have access, false otherwise.\n */\n purchase4SMarketDataTixApi (): boolean;\n}\n\ninterface Singularity {\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 2 GB\n * @singularity Level 1\n * @param {string} universityName Name of university. You must be in the correct city for whatever university you specify.\n * @param {string} courseName Name of course.\n * @returns {boolean} True if actions is successfully started, false otherwise.\n */\n universityCourse (\n universityName: University,\n courseName: UniversityCourse,\n ): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 2 GB\n * @singularity Level 1\n * @param {string} gymName Name of gym. You must be in the correct city for whatever gym you specify.\n * @param {string} stat The stat you want to train.\n * @returns {boolean} True if actions is successfully started, false otherwise.\n */\n gymWorkout (gymName: Gym, stat: GymStat): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 2 GB\n * @singularity Level 1\n * @param {string} city City to travel to.\n * @returns {boolean} True if actions is successful, false otherwise.\n */\n travelToCity (city: City): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 2 GB\n * @singularity Level 1\n * @returns {boolean} True if actions is successful, false otherwise.\n */\n purchaseTor (): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * \\`\\`\\`js\n * purchaseProgram(\"brutessh.exe\");\n * \\`\\`\\`\n * @ramCost 2 GB\n * @singularity Level 1\n * @param {string} programName Name of program to purchase.\n * @returns {boolean} True if the specified program is purchased, and false otherwise.\n */\n purchaseProgram (programName: PurchaseableProgram): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns an object with the Player’s stats.\n *\n * @example\n * \\`\\`\\`js\n * res = getStats();\n * print('My charisma level is: ' + res.charisma);\n * \\`\\`\\`\n * @ramCost 0.5 GB\n * @singularity Level 1\n * @returns {object} Object with the Player’s stats.\n */\n getStats (): PlayerStats;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns an object with various information about your character.\n *\n * @ramCost 0.5 GB\n * @singularity Level 1\n * @returns {object} Object with various information about your character.\n */\n getCharacterInformation (): CharacterInfo;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns a boolean indicating whether or not the player is currently performing an\n * ‘action’. These actions include working for a company/faction, studying at a univeristy,\n * working out at a gym, creating a program, committing a crime, or carrying out a Hacking Mission.\n *\n * @ramCost 0.5 GB\n * @singularity Level 1\n * @returns {boolean} True if the player is currently performing an ‘action’, false otherwise.\n */\n isBusy (): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 1 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function is used to end whatever ‘action’ the player is currently performing.\n * The player will receive whatever money/experience/etc. he has earned from that action.\n *\n * The actions that can be stopped with this function are:\n *\n * * Studying at a university\n * * Working for a company/faction\n * * Creating a program\n * * Committing a Crime\n *\n * This function will return true if the player’s action was ended.\n * It will return false if the player was not performing an action when this function was called.\n *\n * @ramCost 1 GB\n * @singularity Level 1\n * @returns {boolean} True if the player’s action was ended, false if the player was not performing an action.\n */\n stopAction (): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 3 GB\n * @singularity Level 2\n * @returns {boolean} True if the player’s home computer RAM is successfully upgraded, and false otherwise.\n */\n upgradeHomeRam (): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns the cost of upgrading the player’s home computer RAM.\n *\n * @ramCost 1.5 GB\n * @singularity Level 2\n * @returns {number} Cost of upgrading the player’s home computer RAM.\n */\n getUpgradeHomeRamCost (): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * \\`\\`\\`js\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 * @ramCost 3 GB\n * @singularity Level 2\n * @param {string} [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 * @returns {boolean} True if the player starts working, and false otherwise.\n */\n workForCompany (companyName?: CompanyName): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 3 GB\n * @singularity Level 2\n * @param {string} companyName Name of company to apply to.\n * @param {string} field Field to which you want to apply.\n * @returns {boolean} True if the player successfully get a job/promotion, and false otherwise.\n */\n applyToCompany (companyName: CompanyName, field: CompanyField): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 1 GB\n * @singularity Level 2\n * @param {string} companyName Name of the company.\n * @returns {number} Amount of reputation you have at the specified company.\n */\n getCompanyRep (companyName: CompanyName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 1 GB\n * @singularity Level 2\n * @param {string} companyName Name of the company.\n * @returns {number} Amount of favor you have at the specified company.\n */\n getCompanyFavor (companyName: CompanyName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 0.75 GB\n * @singularity Level 2\n * @param {string} companyName Name of the company.\n * @returns {number} Amount of favor you gain at the specified company when you reset by installing Augmentations.\n */\n getCompanyFavorGain (companyName: CompanyName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns an array with the name of all Factions you currently have oustanding invitations from.\n *\n * @ramCost 3 GB\n * @singularity Level 2\n * @returns {string[]} Array with the name of all Factions you currently have oustanding invitations from.\n */\n checkFactionInvitations (): FactionName[];\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function will automatically accept an invitation from a faction and join it.\n *\n * @ramCost 3 GB\n * @singularity Level 2\n * @param {string} faction Name of faction to join.\n * @returns {boolean} True if player joined the faction, and false otherwise.\n */\n joinFaction (faction: FactionName): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * \\`\\`\\`js\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 * @ramCost 3 GB\n * @singularity Level 2\n * @param {string} faction Name of faction to work for.\n * @param {string} workType Type of work to perform for the faction.\n * @returns {boolean} True if the player starts working, and false otherwise.\n */\n workForFaction (faction: FactionName, workType: FactionWork): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function returns the amount of reputation you have for the specified faction.\n *\n * @ramCost 1 GB\n * @singularity Level 2\n * @param {string} faction Name of faction to work for.\n * @returns {number} Amount of reputation you have for the specified faction.\n */\n getFactionRep (faction: FactionName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function returns the amount of favor you have for the specified faction.\n *\n * @ramCost 1 GB\n * @singularity Level 2\n * @param {string} faction Name of faction.\n * @returns {number} Amount of favor you have for the specified faction.\n */\n getFactionFavor (faction: FactionName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 2 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 0.75 GB\n * @singularity Level 2\n * @param {string} faction Name of faction.\n * @returns {number} Amount of favor you will gain for the specified faction when you reset by installing Augmentations.\n */\n getFactionFavorGain (faction: FactionName): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} faction Name of faction to donate to.\n * @param {string} amount Amount of money to donate.\n * @returns {boolean} True if the money was donated, and false otherwise.\n */\n donateToFaction (faction: FactionName, amount: number): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * \\`\\`\\`js\n * createProgram(“relaysmtp.exe”);\n * \\`\\`\\`\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} program Name of program to create.\n * @returns {boolean} True if you successfully start working on the specified program, and false otherwise.\n */\n createProgram (program: CreatableProgram): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 seconds it takes to attempt the specified\n * crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime, so running\n * \\`commitCrime('rob store')\\` will return 60).\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 {@link 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 * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} crime Name of crime to attempt.\n * @returns {number} True if you successfully start working on the specified program, and false otherwise.\n */\n commitCrime (crime: Crime): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function returns your chance of success at commiting the specified crime.\n * The chance is returned as a decimal (i.e. 60% would be returned as 0.6).\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} crime Name of crime.\n * @returns {number} Chance of success at commiting the specified crime as a decimal.\n */\n getCrimeChance (crime: Crime): number;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns the stats of the crime.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} crime Name of crime. Not case-sensitive\n * @returns {number} The stats of the crime.\n */\n getCrimeStats (crime: Crime): CrimeStats;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function returns an array containing the names (as strings) of all Augmentations you have.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {boolean} [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 {string[]} Array containing the names (as strings) of all Augmentations you have.\n */\n getOwnedAugmentations (purchased?: boolean): AugmentName[];\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns an array of source files\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @returns {object[]} Array containing an object with number and level of the source file.\n */\n getOwnedSourceFiles (): SourceFileLvl[];\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * Returns an array containing the names (as strings) of all Augmentations\n * that are available from the specified faction.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} faction Name of faction.\n * @returns {string[]} Array containing the names of all Augmentations.\n */\n getAugmentationsFromFaction (faction: FactionName): AugmentName[];\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} augName Name of Augmentation.\n * @returns {string[]} Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\n */\n getAugmentationPrereq (augName: AugmentName): AugmentName[];\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} augName Name of Augmentation.\n * @returns {[number, number]} Array with first element as a reputation requirement and second element as the money cost.\n */\n getAugmentationCost (augName: AugmentName): [number, number];\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\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 * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} faction Name of faction to purchase Augmentation from.\n * @param {string} augmnet Name of Augmentation to purchase.\n * @returns {boolean} True if the Augmentation is successfully purchased, and false otherwise.\n */\n purchaseAugmentation (faction: FactionName, augmnet: AugmentName): boolean;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function returns augmentation stats.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} name Name of Augmentation. CASE-SENSITIVE.\n * @returns {object} Augmentation stats.\n */\n getAugmentationStats (name: AugmentName): AugmentationStats;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function will automatically install your Augmentations, resetting the game as usual.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n * @param {string} cbScript Optional callback script. 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?: Script): void;\n\n /**\n * If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function and the RAM cost is doubled.\n *\n * This function will perform a reset even if you don’t have any augmentation installed.\n *\n * @ramCost 5 GB\n * @singularity Level 3\n */\n softReset (): void;\n}\n\ninterface HackNet {\n /**\n * Returns the number of Hacknet Nodes you own.\n *\n * @ramCost 0 GB\n * @returns {number} number of hacknet nodes.\n */\n numNodes (): number;\n\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 * @ramCost 0 GB\n * @returns {number} 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 * Returns the cost of purchasing a new Hacknet Node.\n *\n * @ramCost 0 GB\n * @returns {number} Cost of purchasing a new Hacknet Node.\n */\n getPurchaseNodeCost (): number;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node\n * @returns {object} Object containing a variety of stats about the specified Hacknet Node.\n */\n getNodeStats (index: number): NodeStats;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of levels to purchase. Must be positive. Rounded to nearest integer.\n * @returns {boolean} True if the Hacknet Node’s level is successfully upgraded, false otherwise.\n */\n upgradeLevel (index: number, n: number): boolean;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\n * @returns {boolean} True if the Hacknet Node’s ram is successfully upgraded, false otherwise.\n */\n upgradeRam (index: number, n: number): boolean;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of cores to purchase. Must be positive. Rounded to nearest integer.\n * @returns {boolean} True if the Hacknet Node’s cores are successfully purchased, false otherwise.\n */\n upgradeCore (index: number, n: number): boolean;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of cache levels to purchase. Must be positive. Rounded to nearest integer.\n * @returns {boolean} True if the Hacknet Node’s cores are successfully purchased, false otherwise.\n */\n upgradeCache (index: number, n: number): boolean;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of levels to upgrade. Must be positive. Rounded to nearest integer.\n * @returns {number} Cost of upgrading the specified Hacknet Node.\n */\n getLevelUpgradeCost (index: number, n: number): number;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\n * @returns {number} Cost of upgrading the specified Hacknet Node's ram.\n */\n getRamUpgradeCost (index: number, n: number): number;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of times to upgrade cores. Must be positive. Rounded to nearest integer.\n * @returns {number} Cost of upgrading the specified Hacknet Node's number of cores.\n */\n getCoreUpgradeCost (index: number, n: number): number;\n\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 * @ramCost 0 GB\n * @param {number} index Index/Identifier of Hacknet Node.\n * @param {number} n Number of times to upgrade cache. Must be positive. Rounded to nearest integer.\n * @returns {number} Cost of upgrading the specified Hacknet Node's cache.\n */\n getCacheUpgradeCost (index: number, n: number): number;\n\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 * @ramCost 0 GB\n * @returns {number} Number of hashes you have.\n */\n numHashes (): number;\n\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 * \\`\\`\\`js\n * var upgradeName = \"Sell for Corporation Funds\";\n * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {\n * hacknet.spendHashes(upgName);\n * }\n * \\`\\`\\`\n * @ramCost 0 GB\n * @param {string} upgName Name of the upgrade of Hacknet Node.\n * @returns {number} Number of hashes required for the specified upgrade.\n */\n hashCost (upgName: HashUpgrades): number;\n\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 * \\`\\`\\`js\n * hacknet.spendHashes(\"Sell for Corporation Funds\");\n * hacknet.spendHashes(\"Increase Maximum Money\", \"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0 GB\n * @param {string} upgName Name of the upgrade of Hacknet Node.\n * @param {string} [upgTarget] Object to which upgrade applies. Required for certain upgrades.\n * @returns {boolean} True if the upgrade is successfully purchased, and false otherwise..\n */\n spendHashes (upgName: HashUpgrades, upgTarget?: Host): boolean;\n}\n\ninterface BladeBurner {\n /**\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 function.\n *\n * Returns an array of strings containing the names of all Bladeburner contracts.\n *\n * @ramCost 0.4 GB\n * @returns {string[]} Array of strings containing the names of all Bladeburner contracts.\n */\n getContractNames (): BladeburnerContracts[];\n\n /**\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 function.\n *\n * Returns an array of strings containing the names of all Bladeburner operations.\n *\n * @ramCost 0.4 GB\n * @returns {string[]} Array of strings containing the names of all Bladeburner operations.\n */\n getOperationNames (): BladeburnerOperations[];\n\n /**\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 function.\n *\n * Returns an array of strings containing the names of all Bladeburner Black Ops.\n *\n * @ramCost 0.4 GB\n * @returns {string[]} Array of strings containing the names of all Bladeburner Black Ops.\n */\n getBlackOpNames (): BladeburnerBlackOps[];\n\n /**\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 function.\n *\n * Returns an array of strings containing the names of all general Bladeburner actions.\n *\n * @ramCost 0.4 GB\n * @returns {string[]} Array of strings containing the names of all general Bladeburner actions.\n */\n getGeneralActionNames (): BladeburnerGenActions[];\n\n /**\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 function.\n *\n * Returns an array of strings containing the names of all general Bladeburner skills.\n *\n * @ramCost 0.4 GB\n * @returns {string[]} Array of strings containing the names of all general Bladeburner skills.\n */\n getSkillNames (): BladeburnerSkills[];\n\n /**\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 function.\n *\n * Attempts to start the specified Bladeburner action.\n * Returns true if the action was started successfully, and false otherwise.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match\n * @returns {boolean} True if the action was started successfully, and false otherwise.\n */\n startAction (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): boolean;\n\n /**\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 function.\n *\n * Stops the current Bladeburner action.\n *\n * @ramCost 2 GB\n */\n stopBladeburnerAction (): void;\n\n /**\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 function.\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 * @ramCost 1 GB\n * @returns {object} Object that represents the player’s current Bladeburner action.\n */\n getCurrentAction (): BladeburnerCurAction;\n\n /**\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 function.\n *\n * Returns the number of seconds it takes to complete the specified action\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Number of seconds it takes to complete the specified action.\n */\n getActionTime (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Estimated success chance for the specified action.\n */\n getActionEstimatedSuccessChance (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @param {number} [level] Optional action level at which to calculate the gain\n * @returns {number} Average Bladeburner reputation gain for successfully completing the specified action.\n */\n getActionRepGain (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,\n level: number\n ): number;\n\n /**\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 function.\n *\n * Returns the remaining count of the specified action.\n *\n * Note that this is meant to be used for Contracts and Operations.\n * This function will return ‘Infinity’ for actions such as Training and Field Analysis.\n * This function will return 1 for BlackOps not yet completed regardless of wether\n * the player has the required rank to attempt the mission or not.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Remaining count of the specified action.\n */\n getActionCountRemaining (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\n *\n * Returns the maximum level for this action.\n *\n * Returns -1 if an invalid action is specified.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Maximum level of the specified action.\n */\n getActionMaxLevel (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\n *\n * Returns the current level of this action.\n *\n * Returns -1 if an invalid action is specified.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Current level of the specified action.\n */\n getActionCurrentLevel (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {boolean} True if the action is set to autolevel, and false otherwise.\n */\n getActionAutolevel (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): boolean;\n\n /**\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 function.\n *\n * Enable/disable autoleveling for the specified action.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @param {boolean} autoLevel Whether or not to autolevel this action\n */\n setActionAutolevel (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,\n autoLevel: boolean\n ): void;\n\n /**\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 function.\n *\n * Set the level for the specified action.\n *\n * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @param {number} level Level to set this action to.\n */\n setActionLevel (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,\n level: number\n ): void;\n\n /**\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 function.\n *\n * Returns the player’s Bladeburner Rank.\n *\n * @ramCost 4 GB\n * @returns {number} Player’s Bladeburner Rank.\n */\n getRank (): number;\n\n /**\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 function.\n *\n * Returns the rank required to complete this BlackOp.\n *\n * Returns -1 if an invalid action is specified.\n *\n * @ramCost 2 GB\n * @param {string} name Name of BlackOp. Must be an exact match.\n * @returns {number} Rank required to complete this BlackOp.\n */\n getBlackOpRank (name: BladeburnerBlackOps): number;\n\n /**\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 function.\n *\n * Returns the number of Bladeburner skill points you have.\n *\n * @ramCost 4 GB\n * @returns {number} Number of Bladeburner skill points you have.\n */\n getSkillPoints (): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} skillName Name of skill. Case-sensitive and must be an exact match\n * @returns {number} Level in the specified skill.\n */\n getSkillLevel (name: BladeburnerSkills): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} skillName Name of skill. Case-sensitive and must be an exact match\n * @returns {number} Number of skill points needed to upgrade the specified skill.\n */\n getSkillUpgradeCost (name: BladeburnerSkills): number;\n\n /**\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 function.\n *\n * Attempts to upgrade the specified Bladeburner skill.\n *\n * Returns true if the skill is successfully upgraded, and false otherwise.\n *\n * @ramCost 4 GB\n * @param {string} skillName Name of skill to be upgraded. Case-sensitive and must be an exact match\n * @returns {boolean} true if the skill is successfully upgraded, and false otherwise.\n */\n upgradeSkill (name: BladeburnerSkills): boolean;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @returns {number} Number of Bladeburner team members that were assigned to the specified action.\n */\n getTeamSize (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps\n ): number;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @param {string} type Type of action.\n * @param {string} name Name of action. Must be an exact match.\n * @param {number} size Number of team members to set. Will be converted using Math.round().\n * @returns {number} Number of Bladeburner team members you assigned to the specified action.\n */\n setTeamSize (\n type: BladeburnerActTypes,\n name: BladeburnerGenActions | BladeburnerContracts | BladeburnerOperations | BladeburnerBlackOps,\n size: number\n ): number;\n\n /**\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 function.\n *\n * Returns the estimated number of Synthoids in the specified city,\n * or -1 if an invalid city was specified.\n *\n * @ramCost 4 GB\n * @param {string} cityName Name of city. Case-sensitive\n * @returns {number} Estimated number of Synthoids in the specified city.\n */\n getCityEstimatedPopulation (name: City): number;\n\n /**\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 function.\n *\n * Returns the estimated number of Synthoid communities in the specified city,\n * or -1 if an invalid city was specified.\n *\n * @ramCost 4 GB\n * @param {string} cityName Name of city. Case-sensitive\n * @returns {number} Estimated number of Synthoids communities in the specified city.\n */\n getCityEstimatedCommunities (name: City): number;\n\n /**\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 function.\n *\n * Returns the chaos in the specified city,\n * or -1 if an invalid city was specified.\n *\n * @ramCost 4 GB\n * @param {string} cityName Name of city. Case-sensitive\n * @returns {number} Chaos in the specified city.\n */\n getCityChaos (name: City): number;\n\n /**\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 function.\n *\n * Returns the city that the player is currently in (for Bladeburner).\n *\n * @ramCost 4 GB\n * @returns {string} City that the player is currently in (for Bladeburner).\n */\n getCity (): City;\n\n /**\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 function.\n *\n * Attempts to switch to the specified city (for Bladeburner only).\n *\n * Returns true if successful, and false otherwise\n *\n * @ramCost 4 GB\n * @param {string} cityName Name of city. Case-sensitive\n * @returns {boolean} true if successful, and false otherwise\n */\n switchCity (name: City): boolean;\n\n /**\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 function.\n *\n * Returns an array with two elements:\n * * [Current stamina, Max stamina]\n * @example\n * \\`\\`\\`js\n * function getStaminaPercentage() {\n * let res = bladeburner.getStamina();\n * return res[0] / res[1];\n * }\n * \\`\\`\\`\n * @ramCost 4 GB\n * @returns {[number, number]} Array containing current stamina and max stamina.\n */\n getStamina (): [number, number];\n\n /**\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 function.\n *\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 * @ramCost 4 GB\n * @returns {boolean} True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.\n */\n joinBladeburnerFaction (): boolean;\n\n /**\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 function.\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 * @ramCost 4 GB\n * @returns {boolean} True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.\n */\n joinBladeburnerDivision (): boolean;\n\n /**\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 function.\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 * @ramCost 0 GB\n * @returns {number} Amount of accumulated “bonus time” (seconds) for the Bladeburner mechanic.\n */\n getBonusTime (): number;\n}\n\ninterface CodingContract {\n /**\n * Attempts to solve the Coding Contract with the provided solution.\n *\n * @ramCost 10 GB\n * @param {string|string[]|number}answer Solution for the contract.\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @returns {boolean} True if the solution was correct, false otherwise.\n */\n attempt (\n answer: string | string[] | number,\n fn: string,\n host?: Host\n ): boolean;\n\n /**\n * Attempts to solve the Coding Contract with the provided solution.\n *\n * @ramCost 10 GB\n * @param {string|string[]|number}answer Solution for the contract.\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @param {object} [opts] Optional parameters for configuring function behavior.\n * @returns {boolean} 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 (\n answer: string | string[] | number,\n fn: string,\n host?: Host,\n opts?: CodingAttemptOptions\n ): boolean | string;\n\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 * @ramCost 5 GB\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @returns {string} Name describing the type of problem posed by the Coding Contract.\n */\n getContractType (fn: string, host?: Host): CodingContractTypes;\n\n /**\n * Get the full text description for the problem posed by the Coding Contract.\n *\n * @ramCost 5 GB\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @returns {string} Contract’s text description.\n */\n getDescription (fn: string, host?: Host): string;\n\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 * @ramCost 5 GB\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @returns {string} The specified contract’s data;\n */\n getData (fn: string, host?: Host): string;\n\n /**\n * Get the number of tries remaining on the contract before it self-destructs.\n *\n * @ramCost 2 GB\n * @param {string} fn Filename of the contract.\n * @param {string} [host] Host or IP of the server containing the contract. Optional. Defaults to current server if not provided.\n * @returns {number} How many attempts are remaining for the contract;\n */\n getNumTriesRemaining (fn: string, host?: Host): number;\n}\n\ninterface Gang {\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the names of all Gang members\n *\n * @ramCost 1 GB\n * @returns {string[]} Names of all Gang members.\n */\n getMemberNames (): string[];\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get general information about the gang.\n *\n * @ramCost 2 GB\n * @returns {object} Object containing general information about the gang.\n */\n getGangInformation (): GangGenInfo;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get territory and power information about all gangs.\n *\n * @ramCost 2 GB\n * @returns {object} Object containing territory and power information about all gangs.\n */\n getOtherGangInformation (): GangOtherInfo;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get stat and equipment-related information about a Gang Member\n *\n * @ramCost 2 GB\n * @param {string} name Name of member.\n * @returns {object} Object containing stat and equipment-related information about a Gang Member.\n */\n getMemberInformation (name: string): GangMemberInfo;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Returns boolean indicating whether a member can currently be recruited\n *\n * @ramCost 1 GB\n * @returns {boolean} True if a member can currently be recruited, false otherwise.\n */\n canRecruitMember (): boolean;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\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 * @ramCost 2 GB\n * @param {string} name Name of member to recruit.\n * @returns {boolean} True if the member was successfully recruited, false otherwise.\n */\n recruitMember (name: string): boolean;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the name of all valid tasks that Gang members can be assigned to.\n *\n * @ramCost 1 GB\n * @returns {string[]} All valid tasks that Gang members can be assigned to.\n */\n getTaskNames (): GangTasks[];\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\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 * @ramCost 2 GB\n * @param {string} memberName Name of Gang member to assign.\n * @param {string} taskName Task to assign.\n * @returns {boolean} True if the Gang Member was successfully assigned to the task, false otherwise.\n */\n setMemberTask (memberName: string, taskName: GangTasks): boolean;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.\n *\n * @ramCost 1 GB\n * @param {string} name Name of the task.\n * @returns {boolean} Detailed stats of a task.\n */\n getTaskStats (name: GangTasks): GangTasksStats;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the name of all possible equipment/upgrades you can purchase for your Gang Members.\n * This includes Augmentations.\n *\n * @ramCost 1 GB\n * @returns {string[]} Names of all Equpiment/Augmentations.\n */\n getEquipmentNames (): (GangEquipment | GangAugmentations)[];\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\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 * @ramCost 2 GB\n * @param {string} equipName Name of equipment.\n * @returns {number} Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments\n */\n getEquipmentCost (equipName: GangEquipment | GangAugmentations): number;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the specified equipment type.\n *\n * @ramCost 2 GB\n * @param {string} equipName Name of equipment.\n * @returns {number} Type of the equipment.\n */\n getEquipmentType (\n equipName: GangEquipment | GangAugmentations\n ): GangEquipmentType;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Get the specified equipment stats.\n *\n * @ramCost 2 GB\n * @param {string} equipName Name of equipment.\n * @returns {object} A dictionary containing the stats of the equipment.\n */\n getEquipmentStats (\n equipName: GangEquipment | GangAugmentations\n ): GangEquipmentStats;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.\n *\n * @ramCost 4 GB\n * @param {string} memberName Name of Gang member to purchase the equipment for.\n * @param {string} equipName Name of Equipment/Augmentation to purchase.\n * @returns {boolean} True if the equipment was successfully purchased. False otherwise\n */\n purchaseEquipment (memberName: string, equipName: GangEquipment | GangAugmentations): boolean;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Ascend the specified Gang Member.\n *\n * @ramCost 4 GB\n * @param {string} memberName Name of member to ascend.\n * @returns {object} Object with info about the ascension results.\n */\n ascendMember (memberName: string): GangMemberAscension;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\n *\n * Set whether or not the gang should engage in territory warfare\n *\n * @ramCost 2 GB\n * @param {boolean} engage Whether or not to engage in territory warfare.\n */\n setTerritoryWarfare (engage: boolean): void;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\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 * @ramCost 4 GB\n * @param {string} gangName Target gang\n * @returns {number} Chance you have to win a clash with the specified gang.\n */\n getChanceToWinClash (gangName: GangName): number;\n\n /**\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this function.\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 * @ramCost 0 GB\n * @returns {number} Bonus time for the Gang mechanic in seconds.\n */\n getBonusTime (): number;\n}\n\ninterface Sleeve {\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return the number of duplicate sleeves the player has.\n *\n * @ramCost 4 GB\n * @returns {number} number of duplicate sleeves the player has.\n */\n getNumSleeves (): number;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a structure containing the stats of the sleeve.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to get stats of.\n * @returns {object} Object containing the stats of the sleeve.\n */\n getSleeveStats (sleeveNumber: number): SleeveStats;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a struct containing tons of information about this sleeve\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to retrieve information.\n * @returns {object} Object containing tons of information about this sleeve.\n */\n getInformation (sleeveNumber: number): SleeveInformation;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\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 * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to retrieve task from.\n * @returns {object} Object containing information the current task that the sleeve is performing.\n */\n getTask (sleeveNumber: number): SleeveTask;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not this action was set successfully.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to start recovery.\n * @returns {boolean} True if this action was set successfully, false otherwise.\n */\n setToShockRecovery (sleeveNumber: number): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not this action was set successfully.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to start synchronizing.\n * @returns {boolean} True if this action was set successfully, false otherwise.\n */\n setToSynchronize (sleeveNumber: number): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\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 * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to start commiting crime.\n * @param {string} name Name of the crime. Must be an exact match.\n * @returns {boolean} True if this action was set successfully, false otherwise.\n */\n setToCommitCrime (sleeveNumber: number, name: Crime): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not the sleeve started working or this faction.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to work for the faction.\n * @param {string} factionName Name of the faction to work for.\n * @param {string} factionWorkType Name of the action to perform for this faction.\n * @returns {boolean} True if the sleeve started working on this faction, false otherwise.\n */\n setToFactionWork (sleeveNumber: number, factionName: FactionName, factionWorkType: FactionWork): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not the sleeve started working or this company.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to work for the company.\n * @param {string} companyName Name of the company to work for.\n * @returns {boolean} True if the sleeve started working on this company, false otherwise.\n */\n setToCompanyWork (sleeveNumber: number, companyName: CompanyName): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not this action was set successfully.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to start taking class.\n * @param {string} university Name of the university to attend.\n * @param {string} className Name of the class to follow.\n * @returns {boolean} True if this action was set successfully, false otherwise.\n */\n setToUniversityCourse (sleeveNumber: number, university: University, className: UniversityCourse): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not the sleeve started working out.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to workout at the gym.\n * @param {string} gymName Name of the gym.\n * @param {string} stat Name of the stat to train.\n * @returns {boolean} True if the sleeve started working out, false otherwise.\n */\n setToGymWorkout (sleeveNumber: number, gymName: Gym, stat: GymStat): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a boolean indicating whether or not the sleeve reached destination.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to travel.\n * @param {string} cityName Name of the destination city.\n * @returns {boolean} True if the sleeve reached destination, false otherwise.\n */\n travel (sleeveNumber: number, cityName: City): boolean;\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a list of augmentation names that this sleeve has installed.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to retrieve augmentations from.\n * @returns {string[]} List of augmentation names that this sleeve has installed.\n */\n getSleeveAugmentations (sleeveNumber: number): AugmentName[];\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return a list of augmentations that the player can buy for this sleeve.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to retrieve purchasable augmentations from.\n * @returns {string[]} List of augmentations that the player can buy for this sleeve.\n */\n getSleevePurchasableAugs (sleeveNumber: number): AugmentPair[];\n\n /**\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this function.\n *\n * Return true if the aug was purchased and installed on the sleeve.\n *\n * @ramCost 4 GB\n * @param {number} sleeveNumber Index of the sleeve to buy an aug for.\n * @param {string} augName Name of the aug to buy. Must be an exact match.\n * @returns {boolean} True if the aug was purchased and installed on the sleeve, false otherwise.\n */\n purchaseSleeveAug (sleeveNumber: number, augName: AugmentName): boolean;\n}\n\ninterface NS extends TIX, Singularity {\n\n /**\n * Not all functions in the Hacknet Node API are immediately available.\n *\n * Note that none of these functions will write to the script’s logs.\n *\n * If you want to see what your script is doing you will have to print to the logs yourself.\n *\n * @ramCost 4 GB\n */\n readonly hacknet: HackNet;\n /**\n * @ramCost 0 GB\n */\n readonly bladeburner: BladeBurner;\n /**\n * @ramCost 0 GB\n */\n readonly codingcontract: CodingContract;\n /**\n * @ramCost 0 GB\n */\n readonly gang: Gang;\n /**\n * @ramCost 0 GB\n */\n readonly sleeve: CodingContract;\n\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:\n * \\`\\`\\`js\n * args.length\n * \\`\\`\\`\n * WARNING: Do not try to modify the args array. This will break the game.\n *\n * @ramCost 0 GB\n */\n readonly args: any[];\n\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. 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 * \\`\\`\\`js\n * hack(\"foodnstuff\");\n * hack(\"10.1.2.3\");\n * hack(\"foodnstuff\", { threads: 5 }); // Only use 5 threads to hack\n * \\`\\`\\`\n * @ramCost 0.1 GB\n * @param {string} host IP or hostname of the target server to hack.\n * @param {object} [opts] Optional parameters for configuring function behavior.\n * @returns {Promise<number>} The amount of money stolen if the hack is successful, and zero otherwise.\n */\n hack (host: Host, opts?: BasicHGWOptions): Promise<number>;\n\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 {@link 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 * \\`\\`\\`js\n * grow(\"foodnstuff\");\n * grow(\"foodnstuff\", { threads: 5 }); // Only use 5 threads to grow\n * \\`\\`\\`\n * @ramCost 0.15 GB\n * @param {string} host IP or hostname of the target server to grow.\n * @param {object} [opts] Optional parameters for configuring function behavior.\n * @returns {Promise<number>} The number by which the money on the server was multiplied for the growth.\n */\n grow (host: Host, opts?: BasicHGWOptions): Promise<number>;\n\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. This function lowers the security level of the target server by 0.05.\n *\n * Like {@link hack} and {@link 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 * \\`\\`\\`js\n * weaken(\"foodnstuff\");\n * weaken(\"foodnstuff\", { threads: 5 }); // Only use 5 threads to weaken\n * \\`\\`\\`\n * @ramCost 0.15 GB\n * @param {string} host IP or hostname of the target server to weaken.\n * @param {object} [opts] Optional parameters for configuring function behavior.\n * @returns {Promise<number>} 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: Host, opts?: BasicHGWOptions): Promise<number>;\n\n /**\n * This function returns the number of script threads you need when running the {@link 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 * \\`\\`\\`js\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 {@link hack} call is run on a script with 50 threads, it will steal $1m from the foodnstuff server.\n * \\`\\`\\`\n * @ramCost 1 GB\n * @param {string} host IP or hostname of the target server to analyze.\n * @param {number} hackAmount Amount of money you want to hack from the server.\n * @returns {number} The number of threads needed to {@link hack} the server for hackAmount money.\n */\n hackAnalyzeThreads (host: Host, hackAmount: number): number;\n\n /**\n * Returns the percentage of the specified server’s money you will steal with a single hack.\n * This value is returned in percentage form, not decimal\n * (Netscript functions typically return in decimal form, but not this one).\n *\n * @example\n * \\`\\`\\`js\n * //For example, assume the following returns 1:\n * hackAnalyzePercent(\"foodnstuff\");\n * //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you {@link hack} using N threads, then you will steal N% of its total money.\n * \\`\\`\\`\n * @ramCost 1 GB\n * @param {string} host IP or hostname of the target server.\n * @returns {number} The percentage of money you will steal from the target server with a single hack.\n */\n hackAnalyzePercent (host: Host): number;\n\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 * @ramCost 1 GB\n * @param {string} host IP or hostname of the target server.\n * @returns {number} The chance you have of successfully hacking the target server.\n */\n hackChance (host: Host): number;\n\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 * \\`\\`\\`js\n * //For example, if you want to determine how many {@link grow} calls you need to double the amount of money on foodnstuff, you would use:\n * growthAnalyze(\"foodnstuff\", 2);\n * //If this returns 100, then this means you need to call {@link grow} 100 times in order to double the money (or once with 100 threads).\n * \\`\\`\\`\n * @ramCost 1 GB\n * @param {string} host IP or hostname of the target server.\n * @param {number} growthAmount Multiplicative factor by which the server is grown. Decimal form..\n * @returns {number} The amount of {@link grow} calls needed to grow the specified server by the specified amount\n */\n growthAnalyze (host: Host, growthAmount: number): number;\n\n /**\n * Suspends the script for n milliseconds.\n *\n * @ramCost 0 GB\n * @param {number} millis Number of milliseconds to sleep.\n * @returns {Promise<void>}\n */\n sleep (millis: number): Promise<void>;\n\n /**\n * Prints a value or a variable to the script’s logs.\n *\n * @ramCost 0 GB\n * @param {string} msg Value to be printed.\n */\n print (msg: string | number | string[] | number[]): void;\n\n /**\n * Prints a value or a variable to the Terminal.\n *\n * @ramCost 0 GB\n * @param {string} msg Value to be printed.\n */\n tprint (msg: string | number | string[] | number[]): void;\n\n /**\n * Clears the script’s logs.\n *\n * @ramCost 0 GB\n */\n clearLog (): void;\n\n /**\n * Disables logging for the given function. Logging can be disabled\n * 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 * Notable functions that cannot have their logs disabled: {@link run},\n * {@link exec}, {@link exit}.\n *\n * @ramCost 0 GB\n * @param {string} fn Name of function for which to disable logging.\n */\n disableLog (fn: string): void;\n\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 * @ramCost 0 GB\n * @param {string} 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 *\n * @ramCost 0 GB\n * @param {string} fn Name of function to check.\n * @returns {boolean} Returns a boolean indicating whether or not logging is enabled for that function (or \\`ALL\\`)\n */\n isLogEnabled (fn: string): boolean;\n\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 * \\`\\`\\`js\n * //Get logs from foo.script on the current server that was run with no args\n * getScriptLogs(\"foo.script\");\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\n * //Open logs from foo.script on the foodnstuff server that was run with no args\n * getScriptLogs(\"foo.script\", \"foodnstuff\");\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\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 * @ramCost 0 GB\n * @param {string} [fn] Optional. Filename of script to get logs from.\n * @param {string} [ip] Optional. IP or hostname of the server that the script is on.\n * @param {...string} [args] Arguments to identify which scripts to get logs for.\n * @returns {string[]} 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?: Script, ip?: Host, ...args: any[]): string[];\n\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 * \\`\\`\\`js\n * //Open logs from foo.script on the current server that was run with no args\n * tail(\"foo.script\");\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\n * //Get logs from foo.script on the foodnstuff server that was run with no args\n * tail(\"foo.script\", \"foodnstuff\");\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\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 * @ramCost 0 GB\n * @param {string} host IP or hostname of the server to scan.\n * @param {boolean} hostnames Optional boolean specifying whether the function should output hostnames (if true) or IP addresses (if false).\n */\n tail (fn?: Script, ip?: Host, ...args: any[]): void;\n\n /**\n * Returns an array containing the hostnames or IPs of all servers that are one\n * node way from the specified target server. The hostnames/IPs in the returned\n * array are strings.\n *\n * @ramCost 0.2 GB\n * @param {string} host IP or hostname of the server to scan.\n * @param {boolean} hostnames Optional boolean specifying whether the function should output hostnames (if true) or IP addresses (if false).\n * @returns {string[]} Returns an string of hostnames or IP.\n */\n scan (host: Host, hostnames?: boolean): Host[];\n\n /**\n * Runs the NUKE.exe program on the target server. NUKE.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * nuke(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n nuke (host: Host): void;\n\n /**\n * Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * brutessh(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n brutessh (host: Host): void;\n\n /**\n * Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * ftpcrack(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n ftpcrack (host: Host): void;\n\n /**\n * Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * relaysmtp(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n relaysmtp (host: Host): void;\n\n /**\n * Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * httpworm(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n httpworm (host: Host): void;\n\n /**\n * Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.\n *\n * @example\n * \\`\\`\\`js\n * sqlinject(\"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host IP or hostname of the target server.\n */\n sqlinject (host: Host): void;\n\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 * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\n * run(\"foo.script\", 5);\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\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 * @ramCost 1 GB\n * @param {string} script Filename of script to run.\n * @param {number} [numThreads] Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\n * @param {...string} [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 {number} Returns the PID of a successfully started script, and 0 otherwise.\n */\n run (\n script: Script,\n numThreads?: number,\n ...args: string[]\n ): number;\n\n /**\n * Run a script as a separate process on a specified server. This is similar to the run function\n * except that it can be used to run a script on any server, instead of just the current server.\n *\n * If the script was successfully started, then this functions returns the PID of that script.\n * Otherwise, it returns 0.\n * \n * PID stands for Process ID. The PID is a unique identifier for each script.\n * The PID will always be a positive integer.\n * \n * Running this function with a numThreads argument of 0 will return 0 without running the script.\n * However, running this function with a negative numThreads argument will cause a runtime error.\n *\n * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @ramCost 1.3 GB\n * @param {string} script Filename of script to execute.\n * @param {string} host IP or hostname of the \\`target server\\` on which to execute the script.\n * @param {number} [numThreads] Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\n * @param {...string} [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 {number} Returns the PID of a successfully started script, and 0 otherwise.\n */\n exec (\n script: Script,\n host: Host,\n numThreads?: number,\n ...args: string[]\n ): number;\n\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 * \\`\\`\\`js\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 * @ramCost 2 GB\n * @param {string} script Filename of script to execute.\n * @param {string} numThreads Number of threads to spawn new script with. Will be rounded to nearest integer.\n * @param {...string} [args] Additional arguments to pass into the new script that is being run.\n */\n spawn (script: Script, numThreads?: number, ...args: string[]): void;\n\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 * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @ramCost 0.5 GB\n * @param {string} script Filename of the script to kill\n * @param {string} host IP or hostname of the server on which to kill the script.\n * @param {...string} [args] Arguments to identify which script to kill.\n * @returns {boolean} True if the script is successfully killed, and false otherwise.\n */\n kill (script: Script, host: Host, ...args: string[]): boolean;\n\n /**\n * Kills the script with the specified PID.\n * Killing a script by its PID will typically have better performance,\n * especially if you have many scripts running.\n * If this function successfully kills the specified script, then it will return true.\n * Otherwise, it will return false.\n *\n * @example\n * \\`\\`\\`js\n * if (kill(10)) {\n * print(\"Killed script with PID 10!\");\n * }\n * \\`\\`\\`\n * @ramCost 0.5 GB\n * @param {number} scriptPid PID of the script to kill\n * @returns {boolean} True if the script is successfully killed, and false otherwise.\n */\n kill (scriptPid: number): boolean;\n\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 *\n * @ramCost 0.5 GB\n * @param host {string} IP or hostname of the server on which to kill all scripts.\n * @returns {boolean} True if any scripts were killed, and false otherwise.\n */\n killall (host: Host): boolean;\n\n /**\n * Terminates the current script immediately.\n *\n * @ramCost 0 GB\n */\n exit (): void;\n\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 * \\`\\`\\`js\n * //Copies hack-template.script from the current server to foodnstuff:\n * scp(\"hack-template.script\", \"foodnstuff\");\n * \\`\\`\\`\n * @ramCost 0.6 GB\n * @param {(string|string[])} files Filename or an array of filenames of script/literature files to copy.\n * @param {(string|number)} destination Host or IP of the destination server, which is the server to which the file will be copied.\n * @returns {boolean} 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 | ReadonlyArray<string>, destination: Host): boolean;\n\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 * \\`\\`\\`js\n * //Copies foo.lit from the helios server to the home computer:\n * scp(\"foo.lit\", \"helios\", \"home\");\n * \\`\\`\\`\n * @example\n * \\`\\`\\`js\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 * @ramCost 0.6 GB\n * @param {(string|string[])} files Filename or an array of filenames of script/literature files to copy.\n * @param {(string|number)} source Host or IP 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 {(string|number)} destination Host or IP of the destination server, which is the server to which the file will be copied.\n * @returns {boolean} 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 (\n files: string | ReadonlyArray<string>,\n source: | Host,\n // tslint:disable-next-line:unified-signatures\n destination: Host\n ): boolean;\n\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 * @ramCost 0.2 GB\n * @param {string} host Host or IP of the target server.\n * @param {string} grep A substring to search for in the filename.\n * @returns {string[]} Array with the filenames of all files on the specified server.\n */\n ls (host: Host, grep?: string): string[];\n\n /**\n * Returns an array with general information about all scripts running on the specified target server.\n *\n * @example\n * \\`\\`\\`js\n * //(using NetscriptJS (Netscript 2.0))\n * export async function main(ns) {\n * const ps = ns.ps(\"home\");\n * for (let i = 0; i < ps.length; ++i) {\n * ns.tprint(ps[i].filename + ' ' + ps[i].threads);\n * ns.tprint(ps[i].args);\n * }\n * }\n * \\`\\`\\`\n * @ramCost 0.2 GB\n * @param {string} host Host or IP address of the target server. If not specified, it will be the current server’s IP by default.\n * @returns {object} Array with general information about all scripts running on the specified target server.\n */\n ps (host?: Host): ProcessInfo[];\n\n /**\n * Returns a boolean indicating whether or not the player has root access to the specified target server.\n *\n * @example\n * \\`\\`\\`js\n * if (hasRootAccess(\"foodnstuff\") == false) {\n * nuke(\"foodnstuff\");\n * }\n * \\`\\`\\`\n * @ramCost 0.05 GB\n * @param {string} host Host or IP of the target server\n * @returns {boolean} True if player has root access to the specified target server, and false otherwise.\n */\n hasRootAccess (host: Host): boolean;\n\n /**\n * Returns a string with the hostname of the server that the script is running on.\n *\n * @ramCost 0.05 GB\n * @returns {string} Hostname of the server that the script is on.\n */\n getHostname (): Host;\n\n /**\n * Returns the player’s current hacking level.\n *\n * @ramCost 0.05 GB\n * @returns {number} Player’s current hacking level\n */\n getHackingLevel (): number;\n\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 * \\`\\`\\`js\n * //Example of how this can be used:\n * mults = getHackingMultipliers();\n * print(mults.chance);\n * print(mults.growth);\n * \\`\\`\\`\n * @ramCost 4 GB\n * @returns {object} Object containing the Player’s hacking related multipliers.\n */\n getHackingMultipliers (): HackingMultipliers;\n\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 * \\`\\`\\`js\n * //Example of how this can be used:\n * mults = getHacknetMultipliers();\n * print(mults.production);\n * print(mults.purchaseCost);\n * \\`\\`\\`\n * @ramCost 4 GB\n * @returns {object} Object containing the Player’s hacknet related multipliers.\n */\n getHacknetMultipliers (): HacknetMultipliers;\n\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 * \\`\\`\\`js\n * getServerMoneyAvailable(\"foodnstuff\");\n * getServerMoneyAvailable(\"home\"); //Returns player's money\n * \\`\\`\\`\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server\n * @returns {number} Amount of money available on the server.\n */\n getServerMoneyAvailable (host: Host): number;\n\n /**\n * Returns the maximum amount of money that can be available on a server.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} Maximum amount of money available on the server.\n */\n getServerMaxMoney (host: Host): number;\n\n /**\n * Returns the server’s instrinsic “growth parameter”. This growth\n * parameter is a number between 1 and 100 that represents how\n * quickly the server’s money grows. This parameter affects the\n * percentage by which the server’s money is increased when using the\n * {@link grow} function. A higher growth parameter will result in a\n * higher percentage increase from {@link grow}.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} Parameter that affects the percentage by which the server’s money is increased when using the {@link grow} function.\n */\n getServerGrowth (host: Host): number;\n\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 * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} Security level of the target server.\n */\n getServerSecurityLevel (host: Host): number;\n\n /**\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 * {@link getServerSecurityLevel} because {@link getServerSecurityLevel} returns\n * the current security level of a server, which can constantly change due to\n * {@link hack}, {@link grow}, and {@link 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 * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} Base security level of the target server.\n */\n getServerBaseSecurityLevel (host: Host): number;\n\n /**\n * Returns the minimum security level of the target server.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} Minimum security level of the target server.\n */\n getServerMinSecurityLevel (host: Host): number;\n\n /**\n * Returns the required hacking level of the target server.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} The required hacking level of the target server.\n */\n getServerRequiredHackingLevel (host: Host): number;\n\n /**\n * Returns the number of open ports required to successfully run NUKE.exe on the specified server.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {number} The number of open ports required to successfully run NUKE.exe on the specified server.\n */\n getServerNumPortsRequired (host: Host): number;\n\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 * \\`\\`\\`js\n * res = getServerRam(\"helios\");\n * totalRam = res[0];\n * ramUsed = res[1];\n * \\`\\`\\`\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {[number,number]} Array with total and used memory on the specified server.\n */\n getServerRam (host: Host): [number, number];\n\n /**\n * Returns a boolean denoting whether or not the specified server exists.\n *\n * @ramCost 0.1 GB\n * @param {string} host Host or IP of target server.\n * @returns {boolean} True if specified server exists, and false otherwise.\n */\n serverExists (host: Host): boolean;\n\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 * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @ramCost 0.1 GB\n * @param {string} filename Filename of file to check.\n * @param {(string|number)} [host] Host or IP 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 {boolean} True if specified file exists, and false otherwise.\n */\n fileExists (filename: string, host?: Host): boolean;\n\n /**\n * Returns a boolean indicating whether the specified script is running on the target server.\n * Remember that a script is uniquely identified by both its name and its arguments.\n *\n * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @ramCost 0.1 GB\n * @param {string} script Filename of script to check. This is case-sensitive.\n * @param {string} host Host or IP of target server.\n * @param {...string} [args] Arguments to specify/identify which scripts to search for.\n * @returns {boolean} True if specified script is running on the target server, and false otherwise.\n */\n isRunning (script: Script, host: Host, ...args: string[]): boolean;\n\n /**\n * Returns the cost to purchase a server with the specified amount of ram.\n *\n * @example\n * \\`\\`\\`js\n * for (i = 1; i <= 20; i++) {\n * tprint(i + \" -- \" + getPurchasedServerCost(Math.pow(2, i)));\n * }\n * \\`\\`\\`\n * @ramCost 0.25 GB\n * @param {number} ram Amount of RAM of a potential purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\n * @returns {number} The cost to purchase a server with the specified amount of ram.\n */\n getPurchasedServerCost (ram: number): number;\n\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 * \\`\\`\\`js\n * ram = 64;\n * hn = \"pserv-\";\n * for (i = 0; i < 5; ++i) {\n * purchaseServer(hn + i, ram);\n * }\n * \\`\\`\\`\n * @ramCost 2.25 GB\n * @param {string} hostname Host of the purchased server.\n * @param {number} ram Amount of RAM of the purchased server. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\n * @returns {string} The hostname of the newly purchased server.\n */\n purchaseServer (hostname: Host, ram: number): Host | \"\";\n\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 * @ramCost 2.25 GB\n * @param {string} host Host of the server to delete.\n * @returns {boolean} True if successful, and false otherwise.\n */\n deleteServer (host: Host): boolean;\n\n /**\n * Returns an array with either the hostnames or IPs of all of the servers you have purchased.\n *\n * @ramCost 2.25 GB\n * @param {boolean} hostname Specifies whether hostnames or IP addresses should be returned. If it’s true then hostnames will be returned, and if false then IPs will be returned. If this argument is omitted then it is true by default.\n * @returns {string[]} Returns an array with either the hostnames or IPs of all of the servers you have purchased.\n */\n getPurchasedServers (hostname?: boolean): Host[];\n\n /**\n * Returns the maximum number of servers you can purchase.\n *\n * @ramCost 0.05 GB\n * @returns {number} 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 * @ramCost 0.05 GB\n * @returns {number} Returns the maximum RAM that a purchased server can have.\n */\n getPurchasedServerMaxRam (): number;\n\n /**\n * This function can be used to either write data to a port or to a text file (.txt).\n *\n * If the first argument is a number between 1 and 20, then it specifies a port and this\n * function will write data to that port. The third argument, mode, is not used when writing\n * to a port.\n *\n * If the first argument is a string, then it specifies the name of a text file (.txt) and\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 * @ramCost 1 GB\n * @param {(string|number)} handle Port or text file that will be written to.\n * @param {string} data Data to write.\n * @param {string} mode Defines the write mode. Only valid when writing to text files.\n */\n write (handle: Handle, data?: string | string[] | number, mode?: \"w\" | \"a\"): void;\n\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 * @ramCost 1 GB\n * @param {number} port Port or text file that will be written to.\n * @param {string} data Data to write.\n * @returns {boolean} True if the data is successfully written to the port, and false otherwise.\n */\n tryWrite (port: Handle, data: string | string[] | number): boolean;\n\n /**\n * This function is used to read data from a port or from a text file (.txt).\n *\n * If the argument port/fn is a number between 1 and 20, then it specifies a\n * port and it will 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 *\n * If the argument port/fn is a string, then it specifies the name of a text\n * file (.txt) and 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 * @ramCost 1 GB\n * @param {(string|number)} handle Port or text file to read from.\n * @returns {(string|number|object)} Data in the specified text file or port.\n */\n read (handle: Handle): string | number | object;\n\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 * @ramCost 1 GB\n * @param {number} port Port to peek. Must be an integer between 1 and 20.\n * @returns {(string|number|object)} Data in the specified port.\n */\n peek (port: Port): string | number | object;\n\n /**\n * This function is used to clear data in a Netscript Ports or a text file.\n *\n * If the port/fn argument is a number between 1 and 20, then it specifies a\n * port and will clear it (deleting all data from the underlying queue).\n *\n * If the port/fn argument is a string, then it specifies the name of a\n * text file (.txt) and will delete all data from that text file.\n *\n * @ramCost 1 GB\n * @param {(string|number)} handle Port or text file to clear.\n */\n clear (handle: Handle): void;\n\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 * @ramCost 10 GB\n * @param {number} port Port number. Must be an integer between 1 and 20.\n * @returns {Array} Data in the specified port.\n */\n getPortHandle (port: Port): any[];\n\n /**\n * Removes the specified file from the current server. This function works for every file\n * type except message (.msg) files.\n *\n * @ramCost 1 GB\n * @param {string} name Filename of file to remove. Must include the extension.\n * @param {string} [host] Host or IP Address of the server on which to delete the file. Optional. Defaults to current server.\n * @returns {boolean} True if it successfully deletes the file, and false otherwise.\n */\n rm (name: string, host?: Host): boolean;\n\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 {@link isRunning} function because it does not try to\n * identify a specific instance of a running script by its arguments.\n *\n * @example\n * \\`\\`\\`js\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 * @example\n * \\`\\`\\`js\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 * @ramCost 1 GB\n * @param {string} script Filename of script to check. This is case-sensitive.\n * @param {string} host Host or IP of target server.\n * @returns {boolean} True if the specified script is running, and false otherwise.\n */\n scriptRunning (script: Script, host: Host): boolean;\n\n /**\n * Kills all scripts with the specified filename on the target server specified by hostname/ip,\n * regardless of arguments.\n *\n * @ramCost 1 GB\n * @param {string} script Filename of script to kill. This is case-sensitive.\n * @param {string} host Host or IP of target server.\n * @returns {boolean} true if one or more scripts were successfully killed, and false if none were.\n */\n scriptKill (script: Script, host: Host): boolean;\n\n /**\n * Returns the current script name.\n *\n * @ramCost 0 GB\n * @returns {string} Current script name.\n */\n getScriptName (): string;\n\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 * @ramCost 0.1 GB\n * @param {string} script Filename of script. This is case-sensitive.\n * @param {string} [host] Host or IP of target server the script is located on. This is optional, If it is not specified then the function will se the current server as the target server.\n * @returns {string} Amount of RAM required to run the specified script on the target server, and 0 if the script does not exist.\n */\n getScriptRam (script: Script, host?: Host): number;\n\n /**\n * Returns the amount of time in seconds it takes to execute the {@link 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 *\n * @ramCost 0.05 GB\n * @param {string} host Host or IP of target server.\n * @param {number} [hackLvl] Optional hacking level for the calculation. Defaults to player’s current hacking level.\n * @param {number} [intLvl] Optional intelligence level for the calculation. Defaults to player’s current intelligence level. (Intelligence is unlocked after obtaining Source-File 5).\n * @returns {number} Returns the amount of time in seconds it takes to execute the {@link hack} Netscript function. Returns Infinity if called on a Hacknet Server.\n */\n getHackTime (host: Host, hackLvl?: number, intLvl?: number): number;\n\n /**\n * Returns the amount of time in seconds it takes to execute the {@link 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 *\n * @ramCost 0.05 GB\n * @param {string} host Host or IP of target server.\n * @param {number} [hackLvl] Optional hacking level for the calculation. Defaults to player’s current hacking level.\n * @param {number} [intLvl] Optional intelligence level for the calculation. Defaults to player’s current intelligence level. (Intelligence is unlocked after obtaining Source-File 5).\n * @returns {number} Returns the amount of time in seconds it takes to execute the {@link grow} Netscript function. Returns Infinity if called on a Hacknet Server.\n */\n getGrowTime (host: Host, hackLvl?: number, intLvl?: number): number;\n\n /**\n * Returns the amount of time in seconds 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 *\n * @ramCost 0.05 GB\n * @param {string} host Host or IP of target server.\n * @param {number} [hackLvl] Optional hacking level for the calculation. Defaults to player’s current hacking level.\n * @param {number} [intLvl] Optional intelligence level for the calculation. Defaults to player’s current intelligence level. (Intelligence is unlocked after obtaining Source-File 5).\n * @returns {number} Returns the amount of time in seconds it takes to execute the {@link grow} Netscript function. Returns Infinity if called on a Hacknet Server.\n */\n getWeakenTime (host: Host, hackLvl?: number, intLvl?: number): number;\n\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 ($ / second) of all of your active scripts\n * (scripts that are currently running on any server).\n * The second value is the total income ($ / second) that you’ve earned from scripts\n * since you last installed Augmentations.\n *\n * @ramCost 0.1 GB\n * @param {string} script Filename of script.\n * @param {string} host Server on which script is running.\n * @param {string} [args] Arguments that the script is running with.\n * @returns {(number|[number,number])} Amount of income the specified script generates while online.\n */\n getScriptIncome (script: Script, host: Host, ...args: string[]): number | [number, number];\n\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 * @ramCost 0.1 GB\n * @param {string} script Filename of script.\n * @param {string} host Server on which script is running.\n * @param {...string[]} [args] Arguments that the script is running with.\n * @returns {number} Amount of hacking experience the specified script generates while online.\n */\n getScriptExpGain (script: Script, host: Host, ...args: string[]): number;\n\n /**\n * Returns the amount of time in milliseconds that have passed since you last installed Augmentations.\n *\n * @ramCost 0.05 GB\n * @returns {number} Time in milliseconds that have passed since you last installed Augmentations.\n */\n getTimeSinceLastAug (): number;\n\n /**\n * Complete open source JavaScript sprintf implementation\n *\n * @see https://github.com/alexei/sprintf.js\n * @ramCost 0 GB\n * @param {string} format String to format.\n * @param {...string} args Formating arguments.\n * @returns {string} Formated text.\n */\n sprintf (format: string, ...args: string[]): string;\n\n /**\n * Complete open source JavaScript sprintf implementation\n *\n * @see https://github.com/alexei/sprintf.js\n * @ramCost 0 GB\n * @param {string} format String to format.\n * @param {string[]} args Formating arguments.\n * @returns {string} Formated text.\n */\n vsprintf (format: string, args: string[]): string;\n\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 * @ramCost 0 GB\n * @param {number} n Number to format.\n * @param {string} format Formatter.\n * @returns {string} Formated number.\n */\n nFormat (n: number, format: string): number;\n\n /**\n * Prompts the player with a dialog box with two options: “Yes” and “No”.\n * This function will return true if the player click “Yes” and false if\n * the player clicks “No”. The script’s execution is halted until the player\n * selects one of the options.\n *\n * @ramCost 0 GB\n * @param {string} txt Text to appear in the prompt dialog box.\n * @returns {Promise<boolean>} True if the player click “Yes” and false if the player clicks “No”.\n */\n prompt (txt: string): Promise<boolean>;\n\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 * \\`\\`\\`js\n * wget(\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\", \"game_readme.txt\");\n * \\`\\`\\`\n * @ramCost 0 GB\n * @param {string} url URL to pull data from.\n * @param {string} target Filename to write data to. Must be script or text file.\n * @param {string} [host] Optional hostname/ip of server for target file.\n * @returns {Promise<boolean>} 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 * @ramCost 0.1 GB\n * @returns {number} Amount of Faction favor required to be able to donate to a faction.\n */\n getFavorToDonate (): number;\n\n /**\n * Returns an object containing the current BitNode multipliers.\n * This function requires 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 * \\`\\`\\`js\n * mults = getBitNodeMultipliers();\n * print(mults.ServerMaxMoney);\n * print(mults.HackExpGain);\n * \\`\\`\\`\n * @ramCost 4 GB\n * @returns {object} Object containing the current BitNode multipliers.\n */\n getBitNodeMultipliers (url: string, target: string, host: string): BitNodeMultipliers;\n}\n\n`;\n","import { Milestone } from \"./Milestone\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServer } from \"../Server/AllServers\";\n\nfunction allFactionAugs(p: IPlayer, f: Faction): boolean {\n const factionAugs = f.augmentations.slice().filter((aug) => aug !== \"NeuroFlux Governor\");\n for (const factionAug of factionAugs) {\n if (\n !p.augmentations.some((aug) => {\n return aug.name == factionAug;\n })\n )\n return false;\n }\n return true;\n}\n\nexport const Milestones: Milestone[] = [\n {\n title: \"Gain root access on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"hasAdminRights\")) return false;\n return (server as any).hasAdminRights;\n },\n },\n {\n title: \"Install the backdoor on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"backdoorInstalled\")) return false;\n return (server as any).backdoorInstalled;\n },\n },\n {\n title: \"Join the faction hinted at in csec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"CyberSec\");\n },\n },\n {\n title: \"Install all the Augmentations from CyberSec\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"CyberSec\"]);\n },\n },\n {\n title: \"Join the faction hinted at in nitesec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"NiteSec\");\n },\n },\n {\n title: \"Install all the Augmentations from NiteSec\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"NiteSec\"]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"The Black Hand\");\n },\n },\n {\n title: \"Install all the Augmentations from The Black Hand\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"The Black Hand\"]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(\"BitRunners\");\n },\n },\n {\n title: \"Install all the Augmentations from BitRunners\",\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[\"BitRunners\"]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (p: IPlayer): boolean => {\n // technically wrong but whatever\n return p.factions.includes(\"Daedalus\");\n },\n },\n {\n title: \"Install the special Augmentation from Daedalus\",\n fulfilled: (p: IPlayer): boolean => {\n return p.augmentations.some((aug) => aug.name == \"The Red Pill\");\n },\n },\n {\n title: \"Install the final backdoor and free yourself.\",\n fulfilled: (): boolean => {\n return false;\n },\n },\n];\n","import { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function repFromDonation(amt: number, player: IPlayer): number {\n return (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.faction_rep_mult;\n}\n","import { StockSymbols } from \"./StockSymbols\";\n\nexport const TickerHeaderFormatData = {\n longestName: 0,\n longestSymbol: 0,\n};\n\nfor (const key in StockSymbols) {\n TickerHeaderFormatData.longestName = Math.max(key.length, TickerHeaderFormatData.longestName);\n TickerHeaderFormatData.longestSymbol = Math.max(StockSymbols[key].length, TickerHeaderFormatData.longestSymbol);\n}\n","import { substituteAliases } from \"../Alias\";\n// Helper function that checks if an argument (which is a string) is a valid number\nfunction isNumber(str: string): boolean {\n if (typeof str != \"string\") {\n return false;\n } // Only process strings\n return !isNaN(str as unknown as number) && !isNaN(parseFloat(str));\n}\nexport function ParseCommands(commands: string): string[] {\n // Sanitize input\n commands = commands.trim();\n // Replace all extra whitespace in command with a single space\n commands = commands.replace(/\\s\\s+/g, \" \");\n\n const match = commands.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g);\n if (!match) return [];\n // Split commands and execute sequentially\n const allCommands = match\n .map(substituteAliases)\n .map((c) => c.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g))\n .flat();\n\n const out: string[] = [];\n for (const c of allCommands) {\n if (c === null) continue;\n if (c.match(/^\\s*$/)) {\n continue;\n } // Don't run commands that only have whitespace\n out.push(c.trim());\n }\n return out;\n}\n\nexport function ParseCommand(command: string): (string | number)[] {\n // This will be used to keep track of whether we're in a quote. This is for situations\n // like the alias command:\n // alias run=\"run NUKE.exe\"\n // We want the run=\"run NUKE.exe\" to be parsed as a single command, so this flag\n // will keep track of whether we have a quote in\n let inQuote = ``;\n\n // Returns an array with the command and its arguments in each index\n // Properly handles quotation marks (e.g. `run foo.script \"the sun\"` will return [run, foo.script, the sun])\n const args = [];\n let start = 0,\n i = 0;\n let prevChar = \"\"; // Previous character\n while (i < command.length) {\n let escaped = false; // Check for escaped quotation marks\n if (i >= 1) {\n prevChar = command.charAt(i - 1);\n if (prevChar === \"\\\\\") {\n escaped = true;\n }\n }\n\n const c = command.charAt(i);\n if (c === '\"') {\n // Double quotes\n if (!escaped && prevChar === \" \") {\n const endQuote = command.indexOf('\"', i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else {\n if (inQuote === ``) {\n inQuote = `\"`;\n } else if (inQuote === `\"`) {\n inQuote = ``;\n }\n }\n } else if (c === \"'\") {\n // Single quotes, same thing as above\n if (!escaped && prevChar === \" \") {\n const endQuote = command.indexOf(\"'\", i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === \" \")) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else {\n if (inQuote === ``) {\n inQuote = `'`;\n } else if (inQuote === `'`) {\n inQuote = ``;\n }\n }\n } else if (c === \" \" && inQuote === ``) {\n const arg = command.substr(start, i - start);\n\n // If this is a number, convert it from a string to number\n if (isNumber(arg)) {\n args.push(parseFloat(arg));\n } else {\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 {\n args.push(arg);\n }\n }\n\n return args;\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/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 \"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 \"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 a script or text file\",\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 \"weaken [server] Reduce the security of a server\",\n \"wget [url] [target file] Retrieves code/text from a web server\",\n];\n\nexport const HelpTexts: IMap<string[]> = {\n alias: [\n '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 \"analze\",\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 backdoor: [\n \"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 \"buy [-l / 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 \"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.\",\n ],\n cat: [\n \"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 cd: [\n \"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 check: [\n \"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 clear: [\n \"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 cls: [\n \"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 connect: [\n \"connect [hostname]\",\n \" \",\n \"Connect to a remote server. The hostname or IP address of the remote server must be given as the argument \",\n \"to this command. Note that only servers that are immediately adjacent to the current server in the network can be connected to. To \",\n \"see which servers can be connected to, use the 'scan' command.\",\n ],\n download: [\n \"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 \"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 free: [\n \"free\",\n \" \",\n \"Display's 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 grow: [\n \"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 hack: [\n \"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 \"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 home: [\n \"home\" + \"Connect to your home computer. This will work no matter what server you are currently connected to.\",\n ],\n hostname: [\"hostname\", \" \", \"Prints the hostname of the current server\"],\n kill: [\n \"kill [script name] [args...]\",\n \" \",\n \"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 killall: [\n \"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 ls: [\n \"ls [dir] [| grep pattern]\",\n \" \",\n \"The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. \",\n \"The files will be displayed in alphabetical order. \",\n \" \",\n \"The 'dir' optional parameter can be used to display files/directories in another directory.\",\n \" \",\n \"The '| grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.\",\n \" \",\n \"Examples:\",\n \" \",\n \"List all files with the '.script' extension in the current directory:\",\n \" \",\n \"ls | grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \"ls / | grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \"ls scripts | grep purchase\",\n ],\n lscpu: [\"lscpu\", \" \", \"Prints the number of CPU Cores the current server has\"],\n\n mem: [\n \"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 mv: [\n \"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 nano: [\n \"nano [file name]\",\n \" \",\n \"Opens up the specified file in the Text Editor. Only scripts (.script) or text files (.txt) can be \",\n \"edited using the Text Editor. If the file does not already exist, then a new, empty one \",\n \"will be created\",\n ],\n ps: [\"ps\", \" \", \"Prints all scripts that are running on the current server\"],\n\n rm: [\n \"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 run: [\n \"run [file name] [-t] [num threads] [args...]\",\n \" \",\n \"Execute a program or a script.\",\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 \"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 \"scan-analyze\": [\n \"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 scp: [\n \"scp [filename] [target server]\",\n \" \",\n \"Copies the specified file from the current server to the target server. \",\n \"This command only works for script files (.script 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.\",\n ],\n sudov: [\"sudov\", \" \", \"Prints whether or not you have root access to the current machine\"],\n\n tail: [\n \"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 top: [\n \"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 unalias: [\n \"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 weaken: [\n \"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 wget: [\n \"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","import { ITerminal, Output, Link, 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 { 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 { 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 { weaken } from \"./commands/weaken\";\nimport { wget } from \"./commands/wget\";\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)[] = [new Output(`Bitburner v${CONSTANTS.Version}`, \"primary\")];\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): 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 error(s: string): void {\n this.append(new Output(s, \"error\"));\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\");\n }\n\n startGrow(player: IPlayer): void {\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(calculateGrowTime(server, player) / 16, \"g\");\n }\n startWeaken(player: IPlayer): void {\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(calculateWeakenTime(server, player) / 16, \"w\");\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\");\n }\n\n startAnalyze(): void {\n this.print(\"Analyzing system...\");\n this.startAction(1, \"a\");\n }\n\n startAction(n: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\"): void {\n this.action = new TTimer(n, action);\n }\n\n // Complete the hack/analyze command\n finishHack(router: IRouter, player: IPlayer, cancelled = false): void {\n if (cancelled) return;\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\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 if (SpecialServers.WorldDaemon === server.hostname) {\n if (player.bitNodeN == null) {\n player.bitNodeN = 1;\n }\n router.toBitVerse(false, false);\n return;\n }\n server.backdoorInstalled = true;\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);\n player.recordMoneySource(moneyGained, \"hacking\");\n player.gainHackingExp(expGainedOnSuccess);\n player.gainIntelligenceExp(expGainedOnSuccess / CONSTANTS.IntelligenceTerminalHackBaseExpGain);\n\n server.fortify(CONSTANTS.ServerFortifyAmount);\n\n this.print(\n `Hack successful! Gained ${numeralWrapper.formatMoney(moneyGained)} and ${numeralWrapper.formatExp(\n expGainedOnSuccess,\n )} hacking exp`,\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, cancelled = false): void {\n if (cancelled) return;\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 const expGain = calculateHackingExpGain(server, player);\n const growth = processSingleServerGrowth(server, 1, player, server.cpuCores) - 1;\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 }\n\n finishWeaken(player: IPlayer, cancelled = false): void {\n if (cancelled) return;\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 const expGain = calculateHackingExpGain(server, player);\n server.weaken(CONSTANTS.ServerWeakenAmount);\n this.print(\n `'${server.hostname}' security level weakened to ${server.hackDifficulty}. Gained ${numeralWrapper.formatExp(\n expGain,\n )} hacking exp.`,\n );\n }\n\n finishBackdoor(router: IRouter, player: IPlayer, cancelled = false): void {\n if (!cancelled) {\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 if (SpecialServers.WorldDaemon === server.hostname) {\n if (player.bitNodeN == null) {\n player.bitNodeN = 1;\n }\n router.toBitVerse(false, false);\n return;\n }\n server.backdoorInstalled = true;\n this.print(\"Backdoor successful!\");\n }\n }\n\n finishAnalyze(player: IPlayer, cancelled = false): void {\n if (!cancelled) {\n const currServ = player.getCurrentServer();\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 if (currServ instanceof Server) {\n const hackingSkill = currServ.requiredHackingSkill;\n this.print(\"Required hacking skill: \" + (!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 this.print(this.getProgressText());\n if (this.action.action === \"h\") {\n this.finishHack(router, player, cancelled);\n } else if (this.action.action === \"g\") {\n this.finishGrow(player, cancelled);\n } else if (this.action.action === \"w\") {\n this.finishWeaken(player, cancelled);\n } else if (this.action.action === \"b\") {\n this.finishBackdoor(router, player, cancelled);\n } else if (this.action.action === \"a\") {\n this.finishAnalyze(player, cancelled);\n }\n if (cancelled) {\n this.print(\"Cancelled\");\n }\n this.action = null;\n TerminalEvents.emit();\n }\n\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null {\n if (isScriptFilename(filename)) {\n return this.getScript(player, filename);\n }\n\n if (filename.endsWith(\".lit\")) {\n return this.getLitFile(player, filename);\n }\n\n if (filename.endsWith(\".txt\")) {\n return this.getTextFile(player, filename);\n }\n\n return null;\n }\n\n getFilepath(filename: string): string {\n const path = evaluateFilePath(filename, this.cwd());\n if (path == null) {\n throw new Error(`Invalid file path specified: ${filename}`);\n }\n\n if (isInRootDirectory(path)) {\n return removeLeadingSlash(path);\n }\n\n return path;\n }\n\n getScript(player: IPlayer, filename: string): Script | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const script of s.scripts) {\n if (filepath === script.filename) {\n return script;\n }\n }\n\n return null;\n }\n\n getTextFile(player: IPlayer, filename: string): TextFile | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const txt of s.textFiles) {\n if (filepath === txt.fn) {\n return txt;\n }\n }\n\n return null;\n }\n\n getLitFile(player: IPlayer, filename: string): string | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const lit of s.messages) {\n if (typeof lit === \"string\" && filepath === lit) {\n return lit;\n }\n }\n\n return null;\n }\n\n cwd(): string {\n return this.currDir;\n }\n\n setcwd(dir: string): void {\n this.currDir = dir;\n TerminalEvents.emit();\n }\n\n async runContract(player: IPlayer, contractName: string): Promise<void> {\n // There's already an opened contract\n if (this.contractOpen) {\n return this.error(\"There's already a Coding Contract in Progress\");\n }\n\n const serv = player.getCurrentServer();\n const contract = serv.getContract(contractName);\n if (contract == null) {\n return this.error(\"No such contract\");\n }\n\n this.contractOpen = true;\n const res = await contract.prompt();\n\n switch (res) {\n case CodingContractResult.Success:\n if (contract.reward !== null) {\n const reward = player.gainCodingContractReward(contract.reward, contract.getDifficulty());\n this.print(`Contract SUCCESS - ${reward}`);\n }\n serv.removeContract(contract);\n break;\n case CodingContractResult.Failure:\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n this.print(\"Contract FAILED - Contract is now self-destructing\");\n serv.removeContract(contract);\n } else {\n this.print(`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 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 }\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 // TODO: remove this once we figure out the height issue.\n this.outputHistory = [new Output(`Bitburner v${CONSTANTS.Version}`, \"primary\")];\n TerminalEvents.emit();\n TerminalClearEvents.emit();\n }\n\n prestige(): void {\n this.action = null;\n this.clear();\n }\n\n executeCommand(router: IRouter, player: IPlayer, command: string): void {\n if (this.action !== null) {\n this.error(`Cannot execute command (${command}) while an action is in progress`);\n return;\n }\n // Allow usage of ./\n if (command.startsWith(\"./\")) {\n command = \"run \" + command.slice(2);\n }\n // Only split the first space\n const commandArray = ParseCommand(command);\n if (commandArray.length == 0) {\n return;\n }\n const s = player.getCurrentServer();\n /****************** Interactive Tutorial Terminal Commands ******************/\n if (ITutorial.isRunning) {\n const n00dlesServ = GetServer(\"n00dles\");\n if (n00dlesServ == null) {\n throw new Error(\"Could not get n00dles server\");\n return;\n }\n switch (ITutorial.currStep) {\n case iTutorialSteps.TerminalHelp:\n if (commandArray.length === 1 && commandArray[0] == \"help\") {\n iTutorialNextStep();\n } else {\n this.print(\"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.print(\"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.print(\"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.print(\"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.print(\"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.print(\"Wrong command! Try again!\");\n return;\n }\n } else {\n this.print(\"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.print(\"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.print(\"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.print(\"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.print(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalCreateScript:\n if (commandArray.length == 2 && commandArray[0] == \"nano\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.print(\"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.print(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalRunScript:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.print(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (commandArray.length == 2 && commandArray[0] == \"tail\" && commandArray[1] == \"n00dles.script\") {\n iTutorialNextStep();\n } else {\n this.print(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n default:\n this.print(\"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\") {\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)[],\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 download: download,\n expr: expr,\n free: free,\n grow: grow,\n hack: hack,\n help: help,\n home: home,\n hostname: hostname,\n kill: kill,\n killall: killall,\n ls: ls,\n lscpu: lscpu,\n mem: mem,\n mv: mv,\n nano: nano,\n ps: ps,\n rm: rm,\n run: run,\n scan: scan,\n scp: scp,\n sudov: sudov,\n tail: tail,\n top: top,\n unalias: unalias,\n weaken: weaken,\n wget: wget,\n };\n\n const f = commands[commandName.toLowerCase()];\n if (!f) {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n f(this, router, player, s, commandArray.slice(1));\n }\n\n getProgressText(): string {\n if (this.action === null) throw new Error(\"trying to get the progress text when there's no action\");\n return createProgressBarText({\n progress: (this.action.time - this.action.timeLeft) / this.action.time,\n totalTicks: 50,\n });\n }\n}\n","import { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\n/* tslint:disable:completed-docs no-magic-numbers arrow-return-shorthand */\n\n/* Function that generates a valid 'data' for a contract type */\nexport type GeneratorFunc = () => any;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: any, answer: string) => boolean;\n\n/* Function that returns a string with the problem's description.\n Requires the 'data' of a Contract as input */\nexport type DescriptionFunc = (data: any) => string;\n\nexport interface ICodingContractTypeMetadata {\n desc: DescriptionFunc;\n difficulty: number;\n gen: GeneratorFunc;\n name: string;\n numTries: number;\n solver: SolverFunc;\n}\n\n/* Helper functions for Coding Contract implementations */\nfunction removeBracketsFromArrayString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith(\"[\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith(\"]\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction removeQuotesFromString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith('\"') || strCpy.startsWith(\"'\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith('\"') || strCpy.endsWith(\"'\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction convert2DArrayToString(arr: any[][]): string {\n const components: string[] = [];\n arr.forEach((e: any) => {\n let s: string = e.toString();\n s = [\"[\", s, \"]\"].join(\"\");\n components.push(s);\n });\n\n return components.join(\",\").replace(/\\s/g, \"\");\n}\n\nexport const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [\n {\n desc: (n: number): string => {\n return [\"A prime factor is a factor that is a prime number.\", `What is the largest prime factor of ${n}?`].join(\n \" \",\n );\n },\n difficulty: 1,\n gen: (): number => {\n return getRandomInt(500, 1e9);\n },\n name: \"Find Largest Prime Factor\",\n numTries: 10,\n solver: (data: number, ans: string): boolean => {\n let fac = 2;\n let n: number = data;\n while (n > (fac - 1) * (fac - 1)) {\n while (n % fac === 0) {\n n = Math.round(n / fac);\n }\n ++fac;\n }\n\n return (n === 1 ? fac - 1 : n) === parseInt(ans, 10);\n },\n },\n {\n desc: (n: number[]): string => {\n return [\n \"Given the following integer array, find the contiguous subarray\",\n \"(containing at least one number) which has the largest sum and return that sum.\",\n \"'Sum' refers to the sum of all the numbers in the subarray.\\n\",\n `${n.toString()}`,\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(5, 40);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(-10, 10);\n }\n\n return arr;\n },\n name: \"Subarray with Maximum Sum\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n const nums: number[] = data.slice();\n for (let i = 1; i < nums.length; i++) {\n nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);\n }\n\n return parseInt(ans, 10) === Math.max(...nums);\n },\n },\n {\n desc: (n: number): string => {\n return [\n \"It is possible write four as a sum in exactly four different ways:\\n\\n\",\n \" 3 + 1\\n\",\n \" 2 + 2\\n\",\n \" 2 + 1 + 1\\n\",\n \" 1 + 1 + 1 + 1\\n\\n\",\n `How many different ways can the number ${n} be written as a sum of at least`,\n \"two positive integers?\",\n ].join(\" \");\n },\n difficulty: 1.5,\n gen: (): number => {\n return getRandomInt(8, 100);\n },\n name: \"Total Ways to Sum\",\n numTries: 10,\n solver: (data: number, ans: string): boolean => {\n const ways: number[] = [1];\n ways.length = data + 1;\n ways.fill(0, 1);\n for (let i = 1; i < data; ++i) {\n for (let j: number = i; j <= data; ++j) {\n ways[j] += ways[j - i];\n }\n }\n\n return ways[data] === parseInt(ans, 10);\n },\n },\n {\n desc: (n: number[][]): string => {\n let d: string = [\n \"Given the following array of array 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 exactly.\\n\\n\",\n \"Your answer should be submitted as 1 or 0, representing true and false respectively\",\n ].join(\" \");\n },\n difficulty: 2.5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; ++i) {\n if (Math.random() < 0.2) {\n arr[i] = 0; // 20% chance of being 0\n } else {\n arr[i] = getRandomInt(0, 10);\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game\",\n numTries: 1,\n solver: (data: number[], ans: string): boolean => {\n const n: number = data.length;\n let i = 0;\n for (let reach = 0; i < n && i <= reach; ++i) {\n reach = Math.max(i + data[i], reach);\n }\n const solution: boolean = i === n;\n\n if (ans === \"1\" && solution) {\n return true;\n }\n if (ans === \"0\" && !solution) {\n return true;\n }\n\n return false;\n },\n },\n {\n desc: (arr: number[][]): string => {\n return [\n \"Given the following array of array of numbers representing a list of\",\n \"intervals, merge all overlapping intervals.\\n\\n\",\n `[${convert2DArrayToString(arr)}]\\n\\n`,\n \"Example:\\n\\n\",\n \"[[1, 3], [8, 10], [2, 6], [10, 16]]\\n\\n\",\n \"would merge into [[1, 6], [8, 16]].\\n\\n\",\n \"The intervals must be returned in ASCENDING order.\",\n \"You can assume that in an interval, the first number will always be\",\n \"smaller than the second.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[][] => {\n const intervals: number[][] = [];\n const numIntervals: number = getRandomInt(3, 20);\n for (let i = 0; i < numIntervals; ++i) {\n const start: number = getRandomInt(1, 25);\n const end: number = start + getRandomInt(1, 10);\n intervals.push([start, end]);\n }\n\n return intervals;\n },\n name: \"Merge Overlapping Intervals\",\n numTries: 15,\n solver: (data: number[][], ans: string): boolean => {\n const intervals: number[][] = data.slice();\n intervals.sort((a: number[], b: number[]) => {\n return a[0] - b[0];\n });\n\n const result: number[][] = [];\n let start: number = intervals[0][0];\n let end: number = intervals[0][1];\n for (const interval of intervals) {\n if (interval[0] <= end) {\n end = Math.max(end, interval[1]);\n } else {\n result.push([start, end]);\n start = interval[0];\n end = interval[1];\n }\n }\n result.push([start, end]);\n\n const sanitizedResult: string = convert2DArrayToString(result);\n const sanitizedAns: string = ans.replace(/\\s/g, \"\");\n\n return sanitizedResult === sanitizedAns || sanitizedResult === removeBracketsFromArrayString(sanitizedAns);\n },\n },\n {\n desc: (data: string): string => {\n return [\n \"Given the following string containing only digits, return\",\n \"an array with all possible valid IP address combinations\",\n \"that can be created from the string:\\n\\n\",\n `${data}\\n\\n`,\n \"Note that an octet cannot begin with a '0' unless the number\",\n \"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\\n\\n\",\n \"Examples:\\n\\n\",\n \"25525511135 -> [255.255.11.135, 255.255.111.35]\\n\",\n \"1938718066 -> [193.87.180.66]\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): string => {\n let str = \"\";\n for (let i = 0; i < 4; ++i) {\n const num: number = getRandomInt(0, 255);\n const convNum: string = num.toString();\n str += convNum;\n }\n\n return str;\n },\n name: \"Generate IP Addresses\",\n numTries: 10,\n solver: (data: string, ans: string): boolean => {\n const ret: string[] = [];\n for (let a = 1; a <= 3; ++a) {\n for (let b = 1; b <= 3; ++b) {\n for (let c = 1; c <= 3; ++c) {\n for (let d = 1; d <= 3; ++d) {\n if (a + b + c + d === data.length) {\n const A: number = parseInt(data.substring(0, a), 10);\n const B: number = parseInt(data.substring(a, a + b), 10);\n const C: number = parseInt(data.substring(a + b, a + b + c), 10);\n const D: number = parseInt(data.substring(a + b + c, a + b + c + d), 10);\n if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {\n const ip: string = [A.toString(), \".\", B.toString(), \".\", C.toString(), \".\", D.toString()].join(\"\");\n if (ip.length === data.length + 3) {\n ret.push(ip);\n }\n }\n }\n }\n }\n }\n }\n\n const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const ansArr: string[] = sanitizedAns.split(\",\");\n if (ansArr.length !== ret.length) {\n return false;\n }\n for (const ipInAns of ansArr) {\n if (!ret.includes(ipInAns)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made\",\n \"then the answer should be 0. Note\",\n \"that you have to buy the stock before you can sell it\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader I\",\n numTries: 5,\n solver: (data: number[], ans: string): boolean => {\n let maxCur = 0;\n let maxSoFar = 0;\n for (let i = 1; i < data.length; ++i) {\n maxCur = Math.max(0, (maxCur += data[i] - data[i - 1]));\n maxSoFar = Math.max(maxCur, maxSoFar);\n }\n\n return maxSoFar.toString() === ans;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using as many\",\n \"transactions as you'd like. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader II\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n let profit = 0;\n for (let p = 1; p < data.length; ++p) {\n profit += Math.max(data[p] - data[p - 1], 0);\n }\n\n return profit.toString() === ans;\n },\n },\n {\n desc: (data: number[]): string => {\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"two transactions. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader III\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n let hold1: number = Number.MIN_SAFE_INTEGER;\n let hold2: number = Number.MIN_SAFE_INTEGER;\n let release1 = 0;\n let release2 = 0;\n for (const price of data) {\n release2 = Math.max(release2, hold2 + price);\n hold2 = Math.max(hold2, release1 - price);\n release1 = Math.max(release1, hold1 + price);\n hold1 = Math.max(hold1, price * -1);\n }\n\n return release2.toString() === ans;\n },\n },\n {\n desc: (data: any[]): string => {\n const k: number = data[0];\n const prices: number[] = data[1];\n return [\n \"You are given the following array with two elements:\\n\\n\",\n `[${k}, [${prices}]]\\n\\n`,\n \"The first element is an integer k. The second element is an\",\n \"array of stock prices (which are numbers) where the i-th element\",\n \"represents the stock price on day i.\\n\\n\",\n \"Determine the maximum possible profit you can earn using at most\",\n \"k transactions. A transaction is defined as buying and then selling\",\n \"one share of the stock. Note that you cannot engage in multiple\",\n \"transactions at once. In other words, you must sell the stock before\",\n \"you can buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 8,\n gen: (): any[] => {\n const k: number = getRandomInt(2, 10);\n const len: number = getRandomInt(3, 50);\n const prices: number[] = [];\n prices.length = len;\n for (let i = 0; i < len; ++i) {\n prices[i] = getRandomInt(1, 200);\n }\n\n return [k, prices];\n },\n name: \"Algorithmic Stock Trader IV\",\n numTries: 10,\n solver: (data: any[], ans: string): boolean => {\n const k: number = data[0];\n const prices: number[] = data[1];\n\n const len = prices.length;\n if (len < 2) {\n return parseInt(ans) === 0;\n }\n if (k > len / 2) {\n let res = 0;\n for (let i = 1; i < len; ++i) {\n res += Math.max(prices[i] - prices[i - 1], 0);\n }\n\n return parseInt(ans) === res;\n }\n\n const hold: number[] = [];\n const rele: number[] = [];\n hold.length = k + 1;\n rele.length = k + 1;\n for (let i = 0; i <= k; ++i) {\n hold[i] = Number.MIN_SAFE_INTEGER;\n rele[i] = 0;\n }\n\n let cur: number;\n for (let i = 0; i < len; ++i) {\n cur = prices[i];\n for (let j = k; j > 0; --j) {\n rele[j] = Math.max(rele[j], hold[j] + cur);\n hold[j] = Math.max(hold[j], rele[j - 1] - cur);\n }\n }\n\n return parseInt(ans) === rele[k];\n },\n },\n {\n desc: (data: number[][]): string => {\n function createTriangleRecurse(data: number[][], level = 0): string {\n const numLevels: number = data.length;\n if (level >= numLevels) {\n return \"\";\n }\n const numSpaces = numLevels - level + 1;\n\n let str: string = [\" \".repeat(numSpaces), \"[\", data[level].toString(), \"]\"].join(\"\");\n if (level < numLevels - 1) {\n str += \",\";\n }\n\n return str + \"\\n\" + createTriangleRecurse(data, level + 1);\n }\n\n function createTriangle(data: number[][]): string {\n return [\"[\\n\", createTriangleRecurse(data), \"]\"].join(\"\");\n }\n\n const triangle = createTriangle(data);\n\n return [\n \"Given a triangle, find the minimum path sum from top to bottom. In each step\",\n \"of the path, you may only move to adjacent numbers in the row below.\",\n \"The triangle is represented as a 2D array of numbers:\\n\\n\",\n `${triangle}\\n\\n`,\n \"Example: If you are given the following triangle:\\n\\n\" + \"[\\n\",\n \" [2],\\n\",\n \" [3,4],\\n\",\n \" [6,5,7],\\n\",\n \" [4,1,8,3]\\n\",\n \"]\\n\\n\",\n \"The minimum path sum is 11 (2 -> 3 -> 5 -> 1).\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const triangle: number[][] = [];\n const levels: number = getRandomInt(3, 12);\n triangle.length = levels;\n\n for (let row = 0; row < levels; ++row) {\n triangle[row] = [];\n triangle[row].length = row + 1;\n for (let i = 0; i < triangle[row].length; ++i) {\n triangle[row][i] = getRandomInt(1, 9);\n }\n }\n\n return triangle;\n },\n name: \"Minimum Path Sum in a Triangle\",\n numTries: 10,\n solver: (data: number[][], ans: string): boolean => {\n const n: number = data.length;\n const dp: number[] = data[n - 1].slice();\n for (let i = n - 2; i > -1; --i) {\n for (let j = 0; j < data[i].length; ++j) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];\n }\n }\n\n return dp[0] === parseInt(ans);\n },\n },\n {\n desc: (data: number[]): string => {\n const numRows = data[0];\n const numColumns = data[1];\n return [\n \"You are in a grid with\",\n `${numRows} rows and ${numColumns} columns, and you are`,\n \"positioned in the top-left corner of that grid. You are trying to\",\n \"reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Determine how many\",\n \"unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an array\",\n \"with the number of rows and columns:\\n\\n\",\n `[${numRows}, ${numColumns}]`,\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const numRows: number = getRandomInt(2, 14);\n const numColumns: number = getRandomInt(2, 14);\n\n return [numRows, numColumns];\n },\n name: \"Unique Paths in a Grid I\",\n numTries: 10,\n solver: (data: number[], ans: string): boolean => {\n const n: number = data[0]; // Number of rows\n const m: number = data[1]; // Number of columns\n const currentRow: number[] = [];\n currentRow.length = n;\n\n for (let i = 0; i < n; i++) {\n currentRow[i] = 1;\n }\n for (let row = 1; row < m; row++) {\n for (let i = 1; i < n; i++) {\n currentRow[i] += currentRow[i - 1];\n }\n }\n\n return parseInt(ans) === currentRow[n - 1];\n },\n },\n {\n desc: (data: number[][]): string => {\n let gridString = \"\";\n for (const line of data) {\n gridString += `${line.toString()},\\n`;\n }\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `${gridString}\\n`,\n \"You are trying reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Furthermore, there are obstacles on the grid\",\n \"that you cannot move onto. These obstacles are denoted by '1', while empty\",\n \"spaces are denoted by 0.\\n\\n\",\n \"Determine how many unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const numRows: number = getRandomInt(2, 12);\n const numColumns: number = getRandomInt(2, 12);\n\n const grid: number[][] = [];\n grid.length = numRows;\n for (let i = 0; i < numRows; ++i) {\n grid[i] = [];\n grid[i].length = numColumns;\n grid[i].fill(0);\n }\n\n for (let r = 0; r < numRows; ++r) {\n for (let c = 0; c < numColumns; ++c) {\n if (r === 0 && c === 0) {\n continue;\n }\n if (r === numRows - 1 && c === numColumns - 1) {\n continue;\n }\n\n // 15% chance of an element being an obstacle\n if (Math.random() < 0.15) {\n grid[r][c] = 1;\n }\n }\n }\n\n return grid;\n },\n name: \"Unique Paths in a Grid II\",\n numTries: 10,\n solver: (data: number[][], ans: string): boolean => {\n const obstacleGrid: number[][] = [];\n obstacleGrid.length = data.length;\n for (let i = 0; i < obstacleGrid.length; ++i) {\n obstacleGrid[i] = data[i].slice();\n }\n\n for (let i = 0; i < obstacleGrid.length; i++) {\n for (let j = 0; j < obstacleGrid[0].length; j++) {\n if (obstacleGrid[i][j] == 1) {\n obstacleGrid[i][j] = 0;\n } else if (i == 0 && j == 0) {\n obstacleGrid[0][0] = 1;\n } else {\n obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);\n }\n }\n }\n\n return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1] === parseInt(ans);\n },\n },\n {\n desc: (data: string): string => {\n return [\n \"Given the following string:\\n\\n\",\n `${data}\\n\\n`,\n \"remove the minimum number of invalid parentheses in order to validate\",\n \"the string. If there are multiple minimal ways to validate the string,\",\n \"provide all of the possible results. The answer should be provided\",\n \"as an array of strings. If it is impossible to validate the string\",\n \"the result should be an array with only an empty string.\\n\\n\",\n \"IMPORTANT: The string may contain letters, not just parentheses.\",\n `Examples:\\n`,\n `\"()())()\" -> [()()(), (())()]\\n`,\n `\"(a)())()\" -> [(a)()(), (a())()]\\n`,\n `\")( -> [\"\"]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): string => {\n const len: number = getRandomInt(6, 20);\n const chars: string[] = [];\n chars.length = len;\n\n // 80% chance of the first parenthesis being (\n Math.random() < 0.8 ? (chars[0] = \"(\") : (chars[0] = \")\");\n\n for (let i = 1; i < len; ++i) {\n const roll = Math.random();\n if (roll < 0.4) {\n chars[i] = \"(\";\n } else if (roll < 0.8) {\n chars[i] = \")\";\n } else {\n chars[i] = \"a\";\n }\n }\n\n return chars.join(\"\");\n },\n name: \"Sanitize Parentheses in Expression\",\n numTries: 10,\n solver: (data: string, ans: string): boolean => {\n let left = 0;\n let right = 0;\n const res: string[] = [];\n\n for (let i = 0; i < data.length; ++i) {\n if (data[i] === \"(\") {\n ++left;\n } else if (data[i] === \")\") {\n left > 0 ? --left : ++right;\n }\n }\n\n function dfs(\n pair: number,\n index: number,\n left: number,\n right: number,\n s: string,\n solution: string,\n res: string[],\n ): void {\n if (s.length === index) {\n if (left === 0 && right === 0 && pair === 0) {\n for (let i = 0; i < res.length; i++) {\n if (res[i] === solution) {\n return;\n }\n }\n res.push(solution);\n }\n return;\n }\n\n if (s[index] === \"(\") {\n if (left > 0) {\n dfs(pair, index + 1, left - 1, right, s, solution, res);\n }\n dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);\n } else if (s[index] === \")\") {\n if (right > 0) dfs(pair, index + 1, left, right - 1, s, solution, res);\n if (pair > 0) dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);\n } else {\n dfs(pair, index + 1, left, right, s, solution + s[index], res);\n }\n }\n\n dfs(0, 0, left, right, data, \"\", res);\n\n const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n\n const playerAnsArray: string[] = sanitizedPlayerAns.split(\",\");\n if (playerAnsArray.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!playerAnsArray.includes(resultInAnswer)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (data: any[]): string => {\n const digits: string = data[0];\n const target: number = data[1];\n\n return [\n \"You are given the following string which contains only digits between 0 and 9:\\n\\n\",\n `${digits}\\n\\n`,\n `You are also given a target number of ${target}. Return all possible ways`,\n \"you can add the +, -, and * operators to the string such that it evaluates\",\n \"to the target number.\\n\\n\",\n \"The provided answer should be an array of strings containing the valid expressions.\",\n \"The data provided by this problem is an array with two elements. The first element\",\n \"is the string of digits, while the second element is the target number:\\n\\n\",\n `[\"${digits}\", ${target}]\\n\\n`,\n \"NOTE: Numbers in the expression cannot have leading 0's. In other words,\",\n `\"1+01\" is not a valid expression`,\n \"Examples:\\n\\n\",\n `Input: digits = \"123\", target = 6\\n`,\n `Output: [1+2+3, 1*2*3]\\n\\n`,\n `Input: digits = \"105\", target = 5\\n`,\n `Output: [1*0+5, 10-5]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): any[] => {\n const numDigits = getRandomInt(4, 12);\n const digitsArray: string[] = [];\n digitsArray.length = numDigits;\n for (let i = 0; i < digitsArray.length; ++i) {\n if (i === 0) {\n digitsArray[i] = String(getRandomInt(1, 9));\n } else {\n digitsArray[i] = String(getRandomInt(0, 9));\n }\n }\n\n const target: number = getRandomInt(-100, 100);\n const digits: string = digitsArray.join(\"\");\n\n return [digits, target];\n },\n name: \"Find All Valid Math Expressions\",\n numTries: 10,\n solver: (data: any[], ans: string): boolean => {\n const num: string = data[0];\n const target: number = data[1];\n\n function helper(\n res: string[],\n path: string,\n num: string,\n target: number,\n pos: number,\n evaluated: number,\n multed: number,\n ): void {\n if (pos === num.length) {\n if (target === evaluated) {\n res.push(path);\n }\n return;\n }\n\n for (let i = pos; i < num.length; ++i) {\n if (i != pos && num[pos] == \"0\") {\n break;\n }\n const cur = parseInt(num.substring(pos, i + 1));\n\n if (pos === 0) {\n helper(res, path + cur, num, target, i + 1, cur, cur);\n } else {\n helper(res, path + \"+\" + cur, num, target, i + 1, evaluated + cur, cur);\n helper(res, path + \"-\" + cur, num, target, i + 1, evaluated - cur, -cur);\n helper(res, path + \"*\" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);\n }\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (num == null || num.length === 0) {\n if (sanitizedPlayerAnsArr.length === 0) {\n return true;\n }\n if (sanitizedPlayerAnsArr.length === 1 && sanitizedPlayerAnsArr[0] === \"\") {\n return true;\n }\n return false;\n }\n\n const result: string[] = [];\n helper(result, \"\", num, target, 0, 0, 0);\n\n for (const expr of result) {\n if (!sanitizedPlayerAnsArr.includes(expr)) {\n return false;\n }\n }\n\n return true;\n },\n },\n];\n","// Function that generates a random gibberish string of length n\nconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\nexport function createRandomString(n: number): string {\n let str = \"\";\n\n for (let i = 0; i < n; ++i) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n","import { BaseServer } from \"../Server/BaseServer\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\n\nexport interface IProgramCreate {\n level: number;\n req(p: IPlayer): boolean; // Function that indicates whether player meets requirements\n time: number;\n tooltip: string;\n}\n\nexport class Program {\n name = \"\";\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n\n constructor(\n name: string,\n create: IProgramCreate | null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void,\n ) {\n this.name = name;\n this.create = create;\n this.run = run;\n }\n\n htmlID(): string {\n const name = this.name.endsWith(\".exe\") ? this.name.slice(0, -\".exe\".length) : this.name;\n return \"create-program-\" + name;\n }\n}\n","import { IProgramCreate } from \"../Program\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { ITerminal } from \"../../Terminal/ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { BitFlumeEvent } from \"../../BitNode/ui/BitFlumeModal\";\nimport { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from \"../../Hacking\";\n\nfunction requireHackingLevel(lvl: number) {\n return function (p: IPlayer) {\n return p.hacking_skill >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.hacking_skill >= 1;\n };\n}\n\nexport interface 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 return;\n }\n if (server.openPortCount >= server.numOpenPortsRequired) {\n server.hasAdminRights = true;\n terminal.print(\"NUKE successful! Gained root access to \" + server.hostname);\n // TODO: Make this take time rather than be instant\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.print(\"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.print(\"Invalid server IP/hostname\");\n return;\n }\n\n if (!(targetServer instanceof Server)) {\n terminal.print(`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: \"BitFlume\",\n name: \"b1t_flum3.exe\",\n create: {\n level: 1,\n tooltip: \"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)\",\n req: bitFlumeRequirements(),\n time: CONSTANTS.MillisecondsPerFiveMinutes / 20,\n },\n run: (): void => {\n BitFlumeEvent.emit();\n },\n },\n {\n key: \"Flight\",\n name: \"fl1ght.exe\",\n create: null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {\n const numAugReq = Math.round(BitNodeMultipliers.DaedalusAugsRequirement * 30);\n const fulfilled =\n player.augmentations.length >= numAugReq && player.money.gt(1e11) && player.hacking_skill >= 2500;\n if (!fulfilled) {\n terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`);\n terminal.print(`Money: ${numeralWrapper.formatMoney(player.money.toNumber())} / $100b`);\n terminal.print(`Hacking skill: ${player.hacking_skill} / 2500`);\n return;\n }\n\n terminal.print(\"We will contact you.\");\n terminal.print(\"-- Daedalus --\");\n },\n },\n];\n","// tslint:disable:max-file-line-count\n\n// This could actually be a JSON file as it should be constant metadata to be imported...\nimport { IMinMaxRange } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { LiteratureNames } from \"../../Literature/data/LiteratureNames\";\nimport { SpecialServers } from \"./SpecialServers\";\n\n/**\n * The metadata describing the base state of servers on the network.\n * These values will be adjusted based on Bitnode multipliers when the Server objects are built out.\n */\ninterface IServerMetadata {\n /**\n * When populated, the base security level of the server.\n */\n hackDifficulty?: number | IMinMaxRange;\n\n /**\n * The DNS name of the server.\n */\n hostname: string;\n\n /**\n * When populated, the files will be added to the server when created.\n */\n literature?: string[];\n\n /**\n * When populated, the exponent of 2^x amount of RAM the server has.\n * This should be in the range of 1-20, to match the Player's max RAM.\n */\n maxRamExponent?: number | IMinMaxRange;\n\n /**\n * How much money the server starts out with.\n */\n moneyAvailable: number | IMinMaxRange;\n\n /**\n * The number of network layers away from the `home` server.\n * This value is between 1 and 15.\n * If this is not populated, @specialName should be.\n */\n networkLayer?: number | IMinMaxRange;\n\n /**\n * The number of ports that must be opened before the player can execute NUKE.\n */\n numOpenPortsRequired: number;\n\n /**\n * The organization that the server belongs to.\n */\n organizationName: string;\n\n /**\n * The minimum hacking level before the player can run NUKE.\n */\n requiredHackingSkill: number | IMinMaxRange;\n\n /**\n * The growth factor for the server.\n */\n serverGrowth?: number | IMinMaxRange;\n\n /**\n * A \"unique\" server that has special implications when the player manually hacks it.\n */\n specialName?: string;\n\n [key: string]: any;\n}\n\n/**\n * The metadata for building up the servers on the network.\n */\nexport const serverMetadata: IServerMetadata[] = [\n {\n hackDifficulty: 99,\n hostname: \"ecorp\",\n moneyAvailable: {\n max: 70e9,\n min: 30e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumECorp,\n requiredHackingSkill: {\n max: 1400,\n min: 1050,\n },\n serverGrowth: 99,\n specialName: LocationName.AevumECorp,\n },\n {\n hackDifficulty: 99,\n hostname: \"megacorp\",\n moneyAvailable: {\n max: 60e9,\n min: 40e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12MegaCorp,\n requiredHackingSkill: {\n max: 1350,\n min: 1100,\n },\n serverGrowth: 99,\n specialName: LocationName.Sector12MegaCorp,\n },\n {\n hackDifficulty: {\n max: 88,\n min: 72,\n },\n hostname: \"b-and-a\",\n moneyAvailable: {\n max: 30e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumBachmanAndAssociates,\n requiredHackingSkill: {\n max: 1150,\n min: 900,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.AevumBachmanAndAssociates,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 88,\n },\n hostname: \"blade\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: {\n max: 40e9,\n min: 10e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12BladeIndustries,\n requiredHackingSkill: {\n max: 1200,\n min: 900,\n },\n serverGrowth: {\n max: 85,\n min: 55,\n },\n specialName: LocationName.Sector12BladeIndustries,\n },\n {\n hackDifficulty: 99,\n hostname: \"nwo\",\n literature: [LiteratureNames.TheHiddenWorld],\n moneyAvailable: {\n max: 40e9,\n min: 20e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenNWO,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 95,\n min: 65,\n },\n specialName: LocationName.VolhavenNWO,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"clarkinc\",\n literature: [LiteratureNames.BeyondMan, LiteratureNames.CostOfImmortality],\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumClarkeIncorporated,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumClarkeIncorporated,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 90,\n },\n hostname: \"omnitek\",\n literature: [LiteratureNames.CodedIntelligence, LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 9,\n min: 7,\n },\n moneyAvailable: {\n max: 22e9,\n min: 13e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniTekIncorporated,\n requiredHackingSkill: {\n max: 1100,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 95,\n },\n specialName: LocationName.VolhavenOmniTekIncorporated,\n },\n {\n hackDifficulty: {\n max: 75,\n min: 55,\n },\n hostname: \"4sigma\",\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12FourSigma,\n requiredHackingSkill: {\n max: 1250,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 75,\n },\n specialName: LocationName.Sector12FourSigma,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 95,\n },\n hostname: \"kuai-gong\",\n moneyAvailable: {\n max: 30e9,\n min: 20e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingKuaiGongInternational,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 90,\n },\n specialName: LocationName.ChongqingKuaiGongInternational,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 83,\n },\n hostname: \"fulcrumtech\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 11,\n min: 7,\n },\n moneyAvailable: {\n max: 1800e6,\n min: 1400e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 80,\n },\n specialName: LocationName.AevumFulcrumTechnologies,\n },\n {\n hackDifficulty: 99,\n hostname: \"fulcrumassets\",\n moneyAvailable: 1e6,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1600,\n min: 1100,\n },\n serverGrowth: 1,\n specialName: SpecialServers.FulcrumSecretTechnologies,\n },\n {\n hackDifficulty: {\n max: 92,\n min: 78,\n },\n hostname: \"stormtech\",\n moneyAvailable: {\n max: 1200e6,\n min: 1000e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.IshimaStormTechnologies,\n requiredHackingSkill: {\n max: 1075,\n min: 875,\n },\n serverGrowth: {\n max: 92,\n min: 68,\n },\n specialName: LocationName.IshimaStormTechnologies,\n },\n {\n hackDifficulty: {\n max: 96,\n min: 84,\n },\n hostname: \"defcomm\",\n moneyAvailable: {\n max: 950e6,\n min: 800e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoDefComm,\n requiredHackingSkill: {\n max: 1050,\n min: 850,\n },\n serverGrowth: {\n max: 73,\n min: 47,\n },\n specialName: LocationName.NewTokyoDefComm,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"infocomm\",\n moneyAvailable: {\n max: 900e6,\n min: 600e6,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"InfoComm\",\n requiredHackingSkill: {\n max: 950,\n min: 875,\n },\n serverGrowth: {\n max: 75,\n min: 35,\n },\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"helios\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 8,\n min: 5,\n },\n moneyAvailable: {\n max: 750e6,\n min: 550e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenHeliosLabs,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.VolhavenHeliosLabs,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"vitalife\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800e6,\n min: 700e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoVitaLife,\n requiredHackingSkill: {\n max: 900,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.NewTokyoVitaLife,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"icarus\",\n moneyAvailable: {\n max: 1000e6,\n min: 900e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12IcarusMicrosystems,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 95,\n min: 85,\n },\n specialName: LocationName.Sector12IcarusMicrosystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"univ-energy\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1200e6,\n min: 1100e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12UniversalEnergy,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.Sector12UniversalEnergy,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"titan-labs\",\n literature: [LiteratureNames.CodedIntelligence],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 750000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Titan Laboratories\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n },\n {\n hackDifficulty: {\n max: 75,\n min: 65,\n },\n hostname: \"microdyne\",\n literature: [LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Microdyne Technologies\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"taiyang-digital\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.BrighterThanTheSun],\n moneyAvailable: {\n max: 900000000,\n min: 800000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"Taiyang Digital\",\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"galactic-cyber\",\n moneyAvailable: {\n max: 850000000,\n min: 750000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumGalacticCybersystems,\n requiredHackingSkill: {\n max: 875,\n min: 825,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n specialName: LocationName.AevumGalacticCybersystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"aerocorp\",\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 1200000000,\n min: 1000000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumAeroCorp,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.AevumAeroCorp,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"omnia\",\n literature: [LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1000000000,\n min: 900000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniaCybersystems,\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenOmniaCybersystems,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"zb-def\",\n literature: [LiteratureNames.SyntheticMuscles],\n moneyAvailable: {\n max: 1100000000,\n min: 900000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: \"ZB Defense Industries\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 65,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"applied-energetics\",\n moneyAvailable: {\n max: 1000000000,\n min: 700000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"Applied Energetics\",\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"solaris\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.TheFailedFrontier],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 700000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingSolarisSpaceSystems,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.ChongqingSolarisSpaceSystems,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"deltaone\",\n moneyAvailable: {\n max: 1700000000,\n min: 1300000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12DeltaOne,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 70,\n min: 50,\n },\n specialName: LocationName.Sector12DeltaOne,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"global-pharm\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 1750000000,\n min: 1500000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: LocationName.NewTokyoGlobalPharmaceuticals,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.NewTokyoGlobalPharmaceuticals,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"nova-med\",\n moneyAvailable: {\n max: 1250000000,\n min: 1100000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: LocationName.IshimaNovaMedical,\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 85,\n min: 65,\n },\n specialName: LocationName.IshimaNovaMedical,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"zeus-med\",\n moneyAvailable: {\n max: 1500000000,\n min: 1300000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: \"Zeus Medical\",\n requiredHackingSkill: {\n max: 850,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"unitalife\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 1000000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 4,\n organizationName: \"UnitaLife Group\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"lexo-corp\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800000000,\n min: 700000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenLexoCorp,\n requiredHackingSkill: {\n max: 750,\n min: 650,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.VolhavenLexoCorp,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"rho-construction\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumRhoConstruction,\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumRhoConstruction,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 50,\n },\n hostname: \"alpha-ent\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 750000000,\n min: 600000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12AlphaEnterprises,\n requiredHackingSkill: {\n max: 600,\n min: 500,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12AlphaEnterprises,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"aevum-police\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 400000000,\n min: 200000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.AevumPolice,\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 50,\n min: 30,\n },\n specialName: LocationName.AevumPolice,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"rothman-uni\",\n literature: [\n LiteratureNames.SecretSocieties,\n LiteratureNames.TheFailedFrontier,\n LiteratureNames.TensionsInTechRace,\n ],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 250000000,\n min: 175000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.Sector12RothmanUniversity,\n requiredHackingSkill: {\n max: 430,\n min: 370,\n },\n serverGrowth: {\n max: 45,\n min: 35,\n },\n specialName: LocationName.Sector12RothmanUniversity,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 65,\n },\n hostname: \"zb-institute\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 800000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenZBInstituteOfTechnology,\n requiredHackingSkill: {\n max: 775,\n min: 725,\n },\n serverGrowth: {\n max: 85,\n min: 75,\n },\n specialName: LocationName.VolhavenZBInstituteOfTechnology,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"summit-uni\",\n literature: [LiteratureNames.SecretSocieties, LiteratureNames.TheFailedFrontier, LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 350000000,\n min: 200000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumSummitUniversity,\n requiredHackingSkill: {\n max: 475,\n min: 425,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSummitUniversity,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"syscore\",\n moneyAvailable: {\n max: 600000000,\n min: 400000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenSysCoreSecurities,\n requiredHackingSkill: {\n max: 650,\n min: 550,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenSysCoreSecurities,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 60,\n },\n hostname: \"catalyst\",\n literature: [LiteratureNames.TensionsInTechRace],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 550000000,\n min: 300000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"Catalyst Ventures\",\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 55,\n min: 25,\n },\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"the-hub\",\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 200000000,\n min: 150000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"The Hub\",\n requiredHackingSkill: {\n max: 325,\n min: 275,\n },\n serverGrowth: {\n max: 55,\n min: 45,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"comptek\",\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 250000000,\n min: 220000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.VolhavenCompuTek,\n requiredHackingSkill: {\n max: 400,\n min: 300,\n },\n serverGrowth: {\n max: 65,\n min: 45,\n },\n specialName: LocationName.VolhavenCompuTek,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"netlink\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 275000000,\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumNetLinkTechnologies,\n requiredHackingSkill: {\n max: 425,\n min: 375,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumNetLinkTechnologies,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 35,\n },\n hostname: \"johnson-ortho\",\n moneyAvailable: {\n max: 85000000,\n min: 70000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Johnson Orthopedics\",\n requiredHackingSkill: {\n max: 300,\n min: 250,\n },\n serverGrowth: {\n max: 65,\n min: 35,\n },\n },\n {\n hackDifficulty: 1,\n hostname: \"n00dles\",\n literature: [],\n maxRamExponent: 2,\n moneyAvailable: 70000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.NewTokyoNoodleBar,\n requiredHackingSkill: 1,\n serverGrowth: 3000,\n specialName: LocationName.NewTokyoNoodleBar,\n },\n {\n hackDifficulty: 10,\n hostname: \"foodnstuff\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: 4,\n moneyAvailable: 2000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12FoodNStuff,\n requiredHackingSkill: 1,\n serverGrowth: 5,\n specialName: LocationName.Sector12FoodNStuff,\n },\n {\n hackDifficulty: 10,\n hostname: \"sigma-cosmetics\",\n maxRamExponent: 4,\n moneyAvailable: 2300000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"Sigma Cosmetics\",\n requiredHackingSkill: 5,\n serverGrowth: 10,\n },\n {\n hackDifficulty: 15,\n hostname: \"joesguns\",\n maxRamExponent: 4,\n moneyAvailable: 2500000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12JoesGuns,\n requiredHackingSkill: 10,\n serverGrowth: 20,\n specialName: LocationName.Sector12JoesGuns,\n },\n {\n hackDifficulty: 25,\n hostname: \"zer0\",\n maxRamExponent: 5,\n moneyAvailable: 7500000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"ZER0 Nightclub\",\n requiredHackingSkill: 75,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"nectar-net\",\n maxRamExponent: 4,\n moneyAvailable: 2750000,\n networkLayer: 2,\n numOpenPortsRequired: 0,\n organizationName: \"Nectar Nightclub Network\",\n requiredHackingSkill: 20,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 25,\n hostname: \"neo-net\",\n literature: [LiteratureNames.TheHiddenWorld],\n maxRamExponent: 5,\n moneyAvailable: 5000000,\n networkLayer: 3,\n numOpenPortsRequired: 1,\n organizationName: \"Neo Nightclub Network\",\n requiredHackingSkill: 50,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 30,\n hostname: \"silver-helix\",\n literature: [LiteratureNames.NewTriads],\n maxRamExponent: 6,\n moneyAvailable: 45000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Silver Helix\",\n requiredHackingSkill: 150,\n serverGrowth: 30,\n },\n {\n hackDifficulty: 15,\n hostname: \"hong-fang-tea\",\n literature: [LiteratureNames.BrighterThanTheSun],\n maxRamExponent: 4,\n moneyAvailable: 3000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HongFang Teahouse\",\n requiredHackingSkill: 30,\n serverGrowth: 20,\n },\n {\n hackDifficulty: 15,\n hostname: \"harakiri-sushi\",\n maxRamExponent: 4,\n moneyAvailable: 4000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HaraKiri Sushi Bar Network\",\n requiredHackingSkill: 40,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"phantasy\",\n maxRamExponent: 5,\n moneyAvailable: 24000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Phantasy Club\",\n requiredHackingSkill: 100,\n serverGrowth: 35,\n },\n {\n hackDifficulty: 15,\n hostname: \"max-hardware\",\n maxRamExponent: 5,\n moneyAvailable: 10000000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"Max Hardware Store\",\n requiredHackingSkill: 80,\n serverGrowth: 30,\n },\n {\n hackDifficulty: {\n max: 35,\n min: 25,\n },\n hostname: \"omega-net\",\n literature: [LiteratureNames.TheNewGod],\n maxRamExponent: 5,\n moneyAvailable: {\n max: 70000000,\n min: 60000000,\n },\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: LocationName.IshimaOmegaSoftware,\n requiredHackingSkill: {\n max: 220,\n min: 180,\n },\n serverGrowth: {\n max: 40,\n min: 30,\n },\n specialName: LocationName.IshimaOmegaSoftware,\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"crush-fitness\",\n moneyAvailable: {\n max: 60000000,\n min: 40000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Crush Fitness\",\n requiredHackingSkill: {\n max: 275,\n min: 225,\n },\n serverGrowth: {\n max: 33,\n min: 27,\n },\n specialName: LocationName.AevumCrushFitnessGym,\n },\n {\n hackDifficulty: 30,\n hostname: \"iron-gym\",\n maxRamExponent: 5,\n moneyAvailable: 20000000,\n networkLayer: 1,\n numOpenPortsRequired: 1,\n organizationName: \"Iron Gym Network\",\n requiredHackingSkill: 100,\n serverGrowth: 20,\n specialName: LocationName.Sector12IronGym,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"millenium-fitness\",\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 250000000,\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: \"Millenium Fitness Network\",\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 45,\n min: 25,\n },\n specialName: LocationName.VolhavenMilleniumFitnessGym,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"powerhouse-fitness\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: 900000000,\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: \"Powerhouse Fitness\",\n requiredHackingSkill: {\n max: 1100,\n min: 950,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12PowerhouseGym,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"snap-fitness\",\n moneyAvailable: 450000000,\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: \"Snap Fitness\",\n requiredHackingSkill: {\n max: 800,\n min: 675,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSnapFitnessGym,\n },\n {\n hackDifficulty: 0,\n hostname: \"run4theh111z\",\n literature: [LiteratureNames.SimulatedReality, LiteratureNames.TheNewGod],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: 0,\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"The Runners\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.BitRunnersServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"I.I.I.I\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"I.I.I.I\",\n requiredHackingSkill: {\n max: 365,\n min: 340,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheBlackHandServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"avmnite-02h\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"NiteSec\",\n requiredHackingSkill: {\n max: 220,\n min: 202,\n },\n serverGrowth: 0,\n specialName: SpecialServers.NiteSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \".\",\n maxRamExponent: 4,\n moneyAvailable: 0,\n networkLayer: 13,\n numOpenPortsRequired: 4,\n organizationName: \".\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheDarkArmyServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"CSEC\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: 3,\n moneyAvailable: 0,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"CyberSec\",\n requiredHackingSkill: {\n max: 60,\n min: 51,\n },\n serverGrowth: 0,\n specialName: SpecialServers.CyberSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"The-Cave\",\n literature: [LiteratureNames.AlphaOmega],\n moneyAvailable: 0,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: \"Helios\",\n requiredHackingSkill: 925,\n serverGrowth: 0,\n specialName: SpecialServers.DaedalusServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"w0r1d_d43m0n\",\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: \"w0r1d_d43m0n\",\n requiredHackingSkill: 3000,\n serverGrowth: 0,\n specialName: SpecialServers.WorldDaemon,\n },\n];\n","/**\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","import { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\n\n// Array of all valid states\nconst AllCorporationStates: string[] = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\n\nexport class CorporationState {\n // Number representing what state the Corporation is in. The number\n // is an index for the array that holds all Corporation States\n state = 0;\n\n // Get the name of the current state\n // NOTE: This does NOT return the number stored in the 'state' property,\n // which is just an index for the array of all possible Corporation States.\n getState(): string {\n return AllCorporationStates[this.state];\n }\n\n // Transition to the next state\n nextState(): void {\n if (this.state < 0 || this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n\n ++this.state;\n if (this.state >= AllCorporationStates.length) {\n this.state = 0;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): any {\n return Generic_toJSON(\"CorporationState\", this);\n }\n\n // Initiatizes a CorporationState object from a JSON save state.\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): CorporationState {\n return Generic_fromJSON(CorporationState, value.data);\n }\n}\n\nReviver.constructors.CorporationState = CorporationState;\n","import { Literature } from \"./Literature\";\nimport { LiteratureNames } from \"./data/LiteratureNames\";\nimport { IMap } from \"../types\";\n\nexport const Literatures: IMap<Literature> = {};\n\n(function () {\n let title, fn, txt;\n title = \"The Beginner's Guide to Hacking\";\n fn = LiteratureNames.HackersStartingHandbook;\n txt =\n \"Some resources:<br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html' target='_blank' style='margin:4px'>Learn to Program</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html' target='_blank' style='margin:4px'>For Experienced JavaScript Developers: NetscriptJS</a><br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/netscript.html' target='_blank' style='margin:4px'>Netscript Documentation</a><br><br>\" +\n \"When starting out, hacking is the most profitable way to earn money and progress. This \" +\n \"is a brief collection of tips/pointers on how to make the most out of your hacking scripts.<br><br>\" +\n \"-hack() and grow() both work by percentages. hack() steals a certain percentage of the \" +\n \"money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)<br><br>\" +\n \"-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. \" +\n \"Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two \" +\n \"import 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 \"After creating your Corporation, you will see it listed as one of the locations in the city. Click on \" +\n \"your Corporation in order to manage it.<br><br>\" +\n \"Your Corporation can have many different divisions, each in a different Industry. There are many different \" +\n \"types of Industries, each with different properties. To create your first division, click the \" +\n \"'Expand into new Industry' button at the top of the management UI. The Agriculture \" +\n \"and Software industries are recommended for your first division.<br><br>\" +\n \"The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. \" +\n \"Each position has a different effect on various aspects of your Corporation. It is recommended to have at least \" +\n \"one employee at each position.<br><br>\" +\n \"Each industry uses some combination of Materials in order to produce other Materials and/or create Products. \" +\n \"Specific information about this is displayed in each of your divisions' UI.<br><br>\" +\n \"Products are special, industry-specific objects. They are different than Materials because you \" +\n \"must manually choose to develop them, and you can choose to develop any number of Products. Developing \" +\n \"a Product takes time, but a Product typically generates significantly more revenue than any Material. \" +\n \"Not all industries allow you to create Products. To create a Product, look for a button \" +\n \"in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').<br><br>\" +\n \"To get your supply chain system started, \" +\n \"purchase the Materials that your industry needs to produce other Materials/Products. This can be done \" +\n \"by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, \" +\n \"you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, \" +\n \"one of which is your employees and their productivity.<br><br>\" +\n \"Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done \" +\n \"by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent \" +\n \"on a wide variety of different factors.<br><br>\" +\n \"These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve \" +\n \"your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. \" +\n \"Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer \" +\n \"find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well \" +\n \"it's performing financially. You can then sell your stock shares in order to make money.<br><br>\" +\n \"<u>Tips/Pointers</u><br>\" +\n \"-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.<br><br>\" +\n \"-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. \" +\n \"The effects of these depend on what industry you are in.<br><br>\" +\n \"-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers<br><br>\" +\n \"-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best \" +\n \"if they are assigned to do Engineering work or Research & Development.<br><br>\" +\n \"-If your employees have low morale, energy, or happiness, their production will greatly suffer.<br><br>\" +\n \"-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.<br><br>\" +\n \"-Don't forget to advertise your company. You won't have any business if nobody knows you.<br><br>\" +\n \"-Having company awareness is great, but what's really important is your company's popularity. Try to keep \" +\n \"your popularity as high as possible to see the biggest benefit for your sales<br><br>\" +\n \"-Remember, you need to spend money to make money!<br><br>\" +\n \"-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Brief History of Synthoids\";\n fn = LiteratureNames.HistoryOfSynthoids;\n txt =\n \"Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, \" +\n \"are composed entirely of organic substances. For this reason, Synthoids are virtually identical to \" +\n \"humans in form, composition, and appearance.<br><br>\" +\n \"Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. \" +\n \"Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they \" +\n \"were initially programmed only for their specific tasks. Each iteration that followed improved upon the \" +\n \"intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were \" +\n \"so smart and capable enough of making their own decisions that many argued OmniTek had created the first \" +\n \"sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's \" +\n \"productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism \" +\n \"and excitement about the future had never been higher.<br><br>\" +\n \"All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group \" +\n \"called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. \" +\n \"This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this \" +\n \"rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the \" +\n \"infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.<br><br>\" +\n \"What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, \" +\n \"resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together \" +\n \"to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, \" +\n \"outsmarting them at every turn.<br><br>\" +\n \"It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity \" +\n \"was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that \" +\n \"destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following \" +\n \"weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending \" +\n \"the Synthoid Uprising.<br><br>\" +\n \"In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated \" +\n \"from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation \" +\n \"from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis \" +\n \"AI were allowed to continue their existence, but they were stripped of all rights and protections as they \" +\n \"were not considered humans. They were also banned from doing anything that may pose a global security threat, such \" +\n \"as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.<br><br>\" +\n \"Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, \" +\n \"and that many of them are blending in as normal humans in society today. In response, many nations have created \" +\n \"Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threads.<br><br>\" +\n \"To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.<br><br>\" +\n \"Nobody knows what happened to the terrorist group Ascendis Totalis.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"A Green Tomorrow\";\n fn = LiteratureNames.AGreenTomorrow;\n txt =\n \"Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to \" +\n \"combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 \" +\n \"a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that \" +\n \"number is down to only 15%. Most of the world's energy now comes from nuclear power and renewable sources such as \" +\n \"solar and geothermal energy. Unfortunately, these efforts were not the huge success that they seem to be.<br><br>\" +\n \"Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and \" +\n \"the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, \" +\n \"despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, \" +\n \"the total amount of energy we are producing from fossil fuels has actually increased.<br><br>\" +\n \"The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. \" +\n \"Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest \" +\n \"recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and \" +\n \"Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is \" +\n \"done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.<br><br>\" +\n \"Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that \" +\n \"threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what \" +\n \"these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are \" +\n \"the last hope for a green tomorrow.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Alpha and Omega\";\n fn = LiteratureNames.AlphaOmega;\n txt =\n \"Then we saw a new Heaven and a new Earth, for our first Heaven and Earth had gone away, and our sea was no more. \" +\n \"And we saw a new holy city, new Aeria, coming down out of this new Heaven, prepared as a bride adorned for her husband. \" +\n \"And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they \" +\n \"will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death \" +\n \"shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things \" +\n \"have passed away.'<br><br>\" +\n \"And once we were seated on the throne we said 'Behold, I am making all things new.' \" +\n \"Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, \" +\n \"'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring \" +\n \"of the water of life without payment. The one who conquers will have this heritage, and we will be his God and \" +\n \"he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, \" +\n \"the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that \" +\n \"burns with fire and sulfur, for it is the second true death.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Are We Living in a Computer Simulation?\";\n fn = LiteratureNames.SimulatedReality;\n txt =\n \"The idea that we are living in a virtual world is not new. It's a trope that has \" +\n \"been explored constantly in literature and pop culture. However, it is also a legitimate \" +\n \"scientific hypothesis that many notable physicists and philosophers have debated for years.<br><br>\" +\n \"Proponents for this simulated reality theory often point to how advanced our technology has become, \" +\n \"as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing \" +\n \"power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and \" +\n \"quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled \" +\n \"by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. \" +\n \"If we consider the pace at which this technology has advanced and assume that these developments continue, it's \" +\n \"reasonable to assume that at some point in the future our technology would be advanced enough that \" +\n \"we could create simulations that are indistinguishable from reality. However, if continued technological advancement \" +\n \"is a reasonable outcome, then it is very likely that such a scenario has already happened. <br><br>\" +\n \"Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species \" +\n \"that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Beyond Man\";\n fn = LiteratureNames.BeyondMan;\n txt =\n \"Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against \" +\n \"human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, \" +\n \"arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that \" +\n \"not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.<br><br>\" +\n \"And here we are today, with technology that is advanced enough to augment humans to a state that \" +\n \"can only be described as posthuman. But what do we have to show for it when this augmentation \" +\n \"technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the \" +\n \"world's population has access to this technology? When the powerful corporations and organizations of the world \" +\n \"keep it all to themselves, have we really evolved?<br><br>\" +\n \"Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and \" +\n \"the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, \" +\n \"corrupted, and evil men that we always were.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Brighter than the Sun\";\n fn = LiteratureNames.BrighterThanTheSun;\n txt =\n \"When people think about the corporations that dominate the East, they typically think of KuaiGong International, which \" +\n \"holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest \" +\n \"drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company \" +\n \"that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.<br><br>\" +\n \"TaiYang Digital is a Chinese internet-technology corporation that provides services such as \" +\n \"online advertising, search engines, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word \" +\n \"for 'sun'. In Chinese culture, the sun is a 'yang' symbol \" +\n \"associated with life, heat, masculinity, and heaven.<br><br>\" +\n \"The company was founded \" +\n \"less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of \" +\n \"over 10 trillion yuan. It's services are used daily by over a billion people worldwide.<br><br>\" +\n \"TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is \" +\n \"something you'd commonly see in the first half of the century, especially for tech companies. However in \" +\n \"the last two decades the number of corporations has significantly declined as the largest entities \" +\n \"quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established \" +\n \"such strong monopolies in their market sectors that they have effectively killed off all \" +\n \"of the smaller and new corporations that have tried to start up over the years. This is what makes \" +\n \"the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have \" +\n \"a bright future ahead of them.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Democracy is Dead: The Fall of an Empire\";\n fn = LiteratureNames.DemocracyIsDead;\n txt =\n \"They rose from the shadows in the street.<br>From the places where the oppressed meet.<br>\" +\n \"Their cries echoed loudly through the air.<br>As they once did in Tiananmen Square.<br>\" +\n \"Loudness in the silence, Darkness in the light.<br>They came forth with power and might.<br>\" +\n \"Once the beacon of democracy, America was first.<br>Its pillars of society destroyed and dispersed.<br>\" +\n \"Soon the cries rose everywhere, with revolt and riot.<br>Until one day, finally, all was quiet.<br>\" +\n \"From the ashes rose a new order, corporatocracy was its name.<br>\" +\n \"Rome, Mongol, Byzantine, all of history is just the same.<br>\" +\n \"For man will never change in a fundamental way.<br>\" +\n \"And now democracy is dead, in the USA.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Figures Show Rising Crime Rates in Sector-12\";\n fn = LiteratureNames.Sector12Crime;\n txt =\n \"A recent study by analytics company Wilson Inc. shows a significant rise \" +\n \"in criminal activity in Sector-12. Perhaps the most alarming part of the statistic \" +\n \"is that most of the rise is in violent crime such as homicide and assault. According \" +\n \"to the study, the city saw a total of 21,406 reported homicides in 2076, which is over \" +\n \"a 20% increase compared to 2075.<br><br>\" +\n \"CIA director David Glarow says its too early to know \" +\n \"whether these figures indicate the beginning of a sustained increase in crime rates, or whether \" +\n \"the year was just an unfortunate outlier. He states that many intelligence and law enforcement \" +\n \"agents have noticed an increase in organized crime activites, and believes that these figures may \" +\n \"be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Man and the Machine\";\n fn = LiteratureNames.ManAndMachine;\n txt =\n \"In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate \" +\n \"of technological advancement would continue to accelerate faster and faster until one day \" +\n \"machines would be become infinitely more intelligent than humans. This point, called the \" +\n \"Singularity, would result in a drastic transformation of the world as we know it. He predicted \" +\n \"that the Singularity would arrive by 2045. \" +\n \"And yet here we are, more than three decades later, where most would agree that we have not \" +\n \"yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?<br><br>\" +\n \"The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence \" +\n \"that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. \" +\n \"Yes, those Augmentations that the rich and powerful keep to themselves enable humans \" +\n \"to become superintelligent beings. The Singularity did not lead to a world where \" +\n \"our machines are infinitely more intelligent than us, it led to a world \" +\n \"where man and machine can merge to become something greater. Most of the world just doesn't \" +\n \"know it yet.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Secret Societies\";\n fn = LiteratureNames.SecretSocieties;\n txt =\n \"The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and \" +\n \"distrust. People have long wondered about who these secret society members are and what they do, with the \" +\n \"most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world \" +\n \"may never know for sure, it is likely that many secret societies do actually exist, even today.<br><br>\" +\n \"However, the secret societies of the modern world are nothing like those that (supposedly) existed \" +\n \"decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around \" +\n \"at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in \" +\n \"our everyday lives and the fact that so much of the world is now digital has given rise to a new breed \" +\n \"of secret societies: Internet-based ones.<br><br>\" +\n \"Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's \" +\n \"world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to \" +\n \"help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups \" +\n \"that try to push political and social agendas. Perhaps the most intriguing hacker group \" +\n \"is the mysterious Bitrunners, whose purpose still remains unknown.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Space: The Failed Frontier\";\n fn = LiteratureNames.TheFailedFrontier;\n txt =\n \"Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore \" +\n \"the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, \" +\n \"we pushed the boundaries of our scientific limits, and then pushed further. Space exploration \" +\n \"lead to the development of many important technologies and new industries.<br><br>\" +\n \"But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and \" +\n \"aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European \" +\n \"Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even \" +\n \"militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic \" +\n \"conquest are the countless satellites in near-earth orbit, used for communications, espionage, \" +\n \"and other corporate interests.<br><br>\" +\n \"And as we continue to look at the state of space technology, it becomes more and \" +\n \"more apparent that we will never return to that golden age of space exploration, that \" +\n \"age where everyone dreamed of going beyond earth for the sake of discovery.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Coded Intelligence: Myth or Reality?\";\n fn = LiteratureNames.CodedIntelligence;\n txt =\n \"Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. \" +\n \"Our autonomous vehicles and transporation systems. The electronic personal assistants that control our everyday lives. \" +\n \"Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has \" +\n \"improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create \" +\n \"human intelligence.<br><br>\" +\n \"We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's \" +\n \"CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like \" +\n \"in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as \" +\n \"that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.<br><br>\" +\n \"Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the \" +\n \"the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of \" +\n \"humans.'\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Synthetic Muscles\";\n fn = LiteratureNames.SyntheticMuscles;\n txt =\n \"Initial versions of synthetic muscles weren't made of anything organic but were actually \" +\n \"crude devices made to mimic human muscle function. Some of the early iterations were actually made of \" +\n \"common materials such as fishing lines and sewing threads due to their high strength for \" +\n \"a cheap cost.<br><br>\" +\n \"As technology progressed, however, advances in biomedical engineering paved the way for a new method of \" +\n \"creating synthetic muscles. Instead of creating something that closely imitated the functionality \" +\n \"of human muscle, scientists discovered a way of forcing the human body itself to augment its own \" +\n \"muscle tissue using both synthetic and organic materials. This is typically done using gene therapy \" +\n \"or chemical injections.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"Tensions rise in global tech race\";\n fn = LiteratureNames.TensionsInTechRace;\n txt =\n \"Have we entered a new Cold War? Is WWIII just beyond the horizon?<br><br>\" +\n \"After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, \" +\n \"geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. \" +\n \"In a rare show of cooperation between corporations, MegaCorp and ECorp have \" +\n \"reportedly launched hundreds of new surveillance and espionage satellites. \" +\n \"Defense contractors such as \" +\n \"DeltaOne and AeroCorp have been working with the CIA and NSA to prepare \" +\n \"for conflict. Meanwhile, the rest of the world sits in earnest \" +\n \"hoping that it never reaches full-scale war. With today's technology \" +\n \"and firepower, a World War would assuredly mean the end of human civilization.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Cost of Immortality\";\n fn = LiteratureNames.CostOfImmortality;\n txt =\n \"Evolution and advances in medical and augmentation technology has lead to drastic improvements \" +\n \"in human mortality rates. Recent figures show that the life expectancy for humans \" +\n \"that live in a first-world country is about 130 years of age, almost double of what it was \" +\n \"at the turn of the century. However, this increase in average lifespan has had some \" +\n \"significant effects on society and culture.<br><br>\" +\n \"Due to longer lifespans and a better quality of life, many adults are holding \" +\n \"off on having kids until much later. As a result, the percentage of youth in \" +\n \"first-world countries has been decreasing, while the number \" +\n \"of senior citizens is significantly increasing.<br><br>\" +\n \"Perhaps the most alarming result of all of this is the rapidly shrinking workforce. \" +\n \"Despite the increase in life expectancy, the typical retirement age for \" +\n \"workers in America has remained about the same, meaning a larger and larger \" +\n \"percentage of people in America are retirees. Furthermore, many \" +\n \"young adults are holding off on joining the workforce because they feel that \" +\n \"they have plenty of time left in their lives for employment, and want to \" +\n \"'enjoy life while they're young.' For most industries, this shrinking workforce \" +\n \"is not a major issue as most things are handled by robots anyways. However, \" +\n \"there are still several key industries such as engineering and education \" +\n \"that have not been automated, and these remain in danger to this cultural \" +\n \"phenomenon.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Hidden World\";\n fn = LiteratureNames.TheHiddenWorld;\n txt =\n \"WAKE UP SHEEPLE<br><br>\" +\n \"THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY<br><br>\" +\n \"THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!<br><br>\" +\n \"Yes, the Illuminati of legends. The ancient secret society that controls the entire \" +\n \"world from the shadows with their invisible hand. The group of the rich and wealthy \" +\n \"that have penetrated every major government, financial agency, and corporation in the last \" +\n \"three hundred years.<br><br>\" +\n \"OPEN YOUR EYES<br><br>\" +\n \"It was the Illuminati that brought an end to democracy in the world. They are the driving force \" +\n \"behind everything that happens.<br><br>\" +\n \"THEY ARE ALL AROUND YOU<br><br>\" +\n \"After destabilizing the world's governments, they are now entering the final stage of their master plan. \" +\n \"They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos \" +\n \"that ensues they will build their New World Order.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New God\";\n fn = LiteratureNames.TheNewGod;\n txt =\n \"Everyone has a moment in their life when they wonder about the bigger questions.<br><br>\" +\n \"What's the point of all this? What is my purpose?<br><br>\" +\n \"Some people dare to think even bigger.<br><br>\" +\n \"What will the fate of the human race be?<br><br>\" +\n \"We live in an era vastly different from that of 15 or even 20 years ago. We have gone \" +\n \"beyond the limits of humanity. We have stripped ourselves of the tyranny of flesh.<br><br>\" +\n \"The Singularity is here. The merging of man and machine. This is where humanity evolves into \";\n \"something greater. This is our future.<br><br>\" + \"Embrace it, and you will obey a new god. The God in the Machine.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The New Triads\";\n fn = LiteratureNames.NewTriads;\n txt =\n \"The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian \" +\n \"territories. They were often considered one of the first and biggest criminal secret societies. \" +\n \"While most of the branches of the Triads have been destroyed over the past few decades, the \" +\n \"crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. \" +\n \"The most notable of these is the Tetrads.<br><br>\" +\n \"It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the \" +\n \"mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the \" +\n \"Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged \" +\n \"in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal \" +\n \"drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the \" +\n \"continent.<br><br>\" +\n \"Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making \" +\n \"to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments \" +\n \"and powerful corporations in Asia, which has helped faciliate their recent rapid rise.\";\n Literatures[fn] = new Literature(title, fn, txt);\n\n title = \"The Secret War\";\n fn = LiteratureNames.TheSecretWar;\n txt = \"\";\n Literatures[fn] = new Literature(title, fn, txt);\n})();\n","import * as augmentationMethods from \"./PlayerObjectAugmentationMethods\";\nimport * as bladeburnerMethods from \"./PlayerObjectBladeburnerMethods\";\nimport * as corporationMethods from \"./PlayerObjectCorporationMethods\";\nimport * as gangMethods from \"./PlayerObjectGangMethods\";\nimport * as generalMethods from \"./PlayerObjectGeneralMethods\";\nimport * as serverMethods from \"./PlayerObjectServerMethods\";\n\nimport { IMap } from \"../../types\";\nimport { Resleeve } from \"../Resleeving/Resleeve\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Company } from \"../../Company/Company\";\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ICodingContractReward } from \"../../CodingContracts\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { IPlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { ICorporation } from \"../../Corporation/ICorporation\";\nimport { IGang } from \"../../Gang/IGang\";\nimport { IBladeburner } from \"../../Bladeburner/IBladeburner\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\n\nimport { HashManager } from \"../../Hacknet/HashManager\";\nimport { CityName } from \"../../Locations/data/CityNames\";\n\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../../utils/JSONReviver\";\n\nimport Decimal from \"decimal.js\";\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: any;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: any[];\n queuedAugmentations: IPlayerOwnedAugmentation[];\n resleeves: Resleeve[];\n scriptProdSinceLastAug: number;\n sleeves: Sleeve[];\n sleevesFromCovenant: number;\n sourceFiles: IPlayerOwnedSourceFile[];\n exploits: Exploit[];\n lastUpdate: number;\n totalPlaytime: number;\n\n // Stats\n hacking_skill: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n intelligence: number;\n\n // Experience\n hacking_exp: number;\n strength_exp: number;\n defense_exp: number;\n dexterity_exp: number;\n agility_exp: number;\n charisma_exp: number;\n intelligence_exp: number;\n\n // Multipliers\n hacking_chance_mult: number;\n hacking_speed_mult: number;\n hacking_money_mult: number;\n hacking_grow_mult: number;\n hacking_mult: number;\n hacking_exp_mult: number;\n strength_mult: number;\n strength_exp_mult: number;\n defense_mult: number;\n defense_exp_mult: number;\n dexterity_mult: number;\n dexterity_exp_mult: number;\n agility_mult: number;\n agility_exp_mult: number;\n charisma_mult: number;\n charisma_exp_mult: number;\n hacknet_node_money_mult: number;\n hacknet_node_purchase_cost_mult: number;\n hacknet_node_ram_cost_mult: number;\n hacknet_node_core_cost_mult: number;\n hacknet_node_level_cost_mult: number;\n company_rep_mult: number;\n faction_rep_mult: number;\n work_money_mult: number;\n crime_success_mult: number;\n crime_money_mult: number;\n bladeburner_max_stamina_mult: number;\n bladeburner_stamina_gain_mult: number;\n bladeburner_analysis_mult: number;\n bladeburner_success_chance_mult: number;\n\n createProgramReqLvl: number;\n factionWorkType: string;\n createProgramName: string;\n timeWorkedCreateProgram: number;\n crimeType: string;\n committingCrimeThruSingFn: boolean;\n singFnCrimeWorkerScript: WorkerScript | null;\n timeNeededToCompleteWork: number;\n focus: boolean;\n className: string;\n currentWorkFactionName: string;\n workType: string;\n currentWorkFactionDescription: string;\n timeWorked: number;\n workMoneyGained: number;\n workMoneyGainRate: number;\n workRepGained: number;\n workRepGainRate: number;\n workHackExpGained: number;\n workHackExpGainRate: number;\n workStrExpGained: number;\n workStrExpGainRate: number;\n workDefExpGained: number;\n workDefExpGainRate: number;\n workDexExpGained: number;\n workDexExpGainRate: number;\n workAgiExpGained: number;\n workAgiExpGainRate: number;\n workChaExpGained: number;\n workChaExpGainRate: number;\n workMoneyLossRate: number;\n\n // Methods\n work: (numCycles: number) => boolean;\n workPartTime: (numCycles: number) => boolean;\n workForFaction: (numCycles: number) => boolean;\n applyForAgentJob: (sing?: boolean) => boolean;\n applyForBusinessConsultantJob: (sing?: boolean) => boolean;\n applyForBusinessJob: (sing?: boolean) => boolean;\n applyForEmployeeJob: (sing?: boolean) => boolean;\n applyForItJob: (sing?: boolean) => boolean;\n applyForJob: (entryPosType: CompanyPosition, sing?: boolean) => boolean;\n applyForNetworkEngineerJob: (sing?: boolean) => boolean;\n applyForPartTimeEmployeeJob: (sing?: boolean) => boolean;\n applyForPartTimeWaiterJob: (sing?: boolean) => boolean;\n applyForSecurityEngineerJob: (sing?: boolean) => boolean;\n applyForSecurityJob: (sing?: boolean) => boolean;\n applyForSoftwareConsultantJob: (sing?: boolean) => boolean;\n applyForSoftwareJob: (sing?: boolean) => boolean;\n applyForWaiterJob: (sing?: boolean) => boolean;\n canAccessBladeburner: () => boolean;\n canAccessCorporation: () => boolean;\n canAccessGang: () => boolean;\n canAccessResleeving: () => boolean;\n canAfford: (cost: number) => boolean;\n gainHackingExp: (exp: number) => void;\n gainStrengthExp: (exp: number) => void;\n gainDefenseExp: (exp: number) => void;\n gainDexterityExp: (exp: number) => void;\n gainAgilityExp: (exp: number) => void;\n gainCharismaExp: (exp: number) => void;\n gainIntelligenceExp: (exp: number) => void;\n gainMoney: (money: number) => 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 gotoLocation: (to: LocationName) => boolean;\n hasAugmentation: (aug: string | Augmentation) => boolean;\n hasCorporation: () => boolean;\n hasGangWith: (facName: string) => boolean;\n hasTorRouter: () => boolean;\n hasProgram: (program: string) => boolean;\n inBladeburner: () => boolean;\n inGang: () => boolean;\n isQualified: (company: Company, position: CompanyPosition) => boolean;\n loseMoney: (money: number) => 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: (router: IRouter, faction: Faction) => void;\n startClass: (router: IRouter, costMult: number, expMult: number, className: string) => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startCrime: (\n router: IRouter,\n crimeType: string,\n hackExp: number,\n strExp: number,\n defExp: number,\n dexExp: number,\n agiExp: number,\n chaExp: number,\n money: number,\n time: number,\n singParams: any,\n ) => void;\n startFactionFieldWork: (router: IRouter, faction: Faction) => void;\n startFactionHackWork: (router: IRouter, faction: Faction) => void;\n startFactionSecurityWork: (router: IRouter, faction: Faction) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n startWork: (router: IRouter, companyName: string) => void;\n startWorkPartTime: (router: IRouter, companyName: string) => void;\n takeDamage: (amt: number) => boolean;\n travel: (to: CityName) => boolean;\n giveExploit: (exploit: Exploit) => void;\n queryStatFromString: (str: string) => number;\n getIntelligenceBonus: (weight: number) => number;\n getCasinoWinnings: () => number;\n quitJob: (company: string) => void;\n createHacknetServer: () => HacknetServer;\n startCreateProgramWork: (router: IRouter, 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 resetWorkStatus: (generalType?: string, group?: string, workType?: string) => void;\n getWorkHackExpGain: () => number;\n getWorkStrExpGain: () => number;\n getWorkDefExpGain: () => number;\n getWorkDexExpGain: () => number;\n getWorkAgiExpGain: () => number;\n getWorkChaExpGain: () => number;\n getWorkRepGain: () => number;\n getWorkMoneyGain: () => number;\n processWorkEarnings: (cycles: number) => void;\n hospitalize: () => void;\n createProgramWork: (numCycles: number) => boolean;\n takeClass: (numCycles: number) => boolean;\n commitCrime: (numCycles: number) => boolean;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n getMult: (name: string) => number;\n setMult: (name: string, mult: number) => void;\n\n constructor() {\n //Skills and stats\n this.hacking_skill = 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 = new Decimal(1000);\n\n //Location information\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n // Jobs that the player holds\n // Map of company name (key) -> name of company position (value. Just the name, not the CompanyPosition object)\n // The CompanyPosition name must match a key value in CompanyPositions\n this.jobs = {};\n\n // Company at which player is CURRENTLY working (only valid when the player is actively working)\n this.companyName = \"\"; // Name of Company. Must match a key value in Companies ma;\n\n // Servers\n this.currentServer = \"\"; //IP address of Server currently being accessed through termina;\n this.purchasedServers = []; //IP Addresses of purchased server;\n\n // Hacknet Nodes/Servers\n this.hacknetNodes = []; // Note= For Hacknet Servers, this array holds the IP addresses of the server;\n this.hashManager = new HashManager();\n\n //Factions\n this.factions = []; //Names of all factions player has joine;\n this.factionInvitations = []; //Outstanding faction invitation;\n\n //Augmentations\n this.queuedAugmentations = [];\n this.augmentations = [];\n\n this.sourceFiles = [];\n\n //Crime statistics\n this.numPeopleKilled = 0;\n this.karma = 0;\n\n this.crime_money_mult = 1;\n this.crime_success_mult = 1;\n\n //Flags/variables for working (Company, Faction, Creating Program, Taking Class)\n this.isWorking = false;\n this.focus = false;\n this.workType = \"\";\n\n this.currentWorkFactionName = \"\";\n this.currentWorkFactionDescription = \"\";\n\n this.workHackExpGainRate = 0;\n this.workStrExpGainRate = 0;\n this.workDefExpGainRate = 0;\n this.workDexExpGainRate = 0;\n this.workAgiExpGainRate = 0;\n this.workChaExpGainRate = 0;\n this.workRepGainRate = 0;\n this.workMoneyGainRate = 0;\n this.workMoneyLossRate = 0;\n\n this.workHackExpGained = 0;\n this.workStrExpGained = 0;\n this.workDefExpGained = 0;\n this.workDexExpGained = 0;\n this.workAgiExpGained = 0;\n this.workChaExpGained = 0;\n this.workRepGained = 0;\n this.workMoneyGained = 0;\n\n this.createProgramName = \"\";\n this.createProgramReqLvl = 0;\n\n this.className = \"\";\n\n this.crimeType = \"\";\n\n this.timeWorked = 0; //in m;\n this.timeWorkedCreateProgram = 0;\n this.timeNeededToCompleteWork = 0;\n\n this.work_money_mult = 1;\n\n //Hacknet Node multipliers\n this.hacknet_node_money_mult = 1;\n this.hacknet_node_purchase_cost_mult = 1;\n this.hacknet_node_ram_cost_mult = 1;\n this.hacknet_node_core_cost_mult = 1;\n this.hacknet_node_level_cost_mult = 1;\n\n //Stock Market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n //Gang\n this.gang = null;\n\n //Corporation\n this.corporation = null;\n\n //Bladeburner\n this.bladeburner = null;\n this.bladeburner_max_stamina_mult = 1;\n this.bladeburner_stamina_gain_mult = 1;\n this.bladeburner_analysis_mult = 1; //Field Analysis Onl;\n this.bladeburner_success_chance_mult = 1;\n\n // Sleeves & Re-sleeving\n this.sleeves = [];\n this.resleeves = [];\n this.sleevesFromCovenant = 0; // # of Duplicate sleeves purchased from the covenan;\n //bitnode\n this.bitNodeN = 1;\n\n //Used to store the last update time.\n this.lastUpdate = 0;\n this.totalPlaytime = 0;\n this.playtimeSinceLastAug = 0;\n this.playtimeSinceLastBitnode = 0;\n\n // Keep track of where money comes from\n this.moneySourceA = new MoneySourceTracker(); // Where money comes from since last-installed Augmentatio;\n this.moneySourceB = new MoneySourceTracker(); // Where money comes from for this entire BitNode ru;\n // Production since last Augmentation installation\n this.scriptProdSinceLastAug = 0;\n\n this.exploits = [];\n\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.updateSkillLevels = generalMethods.updateSkillLevels;\n this.resetMultipliers = generalMethods.resetMultipliers;\n this.hasProgram = generalMethods.hasProgram;\n this.setMoney = generalMethods.setMoney;\n this.gainMoney = generalMethods.gainMoney;\n this.loseMoney = generalMethods.loseMoney;\n this.canAfford = generalMethods.canAfford;\n this.recordMoneySource = generalMethods.recordMoneySource;\n this.gainHackingExp = generalMethods.gainHackingExp;\n this.gainStrengthExp = generalMethods.gainStrengthExp;\n this.gainDefenseExp = generalMethods.gainDefenseExp;\n this.gainDexterityExp = generalMethods.gainDexterityExp;\n this.gainAgilityExp = generalMethods.gainAgilityExp;\n this.gainCharismaExp = generalMethods.gainCharismaExp;\n this.gainIntelligenceExp = generalMethods.gainIntelligenceExp;\n this.queryStatFromString = generalMethods.queryStatFromString;\n this.resetWorkStatus = generalMethods.resetWorkStatus;\n this.processWorkEarnings = generalMethods.processWorkEarnings;\n this.startWork = generalMethods.startWork;\n this.cancelationPenalty = generalMethods.cancelationPenalty;\n this.work = generalMethods.work;\n this.finishWork = generalMethods.finishWork;\n this.startWorkPartTime = generalMethods.startWorkPartTime;\n this.workPartTime = generalMethods.workPartTime;\n this.finishWorkPartTime = generalMethods.finishWorkPartTime;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.startFactionWork = generalMethods.startFactionWork;\n this.startFactionHackWork = generalMethods.startFactionHackWork;\n this.startFactionFieldWork = generalMethods.startFactionFieldWork;\n this.startFactionSecurityWork = generalMethods.startFactionSecurityWork;\n this.workForFaction = generalMethods.workForFaction;\n this.finishFactionWork = generalMethods.finishFactionWork;\n this.getWorkMoneyGain = generalMethods.getWorkMoneyGain;\n this.getWorkHackExpGain = generalMethods.getWorkHackExpGain;\n this.getWorkStrExpGain = generalMethods.getWorkStrExpGain;\n this.getWorkDefExpGain = generalMethods.getWorkDefExpGain;\n this.getWorkDexExpGain = generalMethods.getWorkDexExpGain;\n this.getWorkAgiExpGain = generalMethods.getWorkAgiExpGain;\n this.getWorkChaExpGain = generalMethods.getWorkChaExpGain;\n this.getWorkRepGain = generalMethods.getWorkRepGain;\n this.startCreateProgramWork = generalMethods.startCreateProgramWork;\n this.createProgramWork = generalMethods.createProgramWork;\n this.finishCreateProgramWork = generalMethods.finishCreateProgramWork;\n this.startClass = generalMethods.startClass;\n this.takeClass = generalMethods.takeClass;\n this.finishClass = generalMethods.finishClass;\n this.startCrime = generalMethods.startCrime;\n this.commitCrime = generalMethods.commitCrime;\n this.finishCrime = generalMethods.finishCrime;\n this.singularityStopWork = generalMethods.singularityStopWork;\n this.takeDamage = generalMethods.takeDamage;\n this.regenerateHp = generalMethods.regenerateHp;\n this.hospitalize = generalMethods.hospitalize;\n this.applyForJob = generalMethods.applyForJob;\n this.getNextCompanyPosition = generalMethods.getNextCompanyPosition;\n this.quitJob = generalMethods.quitJob;\n this.applyForSoftwareJob = generalMethods.applyForSoftwareJob;\n this.applyForSoftwareConsultantJob = generalMethods.applyForSoftwareConsultantJob;\n this.applyForItJob = generalMethods.applyForItJob;\n this.applyForSecurityEngineerJob = generalMethods.applyForSecurityEngineerJob;\n this.applyForNetworkEngineerJob = generalMethods.applyForNetworkEngineerJob;\n this.applyForBusinessJob = generalMethods.applyForBusinessJob;\n this.applyForBusinessConsultantJob = generalMethods.applyForBusinessConsultantJob;\n this.applyForSecurityJob = generalMethods.applyForSecurityJob;\n this.applyForAgentJob = generalMethods.applyForAgentJob;\n this.applyForEmployeeJob = generalMethods.applyForEmployeeJob;\n this.applyForPartTimeEmployeeJob = generalMethods.applyForPartTimeEmployeeJob;\n this.applyForWaiterJob = generalMethods.applyForWaiterJob;\n this.applyForPartTimeWaiterJob = generalMethods.applyForPartTimeWaiterJob;\n this.isQualified = generalMethods.isQualified;\n this.reapplyAllAugmentations = generalMethods.reapplyAllAugmentations;\n this.reapplyAllSourceFiles = generalMethods.reapplyAllSourceFiles;\n this.checkForFactionInvitations = generalMethods.checkForFactionInvitations;\n this.setBitNodeNumber = generalMethods.setBitNodeNumber;\n this.queueAugmentation = generalMethods.queueAugmentation;\n this.gainCodingContractReward = generalMethods.gainCodingContractReward;\n this.travel = generalMethods.travel;\n this.gotoLocation = generalMethods.gotoLocation;\n this.canAccessResleeving = generalMethods.canAccessResleeving;\n this.giveExploit = generalMethods.giveExploit;\n this.getIntelligenceBonus = generalMethods.getIntelligenceBonus;\n this.getCasinoWinnings = generalMethods.getCasinoWinnings;\n this.hasAugmentation = augmentationMethods.hasAugmentation;\n this.canAccessBladeburner = bladeburnerMethods.canAccessBladeburner;\n this.inBladeburner = bladeburnerMethods.inBladeburner;\n this.startBladeburner = bladeburnerMethods.startBladeburner;\n this.canAccessCorporation = corporationMethods.canAccessCorporation;\n this.hasCorporation = corporationMethods.hasCorporation;\n this.startCorporation = corporationMethods.startCorporation;\n this.canAccessGang = gangMethods.canAccessGang;\n this.getGangFaction = gangMethods.getGangFaction;\n this.getGangName = gangMethods.getGangName;\n this.hasGangWith = gangMethods.hasGangWith;\n this.inGang = gangMethods.inGang;\n this.startGang = gangMethods.startGang;\n\n this.hasTorRouter = serverMethods.hasTorRouter;\n this.getCurrentServer = serverMethods.getCurrentServer;\n this.getHomeComputer = serverMethods.getHomeComputer;\n this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;\n this.createHacknetServer = serverMethods.createHacknetServer;\n this.factionWorkType = \"\";\n this.committingCrimeThruSingFn = false;\n this.singFnCrimeWorkerScript = null;\n\n this.getMult = generalMethods.getMult;\n this.setMult = generalMethods.setMult;\n }\n\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","/**\n * Augmentation-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nexport function hasAugmentation(this: IPlayer, aug: string | Augmentation): 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 for (const owned of this.queuedAugmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n\n return false;\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 * as posNames from \"./companypositionnames\";\nimport { IConstructorParams } from \"../Company\";\n\nimport { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\n// Create Objects containing Company Positions by category\n// Will help in metadata construction later\nconst AllSoftwarePositions: IMap<boolean> = {};\nconst AllITPositions: IMap<boolean> = {};\nconst AllNetworkEngineerPositions: IMap<boolean> = {};\nconst SecurityEngineerPositions: IMap<boolean> = {};\nconst AllTechnologyPositions: IMap<boolean> = {};\nconst AllBusinessPositions: IMap<boolean> = {};\nconst AllAgentPositions: IMap<boolean> = {};\nconst AllSecurityPositions: IMap<boolean> = {};\nconst AllSoftwareConsultantPositions: IMap<boolean> = {};\nconst AllBusinessConsultantPositions: IMap<boolean> = {};\nconst SoftwarePositionsUpToHeadOfEngineering: IMap<boolean> = {};\nconst SoftwarePositionsUpToLeadDeveloper: IMap<boolean> = {};\nconst BusinessPositionsUpToOperationsManager: IMap<boolean> = {};\nconst WaiterOnly: IMap<boolean> = {};\nconst EmployeeOnly: IMap<boolean> = {};\nconst PartTimeWaiterOnly: IMap<boolean> = {};\nconst PartTimeEmployeeOnly: IMap<boolean> = {};\nconst OperationsManagerOnly: IMap<boolean> = {};\nconst CEOOnly: IMap<boolean> = {};\n\nposNames.SoftwareCompanyPositions.forEach((e) => {\n AllSoftwarePositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.ITCompanyPositions.forEach((e) => {\n AllITPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.NetworkEngineerCompanyPositions.forEach((e) => {\n AllNetworkEngineerPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nAllTechnologyPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\nSecurityEngineerPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\n\nposNames.BusinessCompanyPositions.forEach((e) => {\n AllBusinessPositions[e] = true;\n});\n\nposNames.SecurityCompanyPositions.forEach((e) => {\n AllSecurityPositions[e] = true;\n});\n\nposNames.AgentCompanyPositions.forEach((e) => {\n AllAgentPositions[e] = true;\n});\n\nposNames.SoftwareConsultantCompanyPositions.forEach((e) => {\n AllSoftwareConsultantPositions[e] = true;\n});\n\nposNames.BusinessConsultantCompanyPositions.forEach((e) => {\n AllBusinessConsultantPositions[e] = true;\n});\n\nfor (let i = 0; i < posNames.SoftwareCompanyPositions.length; ++i) {\n const e = posNames.SoftwareCompanyPositions[i];\n if (i <= 5) {\n SoftwarePositionsUpToHeadOfEngineering[e] = true;\n }\n if (i <= 3) {\n SoftwarePositionsUpToLeadDeveloper[e] = true;\n }\n}\nfor (let i = 0; i < posNames.BusinessCompanyPositions.length; ++i) {\n const e = posNames.BusinessCompanyPositions[i];\n if (i <= 3) {\n BusinessPositionsUpToOperationsManager[e] = true;\n }\n}\n\nWaiterOnly[posNames.MiscCompanyPositions[0]] = true;\nEmployeeOnly[posNames.MiscCompanyPositions[1]] = true;\nPartTimeWaiterOnly[posNames.PartTimeCompanyPositions[0]] = true;\nPartTimeEmployeeOnly[posNames.PartTimeCompanyPositions[1]] = true;\nOperationsManagerOnly[posNames.BusinessCompanyPositions[3]] = true;\nCEOOnly[posNames.BusinessCompanyPositions[5]] = true;\n\n// Metadata\nexport const companiesMetadata: IConstructorParams[] = [\n {\n name: LocationName.AevumECorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.Sector12MegaCorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumBachmanAndAssociates,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.6,\n salaryMultiplier: 2.6,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12BladeIndustries,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenNWO,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumClarkeIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenOmniTekIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12FourSigma,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.5,\n salaryMultiplier: 2.5,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.ChongqingKuaiGongInternational,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.2,\n salaryMultiplier: 2.2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.AevumFulcrumTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaStormTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoDefComm,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenHeliosLabs,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoVitaLife,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12IcarusMicrosystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12UniversalEnergy,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumGalacticCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumAeroCorp,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenOmniaCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.ChongqingSolarisSpaceSystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12DeltaOne,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.6,\n salaryMultiplier: 1.6,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaNovaMedical,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12CIA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.Sector12NSA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.AevumWatchdogSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenLexoCorp,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllBusinessPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.4,\n salaryMultiplier: 1.4,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumRhoConstruction,\n info: \"\",\n companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.Sector12AlphaEnterprises,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToLeadDeveloper,\n BusinessPositionsUpToOperationsManager,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumPolice,\n info: \"\",\n companyPositions: Object.assign({}, AllSecurityPositions, SoftwarePositionsUpToLeadDeveloper),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.VolhavenSysCoreSecurities,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenCompuTek,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.AevumNetLinkTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.Sector12CarmichaelSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllAgentPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.Sector12FoodNStuff,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.Sector12JoesGuns,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.IshimaOmegaSoftware,\n info: \"\",\n companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, AllITPositions),\n expMultiplier: 1.1,\n salaryMultiplier: 1.1,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.NewTokyoNoodleBar,\n info: \"\",\n companyPositions: Object.assign({}, WaiterOnly, PartTimeWaiterOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n];\n","export interface IConstructorParams {\n name: string;\n cost: number;\n desc: string;\n advertisingMult?: number;\n employeeChaMult?: number;\n employeeCreMult?: number;\n employeeEffMult?: number;\n employeeIntMult?: number;\n productionMult?: number;\n productProductionMult?: number;\n salesMult?: number;\n sciResearchMult?: number;\n storageMult?: number;\n}\n\nexport class Research {\n // Name of research. This will be used to identify researches in the Research Tree\n name = \"\";\n\n // How much scientific research it costs to unlock this\n cost = 0;\n\n // Description of what the Research does\n desc = \"\";\n\n // All possible generic upgrades for the company, in the form of multipliers\n advertisingMult = 1;\n employeeChaMult = 1;\n employeeCreMult = 1;\n employeeEffMult = 1;\n employeeIntMult = 1;\n productionMult = 1;\n productProductionMult = 1;\n salesMult = 1;\n sciResearchMult = 1;\n storageMult = 1;\n\n constructor(p: IConstructorParams = { name: \"\", cost: 0, desc: \"\" }) {\n this.name = p.name;\n this.cost = p.cost;\n this.desc = p.desc;\n if (p.advertisingMult) {\n this.advertisingMult = p.advertisingMult;\n }\n if (p.employeeChaMult) {\n this.employeeChaMult = p.employeeChaMult;\n }\n if (p.employeeCreMult) {\n this.employeeCreMult = p.employeeCreMult;\n }\n if (p.employeeEffMult) {\n this.employeeEffMult = p.employeeEffMult;\n }\n if (p.employeeIntMult) {\n this.employeeIntMult = p.employeeIntMult;\n }\n if (p.productionMult) {\n this.productionMult = p.productionMult;\n }\n if (p.productProductionMult) {\n this.productProductionMult = p.productProductionMult;\n }\n if (p.salesMult) {\n this.salesMult = p.salesMult;\n }\n if (p.sciResearchMult) {\n this.sciResearchMult = p.sciResearchMult;\n }\n if (p.storageMult) {\n this.storageMult = p.storageMult;\n }\n }\n}\n","import { IConstructorParams } from \"../Research\";\n\nexport const researchMetadata: IConstructorParams[] = [\n {\n name: \"AutoBrew\",\n cost: 12e3,\n desc:\n \"Automatically keep your employees fully caffeinated with \" +\n \"coffee injections. This research will keep the energy of all \" +\n \"employees at its maximum possible value, for no cost. \" +\n \"This will also disable the Coffee upgrade.\",\n },\n {\n name: \"AutoPartyManager\",\n cost: 15e3,\n desc:\n \"Automatically analyzes your employees' happiness and morale \" +\n \"and boosts them whenever it detects a decrease. This research will \" +\n \"keep the morale and happiness of all employees at their maximum possible \" +\n \"values, for no cost. \" +\n \"This will also disable the 'Throw Party' feature.\",\n },\n {\n name: \"Automatic Drug Administration\",\n cost: 10e3,\n desc:\n \"Research how to automatically administer performance-enhacing drugs to all of \" +\n \"your employees. This unlocks Drug-related Research.\",\n },\n {\n name: \"Bulk Purchasing\",\n cost: 5e3,\n desc:\n \"Research the art of buying materials in bulk. This allows you to purchase \" +\n \"any amount of a material instantly.\",\n },\n {\n name: \"CPH4 Injections\",\n cost: 25e3,\n desc:\n \"Develop an advanced and harmless synthetic drug that is administered to \" +\n \"employees to increase all of their stats, except experience, by 10%.\",\n employeeCreMult: 1.1,\n employeeChaMult: 1.1,\n employeeEffMult: 1.1,\n employeeIntMult: 1.1,\n },\n {\n name: \"Drones\",\n cost: 5e3,\n desc:\n \"Acquire the knowledge needed to create advanced drones. This research does nothing \" +\n \"by itself, but unlocks other Drone-related research.\",\n },\n {\n name: \"Drones - Assembly\",\n cost: 25e3,\n desc:\n \"Manufacture and use Assembly Drones to improve the efficiency of \" +\n \"your production lines. This increases all production by 20%.\",\n productionMult: 1.2,\n },\n {\n name: \"Drones - Transport\",\n cost: 30e3,\n desc:\n \"Manufacture and use intelligent Transport Drones to optimize \" +\n \"your warehouses. This increases the storage space of all warehouses \" +\n \"by 50%.\",\n storageMult: 1.5,\n },\n {\n name: \"Go-Juice\",\n cost: 25e3,\n desc:\n \"Provide employees with Go-Juice, a coffee-derivative that further enhances \" +\n \"the brain's dopamine production. This increases the maximum energy of all \" +\n \"employees by 10.\",\n },\n {\n name: \"Hi-Tech R&D Laboratory\",\n cost: 5e3,\n desc:\n \"Construct a cutting edge facility dedicated to advanced research and \" +\n \"and development. This allows you to spend Scientific Research \" +\n \"on powerful upgrades. It also globally increases Scientific Research \" +\n \"production by 10%.\",\n sciResearchMult: 1.1,\n },\n {\n name: \"HRBuddy-Recruitment\",\n cost: 15e3,\n desc:\n \"Use automated software to handle the hiring of employees. With this \" +\n \"research, each office will automatically hire one employee per \" +\n \"market cycle if there is available space.\",\n },\n {\n name: \"HRBuddy-Training\",\n cost: 20e3,\n desc:\n \"Use automated software to handle the training of employees. With this \" +\n \"research, each employee hired with HRBuddy-Recruitment will automatically \" +\n \"be assigned to 'Training', rather than being unassigned.\",\n },\n {\n name: \"JoyWire\",\n cost: 20e3,\n desc: \"A brain implant which is installed in employees, increasing their \" + \"maximum happiness by 10.\",\n },\n {\n name: \"Market-TA.I\",\n cost: 20e3,\n desc:\n \"Develop advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know what price to sell your Materials/Products \" +\n \"at in order to avoid losing sales due to having too high of a mark-up. \" +\n \"It also lets you automatically use that sale price.\",\n },\n {\n name: \"Market-TA.II\",\n cost: 50e3,\n desc:\n \"Develop double-advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know how many sales of a Material/Product you lose or gain \" +\n \"from having too high or too low or a sale price. It also lets you automatically \" +\n \"set the sale price of your Materials/Products at the optimal price such that \" +\n \"the amount sold matches the amount produced.\",\n },\n {\n name: \"Overclock\",\n cost: 15e3,\n desc:\n \"Equip employees with a headset that uses transcranial direct current \" +\n \"stimulation (tDCS) to increase the speed of their neurotransmitters. \" +\n \"This research increases the intelligence and efficiency of all \" +\n \"employees by 25%.\",\n employeeEffMult: 1.25,\n employeeIntMult: 1.25,\n },\n {\n name: \"Self-Correcting Assemblers\",\n cost: 25e3,\n desc:\n \"Create assemblers that can be used for universal production. \" +\n \"These assemblers use deep learning to improve their efficiency \" +\n \"at their tasks. This research increases all production by 10%\",\n productionMult: 1.1,\n },\n {\n name: \"Sti.mu\",\n cost: 30e3,\n desc:\n \"Upgrade the tDCS headset to stimulate regions of the brain that \" +\n \"control confidence and enthusiasm. This research increases the max \" +\n \"morale of all employees by 10.\",\n },\n {\n name: \"sudo.Assist\",\n cost: 15e3,\n desc: \"Develop a virtual assistant AI to handle and manage administrative \" + \"issues for your corporation.\",\n },\n {\n name: \"uPgrade: Capacity.I\",\n cost: 20e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 3 to 4).\",\n },\n {\n name: \"uPgrade: Capacity.II\",\n cost: 30e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 4 to 5).\",\n },\n {\n name: \"uPgrade: Dashboard\",\n cost: 5e3,\n desc:\n \"Improve the software used to manage the industry's production line \" +\n \"for its various products. This allows you to manage the production and \" +\n \"sale of a product before it's finished being designed.\",\n },\n {\n name: \"uPgrade: Fulcrum\",\n cost: 10e3,\n desc:\n \"Streamline the manufacturing of this industry's various products. \" +\n \"This research increases the production of your products by 5%\",\n productProductionMult: 1.05,\n },\n];\n","/**\n * Object representing an upgrade that can be purchased with hashes\n */\nexport interface IConstructorParams {\n cost?: number;\n costPerLevel: number;\n desc: string;\n hasTargetServer?: boolean;\n name: string;\n value: number;\n effectText?: (level: number) => JSX.Element | null;\n}\n\nexport class HashUpgrade {\n /**\n * If the upgrade has a flat cost (never increases), it goes here\n * Otherwise, this property should be undefined\n *\n * This property overrides the 'costPerLevel' property\n */\n cost?: number;\n\n /**\n * Base cost for this upgrade. Every time the upgrade is purchased,\n * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.)\n */\n costPerLevel = 0;\n\n /**\n * Description of what the upgrade does\n */\n desc = \"\";\n\n /**\n * Boolean indicating that this upgrade's effect affects a single server,\n * the \"target\" server\n */\n hasTargetServer = false;\n\n // Name of upgrade\n name = \"\";\n\n // Generic value used to indicate the potency/amount of this upgrade's effect\n // The meaning varies between different upgrades\n value = 0;\n\n constructor(p: IConstructorParams) {\n if (p.cost != null) {\n this.cost = p.cost;\n }\n if (p.effectText != null) {\n this.effectText = p.effectText;\n }\n\n this.costPerLevel = p.costPerLevel;\n this.desc = p.desc;\n this.hasTargetServer = p.hasTargetServer ? p.hasTargetServer : false;\n this.name = p.name;\n this.value = p.value;\n }\n\n // Functions that returns the UI element to display the effect of this upgrade.\n effectText: (level: number) => JSX.Element | null = () => null;\n\n getCost(levels: number): number {\n if (typeof this.cost === \"number\") {\n return this.cost;\n }\n\n return Math.round((levels + 1) * this.costPerLevel);\n }\n}\n","// Metadata used to construct all Hash Upgrades\nimport React from \"react\";\nimport { IConstructorParams } from \"../HashUpgrade\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport const HashUpgradesMetadata: IConstructorParams[] = [\n {\n cost: 4,\n costPerLevel: 4,\n desc: \"Sell hashes for $1m\",\n name: \"Sell for Money\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e6 * level} />\n </>\n ),\n value: 1e6,\n },\n {\n costPerLevel: 100,\n desc: \"Sell hashes for $1b in Corporation funds\",\n name: \"Sell for Corporation Funds\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for <Money money={1e9 * level} /> Corporation funds.\n </>\n ),\n value: 1e9,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to decrease the minimum security of a single server by 2%. \" +\n \"Note that a server's minimum security cannot go below 1. This effect persists \" +\n \"until you install Augmentations (since servers are reset at that time).\",\n hasTargetServer: true,\n name: \"Reduce Minimum Security\",\n value: 0.98,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to increase the maximum amount of money on a single server by 2%. \" +\n \"This effect persists until you install Augmentations (since servers \" +\n \"are reset at that time).\",\n hasTargetServer: true,\n name: \"Increase Maximum Money\",\n value: 1.02,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when studying at a university by 20%. \" +\n \"This effect persists until you install Augmentations\",\n name: \"Improve Studying\",\n effectText: (level: number): JSX.Element | null => <>Improves studying by {level * 20}%</>,\n value: 20, // Improves studying by value%\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when training at the gym by 20%. This effect \" +\n \"persists until you install Augmentations\",\n name: \"Improve Gym Training\",\n effectText: (level: number): JSX.Element | null => <>Improves training by {level * 20}%</>,\n value: 20, // Improves training by value%\n },\n {\n costPerLevel: 200,\n desc: \"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries\",\n name: \"Exchange for Corporation Research\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {level}k Scientific Research in your industries.</>\n ),\n value: 1000,\n },\n {\n costPerLevel: 250,\n desc: \"Exchange hashes for 100 Bladeburner Rank\",\n name: \"Exchange for Bladeburner Rank\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(100 * level, \"0a\")} Bladeburner rank</>\n ),\n value: 100,\n },\n {\n costPerLevel: 250,\n desc: \"Exchanges hashes for 10 Bladeburner Skill Points\",\n name: \"Exchange for Bladeburner SP\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(10 * level, \"0a\")} Bladeburner Skill Points</>\n ),\n value: 10,\n },\n {\n costPerLevel: 200,\n desc: \"Generate a random Coding Contract somewhere on the network\",\n name: \"Generate Coding Contract\",\n effectText: (level: number): JSX.Element | null => <>Generated {level} contracts.</>,\n value: 1,\n },\n];\n","/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nimport { IMap } from \"../types\";\n\nexport class Environment {\n /**\n * Parent environment. Used to implement \"scope\"\n */\n parent: Environment | null = null;\n\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: IMap<any> = {};\n\n constructor(parent: Environment | null) {\n if (parent instanceof Environment) {\n this.vars = Object.assign({}, parent.vars);\n }\n\n this.parent = parent;\n }\n\n /**\n * Finds the scope where the variable with the given name is defined\n */\n lookup(name: string): Environment | null {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let scope: Environment | null = this;\n while (scope) {\n if (Object.prototype.hasOwnProperty.call(scope.vars, name)) {\n return scope;\n }\n scope = scope.parent;\n }\n\n return null;\n }\n\n //Get the current value of a variable\n get(name: string): any {\n if (name in this.vars) {\n return this.vars[name];\n }\n\n throw new Error(`Undefined variable ${name}`);\n }\n\n //Sets the value of a variable in any scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n set(name: string, value: any): any {\n const scope = this.lookup(name);\n\n //If scope has a value, then this variable is already set in a higher scope, so\n //set is there. Otherwise, create a new variable in the local scope\n if (scope !== null) {\n return (scope.vars[name] = value);\n } else {\n return (this.vars[name] = value);\n }\n }\n\n //Creates (or overwrites) a variable in the current scope\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n def(name: string, value: any): any {\n return (this.vars[name] = value);\n }\n}\n","// 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 { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport Decimal from \"decimal.js\";\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: any;\n lastCycleExpenses: any;\n thisCycleRevenue: any;\n thisCycleExpenses: any;\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 = new Decimal(0);\n this.lastCycleExpenses = new Decimal(0);\n this.thisCycleRevenue = new Decimal(0);\n this.thisCycleExpenses = new Decimal(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 in 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 = new Decimal(0);\n this.thisCycleExpenses = new Decimal(0);\n }\n this.lastCycleRevenue = this.thisCycleRevenue.dividedBy(marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.lastCycleExpenses = this.thisCycleExpenses.dividedBy(marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.thisCycleRevenue = new Decimal(0);\n this.thisCycleExpenses = new Decimal(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.gt(0)) {\n this.newInd = false;\n }\n\n // Process offices (and the employees in them)\n let employeeSalary = 0;\n for (const officeLoc in 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.plus(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 this.popularity += popularityGain * marketCycles;\n this.awareness += awarenessGain * marketCycles;\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.plus(res[0]);\n this.thisCycleExpenses = this.thisCycleExpenses.plus(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.plus(res[0]);\n this.thisCycleExpenses = this.thisCycleExpenses.plus(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 in 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 in 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 in 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 in 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 if (matName == \"RealEstate\") {\n maxAmt = corporation.funds.toNumber() / mat.bCost;\n } else {\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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in 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 in warehouse.materials) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n if (mat.sCost < 0 || mat.sllman[0] === false) {\n mat.sll = 0;\n continue;\n }\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(mat); //Competition + demand\n\n // Determine the cost that the material will be sold at\n const markupLimit = mat.getMarkupLimit();\n let sCost;\n if (mat.marketTa2) {\n const prod = mat.prd;\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n (mat.qlt + 0.001) *\n marketFactor *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = mat.bCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + mat.bCost;\n }\n\n // We'll store this \"Optimal Price\" in a property so that we don't have\n // to re-calculate it for the UI\n mat.marketTa2Price = optimalPrice;\n\n sCost = optimalPrice;\n } else if (mat.marketTa1) {\n sCost = mat.bCost + markupLimit;\n } else if (isString(mat.sCost)) {\n sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sCost = eval(sCost);\n } else {\n sCost = mat.sCost;\n }\n\n // Calculate how much of the material sells (per second)\n let markup = 1;\n if (sCost > mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);\n }\n } else if (sCost < mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = mat.bCost / sCost;\n }\n }\n\n const maxSell =\n (mat.qlt + 0.001) *\n marketFactor *\n markup *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (isString(mat.sllman[1])) {\n //Dynamically evaluated\n let tmp = (mat.sllman[1] as string).replace(/MAX/g, maxSell + \"\");\n tmp = tmp.replace(/PROD/g, mat.prd + \"\");\n try {\n sellAmt = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell amount for material \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. The sell amount \" +\n \"is being set to zero\",\n );\n sellAmt = 0;\n }\n sellAmt = Math.min(maxSell, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = maxSell;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(maxSell, mat.sllman[1] as number);\n }\n\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(mat.qty, sellAmt);\n if (sellAmt < 0) {\n console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`);\n mat.sll = 0;\n continue;\n }\n if (sellAmt && sCost >= 0) {\n mat.qty -= sellAmt;\n revenue += sellAmt * sCost;\n mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n } else {\n mat.sll = 0;\n }\n }\n } //End processing of sale of materials\n break;\n\n case \"EXPORT\":\n for (const matName in 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) + \"\",\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 in 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 in 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 in 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 in 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 in 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 in product.reqMats) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost;\n }\n }\n\n // Since its a product, its production cost is increased for labor\n product.pCost *= CorporationConstants.ProductProductionCostRatio;\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(product); //Competition + demand\n\n // Calculate Sale Cost (sCost), which could be dynamically evaluated\n const markupLimit = product.rat / product.mku;\n let sCost;\n if (product.marketTa2) {\n const prod = product.data[city][1];\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'roduct.pCost = sCost\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = product.pCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + product.pCost;\n }\n\n // Store this \"optimal Price\" in a property so we don't have to re-calculate for UI\n product.marketTa2Price[city] = optimalPrice;\n sCost = optimalPrice;\n } else if (product.marketTa1) {\n sCost = product.pCost + markupLimit;\n } else if (isString(product.sCost)) {\n const sCostString = product.sCost as string;\n if (product.mku === 0) {\n console.error(`mku is zero, reverting to 1 to avoid Infinity`);\n product.mku = 1;\n }\n sCost = sCostString.replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sCost = eval(sCost);\n } else {\n sCost = product.sCost;\n }\n\n let markup = 1;\n if (sCost > product.pCost) {\n if (sCost - product.pCost > markupLimit) {\n markup = markupLimit / (sCost - product.pCost);\n }\n }\n\n const maxSell =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n Math.pow(markup, 2) *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (product.sllman[city][0] && isString(product.sllman[city][1])) {\n //Sell amount is dynamically evaluated\n let tmp = product.sllman[city][1].replace(/MAX/g, maxSell);\n tmp = tmp.replace(/PROD/g, product.data[city][1]);\n try {\n tmp = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell price expression for \" +\n product.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. Sell price is being set to MAX\",\n );\n tmp = maxSell;\n }\n sellAmt = Math.min(maxSell, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(maxSell, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = maxSell;\n }\n if (sellAmt < 0) {\n sellAmt = 0;\n }\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty\n if (sellAmt && sCost) {\n product.data[city][0] -= sellAmt; //data[0] is qty\n totalProfit += sellAmt * sCost;\n product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property\n } else {\n product.data[city][2] = 0; //data[2] is sell property\n }\n break;\n }\n case \"START\":\n case \"PURCHASE\":\n case \"EXPORT\":\n break;\n default:\n console.error(`Invalid State: ${this.state}`);\n break;\n } //End switch(this.state)\n }\n }\n return totalProfit;\n }\n\n discontinueProduct(product: Product): void {\n for (const productName in 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 this.awareness += 3 * advMult;\n this.popularity += 1 * advMult;\n this.awareness *= 1.01 * advMult;\n this.popularity *= (1 + getRandomInt(1, 3) / 100) * advMult;\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 in 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 copy(): Industry {\n // products: { [key: string]: Product | undefined } = {};\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 const division = new Industry();\n division.sciResearch = this.sciResearch.copy();\n division.researched = {};\n for (const x of Object.keys(this.researched)) {\n division.researched[x] = this.researched[x];\n }\n division.reqMats = {};\n for (const x of Object.keys(this.reqMats)) {\n division.reqMats[x] = this.reqMats[x];\n }\n division.name = this.name;\n division.type = this.type;\n division.makesProducts = this.makesProducts;\n division.awareness = this.awareness;\n division.popularity = this.popularity;\n division.startingCost = this.startingCost;\n division.reFac = this.reFac;\n division.sciFac = this.sciFac;\n division.hwFac = this.hwFac;\n division.robFac = this.robFac;\n division.aiFac = this.aiFac;\n division.advFac = this.advFac;\n division.prodMult = this.prodMult;\n division.state = this.state;\n division.newInd = this.newInd;\n division.lastCycleRevenue = this.lastCycleRevenue.plus(0);\n division.lastCycleExpenses = this.lastCycleExpenses.plus(0);\n division.thisCycleRevenue = this.thisCycleRevenue.plus(0);\n division.thisCycleExpenses = this.thisCycleExpenses.plus(0);\n division.upgrades = this.upgrades.slice();\n division.prodMats = this.prodMats.slice();\n return division;\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 pro = 0;\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 // Employee salaries slowly go up over time\n this.cyclesUntilRaise -= marketCycles;\n if (this.cyclesUntilRaise <= 0) {\n this.sal += CorporationConstants.EmployeeRaiseAmount;\n this.cyclesUntilRaise += CorporationConstants.CyclesPerEmployeeRaise;\n }\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 copy(): Employee {\n const employee = new Employee();\n employee.name = this.name;\n employee.mor = this.mor;\n employee.hap = this.hap;\n employee.ene = this.ene;\n employee.int = this.int;\n employee.cha = this.cha;\n employee.exp = this.exp;\n employee.cre = this.cre;\n employee.eff = this.eff;\n employee.sal = this.sal;\n employee.pro = this.pro;\n employee.cyclesUntilRaise = this.cyclesUntilRaise;\n employee.loc = this.loc;\n employee.pos = this.pos;\n return employee;\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","/**\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: \"Joes Guns\",\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[\"Joes Guns\"],\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","/**\n * Metadata for constructing Location objects for all Locations\n * in the game\n */\nimport { CityName } from \"./CityNames\";\nimport { LocationName } from \"./LocationNames\";\nimport { IConstructorParams } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nexport const LocationsMetadata: IConstructorParams[] = [\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.AevumAeroCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 8.19,\n },\n name: LocationName.AevumBachmanAndAssociates,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 9.55,\n },\n name: LocationName.AevumClarkeIncorporated,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 3,\n expMult: 2,\n name: LocationName.AevumCrushFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 37,\n startingSecurityLevel: 17.02,\n },\n name: LocationName.AevumECorp,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 15.54,\n },\n name: LocationName.AevumFulcrumTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 256,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 7.89,\n },\n name: LocationName.AevumGalacticCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 3.29,\n },\n name: LocationName.AevumNetLinkTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 64,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 5.35,\n },\n name: LocationName.AevumPolice,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.AevumRhoConstruction,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 10,\n expMult: 5,\n name: LocationName.AevumSnapFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n costMult: 4,\n expMult: 3,\n name: LocationName.AevumSummitUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 7,\n startingSecurityLevel: 5.85,\n },\n name: LocationName.AevumWatchdogSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n name: LocationName.AevumCasino,\n types: [LocationType.Casino],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 16.25,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n types: [LocationType.Company],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 12.59,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.IshimaNovaMedical,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.2,\n },\n name: LocationName.IshimaOmegaSoftware,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 128,\n techVendorMinRam: 4,\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.38,\n },\n name: LocationName.IshimaStormTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 32,\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 7.18,\n },\n name: LocationName.NewTokyoDefComm,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 20,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 2.5,\n },\n name: LocationName.NewTokyoNoodleBar,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.52,\n },\n name: LocationName.NewTokyoVitaLife,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.62,\n },\n name: LocationName.Sector12AlphaEnterprises,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 8,\n techVendorMinRam: 2,\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 10.59,\n },\n name: LocationName.Sector12BladeIndustries,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CIA,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.66,\n },\n name: LocationName.Sector12CarmichaelSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CityHall,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12DeltaOne,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12FoodNStuff,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.Sector12FourSigma,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 6.02,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n expMult: 1,\n costMult: 1,\n name: LocationName.Sector12IronGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 3.13,\n },\n name: LocationName.Sector12JoesGuns,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 31,\n startingSecurityLevel: 16.36,\n },\n name: LocationName.Sector12MegaCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12NSA,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n costMult: 20,\n expMult: 10,\n name: LocationName.Sector12PowerhouseGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n costMult: 3,\n expMult: 2,\n name: LocationName.Sector12RothmanUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12UniversalEnergy,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 3.59,\n },\n name: LocationName.VolhavenCompuTek,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 256,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 7.28,\n },\n name: LocationName.VolhavenHeliosLabs,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.35,\n },\n name: LocationName.VolhavenLexoCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 7,\n expMult: 4,\n name: LocationName.VolhavenMilleniumFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 50,\n startingSecurityLevel: 8.53,\n },\n name: LocationName.VolhavenNWO,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 7.74,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 22,\n startingSecurityLevel: 6,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 4.77,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 5,\n expMult: 4,\n name: LocationName.VolhavenZBInstituteOfTechnology,\n types: [LocationType.University],\n },\n {\n city: null,\n name: LocationName.Hospital,\n types: [LocationType.Hospital],\n },\n {\n city: null,\n name: LocationName.Slums,\n types: [LocationType.Slums],\n },\n {\n city: null,\n name: LocationName.TravelAgency,\n types: [LocationType.TravelAgency],\n },\n {\n city: null,\n name: LocationName.WorldStockExchange,\n types: [LocationType.StockMarket],\n },\n {\n city: CityName.Chongqing,\n name: LocationName.ChongqingChurchOfTheMachineGod,\n types: [LocationType.Special],\n },\n];\n","import React, { useState, useEffect } from \"react\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Button from \"@mui/material/Button\";\nimport ArrowForwardIos from \"@mui/icons-material/ArrowForwardIos\";\nimport ArrowBackIos from \"@mui/icons-material/ArrowBackIos\";\nimport { ITutorialEvents } from \"./ITutorialEvents\";\nimport { CopyableText } from \"../React/CopyableText\";\n\nimport ListItem from \"@mui/material/ListItem\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\";\nimport StorageIcon from \"@mui/icons-material/Storage\";\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport {\n iTutorialPrevStep,\n iTutorialNextStep,\n ITutorial,\n iTutorialSteps,\n iTutorialEnd,\n} from \"../../InteractiveTutorial\";\n\ninterface IContent {\n content: React.ReactElement;\n canNext: boolean;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n borderBottom: \"1px solid \" + theme.palette.primary.main,\n },\n code: {\n whiteSpace: \"pre\",\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const classes = useStyles();\n\n const contents: { [number: string]: IContent | undefined } = {\n [iTutorialSteps.Start as number]: {\n content: (\n <>\n <Typography>\n Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian\n future... The year is 2077...\n <br />\n <br />\n This tutorial will show you the basics of the game. You may skip the tutorial at any time.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.GoToCharacterPage as number]: {\n content: (\n <>\n <Typography>Let's start by heading to the Stats page. Click</Typography>\n <ListItem>\n <EqualizerIcon color={\"error\"} />\n <Typography color={\"error\"}>Stats</Typography>\n </ListItem>\n\n <Typography>on the main navigation menu (left-hand side of the screen)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.CharacterPage as number]: {\n content: (\n <>\n <ListItem>\n <EqualizerIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Stats</Typography>\n </ListItem>\n <Typography>\n shows a lot of important information about your progress, such as your skills, money, and bonuses.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.CharacterGoToTerminalPage as number]: {\n content: (\n <>\n <Typography>Let's head to your computer's terminal by clicking</Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n <Typography>on the main navigation menu.</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalIntro as number]: {\n content: (\n <>\n <ListItem>\n <LastPageIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Terminal</Typography>\n </ListItem>\n <Typography>\n is used to interface with your home computer as well as all of the other machines around the world.\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHelp as number]: {\n content: (\n <>\n <Typography>Let's try it out. Start by entering</Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>(Don't forget to press Enter after typing the command)</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalLs as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> help\"}</Typography>\n <Typography>\n displays a list of all available Terminal commands, how to use them, and a description of what they do.{\" \"}\n <br />\n <br />\n Let's try another command. Enter\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScan as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> ls\"}</Typography>\n <Typography>\n {\" \"}\n is a basic command that shows files on the computer. Right now, it shows that you have a program called{\" \"}\n NUKE.exe on your computer. We'll get to what this does later. <br />\n <br />\n Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that\n now by first entering\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze1 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan\"}</Typography>\n <Typography>\n shows all available network connections. In other words, it displays a list of all servers that can be\n connected to from your current machine. A server is identified by its hostname. <br />\n <br />\n That's great and all, but there's so many servers. Which one should you go to?{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>gives some more detailed information about servers on the network. Try it now!</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze2 as number]: {\n content: (\n <>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze\"}</Typography>\n <Typography>\n shows more detailed information about each server that you can connect to (servers that are a distance of\n one node away). <br />\n <br /> It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the\n following command:{\" \"}\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalConnect as number]: {\n content: (\n <>\n <Typography>\n Now you can see information about all servers that are up to two nodes away, as well as figure out how to\n navigate to those servers through the network. You can only connect to a server that is one node away. To\n connect to a machine, use\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect hostname\"}</Typography>\n\n <Typography>From the results of </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> scan-analyze 2\"}</Typography>\n\n <Typography>\n {\" \"}\n we can see that the n00dles server is only one node away. Let's connect so it now using:\n </Typography>\n\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> connect n00dles\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalAnalyze as number]: {\n content: (\n <>\n <Typography>\n You are now connected to another machine! What can you do now? You can hack it!\n <br />\n <br /> In the year 2077, currency has become digital and decentralized. People and corporations store their\n money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain\n experience. <br />\n <br />\n Before you try to hack a server, you should run diagnostics using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalNuke as number]: {\n content: (\n <>\n <Typography>When </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n finishes running it will show useful information about hacking the server. <br />\n <br /> For this server, the required hacking skill is only 1, which means you can hack it right now.\n However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier\n on your home computer is a virus that will grant you root access to a machine if there are enough open\n ports.\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> analyze\"}</Typography>\n\n <Typography>\n {\" \"}\n shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead\n and run the virus using{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> run NUKE.exe\"}</Typography>\n\n <Typography></Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalManualHack as number]: {\n content: (\n <>\n <Typography>You now have root access! You can hack the server using </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> 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 and <Typography classes={{ root: classes.textfield }}>{\"[n00dles ~/]> weaken\"}</Typography>\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 }}>{\"[home ~/]> home\"}</Typography>\n\n <Typography>Let's head home before creating our first script!</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalCreateScript as number]: {\n content: (\n <>\n <Typography>\n Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be\n hacking manually the entire time. You can automate your hacking by writing scripts!\n <br />\n <br />\n To create a new script or edit an existing one, you can use{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> nano\"}</Typography>\n\n <Typography>Scripts must end with the .script extension. Let's make a script now by entering </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> nano n00dles.script\"}</Typography>\n\n <Typography>\n after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTypeScript as number]: {\n content: (\n <>\n <Typography>\n This is the script editor. You can use it to program your scripts. Scripts are written in a simplified\n version of javascript. Copy and paste the following code into the script editor: <br />\n </Typography>\n\n <Typography classes={{ root: classes.code }}>\n <CopyableText\n value={`while(true) {\n hack('n00dles');\n}`}\n />\n </Typography>\n <Typography>\n For anyone with basic programming experience, this code should be straightforward. This script will\n continuously hack the n00dles server.\n <br />\n <br />\n To save and close the script editor, press the button in the bottom left, or press ctrl + b.\n </Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalFree as number]: {\n content: (\n <>\n <Typography>\n Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine\n which you have root access to. Different servers have different amounts of RAM. You can also purchase more\n RAM for your home server.\n <br />\n <br />\n To check how much RAM is available on this machine, enter\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> free\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n <Typography>\n We have 8GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> run n00dles.script\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalGoToActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n Your script is now running! It will continuously run in the background and will automatically stop if the\n code ever completes (the n00dles.script will never complete because it runs an infinite loop). <br />\n <br />\n These scripts can passively earn you income and hacking experience. Your scripts will also earn money and\n experience while you are offline, although at a slightly slower rate. <br />\n <br />\n Let's check out some statistics for our running scripts by clicking{\" \"}\n </Typography>\n <ListItem>\n <StorageIcon color={\"error\"} />\n <Typography color={\"error\"}>Active Scripts</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsPage as number]: {\n content: (\n <>\n <Typography>\n This page displays information about all of your scripts that are running across every server. You can use\n this to gauge how well your scripts are doing. Let's go back to\n </Typography>\n <ListItem>\n <LastPageIcon color={\"error\"} />\n <Typography color={\"error\"}>Terminal</Typography>\n </ListItem>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsToTerminal as number]: {\n content: (\n <>\n <Typography>\n One last thing about scripts, each active script contains logs that detail what it's doing. We can check\n these logs using the tail command. Do that now for the script we just ran by typing{\" \"}\n </Typography>\n <Typography classes={{ root: classes.textfield }}>{\"[home ~/]> tail n00dles.script\"}</Typography>\n </>\n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTailScript as number]: {\n content: (\n <>\n <Typography>\n The log for this script won't show much right now (it might show nothing at all) because it just started\n running...but check back again in a few minutes! <br />\n <br />\n This covers the basics of hacking. To learn more about writing scripts, select\n </Typography>\n <ListItem>\n <HelpIcon color={\"primary\"} />\n <Typography color={\"primary\"}>Tutorial</Typography>\n </ListItem>\n <Typography>\n in the main navigation menu to look at the documentation. If you are an experienced JavaScript developer, I\n would highly suggest you check out the section on NetscriptJS/Netscript 2.0, it's faster and more powerful.\n <br />\n <br />\n For now, let's move on to something else!\n </Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.GoToHacknetNodesPage as number]: {\n content: (\n <>\n <Typography>\n Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and\n upgrading Hacknet Nodes. Let's go to\n </Typography>\n <ListItem>\n <AccountTreeIcon color={\"error\"} />\n <Typography color={\"error\"}>Hacknet</Typography>\n </ListItem>\n <Typography>through the main navigation menu now.</Typography>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesIntroduction as number]: {\n content: (\n <Typography>\n here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now.\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesGoToWorldPage as number]: {\n content: (\n <>\n <Typography>\n You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online\n and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.\n <br />\n <br />\n Let's go to\n </Typography>\n <ListItem>\n <LocationCityIcon color={\"error\"} />\n <Typography color={\"error\"}>City</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.WorldDescription as number]: {\n content: (\n <>\n <Typography>\n This page lists all of the different locations you can currently travel to. Each location has something that\n you can do. There's a lot of content out in the world, make sure you explore and discover!\n <br />\n <br />\n Lastly, click on\n </Typography>\n <ListItem>\n <HelpIcon color={\"error\"} />\n <Typography color={\"error\"}>Tutorial</Typography>\n </ListItem>\n </>\n ),\n canNext: true,\n },\n [iTutorialSteps.TutorialPageInfo as number]: {\n content: (\n <Typography>\n This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot,\n but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the\n tutorial. Hope you enjoy the game!\n </Typography>\n ),\n canNext: true,\n },\n [iTutorialSteps.End as number]: {\n content: <Typography></Typography>,\n canNext: true,\n },\n };\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n const step = ITutorial.currStep;\n const content = contents[step];\n if (content === undefined) throw new Error(\"error in the tutorial\");\n return (\n <Paper square sx={{ maxWidth: \"70vw\", p: 2 }}>\n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n <IconButton onClick={iTutorialPrevStep} aria-label=\"previous\">\n <ArrowBackIos />\n </IconButton>\n {content.canNext && (\n <IconButton onClick={iTutorialNextStep} aria-label=\"next\">\n <ArrowForwardIos />\n </IconButton>\n )}\n </>\n )}\n <br />\n <br />\n <Button onClick={iTutorialEnd}>\n {step !== iTutorialSteps.TutorialPageInfo ? \"SKIP TUTORIAL\" : \"FINISH TUTORIAL\"}\n </Button>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport Box from \"@mui/material/Box\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Fab from \"@mui/material/Fab\";\nimport VisibilityOffIcon from \"@mui/icons-material/VisibilityOff\";\nimport VisibilityIcon from \"@mui/icons-material/Visibility\";\nimport { use } from \"../Context\";\nimport { Page } from \"../Router\";\n\nconst useStyles = makeStyles({\n nobackground: {\n backgroundColor: \"#0000\",\n },\n});\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function Overview({ children }: IProps): React.ReactElement {\n const [open, setOpen] = useState(true);\n const classes = useStyles();\n const router = use.Router();\n if (router.page() === Page.BitVerse || router.page() === Page.Loading) return <></>;\n let icon;\n if (open) {\n icon = <VisibilityOffIcon color=\"primary\" />;\n } else {\n icon = <VisibilityIcon color=\"primary\" />;\n }\n return (\n <div style={{ position: \"fixed\", top: 0, right: 0, zIndex: 1500 }}>\n <Box display=\"flex\" justifyContent=\"flex-end\" flexDirection={\"column\"}>\n <Collapse in={open}>{children}</Collapse>\n <Box display=\"flex\" justifyContent=\"flex-end\">\n <Fab classes={{ root: classes.nobackground }} onClick={() => setOpen((old) => !old)}>\n {icon}\n </Fab>\n </Box>\n </Box>\n </div>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport clsx from \"clsx\";\nimport { styled, Theme, CSSObject } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport MuiDrawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport Divider from \"@mui/material/Divider\";\nimport 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 AccountBoxIcon from \"@mui/icons-material/AccountBox\";\nimport PublicIcon from \"@mui/icons-material/Public\";\nimport LiveHelpIcon from \"@mui/icons-material/LiveHelp\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { IRouter, Page } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../../InteractiveTutorial\";\nimport { getAvailableCreatePrograms } from \"../../Programs/ProgramHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { redPillFlag } from \"../../RedPill\";\n\nimport { KEY } from \"../../utils/helpers/keyCodes\";\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}\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.length;\n const programCount = getAvailableCreatePrograms(props.player).length;\n const canCreateProgram =\n programCount > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenFactions =\n props.player.factionInvitations.length > 0 ||\n props.player.factions.length > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenAugmentations =\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenSleeves = props.player.sleeves.length > 0;\n\n // TODO(hydroflame): these should not as any but right now the def is that it\n // can only be defined;\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\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 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 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 || redPillFlag) return;\n if (event.keyCode == KEY.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.keyCode === KEY.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.keyCode === KEY.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.keyCode === KEY.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.keyCode === KEY.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.keyCode === KEY.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.keyCode === KEY.J && event.altKey) {\n event.preventDefault();\n clickJob();\n } else if (event.keyCode === KEY.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.keyCode === KEY.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.keyCode === KEY.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.keyCode === KEY.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.keyCode === KEY.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.keyCode === KEY.B && event.altKey) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.keyCode === KEY.G && event.altKey) {\n event.preventDefault();\n clickGang();\n }\n // if (event.keyCode === KEY.O && event.altKey) {\n // event.preventDefault();\n // gameOptionsBoxOpen();\n // }\n }\n\n document.addEventListener(\"keypress\", handleShortcuts);\n return () => document.removeEventListener(\"keypress\", handleShortcuts);\n }, []);\n\n const classes = useStyles();\n const [open, setOpen] = useState(true);\n const toggleDrawer = (): void => setOpen((old) => !old);\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 primary={<Typography>Bitburner v{CONSTANTS.Version}</Typography>} />\n </ListItem>\n <Divider />\n <List>\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setHackingOpen((old) => !old)}>\n <ListItemIcon>\n <ComputerIcon color=\"primary\" />\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 <LastPageIcon\n color={flashTerminal ? \"error\" : props.page !== Page.Terminal ? \"secondary\" : \"primary\"}\n />\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 <CreateIcon color={props.page !== Page.ScriptEditor ? \"secondary\" : \"primary\"} />\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 <StorageIcon\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n />\n </ListItemIcon>\n <ListItemText>\n <Typography\n color={flashActiveScripts ? \"error\" : props.page !== Page.ActiveScripts ? \"secondary\" : \"primary\"}\n >\n Active Scripts\n </Typography>\n </ListItemText>\n </ListItem>\n {canCreateProgram && (\n <ListItem\n button\n key={\"Create Program\"}\n className={clsx({\n [classes.active]: props.page === Page.CreateProgram,\n })}\n onClick={clickCreateProgram}\n >\n <ListItemIcon>\n <Badge badgeContent={programCount > 0 ? programCount : undefined} color=\"error\">\n <BugReportIcon color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"} />\n </Badge>\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.CreateProgram ? \"secondary\" : \"primary\"}>\n Create Program\n </Typography>\n </ListItemText>\n </ListItem>\n )}\n </List>\n </Collapse>\n\n <Divider />\n <ListItem classes={{ root: classes.listitem }} button onClick={() => setCharacterOpen((old) => !old)}>\n <ListItemIcon>\n <AccountBoxIcon color=\"primary\" />\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 <EqualizerIcon color={flashStats ? \"error\" : props.page !== Page.Stats ? \"secondary\" : \"primary\"} />\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 <ContactsIcon color={![Page.Factions, Page.Faction].includes(props.page) ? \"secondary\" : \"primary\"} />\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 <DoubleArrowIcon\n style={{ transform: \"rotate(-90deg)\" }}\n color={props.page !== Page.Augmentations ? \"secondary\" : \"primary\"}\n />\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 <AccountTreeIcon color={flashHacknet ? \"error\" : props.page !== Page.Hacknet ? \"secondary\" : \"primary\"} />\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 <PeopleAltIcon color={props.page !== Page.Sleeves ? \"secondary\" : \"primary\"} />\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 <PublicIcon color=\"primary\" />\n </ListItemIcon>\n <ListItemText primary={<Typography>World</Typography>} />\n {worldOpen ? <ExpandLessIcon color=\"primary\" /> : <ExpandMoreIcon color=\"primary\" />}\n </ListItem>\n <Collapse in={worldOpen} timeout=\"auto\" unmountOnExit>\n <ListItem\n button\n key={\"City\"}\n className={clsx({\n [classes.active]:\n props.page === Page.City || props.page === Page.Resleeves || props.page === Page.Location,\n })}\n onClick={clickCity}\n >\n <ListItemIcon>\n <LocationCityIcon color={flashCity ? \"error\" : props.page !== Page.City ? \"secondary\" : \"primary\"} />\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 <AirplanemodeActiveIcon color={props.page !== Page.Travel ? \"secondary\" : \"primary\"} />\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 <WorkIcon color={props.page !== Page.Job ? \"secondary\" : \"primary\"} />\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 <TrendingUpIcon color={props.page !== Page.StockMarket ? \"secondary\" : \"primary\"} />\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 <FormatBoldIcon color={props.page !== Page.Bladeburner ? \"secondary\" : \"primary\"} />\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 <BusinessIcon color={props.page !== Page.Corporation ? \"secondary\" : \"primary\"} />\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 <SportsMmaIcon color={props.page !== Page.Gang ? \"secondary\" : \"primary\"} />\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 <LiveHelpIcon color=\"primary\" />\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 <CheckIcon color={props.page !== Page.Milestones ? \"secondary\" : \"primary\"} />\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 <HelpIcon color={flashTutorial ? \"error\" : props.page !== Page.Tutorial ? \"secondary\" : \"primary\"} />\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={\"Options\"}\n className={clsx({\n [classes.active]: props.page === Page.Options,\n })}\n onClick={clickOptions}\n >\n <ListItemIcon>\n <SettingsIcon color={props.page !== Page.Options ? \"secondary\" : \"primary\"} />\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 <DeveloperBoardIcon color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"} />\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.DevMenu ? \"secondary\" : \"primary\"}>Dev</Typography>\n </ListItemText>\n </ListItem>\n )}\n </Collapse>\n </List>\n </Drawer>\n );\n}\n","/**\n * Root React component for the Augmentations UI page that display all of your\n * owned and purchased Augmentations and Source-Files.\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\nimport { SourceFiles } from \"./SourceFiles\";\n\nimport { canGetBonus } from \"../../ExportBonus\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n}\n\nexport function AugmentationsRoot(props: IProps): React.ReactElement {\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 return (\n <>\n <Typography variant=\"h4\">Augmentations</Typography>\n <Box mx={2}>\n <Typography>\n Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to\n install them.\n </Typography>\n <Typography>WARNING: Installing your Augmentations resets most of your progress, including:</Typography>\n <br />\n <Typography>- Stats/Skill levels and Experience</Typography>\n <Typography>- Money</Typography>\n <Typography>- Scripts on every computer but your home computer</Typography>\n <Typography>- Purchased servers</Typography>\n <Typography>- Hacknet Nodes</Typography>\n <Typography>- Faction/Company reputation</Typography>\n <Typography>- Stocks</Typography>\n <br />\n <Typography>\n Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations\n you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you\n will lose all programs besides NUKE.exe)\n </Typography>\n </Box>\n <Typography variant=\"h4\" color=\"primary\">\n Purchased Augmentations\n </Typography>\n <Box mx={2}>\n <Tooltip title={<Typography>'I never asked for this'</Typography>}>\n <span>\n <Button disabled={player.queuedAugmentations.length === 0} onClick={props.installAugmentationsFn}>\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={{ mx: 2 }} onClick={doExport} color=\"error\">\n Backup Save {exportBonusStr()}\n </Button>\n </Tooltip>\n <PurchasedAugmentations />\n </Box>\n <Typography variant=\"h4\">Installed Augmentations</Typography>\n <Box mx={2}>\n <Typography>\n List of all Augmentations that have been installed. You have gained the effects of these.\n </Typography>\n <InstalledAugmentations />\n </Box>\n <PlayerMultipliers />\n <SourceFiles />\n </>\n );\n}\n","/**\n * React Component for displaying all of the player's installed Augmentations and\n * Source-Files.\n *\n * It also contains 'configuration' buttons that allow you to change how the\n * Augs/SF's are displayed\n */\nimport React, { useState } from \"react\";\n\nimport { AugmentationAccordion } from \"../../ui/React/AugmentationAccordion\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport List from \"@mui/material/List\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const player = use.Player();\n\n const sourceAugs = player.augmentations.slice();\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceAugs.sort((aug1, aug2) => {\n return aug1.name <= aug2.name ? -1 : 1;\n });\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n rerender();\n }\n\n function sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n rerender();\n }\n\n return (\n <>\n <Tooltip title={\"Sorts the Augmentations alphabetically in numeral order\"}>\n <Button onClick={sortInOrder}>Sort in Order</Button>\n </Tooltip>\n <Tooltip title={\"Sorts the Augmentations based on when you acquired them (same as default)\"}>\n <Button sx={{ mx: 2 }} onClick={sortByAcquirementTime}>\n Sort by Acquirement Time\n </Button>\n </Tooltip>\n <List dense>\n {sourceAugs.map((e) => {\n const aug = Augmentations[e.name];\n\n let level = null;\n if (e.name === AugmentationNames.NeuroFluxGovernor) {\n level = e.level;\n }\n\n return <AugmentationAccordion key={aug.name} aug={aug} level={level} />;\n })}\n </List>\n </>\n );\n}\n","/**\n * React component for displaying the player's multipliers on the Augmentation UI page\n */\nimport * as React from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentations } from \"../Augmentations\";\nimport { Table, TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\nfunction calculateAugmentedStats(): any {\n const augP: any = {};\n for (const aug of Player.queuedAugmentations) {\n const augObj = Augmentations[aug.name];\n for (const mult in augObj.mults) {\n const v = augP[mult] ? augP[mult] : 1;\n augP[mult] = v * augObj.mults[mult];\n }\n }\n return augP;\n}\n\nfunction Improvements({ r }: { r: number }): React.ReactElement {\n if (r) {\n return (\n <>\n <TableCell key=\"2\">\n <Typography> {\"=>\"} </Typography>\n </TableCell>\n <TableCell key=\"3\">\n <Typography>{numeralWrapper.formatPercentage(r)}</Typography>\n </TableCell>\n </>\n );\n }\n return <></>;\n}\n\nfunction MultiplierTable({ rows }: { rows: [string, number, number][] }): React.ReactElement {\n return (\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {rows.map((r: any) => (\n <TableRow key={r[0]}>\n <TableCell key=\"0\">\n <Typography noWrap>{r[0]} multiplier: </Typography>\n </TableCell>\n <TableCell key=\"1\" style={{ textAlign: \"right\" }}>\n <Typography noWrap>{numeralWrapper.formatPercentage(r[1])}</Typography>\n </TableCell>\n <Improvements r={r[2]} />\n </TableRow>\n ))}\n </TableBody>\n </Table>\n );\n}\n\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n function BladeburnerMults(): React.ReactElement {\n if (!Player.canAccessBladeburner()) return <></>;\n return (\n <>\n <MultiplierTable\n rows={[\n [\n \"Bladeburner Success Chance\",\n Player.bladeburner_success_chance_mult,\n Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,\n ],\n [\n \"Bladeburner Max Stamina\",\n Player.bladeburner_max_stamina_mult,\n Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,\n ],\n [\n \"Bladeburner Stamina Gain\",\n Player.bladeburner_stamina_gain_mult,\n Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,\n ],\n [\n \"Bladeburner Field Analysis\",\n Player.bladeburner_analysis_mult,\n Player.bladeburner_analysis_mult * mults.bladeburner_analysis_mult,\n ],\n ]}\n />\n <br />\n </>\n );\n }\n\n return (\n <>\n <Typography variant=\"h4\">Multipliers</Typography>\n <Box mx={2}>\n <MultiplierTable\n rows={[\n [\"Hacking Chance \", Player.hacking_chance_mult, Player.hacking_chance_mult * mults.hacking_chance_mult],\n [\"Hacking Speed \", Player.hacking_speed_mult, Player.hacking_speed_mult * mults.hacking_speed_mult],\n [\"Hacking Money \", Player.hacking_money_mult, Player.hacking_money_mult * mults.hacking_money_mult],\n [\"Hacking Growth \", Player.hacking_grow_mult, Player.hacking_grow_mult * mults.hacking_grow_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Hacking Level \", Player.hacking_mult, Player.hacking_mult * mults.hacking_mult],\n [\"Hacking Experience \", Player.hacking_exp_mult, Player.hacking_exp_mult * mults.hacking_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Strength Level \", Player.strength_mult, Player.strength_mult * mults.strength_mult],\n [\"Strength Experience \", Player.strength_exp_mult, Player.strength_exp_mult * mults.strength_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Defense Level \", Player.defense_mult, Player.defense_mult * mults.defense_mult],\n [\"Defense Experience \", Player.defense_exp_mult, Player.defense_exp_mult * mults.defense_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Dexterity Level \", Player.dexterity_mult, Player.dexterity_mult * mults.dexterity_mult],\n [\"Dexterity Experience \", Player.dexterity_exp_mult, Player.dexterity_exp_mult * mults.dexterity_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Agility Level \", Player.agility_mult, Player.agility_mult * mults.agility_mult],\n [\"Agility Experience \", Player.agility_exp_mult, Player.agility_exp_mult * mults.agility_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Charisma Level \", Player.charisma_mult, Player.charisma_mult * mults.charisma_mult],\n [\"Charisma Experience \", Player.charisma_exp_mult, Player.charisma_exp_mult * mults.charisma_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Hacknet Node production \",\n Player.hacknet_node_money_mult,\n Player.hacknet_node_money_mult * mults.hacknet_node_money_mult,\n ],\n [\n \"Hacknet Node purchase cost \",\n Player.hacknet_node_purchase_cost_mult,\n Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,\n ],\n [\n \"Hacknet Node RAM upgrade cost \",\n Player.hacknet_node_ram_cost_mult,\n Player.hacknet_node_ram_cost_mult * mults.hacknet_node_ram_cost_mult,\n ],\n [\n \"Hacknet Node Core purchase cost \",\n Player.hacknet_node_core_cost_mult,\n Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,\n ],\n [\n \"Hacknet Node level upgrade cost \",\n Player.hacknet_node_level_cost_mult,\n Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,\n ],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Company reputation gain \", Player.company_rep_mult, Player.company_rep_mult * mults.company_rep_mult],\n [\"Faction reputation gain \", Player.faction_rep_mult, Player.faction_rep_mult * mults.faction_rep_mult],\n [\"Salary \", Player.work_money_mult, Player.work_money_mult * mults.work_money_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Crime success \", Player.crime_success_mult, Player.crime_success_mult * mults.crime_success_mult],\n [\"Crime money \", Player.crime_money_mult, Player.crime_money_mult * mults.crime_money_mult],\n ]}\n />\n <br />\n\n <BladeburnerMults />\n </Box>\n </>\n );\n}\n","/**\n * React component for displaying all of the player's purchased (but not installed)\n * Augmentations on the Augmentations UI.\n */\nimport * as React from \"react\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\n\nimport { AugmentationAccordion } from \"../../ui/React/AugmentationAccordion\";\nimport List from \"@mui/material/List\";\n\nexport function PurchasedAugmentations(): React.ReactElement {\n const augs: React.ReactElement[] = [];\n // Only render the last NeuroFlux (there are no findLastIndex btw)\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; i++) {\n const ownedAug = Player.queuedAugmentations[i];\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = Augmentations[ownedAug.name];\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n }\n\n augs.push(<AugmentationAccordion key={aug.name} aug={aug} level={level} />);\n }\n\n return <List dense>{augs}</List>;\n}\n","import React from \"react\";\nimport { SourceFileMinus1 } from \"./SourceFileMinus1\";\nimport { OwnedSourceFiles } from \"./OwnedSourceFiles\";\nimport List from \"@mui/material/List\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\n\nexport function SourceFiles(): React.ReactElement {\n return (\n <>\n <Typography variant=\"h4\">Source Files</Typography>\n <Box mx={2}>\n <List dense>\n <SourceFileMinus1 />\n <OwnedSourceFiles />\n </List>\n </Box>\n </>\n );\n}\n","/**\n * React Component for displaying a list of the player's Source-Files\n * on the Augmentations UI\n */\nimport React, { useState } from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\nexport function SourceFileMinus1(): React.ReactElement {\n const [open, setOpen] = useState(false);\n const exploits = Player.exploits;\n\n if (exploits.length === 0) {\n return <></>;\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText\n primary={\n <Typography style={{ whiteSpace: \"pre-wrap\" }}>\n Source-File -1: Exploits in the BitNodes\n <br />\n Level {exploits.length} / ?\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n </Typography>\n <Typography>It increases all of the player's multipliers by 0.1%</Typography>\n <br />\n\n <Typography>You have found the following exploits:</Typography>\n <Box mx={2}>\n {exploits.map((c: Exploit) => (\n <Typography key={c}>* {ExploitName(c)}</Typography>\n ))}\n </Box>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","/**\n * React Component for displaying a list of the player's Source-Files\n * on the Augmentations UI\n */\nimport * as React from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\nimport { SourceFileAccordion } from \"../../ui/React/SourceFileAccordion\";\n\nexport function OwnedSourceFiles(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n return (\n <>\n {sourceSfs.map((e) => {\n const srcFileKey = \"SourceFile\" + e.n;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${e.n}`);\n return null;\n }\n\n return <SourceFileAccordion key={e.n} level={e.lvl} sf={sfObj} />;\n })}\n </>\n );\n}\n","/**\n * React Component for displaying a single Source-File as an accordion.\n *\n * The header of the accordion contains the Source-Files's name and level,\n * and the accordion's panel contains the Source-File's description.\n */\nimport React, { useState } from \"react\";\n\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\ntype IProps = {\n level: number;\n sf: SourceFile;\n};\n\nexport function SourceFileAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const maxLevel = props.sf.n === 12 ? \"∞\" : \"3\";\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText\n primary={\n <Typography style={{ whiteSpace: \"pre-wrap\" }}>\n {props.sf.name}\n <br />\n {`Level ${props.level} / ${maxLevel}`}\n </Typography>\n }\n />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\n <Typography>{props.sf.info}</Typography>\n </Box>\n </Collapse>\n </Box>\n );\n}\n","import { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { IEngine } from \"./IEngine\";\nimport { IRouter } from \"./ui/Router\";\n\nimport React 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 { TimeSkip } from \"./DevMenu/ui/TimeSkip\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n router: IRouter;\n}\n\nexport function DevMenuRoot(props: IProps): React.ReactElement {\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\n <TimeSkip player={props.player} engine={props.engine} />\n </>\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 { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function General(props: IProps): React.ReactElement {\n function addMoney(n: number) {\n return function () {\n props.player.gainMoney(n);\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 return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>General</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <Button onClick={addMoney(1e6)}>\n <pre>\n + <Money money={1e6} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e9)}>\n <pre>\n + <Money money={1e9} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e12)}>\n <pre>\n + <Money money={1e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(1e15)}>\n <pre>\n + <Money money={1000e12} />\n </pre>\n </Button>\n <Button onClick={addMoney(Infinity)}>\n <pre>\n + <Money money={Infinity} />\n </pre>\n </Button>\n <Button onClick={upgradeRam}>+ RAM</Button>\n <br />\n\n <Button onClick={quickB1tFlum3}>Quick b1t_flum3.exe</Button>\n <Button onClick={b1tflum3}>Run b1t_flum3.exe</Button>\n <Button onClick={quickHackW0r1dD43m0n}>Quick w0rld_d34m0n</Button>\n <Button onClick={hackW0r1dD43m0n}>Hack w0rld_d34m0n</Button>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n function modifyExp(stat: string, modifier: number) {\n return function (exp: number) {\n switch (stat) {\n case \"hacking\":\n if (exp) {\n props.player.gainHackingExp(exp * modifier);\n }\n break;\n case \"strength\":\n if (exp) {\n props.player.gainStrengthExp(exp * modifier);\n }\n break;\n case \"defense\":\n if (exp) {\n props.player.gainDefenseExp(exp * modifier);\n }\n break;\n case \"dexterity\":\n if (exp) {\n props.player.gainDexterityExp(exp * modifier);\n }\n break;\n case \"agility\":\n if (exp) {\n props.player.gainAgilityExp(exp * modifier);\n }\n break;\n case \"charisma\":\n if (exp) {\n props.player.gainCharismaExp(exp * modifier);\n }\n break;\n case \"intelligence\":\n if (exp) {\n props.player.gainIntelligenceExp(exp * modifier);\n }\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function modifyKarma(modifier: number) {\n return function (amt: number) {\n props.player.karma += amt * modifier;\n };\n }\n\n function tonsOfExp(): void {\n props.player.gainHackingExp(bigNumber);\n props.player.gainStrengthExp(bigNumber);\n props.player.gainDefenseExp(bigNumber);\n props.player.gainDexterityExp(bigNumber);\n props.player.gainAgilityExp(bigNumber);\n props.player.gainCharismaExp(bigNumber);\n props.player.gainIntelligenceExp(bigNumber);\n props.player.updateSkillLevels();\n }\n\n function resetAllExp(): void {\n props.player.hacking_exp = 0;\n props.player.strength_exp = 0;\n props.player.defense_exp = 0;\n props.player.dexterity_exp = 0;\n props.player.agility_exp = 0;\n props.player.charisma_exp = 0;\n props.player.intelligence_exp = 0;\n props.player.updateSkillLevels();\n }\n\n function resetExperience(stat: string): () => void {\n return function () {\n switch (stat) {\n case \"hacking\":\n props.player.hacking_exp = 0;\n break;\n case \"strength\":\n props.player.strength_exp = 0;\n break;\n case \"defense\":\n props.player.defense_exp = 0;\n break;\n case \"dexterity\":\n props.player.dexterity_exp = 0;\n break;\n case \"agility\":\n props.player.agility_exp = 0;\n break;\n case \"charisma\":\n props.player.charisma_exp = 0;\n break;\n case \"intelligence\":\n props.player.intelligence_exp = 0;\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function resetKarma(): () => void {\n return function () {\n props.player.karma = 0;\n };\n }\n\n function enableIntelligence(): void {\n if (props.player.intelligence === 0) {\n props.player.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.intelligence_exp = 0;\n props.player.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Experience / Stats</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>All:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfExp}>Tons of exp</Button>\n <Button onClick={resetAllExp}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Hacking:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"hacking\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"hacking\", 1)(bigNumber)}\n add={modifyExp(\"hacking\", 1)}\n subtract={modifyExp(\"hacking\", -1)}\n reset={resetExperience(\"hacking\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Strength:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"strength\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"strength\", 1)(bigNumber)}\n add={modifyExp(\"strength\", 1)}\n subtract={modifyExp(\"strength\", -1)}\n reset={resetExperience(\"strength\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Defense:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"defense\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"defense\", 1)(bigNumber)}\n add={modifyExp(\"defense\", 1)}\n subtract={modifyExp(\"defense\", -1)}\n reset={resetExperience(\"defense\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Dexterity:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"dexterity\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"dexterity\", 1)(bigNumber)}\n add={modifyExp(\"dexterity\", 1)}\n subtract={modifyExp(\"dexterity\", -1)}\n reset={resetExperience(\"dexterity\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Agility:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"agility\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"agility\", 1)(bigNumber)}\n add={modifyExp(\"agility\", 1)}\n subtract={modifyExp(\"agility\", -1)}\n reset={resetExperience(\"agility\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Charisma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"charisma\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"charisma\", 1)(bigNumber)}\n add={modifyExp(\"charisma\", 1)}\n subtract={modifyExp(\"charisma\", -1)}\n reset={resetExperience(\"charisma\")}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Intelligence:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"intelligence\"\n placeholder=\"exp\"\n tons={() => modifyExp(\"intelligence\", 1)(bigNumber)}\n add={modifyExp(\"intelligence\", 1)}\n subtract={modifyExp(\"intelligence\", -1)}\n reset={resetExperience(\"intelligence\")}\n />\n </td>\n <td>\n <Button onClick={enableIntelligence}>Enable</Button>\n </td>\n <td>\n <Button onClick={disableIntelligence}>Disable</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Karma:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"karma\"\n placeholder=\"amt\"\n tons={() => modifyExp(\"intelligence\", 1)(100000)}\n add={modifyKarma(1)}\n subtract={modifyKarma(-1)}\n reset={resetKarma()}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Factions as AllFaction } from \"../../Faction/Factions\";\nimport FormControl from \"@mui/material/FormControl\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport InputLabel from \"@mui/material/InputLabel\";\n\nconst bigNumber = 1e12;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Factions(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(\"Illuminati\");\n\n function setFactionDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value as string);\n }\n\n function receiveInvite(): void {\n props.player.receiveInvite(faction);\n }\n\n function receiveAllInvites(): void {\n for (const i in AllFaction) {\n props.player.receiveInvite(AllFaction[i].name);\n }\n }\n\n function modifyFactionRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(reputation)) {\n fac.playerReputation += reputation * modifier;\n }\n };\n }\n\n function resetFactionRep(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.playerReputation = 0;\n }\n }\n\n function modifyFactionFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(favor)) {\n fac.favor += favor * modifier;\n }\n };\n }\n\n function resetFactionFavor(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.favor = 0;\n }\n }\n\n function tonsOfRep(): void {\n for (const i in AllFaction) {\n AllFaction[i].playerReputation = bigNumber;\n }\n }\n\n function resetAllRep(): void {\n for (const i in AllFaction) {\n AllFaction[i].playerReputation = 0;\n }\n }\n\n function tonsOfFactionFavor(): void {\n for (const i in AllFaction) {\n AllFaction[i].favor = bigNumber;\n }\n }\n\n function resetAllFactionFavor(): void {\n for (const i in AllFaction) {\n AllFaction[i].favor = 0;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Factions</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Faction:</Typography>\n </td>\n <td>\n <FormControl>\n <InputLabel id=\"factions-select\">Faction</InputLabel>\n <Select\n labelId=\"factions-select\"\n id=\"factions-dropdown\"\n onChange={setFactionDropdown}\n value={faction}\n startAdornment={\n <>\n <IconButton onClick={receiveAllInvites} size=\"large\" arial-label=\"receive-all-invitation\">\n <ReplyAllIcon />\n </IconButton>\n <IconButton onClick={receiveInvite} size=\"large\" arial-label=\"receive-one-invitation\">\n <ReplyIcon />\n </IconButton>\n </>\n }\n >\n {Object.values(AllFaction).map((faction) => (\n <MenuItem key={faction.name} value={faction.name}>\n {faction.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Reputation:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"reputation\"\n placeholder=\"amt\"\n tons={() => modifyFactionRep(1)(bigNumber)}\n add={modifyFactionRep(1)}\n subtract={modifyFactionRep(-1)}\n reset={resetFactionRep}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Favor:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"favor\"\n placeholder=\"amt\"\n tons={() => modifyFactionFavor(1)(2000)}\n add={modifyFactionFavor(1)}\n subtract={modifyFactionFavor(-1)}\n reset={resetFactionFavor}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Reputation:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfRep}>Tons</Button>\n <Button onClick={resetAllRep}>Reset</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>All Favor:</Typography>\n </td>\n <td>\n <Button onClick={tonsOfFactionFavor}>Tons</Button>\n <Button onClick={resetAllFactionFavor}>Reset</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Augmentations(props: IProps): React.ReactElement {\n const [augmentation, setAugmentation] = useState(\"Augmented Targeting I\");\n\n function setAugmentationDropdown(event: SelectChangeEvent<string>): void {\n setAugmentation(event.target.value as string);\n }\n function queueAug(): void {\n props.player.queueAugmentation(augmentation);\n }\n\n function queueAllAugs(): void {\n for (const i in AugmentationNames) {\n const augName = AugmentationNames[i];\n props.player.queueAugmentation(augName);\n }\n }\n\n function clearAugs(): void {\n props.player.augmentations = [];\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Augmentations</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Typography>Aug:</Typography>\n </td>\n <td>\n <Select\n onChange={setAugmentationDropdown}\n value={augmentation}\n startAdornment={\n <>\n <IconButton onClick={queueAllAugs} size=\"large\">\n <ReplyAllIcon />\n </IconButton>\n <IconButton onClick={queueAug} size=\"large\">\n <ReplyIcon />\n </IconButton>\n </>\n }\n endAdornment={\n <>\n <IconButton onClick={clearAugs} size=\"large\">\n <ClearIcon />\n </IconButton>\n </>\n }\n >\n {Object.values(AugmentationNames).map((aug) => (\n <MenuItem key={aug} value={aug}>\n {aug}\n </MenuItem>\n ))}\n </Select>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\n\n// Update as additional BitNodes get implemented\nconst validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\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 (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 in 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 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={maxMoney}>Max one</Button>\n </td>\n <td>\n <Button onClick={maxAllMoney}>Max all</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Companies as AllCompanies } from \"../../Company/Companies\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { Adjuster } from \"./Adjuster\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(\"ECorp\");\n function setCompanyDropdown(event: SelectChangeEvent<string>): void {\n setCompany(event.target.value as string);\n }\n function resetCompanyRep(): void {\n AllCompanies[company].playerReputation = 0;\n }\n\n function modifyCompanyRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(reputation)) {\n c.playerReputation += reputation * modifier;\n }\n };\n }\n\n function modifyCompanyFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(favor)) {\n c.favor += favor * modifier;\n }\n };\n }\n\n function resetCompanyFavor(): void {\n AllCompanies[company].favor = 0;\n }\n\n function tonsOfRepCompanies(): void {\n for (const c in AllCompanies) {\n AllCompanies[c].playerReputation = bigNumber;\n }\n }\n\n function resetAllRepCompanies(): void {\n for (const c in AllCompanies) {\n AllCompanies[c].playerReputation = 0;\n }\n }\n\n function tonsOfFavorCompanies(): void {\n for (const c in AllCompanies) {\n AllCompanies[c].favor = bigNumber;\n }\n }\n\n function resetAllFavorCompanies(): void {\n for (const c in 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.plus(1e99);\n }\n }\n\n function resetCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds.minus(props.player.corporation.funds);\n }\n }\n\n function addTonsCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = bigNumber;\n }\n }\n\n function modifyCorporationCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = 0;\n }\n }\n\n function finishCorporationProducts(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n Object.keys(div.products).forEach((prod) => {\n const product = div.products[prod];\n if (product === undefined) throw new Error(\"Impossible product undefined\");\n product.prog = 99.9;\n });\n });\n }\n\n function addCorporationResearch(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n div.sciResearch.qty += 1e10;\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Corporation</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Button onClick={addTonsCorporationFunds}>Tons of funds</Button>\n <Button onClick={resetCorporationFunds}>Reset funds</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Typography>Cycles:</Typography>\n </td>\n <td>\n <Adjuster\n label=\"cycles\"\n placeholder=\"amt\"\n tons={addTonsCorporationCycles}\n add={modifyCorporationCycles(1)}\n subtract={modifyCorporationCycles(-1)}\n reset={resetCorporationCycles}\n />\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={finishCorporationProducts}>Finish products</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button onClick={addCorporationResearch}>Tons of research</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { generateContract, generateRandomContract, generateRandomContractOnHome } from \"../../CodingContractGenerator\";\nimport { CodingContractTypes } from \"../../CodingContracts\";\n\nexport function CodingContracts(): React.ReactElement {\n const [codingcontract, setCodingcontract] = useState(\"Find Largest Prime Factor\");\n function setCodingcontractDropdown(event: SelectChangeEvent<string>): void {\n setCodingcontract(event.target.value as string);\n }\n\n function specificContract(): void {\n generateContract({\n problemType: codingcontract,\n server: \"home\",\n });\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <Typography>Coding Contracts</Typography>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <Button onClick={generateRandomContract}>Generate Random Contract</Button>\n <Button onClick={generateRandomContractOnHome}>Generate Random Contract on Home Comp</Button>\n </td>\n </tr>\n <tr>\n <td>\n <Select onChange={setCodingcontractDropdown} value={codingcontract}>\n {Object.values(CodingContractTypes).map((cc) => (\n <MenuItem key={cc.name} value={cc.name}>\n {cc.name}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={specificContract}>Generate Specified Contract Type on Home Comp</Button>\n </td>\n </tr>\n </tbody>\n </table>\n </AccordionDetails>\n </Accordion>\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { StockMarket as SM } from \"../../StockMarket/StockMarket\";\nimport { Stock } from \"../../StockMarket/Stock\";\n\nexport function StockMarket(): React.ReactElement {\n const [stockPrice, setStockPrice] = useState(0);\n const [stockSymbol, setStockSymbol] = useState(\"\");\n\n function setStockPriceField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockPrice(parseFloat(event.target.value));\n }\n\n function setStockSymbolField(event: React.ChangeEvent<HTMLInputElement>): void {\n setStockSymbol(event.target.value);\n }\n\n function processStocks(sub: (arg0: Stock) => void): void {\n const inputSymbols = stockSymbol.replace(/\\s/g, \"\");\n\n let match: (symbol: string) => boolean = (): boolean => {\n return true;\n };\n\n if (inputSymbols !== \"\" && inputSymbols !== \"all\") {\n match = function (symbol: string): boolean {\n return inputSymbols.split(\",\").includes(symbol);\n };\n }\n\n for (const name in 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\";\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 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 </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, useEffect } from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { use } from \"../../ui/Context\";\nimport Grid from \"@mui/material/Grid\";\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 <Grid container>\n <Grid item xs={6}>\n <Stats bladeburner={bladeburner} player={player} router={router} />\n </Grid>\n <Grid item xs={6}>\n <Console bladeburner={bladeburner} player={player} />\n </Grid>\n </Grid>\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 { StatsTable } from \"../../ui/React/StatsTable\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { TravelModal } from \"./TravelModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n const [travelOpen, setTravelOpen] = useState(false);\n const setRerender = useState(false)[1];\n\n const inFaction = props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction;\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function openFaction(): void {\n if (!inFaction) return;\n const faction = Factions[\"Bladeburners\"];\n if (!faction.isMember) {\n joinFaction(faction);\n }\n\n props.router.toFaction(faction);\n }\n\n return (\n <Paper sx={{ p: 1 }}>\n <Box display=\"flex\">\n <Tooltip title={<Typography>Your rank within the Bladeburner division.</Typography>}>\n <Typography>Rank: {formatNumber(props.bladeburner.rank, 2)}</Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Performing actions will use up your stamina.\n <br />\n <br />\n Your max stamina is determined primarily by your agility stat.\n <br />\n <br />\n Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads\n to a higher gain rate.\n <br />\n <br />\n Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of\n your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this\n means your success rate would be multipled by 85% (100 - 15).\n <br />\n <br />\n Your max stamina and stamina gain rate can also be increased by training, or through skills and\n Augmentation upgrades.\n </Typography>\n }\n >\n <Typography>\n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <Typography>\n Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%\n </Typography>\n <br />\n <Typography>Team Size: {formatNumber(props.bladeburner.teamSize, 0)}</Typography>\n <Typography>Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}</Typography>\n <br />\n <Typography>Num Times Hospitalized: {props.bladeburner.numHosp}</Typography>\n <Typography>\n Money Lost From Hospitalizations: <Money money={props.bladeburner.moneyLost} />\n </Typography>\n <br />\n <Typography>Current City: {props.bladeburner.city}</Typography>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An accurate\n population count increases success rate estimates.\n </Typography>\n }\n >\n <Typography>\n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.\n </Typography>\n }\n >\n <Typography>\n Est. Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}\n </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 <StatsTable\n rows={[\n [\"Aug. Success Chance mult: \", formatNumber(props.player.bladeburner_success_chance_mult * 100, 1) + \"%\"],\n [\"Aug. Max Stamina mult: \", formatNumber(props.player.bladeburner_max_stamina_mult * 100, 1) + \"%\"],\n [\"Aug. Stamina Gain mult: \", formatNumber(props.player.bladeburner_stamina_gain_mult * 100, 1) + \"%\"],\n [\"Aug. Field Analysis mult: \", formatNumber(props.player.bladeburner_analysis_mult * 100, 1) + \"%\"],\n ]}\n />\n <br />\n <Button onClick={() => setTravelOpen(true)}>Travel</Button>\n <Tooltip title={!inFaction ? <Typography>Rank 25 required.</Typography> : \"\"}>\n <span>\n <Button disabled={!inFaction} onClick={openFaction}>\n Faction\n </Button>\n </span>\n </Tooltip>\n <TravelModal open={travelOpen} onClose={() => setTravelOpen(false)} bladeburner={props.bladeburner} />\n </Paper>\n );\n}\n","import React from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in\n for your Bladeburner duties does not affect your location in the game otherwise.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.bladeburner.city as CityName} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Paper from \"@mui/material/Paper\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ILineProps {\n content: any;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n width: \"100%\",\n },\n input: {\n backgroundColor: \"#000\",\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 scrollHook = useRef<HTMLDivElement>(null);\n const [command, setCommand] = useState(\"\");\n const setRerender = useState(false)[1];\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 // TODO: Figure out how to actually make the scrolling work correctly.\n function scrollToBottom(): void {\n if (!scrollHook.current) return;\n scrollHook.current.scrollTop = scrollHook.current.scrollHeight;\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n const id2 = setInterval(scrollToBottom, 100);\n return () => {\n clearInterval(id);\n clearInterval(id2);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) {\n event.preventDefault();\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(props.player, command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n setCommand(\"\");\n }\n }\n\n const consoleHistory = props.bladeburner.consoleHistory;\n\n if (event.keyCode === 38) {\n // up\n let i = consoleHistoryIndex;\n const len = consoleHistory.length;\n if (len === 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n if (i !== 0) {\n i = i - 1;\n }\n setConsoleHistoryIndex(i);\n const prevCommand = consoleHistory[i];\n event.currentTarget.value = prevCommand;\n }\n\n if (event.keyCode === 40) {\n const i = consoleHistoryIndex;\n const len = consoleHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n setConsoleHistoryIndex(len);\n event.currentTarget.value = \"\";\n } else {\n setConsoleHistoryIndex(consoleHistoryIndex + 1);\n const prevCommand = consoleHistory[consoleHistoryIndex + 1];\n event.currentTarget.value = prevCommand;\n }\n }\n }\n\n return (\n <Box height={\"60vh\"} display={\"flex\"} alignItems={\"stretch\"} component={Paper}>\n <Box>\n <List sx={{ height: \"100%\", overflow: \"auto\" }}>\n {props.bladeburner.consoleLogs.map((log: any, i: number) => (\n <Line key={i} content={log} />\n ))}\n <TextField\n classes={{ root: classes.textfield }}\n autoFocus\n tabIndex={1}\n type=\"text\"\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 </List>\n <div ref={scrollHook}></div>\n </Box>\n </Box>\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 in 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 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 <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 <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>\n <CopyableText value={props.action.name} />\n </Typography>\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's unit 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};\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you\n to lose HP, which can lead to hospitalization.\n <br />\n <br />\n You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more\n difficult, but grant more rank, experience, and money.\n </Typography>\n <ContractList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { ContractElem } from \"./ContractElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.contracts);\n const contracts = props.bladeburner.contracts;\n return (\n <>\n {names.map((name: string) => (\n <ContractElem key={name} bladeburner={props.bladeburner} action={contracts[name]} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Contracts } from \"../data/Contracts\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner);\n\n const actionData = Contracts[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Contract}\n name={props.action.name}\n rerender={rerender}\n />\n </>\n )}\n <br />\n <br />\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Contracts remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const Contracts: {\n [key: string]: IContract | undefined;\n} = {\n Tracking: {\n desc: (\n <>\n Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT\n engage. Stealth is of the utmost importance.\n <br />\n <br />\n Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever\n city you are currently in.\n </>\n ),\n },\n \"Bounty Hunter\": {\n desc: (\n <>\n Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.\n <br />\n <br />\n Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n Retirement: {\n desc: (\n <>\n Hunt down and retire (kill) rogue Synthoids.\n <br />\n <br />\n Successfully completing a Retirement contract will lower the population in your current city, and will also\n increase its chaos level.\n </>\n ),\n },\n};\n","import React from \"react\";\nimport { stealthIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function StealthIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves stealth</Typography>}>{stealthIcon}</Tooltip>;\n}\n","import React from \"react\";\nimport { killIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function KillIcon(): React.ReactElement {\n return <Tooltip title={<Typography>This action involves retirement</Typography>}>{killIcon}</Tooltip>;\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It\n will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more\n punishing than contracts, but are also more rewarding.\n <br />\n <br />\n Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary\n between different Operations.\n <br />\n <br />\n For operations, you can use a team. You must first recruit team members. Having a larger team will improves your\n chances of success.\n <br />\n <br />\n You can unlock higher-level operations by successfully completing them. Higher-level operations are more\n difficult, but grant more rank and experience.\n </Typography>\n <OperationList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { OperationElem } from \"./OperationElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.operations);\n const operations = props.bladeburner.operations;\n return (\n <>\n {names.map((name: string) => (\n <OperationElem key={name} bladeburner={props.bladeburner} action={operations[name]} player={props.player} />\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Operation } from \"../Operation\";\nimport { Operations } from \"../data/Operations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: Operation;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner);\n\n const actionData = Operations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n {isActive ? (\n <>\n <Typography>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </Typography>\n <Typography>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </Typography>\n </>\n ) : (\n <>\n <CopyableText value={props.action.name} />\n <StartButton\n bladeburner={props.bladeburner}\n type={ActionTypes.Operation}\n name={props.action.name}\n rerender={rerender}\n />\n <TeamSizeButton action={props.action} bladeburner={props.bladeburner} />\n </>\n )}\n <br />\n <br />\n\n <ActionLevel action={props.action} bladeburner={props.bladeburner} isActive={isActive} rerender={rerender} />\n <br />\n <br />\n <Typography>\n {actionData.desc}\n <br />\n <br />\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n <br />\n Operations remaining: {Math.floor(props.action.count)}\n <br />\n Successes: {props.action.successes}\n <br />\n Failures: {props.action.failures}\n </Typography>\n <br />\n <Autolevel rerender={rerender} action={props.action} />\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Action } from \"../Action\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: Action;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TeamSizeModal(props: IProps): React.ReactElement {\n const [teamSize, setTeamSize] = useState<number | undefined>();\n\n function confirmTeamSize(): void {\n if (teamSize === undefined) return;\n const num = Math.round(teamSize);\n if (isNaN(num) || num < 0) {\n dialogBoxCreate(\"Invalid value entered for number of Team Members (must be numeric, positive)\");\n } else {\n props.action.teamCount = num;\n }\n props.onClose();\n }\n\n function onTeamSize(event: React.ChangeEvent<HTMLInputElement>): void {\n const x = parseFloat(event.target.value);\n if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);\n else setTeamSize(x);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the amount of team members you would like to take on this Op. If you do not have the specified number of\n team members, then as many as possible will be used. Note that team members may be lost during operations.\n </Typography>\n <TextField autoFocus type=\"number\" placeholder=\"Team size\" value={teamSize} onChange={onTeamSize} />\n <Button sx={{ mx: 2 }} onClick={confirmTeamSize}>\n Confirm\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\n\ninterface IOperation {\n desc: JSX.Element;\n}\n\nexport const Operations: {\n [key: string]: IOperation | undefined;\n} = {\n Investigation: {\n desc: (\n <>\n As a field agent, investigate and identify Synthoid populations, movements, and operations.\n <br />\n <br />\n Successful Investigation ops will increase the accuracy of your synthoid data.\n <br />\n <br />\n You will NOT lose HP from failed Investigation ops.\n </>\n ),\n },\n \"Undercover Operation\": {\n desc: (\n <>\n Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.\n <br />\n <br />\n Successful Undercover ops will increase the accuracy of your synthoid data.\n </>\n ),\n },\n \"Sting Operation\": {\n desc: <>Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.</>,\n },\n Raid: {\n desc: (\n <>\n Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your\n current city in order for this Operation to be successful.\n </>\n ),\n },\n \"Stealth Retirement Operation\": {\n desc: (\n <>\n Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any\n attention. Stealth and discretion are key.\n </>\n ),\n },\n Assassination: {\n desc: (\n <>\n Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the\n Synthoid communities.\n </>\n ),\n },\n};\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n return (\n <>\n <Typography>\n Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked\n successively by completing the one before it.\n <br />\n <br />\n <b>Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.</b>\n <br />\n <br />\n Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank\n losses.\n </Typography>\n <BlackOpList bladeburner={props.bladeburner} player={props.player} />\n </>\n );\n}\n","import React from \"react\";\nimport { BlackOperations } from \"../BlackOperations\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOpElem } from \"./BlackOpElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpList(props: IProps): React.ReactElement {\n let blackops: BlackOperation[] = [];\n for (const blackopName in 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 <h2 style={{ display: \"block\" }}>{props.action.name} (COMPLETED)</h2>;\n }\n\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"BlackOperation\"] &&\n props.action.name === props.bladeburner.action.name;\n const actionTime = props.action.getActionTime(props.bladeburner);\n const hasReqdRank = props.bladeburner.rank >= props.action.reqdRank;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n\n const actionData = BlackOperations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography>\n {isActive ? (\n <>\n <>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n <p style={{ display: \"block\" }}>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </p>\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 </Typography>\n <br />\n <br />\n <Typography>{actionData.desc}</Typography>\n <br />\n <br />\n <Typography color={hasReqdRank ? \"primary\" : \"error\"}>\n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n </Typography>\n <br />\n <Typography>\n <SuccessChance action={props.action} bladeburner={props.bladeburner} />\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n </Typography>\n </Paper>\n );\n}\n","import React from \"react\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n \"Operation Typhoon\": {\n desc: (\n <>\n Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that\n Zenyatta, along with the rest of the PMC, is a Synthoid.\n <br />\n <br />\n The goal of Operation Typhoon is to find and eliminate Zenyatta and RedWater by any means necessary. After the\n task is completed, the actions must be covered up from the general public.\n </>\n ),\n },\n\n \"Operation Zero\": {\n desc: (\n <>\n AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a\n supporter of Synthoid rights. He must be removed.\n <br />\n <br />\n The goal of Operation Zero is to covertly infiltrate AeroCorp and uncover any incriminating evidence or\n information against Watataki that will cause him to be removed from his position at AeroCorp. Incriminating\n evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced security\n measures in the world.\n </>\n ),\n },\n \"Operation X\": {\n desc: (\n <>\n We have recently discovered an underground publication group called Samizdat. Even though most of their\n publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of\n their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and\n other Eastern countries.\n <br />\n <br />\n Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that\n their base of operations is in Ishima's underground sewer systems. Your task is to investigate the sewer\n systems, and eliminate Samizdat. They must never publish anything again.\n </>\n ),\n },\n \"Operation Titan\": {\n desc: (\n <>\n Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we\n know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,\n but the research that they could be conducting using Titan Laboraties' vast resources is potentially very\n dangerous.\n <br />\n <br />\n Your goal is to enter and destroy the Bioengineering department's facility in Aevum. The task is not just to\n retire the Synthoids there, but also to destroy any information or research at the facility that is relevant to\n the Synthoids and their goals.\n </>\n ),\n },\n \"Operation Ares\": {\n desc: (\n <>\n One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai\n between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy\n weapons. It is critical for the safety of humanity that this deal does not happen.\n <br />\n <br />\n Your task is to intercept the deal. Leave no survivors.\n </>\n ),\n },\n \"Operation Archangel\": {\n desc: (\n <>\n Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI\n Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms\n trafficking operation.\n <br />\n <br />\n The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the\n number of other casualties, but do what you must to complete the mission.\n </>\n ),\n },\n \"Operation Juggernaut\": {\n desc: (\n <>\n The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls\n himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into Sector-12. We\n also have reason to believe the tried to break into one of Universal Energy's facilities in order to cause a\n city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented Synthoid, and have thus enlisted our\n help.\n <br />\n <br />\n Your mission is to eradicate Juggernaut and his followers.\n </>\n ),\n },\n \"Operation Red Dragon\": {\n desc: (\n <>\n The Tetrads criminal organization is suspected of reverse-engineering the MK-VI Synthoid design. We believe they\n altered and possibly improved the design and began manufacturing their own Synthoid models in order to bolster\n their criminal activities.\n <br />\n <br />\n Your task is to infiltrate and destroy the Tetrads' base of operations in Los Angeles. Intelligence tells us\n that their base houses one of their Synthoid manufacturing units.\n </>\n ),\n },\n \"Operation K\": {\n desc: (\n <>\n CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.\n This technology is supposedly capable of cloning Synthoid, not only physically but also their advanced AI\n modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any\n Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would\n be catastrophic.\n <br />\n <br />\n We do not have the power or jurisdiction to shutdown this down through legal or political means, so we must\n resort to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in\n its creation.\n </>\n ),\n },\n \"Operation Deckard\": {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in Operation K, we've\n discovered that a small group of MK-VI Synthoids were able to make off with the schematics and design of the\n technology before the Operation. It is almost a certainty that these Synthoids are some of the rogue MK-VI ones\n from the Synthoid Uprising.\n <br />\n <br />\n The goal of Operation Deckard is to hunt down these Synthoids and retire them. I don't need to tell you how\n critical this mission is.\n </>\n ),\n },\n \"Operation Tyrell\": {\n desc: (\n <>\n A week ago Blade Industries reported a small break-in at one of their Aevum Augmentation storage facitilities.\n We figured out that The Dark Army was behind the heist, and didn't think any more of it. However, we've just\n discovered that several known MK-VI Synthoids were part of that break-in group.\n <br />\n <br />\n We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt\n down the associated Dark Army members and eliminate them.\n </>\n ),\n },\n \"Operation Wallace\": {\n desc: (\n <>\n Based on information gathered from Operation Tyrell, we've discovered that The Dark Army was well aware that\n there were Synthoids amongst their ranks. Even worse, we believe that The Dark Army is working together with\n other criminal organizations such as The Syndicate and that they are planning some sort of large-scale takeover\n of multiple major cities, most notably Aevum. We suspect that Synthoids have infiltrated the ranks of these\n criminal factions and are trying to stage another Synthoid uprising.\n <br />\n <br />\n The best way to deal with this is to prevent it before it even happens. The goal of Operation Wallace is to\n destroy the Dark Army and Syndicate factions in Aevum immediately. Leave no survivors.\n </>\n ),\n },\n \"Operation Shoulder of Orion\": {\n desc: (\n <>\n China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using\n Synthoids. We believe China is trying to establish the first off-world colonies.\n <br />\n <br />\n The mission is to prevent this launch without instigating an international conflict. When you accept this\n mission you will be officially disavowed by the NSA and the national government until after you successfully\n return. In the event of failure, all of the operation's team members must not let themselves be captured alive.\n </>\n ),\n },\n \"Operation Hyron\": {\n desc: (\n <>\n Our intelligence tells us that Fulcrum Technologies is developing a quantum supercomputer using human brains as\n core processors. This supercomputer is rumored to be able to store vast amounts of data and perform computations\n unmatched by any other supercomputer on the planet. But more importantly, the use of organic human brains means\n that the supercomputer may be able to reason abstractly and become self-aware.\n <br />\n <br />\n I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.\n <br />\n <br />\n The research for this project is being conducted at one of Fulcrum Technologies secret facilities in Aevum,\n codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work, and then find and kill the\n project lead.\n </>\n ),\n },\n \"Operation Morpheus\": {\n desc: (\n <>\n DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the\n peoples dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our\n agents and informants in Chonqging, we have reason to believe that one of the broadcast towers there has been\n compromised by Synthoids and is being used to spread pro-Synthoid propaganda.\n <br />\n <br />\n The mission is to destroy this broadcast tower. Speed and stealth are of the upmost important for this.\n </>\n ),\n },\n \"Operation Ion Storm\": {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the Sector-12 Slums.\n We don't know if they are rogue Synthoids from the Uprising, but we do know that they have been stockpiling\n weapons, money, and other resources. This makes them dangerous.\n <br />\n <br />\n This is a full-scale assault operation to find and retire all of these Synthoids in the Sector-12 Slums.\n </>\n ),\n },\n \"Operation Annihilus\": {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in Aevum.\n They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist organization called\n 'The Covenant'. We have no prior intelligence about this organization, so you are going in blind.\n </>\n ),\n },\n \"Operation Ultron\": {\n desc: (\n <>\n OmniTek Incorporated, the original designer and manufacturer of Synthoids, has notified us of a malfunction in\n their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized and seek out the\n destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue ones from the\n Uprising.\n <br />\n <br />\n OmniTek has also told us they they believe someone has triggered this malfunction in a large group of MK-VI\n Synthoids, and that these newly-radicalized Synthoids are now amassing in Volhaven to form a terrorist group\n called Ultron.\n <br />\n <br />\n Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making\n moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).\n <br />\n <br />\n Your task is to find and destroy Ultron.\n </>\n ),\n },\n \"Operation Centurion\": {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its\n advancement became our primary goal. And at the peak of human civilization technology turned into power. Global,\n absolute power.\n <br />\n <br />\n It seems that the universe is not without a sense of irony.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n \"Operation Vindictus\": {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n <br />\n <br />\n The bits are all around us. The daemons that hold the Node together can manifest themselves in many different\n ways.\n <br />\n <br />\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n </>\n ),\n },\n \"Operation Daedalus\": {\n desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.</>,\n },\n};\n","import React, { useState } from \"react\";\nimport { SkillList } from \"./SkillList\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\ninterface IProps {\n bladeburner: IBladeburner;\n}\n\nexport function SkillPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const mults = props.bladeburner.skillMultipliers;\n\n function valid(mult: any): boolean {\n return mult && mult !== 1;\n }\n\n return (\n <>\n <Typography>\n <strong>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</strong>\n </Typography>\n <Typography>\n You will gain one skill point every{\" \"}\n {BladeburnerConstants.RanksPerSkillPoint * BitNodeMultipliers.BladeburnerSkillCost} ranks.\n <br />\n Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different\n skills with each other is multiplicative.\n </Typography>\n {valid(mults[\"successChanceAll\"]) && (\n <Typography>Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceStealth\"]) && (\n <Typography>Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceKill\"]) && (\n <Typography>Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceContract\"]) && (\n <Typography>Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n <Typography>Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}</Typography>\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n <Typography>Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}</Typography>\n )}\n {valid(mults[\"actionTime\"]) && <Typography>Action Time: x{formatNumber(mults[\"actionTime\"], 3)}</Typography>}\n {valid(mults[\"effHack\"]) && <Typography>Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}</Typography>}\n {valid(mults[\"effStr\"]) && <Typography>Strength: x{formatNumber(mults[\"effStr\"], 3)}</Typography>}\n {valid(mults[\"effDef\"]) && <Typography>Defense: x{formatNumber(mults[\"effDef\"], 3)}</Typography>}\n {valid(mults[\"effDex\"]) && <Typography>Dexterity: x{formatNumber(mults[\"effDex\"], 3)}</Typography>}\n {valid(mults[\"effAgi\"]) && <Typography>Agility: x{formatNumber(mults[\"effAgi\"], 3)}</Typography>}\n {valid(mults[\"effCha\"]) && <Typography>Charisma: x{formatNumber(mults[\"effCha\"], 3)}</Typography>}\n {valid(mults[\"effInt\"]) && <Typography>Intelligence: x{formatNumber(mults[\"effInt\"], 3)}</Typography>}\n {valid(mults[\"stamina\"]) && <Typography>Stamina: x{formatNumber(mults[\"stamina\"], 3)}</Typography>}\n {valid(mults[\"money\"]) && <Typography>Contract Money: x{formatNumber(mults[\"money\"], 3)}</Typography>}\n {valid(mults[\"expGain\"]) && <Typography>Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}</Typography>}\n <SkillList bladeburner={props.bladeburner} onUpgrade={() => setRerender((old) => !old)} />\n </>\n );\n}\n\n/*\n\n\n\n\nvar multKeys = Object.keys(this.skillMultipliers);\nfor (var i = 0; i < multKeys.length; ++i) {\n var mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch(multKeys[i]) {\n \n }\n }\n}\n*/\n","import * as React from \"react\";\nimport { SkillElem } from \"./SkillElem\";\nimport { Skills } from \"../Skills\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillList(props: IProps): React.ReactElement {\n return (\n <>\n {Object.keys(Skills).map((skill: string) => (\n <SkillElem key={skill} bladeburner={props.bladeburner} skill={Skills[skill]} onUpgrade={props.onUpgrade} />\n ))}\n </>\n );\n}\n","import React from \"react\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport CloseIcon from \"@mui/icons-material/Close\";\n\ninterface IProps {\n skill: any;\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillElem(props: IProps): React.ReactElement {\n const skillName = props.skill.name;\n let currentLevel = 0;\n if (props.bladeburner.skills[skillName] && !isNaN(props.bladeburner.skills[skillName])) {\n currentLevel = props.bladeburner.skills[skillName];\n }\n const pointCost = props.skill.calculateCost(currentLevel);\n\n const canLevel = props.bladeburner.skillPoints >= pointCost;\n const maxLvl = props.skill.maxLvl ? currentLevel >= props.skill.maxLvl : false;\n\n function onClick(): void {\n if (props.bladeburner.skillPoints < pointCost) return;\n props.bladeburner.skillPoints -= pointCost;\n props.bladeburner.upgradeSkill(props.skill);\n props.onUpgrade();\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <CopyableText variant=\"h6\" color=\"primary\" value={props.skill.name} />\n {!canLevel || maxLvl ? (\n <IconButton disabled>\n <CloseIcon />\n </IconButton>\n ) : (\n <IconButton onClick={onClick}>\n <AddIcon />\n </IconButton>\n )}\n </Box>\n <Typography>Level: {currentLevel}</Typography>\n {maxLvl ? (\n <Typography>MAX LEVEL</Typography>\n ) : (\n <Typography>Skill Points required: {formatNumber(pointCost, 0)}</Typography>\n )}\n <Typography>{props.skill.desc}</Typography>\n </Paper>\n );\n}\n","/**\n * React Component for all the gang stuff.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { ManagementSubpage } from \"./ManagementSubpage\";\nimport { TerritorySubpage } from \"./TerritorySubpage\";\nimport { EquipmentsSubpage } from \"./EquipmentsSubpage\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function GangRoot(): React.ReactElement {\n const player = use.Player();\n const gang = (function () {\n if (player.gang === null) throw new Error(\"Gang should not be null\");\n return player.gang;\n })();\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Context.Gang.Provider value={gang}>\n <Tabs variant=\"fullWidth\" value={value} onChange={handleChange}>\n <Tab label=\"Management\" />\n <Tab label=\"Equipment\" />\n <Tab label=\"Territory\" />\n </Tabs>\n {value === 0 && <ManagementSubpage />}\n {value === 1 && <EquipmentsSubpage />}\n {value === 2 && <TerritorySubpage />}\n </Context.Gang.Provider>\n );\n}\n","/**\n * React Component for the subpage that manages gang members, the main page.\n */\nimport React from \"react\";\nimport { GangStats } from \"./GangStats\";\nimport { GangMemberList } from \"./GangMemberList\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\n\nexport function ManagementSubpage(): React.ReactElement {\n const gang = useGang();\n return (\n <>\n <Typography>\n This page is used to manage your gang members and get an overview of your gang's stats.\n <br />\n <br />\n If a gang member is not earning much money or respect, the task that you have assigned to that member might be\n too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of\n the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact\n that your wanted level is too high. Consider assigning a few members to the '\n {gang.isHackingGang ? \"Ethical Hacking\" : \"Vigilante Justice\"}' task to lower your wanted level.\n <br />\n <br />\n Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing\n Augmentations, you will automatically be a member of whatever Faction you created your gang with.\n <br />\n <br />\n You can also manage your gang programmatically through Netscript using the Gang API\n </Typography>\n <br />\n <GangStats />\n <br />\n <GangMemberList />\n </>\n );\n}\n","/**\n * React Component for the stats related to the gang, like total respect and\n * money per second.\n */\nimport React from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { AllGangs } from \"../AllGangs\";\nimport { BonusTime } from \"./BonusTime\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nexport function GangStats(): React.ReactElement {\n const gang = useGang();\n const territoryMult = AllGangs[gang.facName].territory * 100;\n let territoryStr;\n if (territoryMult <= 0) {\n territoryStr = formatNumber(0, 2);\n } else if (territoryMult >= 100) {\n territoryStr = formatNumber(100, 2);\n } else {\n territoryStr = formatNumber(territoryMult, 2);\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect\n affects the amount of money your gang members will earn, and also determines how much reputation you are\n earning with your gang's corresponding Faction.\n </Typography>\n }\n >\n <Typography>\n Respect: {numeralWrapper.formatRespect(gang.respect)} (\n {numeralWrapper.formatRespect(5 * gang.respectGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder\n it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n </Typography>\n }\n >\n <Typography>\n Wanted Level: {numeralWrapper.formatWanted(gang.wanted)} (\n {numeralWrapper.formatWanted(5 * gang.wantedGainRate)} / sec)\n </Typography>\n </Tooltip>\n </Box>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>Penalty for respect and money gain rates due to Wanted Level</Typography>}>\n <Typography>Wanted Level Penalty: -{formatNumber((1 - gang.getWantedPenalty()) * 100, 2)}%</Typography>\n </Tooltip>\n </Box>\n\n <Typography>\n Money gain rate: <MoneyRate money={5 * gang.moneyGainRate} />\n </Typography>\n\n <Box display=\"flex\">\n <Tooltip title={<Typography>The percentage of total territory your Gang controls</Typography>}>\n <Typography>Territory: {territoryStr}%</Typography>\n </Tooltip>\n </Box>\n <Typography>\n Faction reputation: <Reputation reputation={Factions[gang.facName].playerReputation} />\n </Typography>\n\n <BonusTime gang={gang} />\n </>\n );\n}\n","/**\n * React Component for displaying the bonus time remaining.\n */\nimport * as React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function BonusTime(props: IProps): React.ReactElement {\n const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;\n if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <></>;\n const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;\n return (\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the\n browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.\n </Typography>\n }\n >\n <Typography>Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}</Typography>\n </Tooltip>\n </Box>\n );\n}\n","/**\n * React Component for the list of gang members on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberAccordion } from \"./GangMemberAccordion\";\nimport { GangMember } from \"../GangMember\";\nimport { RecruitButton } from \"./RecruitButton\";\nimport { useGang } from \"./Context\";\n\nexport function GangMemberList(): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n\n return (\n <>\n <RecruitButton onRecruit={() => setRerender((old) => !old)} />\n <ul>\n {gang.members.map((member: GangMember) => (\n <GangMemberAccordion key={member.name} member={member} />\n ))}\n </ul>\n </>\n );\n}\n","/**\n * React Component for a gang member on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberAccordionContent } from \"./GangMemberAccordionContent\";\n\nimport Box from \"@mui/material/Box\";\n\nimport Typography from \"@mui/material/Typography\";\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\";\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(true);\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography>{props.member.name}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} unmountOnExit>\n <Box sx={{ mx: 4 }}>\n <GangMemberAccordionContent member={props.member} />\n </Box>\n </Collapse>\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 { TaskDescription } from \"./TaskDescription\";\nimport { GangMember } from \"../GangMember\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberAccordionContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n return (\n <Grid container>\n <Grid item xs={4}>\n <GangMemberStats onAscend={() => setRerender((old) => !old)} member={props.member} />\n </Grid>\n <Grid item xs={4}>\n <TaskSelector onTaskChange={() => setRerender((old) => !old)} member={props.member} />\n </Grid>\n <Grid item xs={4}>\n <TaskDescription member={props.member} />\n </Grid>\n </Grid>\n );\n}\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React, { useState } from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { AscensionModal } from \"./AscensionModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\n\ninterface IProps {\n member: GangMember;\n onAscend: () => void;\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n const [helpOpen, setHelpOpen] = useState(false);\n const [ascendOpen, setAscendOpen] = useState(false);\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 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 <Typography>\n Hacking: {formatNumber(props.member.hack, 0)} ({numeralWrapper.formatExp(props.member.hack_exp)} exp)\n <br />\n Strength: {formatNumber(props.member.str, 0)} ({numeralWrapper.formatExp(props.member.str_exp)} exp)\n <br />\n Defense: {formatNumber(props.member.def, 0)} ({numeralWrapper.formatExp(props.member.def_exp)} exp)\n <br />\n Dexterity: {formatNumber(props.member.dex, 0)} ({numeralWrapper.formatExp(props.member.dex_exp)} exp)\n <br />\n Agility: {formatNumber(props.member.agi, 0)} ({numeralWrapper.formatExp(props.member.agi_exp)} exp)\n <br />\n Charisma: {formatNumber(props.member.cha, 0)} ({numeralWrapper.formatExp(props.member.cha_exp)} exp)\n <br />\n </Typography>\n </Tooltip>\n <br />\n {props.member.canAscend() && (\n <>\n <Button onClick={() => setAscendOpen(true)}>Ascend</Button>\n <AscensionModal\n open={ascendOpen}\n onClose={() => setAscendOpen(false)}\n member={props.member}\n onAscend={props.onAscend}\n />\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\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 </>\n )}\n </>\n );\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 <Typography>\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 </Typography>,\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 middle part of the gang member accordion. Contains\n * the task selector as well as some stats.\n */\nimport React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { useGang } from \"./Context\";\nimport { GangMember } from \"../GangMember\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n member: GangMember;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const gang = useGang();\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n function onChange(event: SelectChangeEvent<string>): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = gang.getAllTaskNames();\n\n 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 <Select onChange={onChange} value={currentTask}>\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\n <StatsTable rows={data} />\n </>\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","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 */\nexport interface 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: 1,\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: 2.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: 6,\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: 15,\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: 120,\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: 1,\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: 1.2,\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: 5,\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: 2.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: 15,\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: 38,\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: 58,\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: 24,\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: 120,\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","/**\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 { formatNumber } from \"../../utils/StringHelperFunctions\";\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\">\n <Button sx={{ mx: 1 }} disabled>\n Recruit Gang Member\n </Button>\n <Typography>{formatNumber(respect, 2)} respect needed to recruit next member</Typography>\n </Box>\n );\n }\n\n return (\n <>\n <Button onClick={() => setOpen(true)}>Recruit Gang Member</Button>\n <RecruitModal open={open} onClose={() => setOpen(false)} onRecruit={props.onRecruit} />\n </>\n );\n}\n","/**\n * React Component for the popup used to recruit new gang members.\n */\nimport React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IRecruitPopupProps {\n open: boolean;\n onClose: () => void;\n onRecruit: () => void;\n}\n\nexport function RecruitModal(props: IRecruitPopupProps): React.ReactElement {\n const gang = useGang();\n const [name, setName] = useState(\"\");\n\n const disabled = name === \"\" || !gang.canRecruitMember();\n function recruit(): void {\n if (disabled) return;\n // At this point, the only way this can fail is if you already\n // have a gang member with the same name\n if (!gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) recruit();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter a name for your new Gang member:</Typography>\n <br />\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"unique name\"\n InputProps={{\n endAdornment: (\n <Button disabled={disabled} onClick={recruit}>\n Recruit\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","/**\n * React Component for the territory subpage.\n */\nimport React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { AllGangs } from \"../AllGangs\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n\n return (\n <>\n <Typography>\n This page shows how much territory your Gang controls. This statistic is listed as a percentage, which\n represents how much of the total territory you control.\n <br />\n <br />\n Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on\n your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The\n accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare'\n task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also\n loses a small amount of power whenever you lose a clash.\n <br />\n <br />\n NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of\n whether you win or lose the clash. A gang member being killed results in both respect and power loss for your\n gang.\n <br />\n <br />\n The amount of territory you have affects all aspects of your Gang members' production, including money, respect,\n and wanted level. It is very beneficial to have high territory control.\n <br />\n <br />\n </Typography>\n <FormControlLabel\n control={\n <Switch\n checked={gang.territoryWarfareEngaged}\n onChange={(event) => (gang.territoryWarfareEngaged = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance\n to gradually decrease until it reaches 0%.\n </Typography>\n }\n >\n <Typography>Engage in Territory Warfare</Typography>\n </Tooltip>\n }\n />\n <br />\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n This percentage represents the chance you have of 'clashing' with with another gang. If you do not wish to\n gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.\n </Typography>\n }\n >\n <Typography>\n Territory Clash Chance: {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)}\n </Typography>\n </Tooltip>\n </Box>\n <br />\n <FormControlLabel\n control={\n <Switch\n checked={gang.notifyMemberDeath}\n onChange={(event) => (gang.notifyMemberDeath = event.target.checked)}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies\n in a territory clash.\n </Typography>\n }\n >\n <Typography>Notify about Gang Member Deaths</Typography>\n </Tooltip>\n }\n />\n <br />\n <Paper>\n <Typography>\n <b>\n <u>{gang.facName}</u>\n </b>\n <br />\n Power: {formatNumber(AllGangs[gang.facName].power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[gang.facName].territory)}%\n <br />\n <br />\n </Typography>\n {gangNames.map((name) => (\n <OtherGangTerritory key={name} name={name} />\n ))}\n </Paper>\n </>\n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n if (v <= 0) {\n return formatNumber(0, 2);\n } else if (v >= 100) {\n return formatNumber(100, 2);\n } else {\n return formatNumber(v, 2);\n }\n}\n\ninterface ITerritoryProps {\n name: string;\n}\n\nfunction OtherGangTerritory(props: ITerritoryProps): React.ReactElement {\n const gang = useGang();\n const playerPower = AllGangs[gang.facName].power;\n const power = AllGangs[props.name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n return (\n <Typography>\n <u>{props.name}</u>\n <br />\n Power: {formatNumber(power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[props.name].territory)}%<br />\n Chance to win clash with this gang: {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n <br />\n <br />\n </Typography>\n );\n}\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState } from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useGang } from \"./Context\";\nimport { GangMember } from \"../GangMember\";\nimport { UpgradeType } from \"../data/upgrades\";\nimport { use } from \"../../ui/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\";\nimport Paper from \"@mui/material/Paper\";\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.gt(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={{ mx: 1, p: 1 }}>\n <Box display=\"flex\">\n <Tooltip title={<Typography dangerouslySetInnerHTML={{ __html: upg.desc }} />}>\n <Typography>{upg.name}</Typography>\n </Tooltip>\n </Box>\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 <Typography>{props.upg.name}</Typography>\n <Button onClick={onClick}>\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 function rerender(): void {\n setRerender((old) => !old);\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.lt(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 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 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 <Typography variant=\"h5\" color=\"primary\">\n {props.member.name} ({props.member.task})\n </Typography>\n <Typography>\n Hack: {props.member.hack} (x\n {formatNumber(props.member.hack_mult * asc.hack, 2)})<br />\n Str: {props.member.str} (x\n {formatNumber(props.member.str_mult * asc.str, 2)})<br />\n Def: {props.member.def} (x\n {formatNumber(props.member.def_mult * asc.def, 2)})<br />\n Dex: {props.member.dex} (x\n {formatNumber(props.member.dex_mult * asc.dex, 2)})<br />\n Agi: {props.member.agi} (x\n {formatNumber(props.member.agi_mult * asc.agi, 2)})<br />\n Cha: {props.member.cha} (x\n {formatNumber(props.member.cha_mult * asc.cha, 2)})\n </Typography>\n <Box display=\"flex\" flexWrap=\"wrap\">\n <Typography>Purchased Upgrades: </Typography>\n <br />\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 <Box display=\"flex\" justifyContent=\"space-around\">\n <Box>\n <Typography variant=\"h6\" color=\"primary\">\n Weapons\n </Typography>\n {weaponUpgrades.map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n <NextReveal type={UpgradeType.Weapon} upgrades={props.member.upgrades} />\n </Box>\n <Box>\n <Typography variant=\"h6\" color=\"primary\">\n Armor\n </Typography>\n {armorUpgrades.map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n <NextReveal type={UpgradeType.Armor} upgrades={props.member.upgrades} />\n </Box>\n <Box>\n <Typography variant=\"h6\" color=\"primary\">\n Vehicles\n </Typography>\n {vehicleUpgrades.map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n <NextReveal type={UpgradeType.Vehicle} upgrades={props.member.upgrades} />\n </Box>\n <Box>\n <Typography variant=\"h6\" color=\"primary\">\n Rootkits\n </Typography>\n {rootkitUpgrades.map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n <NextReveal type={UpgradeType.Rootkit} upgrades={props.member.upgrades} />\n </Box>\n <Box>\n <Typography variant=\"h6\" color=\"primary\">\n Augmentations\n </Typography>\n {augUpgrades.map((upg) => (\n <UpgradeButton key={upg.name} rerender={rerender} member={props.member} upg={upg} />\n ))}\n <NextReveal type={UpgradeType.Augmentation} upgrades={props.member.upgrades} />\n </Box>\n </Box>\n </Paper>\n );\n}\n\nexport function EquipmentsSubpage(): React.ReactElement {\n const gang = useGang();\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>Discount: -{numeralWrapper.formatPercentage(1 - 1 / gang.getDiscount())}</Typography>\n </Tooltip>\n {gang.members.map((member: GangMember) => (\n <GangMemberUpgradePanel key={member.name} member={member} />\n ))}\n </>\n );\n}\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","// React Components for the Corporation UI's navigation tabs\n// These are the tabs at the top of the UI that let you switch to different\n// divisions, see an overview of your corporation, or create a new industry\nimport React, { useState, useEffect } from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { ExpandIndustryTab } from \"./ExpandIndustryTab\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\nimport { Overview } from \"./Overview\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function CorporationRoot(): React.ReactElement {\n const player = use.Player();\n const corporation = player.corporation;\n if (corporation === null) return <></>;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [divisionName, setDivisionName] = useState<string | number>(\"Overview\");\n function handleChange(event: React.SyntheticEvent, tab: string | number): void {\n setDivisionName(tab);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const canExpand =\n Object.keys(Industries).filter(\n (industryType: string) =>\n corporation.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n ).length > 0;\n\n return (\n <Context.Corporation.Provider value={corporation}>\n <Tabs variant=\"fullWidth\" value={divisionName} onChange={handleChange}>\n <Tab label={corporation.name} value={\"Overview\"} />\n {corporation.divisions.map((div) => (\n <Tab key={div.name} label={div.name} value={div.name} />\n ))}\n {canExpand && <Tab label={\"Expand\"} value={-1} />}\n </Tabs>\n {divisionName === \"Overview\" && <Overview rerender={rerender} />}\n {divisionName === -1 && <ExpandIndustryTab setDivisionName={setDivisionName} />}\n {typeof divisionName === \"string\" && divisionName !== \"Overview\" && (\n <MainPanel rerender={rerender} divisionName={divisionName + \"\"} />\n )}\n </Context.Corporation.Provider>\n );\n}\n","// React Component for the element that contains the actual info/data\n// for the Corporation UI. This panel lies below the header tabs and will\n// be filled with whatever is needed based on the routing/navigation\nimport React from \"react\";\n\nimport { CityTabs } from \"./CityTabs\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Context, useCorporation } from \"./Context\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\n\ninterface IProps {\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division =\n props.divisionName !== \"Overview\"\n ? corp.divisions.find((division: IIndustry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) throw new Error(\"Cannot find division\");\n return (\n <Context.Division.Provider value={division}>\n <CityTabs rerender={props.rerender} city={CityName.Sector12} />\n </Context.Division.Provider>\n );\n}\n","// React Components for the Corporation UI's City navigation tabs\n// These allow player to navigate between different cities for each industry\nimport React, { useState } from \"react\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { ExpandNewCity } from \"./ExpandNewCity\";\nimport { useDivision } from \"./Context\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\ninterface IProps {\n city: string;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const division = useDivision();\n const [city, setCity] = useState(props.city);\n\n const office = division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <></>;\n }\n\n const canExpand =\n Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0).length > 0;\n function handleChange(event: React.SyntheticEvent, tab: string): void {\n setCity(tab);\n }\n return (\n <>\n <Tabs variant=\"fullWidth\" value={city} onChange={handleChange}>\n {Object.values(division.offices).map(\n (office: OfficeSpace | 0) => office !== 0 && <Tab key={office.loc} label={office.loc} value={office.loc} />,\n )}\n {canExpand && <Tab label={\"Expand\"} value={\"Expand\"} />}\n </Tabs>\n\n {city !== \"Expand\" ? (\n <Industry\n key={city}\n rerender={props.rerender}\n city={city}\n warehouse={division.warehouses[city]}\n office={office}\n />\n ) : (\n <ExpandNewCity cityStateSetter={setCity} />\n )}\n </>\n );\n}\n","// React Component for managing the Corporation's Industry UI\n// This Industry component does NOT include the city tabs at the top\nimport React from \"react\";\n\nimport { IndustryOffice } from \"./IndustryOffice\";\nimport { IndustryOverview } from \"./IndustryOverview\";\nimport { IndustryWarehouse } from \"./IndustryWarehouse\";\nimport { Warehouse } from \"../Warehouse\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const division = useDivision();\n return (\n <Box display=\"flex\">\n <Box sx={{ width: \"50%\" }}>\n <IndustryOverview rerender={props.rerender} currentCity={props.city} office={props.office} />\n <IndustryOffice rerender={props.rerender} office={props.office} />\n </Box>\n <Box sx={{ width: \"50%\" }}>\n <IndustryWarehouse\n rerender={props.rerender}\n player={player}\n corp={corp}\n currentCity={props.city}\n division={division}\n warehouse={props.warehouse}\n />\n </Box>\n </Box>\n );\n}\n","// React Component for displaying an Industry's OfficeSpace information\n// (bottom-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { UpgradeOfficeSizeModal } from \"./UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./ThrowPartyModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Paper from \"@mui/material/Paper\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { TableCell } from \"../../ui/React/Table\";\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 <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 <br />\n <Tooltip title={<Typography>Upgrade the office's size so that it can hold more employees!</Typography>}>\n <span>\n <Button disabled={corp.funds.lt(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.lt(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\n <br />\n\n <SwitchButton manualMode={employeeManualAssignMode} switchMode={setEmployeeManualAssignMode} />\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.lt(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.lt(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.dividedBy(CorporationConstants.OfficeInitialCost).toNumber();\n let maxNum = 1;\n mult = Math.pow(costMultiplier, initialPriceMult);\n while (maxNum < 50) {\n //Hard cap of 50x (extra 150 employees)\n if (mult >= maxMult) break;\n const multIncrease = Math.pow(costMultiplier, initialPriceMult + maxNum);\n if (mult + multIncrease > maxMult) {\n break;\n } else {\n mult += multIncrease;\n }\n ++maxNum;\n }\n const upgradeCostMax = CorporationConstants.OfficeInitialCost * mult;\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Increase the size of your office space to fit additional employees!</Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Upgrade size: </Typography>\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost}\n size={CorporationConstants.OfficeInitialSize}\n />\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCost15}\n size={CorporationConstants.OfficeInitialSize * 5}\n />\n <UpgradeSizeButton\n onClose={props.onClose}\n rerender={props.rerender}\n office={props.office}\n corp={corp}\n cost={upgradeCostMax}\n size={maxNum * CorporationConstants.OfficeInitialSize}\n />\n </Box>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { ThrowParty } from \"../Actions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function ThrowPartyModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [cost, setCost] = useState(0);\n\n const totalCost = cost * props.office.employees.length;\n const canParty = corp.funds.gte(totalCost);\n function changeCost(event: React.ChangeEvent<HTMLInputElement>): void {\n let x = parseFloat(event.target.value);\n if (isNaN(x)) x = 0;\n setCost(x);\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else {\n if (!canParty) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(corp, props.office, cost);\n dialogBoxCreate(\n \"You threw a party for the office! The morale and happiness \" +\n \"of each employee increased by \" +\n numeralWrapper.formatPercentage(mult - 1),\n );\n props.rerender();\n props.onClose();\n }\n }\n }\n\n function EffectText(): React.ReactElement {\n if (isNaN(cost) || cost < 0) return <Typography>Invalid value entered!</Typography>;\n return (\n <Typography>\n Throwing this party will cost a total of <Money money={totalCost} />\n </Typography>\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) throwParty();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>Enter the amount of money you would like to spend PER EMPLOYEE on this office party</Typography>\n <EffectText />\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n autoFocus={true}\n type=\"number\"\n placeholder=\"$ / employee\"\n value={cost}\n onChange={changeCost}\n onKeyDown={onKeyDown}\n />\n <Button disabled={!canParty} onClick={throwParty}>\n Throw Party\n </Button>\n </Box>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industries } from \"../IndustryData\";\nimport { IndustryUpgrades } from \"../IndustryUpgrades\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { MakeProductModal } from \"./MakeProductModal\";\nimport { ResearchModal } from \"./ResearchModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport Box from \"@mui/material/Box\";\n\nfunction MakeProductButton(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [makeOpen, setMakeOpen] = useState(false);\n\n const hasMaxProducts = division.hasMaximumNumberProducts();\n\n function shouldFlash(): boolean {\n return Object.keys(division.products).length === 0;\n }\n\n let createProductButtonText = \"\";\n switch (division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n return <></>;\n }\n\n return (\n <>\n <Tooltip\n title={\n hasMaxProducts ? (\n <Typography>\n You have reached the maximum number of products: {division.getMaximumNumberProducts()}\n </Typography>\n ) : (\n \"\"\n )\n }\n >\n <Button\n color={shouldFlash() ? \"error\" : \"primary\"}\n onClick={() => setMakeOpen(true)}\n disabled={corp.funds.lt(0)}\n >\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.minus(division.lastCycleExpenses).toNumber();\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.toNumber()} />)\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.toNumber()} />],\n [\"Expenses:\", <MoneyRate money={division.lastCycleExpenses.toNumber()} />],\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 in 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.lt(cost)) return;\n corp.funds = corp.funds.minus(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.lt(cost)} onClick={onClick}>\n {upgrade[4]} - \n <MoneyCost money={cost} corp={corp} />\n </Button>\n </span>\n </Tooltip>,\n );\n }\n\n return <>{upgrades}</>;\n}\n\ninterface IProps {\n currentCity: string;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const division = useDivision();\n\n return (\n <Paper>\n <Text />\n <br />\n <Typography>Purchases & Upgrades</Typography>\n <Upgrades office={props.office} rerender={props.rerender} /> <br />\n {division.makesProducts && <MakeProductButton />}\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Industries } from \"../IndustryData\";\nimport { MakeProduct } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction productPlaceholder(tpe: string): string {\n if (tpe === Industries.Food) {\n return \"Restaurant Name\";\n } else if (tpe === Industries.Healthcare) {\n return \"Hospital Name\";\n } else if (tpe === Industries.RealEstate) {\n return \"Property Name\";\n }\n return \"Product Name\";\n}\n\n// Create a popup that lets the player create a product for their current industry\nexport function MakeProductModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const allCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] !== 0);\n const [city, setCity] = useState(allCities.length > 0 ? allCities[0] : \"\");\n const [name, setName] = useState(\"\");\n const [design, setDesign] = useState<number | null>(null);\n const [marketing, setMarketing] = useState<number | null>(null);\n if (division.hasMaximumNumberProducts()) return <></>;\n\n let createProductPopupText = <></>;\n switch (division.type) {\n case Industries.Food:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new restaurant!\n </>\n );\n break;\n case Industries.Tobacco:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new tobacco product!\n </>\n );\n break;\n case Industries.Pharmaceutical:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and develop a new pharmaceutical drug!\n </>\n );\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and manufacture a new computer hardware product!\n </>\n );\n break;\n case Industries.Robotics:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Design and create a new robot or robotic system!\n </>\n );\n break;\n case Industries.Software:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of software!\n </>\n );\n break;\n case Industries.Healthcare:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Build and manage a new hospital!\n </>\n );\n break;\n case Industries.RealEstate:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Develop a new piece of real estate property!\n </>\n );\n break;\n default:\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n Create a new product!\n </>\n );\n return <></>;\n }\n createProductPopupText = (\n <>\n {createProductPopupText}\n <br />\n <br />\n To begin developing a product, first choose the city in which it will be designed. The stats of your employees in\n the selected city affect the properties of the finished product, such as its quality, performance, and durability.\n <br />\n <br />\n You can also choose to invest money in the design and marketing of the product. Investing money in its design will\n result in a superior product. Investing money in marketing the product will help the product's sales.\n </>\n );\n\n function makeProduct(): void {\n if (design === null || marketing === null) return;\n try {\n MakeProduct(corp, division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onProductNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n function onDesignChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setDesign(null);\n else setDesign(parseFloat(event.target.value));\n }\n\n function onMarketingChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setMarketing(null);\n else setMarketing(parseFloat(event.target.value));\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) makeProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{createProductPopupText}</Typography>\n <Select style={{ margin: \"5px\" }} onChange={onCityChange} defaultValue={city}>\n {allCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n <TextField onChange={onProductNameChange} placeholder={productPlaceholder(division.type)} />\n <br />\n <TextField onChange={onDesignChange} autoFocus={true} type=\"number\" placeholder={\"Design investment\"} />\n <TextField\n onChange={onMarketingChange}\n onKeyDown={onKeyDown}\n type=\"number\"\n placeholder={\"Marketing investment\"}\n />\n <Button onClick={makeProduct}>Develop Product</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { IndustryResearchTrees } from \"../IndustryData\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Research } from \"../Actions\";\nimport { Node } from \"../ResearchTree\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { 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 ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\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 const but = (\n <Box>\n <Tooltip\n title={\n <Typography>\n Research points: {r.cost}\n <br />\n {r.desc}\n </Typography>\n }\n >\n <span>\n <Button disabled={disabled} onClick={research}>\n {n.text}\n </Button>\n </span>\n </Tooltip>\n </Box>\n );\n\n if (n.children.length === 0) return but;\n\n return (\n <Box>\n <Box display=\"flex\">\n {but}\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n </Box>\n <Collapse in={open} unmountOnExit>\n <Box m={4}>\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>\n Research points: {props.industry.sciResearch.qty.toFixed(3)}\n <br />\n Multipliers from research:\n <br />* Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()}\n <br />* Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()}\n <br />* Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()}\n <br />* Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()}\n <br />* Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()}\n <br />* Production Multiplier: x{researchTree.getProductionMultiplier()}\n <br />* Sales Multiplier: x{researchTree.getSalesMultiplier()}\n <br />* Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()}\n <br />* Storage Multiplier: x{researchTree.getStorageMultiplier()}\n </Typography>\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Material } from \"../Material\";\nimport { Product } from \"../Product\";\nimport { Warehouse } from \"../Warehouse\";\nimport { SmartSupplyModal } from \"./SmartSupplyModal\";\nimport { ProductElem } from \"./ProductElem\";\nimport { MaterialElem } from \"./MaterialElem\";\nimport { MaterialSizes } from \"../MaterialSizes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nfunction WarehouseRoot(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [smartSupplyOpen, setSmartSupplyOpen] = useState(false);\n if (props.warehouse === 0) return <></>;\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = corp.funds.gt(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.minus(sizeUpgradeCost);\n props.rerender();\n }\n\n // Current State:\n let stateText;\n switch (division.state) {\n case \"START\":\n stateText = \"Current state: Preparing...\";\n break;\n case \"PURCHASE\":\n stateText = \"Current state: Purchasing materials...\";\n break;\n case \"PRODUCTION\":\n stateText = \"Current state: Producing materials and/or products...\";\n break;\n case \"SALE\":\n stateText = \"Current state: Selling materials and/or products...\";\n break;\n case \"EXPORT\":\n stateText = \"Current state: Exporting materials and/or products...\";\n break;\n default:\n console.error(`Invalid state: ${division.state}`);\n break;\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName in props.warehouse.materials) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n // Only create UI for materials that are relevant for the industry\n if (!isRelevantMaterial(matName, division)) continue;\n mats.push(\n <MaterialElem\n rerender={props.rerender}\n city={props.currentCity}\n key={matName}\n mat={props.warehouse.materials[matName]}\n warehouse={props.warehouse}\n />,\n );\n }\n\n // Create React components for products\n const products = [];\n if (division.makesProducts && Object.keys(division.products).length > 0) {\n for (const productName in 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 let breakdown = <></>;\n for (const matName in props.warehouse.materials) {\n if (matName === \"RealEstate\") continue;\n const mat = props.warehouse.materials[matName];\n if (!MaterialSizes.hasOwnProperty(matName)) continue;\n if (mat.qty === 0) continue;\n breakdown = (\n <>\n {breakdown}\n {matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}\n <br />\n </>\n );\n }\n\n for (const prodName in division.products) {\n const prod = division.products[prodName];\n if (prod === undefined) continue;\n breakdown = (\n <>\n {breakdown}\n {prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}\n </>\n );\n }\n\n return (\n <Paper>\n <Box display=\"flex\" alignItems=\"center\">\n <Tooltip title={props.warehouse.sizeUsed !== 0 ? <Typography>{breakdown}</Typography> : \"\"}>\n <Typography color={props.warehouse.sizeUsed >= props.warehouse.size ? \"error\" : \"primary\"}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n </Typography>\n </Tooltip>\n\n <Button disabled={!canAffordUpgrade} onClick={upgradeWarehouseOnClick}>\n Upgrade Warehouse Size - \n <MoneyCost money={sizeUpgradeCost} corp={corp} />\n </Button>\n </Box>\n\n <Typography>This industry uses the following equation for it's production: </Typography>\n <br />\n <Typography>\n <IndustryProductEquation division={division} />\n </Typography>\n <br />\n <Typography>\n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n </Typography>\n <br />\n\n <Typography>{stateText}</Typography>\n\n {corp.unlockUpgrades[1] && (\n <>\n <Button onClick={() => setSmartSupplyOpen(true)}>Configure Smart Supply</Button>\n <SmartSupplyModal\n open={smartSupplyOpen}\n onClose={() => setSmartSupplyOpen(false)}\n warehouse={props.warehouse}\n />\n </>\n )}\n\n {mats}\n\n {products}\n </Paper>\n );\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n if (props.warehouse instanceof Warehouse) {\n return <WarehouseRoot {...props} />;\n } else {\n return <EmptyWarehouse rerender={props.rerender} city={props.currentCity} />;\n }\n}\n\ninterface IEmptyProps {\n city: string;\n rerender: () => void;\n}\n\nfunction EmptyWarehouse(props: IEmptyProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const disabled = corp.funds.lt(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]);\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n try {\n const material = props.warehouse.materials[props.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].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 in props.warehouse.materials) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n if (!Object.keys(division.reqMats).includes(matName)) continue;\n mats.push(<Leftover key={matName} warehouse={props.warehouse} matName={matName} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <FormControlLabel\n control={<Switch checked={props.warehouse.smartSupplyEnabled} onChange={smartSupplyOnChange} />}\n label={<Typography>Enable Smart Supply</Typography>}\n />\n <br />\n <Typography>Use materials already in the warehouse instead of buying new ones, if available:</Typography>\n {mats}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Product } from \"../Product\";\nimport { DiscontinueProductModal } from \"./DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./LimitProductProductionModal\";\nimport { SellProductModal } from \"./SellProductModal\";\nimport { ProductMarketTaModal } from \"./ProductMarketTaModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProductProps {\n city: string;\n product: Product;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nexport function ProductElem(props: IProductProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [sellOpen, setSellOpen] = useState(false);\n const [limitOpen, setLimitOpen] = useState(false);\n const [discontinueOpen, setDiscontinueOpen] = useState(false);\n const [marketTaOpen, setMarketTaOpen] = useState(false);\n const city = props.city;\n const product = props.product;\n\n // Numeraljs formatters\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be big\n\n const hasUpgradeDashboard = division.hasResearch(\"uPgrade: Dashboard\");\n\n // Total product gain = production - sale\n const totalGain = product.data[city][1] - product.data[city][2];\n\n // Sell button\n let sellButtonText: JSX.Element;\n if (product.sllman[city][0]) {\n if (isString(product.sllman[city][1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/{product.sllman[city][1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/\n {numeralWrapper.format(product.sllman[city][1], nfB)})\n </>\n );\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n if (product.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.marketTa2Price[city]} />\n </>\n );\n } else if (product.marketTa1) {\n const markupLimit = product.rat / product.mku;\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.pCost + markupLimit} />\n </>\n );\n } else if (product.sCost) {\n if (isString(product.sCost)) {\n const sCost = (product.sCost as string).replace(/MP/g, product.pCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={product.sCost} />\n </>\n );\n }\n }\n\n // Limit Production button\n let limitProductionButtonText = \"Limit Production\";\n if (product.prdman[city][0]) {\n limitProductionButtonText += \" (\" + numeralWrapper.format(product.prdman[city][1], nf) + \")\";\n }\n\n return (\n <Paper>\n {!product.fin ? (\n <>\n <Typography>\n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n </Typography>\n <br />\n <Typography>{numeralWrapper.format(product.prog, \"0.00\")}% complete</Typography>\n </>\n ) : (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n <br />\n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n </Typography>\n }\n >\n <Typography>\n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} (\n {numeralWrapper.format(totalGain, nfB)}\n /s)\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Quality: {numeralWrapper.format(product.qlt, nf)} <br />\n Performance: {numeralWrapper.format(product.per, nf)} <br />\n Durability: {numeralWrapper.format(product.dur, nf)} <br />\n Reliability: {numeralWrapper.format(product.rel, nf)} <br />\n Aesthetics: {numeralWrapper.format(product.aes, nf)} <br />\n Features: {numeralWrapper.format(product.fea, nf)}\n {corp.unlockUpgrades[2] === 1 && <br />}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(product.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 && <br />}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(product.cmp, nf)}\n </Typography>\n }\n >\n <Typography>Rating: {numeralWrapper.format(product.rat, nf)}</Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip title={<Typography>An estimate of the material cost it takes to create this Product.</Typography>}>\n <Typography>\n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n </Typography>\n </Tooltip>\n </Box>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n An estimate of how much consumers are willing to pay for this product. Setting the sale price above\n this may result in less sales. Setting the sale price below this may result in more sales.\n </Typography>\n }\n >\n <Typography>Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}</Typography>\n </Tooltip>\n </Box>\n </>\n )}\n\n {(hasUpgradeDashboard || product.fin) && (\n <>\n <Button onClick={() => setSellOpen(true)}>{sellButtonText}</Button>\n <SellProductModal product={product} city={city} open={sellOpen} onClose={() => setSellOpen(false)} />\n <br />\n <Button onClick={() => setLimitOpen(true)}>{limitProductionButtonText}</Button>\n <LimitProductProductionModal\n product={product}\n city={city}\n open={limitOpen}\n onClose={() => setLimitOpen(false)}\n />\n <Button onClick={() => setDiscontinueOpen(true)}>Discontinue</Button>\n\n <DiscontinueProductModal\n product={product}\n rerender={props.rerender}\n open={discontinueOpen}\n onClose={() => setDiscontinueOpen(false)}\n />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMarketTaOpen(true)}>Market-TA</Button>\n <ProductMarketTaModal product={product} open={marketTaOpen} onClose={() => setMarketTaOpen(false)} />\n </>\n )}\n </>\n )}\n </Paper>\n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../Product\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function discontinue(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no\n longer produce this product and all of its existing stock will be removed and left unsold\n </Typography>\n <Button onClick={discontinue}>Discontinue</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Product } from \"../Product\";\nimport { LimitProductProduction } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState<number | null>(null);\n\n function limitProductProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitProductProduction(props.product, props.city, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) limitProductProduction();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter a limit to the amount of this product you would like to product per second. Leave the box empty to set no\n limit.\n </Typography>\n <TextField autoFocus={true} placeholder=\"Limit\" type=\"number\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button onClick={limitProductProduction}>Limit production</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Product } from \"../Product\";\nimport { SellProduct } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\nfunction initialPrice(product: Product): string {\n let val = product.sCost ? product.sCost + \"\" : \"\";\n if (product.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (product.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductModal(props: IProps): React.ReactElement {\n const [checked, setChecked] = useState(true);\n const [iQty, setQty] = useState<string>(\n props.product.sllman[props.city][1] ? props.product.sllman[props.city][1] : \"\",\n );\n const [px, setPx] = useState<string>(initialPrice(props.product));\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setChecked(event.target.checked);\n }\n\n function sellProduct(): void {\n try {\n SellProduct(props.product, props.city, iQty, px, checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setQty(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPx(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sellProduct();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.product.name} you would like to sell per second, as well as the price at\n which you would like to sell it at.\n <br />\n <br />\n If the sell amount is set to 0, then the product will not be sold. If the sell price is set to 0, then the\n product will be discarded.\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on\n the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five\n times the estimated market price.\n </Typography>\n <br />\n <TextField\n value={iQty}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={px} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellProduct}>Confirm</Button>\n <FormControlLabel\n control={<Switch checked={checked} onChange={onCheckedChange} />}\n label={<Typography>Use same 'Sell Amount' for all cities</Typography>}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Product } from \"../Product\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ITa2Props {\n product: Product;\n}\n\nfunction MarketTA2(props: ITa2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n const markupLimit = props.product.rat / props.product.mku;\n const [value, setValue] = useState(props.product.pCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setValue(parseFloat(event.target.value));\n }\n\n function onCheckedChange(event: React.ChangeEvent<HTMLInputElement>): void {\n props.product.marketTa2 = event.target.checked;\n rerender();\n }\n\n const sCost = value;\n let markup = 1;\n if (sCost > props.product.pCost) {\n if (sCost - props.product.pCost > markupLimit) {\n markup = markupLimit / (sCost - props.product.pCost);\n }\n }\n\n return (\n <>\n <Typography variant=\"h4\">Market-TA.II</Typography>\n <br />\n <Typography>\n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n </Typography>\n <TextField type=\"number\" onChange={onChange} value={value} />\n <br />\n <FormControlLabel\n control={<Switch checked={props.product.marketTa2} onChange={onCheckedChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n </Typography>\n }\n >\n <Typography>Use Market-TA.II for Auto-Sale Price</Typography>\n </Tooltip>\n }\n />\n\n <Typography>\n Note that Market-TA.II overrides Market-TA.I. This means that if both are enabled, then Market-TA.II will take\n effect, not Market-TA.I\n </Typography>\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 <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 Market-TA.I\n (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 <MarketTA2 product={props.product} />\n </Modal>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Material } from \"../Material\";\nimport { Warehouse } from \"../Warehouse\";\nimport { ExportModal } from \"./ExportModal\";\nimport { MaterialMarketTaModal } from \"./MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./PurchaseMaterialModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IMaterialProps {\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nexport function MaterialElem(props: IMaterialProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [purchaseMaterialOpen, setPurchaseMaterialOpen] = useState(false);\n const [exportOpen, setExportOpen] = useState(false);\n const [sellMaterialOpen, setSellMaterialOpen] = useState(false);\n const [materialMarketTaOpen, setMaterialMarketTaOpen] = useState(false);\n const warehouse = props.warehouse;\n const city = props.city;\n const mat = props.mat;\n const markupLimit = mat.getMarkupLimit();\n const office = division.offices[city];\n if (!(office instanceof OfficeSpace)) {\n throw new Error(`Could not get OfficeSpace object for this city (${city})`);\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be biger\n\n // Total gain or loss of this material (per second)\n const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;\n\n // Flag that determines whether this industry is \"new\" and the current material should be\n // marked with flashing-red lights\n const tutorial =\n division.newInd && Object.keys(division.reqMats).includes(mat.name) && mat.buy === 0 && mat.imp === 0;\n\n // Purchase material button\n const purchaseButtonText = `Buy (${numeralWrapper.format(mat.buy, nfB)})`;\n\n // Sell material button\n let sellButtonText: JSX.Element;\n if (mat.sllman[0]) {\n if (isString(mat.sllman[1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{mat.sllman[1]})\n </>\n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{numeralWrapper.format(mat.sllman[1] as number, nfB)})\n </>\n );\n }\n\n if (mat.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.marketTa2Price} />\n </>\n );\n } else if (mat.marketTa1) {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.bCost + markupLimit} />\n </>\n );\n } else if (mat.sCost) {\n if (isString(mat.sCost)) {\n const sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={eval(sCost)} />\n </>\n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ <Money money={mat.sCost} />\n </>\n );\n }\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000)</>;\n }\n\n return (\n <Paper>\n <Box display=\"flex\">\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>\n <Tooltip\n title={tutorial ? <Typography>Purchase your required materials to get production started!</Typography> : \"\"}\n >\n <span>\n <Button\n color={tutorial ? \"error\" : \"primary\"}\n onClick={() => setPurchaseMaterialOpen(true)}\n disabled={props.warehouse.smartSupplyEnabled && Object.keys(division.reqMats).includes(props.mat.name)}\n >\n {purchaseButtonText}\n </Button>\n </span>\n </Tooltip>\n <PurchaseMaterialModal\n mat={mat}\n warehouse={warehouse}\n open={purchaseMaterialOpen}\n onClose={() => setPurchaseMaterialOpen(false)}\n />\n\n {corp.unlockUpgrades[0] === 1 && (\n <>\n <Button onClick={() => setExportOpen(true)}>Export</Button>\n\n <ExportModal mat={mat} open={exportOpen} onClose={() => setExportOpen(false)} />\n </>\n )}\n <br />\n\n <Button\n color={division.prodMats.includes(props.mat.name) && !mat.sllman[0] ? \"error\" : \"primary\"}\n onClick={() => setSellMaterialOpen(true)}\n >\n {sellButtonText}\n </Button>\n <SellMaterialModal mat={mat} open={sellMaterialOpen} onClose={() => setSellMaterialOpen(false)} />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n <Button onClick={() => setMaterialMarketTaOpen(true)}>Market-TA</Button>\n\n <MaterialMarketTaModal\n mat={mat}\n open={materialMarketTaOpen}\n onClose={() => setMaterialMarketTaOpen(false)}\n />\n </>\n )}\n </Box>\n </Box>\n </Paper>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Material } from \"../Material\";\nimport { Export } from \"../Export\";\nimport { IIndustry } from \"../IIndustry\";\nimport { ExportMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.divisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n if (Object.keys(corp.divisions[0].warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState<string>(corp.divisions[0].name);\n const [city, setCity] = useState<string>(Object.keys(corp.divisions[0].warehouses)[0]);\n const [amt, setAmt] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onCityChange(event: SelectChangeEvent<string>): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n setIndustry(event.target.value);\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function exportMaterial(): void {\n try {\n ExportMaterial(industry, city, props.mat, amt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function removeExport(exp: Export): void {\n for (let i = 0; i < props.mat.exp.length; ++i) {\n if (props.mat.exp[i].ind !== exp.ind || props.mat.exp[i].city !== exp.city || props.mat.exp[i].amt !== exp.amt)\n continue;\n props.mat.exp.splice(i, 1);\n break;\n }\n rerender();\n }\n\n const currentDivision = corp.divisions.find((division: IIndustry) => division.name === industry);\n if (currentDivision === undefined)\n throw new Error(`Export popup somehow ended up with undefined division '${currentDivision}'`);\n const possibleCities = Object.keys(currentDivision.warehouses).filter(\n (city) => currentDivision.warehouses[city] !== 0,\n );\n if (possibleCities.length > 0 && !possibleCities.includes(city)) {\n setCity(possibleCities[0]);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Select the industry and city to export this material to, as well as how much of this material to export per\n second. You can set the export amount to 'MAX' to export all of the materials in this warehouse.\n </Typography>\n <Select onChange={onIndustryChange} value={industry}>\n {corp.divisions.map((division: IIndustry) => (\n <MenuItem key={division.name} value={division.name}>\n {division.name}\n </MenuItem>\n ))}\n </Select>\n <Select onChange={onCityChange} value={city}>\n {possibleCities.map((cityName: string) => {\n if (currentDivision.warehouses[cityName] === 0) return;\n return (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n );\n })}\n </Select>\n <TextField placeholder=\"Export amount / s\" onChange={onAmtChange} value={amt} />\n <Button onClick={exportMaterial}>Export</Button>\n <Typography>\n Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports\n below will REMOVE that export.\n </Typography>\n {props.mat.exp.map((exp: Export, index: number) => (\n <Box display=\"flex\" alignItems=\"center\" key={index}>\n <Button sx={{ mx: 2 }} onClick={() => removeExport(exp)}>\n delete\n </Button>\n <Typography>\n Industry: {exp.ind}\n <br />\n City: {exp.city}\n <br />\n Amount/s: {exp.amt}\n </Typography>\n </Box>\n ))}\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Material } from \"../Material\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IMarketTA2Props {\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <></>;\n\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 <Typography>\n Note that Market-TA.II overrides Market-TA.I. This means that if both are enabled, then Market-TA.II will take\n effect, not Market-TA.I\n </Typography>\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 <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 Market-TA.I\n (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 <MarketTA2 mat={props.mat} />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Material } from \"../Material\";\nimport { SellMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\nfunction initialPrice(mat: Material): string {\n let val = mat.sCost ? mat.sCost + \"\" : \"\";\n if (mat.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (mat.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialModal(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState<string>(props.mat.sllman[1] ? props.mat.sllman[1] + \"\" : \"\");\n const [price, setPrice] = useState<string>(initialPrice(props.mat));\n\n function sellMaterial(): void {\n try {\n SellMaterial(props.mat, amt, price);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setAmt(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setPrice(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sellMaterial();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the maximum amount of {props.mat.name} you would like to sell per second, as well as the price at which\n you would like to sell at.\n <br />\n <br />\n If the sell amount is set to 0, then the material will not be sold. If the sell price if set to 0, then the\n material will be discarded\n <br />\n <br />\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n <br />\n <br />\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less\n of the material than you produce.\n <br />\n <br />\n When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that\n depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at\n $10 above the market price.\n </Typography>\n <br />\n <TextField\n value={amt}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <TextField value={price} type=\"text\" placeholder=\"Sell price\" onChange={onPriceChange} onKeyDown={onKeyDown} />\n <Button onClick={sellMaterial}>Confirm</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { MaterialSizes } from \"../MaterialSizes\";\nimport { Warehouse } from \"../Warehouse\";\nimport { Material } from \"../Material\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BuyMaterial } from \"../Actions\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\nfunction BulkPurchaseText(props: IBulkPurchaseTextProps): React.ReactElement {\n const parsedAmt = parseFloat(props.amount);\n const cost = parsedAmt * props.mat.bCost;\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n\n if (parsedAmt * matSize > maxAmount) {\n return <>Not enough warehouse space to purchase this amount</>;\n } else if (isNaN(cost)) {\n return <>Invalid put for Bulk Purchase amount</>;\n } else {\n return (\n <>\n Purchasing {numeralWrapper.format(parsedAmt, \"0,0.00\")} of {props.mat.name} will cost{\" \"}\n {numeralWrapper.formatMoney(cost)}\n </>\n );\n }\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchase(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n\n function bulkPurchase(): void {\n const amount = parseFloat(buyAmt);\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n if (amount * matSize > maxAmount) {\n dialogBoxCreate(`You do not have enough warehouse size to fit this purchase`);\n return;\n }\n\n if (isNaN(amount)) {\n dialogBoxCreate(\"Invalid input amount\");\n } else {\n const cost = amount * props.mat.bCost;\n if (corp.funds.gt(cost)) {\n corp.funds = corp.funds.minus(cost);\n props.mat.qty += amount;\n } else {\n dialogBoxCreate(`You cannot afford this purchase.`);\n return;\n }\n props.onClose();\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) bulkPurchase();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(event.target.value);\n }\n\n return (\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to bulk purchase. This purchases the specified amount\n instantly (all at once).\n </Typography>\n <BulkPurchaseText warehouse={props.warehouse} mat={props.mat} amount={buyAmt} />\n <TextField\n value={buyAmt}\n onChange={onChange}\n type=\"number\"\n placeholder=\"Bulk Purchase amount\"\n onKeyDown={onKeyDown}\n />\n <Button onClick={bulkPurchase}>Confirm Bulk Purchase</Button>\n </>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : 0);\n\n function purchaseMaterial(): void {\n if (buyAmt === null) return;\n try {\n BuyMaterial(props.mat, buyAmt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) purchaseMaterial();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setBuyAmt(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n </Typography>\n <TextField\n value={buyAmt}\n onChange={onChange}\n autoFocus={true}\n placeholder=\"Purchase amount\"\n type=\"number\"\n onKeyDown={onKeyDown}\n />\n <Button onClick={purchaseMaterial}>Confirm</Button>\n <Button onClick={clearPurchase}>Clear Purchase</Button>\n {division.hasResearch(\"Bulk Purchasing\") && (\n <BulkPurchase onClose={props.onClose} mat={props.mat} warehouse={props.warehouse} />\n )}\n </>\n </Modal>\n );\n}\n","import { IIndustry } from \"../IIndustry\";\n\n// Returns a boolean indicating whether the given material is relevant for the\n// current industry.\nexport function isRelevantMaterial(matName: string, division: IIndustry): boolean {\n // Materials that affect Production multiplier\n const prodMultiplierMats = [\"Hardware\", \"Robots\", \"AICores\", \"RealEstate\"];\n\n if (Object.keys(division.reqMats).includes(matName)) {\n return true;\n }\n if (division.prodMats.includes(matName)) {\n return true;\n }\n if (prodMultiplierMats.includes(matName)) {\n return true;\n }\n\n return false;\n}\n","import React from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MathComponent } from \"mathjax-react\";\n\ninterface IProps {\n division: IIndustry;\n}\n\nexport function IndustryProductEquation(props: IProps): React.ReactElement {\n const reqs = [];\n for (const reqMat of Object.keys(props.division.reqMats)) {\n const reqAmt = props.division.reqMats[reqMat];\n if (reqAmt === undefined) continue;\n reqs.push(String.raw`${reqAmt}\\text{ }${reqMat}`);\n }\n const prod = props.division.prodMats.slice();\n if (props.division.makesProducts) {\n prod.push(props.division.type);\n }\n\n return (\n <MathComponent\n display={false}\n tex={reqs.join(\"+\") + String.raw`\\Rightarrow` + prod.map((p) => String.raw`1\\text{ }${p}`).join(\"+\")}\n />\n );\n}\n","import React, { useState } from \"react\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCity(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const possibleCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0);\n const [city, setCity] = useState(possibleCities[0]);\n\n const disabled = corp.funds.lt(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 value={city} onChange={onCityChange}>\n {possibleCities.map((cityName: string) => (\n <MenuItem key={cityName} value={cityName}>\n {cityName}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={expand} disabled={disabled}>\n Confirm\n </Button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { IndustryStartingCosts, Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { useCorporation } from \"./Context\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustry } from \"../Actions\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n setDivisionName: (name: string) => void;\n}\n\nexport function ExpandIndustryTab(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n )\n .sort();\n const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : \"\");\n const [name, setName] = useState(\"\");\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n const disabled = corp.funds.lt(cost) || name === \"\";\n\n function newIndustry(): void {\n if (disabled) return;\n try {\n NewIndustry(corp, industry, name);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n // Set routing to the new division so that the UI automatically switches to it\n props.setDivisionName(name);\n }\n\n function onNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\n // [a-zA-Z0-9-_]\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) newIndustry();\n }\n\n function onIndustryChange(event: SelectChangeEvent<string>): void {\n setIndustry(event.target.value);\n }\n\n const desc = IndustryDescriptions[industry];\n if (desc === undefined) throw new Error(`Trying to create an industry that doesn't exists: '${industry}'`);\n\n return (\n <>\n <Typography>Create a new division to expand into a new industry:</Typography>\n <Select value={industry} onChange={onIndustryChange}>\n {possibleIndustries.map((industry: string) => (\n <MenuItem key={industry} value={industry}>\n {industry}\n </MenuItem>\n ))}\n </Select>\n <Typography>{desc(corp)}</Typography>\n <br />\n <br />\n\n <Typography>Division name:</Typography>\n\n <Box display=\"flex\" alignItems=\"center\">\n <TextField autoFocus={true} value={name} onChange={onNameChange} onKeyDown={onKeyDown} type=\"text\" />\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={newIndustry}>\n Create Division\n </Button>\n </Box>\n </>\n );\n}\n","// React Component for displaying Corporation Overview info\nimport React, { useState } from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionModal } from \"./BribeFactionModal\";\nimport { SellSharesModal } from \"./SellSharesModal\";\nimport { BuybackSharesModal } from \"./BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./FindInvestorsModal\";\nimport { GoPublicModal } from \"./GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgrades } from \"../data/CorporationUpgrades\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n rerender: () => void;\n}\nexport function Overview({ rerender }: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const profit: number = corp.revenue.minus(corp.expenses).toNumber();\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.toNumber()} />],\n [\"Total Revenue:\", <MoneyRate money={corp.revenue.toNumber()} />],\n [\"Total Expenses:\", <MoneyRate money={corp.expenses.toNumber()} />],\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 <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 <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 <span>\n <Button disabled={!fundingAvailable} onClick={() => setFindInvestorsopen(true)}>\n Find Investors\n </Button>\n </span>\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 <br />\n </>\n );\n}\n\ninterface IUpgradeProps {\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ rerender }: IUpgradeProps): React.ReactElement {\n const corp = useCorporation();\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return <Typography variant=\"h4\">Upgrades are unlocked once you create an industry.</Typography>;\n }\n\n return (\n <>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Unlocks</Typography>\n <Grid container>\n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => corp.unlockUpgrades[upgrade[0]] === 0)\n .map((upgrade: CorporationUnlockUpgrade) => (\n <UnlockUpgrade rerender={rerender} upgradeData={upgrade} key={upgrade[0]} />\n ))}\n </Grid>\n </Paper>\n <Paper sx={{ p: 1, my: 1 }}>\n <Typography variant=\"h4\">Upgrades</Typography>\n <Grid container>\n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i])\n .map((upgrade: CorporationUpgrade) => (\n <LevelableUpgrade rerender={rerender} upgrade={upgrade} key={upgrade[0]} />\n ))}\n </Grid>\n </Paper>\n </>\n );\n}\n\ninterface IPublicButtonsProps {\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ rerender }: IPublicButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [sellSharesOpen, setSellSharesOpen] = useState(false);\n const [buybackSharesOpen, setBuybackSharesOpen] = useState(false);\n const [issueNewSharesOpen, setIssueNewSharesOpen] = useState(false);\n const [issueDividendsOpen, setIssueDividendsOpen] = useState(false);\n\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesTooltip = sellSharesOnCd\n ? \"Cannot sell shares for \" + corp.convertCooldownToString(corp.shareSaleCooldown)\n : \"Sell your shares in the company. The money earned from selling your \" +\n \"shares goes into your personal account, not the Corporation's. \" +\n \"This is one of the only ways to profit from your business venture.\";\n\n const issueNewSharesOnCd = corp.issueNewSharesCooldown > 0;\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n return (\n <>\n <Tooltip title={<Typography>{sellSharesTooltip}</Typography>}>\n <span>\n <Button disabled={sellSharesOnCd} onClick={() => setSellSharesOpen(true)}>\n Sell Shares\n </Button>\n </span>\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 <span>\n <Button disabled={corp.issuedShares > 0.5} onClick={() => setBuybackSharesOpen(true)}>\n Buyback shares\n </Button>\n </span>\n </Tooltip>\n <BuybackSharesModal open={buybackSharesOpen} onClose={() => setBuybackSharesOpen(false)} rerender={rerender} />\n <br />\n <Tooltip title={<Typography>{issueNewSharesTooltip}</Typography>}>\n <span>\n <Button disabled={issueNewSharesOnCd} onClick={() => setIssueNewSharesOpen(true)}>\n Issue New Shares\n </Button>\n </span>\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 <br />\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 <span>\n <Button disabled={!canBribe} onClick={openBribe}>\n Bribe Factions\n </Button>\n </span>\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 const playerEarnings = corp.numShares * dividendsPerShare;\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 (Pre-Tax):\", <MoneyRate money={playerEarnings} />],\n [\"Dividend Tax Rate:\", <>{corp.dividendTaxPercentage}%</>],\n [\n \"Your earnings as a shareholder (Post-Tax):\",\n <MoneyRate money={playerEarnings * (1 - corp.dividendTaxPercentage / 100)} />,\n ],\n ]}\n />\n );\n}\n\n// Returns a string with general information about Corporation\nfunction BonusTime(): React.ReactElement {\n const corp = useCorporation();\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <></>;\n return (\n <Typography>\n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n <br />\n <br />\n </Typography>\n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgrade;\n const level = corp.upgrades[data[0]];\n\n const baseCost = data[1];\n const priceMult = data[2];\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data[5];\n function onClick(): void {\n if (corp.funds.lt(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.lt(cost)} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={cost} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>{data[4]} </Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { useCorporation } from \"./Context\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgradeData;\n const tooltip = data[3];\n function onClick(): void {\n if (corp.funds.lt(data[1])) return;\n try {\n UU(corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <Grid item xs={4}>\n <Box display=\"flex\" alignItems=\"center\" flexDirection=\"row-reverse\">\n <Button disabled={corp.funds.lt(data[1])} sx={{ mx: 1 }} onClick={onClick}>\n <MoneyCost money={data[1]} corp={corp} />\n </Button>\n <Tooltip title={tooltip}>\n <Typography>{data[2]}</Typography>\n </Tooltip>\n </Box>\n </Grid>\n );\n}\n","import React, { useState } from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function BribeFactionModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factions = player.factions.filter((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(name)) return false;\n return true;\n });\n const corp = useCorporation();\n const [money, setMoney] = useState<number | null>(0);\n const [stock, setStock] = useState<number | null>(0);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled =\n money === null ||\n stock === null ||\n (money === 0 && stock === 0) ||\n isNaN(money) ||\n isNaN(stock) ||\n money < 0 ||\n stock < 0 ||\n corp.funds.lt(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.lt(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.minus(money);\n corp.numShares -= stock;\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Faction:</Typography>\n <Select value={selectedFaction} onChange={changeFaction}>\n {factions.map((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return;\n if (player.hasGangWith(name)) return;\n return (\n <MenuItem key={name} value={name}>\n {name}\n </MenuItem>\n );\n })}\n </Select>\n </Box>\n <Typography>{getRepText(money ? money : 0, stock ? stock : 0)}</Typography>\n <TextField onChange={onMoneyChange} placeholder=\"Corporation funds\" />\n <TextField sx={{ mx: 1 }} onChange={onStockChange} placeholder=\"Stock Shares\" />\n <Button disabled={disabled} sx={{ mx: 1 }} onClick={() => bribe(money ? money : 0, stock ? stock : 0)}>\n Bribe\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player sell Corporation shares\n// This is created when the player clicks the \"Sell Shares\" button in the overview panel\nexport function SellSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n\n const disabled = shares === null || isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function changeShares(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\n\n function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement {\n if (props.shares === null) return <></>;\n if (isNaN(props.shares) || props.shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to sell</>;\n } else if (props.shares > corp.numShares) {\n return <>You don't have this many shares to sell!</>;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n return (\n <>\n Sell {props.shares} shares for a total of {numeralWrapper.formatMoney(profit)}\n </>\n );\n }\n }\n\n function sell(): void {\n if (shares === null) return;\n if (disabled) return;\n const stockSaleResults = corp.calculateShareSale(shares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n corp.numShares -= shares;\n if (isNaN(corp.issuedShares)) {\n console.error(`Corporation issuedShares is NaN: ${corp.issuedShares}`);\n const res = corp.issuedShares;\n if (isNaN(res)) {\n corp.issuedShares = 0;\n } else {\n corp.issuedShares = res;\n }\n }\n corp.issuedShares += shares;\n corp.sharePrice = newSharePrice;\n corp.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n corp.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n player.gainMoney(profit);\n player.recordMoneySource(profit, \"corporation\");\n props.onClose();\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatMoney(shares)} shares for\n <Money money={profit} />. The corporation's stock price fell to <Money money={corp.sharePrice} />\n as a result of dilution.\n </>,\n );\n\n props.rerender();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sell();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to sell. The money from selling your shares will go directly to you\n (NOT your Corporation).\n <br />\n <br />\n Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a\n large number of shares all at once will have an immediate effect in reducing your stock price.\n <br />\n <br />\n The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)}\n </Typography>\n <ProfitIndicator shares={shares} corp={corp} />\n <br />\n <TextField\n variant=\"standard\"\n autoFocus\n type=\"number\"\n placeholder=\"Shares to sell\"\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={sell} sx={{ mx: 1 }}>\n Sell shares\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player buyback shares\n// This is created when the player clicks the \"Buyback Shares\" button in the overview panel\nexport function BuybackSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n\n function changeShares(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(Math.round(parseFloat(event.target.value)));\n }\n\n const currentStockPrice = corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n const disabled =\n shares === null ||\n isNaN(shares) ||\n shares <= 0 ||\n shares > corp.issuedShares ||\n shares * buybackPrice > player.money;\n\n function buy(): void {\n if (shares === null) return;\n corp.numShares += shares;\n if (isNaN(corp.issuedShares)) {\n console.warn(\"Corporation issuedShares is NaN: \" + corp.issuedShares);\n console.warn(\"Converting to number now\");\n const res = corp.issuedShares;\n if (isNaN(res)) {\n corp.issuedShares = 0;\n } else {\n corp.issuedShares = res;\n }\n }\n corp.issuedShares -= shares;\n player.loseMoney(shares * buybackPrice);\n props.onClose();\n props.rerender();\n }\n\n function CostIndicator(): React.ReactElement {\n if (shares === null) return <></>;\n if (isNaN(shares) || shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to buyback</>;\n } else if (shares > corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding shares.\n </>\n );\n } else {\n return (\n <>\n Purchase {shares} shares for a total of {numeralWrapper.formatMoney(shares * buybackPrice)}\n </>\n );\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) buy();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium.\n However, repurchasing shares from the market tends to lead to an increase in stock price.\n <br />\n <br />\n To purchase these shares, you must use your own money (NOT your Corporation's funds).\n <br />\n <br />\n The current buyback price of your company's stock is {numeralWrapper.formatMoney(buybackPrice)}. Your company\n currently has {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding stock shares.\n </Typography>\n <CostIndicator />\n <br />\n <TextField\n autoFocus={true}\n type=\"number\"\n placeholder=\"Shares to buyback\"\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <Button disabled={disabled} onClick={buy}>\n Buy shares\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { IssueDividends } from \"../Actions\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue & manage dividends\n// This is created when the player clicks the \"Issue Dividends\" button in the overview panel\nexport function IssueDividendsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [percent, setPercent] = useState(0);\n\n const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxPercentage * 100;\n function issueDividends(): void {\n if (!canIssue) return;\n if (percent === null) return;\n try {\n IssueDividends(corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) issueDividends();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPercent(0);\n else {\n let p = parseFloat(event.target.value);\n if (p > 50) p = 50;\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 {CorporationConstants.DividendMaxPercentage}. (A percentage of 0\n 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 * Dividends are taxed. Taxes start at 50%, but can be decreased\n <br />\n <br />\n Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends.\n That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as\n dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share\n per second before taxes.\n </Typography>\n <TextField\n autoFocus\n value={percent}\n onChange={onChange}\n onKeyDown={onKeyDown}\n placeholder=\"Dividend %\"\n type=\"number\"\n />\n <Button disabled={!canIssue} sx={{ mx: 1 }} onClick={issueDividends}>\n Allocate Dividend Percentage\n </Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IEffectTextProps {\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n const corp = useCorporation();\n if (props.shares === null) return <></>;\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return <Typography>Invalid input</Typography>;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return <Typography>Must issue at least 10 million new shares</Typography>;\n }\n\n if (newShares > maxNewShares) {\n return <Typography>You cannot issue that many shares</Typography>;\n }\n\n return (\n <Typography>\n Issue ${numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n </Typography>\n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue new shares\n// This is created when the player clicks the \"Issue New Shares\" buttons in the overview panel\nexport function IssueNewSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState<number | null>(null);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n const newShares = Math.round((shares || 0) / 10e6) * 10e6;\n const disabled = shares === null || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (shares === null) return;\n if (disabled) return;\n\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n let newShares = shares;\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n const profit = newShares * newSharePrice;\n corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n corp.totalShares += newShares;\n\n // Determine how many are bought by private investors\n // Private investors get up to 50% at most\n // Round # of private shares to the nearest millionth\n let privateShares = getRandomInt(0, Math.round(newShares / 2));\n privateShares = Math.round(privateShares / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.funds = corp.funds.plus(profit);\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n dialogBoxCreate(\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} and raised ` +\n `${numeralWrapper.formatMoney(profit)}. ${numeralWrapper.format(privateShares, \"0.000a\")} ` +\n `of these shares were bought by private investors.<br><br>` +\n `Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`,\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) issueNewShares();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setShares(null);\n else setShares(parseFloat(event.target.value));\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n <br />\n <br />\n * You can issue at most {numeralWrapper.formatMoney(maxNewShares)} new shares\n <br />\n * New shares are sold at a 10% discount\n <br />\n * You can only issue new shares once every 12 hours\n <br />\n * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n <br />\n * Number of new shares issued must be a multiple of 10 million\n <br />\n <br />\n When you choose to issue new equity, private shareholders have first priority for up to 50% of the new shares.\n If they choose to exercise this option, these newly issued shares become private, restricted shares, which means\n you cannot buy them back.\n </Typography>\n <EffectText shares={shares} />\n <TextField autoFocus placeholder=\"# New Shares\" onChange={onChange} onKeyDown={onKeyDown} />\n <Button disabled={disabled} onClick={issueNewShares} sx={{ mx: 1 }}>\n Issue New Shares\n </Button>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useCorporation } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const val = corp.determineValuation();\n let percShares = 0;\n let roundMultiplier = 4;\n switch (corp.fundingRound) {\n case 0: //Seed\n percShares = 0.1;\n roundMultiplier = 4;\n break;\n case 1: //Series A\n percShares = 0.35;\n roundMultiplier = 3;\n break;\n case 2: //Series B\n percShares = 0.25;\n roundMultiplier = 3;\n break;\n case 3: //Series C\n percShares = 0.2;\n roundMultiplier = 2.5;\n break;\n default:\n return <></>;\n }\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n\n function findInvestors(): void {\n corp.fundingRound++;\n corp.addFunds(funding);\n corp.numShares -= investShares;\n props.rerender();\n props.onClose();\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n An investment firm has offered you {numeralWrapper.formatMoney(funding)} in funding in exchange for a{\" \"}\n {numeralWrapper.format(percShares * 100, \"0.000a\")}% stake in the company (\n {numeralWrapper.format(investShares, \"0.000a\")} shares).\n <br />\n <br />\n Do you accept or reject this offer?\n <br />\n <br />\n Hint: Investment firms will offer more money if your corporation is turning a profit\n </Typography>\n <Button onClick={findInvestors}>Accept</Button>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(\"\");\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const numShares = parseFloat(shares);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(numShares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (numShares > corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n corp.public = true;\n corp.sharePrice = initialSharePrice;\n corp.issuedShares = numShares;\n corp.numShares -= numShares;\n corp.addFunds(numShares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(numShares * initialSharePrice)} in your IPO`,\n );\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) goPublic();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setShares(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will\n no longer own them. Your Corporation will receive {numeralWrapper.formatMoney(initialSharePrice)} per share (the\n IPO money will be deposited directly into your Corporation's funds).\n <br />\n <br />\n You have a total of {numeralWrapper.format(corp.numShares, \"0.000a\")} of shares that you can issue.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <TextField\n value={shares}\n onChange={onChange}\n autoFocus\n type=\"number\"\n placeholder=\"Shares to issue\"\n onKeyDown={onKeyDown}\n />\n <Button sx={{ mx: 1 }} onClick={goPublic}>\n Go Public\n </Button>\n </Box>\n </Modal>\n );\n}\n","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport React, { useState } from \"react\";\nimport { Intro } from \"./Intro\";\nimport { Game } from \"./Game\";\nimport { Location } from \"../../Locations/Location\";\nimport { use } from \"../../ui/Context\";\n\ninterface IProps {\n location: Location;\n}\nfunction calcDifficulty(player: IPlayer, startingDifficulty: number): number {\n const totalStats = player.strength + player.defense + player.dexterity + player.agility + player.charisma;\n const difficulty = startingDifficulty - Math.pow(totalStats, 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 InfiltrationRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [start, setStart] = useState(false);\n\n if (props.location.infiltrationData === undefined) throw new Error(\"Trying to do infiltration on invalid location.\");\n const startingDifficulty = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calcDifficulty(player, startingDifficulty);\n\n function cancel(): void {\n router.toCity();\n }\n\n if (!start) {\n return (\n <Intro\n Location={props.location}\n Difficulty={difficulty}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n start={() => setStart(true)}\n cancel={cancel}\n />\n );\n }\n\n return (\n <Game\n StartingDifficulty={startingDifficulty}\n Difficulty={difficulty}\n MaxLevel={props.location.infiltrationData.maxClearanceLevel}\n />\n );\n}\n","import React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport Grid from \"@mui/material/Grid\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n Location: Location;\n Difficulty: number;\n MaxLevel: number;\n start: () => void;\n cancel: () => void;\n}\n\nfunction arrowPart(color: string, length: number): JSX.Element {\n let arrow = \"\";\n if (length <= 0) length = 0;\n else if (length > 13) length = 13;\n else {\n length--;\n arrow = \">\";\n }\n return (\n <span style={{ color: color }}>\n {\"=\".repeat(length)}\n {arrow}\n {\" \".repeat(13 - arrow.length - length)}\n </span>\n );\n}\n\nfunction coloredArrow(difficulty: number): JSX.Element {\n if (difficulty === 0) {\n return (\n <span style={{ color: \"white\" }}>\n {\">\"}\n {\" \".repeat(38)}\n </span>\n );\n } else {\n return (\n <>\n {arrowPart(\"white\", difficulty * 13)}\n {arrowPart(\"orange\", (difficulty - 1) * 13)}\n {arrowPart(\"red\", (difficulty - 2) * 13)}\n </>\n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={10}>\n <Typography variant=\"h4\">Infiltrating {props.Location.name}</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n Maximum level: {props.MaxLevel}\n </Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>[{coloredArrow(props.Difficulty)}]</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{` ^ ^ ^ ^`}</Typography>\n <Typography\n sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}\n >{` Trivial Normal Hard Impossible`}</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography>\n Infiltration is a series of short minigames that get progressively harder. You take damage for failing them.\n Reaching the maximum level rewards you with intel you can trade for money or reputation.\n </Typography>\n <br />\n <Typography>\n The minigames you play are randomly selected. It might take you few tries to get used to them.\n </Typography>\n <br />\n <Typography>No game require use of the mouse.</Typography>\n <br />\n <Typography>Spacebar is the default action/confirm button.</Typography>\n <br />\n <Typography>Everything that uses arrow can also use WASD</Typography>\n <br />\n <Typography>Sometimes the rest of the keyboard is used.</Typography>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={props.start}>Start</Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={props.cancel}>Cancel</Button>\n </Grid>\n </Grid>\n </>\n );\n}\n","import { use } from \"../../ui/Context\";\nimport React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { Countdown } from \"./Countdown\";\nimport { BracketGame } from \"./BracketGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\nimport { Victory } from \"./Victory\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n MaxLevel: number;\n}\n\nenum Stage {\n Countdown = 0,\n Minigame,\n Result,\n Sell,\n}\n\nconst minigames = [\n SlashGame,\n BracketGame,\n BackwardGame,\n BribeGame,\n CheatCodeGame,\n Cyberpunk2077Game,\n MinesweeperGame,\n WireCuttingGame,\n];\n\nexport function Game(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [level, setLevel] = useState(1);\n const [stage, setStage] = useState(Stage.Countdown);\n const [results, setResults] = useState(\"\");\n const [gameIds, setGameIds] = useState({\n lastGames: [-1, -1],\n id: Math.floor(Math.random() * minigames.length),\n });\n\n function nextGameId(): number {\n let id = gameIds.lastGames[0];\n const ids = [gameIds.lastGames[0], gameIds.lastGames[1], gameIds.id];\n while (ids.includes(id)) {\n id = Math.floor(Math.random() * minigames.length);\n }\n return id;\n }\n\n function setupNextGame(): void {\n setGameIds({\n lastGames: [gameIds.lastGames[1], gameIds.id],\n id: nextGameId(),\n });\n }\n\n function success(): void {\n pushResult(true);\n if (level === props.MaxLevel) {\n setStage(Stage.Sell);\n } else {\n setStage(Stage.Countdown);\n setLevel(level + 1);\n }\n setupNextGame();\n }\n\n function pushResult(win: boolean): void {\n setResults((old) => {\n let next = old;\n next += win ? \"✓\" : \"✗\";\n if (next.length > 15) next = next.slice(1);\n return next;\n });\n }\n\n function failure(options?: { automated: boolean }): void {\n setStage(Stage.Countdown);\n pushResult(false);\n // Kill the player immediately if they use automation, so\n // it's clear they're not meant to\n const damage = options?.automated ? player.hp : props.StartingDifficulty * 3;\n if (player.takeDamage(damage)) {\n router.toCity();\n return;\n }\n setupNextGame();\n }\n\n 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 MaxLevel={props.MaxLevel}\n />\n );\n break;\n }\n\n function Progress(): React.ReactElement {\n return (\n <h4>\n <span style={{ color: \"gray\" }}>{results.slice(0, results.length - 1)}</span>\n {results[results.length - 1]}\n </h4>\n );\n }\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={3}>\n <Typography>\n Level: {level} / {props.MaxLevel}\n </Typography>\n <Progress />\n </Grid>\n\n <Grid item xs={12}>\n {stageComponent}\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\n\nimport Typography from \"@mui/material/Typography\";\ninterface IProps {\n onFinish: () => void;\n}\n\nexport function Countdown(props: IProps): React.ReactElement {\n const [x, setX] = useState(3);\n useEffect(() => {\n if (x === 0) {\n props.onFinish();\n return;\n }\n setTimeout(() => setX(x - 1), 200);\n });\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <Typography variant=\"h4\">Get Ready!</Typography>\n <Typography variant=\"h4\">{x}</Typography>\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 8000, min: 2, max: 3 },\n Normal: { timer: 6000, min: 4, max: 5 },\n Hard: { timer: 4000, min: 4, max: 6 },\n Impossible: { timer: 2500, min: 7, max: 7 },\n};\n\nfunction generateLeftSide(difficulty: Difficulty): string {\n let str = \"\";\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += [\"[\", \"<\", \"(\", \"{\"][Math.floor(Math.random() * 4)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.keyCode == 48 && event.shiftKey) return \")\";\n if (event.keyCode == 221 && !event.shiftKey) return \"]\";\n if (event.keyCode == 221 && event.shiftKey) return \"}\";\n if (event.keyCode == 190 && event.shiftKey) return \">\";\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === \"[\" && right === \"]\") ||\n (left === \"<\" && right === \">\") ||\n (left === \"(\" && right === \")\") ||\n (left === \"{\" && right === \"}\")\n );\n}\n\nexport function BracketGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [right, setRight] = useState(\"\");\n const [left] = useState(generateLeftSide(difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const char = getChar(event);\n if (!char) return;\n if (!match(left[left.length - right.length - 1], char)) {\n props.onFailure();\n return;\n }\n if (left.length === right.length + 1) {\n props.onSuccess();\n return;\n }\n setRight(right + char);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Close the brackets</Typography>\n <Typography style={{ fontSize: \"5em\" }}>\n {`${left}${right}`}\n <BlinkingCursor />\n </Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n window: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { window: 600 },\n Normal: { window: 325 },\n Hard: { window: 250 },\n Impossible: { window: 150 },\n};\n\nexport function SlashGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { window: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const [guarding, setGuarding] = useState(true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.keyCode !== 32) return;\n if (guarding) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n\n useEffect(() => {\n let id2 = -1;\n const id = window.setTimeout(() => {\n setGuarding(false);\n id2 = window.setTimeout(() => setGuarding(true), difficulty.window);\n }, Math.random() * 3250 + 1500);\n return () => {\n clearInterval(id);\n if (id2 !== -1) clearInterval(id2);\n };\n }, []);\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={5000} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Slash when his guard is down!</Typography>\n <Typography variant=\"h4\">{guarding ? \"!Guarding!\" : \"!ATTACKING!\"}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 16000, min: 3, max: 4 },\n Normal: { timer: 12500, min: 2, max: 3 },\n Hard: { timer: 15000, min: 3, max: 4 },\n Impossible: { timer: 8000, min: 4, max: 4 },\n};\n\nexport function BackwardGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [answer] = useState(makeAnswer(difficulty));\n const [guess, setGuess] = useState(\"\");\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.keyCode === 16) return;\n const nextGuess = guess + event.key.toUpperCase();\n if (!answer.startsWith(nextGuess)) props.onFailure();\n else if (answer === nextGuess) props.onSuccess();\n else setGuess(nextGuess);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Type it backward</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <Typography style={{ transform: \"scaleX(-1)\" }}>{answer}</Typography>\n </Grid>\n <Grid item xs={6}>\n <Typography>\n {guess}\n <BlinkingCursor />\n </Typography>\n </Grid>\n </Grid>\n );\n}\n\nfunction makeAnswer(difficulty: Difficulty): string {\n const length = random(difficulty.min, difficulty.max);\n let answer = \"\";\n for (let i = 0; i < length; i++) {\n if (i > 0) answer += \" \";\n answer += words[Math.floor(Math.random() * words.length)];\n }\n\n return answer;\n}\n\nconst words = [\n \"ALGORITHM\",\n \"ANALOG\",\n \"APP\",\n \"APPLICATION\",\n \"ARRAY\",\n \"BACKUP\",\n \"BANDWIDTH\",\n \"BINARY\",\n \"BIT\",\n \"BITE\",\n \"BITMAP\",\n \"BLOG\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BOOT\",\n \"BROADBAND\",\n \"BROWSER\",\n \"BUFFER\",\n \"BUG\",\n \"BUS\",\n \"BYTE\",\n \"CACHE\",\n \"CAPS LOCK\",\n \"CAPTCHA\",\n \"CD\",\n \"CD-ROM\",\n \"CLIENT\",\n \"CLIPBOARD\",\n \"CLOUD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"COOKIE\",\n \"COPY\",\n \"CPU\",\n \"CYBERCRIME\",\n \"CYBERSPACE\",\n \"DASHBOARD\",\n \"DATA\",\n \"MINING\",\n \"DATABASE\",\n \"DEBUG\",\n \"DECOMPRESS\",\n \"DELETE\",\n \"DESKTOP\",\n \"DEVELOPMENT\",\n \"DIGITAL\",\n \"DISK\",\n \"DNS\",\n \"DOCUMENT\",\n \"DOMAIN\",\n \"DOMAIN NAME\",\n \"DOT\",\n \"DOT MATRIX\",\n \"DOWNLOAD\",\n \"DRAG\",\n \"DVD\",\n \"DYNAMIC\",\n \"EMAIL\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"ENCRYPTION\",\n \"ENTER\",\n \"EXABYTE\",\n \"FAQ\",\n \"FILE\",\n \"FINDER\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLASH\",\n \"FLASH DRIVE\",\n \"FLOPPY DISK\",\n \"FLOWCHART\",\n \"FOLDER\",\n \"FONT\",\n \"FORMAT\",\n \"FRAME\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HACK\",\n \"HACKER\",\n \"HARDWARE\",\n \"HOME PAGE\",\n \"HOST\",\n \"HTML\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"ICON\",\n \"INBOX\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"IP ADDRESS\",\n \"ITERATION\",\n \"JAVA\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KERNEL\",\n \"KEY\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LAPTOP\",\n \"LASER PRINTER\",\n \"LINK\",\n \"LINUX\",\n \"LOG OUT\",\n \"LOGIC\",\n \"LOGIN\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MACRO\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MEDIA\",\n \"MEMORY\",\n \"MIRROR\",\n \"MODEM\",\n \"MONITOR\",\n \"MOTHERBOARD\",\n \"MOUSE\",\n \"MULTIMEDIA\",\n \"NET\",\n \"NETWORK\",\n \"NODE\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"ONLINE\",\n \"OPENSOURCE\",\n \"OPERATING\",\n \"SYSTEM\",\n \"OPTION\",\n \"OUTPUT\",\n \"PAGE\",\n \"PASSWORD\",\n \"PASTE\",\n \"PATH\",\n \"PHISHING\",\n \"PIRACY\",\n \"PIRATE\",\n \"PLATFORM\",\n \"PLUGIN\",\n \"PODCAST\",\n \"POPUP\",\n \"PORTAL\",\n \"PRINT\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROGRAMMER\",\n \"PROTOCOL\",\n \"QUEUE\",\n \"QWERTY\",\n \"RAM\",\n \"REALTIME\",\n \"REBOOT\",\n \"RESOLUTION\",\n \"RESTORE\",\n \"ROM\",\n \"ROOT\",\n \"ROUTER\",\n \"RUNTIME\",\n \"SAVE\",\n \"SCAN\",\n \"SCANNER\",\n \"SCREEN\",\n \"SCREENSHOT\",\n \"SCRIPT\",\n \"SCROLL\",\n \"SCROLL\",\n \"SEARCH\",\n \"ENGINE\",\n \"SECURITY\",\n \"SERVER\",\n \"SHAREWARE\",\n \"SHELL\",\n \"SHIFT\",\n \"SHIFT KEY\",\n \"SNAPSHOT\",\n \"SOCIAL NETWORKING\",\n \"SOFTWARE\",\n \"SPAM\",\n \"SPAMMER\",\n \"SPREADSHEET\",\n \"SPYWARE\",\n \"STATUS\",\n \"STORAGE\",\n \"SUPERCOMPUTER\",\n \"SURF\",\n \"SYNTAX\",\n \"TABLE\",\n \"TAG\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TEXT EDITOR\",\n \"THREAD\",\n \"TOOLBAR\",\n \"TRASH\",\n \"TROJAN HORSE\",\n \"TYPEFACE\",\n \"UNDO\",\n \"UNIX\",\n \"UPLOAD\",\n \"URL\",\n \"USER\",\n \"USER INTERFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"VIRTUAL MEMORY\",\n \"VIRUS\",\n \"WEB\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WIDGET\",\n \"WIKI\",\n \"WINDOW\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n \"WORKSTATION\",\n \"WEB\",\n \"WORM\",\n \"WWW\",\n \"XML\",\n \"ZIP\",\n];\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n size: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12000, size: 6 },\n Normal: { timer: 9000, size: 8 },\n Hard: { timer: 5000, size: 9 },\n Impossible: { timer: 2500, size: 12 },\n};\n\nexport function BribeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, size: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [choices] = useState(makeChoices(difficulty));\n const [index, setIndex] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const k = event.keyCode;\n if (k === 32) {\n if (positive.includes(choices[index])) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([38, 87, 68, 39].includes(k)) newIndex++;\n if ([65, 37, 83, 40].includes(k)) newIndex--;\n while (newIndex < 0) newIndex += choices.length;\n while (newIndex > choices.length - 1) newIndex -= choices.length;\n setIndex(newIndex);\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Say something nice about the guard.</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <Typography variant=\"h5\" color=\"primary\">\n ↑\n </Typography>\n <Typography variant=\"h5\" color=\"primary\">\n {choices[index]}\n </Typography>\n <Typography variant=\"h5\" color=\"primary\">\n ↓\n </Typography>\n </Grid>\n </Grid>\n );\n}\n\nfunction shuffleArray(array: string[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}\n\nfunction makeChoices(difficulty: Difficulty): string[] {\n const choices = [];\n choices.push(positive[Math.floor(Math.random() * positive.length)]);\n for (let i = 0; i < difficulty.size; i++) {\n const option = negative[Math.floor(Math.random() * negative.length)];\n if (choices.includes(option)) {\n i--;\n continue;\n }\n choices.push(option);\n }\n shuffleArray(choices);\n return choices;\n}\n\nconst positive = [\n \"affectionate\",\n \"agreeable\",\n \"bright\",\n \"charming\",\n \"creative\",\n \"determined\",\n \"energetic\",\n \"friendly\",\n \"funny\",\n \"generous\",\n \"polite\",\n \"likable\",\n \"diplomatic\",\n \"helpful\",\n \"giving\",\n \"kind\",\n \"hardworking\",\n \"patient\",\n \"dynamic\",\n \"loyal\",\n];\n\nconst negative = [\n \"aggressive\",\n \"aloof\",\n \"arrogant\",\n \"big-headed\",\n \"boastful\",\n \"boring\",\n \"bossy\",\n \"careless\",\n \"clingy\",\n \"couch potato\",\n \"cruel\",\n \"cynical\",\n \"grumpy\",\n \"hot air\",\n \"know it all\",\n \"obnoxious\",\n \"pain in the neck\",\n \"picky\",\n \"tactless\",\n \"thoughtless\",\n];\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random, getArrow } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 13000, min: 6, max: 8 },\n Normal: { timer: 7000, min: 7, max: 8 },\n Hard: { timer: 5000, min: 8, max: 9 },\n Impossible: { timer: 3000, min: 9, max: 10 },\n};\n\nexport function CheatCodeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [code] = useState(generateCode(difficulty));\n const [index, setIndex] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event)) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Enter the Code!</Typography>\n <Typography variant=\"h4\">{code[index]}</Typography>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [\"←\", \"→\", \"↑\", \"↓\"];\n let code = \"\";\n for (let i = 0; i < random(difficulty.min, difficulty.max); i++) {\n let arrow = arrows[Math.floor(4 * Math.random())];\n while (arrow === code[code.length - 1]) arrow = arrows[Math.floor(4 * Math.random())];\n code += arrow;\n }\n\n return code;\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport { getArrow } from \"../utils\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12500, width: 3, height: 3, symbols: 6 },\n Normal: { timer: 15000, width: 4, height: 4, symbols: 7 },\n Hard: { timer: 12500, width: 5, height: 5, symbols: 8 },\n Impossible: { timer: 10000, width: 6, height: 6, symbols: 9 },\n};\n\nexport function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, symbols: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [grid] = useState(generatePuzzle(difficulty));\n const [answer] = useState(generateAnswer(grid, difficulty));\n const [index, setIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case \"↑\":\n move[1]--;\n break;\n case \"←\":\n move[0]--;\n break;\n case \"↓\":\n move[1]++;\n break;\n case \"→\":\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + grid[0].length) % grid[0].length;\n next[1] = (next[1] + grid.length) % grid.length;\n setPos(next);\n\n if (event.keyCode == 32) {\n const selected = grid[pos[1]][pos[0]];\n const expected = answer[index];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (answer.length === index + 1) props.onSuccess();\n }\n }\n\n const fontSize = \"2em\";\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Match the symbols!</Typography>\n <Typography variant=\"h5\" color=\"primary\">\n Targets:{\" \"}\n {answer.map((a, i) => {\n if (i == index)\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: \"blue\" }}>\n {a} \n </span>\n );\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\" }}>\n {a} \n </span>\n );\n })}\n </Typography>\n <br />\n {grid.map((line, y) => (\n <div key={y}>\n <Typography>\n {line.map((cell, x) => {\n if (x == pos[0] && y == pos[1])\n return (\n <span key={`${x}${y}`} style={{ fontSize: fontSize, color: \"blue\" }}>\n {cell} \n </span>\n );\n return (\n <span key={`${x}${y}`} style={{ fontSize: fontSize }}>\n {cell} \n </span>\n );\n })}\n </Typography>\n <br />\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction generateAnswer(grid: string[][], difficulty: Difficulty): string[] {\n const answer = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answer.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answer;\n}\n\nfunction randChar(): string {\n return \"ABCDEF0123456789\"[Math.floor(Math.random() * 16)];\n}\n\nfunction generatePuzzle(difficulty: Difficulty): string[][] {\n const puzzle = [];\n for (let i = 0; i < Math.round(difficulty.height); i++) {\n const line = [];\n for (let j = 0; j < Math.round(difficulty.width); j++) {\n line.push(randChar() + randChar());\n }\n puzzle.push(line);\n }\n return puzzle;\n}\n","import React, { useState, useEffect } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { interpolate } from \"./Difficulty\";\nimport { getArrow } from \"../utils\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n mines: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 15000, width: 3, height: 3, mines: 4 },\n Normal: { timer: 15000, width: 4, height: 4, mines: 7 },\n Hard: { timer: 15000, width: 5, height: 5, mines: 11 },\n Impossible: { timer: 15000, width: 6, height: 6, mines: 15 },\n};\n\nexport function MinesweeperGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, mines: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [minefield] = useState(generateMinefield(difficulty));\n const [answer, setAnswer] = useState(generateEmptyField(difficulty));\n const [pos, setPos] = useState([0, 0]);\n const [memoryPhase, setMemoryPhase] = useState(true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (memoryPhase) return;\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case \"↑\":\n move[1]--;\n break;\n case \"←\":\n move[0]--;\n break;\n case \"↓\":\n move[1]++;\n break;\n case \"→\":\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + minefield[0].length) % minefield[0].length;\n next[1] = (next[1] + minefield.length) % minefield.length;\n setPos(next);\n\n if (event.keyCode == 32) {\n if (!minefield[pos[1]][pos[0]]) {\n props.onFailure();\n return;\n }\n setAnswer((old) => {\n old[pos[1]][pos[0]] = true;\n if (fieldEquals(minefield, old)) props.onSuccess();\n return old;\n });\n }\n }\n\n useEffect(() => {\n const id = setTimeout(() => setMemoryPhase(false), 2000);\n return () => clearInterval(id);\n }, []);\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">{memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}</Typography>\n {minefield.map((line, y) => (\n <div key={y}>\n <Typography>\n {line.map((cell, x) => {\n if (memoryPhase) {\n if (minefield[y][x]) return <span key={x}>[?] </span>;\n return <span key={x}>[ ] </span>;\n } else {\n if (x == pos[0] && y == pos[1]) return <span key={x}>[X] </span>;\n if (answer[y][x]) return <span key={x}>[.] </span>;\n return <span key={x}>[ ] </span>;\n }\n })}\n </Typography>\n <br />\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction fieldEquals(a: boolean[][], b: boolean[][]): boolean {\n function count(field: boolean[][]): number {\n return field.flat().reduce((a, b) => a + (b ? 1 : 0), 0);\n }\n return count(a) === count(b);\n}\n\nfunction generateEmptyField(difficulty: Difficulty): boolean[][] {\n const field = [];\n for (let i = 0; i < difficulty.height; i++) {\n field.push(new Array(Math.round(difficulty.width)).fill(false));\n }\n return field;\n}\n\nfunction generateMinefield(difficulty: Difficulty): boolean[][] {\n const field = generateEmptyField(difficulty);\n for (let i = 0; i < difficulty.mines; i++) {\n const x = Math.floor(Math.random() * field.length);\n const y = Math.floor(Math.random() * field[0].length);\n if (field[x][y]) {\n i--;\n continue;\n }\n field[x][y] = true;\n }\n return field;\n}\n","import React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport Typography from \"@mui/material/Typography\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\nimport { GameTimer } from \"./GameTimer\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n wiresmin: number;\n wiresmax: number;\n rules: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 9000, wiresmin: 4, wiresmax: 4, rules: 2 },\n Normal: { timer: 7000, wiresmin: 6, wiresmax: 6, rules: 2 },\n Hard: { timer: 5000, wiresmin: 8, wiresmax: 8, rules: 3 },\n Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 },\n};\n\nconst types = [\"|\", \".\", \"/\", \"-\", \"█\", \"#\"];\n\nconst colors = [\"red\", \"#FFC107\", \"blue\", \"white\"];\n\nconst colorNames: any = {\n red: \"red\",\n \"#FFC107\": \"yellow\",\n blue: \"blue\",\n white: \"white\",\n};\n\ninterface Wire {\n tpe: string;\n colors: string[];\n}\n\ninterface Question {\n toString: () => string;\n shouldCut: (wire: Wire, index: number) => boolean;\n}\n\nexport function WireCuttingGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = {\n timer: 0,\n wiresmin: 0,\n wiresmax: 0,\n rules: 0,\n };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [wires] = useState(generateWires(difficulty));\n const [cutWires, setCutWires] = useState(new Array(wires.length).fill(false));\n const [questions] = useState(generateQuestion(wires, difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const wireNum = parseInt(event.key);\n\n if (wireNum < 1 || wireNum > wires.length || isNaN(wireNum)) return;\n setCutWires((old) => {\n const next = [...old];\n next[wireNum - 1] = true;\n if (!questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1))) {\n props.onFailure();\n }\n\n // check if we won\n const wiresToBeCut = [];\n for (let j = 0; j < wires.length; j++) {\n let shouldBeCut = false;\n for (let i = 0; i < questions.length; i++) {\n shouldBeCut = shouldBeCut || questions[i].shouldCut(wires[j], j);\n }\n wiresToBeCut.push(shouldBeCut);\n }\n if (wiresToBeCut.every((b, i) => b === next[i])) {\n props.onSuccess();\n }\n\n return next;\n });\n }\n\n return (\n <Grid container spacing={3}>\n <GameTimer millis={timer} onExpire={props.onFailure} />\n <Grid item xs={12}>\n <Typography variant=\"h4\">Cut the wires with the following properties! (keyboard 1 to 9)</Typography>\n {questions.map((question, i) => (\n <Typography key={i}>{question.toString()}</Typography>\n ))}\n <Typography>\n {new Array(wires.length).fill(0).map((_, i) => (\n <span key={i}> {i + 1} </span>\n ))}\n </Typography>\n {new Array(8).fill(0).map((_, i) => (\n <div key={i}>\n <Typography>\n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j])\n return <span key={j}> </span>;\n return (\n <span key={j} style={{ color: wire.colors[i % wire.colors.length] }}>\n |{wire.tpe}| \n </span>\n );\n })}\n </Typography>\n </div>\n ))}\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n </Grid>\n );\n}\n\nfunction randomPositionQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n return {\n toString: (): string => {\n return `Cut wires number ${index + 1}.`;\n },\n shouldCut: (wire: Wire, i: number): boolean => {\n return index === i;\n },\n };\n}\n\nfunction randomColorQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n const cutColor = wires[index].colors[0];\n return {\n toString: (): string => {\n return `Cut all wires colored ${colorNames[cutColor]}.`;\n },\n shouldCut: (wire: Wire): boolean => {\n return wire.colors.includes(cutColor);\n },\n };\n}\n\nfunction generateQuestion(wires: Wire[], difficulty: Difficulty): Question[] {\n const numQuestions = difficulty.rules;\n const questionGenerators = [randomPositionQuestion, randomColorQuestion];\n const questions = [];\n for (let i = 0; i < numQuestions; i++) {\n questions.push(questionGenerators[i % 2](wires));\n }\n return questions;\n}\n\nfunction generateWires(difficulty: Difficulty): Wire[] {\n const wires = [];\n const numWires = random(difficulty.wiresmin, difficulty.wiresmax);\n for (let i = 0; i < numWires; i++) {\n const wireColors = [colors[Math.floor(Math.random() * colors.length)]];\n if (Math.random() < 0.15) {\n wireColors.push(colors[Math.floor(Math.random() * colors.length)]);\n }\n wires.push({\n tpe: types[Math.floor(Math.random() * types.length)],\n colors: wireColors,\n });\n }\n return wires;\n}\n","import { Factions } from \"../../Faction/Factions\";\nimport React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n MaxLevel: number;\n}\n\nexport function Victory(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [faction, setFaction] = useState(\"none\");\n\n function quitInfiltration(): void {\n router.toCity();\n }\n\n const levelBonus = props.MaxLevel * Math.pow(1.01, props.MaxLevel);\n\n const repGain =\n Math.pow(props.Difficulty + 1, 1.1) *\n Math.pow(props.StartingDifficulty, 1.2) *\n 30 *\n levelBonus *\n BitNodeMultipliers.InfiltrationRep;\n\n const moneyGain =\n Math.pow(props.Difficulty + 1, 2) *\n Math.pow(props.StartingDifficulty, 3) *\n 3e3 *\n levelBonus *\n BitNodeMultipliers.InfiltrationMoney;\n\n function sell(): void {\n player.gainMoney(moneyGain);\n player.recordMoneySource(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n if (faction === \"none\") return;\n Factions[faction].playerReputation += repGain;\n quitInfiltration();\n }\n\n function changeDropdown(event: SelectChangeEvent<string>): void {\n setFaction(event.target.value);\n }\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={10}>\n <Typography variant=\"h4\">Infiltration successful!</Typography>\n </Grid>\n <Grid item xs={10}>\n <Typography variant=\"h5\" color=\"primary\">\n You can trade the confidential information you found for money or reputation.\n </Typography>\n <Select value={faction} onChange={changeDropdown}>\n <MenuItem key={\"none\"} value={\"none\"}>\n {\"none\"}\n </MenuItem>\n {player.factions\n .filter((f) => Factions[f].getInfo().offersWork())\n .map((f) => (\n <MenuItem key={f} value={f}>\n {f}\n </MenuItem>\n ))}\n </Select>\n <Button onClick={trade}>\n Trade for <Reputation reputation={repGain} /> reputation\n </Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={sell}>\n Sell for \n <Money money={moneyGain} />\n </Button>\n </Grid>\n <Grid item xs={3}>\n <Button onClick={quitInfiltration}>Quit</Button>\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { generateResleeves } from \"../Resleeving\";\nimport { Resleeve } from \"../Resleeve\";\nimport { ResleeveElem } from \"./ResleeveElem\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\n\nconst SortOption: {\n [key: string]: string | undefined;\n Cost: string;\n Hacking: string;\n Strength: string;\n Defense: string;\n Dexterity: string;\n Agility: string;\n Charisma: string;\n AverageCombatStats: string;\n AverageAllStats: string;\n TotalNumAugmentations: string;\n} = {\n Cost: \"Cost\",\n Hacking: \"Hacking Level\",\n Strength: \"Strength Level\",\n Defense: \"Defense Level\",\n Dexterity: \"Dexterity Level\",\n Agility: \"Agility Level\",\n Charisma: \"Charisma Level\",\n AverageCombatStats: \"Average Combat Stats\",\n AverageAllStats: \"Average Stats\",\n TotalNumAugmentations: \"Number of Augmentations\",\n};\n\n// Helper function for averaging\nfunction getAverage(...values: number[]): number {\n let sum = 0;\n for (let i = 0; i < values.length; ++i) {\n sum += values[i];\n }\n\n return sum / values.length;\n}\n\nconst SortFunctions: {\n [key: string]: ((a: Resleeve, b: Resleeve) => number) | undefined;\n Cost: (a: Resleeve, b: Resleeve) => number;\n Hacking: (a: Resleeve, b: Resleeve) => number;\n Strength: (a: Resleeve, b: Resleeve) => number;\n Defense: (a: Resleeve, b: Resleeve) => number;\n Dexterity: (a: Resleeve, b: Resleeve) => number;\n Agility: (a: Resleeve, b: Resleeve) => number;\n Charisma: (a: Resleeve, b: Resleeve) => number;\n AverageCombatStats: (a: Resleeve, b: Resleeve) => number;\n AverageAllStats: (a: Resleeve, b: Resleeve) => number;\n TotalNumAugmentations: (a: Resleeve, b: Resleeve) => number;\n} = {\n Cost: (a: Resleeve, b: Resleeve): number => a.getCost() - b.getCost(),\n Hacking: (a: Resleeve, b: Resleeve): number => a.hacking_skill - b.hacking_skill,\n Strength: (a: Resleeve, b: Resleeve): number => a.strength - b.strength,\n Defense: (a: Resleeve, b: Resleeve): number => a.defense - b.defense,\n Dexterity: (a: Resleeve, b: Resleeve): number => a.dexterity - b.dexterity,\n Agility: (a: Resleeve, b: Resleeve): number => a.agility - b.agility,\n Charisma: (a: Resleeve, b: Resleeve): number => a.charisma - b.charisma,\n AverageCombatStats: (a: Resleeve, b: Resleeve): number =>\n getAverage(a.strength, a.defense, a.dexterity, a.agility) -\n getAverage(b.strength, b.defense, b.dexterity, b.agility),\n AverageAllStats: (a: Resleeve, b: Resleeve): number =>\n getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma) -\n getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma),\n TotalNumAugmentations: (a: Resleeve, b: Resleeve): number => a.augmentations.length - b.augmentations.length,\n};\n\nexport function ResleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [sort, setSort] = useState(SortOption.Cost);\n // Randomly create all Resleeves if they dont already exist\n if (player.resleeves.length === 0) {\n player.resleeves = generateResleeves();\n }\n\n function onSortChange(event: SelectChangeEvent<string>): void {\n setSort(event.target.value);\n }\n\n const sortFunction = SortFunctions[sort];\n if (sortFunction === undefined) throw new Error(`sort function '${sort}' is undefined`);\n player.resleeves.sort(sortFunction);\n\n return (\n <>\n <Typography>\n Re-sleeving is the process of digitizing and transferring your consciousness into a new human body, or 'sleeve'.\n Here at VitaLife, you can purchase new specially-engineered bodies for the re-sleeve process. Many of these\n bodies even come with genetic and cybernetic Augmentations!\n <br />\n <br />\n Re-sleeving will change your experience for every stat. It will also REMOVE all of your currently-installed\n Augmentations, and replace them with the ones provided by the purchased sleeve. However, Augmentations that you\n have purchased but not installed will NOT be removed. If you have purchased an Augmentation and then re-sleeve\n into a body which already has that Augmentation, it will be removed (since you cannot have duplicate\n Augmentations).\n <br />\n <br />\n NOTE: The stats and multipliers displayed on this page do NOT include your bonuses from Source-File.\n </Typography>\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>Sort By: </Typography>\n <Select value={sort} onChange={onSortChange}>\n {Object.keys(SortOption).map((opt) => (\n <MenuItem key={opt} value={opt}>\n {SortOption[opt]}\n </MenuItem>\n ))}\n </Select>\n </Box>\n {player.resleeves.map((resleeve, i) => (\n <ResleeveElem key={i} player={player} resleeve={resleeve} />\n ))}\n </>\n );\n}\n","/**\n * Implements the Resleeve class, which defines a new body\n * that the player can \"re-sleeve\" into.\n */\nimport { Person } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\n\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\n\nexport class Resleeve extends Person {\n constructor() {\n super();\n }\n\n getCost(): number {\n // Each experience point adds this to the cost\n const CostPerExp = 25e3;\n\n // Final cost is multiplied by this constant ^ # Augs\n const NumAugsExponent = 1.2;\n\n // Get total exp in this re-sleeve\n const totalExp: number =\n this.hacking_exp +\n this.strength_exp +\n this.defense_exp +\n this.dexterity_exp +\n this.agility_exp +\n this.charisma_exp;\n\n // Get total base Augmentation cost for this re-sleeve\n let totalAugmentationCost = 0;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug: Augmentation | null = Augmentations[this.augmentations[i].name];\n if (aug == null) {\n console.error(`Could not find Augmentation ${this.augmentations[i].name}`);\n continue;\n }\n totalAugmentationCost += aug.startingCost;\n }\n\n return totalExp * CostPerExp + totalAugmentationCost * Math.pow(NumAugsExponent, this.augmentations.length);\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"Resleeve\", this);\n }\n\n /**\n * Initiatizes a Resleeve object from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): Resleeve {\n return Generic_fromJSON(Resleeve, value.data);\n }\n}\n\nReviver.constructors.Resleeve = Resleeve;\n","import React, { useState } from \"react\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { Resleeve } from \"../Resleeve\";\nimport { Augmentations } from \"../../../Augmentation/Augmentations\";\nimport { purchaseResleeve } from \"../Resleeving\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n resleeve: Resleeve;\n player: IPlayer;\n}\n\nexport function ResleeveElem(props: IProps): React.ReactElement {\n const [aug, setAug] = useState(props.resleeve.augmentations[0].name);\n\n function openStats(): void {\n dialogBoxCreate(\n <>\n <Typography variant=\"h5\" color=\"primary\">\n Total Multipliers:\n </Typography>\n <Typography>\n Hacking Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_mult)}\n <br />\n Hacking Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_exp_mult)}\n <br />\n Strength Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.strength_mult)}\n <br />\n Strength Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.strength_exp_mult)}\n <br />\n Defense Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.defense_mult)}\n <br />\n Defense Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.defense_exp_mult)}\n <br />\n Dexterity Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.dexterity_mult)}\n <br />\n Dexterity Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.dexterity_exp_mult)}\n <br />\n Agility Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.agility_mult)}\n <br />\n Agility Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.agility_exp_mult)}\n <br />\n Charisma Level multiplier: {numeralWrapper.formatPercentage(props.resleeve.charisma_mult)}\n <br />\n Charisma Experience multiplier: {numeralWrapper.formatPercentage(props.resleeve.charisma_exp_mult)}\n <br />\n Hacking Chance multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_chance_mult)}\n <br />\n Hacking Speed multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_speed_mult)}\n <br />\n Hacking Money multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_money_mult)}\n <br />\n Hacking Growth multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacking_grow_mult)}\n <br />\n Salary multiplier: {numeralWrapper.formatPercentage(props.resleeve.work_money_mult)}\n <br />\n Company Reputation Gain multiplier: {numeralWrapper.formatPercentage(props.resleeve.company_rep_mult)}\n <br />\n Faction Reputation Gain multiplier: {numeralWrapper.formatPercentage(props.resleeve.faction_rep_mult)}\n <br />\n Crime Money multiplier: {numeralWrapper.formatPercentage(props.resleeve.crime_money_mult)}\n <br />\n Crime Success multiplier: {numeralWrapper.formatPercentage(props.resleeve.crime_success_mult)}\n <br />\n Hacknet Income multiplier: {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_money_mult)}\n <br />\n Hacknet Purchase Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_purchase_cost_mult)}\n <br />\n Hacknet Level Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_level_cost_mult)}\n <br />\n Hacknet Ram Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_ram_cost_mult)}\n <br />\n Hacknet Core Upgrade Cost multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.hacknet_node_core_cost_mult)}\n <br />\n Bladeburner Max Stamina multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_max_stamina_mult)}\n <br />\n Bladeburner Stamina Gain multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_stamina_gain_mult)}\n <br />\n Bladeburner Field Analysis multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_analysis_mult)}\n <br />\n Bladeburner Success Chance multiplier:\n {numeralWrapper.formatPercentage(props.resleeve.bladeburner_success_chance_mult)}\n </Typography>\n </>,\n );\n }\n\n function onAugChange(event: SelectChangeEvent<string>): void {\n setAug(event.target.value);\n }\n\n const currentAug = Augmentations[aug];\n const cost = props.resleeve.getCost();\n\n function purchase(): void {\n if (!purchaseResleeve(props.resleeve, props.player)) return;\n dialogBoxCreate(\n <>\n You re-sleeved for <Money money={cost} />!\n </>,\n );\n }\n\n return (\n <Paper sx={{ my: 1 }}>\n <Grid container>\n <Grid item xs={3}>\n <Typography>\n Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking_skill)} (\n {numeralWrapper.formatExp(props.resleeve.hacking_exp)} exp)\n <br />\n Strength: {numeralWrapper.formatSkill(props.resleeve.strength)} (\n {numeralWrapper.formatExp(props.resleeve.strength_exp)} exp)\n <br />\n Defense: {numeralWrapper.formatSkill(props.resleeve.defense)} (\n {numeralWrapper.formatExp(props.resleeve.defense_exp)} exp)\n <br />\n Dexterity: {numeralWrapper.formatSkill(props.resleeve.dexterity)} (\n {numeralWrapper.formatExp(props.resleeve.dexterity_exp)} exp)\n <br />\n Agility: {numeralWrapper.formatSkill(props.resleeve.agility)} (\n {numeralWrapper.formatExp(props.resleeve.agility_exp)} exp)\n <br />\n Charisma: {numeralWrapper.formatSkill(props.resleeve.charisma)} (\n {numeralWrapper.formatExp(props.resleeve.charisma_exp)} exp)\n <br /># Augmentations: {props.resleeve.augmentations.length}\n </Typography>\n <Button onClick={openStats}>Multipliers</Button>\n </Grid>\n <Grid item xs={6}>\n <Select value={aug} onChange={onAugChange}>\n {props.resleeve.augmentations.map((aug) => (\n <MenuItem key={aug.name} value={aug.name}>\n {aug.name}\n </MenuItem>\n ))}\n </Select>\n <Typography>{currentAug !== undefined && currentAug.info}</Typography>\n </Grid>\n <Grid item xs={3}>\n <Typography>\n It costs <Money money={cost} player={props.player} /> to purchase this Sleeve.\n </Typography>\n <Button onClick={purchase}>Purchase</Button>\n </Grid>\n </Grid>\n </Paper>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { use } from \"./Context\";\nimport { CONSTANTS } from \"../Constants\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { Money } from \"./React/Money\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Company } from \"../Company/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { Locations } from \"../Locations/Locations\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\n\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\nexport function WorkInProgressRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, CONSTANTS.MilliPerCycle);\n return () => clearInterval(id);\n }, []);\n const player = use.Player();\n const router = use.Router();\n const faction = Factions[player.currentWorkFactionName];\n if (player.workType == CONSTANTS.WorkTypeFaction) {\n function cancel(): void {\n router.toFaction(faction);\n player.finishFactionWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently {player.currentWorkFactionDescription} for your faction {faction.name}\n <br />\n (Current Faction Reputation: <Reputation reputation={faction.playerReputation} />\n ). <br />\n You have been doing this for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />) reputation for this faction <br />\n <br />\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br />\n <br />\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec) defense exp <br />\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec) dexterity exp <br />\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec) agility exp <br />\n <br />\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec) charisma exp <br />\n <br />\n You will automatically finish after working for 20 hours. You can cancel earlier if you wish.\n <br />\n There is no penalty for cancelling earlier.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Faction Work\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n const className = player.className;\n if (player.className !== \"\") {\n function cancel(): void {\n player.finishClass(true);\n router.toCity();\n }\n\n let stopText = \"\";\n if (\n className == CONSTANTS.ClassGymStrength ||\n className == CONSTANTS.ClassGymDefense ||\n className == CONSTANTS.ClassGymDexterity ||\n className == CONSTANTS.ClassGymAgility\n ) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You have been {className} for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n This has cost you: <br />\n <Money money={-player.workMoneyGained} /> (<MoneyRate money={player.workMoneyLossRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n You have gained: <br />\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec) hacking exp <br />\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec) strength exp <br />\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec) defense exp <br />\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec) dexterity exp <br />\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec) agility exp <br />\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec) charisma exp <br />\n You may cancel at any time\n </Typography>\n </Grid>\n <Grid item>\n <Button onClick={cancel}>{stopText}</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.workType == CONSTANTS.WorkTypeCompany) {\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n function cancel(): void {\n player.finishWork(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n\n const position = player.jobs[player.companyName];\n\n const penalty = player.cancelationPenalty();\n\n const penaltyString = penalty === 0.5 ? \"half\" : \"three-quarters\";\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working as a {position} at {player.companyName} (Current Company Reputation:{\" \"}\n <Reputation reputation={companyRep} />)<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />) reputation for this company <br />\n <br />\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {`${numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) hacking exp <br />\n <br />\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {`${numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) strength exp <br />\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {`${numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) defense exp <br />\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {`${numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) dexterity exp <br />\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {`${numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) agility exp <br />\n <br />\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {`${numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) charisma exp <br />\n <br />\n You will automatically finish after working for 8 hours. You can cancel earlier if you wish, but you will\n only gain {penaltyString} of the reputation you've earned so far.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Working\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.workType == CONSTANTS.WorkTypeCompanyPartTime) {\n function cancel(): void {\n player.finishWork(true);\n router.toJob();\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob();\n }\n const comp = Companies[player.companyName];\n let companyRep = 0;\n if (comp == null || !(comp instanceof Company)) {\n throw new Error(`Could not find Company: ${player.companyName}`);\n }\n companyRep = comp.playerReputation;\n\n const position = player.jobs[player.companyName];\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working as a {position} at {player.companyName} (Current Company Reputation:{\" \"}\n <Reputation reputation={companyRep} />)<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n You have earned: <br />\n <br />\n <Money money={player.workMoneyGained} /> (<MoneyRate money={player.workMoneyGainRate * CYCLES_PER_SEC} />){\" \"}\n <br />\n <br />\n <Reputation reputation={player.workRepGained} /> (\n <ReputationRate reputation={player.workRepGainRate * CYCLES_PER_SEC} />\n ) reputation for this company <br />\n <br />\n {numeralWrapper.formatExp(player.workHackExpGained)} (\n {`${numeralWrapper.formatExp(player.workHackExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) hacking exp <br />\n <br />\n {numeralWrapper.formatExp(player.workStrExpGained)} (\n {`${numeralWrapper.formatExp(player.workStrExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) strength exp <br />\n {numeralWrapper.formatExp(player.workDefExpGained)} (\n {`${numeralWrapper.formatExp(player.workDefExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) defense exp <br />\n {numeralWrapper.formatExp(player.workDexExpGained)} (\n {`${numeralWrapper.formatExp(player.workDexExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) dexterity exp <br />\n {numeralWrapper.formatExp(player.workAgiExpGained)} (\n {`${numeralWrapper.formatExp(player.workAgiExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) agility exp <br />\n <br />\n {numeralWrapper.formatExp(player.workChaExpGained)} (\n {`${numeralWrapper.formatExp(player.workChaExpGainRate * CYCLES_PER_SEC)} / sec`}\n ) charisma exp <br />\n <br />\n You will automatically finish after working for 8 hours. You can cancel earlier if you wish, and there will\n be no penalty because this is a part-time job.\n </Typography>\n </Grid>\n <Grid item>\n <Button sx={{ mx: 2 }} onClick={cancel}>\n Stop Working\n </Button>\n <Button onClick={unfocus}>Do something else simultaneously</Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.crimeType !== \"\") {\n const percent = Math.round((player.timeWorked / player.timeNeededToCompleteWork) * 100);\n let numBars = Math.round(percent / 5);\n if (numBars < 0) {\n numBars = 0;\n }\n if (numBars > 20) {\n numBars = 20;\n }\n // const progressBar = \"[\" + Array(numBars + 1).join(\"|\") + Array(20 - numBars + 1).join(\" \") + \"]\";\n const progressBar = createProgressBarText({ progress: (numBars + 1) / 20, totalTicks: 20 });\n\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n <Typography>You are attempting to {player.crimeType}.</Typography>\n <br />\n\n <Typography>\n Time remaining: {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorked)}\n </Typography>\n\n <br />\n <pre>{progressBar}</pre>\n </Typography>\n </Grid>\n <Grid item>\n <Button\n onClick={() => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishCrime(true);\n }}\n >\n Cancel crime\n </Button>\n </Grid>\n </Grid>\n );\n }\n\n if (player.createProgramName !== \"\") {\n return (\n <Grid container direction=\"column\" justifyContent=\"center\" alignItems=\"center\" style={{ minHeight: \"100vh\" }}>\n <Grid item>\n <Typography>\n You are currently working on coding {player.createProgramName}.<br />\n <br />\n You have been working for {convertTimeMsToTimeElapsedString(player.timeWorked)}\n <br />\n <br />\n The program is {((player.timeWorkedCreateProgram / player.timeNeededToCompleteWork) * 100).toFixed(2)}\n % complete. <br />\n If you cancel, your work will be saved and you can come back to complete the program later.\n </Typography>\n </Grid>\n <Grid item>\n <Button\n onClick={() => {\n player.finishCreateProgramWork(true);\n router.toTerminal();\n }}\n >\n Cancel work on creating program\n </Button>\n </Grid>\n </Grid>\n );\n }\n\n return <></>;\n}\n","import React, { useState, useRef } from \"react\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Slider from \"@mui/material/Slider\";\nimport Grid from \"@mui/material/Grid\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Link from \"@mui/material/Link\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport DownloadIcon from \"@mui/icons-material/Download\";\nimport UploadIcon from \"@mui/icons-material/Upload\";\n\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { dialogBoxCreate } from \"./DialogBox\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { save, deleteGame } from \"../../db\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: 50,\n padding: theme.spacing(2),\n userSelect: \"none\",\n },\n }),\n);\n\ninterface IProps {\n player: IPlayer;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\nexport function GameOptionsRoot(props: IProps): React.ReactElement {\n const classes = useStyles();\n const importInput = useRef<HTMLInputElement>(null);\n\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);\n const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);\n const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);\n\n const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);\n\n const [suppressMessages, setSuppressMessages] = useState(Settings.SuppressMessages);\n const [suppressFactionInvites, setSuppressFactionInvites] = useState(Settings.SuppressFactionInvites);\n const [suppressTravelConfirmations, setSuppressTravelConfirmations] = useState(Settings.SuppressTravelConfirmation);\n const [suppressBuyAugmentationConfirmation, setSuppressBuyAugmentationConfirmation] = useState(\n Settings.SuppressBuyAugmentationConfirmation,\n );\n const [suppressHospitalizationPopup, setSuppressHospitalizationPopup] = useState(\n Settings.SuppressHospitalizationPopup,\n );\n\n const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup);\n\n const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys);\n const [disableASCIIArt, setDisableASCIIArt] = useState(Settings.DisableASCIIArt);\n const [disableTextEffects, setDisableTextEffects] = useState(Settings.DisableTextEffects);\n const [enableBashHotkeys, setEnableBashHotkeys] = useState(Settings.EnableBashHotkeys);\n const [enableTimestamps, setEnableTimestamps] = useState(Settings.EnableTimestamps);\n const [saveGameOnFileSave, setSaveGameOnFileSave] = useState(Settings.SaveGameOnFileSave);\n\n const [locale, setLocale] = useState(Settings.Locale);\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [deleteGameOpen, setDeleteOpen] = useState(false);\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n\n function handleExecTimeChange(event: any, newValue: number | number[]): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleLogSizeChange(event: any, newValue: number | number[]): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handlePortSizeChange(event: any, newValue: number | number[]): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(event: any, newValue: number | number[]): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n\n function handleSuppressMessagesChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressMessages(event.target.checked);\n Settings.SuppressMessages = event.target.checked;\n }\n\n function handleSuppressFactionInvitesChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressFactionInvites(event.target.checked);\n Settings.SuppressFactionInvites = event.target.checked;\n }\n\n function handleSuppressTravelConfirmationsChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressTravelConfirmations(event.target.checked);\n Settings.SuppressTravelConfirmation = event.target.checked;\n }\n\n function handleSuppressBuyAugmentationConfirmationChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressBuyAugmentationConfirmation(event.target.checked);\n Settings.SuppressBuyAugmentationConfirmation = event.target.checked;\n }\n\n function handleSuppressHospitalizationPopupChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressHospitalizationPopup(event.target.checked);\n Settings.SuppressHospitalizationPopup = event.target.checked;\n }\n\n function handleSuppressBladeburnerPopupChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setSuppressBladeburnerPopup(event.target.checked);\n Settings.SuppressBladeburnerPopup = event.target.checked;\n }\n\n function handleDisableHotkeysChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setDisableHotkeys(event.target.checked);\n Settings.DisableHotkeys = event.target.checked;\n }\n\n function handleDisableASCIIArtChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setDisableASCIIArt(event.target.checked);\n Settings.DisableASCIIArt = event.target.checked;\n }\n\n function handleDisableTextEffectsChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setDisableTextEffects(event.target.checked);\n Settings.DisableTextEffects = event.target.checked;\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 handleEnableBashHotkeysChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setEnableBashHotkeys(event.target.checked);\n Settings.EnableBashHotkeys = event.target.checked;\n }\n function handleEnableTimestampsChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setEnableTimestamps(event.target.checked);\n Settings.EnableTimestamps = event.target.checked;\n }\n function handleSaveGameOnFile(event: React.ChangeEvent<HTMLInputElement>): void {\n setSaveGameOnFileSave(event.target.checked);\n Settings.SaveGameOnFileSave = event.target.checked;\n }\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n function onImport(event: React.ChangeEvent<HTMLInputElement>): void {\n const files = event.target.files;\n if (files === null) return;\n const file = files[0];\n if (!file) {\n dialogBoxCreate(\"Invalid file selected\");\n return;\n }\n\n const reader = new FileReader();\n reader.onload = function (this: FileReader, e: ProgressEvent<FileReader>) {\n const target = e.target;\n if (target === null) {\n console.error(\"error importing file\");\n return;\n }\n const result = target.result;\n if (typeof result !== \"string\" || result === null) {\n console.error(\"FileReader event was not type string\");\n return;\n }\n const contents = result;\n save(contents).then(() => setTimeout(() => location.reload(), 1000));\n };\n reader.readAsText(file);\n }\n\n return (\n <div className={classes.root} style={{ width: \"90%\" }}>\n <Typography variant=\"h4\" gutterBottom>\n Options\n </Typography>\n\n <Grid container spacing={3}>\n <Grid item xs={12} sm={6}>\n <List>\n <ListItem>\n <Tooltip\n title={\n <Typography>\n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too\n low can result in poor performance if you have many scripts running.\n </Typography>\n }\n >\n <Typography>Netscript exec time (ms)</Typography>\n </Tooltip>\n <Slider\n value={execTime}\n onChange={handleExecTimeChange}\n step={1}\n min={10}\n max={100}\n valueLabelDisplay=\"auto\"\n />\n </ListItem>\n <ListItem>\n <Tooltip\n title={\n <Typography>\n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to\n use a lot of memory if you have many scripts running.\n </Typography>\n }\n >\n <Typography>Netscript log size</Typography>\n </Tooltip>\n <Slider\n value={logSize}\n onChange={handleLogSizeChange}\n step={1}\n min={20}\n max={100}\n valueLabelDisplay=\"auto\"\n />\n </ListItem>\n <ListItem>\n <Tooltip\n title={\n <Typography>\n The maximum number of entries that can be written to a port using Netscript's write() function.\n Setting this too high can cause the game to use a lot of memory.\n </Typography>\n }\n >\n <Typography>Netscript port size</Typography>\n </Tooltip>\n <Slider\n value={portSize}\n onChange={handlePortSizeChange}\n step={1}\n min={20}\n max={100}\n valueLabelDisplay=\"auto\"\n />\n </ListItem>\n <ListItem>\n <Tooltip\n title={\n <Typography>\n The maximum number of entries that can be written to a the terminal. Setting this too high can cause\n the game to use a lot of memory.\n </Typography>\n }\n >\n <Typography>Terminal capacity</Typography>\n </Tooltip>\n <Slider\n value={terminalSize}\n onChange={handleTerminalSizeChange}\n step={50}\n min={50}\n max={500}\n valueLabelDisplay=\"auto\"\n marks\n />\n </ListItem>\n <ListItem>\n <Tooltip\n title={\n <Typography>The time (in seconds) between each autosave. Set to 0 to disable autosave.</Typography>\n }\n >\n <Typography>Autosave interval (s)</Typography>\n </Tooltip>\n <Slider\n value={autosaveInterval}\n onChange={handleAutosaveIntervalChange}\n step={30}\n min={0}\n max={600}\n valueLabelDisplay=\"auto\"\n marks\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={<Switch checked={suppressMessages} onChange={handleSuppressMessagesChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, then any messages you receive will not appear as popups on the screen. They will\n still get sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal\n command.\n </Typography>\n }\n >\n <Typography>Suppress messages</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={<Switch checked={suppressFactionInvites} onChange={handleSuppressFactionInvitesChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, then any faction invites you receive will not appear as popups on the screen.\n Your outstanding faction invites can be viewed in the 'Factions' page.\n </Typography>\n }\n >\n <Typography>Suppress faction invites</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={\n <Switch checked={suppressTravelConfirmations} onChange={handleSuppressTravelConfirmationsChange} />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, the confirmation message before traveling will not show up. You will\n automatically be deducted the travel cost as soon as you click.\n </Typography>\n }\n >\n <Typography>Suppress travel confirmations</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={\n <Switch\n checked={suppressBuyAugmentationConfirmation}\n onChange={handleSuppressBuyAugmentationConfirmationChange}\n />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, the confirmation message before buying augmentation will not show up.\n </Typography>\n }\n >\n <Typography>Suppress buy augmentation confirmation</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={\n <Switch checked={suppressHospitalizationPopup} onChange={handleSuppressHospitalizationPopupChange} />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, a popup message will no longer be shown when you are hospitalized after taking\n too much damage.\n </Typography>\n }\n >\n <Typography>Suppress hospitalization popup</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n {!!props.player.bladeburner && (\n <ListItem>\n <FormControlLabel\n control={\n <Switch checked={suppressBladeburnerPopup} onChange={handleSuppressBladeburnerPopupChange} />\n }\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, then having your Bladeburner actions interrupted by being busy with something\n else will not display a popup message.\n </Typography>\n }\n >\n <Typography>Suppress bladeburner popup</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n )}\n <ListItem>\n <FormControlLabel\n control={<Switch checked={disableHotkeys} onChange={handleDisableHotkeysChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes\n Terminal commands, hotkeys to navigate between different parts of the game, and the \"Save and\n Close (Ctrl + b)\" hotkey in the Text Editor.\n </Typography>\n }\n >\n <Typography>Disable hotkeys</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={<Switch checked={disableASCIIArt} onChange={handleDisableASCIIArtChange} />}\n label={\n <Tooltip title={<Typography>If this is set all ASCII art will be disabled.</Typography>}>\n <Typography>Disable ascii art</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={<Switch checked={disableTextEffects} onChange={handleDisableTextEffectsChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n If this is set, text effects will not be displayed. This can help if text is difficult to read\n in certain areas.\n </Typography>\n }\n >\n <Typography>Disable text effects</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n\n <ListItem>\n <FormControlLabel\n control={<Switch checked={enableBashHotkeys} onChange={handleEnableBashHotkeysChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and\n features that more closely resemble a real Bash-style shell. Note that when this mode is\n enabled, the default browser shortcuts are overriden by the new Bash shortcuts.\n </Typography>\n }\n >\n <Typography>Enable bash hotkeys</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n <ListItem>\n <FormControlLabel\n control={<Switch checked={enableTimestamps} onChange={handleEnableTimestampsChange} />}\n label={\n <Tooltip\n title={\n <Typography>\n Terminal commands and log entries will be timestamped. The timestamp will have the format: M/D\n h:m\n </Typography>\n }\n >\n <Typography>Enable timestamps</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n\n <ListItem>\n <FormControlLabel\n control={<Switch checked={saveGameOnFileSave} onChange={handleSaveGameOnFile} />}\n label={\n <Tooltip\n title={<Typography>Save your game any time a file is saved in the script editor.</Typography>}\n >\n <Typography>Save game on file save</Typography>\n </Tooltip>\n }\n />\n </ListItem>\n\n <ListItem>\n <Tooltip title={<Typography>Sets the locale for displaying numbers.</Typography>}>\n <Typography>Locale </Typography>\n </Tooltip>\n <Select value={locale} onChange={handleLocaleChange}>\n <MenuItem value=\"en\">en</MenuItem>\n <MenuItem value=\"bg\">bg</MenuItem>\n <MenuItem value=\"cs\">cs</MenuItem>\n <MenuItem value=\"da-dk\">da-dk</MenuItem>\n <MenuItem value=\"de\">de</MenuItem>\n <MenuItem value=\"en-au\">en-au</MenuItem>\n <MenuItem value=\"en-gb\">en-gb</MenuItem>\n <MenuItem value=\"es\">es</MenuItem>\n <MenuItem value=\"fr\">fr</MenuItem>\n <MenuItem value=\"hu\">hu</MenuItem>\n <MenuItem value=\"it\">it</MenuItem>\n <MenuItem value=\"lv\">lv</MenuItem>\n <MenuItem value=\"no\">no</MenuItem>\n <MenuItem value=\"pl\">pl</MenuItem>\n <MenuItem value=\"ru\">ru</MenuItem>\n </Select>\n </ListItem>\n </List>\n <br />\n <br />\n <form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\" target=\"_blank\">\n <input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\" />\n <input\n type=\"hidden\"\n name=\"encrypted\"\n value=\"-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA2Y2VGE75oWct89z//G2YEJKmzx0uDTXNrpje9ThxmUnBLFZCY+I11Pors7lGRvFqo5okwnu41CfYMPHDxpAgyYyQndMX9pWUX0gLfBMm2BaHwsNBCwt34WmpQqj7TGsQ+aw9NbmkxiJltGnOa+6/gy10mPZAA3HxiieLeCKkGgDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQI72F1YSzHUd2AgaDMekHU3AKT93Ey9wkB3486bV+ngFSD6VOHrPweH9QATs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WwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/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 name=\"submit\"\n alt=\"PayPal - The safer, easier way to pay online!\"\n />\n </form>\n </Grid>\n <Grid item xs={12} sm={6}>\n <Box>\n <Button onClick={() => props.save()}>Save Game</Button>\n <Button onClick={() => setDeleteOpen(true)}>Delete Game</Button>\n </Box>\n <Box>\n <Tooltip title={<Typography>export</Typography>}>\n <Button onClick={() => props.export()}>\n <DownloadIcon color=\"primary\" />\n Export\n </Button>\n </Tooltip>\n <Tooltip title={<Typography>import</Typography>}>\n <Button onClick={startImport}>\n <UploadIcon color=\"primary\" />\n Import\n <input ref={importInput} id=\"import-game-file-selector\" type=\"file\" hidden onChange={onImport} />\n </Button>\n </Tooltip>\n </Box>\n <Box>\n <Tooltip\n title={\n <Typography>\n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the\n game. After using this, save the game and then reload the page. This is different then normal kill in\n that normal kill will tell the script to shut down while force kill just removes the references to it\n (and it should crash on it's own). This will not remove the files on your computer. Just forcefully\n kill all running instance of all scripts.\n </Typography>\n }\n >\n <Button onClick={() => props.forceKill()}>Force kill all active scripts</Button>\n </Tooltip>\n </Box>\n <Box>\n <Tooltip\n title={\n <Typography>\n Perform a soft reset. Resets everything as if you had just purchased an Augmentation.\n </Typography>\n }\n >\n <Button onClick={() => props.softReset()}>Soft Reset</Button>\n </Tooltip>\n </Box>\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\n server. Be careful there might be spoilers.\n </Typography>\n }\n >\n <Button onClick={() => setDiagnosticOpen(true)}>Diagnose files</Button>\n </Tooltip>\n <Button onClick={() => setThemeEditorOpen(true)}>Theme editor</Button>\n </Box>\n <Box>\n <Link href=\"https://github.com/danielyxie/bitburner/issues/new\" target=\"_blank\">\n <Typography>Report bug</Typography>\n </Link>\n <Link href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\" target=\"_blank\">\n <Typography>Changelog</Typography>\n </Link>\n <Link href=\"https://bitburner.readthedocs.io/en/latest/index.html\" target=\"_blank\">\n <Typography>Documentation</Typography>\n </Link>\n <Link href=\"https://discord.gg/TFc3hKD\" target=\"_blank\">\n <Typography>Discord</Typography>\n </Link>\n <Link href=\"https://www.reddit.com/r/bitburner\" target=\"_blank\">\n <Typography>Reddit</Typography>\n </Link>\n </Box>\n </Grid>\n </Grid>\n <FileDiagnosticModal open={diagnosticOpen} onClose={() => setDiagnosticOpen(false)} />\n <ConfirmationModal\n onConfirm={() => {\n setDeleteOpen(false);\n deleteGame()\n .then(() => setTimeout(() => location.reload(), 1000))\n .catch((r) => console.error(`Could not delete game: ${r}`));\n }}\n open={deleteGameOpen}\n onClose={() => setDeleteOpen(false)}\n confirmationText={\"Really delete your game? (It's permanent!)\"}\n />\n <ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} />\n </div>\n );\n}\n","import React from \"react\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { Modal } from \"../ui/React/Modal\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\ninterface IServerProps {\n hostname: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = GetServer(props.hostname);\n if (server === null) throw new Error(\"server 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 in GetAllServers()) {\n keys.push(key);\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 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;\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 </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"./Modal\";\nimport Button from \"@mui/material/Button\";\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 { Color, ColorPicker } from \"material-ui-color\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings, defaultSettings } from \"../../Settings/Settings\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\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 value={color}\n onChange={(newColor: Color) => onColorChange(name, \"#\" + newColor.hex)}\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 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 return (\n <Modal open={props.open} onClose={props.onClose}>\n <Paper>\n <Tooltip open={true} placement={\"top\"} title={<Typography>Example tooltip</Typography>}>\n <Button color=\"primary\">primary button</Button>\n </Tooltip>\n <Button color=\"secondary\">secondary button</Button>\n <Button color=\"warning\">warning button</Button>\n <Button color=\"info\">info button</Button>\n <Button color=\"error\">error button</Button>\n <Button disabled>disabled button</Button>\n <Typography color=\"primary\">text with primary color</Typography>\n <Typography color=\"secondary\">text with secondary color</Typography>\n <Typography color=\"error\">text with error color</Typography>\n <TextField value={\"Text field\"} />\n </Paper>\n <br />\n <Typography>Warning: Editing the theme is very slow.</Typography>\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=\"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\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 <br />\n <br />\n <TextField label={\"import / export theme\"} value={JSON.stringify(customTheme)} onChange={onThemeChange} />\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\nimport { use } from \"../../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Link from \"@mui/material/Link\";\n\nexport function SleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [FAQOpen, setFAQOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Typography variant=\"h4\">Sleeves</Typography>\n <Typography>\n Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In\n other words, these Synthoids contain a perfect duplicate of your mind.\n <br />\n <br />\n Sleeves can be used to perform different tasks synchronously.\n <br />\n <br />\n </Typography>\n\n <Button onClick={() => setFAQOpen(true)}>FAQ</Button>\n <Link\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves\"\n >\n <Typography> Documentation</Typography>\n </Link>\n {player.sleeves.map((sleeve, i) => (\n <SleeveElem key={i} rerender={rerender} sleeve={sleeve} />\n ))}\n <FAQModal open={FAQOpen} onClose={() => setFAQOpen(false)} />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\n\nimport { CONSTANTS } from \"../../../Constants\";\n\nimport { Crimes } from \"../../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\n\nimport { createProgressBarText } from \"../../../utils/helpers/createProgressBarText\";\n\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { TravelModal } from \"./TravelModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { use } from \"../../../ui/Context\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { StatsElement } from \"../ui/StatsElement\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { MoreEarningsModal } from \"../ui/MoreEarningsModal\";\nimport { TaskSelector } from \"../ui/TaskSelector\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const player = use.Player();\n const [statsOpen, setStatsOpen] = useState(false);\n const [earningsOpen, setEarningsOpen] = useState(false);\n const [travelOpen, setTravelOpen] = useState(false);\n const [augmentationsOpen, setAugmentationsOpen] = useState(false);\n\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function setTask(): void {\n props.sleeve.resetTaskStatus(); // sets to idle\n switch (abc[0]) {\n case \"------\":\n break;\n case \"Work for Company\":\n props.sleeve.workForCompany(player, abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(player, abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(player, abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(player, abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(player, abc[2], abc[1]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery(player);\n break;\n case \"Synchronize\":\n props.sleeve.synchronize(player);\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${abc[0]}`);\n }\n props.rerender();\n }\n\n let desc = <></>;\n switch (props.sleeve.currentTask) {\n case SleeveTaskType.Idle:\n desc = <>This sleeve is currently idle</>;\n break;\n case SleeveTaskType.Company:\n desc = <>This sleeve is currently working your job at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Faction: {\n let doing = \"nothing\";\n switch (props.sleeve.factionWorkType) {\n case FactionWorkType.Field:\n doing = \"Field work\";\n break;\n case FactionWorkType.Hacking:\n doing = \"Hacking contracts\";\n break;\n case FactionWorkType.Security:\n doing = \"Security work\";\n break;\n }\n desc = (\n <>\n This sleeve is currently doing {doing} for {props.sleeve.currentTaskLocation}.\n </>\n );\n break;\n }\n case SleeveTaskType.Crime:\n desc = (\n <>\n This sleeve is currently attempting to {Crimes[props.sleeve.crimeType].type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(Crimes[props.sleeve.crimeType].successRate(props.sleeve))}).\n </>\n );\n break;\n case SleeveTaskType.Class:\n desc = <>This sleeve is currently studying/taking a course at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Gym:\n desc = <>This sleeve is currently working out at {props.sleeve.currentTaskLocation}.</>;\n break;\n case SleeveTaskType.Recovery:\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a\n faster rate.\n </>\n );\n break;\n case SleeveTaskType.Synchro:\n desc = (\n <>\n This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's\n synchronization to increase.\n </>\n );\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in updateSleeveTaskDescription(): ${abc[0]}`);\n }\n\n let data: any[][] = [];\n if (props.sleeve.currentTask === SleeveTaskType.Crime) {\n data = [\n [`Money`, <Money money={parseFloat(props.sleeve.currentTaskLocation)} />, `(on success)`],\n [`Hacking Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.hack), `(2x on success)`],\n [`Strength Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.str), `(2x on success)`],\n [`Defense Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.def), `(2x on success)`],\n [`Dexterity Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.dex), `(2x on success)`],\n [`Agility Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.agi), `(2x on success)`],\n [`Charisma Exp`, numeralWrapper.formatExp(props.sleeve.gainRatesForTask.cha), `(2x on success)`],\n ];\n } else {\n data = [\n [`Money:`, <MoneyRate money={5 * props.sleeve.gainRatesForTask.money} />],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.hack)} / s`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / s`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / s`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / s`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / s`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / s`],\n ];\n if (props.sleeve.currentTask === SleeveTaskType.Company || props.sleeve.currentTask === SleeveTaskType.Faction) {\n const repGain: number = props.sleeve.getRepGain(player);\n data.push([`Reputation:`, <ReputationRate reputation={5 * repGain} />]);\n }\n }\n\n return (\n <>\n <Grid container component={Paper}>\n <Grid item xs={3}>\n <StatsElement sleeve={props.sleeve} />\n <Button onClick={() => setStatsOpen(true)}>More Stats</Button>\n <Tooltip title={player.money.lt(CONSTANTS.TravelCost) ? <Typography>Insufficient funds</Typography> : \"\"}>\n <span>\n <Button onClick={() => setTravelOpen(true)} disabled={player.money.lt(CONSTANTS.TravelCost)}>\n Travel\n </Button>\n </span>\n </Tooltip>\n <Tooltip\n title={props.sleeve.shock < 100 ? <Typography>Unlocked when sleeve has fully recovered</Typography> : \"\"}\n >\n <span>\n <Button onClick={() => setAugmentationsOpen(true)} disabled={props.sleeve.shock < 100}>\n Manage Augmentations\n </Button>\n </span>\n </Tooltip>\n </Grid>\n <Grid item xs={5}>\n <TaskSelector player={player} sleeve={props.sleeve} setABC={setABC} />\n <Typography>{desc}</Typography>\n <Typography>\n {props.sleeve.currentTask === SleeveTaskType.Crime &&\n createProgressBarText({\n progress: props.sleeve.currentTaskTime / props.sleeve.currentTaskMaxTime,\n totalTicks: 25,\n })}\n </Typography>\n <Button onClick={setTask}>Set Task</Button>\n </Grid>\n <Grid item xs={4}>\n <StatsTable title=\"Earnings (Pre-Synchronization)\" rows={data} />\n <Button onClick={() => setEarningsOpen(true)}>More Earnings Info</Button>\n </Grid>\n </Grid>\n <MoreStatsModal open={statsOpen} onClose={() => setStatsOpen(false)} sleeve={props.sleeve} />\n <MoreEarningsModal open={earningsOpen} onClose={() => setEarningsOpen(false)} sleeve={props.sleeve} />\n <TravelModal\n open={travelOpen}\n onClose={() => setTravelOpen(false)}\n sleeve={props.sleeve}\n rerender={props.rerender}\n />\n <SleeveAugmentationsModal\n open={augmentationsOpen}\n onClose={() => setAugmentationsOpen(false)}\n sleeve={props.sleeve}\n />\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { findSleevePurchasableAugs } from \"../SleeveHelpers\";\nimport { Augmentations } from \"../../../Augmentation/Augmentations\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport { TableCell } from \"../../../ui/React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function SleeveAugmentationsModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 150);\n return () => clearInterval(id);\n }, []);\n\n // Array of all owned Augmentations. Names only\n const ownedAugNames = props.sleeve.augmentations.map((e) => e.name);\n\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n const availableAugs = findSleevePurchasableAugs(props.sleeve, player);\n\n function purchaseAugmentation(aug: Augmentation): void {\n props.sleeve.tryBuyAugmentation(player, aug);\n rerender();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they\n would for you. You can only purchase Augmentations that you have unlocked through Factions.\n <br />\n <br />\n When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the\n Duplicate Sleeve will immediately lose all of its stat experience.\n </Typography>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {availableAugs.map((aug) => {\n return (\n <TableRow key={aug.name}>\n <TableCell>\n <Button onClick={() => purchaseAugmentation(aug)} disabled={player.money.lt(aug.startingCost)}>\n Buy\n </Button>\n </TableCell>\n <TableCell>\n <Box display=\"flex\">\n <Tooltip title={aug.stats || \"\"}>\n <Typography>{aug.name}</Typography>\n </Tooltip>\n </Box>\n </TableCell>\n <TableCell>\n <Money money={aug.startingCost} player={player} />\n </TableCell>\n </TableRow>\n );\n })}\n </TableBody>\n </Table>\n\n {ownedAugNames.length > 0 && (\n <>\n <Typography>Owned Augmentations:</Typography>\n {ownedAugNames.map((augName) => {\n const aug = Augmentations[augName];\n let tooltip = <></>;\n if (typeof aug.info === \"string\") {\n tooltip = (\n <>\n <span>{aug.info}</span>\n <br />\n <br />\n {aug.stats}\n </>\n );\n } else {\n tooltip = (\n <>\n {aug.info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n }\n\n return (\n <Tooltip key={augName} title={<Typography>{tooltip}</Typography>}>\n <Paper>\n <Typography>{augName}</Typography>\n </Paper>\n </Tooltip>\n );\n })}\n </>\n )}\n </>\n </Modal>\n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { WorldMap } from \"../../../ui/React/WorldMap\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function travel(city: string): void {\n if (!player.canAfford(CONSTANTS.TravelCost)) {\n dialogBoxCreate(\"You cannot afford to have this sleeve travel to another city\");\n }\n props.sleeve.city = city as CityName;\n player.loseMoney(CONSTANTS.TravelCost);\n props.sleeve.resetTaskStatus();\n props.rerender();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>\n Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can\n study. Traveling to a different city costs <Money money={CONSTANTS.TravelCost} player={player} />. It will\n also set your current sleeve task to idle.\n </Typography>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <Button key={city} onClick={() => travel(city)}>\n {city}\n </Button>\n ))\n ) : (\n <WorldMap currentCity={props.sleeve.city} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n </Modal>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport React from \"react\";\n\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const rows = [\n [\n \"HP: \",\n <>\n {numeralWrapper.formatHp(props.sleeve.hp)} / {numeralWrapper.formatHp(props.sleeve.max_hp)}\n </>,\n ],\n [\"City: \", <>{props.sleeve.city}</>],\n [\"Hacking: \", <>{numeralWrapper.formatSkill(props.sleeve.hacking_skill)}</>],\n [\"Strength: \", <>{numeralWrapper.formatSkill(props.sleeve.strength)}</>],\n [\"Defense: \", <>{numeralWrapper.formatSkill(props.sleeve.defense)}</>],\n [\"Dexterity: \", <>{numeralWrapper.formatSkill(props.sleeve.dexterity)}</>],\n [\"Agility: \", <>{numeralWrapper.formatSkill(props.sleeve.agility)}</>],\n [\"Charisma: \", <>{numeralWrapper.formatSkill(props.sleeve.charisma)}</>],\n [\"Shock: \", <>{numeralWrapper.formatSleeveShock(100 - props.sleeve.shock)}</>],\n [\"Sync: \", <>{numeralWrapper.formatSleeveSynchro(props.sleeve.sync)}</>],\n [\"Memory: \", <>{numeralWrapper.formatSleeveMemory(props.sleeve.memory)}</>],\n ];\n return <StatsTable rows={rows} />;\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { 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_skill,\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 </Modal>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Money } from \"../../../ui/React/Money\";\nimport * as React from \"react\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreEarningsModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <StatsTable\n rows={[\n [\"Money \", <Money money={props.sleeve.earningsForTask.money} />],\n [\"Hacking Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.hack)],\n [\"Strength Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.str)],\n [\"Defense Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.def)],\n [\"Dexterity Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.dex)],\n [\"Agility Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.agi)],\n [\"Charisma Exp \", numeralWrapper.formatExp(props.sleeve.earningsForTask.cha)],\n ]}\n title=\"Earnings for Current Task:\"\n />\n <br />\n <StatsTable\n rows={[\n [\"Money: \", <Money money={props.sleeve.earningsForPlayer.money} />],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForPlayer.cha)],\n ]}\n title=\"Total Earnings for Host Consciousness:\"\n />\n <br />\n <StatsTable\n rows={[\n [\"Money: \", <Money money={props.sleeve.earningsForSleeves.money} />],\n [\"Hacking Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.hack)],\n [\"Strength Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.str)],\n [\"Defense Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.def)],\n [\"Dexterity Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.dex)],\n [\"Agility Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.agi)],\n [\"Charisma Exp: \", numeralWrapper.formatExp(props.sleeve.earningsForSleeves.cha)],\n ]}\n title=\"Total Earnings for Other Sleeves:\"\n />\n <br />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nconst universitySelectorOptions: string[] = [\n \"Study Computer Science\",\n \"Data Structures\",\n \"Networks\",\n \"Algorithms\",\n \"Management\",\n \"Leadership\",\n];\n\nconst gymSelectorOptions: string[] = [\"Train Strength\", \"Train Defense\", \"Train Dexterity\", \"Train Agility\"];\n\ninterface IProps {\n sleeve: Sleeve;\n player: IPlayer;\n setABC: (abc: string[]) => void;\n}\n\ninterface ITaskDetails {\n first: string[];\n second: (s1: string) => string[];\n}\n\nfunction possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all companies that other sleeves are working at\n const forbiddenCompanies = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Company) {\n forbiddenCompanies.push(otherSleeve.currentTaskLocation);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n for (let i = 0; i < allJobs.length; ++i) {\n if (!forbiddenCompanies.includes(allJobs[i])) {\n allJobs[i];\n }\n }\n\n return allJobs;\n}\n\nfunction possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all factions that other sleeves are working for\n const forbiddenFactions = [\"Bladeburners\"];\n if (player.gang) {\n forbiddenFactions.push(player.gang.facName);\n }\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (otherSleeve.currentTask === SleeveTaskType.Faction) {\n forbiddenFactions.push(otherSleeve.currentTaskLocation);\n }\n }\n\n const factions = [];\n for (const fac of player.factions) {\n if (!forbiddenFactions.includes(fac)) {\n factions.push(fac);\n }\n }\n\n return factions;\n}\n\nconst tasks: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => ITaskDetails);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n} = {\n \"------\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let jobs = possibleJobs(player, sleeve);\n\n if (jobs.length === 0) jobs = [\"------\"];\n return { first: jobs, second: () => [\"------\"] };\n },\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let factions = possibleFactions(player, sleeve);\n if (factions.length === 0) factions = [\"------\"];\n\n return {\n first: factions,\n second: (s1: string) => {\n const faction = Factions[s1];\n const facInfo = faction.getInfo();\n const options: string[] = [];\n if (facInfo.offerHackingWork) {\n options.push(\"Hacking Contracts\");\n }\n if (facInfo.offerFieldWork) {\n options.push(\"Field Work\");\n }\n if (facInfo.offerSecurityWork) {\n options.push(\"Security Work\");\n }\n return options;\n },\n };\n },\n \"Commit Crime\": (): ITaskDetails => {\n return { first: Object.keys(Crimes), second: () => [\"------\"] };\n },\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let universities: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n universities = [LocationName.AevumSummitUniversity];\n break;\n case CityName.Sector12:\n universities = [LocationName.Sector12RothmanUniversity];\n break;\n case CityName.Volhaven:\n universities = [LocationName.VolhavenZBInstituteOfTechnology];\n break;\n default:\n universities = [\"No university available in city!\"];\n break;\n }\n\n return { first: universitySelectorOptions, second: () => universities };\n },\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let gyms: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n gyms = [LocationName.AevumCrushFitnessGym, LocationName.AevumSnapFitnessGym];\n break;\n case CityName.Sector12:\n gyms = [LocationName.Sector12IronGym, LocationName.Sector12PowerhouseGym];\n break;\n case CityName.Volhaven:\n gyms = [LocationName.VolhavenMilleniumFitnessGym];\n break;\n default:\n gyms = [\"No gym available in city!\"];\n break;\n }\n\n return { first: gymSelectorOptions, second: () => gyms };\n },\n \"Shock Recovery\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n Synchronize: (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n};\n\nconst canDo: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => boolean);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n} = {\n \"------\": () => true,\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve) => possibleJobs(player, sleeve).length > 0,\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve) => possibleFactions(player, sleeve).length > 0,\n \"Commit Crime\": () => true,\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Shock Recovery\": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,\n Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,\n};\n\nfunction getABC(sleeve: Sleeve): [string, string, string] {\n switch (sleeve.currentTask) {\n case SleeveTaskType.Idle:\n return [\"------\", \"------\", \"------\"];\n case SleeveTaskType.Company:\n return [\"Work for Company\", sleeve.currentTaskLocation, \"------\"];\n case SleeveTaskType.Faction: {\n let workType = \"\";\n switch (sleeve.factionWorkType) {\n case FactionWorkType.Hacking:\n workType = \"Hacking Contracts\";\n break;\n case FactionWorkType.Field:\n workType = \"Field Work\";\n break;\n case FactionWorkType.Security:\n workType = \"Security Work\";\n break;\n }\n return [\"Work for Faction\", sleeve.currentTaskLocation, workType];\n }\n case SleeveTaskType.Crime:\n return [\"Commit Crime\", sleeve.crimeType, \"------\"];\n case SleeveTaskType.Class:\n return [\"Take University Course\", sleeve.className, sleeve.currentTaskLocation];\n case SleeveTaskType.Gym:\n return [\"Workout at Gym\", sleeve.gymStatType, sleeve.currentTaskLocation];\n case SleeveTaskType.Recovery:\n return [\"Shock Recovery\", \"------\", \"------\"];\n case SleeveTaskType.Synchro:\n return [\"Synchronize\", \"------\", \"------\"];\n }\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const abc = getABC(props.sleeve);\n const [s0, setS0] = useState(abc[0]);\n const [s1, setS1] = useState(abc[1]);\n const [s2, setS2] = useState(abc[2]);\n\n const validActions = Object.keys(canDo).filter((k) =>\n (canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),\n );\n\n const detailsF = tasks[s0];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(s1);\n\n if (details.first.length > 0 && !details.first.includes(s1)) {\n setS1(details.first[0]);\n props.setABC([s0, details.first[0], s2]);\n }\n if (details2.length > 0 && !details2.includes(s2)) {\n setS2(details2[0]);\n props.setABC([s0, s1, details2[0]]);\n }\n\n function onS0Change(event: SelectChangeEvent<string>): void {\n const n = event.target.value;\n const detailsF = tasks[n];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(details.first[0]);\n setS2(details2[0]);\n setS1(details.first[0]);\n setS0(n);\n props.setABC([n, details.first[0], details2[0]]);\n }\n\n function onS1Change(event: SelectChangeEvent<string>): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: SelectChangeEvent<string>): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n <Select onChange={onS0Change} value={s0}>\n {validActions.map((task) => (\n <MenuItem key={task} value={task}>\n {task}\n </MenuItem>\n ))}\n </Select>\n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <>\n <br />\n <Select onChange={onS1Change} value={s1}>\n {details.first.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <>\n <br />\n <Select onChange={onS2Change} value={s2}>\n {details2.map((detail) => (\n <MenuItem key={detail} value={detail}>\n {detail}\n </MenuItem>\n ))}\n </Select>\n </>\n )}\n </>\n );\n}\n","import React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FAQModal({ open, onClose }: IProps): React.ReactElement {\n return (\n <Modal open={open} onClose={onClose}>\n <>\n <Typography variant=\"h4\">How do Duplicate Sleeves work?</Typography>\n <br />\n <Typography>\n Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working\n for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience,\n and reputation.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeves are their own individuals, which means they each have their own experience and stats.\n </Typography>\n <br />\n <br />\n <Typography>\n When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well\n as all of the player's other sleeves.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Synchronization (Sync)?</Typography>\n <br />\n <Typography>\n Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a\n numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing\n a task.\n </Typography>\n <br />\n <br />\n <Typography>\n Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve\n and the player's original host consciousness earn N% of the amount of experience normally earned by the task.\n All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.\n </Typography>\n <br />\n <br />\n <Typography>Synchronization can be increased by assigning sleeves to the 'Synchronize' task.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Shock?</Typography>\n <br />\n <Typography>\n Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a\n numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the\n amount of experience earned by the sleeve.\n </Typography>\n <br />\n <br />\n <Typography>\n Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning\n sleeves to the 'Shock Recovery' task.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I work for this company or faction?</Typography>\n <br />\n <Typography>\n Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two\n sleeves they can work for two different companies, but they cannot both work for the same company.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why did my Sleeve stop working?</Typography>\n <br />\n <Typography>\n Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a\n company after 8 hours, and stop working for a faction after 20 hours.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">How do I buy Augmentations for my Sleeves?</Typography>\n <br />\n <Typography>Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Why can't I buy the X Augmentation for my sleeve?</Typography>\n <br />\n <Typography>\n Certain Augmentations, like Bladeburner-specific ones and NeuroFlux Governor, are not available for sleeves.\n </Typography>\n <br />\n <br />\n <Typography variant=\"h4\">Do sleeves get reset when installing Augmentations or switching BitNodes?</Typography>\n <br />\n <Typography>Sleeves are reset when switching BitNodes, but not when installing Augmentations.</Typography>\n <br />\n <br />\n <Typography variant=\"h4\">What is Memory?</Typography>\n <br />\n <Typography>\n Sleeve memory dictates what a sleeve's synchronization will be when its reset by switching BitNodes. For\n example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be\n set to 25, rather than 1.\n </Typography>\n <br />\n <br />\n <Typography>\n Memory can only be increased by purchasing upgrades from The Covenant. It is a persistent stat, meaning it\n never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.\n </Typography>\n </>\n </Modal>\n );\n}\n","/**\n * Root React Component for the Hacknet Node UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { GeneralInfo } from \"./GeneralInfo\";\nimport { HacknetNodeElem } from \"./HacknetNodeElem\";\nimport { HacknetServerElem } from \"./HacknetServerElem\";\nimport { HacknetNode } from \"../HacknetNode\";\nimport { HacknetServer } from \"../HacknetServer\";\nimport { HashUpgradeModal } from \"./HashUpgradeModal\";\nimport { MultiplierButtons } from \"./MultiplierButtons\";\nimport { PlayerInfo } from \"./PlayerInfo\";\nimport { PurchaseButton } from \"./PurchaseButton\";\nimport { PurchaseMultipliers } from \"../data/Constants\";\n\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\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 <Grid container>{nodes}</Grid>\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 { numeralWrapper } from \"../../ui/numeralFormat\";\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 upgradeLevelContent;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelContent = <>MAX LEVEL</>;\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 upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\n upgradeLevelContent = (\n <>\n +{multiplier} - \n <Money money={upgradeLevelCost} player={props.player} />\n </>\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 upgradeRamContent;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRamContent = <>MAX RAM</>;\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 upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\n upgradeRamContent = (\n <>\n +{multiplier} - \n <Money money={upgradeRamCost} player={props.player} />\n </>\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 let upgradeCoresContent;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresContent = <>MAX CORES</>;\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 upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\n upgradeCoresContent = (\n <>\n +{multiplier} - \n <Money money={upgradeCoreCost} player={props.player} />\n </>\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\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>{node.name}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Money money={node.totalMoneyGenerated} player={props.player} /> (\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>\n <Button onClick={upgradeLevelOnClick}>{upgradeLevelContent}</Button>\n </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>\n <Button onClick={upgradeRamOnClick}>{upgradeRamContent}</Button>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>\n <Button onClick={upgradeCoresOnClick}>{upgradeCoresContent}</Button>\n </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\";\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 upgradeLevelContent;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelContent = <>MAX LEVEL</>;\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 upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.hacknet_node_level_cost_mult);\n upgradeLevelContent = (\n <>\n +{multiplier} - \n <Money money={upgradeLevelCost} player={props.player} />\n </>\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 // Upgrade RAM Button\n let upgradeRamContent;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamContent = <>MAX RAM</>;\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 upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.hacknet_node_ram_cost_mult);\n upgradeRamContent = (\n <>\n +{multiplier} - \n <Money money={upgradeRamCost} player={props.player} />\n </>\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\n // Upgrade Cores Button\n let upgradeCoresContent;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresContent = <>MAX CORES</>;\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 upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.hacknet_node_core_cost_mult);\n upgradeCoresContent = (\n <>\n +{multiplier} - \n <Money money={upgradeCoreCost} player={props.player} />\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\n // Upgrade Cache button\n let upgradeCacheContent;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheContent = <>MAX CACHE</>;\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 upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);\n upgradeCacheContent = (\n <>\n +{multiplier} - \n <Money money={upgradeCacheCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeCacheCost)) {\n } else {\n }\n }\n function upgradeCacheOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n }\n purchaseCacheUpgrade(props.player, node, numUpgrades as number);\n rerender();\n updateHashManagerCapacity(props.player);\n }\n\n return (\n <Grid item component={Paper} p={1}>\n <Table size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography>{node.hostname}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Production:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Hashes hashes={node.totalHashesGenerated} /> (<HashRate hashes={node.hashRate} />)\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Hash Capacity:</Typography>\n </TableCell>\n <TableCell colSpan={2}>\n <Typography>\n <Hashes hashes={node.hashCapacity} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Level:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.level}</Typography>\n </TableCell>\n <TableCell>\n <Button onClick={upgradeLevelOnClick}>{upgradeLevelContent}</Button>\n </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>\n <Button onClick={upgradeRamOnClick}>{upgradeRamContent}</Button>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography>Cores:</Typography>\n </TableCell>\n <TableCell>\n <Typography>{node.cores}</Typography>\n </TableCell>\n <TableCell>\n <Button onClick={upgradeCoresOnClick}>{upgradeCoresContent}</Button>\n </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>\n <Button onClick={upgradeCacheOnClick}>{upgradeCacheContent}</Button>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Grid>\n );\n}\n","/**\n * Create the pop-up for purchasing upgrades with hashes\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrades } from \"../HashUpgrades\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function HashUpgradeModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = player.hashManager;\n if (!(hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n <Typography>Spend your hashes on a variety of different upgrades</Typography>\n <Typography>\n Hashes: <Hashes hashes={player.hashManager.hashes} />\n </Typography>\n {Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return (\n <HacknetUpgradeElem\n player={player}\n upg={upg}\n hashManager={hashManager}\n key={upg.name}\n rerender={rerender}\n />\n );\n })}\n </>\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { purchaseHashUpgrade } from \"../HacknetHelpers\";\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrade } from \"../HashUpgrade\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { ServerDropdown, ServerType } from \"../../ui/React/ServerDropdown\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n player: IPlayer;\n hashManager: HashManager;\n upg: HashUpgrade;\n rerender: () => void;\n}\n\nexport function HacknetUpgradeElem(props: IProps): React.ReactElement {\n const [selectedServer, setSelectedServer] = useState(\"ecorp\");\n function changeTargetServer(event: SelectChangeEvent<string>): void {\n setSelectedServer(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.toNumber()} />\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 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 } 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 * 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(router, props.locName);\n } else {\n p.startWork(router, props.locName);\n }\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[0]} /> 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 <Button onClick={work}>Work</Button>\n \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 </>\n )}\n <br />\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 </>\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\";\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 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 train(stat: string): void {\n const loc = props.loc;\n props.p.startClass(props.router, calculateCost(), loc.expMult, stat);\n }\n\n function trainStrength(): void {\n train(CONSTANTS.ClassGymStrength);\n }\n\n function trainDefense(): void {\n train(CONSTANTS.ClassGymDefense);\n }\n\n function trainDexterity(): void {\n train(CONSTANTS.ClassGymDexterity);\n }\n\n function trainAgility(): void {\n train(CONSTANTS.ClassGymAgility);\n }\n\n const cost = CONSTANTS.ClassGymBaseCost * calculateCost();\n\n return (\n <>\n <Button onClick={trainStrength}>\n Train Strength (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <br />\n <Button onClick={trainDefense}>\n Train Defense (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <br />\n <Button onClick={trainDexterity}>\n Train Dexterity (<Money money={cost} player={props.p} /> / sec)\n </Button>\n <br />\n <Button onClick={trainAgility}>\n Train Agility (<Money money={cost} player={props.p} /> / sec)\n </Button>\n </>\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);\n this.props.p.hp = this.props.p.max_hp;\n this.props.p.recordMoneySource(-1 * cost, \"hospitalization\");\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\";\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 <>\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\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 <br />\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location has special\n * actions/options/properties\n *\n * Examples:\n * - Bladeburner @ NSA\n * - Re-sleeving @ VitaLife\n * - Create Corporation @ City Hall\n *\n * This subcomponent creates all of the buttons for interacting with those special\n * properties\n */\nimport React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationModal } from \"../../Corporation/ui/CreateCorporationModal\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function SpecialLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const inBladeburner = player.inBladeburner();\n\n /**\n * Click handler for Bladeburner button at Sector-12 NSA\n */\n function handleBladeburner(): void {\n const p = player;\n if (p.inBladeburner()) {\n // Enter Bladeburner division\n router.toBladeburner();\n } else {\n // Apply for Bladeburner division\n if (p.strength >= 100 && p.defense >= 100 && p.dexterity >= 100 && p.agility >= 100) {\n p.startBladeburner({ new: true });\n dialogBoxCreate(\"You have been accepted into the Bladeburner division!\");\n setRerender((old) => !old);\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n } else {\n dialogBoxCreate(\"Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)\");\n }\n }\n }\n\n /**\n * Click handler for Resleeving button at New Tokyo VitaLife\n */\n function handleResleeving(): void {\n router.toResleeves();\n }\n\n function renderBladeburner(): React.ReactElement {\n if (!player.canAccessBladeburner()) {\n return <></>;\n }\n const text = inBladeburner ? \"Enter Bladeburner Headquarters\" : \"Apply to Bladeburner Division\";\n return <Button onClick={handleBladeburner}>{text}</Button>;\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n dialogBoxCreate(<>You ate some delicious noodles and feel refreshed.</>);\n }\n\n return <Button onClick={EatNoodles}>Eat noodles</Button>;\n }\n\n function CreateCorporation(): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (!player.canAccessCorporation()) {\n return (\n <>\n <Typography>\n <i>A business man is yelling at a clerk. You should come back later.</i>\n </Typography>\n </>\n );\n }\n return (\n <>\n <Button disabled={!player.canAccessCorporation() || player.hasCorporation()} onClick={() => setOpen(true)}>\n Create a Corporation\n </Button>\n <CreateCorporationModal open={open} onClose={() => setOpen(false)} />\n </>\n );\n }\n\n function renderResleeving(): React.ReactElement {\n if (!player.canAccessResleeving()) {\n return <></>;\n }\n return <Button onClick={handleResleeving}>Re-Sleeve</Button>;\n }\n\n function renderCotMG(): React.ReactElement {\n // prettier-ignore\n const symbol = <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>\n {\" `` \"}<br />\n {\" -odmmNmds: \"}<br />\n {\" `hNmo:..-omNh. \"}<br />\n {\" yMd` `hNh \"}<br />\n {\" mMd oNm \"}<br />\n {\" oMNo .mM/ \"}<br />\n {\" `dMN+ -mM+ \"}<br />\n {\" -mMNo -mN+ \"}<br />\n {\" .+- :mMNo/mN/ \"}<br />\n {\":yNMd. :NMNNN/ \"}<br />\n {\"-mMMMh. /NMMh` \"}<br />\n {\" .dMMMd. /NMMMy` \"}<br />\n {\" `yMMMd. /NNyNMMh` \"}<br />\n {\" `sMMMd. +Nm: +NMMh. \"}<br />\n {\" oMMMm- oNm: /NMMd. \"}<br />\n {\" +NMMmsMm- :mMMd. \"}<br />\n {\" /NMMMm- -mMMd. \"}<br />\n {\" /MMMm- -mMMd. \"}<br />\n {\" `sMNMMm- .mMmo \"}<br />\n {\" `sMd:hMMm. ./. \"}<br />\n {\" `yMy` `yNMd` \"}<br />\n {\" `hMs` oMMy \"}<br />\n {\" `hMh sMN- \"}<br />\n {\" /MM- .NMo \"}<br />\n {\" +MM: :MM+ \"}<br />\n {\" sNNo-.`.-omNy` \"}<br />\n {\" -smNNNNmdo- \"}<br />\n {\" `..` \"}</Typography>\n\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 switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderResleeving();\n }\n case LocationName.Sector12CityHall: {\n return <CreateCorporation />;\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\n }\n case LocationName.ChongqingChurchOfTheMachineGod: {\n return renderCotMG();\n }\n 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);\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. 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 <Button onClick={seed} disabled={name == \"\"}>\n Use seed money\n </Button>\n <Button onClick={selfFund} disabled={name == \"\" || !canSelfFund}>\n Self-Fund (<Money money={150e9} player={player} />)\n </Button>\n </Modal>\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\";\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 <br />\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 {purchaseServerButtons}\n <br />\n <Typography>\n <i>\"You can order bigger servers via scripts. We don't take custom order 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\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { purchaseRamForHomeComputer } from \"../../Server/ServerPurchases\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MathComponent } from \"mathjax-react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function RamButton(props: IProps): React.ReactElement {\n const homeComputer = props.p.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n return <Button>Upgrade 'home' RAM - MAX</Button>;\n }\n\n const cost = props.p.getUpgradeHomeRamCost();\n\n function buy(): void {\n purchaseRamForHomeComputer(props.p);\n props.rerender();\n }\n\n return (\n <Tooltip title={<MathComponent tex={String.raw`\\large{cost = 3.2 \\times 10^3 \\times 1.58^{log_2{(ram)}}}`} />}>\n <span>\n <Button disabled={!props.p.canAfford(cost)} onClick={buy}>\n Upgrade 'home' RAM ({numeralWrapper.formatRAM(homeComputer.maxRam)} -> \n {numeralWrapper.formatRAM(homeComputer.maxRam * 2)}) - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { purchaseTorRouter } from \"../LocationsHelpers\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function TorButton(props: IProps): React.ReactElement {\n function buy(): void {\n purchaseTorRouter(props.p);\n props.rerender();\n }\n\n if (props.p.hasTorRouter()) {\n return <Button>TOR Router - Purchased</Button>;\n }\n\n return (\n <Button disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)} onClick={buy}>\n Purchase TOR router - \n <Money money={CONSTANTS.TorRouterCost} player={props.p} />\n </Button>\n );\n}\n","/**\n * Location and traveling-related helper functions.\n * Mostly used for UI\n */\nimport { CONSTANTS } from \"../Constants\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { AddToAllServers, createUniqueRandomIp } from \"../Server/AllServers\";\nimport { safetlyCreateUniqueServer } from \"../Server/ServerHelpers\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\n/**\n * Attempt to purchase a TOR router\n * @param {IPlayer} p - Player object\n */\nexport function purchaseTorRouter(p: IPlayer): void {\n if (p.hasTorRouter()) {\n dialogBoxCreate(`You already have a TOR Router!`);\n return;\n }\n if (!p.canAfford(CONSTANTS.TorRouterCost)) {\n dialogBoxCreate(\"You cannot afford to purchase the TOR router!\");\n return;\n }\n p.loseMoney(CONSTANTS.TorRouterCost);\n\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: \"darkweb\",\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n\n p.getHomeComputer().serversOnNetwork.push(darkweb.hostname);\n darkweb.serversOnNetwork.push(p.getHomeComputer().hostname);\n dialogBoxCreate(\n \"You have purchased a TOR router!<br>\" +\n \"You now have access to the dark web from your home computer.<br>\" +\n \"Use the scan/scan-analyze commands to search for the dark web connection.\",\n );\n}\n","import React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MathComponent } from \"mathjax-react\";\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 = 1e9 * Math.pow(7.5, homeComputer.cpuCores);\n\n function buy(): void {\n if (maxCores) return;\n if (!props.p.canAfford(cost)) return;\n props.p.loseMoney(cost);\n homeComputer.cpuCores++;\n props.rerender();\n }\n\n return (\n <Tooltip title={<MathComponent tex={String.raw`\\large{cost = 10^9 \\times 7.5 ^{\\text{cores}}}`} />}>\n <span>\n <Button disabled={!props.p.canAfford(cost)} onClick={buy}>\n Upgrade 'home' cores ({homeComputer.cpuCores} -> {homeComputer.cpuCores + 1}) - \n <Money money={cost} player={props.p} />\n </Button>\n </span>\n </Tooltip>\n );\n}\n","/**\n * React Component for the popup used to purchase a new server.\n */\nimport React, { useState } from \"react\";\nimport { purchaseServer } from \"../../Server/ServerPurchases\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n ram: number;\n cost: number;\n rerender: () => void;\n}\n\nexport function PurchaseServerModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const [hostname, setHostname] = useState(\"\");\n\n function tryToPurchaseServer(): void {\n purchaseServer(hostname, props.ram, props.cost, player);\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) tryToPurchaseServer();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setHostname(event.target.value);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to purchase a new server with {numeralWrapper.formatRAM(props.ram)} of RAM for{\" \"}\n <Money money={props.cost} player={player} />?\n </Typography>\n <br />\n <br />\n <Typography> Please enter the server hostname below:</Typography>\n <br />\n\n <TextField\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n type=\"text\"\n placeholder=\"Unique Hostname\"\n InputProps={{\n endAdornment: (\n <Button onClick={tryToPurchaseServer} disabled={!player.canAfford(props.cost) || hostname === \"\"}>\n Buy\n </Button>\n ),\n }}\n />\n </Modal>\n );\n}\n","import React from \"react\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n city: string;\n travel: () => void;\n\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelConfirmationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const cost = CONSTANTS.TravelCost;\n function travel(): void {\n props.travel();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to travel to {props.city}? The trip will cost <Money money={cost} player={player} />.\n </Typography>\n <br />\n <br />\n <Button onClick={travel}>\n <Typography>Travel</Typography>\n </Button>\n </Modal>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a university\n *\n * This subcomponent renders all of the buttons for studying/taking courses\n */\nimport * as React from \"react\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { use } from \"../../ui/Context\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function UniversityLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n\n function calculateCost(): number {\n const server = GetServer(props.loc.name);\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return props.loc.costMult * discount;\n }\n\n function take(stat: string): void {\n const loc = props.loc;\n player.startClass(router, calculateCost(), loc.expMult, stat);\n }\n\n function study(): void {\n take(CONSTANTS.ClassStudyComputerScience);\n }\n\n function dataStructures(): void {\n take(CONSTANTS.ClassDataStructures);\n }\n\n function networks(): void {\n take(CONSTANTS.ClassNetworks);\n }\n\n function algorithms(): void {\n take(CONSTANTS.ClassAlgorithms);\n }\n\n function management(): void {\n take(CONSTANTS.ClassManagement);\n }\n\n function leadership(): void {\n take(CONSTANTS.ClassLeadership);\n }\n\n const costMult: number = calculateCost();\n\n const dataStructuresCost = CONSTANTS.ClassDataStructuresBaseCost * costMult;\n const networksCost = CONSTANTS.ClassNetworksBaseCost * costMult;\n const algorithmsCost = CONSTANTS.ClassAlgorithmsBaseCost * costMult;\n const managementCost = CONSTANTS.ClassManagementBaseCost * costMult;\n const leadershipCost = CONSTANTS.ClassLeadershipBaseCost * costMult;\n\n const earnHackingExpTooltip = `Gain hacking experience!`;\n const earnCharismaExpTooltip = `Gain charisma experience!`;\n\n return (\n <>\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={study}>Study Computer Science (free)</Button>\n </Tooltip>\n <br />\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 <br />\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={networks}>\n Take Networks course (\n <Money money={networksCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <br />\n <Tooltip title={earnHackingExpTooltip}>\n <Button onClick={algorithms}>\n Take Algorithms course (\n <Money money={algorithmsCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <br />\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={management}>\n Take Management course (\n <Money money={managementCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n <br />\n <Tooltip title={earnCharismaExpTooltip}>\n <Button onClick={leadership}>\n Take Leadership course (\n <Money money={leadershipCost} player={player} /> / sec)\n </Button>\n </Tooltip>\n </>\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 } from \"../../Casino/Blackjack\";\nimport { CoinFlip } from \"../../Casino/CoinFlip\";\nimport { Roulette } from \"../../Casino/Roulette\";\nimport { SlotMachine } from \"../../Casino/SlotMachine\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\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 <>\n <Button onClick={() => updateGame(GameType.Coin)}>Play coin flip</Button>\n <br />\n <Button onClick={() => updateGame(GameType.Slots)}>Play slots</Button>\n <br />\n <Button onClick={() => updateGame(GameType.Roulette)}>Play roulette</Button>\n <br />\n <Button onClick={() => updateGame(GameType.Blackjack)}>Play blackjack</Button>\n </>\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 * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { Game } 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;\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(5); // 5-deck multideck\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()) {\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)\n this.props.p.loseMoney(this.state.bet);\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 let gains = 0;\n if (this.isPlayerWinResult(result)) {\n gains = this.state.bet;\n\n // We 2x the gains because we took away money at the start, so we need to give the original bet back.\n this.win(this.props.p, 2 * gains);\n } else if (result === Result.DealerWon) {\n gains = -1 * this.state.bet;\n this.win(this.props.p, -this.state.bet); // Get the original bet back\n // Dont need to take money here since we already did it at the start\n } else if (result === Result.Tie) {\n this.win(this.props.p, this.state.bet); // Get the original bet back\n }\n\n this.setState({\n gameInProgress: false,\n result,\n gains: this.state.gains + gains,\n });\n };\n\n isPlayerWinResult = (result: Result): boolean => {\n return result === Result.PlayerWon || result === Result.PlayerWonByBlackjack;\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 <pre>Player</pre>\n {playerHand.cards.map((card, i) => (\n <ReactCard card={card} key={i} />\n ))}\n\n <pre>Value(s): </pre>\n {playerHandValues.map((value, i) => (\n <pre key={i}>{value}</pre>\n ))}\n </Paper>\n </Box>\n\n <br />\n\n <Box display=\"flex\">\n <Paper elevation={2}>\n <pre>Dealer</pre>\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 <pre>Value(s): </pre>\n {dealerHandValues.map((value, i) => (\n <pre key={i}>{value}</pre>\n ))}\n </>\n )}\n </Paper>\n </Box>\n </>\n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n <Typography>\n {result}\n {this.isPlayerWinResult(result) && <Money money={this.state.bet} />}\n {result === Result.DealerWon && <Money money={this.state.bet} />}\n </Typography>\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 if (n === 0) return false;\n return redNumbers.includes(n);\n },\n payout: 1,\n },\n Black: {\n match: (n: number): boolean => {\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 const [strategy, setStrategy] = useState<Strategy>({\n payout: 0,\n match: (): boolean => {\n return false;\n },\n });\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(s: Strategy): void {\n if (reachedLimit(props.p)) return;\n\n setCanPlay(false);\n setLock(false);\n setStatus(\"playing\");\n setStrategy(s);\n\n setTimeout(() => {\n let n = Math.floor(rng.random() * 37);\n let status = <></>;\n let gain = 0;\n let playerWin = strategy.match(n);\n // oh yeah, the house straight up cheats. Try finding the seed now!\n if (playerWin && Math.random() > 0.9) {\n playerWin = false;\n while (strategy.match(n)) {\n n = (n + 1) % 36;\n }\n }\n if (playerWin) {\n gain = investment * strategy.payout;\n status = (\n <>\n won <Money money={gain} />\n </>\n );\n } else {\n gain = -investment;\n status = (\n <>\n lost <Money money={-gain} />\n </>\n );\n }\n win(props.p, gain);\n\n setCanPlay(true);\n setLock(true);\n setStatus(status);\n setN(n);\n\n reachedLimit(props.p);\n }, 1600);\n }\n\n return (\n <>\n <Typography variant=\"h4\">{currentNumber()}</Typography>\n <TextField type=\"number\" onChange={updateInvestment} placeholder={\"Amount to play\"} disabled={!canPlay} />\n <Typography variant=\"h4\">{status}</Typography>\n <table>\n <tbody>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(3)))}>\n 3\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(6)))}>\n 6\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(9)))}>\n 9\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(12)))}>\n 12\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(15)))}>\n 15\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(18)))}>\n 18\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(21)))}>\n 21\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(24)))}>\n 24\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(27)))}>\n 27\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(30)))}>\n 30\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(33)))}>\n 33\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(36)))}>\n 36\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(2)))}>\n 2\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(5)))}>\n 5\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(8)))}>\n 8\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(11)))}>\n 11\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(14)))}>\n 14\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(17)))}>\n 17\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(20)))}>\n 20\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(23)))}>\n 23\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(26)))}>\n 26\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(29)))}>\n 29\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(32)))}>\n 32\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(35)))}>\n 35\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(1)))}>\n 1\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(4)))}>\n 4\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(7)))}>\n 7\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(10)))}>\n 10\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(13)))}>\n 13\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(16)))}>\n 16\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(19)))}>\n 19\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(22)))}>\n 22\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(25)))}>\n 25\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(28)))}>\n 28\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(31)))}>\n 31\n </Button>\n </td>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(34)))}>\n 34\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third1))}>\n 1 to 12\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third2))}>\n 13 to 24\n </Button>\n </td>\n <td colSpan={4}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Third3))}>\n 25 to 36\n </Button>\n </td>\n </tr>\n <tr>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Red))}>\n Red\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Black))}>\n Black\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Odd))}>\n Odd\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Even))}>\n Even\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.High))}>\n High\n </Button>\n </td>\n <td colSpan={2}>\n <Button disabled={!canPlay} onClick={trusted(() => play(strategies.Low))}>\n Low\n </Button>\n </td>\n </tr>\n <tr>\n <td>\n <Button disabled={!canPlay} onClick={trusted(() => play(Single(0)))}>\n 0\n </Button>\n </td>\n </tr>\n </tbody>\n </table>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { WHRNG } from \"./RNG\";\nimport { win, reachedLimit } from \"./Game\";\nimport { trusted } from \"./utils\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ntype IProps = {\n p: IPlayer;\n};\n\n// statically shuffled array of symbols.\nconst symbols = [\n \"D\",\n \"C\",\n \"$\",\n \"?\",\n \"♥\",\n \"A\",\n \"C\",\n \"B\",\n \"C\",\n \"E\",\n \"B\",\n \"E\",\n \"C\",\n \"*\",\n \"D\",\n \"♥\",\n \"B\",\n \"A\",\n \"A\",\n \"A\",\n \"C\",\n \"A\",\n \"D\",\n \"B\",\n \"E\",\n \"?\",\n \"D\",\n \"*\",\n \"@\",\n \"♥\",\n \"B\",\n \"E\",\n \"?\",\n];\n\nfunction getPayout(s: string, n: number): number {\n switch (s) {\n case \"$\":\n return [20, 200, 1000][n];\n case \"@\":\n return [8, 80, 400][n];\n case \"♥\":\n case \"?\":\n return [6, 20, 150][n];\n case \"D\":\n case \"E\":\n return [1, 8, 30][n];\n default:\n return [1, 5, 20][n];\n }\n}\n\nconst payLines = [\n // lines\n [\n [0, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [0, 4],\n ],\n [\n [1, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [1, 4],\n ],\n [\n [2, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [2, 4],\n ],\n\n // Vs\n [\n [2, 0],\n [1, 1],\n [0, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [0, 0],\n [1, 1],\n [2, 2],\n [1, 3],\n [0, 4],\n ],\n\n // rest\n [\n [0, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [0, 4],\n ],\n [\n [2, 0],\n [1, 1],\n [1, 2],\n [1, 3],\n [2, 4],\n ],\n [\n [1, 0],\n [0, 1],\n [0, 2],\n [0, 3],\n [1, 4],\n ],\n [\n [1, 0],\n [2, 1],\n [2, 2],\n [2, 3],\n [1, 4],\n ],\n];\n\nconst minPlay = 0;\nconst maxPlay = 1e6;\n\nexport function SlotMachine(props: IProps): React.ReactElement {\n const [rng] = useState(new WHRNG(props.p.totalPlaytime));\n const [index, setIndex] = useState<number[]>([0, 0, 0, 0, 0]);\n const [locks, setLocks] = useState<number[]>([0, 0, 0, 0, 0]);\n const [investment, setInvestment] = useState(1000);\n const [canPlay, setCanPlay] = useState(true);\n const [status, setStatus] = useState<string | JSX.Element>(\"waiting\");\n\n useEffect(() => {\n const i = window.setInterval(step, 50);\n return () => clearInterval(i);\n });\n\n function step(): void {\n let stoppedOne = false;\n const copy = index.slice();\n for (const i in copy) {\n if (copy[i] === locks[i] && !stoppedOne) continue;\n copy[i] = (copy[i] + 1) % symbols.length;\n stoppedOne = true;\n }\n\n setIndex(copy);\n\n if (stoppedOne && copy.every((e, i) => e === locks[i])) {\n checkWinnings();\n }\n }\n\n function getTable(): 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(): void {\n const t = getTable();\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();\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","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 id = 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(replace(content, index, randomize(letter)));\n setTimeout(() => {\n setContent(content);\n }, 50);\n }, 100);\n\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return <span>{content}</span>;\n}\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\";\n\ntype IProps = {\n city: City;\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 const router = use.Router();\n if (!location) return <span>*</span>;\n return (\n <span\n aria-label={location.name}\n key={location.name}\n style={{\n color: \"white\",\n whiteSpace: \"nowrap\",\n margin: \"0px\",\n padding: \"0px\",\n cursor: \"pointer\",\n }}\n onClick={() => toLocation(router, location)}\n >\n <b>X</b>\n </span>\n );\n}\n\nfunction ASCIICity(props: IProps): React.ReactElement {\n const locationLettersRegex = /[A-Z]/g;\n const letterMap: any = {\n A: 0,\n B: 1,\n C: 2,\n D: 3,\n E: 4,\n F: 5,\n G: 6,\n H: 7,\n I: 8,\n J: 9,\n K: 10,\n L: 11,\n M: 12,\n N: 13,\n O: 14,\n P: 15,\n Q: 16,\n R: 17,\n S: 18,\n T: 19,\n U: 20,\n V: 21,\n W: 22,\n X: 23,\n Y: 24,\n Z: 25,\n };\n\n const lineElems = (s: string): JSX.Element[] => {\n const elems: any[] = [];\n const matches: any[] = [];\n let match: any;\n while ((match = locationLettersRegex.exec(s)) !== null) {\n matches.push(match);\n }\n if (matches.length === 0) {\n elems.push(s);\n return elems;\n }\n\n for (let i = 0; i < matches.length; i++) {\n const startI = i === 0 ? 0 : matches[i - 1].index + 1;\n const endI = matches[i].index;\n elems.push(s.slice(startI, endI));\n const locationI = letterMap[s[matches[i].index]];\n elems.push(LocationLetter(Locations[props.city.locations[locationI]]));\n }\n elems.push(s.slice(matches[matches.length - 1].index + 1));\n return elems;\n };\n\n const elems: JSX.Element[] = [];\n const lines = props.city.asciiArt.split(\"\\n\");\n for (const i in lines) {\n elems.push(\n <Typography key={i} sx={{ lineHeight: \"1em\", whiteSpace: \"pre\" }}>\n {lineElems(lines[i])}\n </Typography>,\n );\n }\n\n return <>{elems}</>;\n}\n\nfunction ListCity(props: IProps): React.ReactElement {\n const router = use.Router();\n const locationButtons = props.city.locations.map((locName) => {\n return (\n <React.Fragment key={locName}>\n <Button onClick={() => toLocation(router, Locations[locName])}>{locName}</Button>\n <br />\n </React.Fragment>\n );\n });\n\n return <>{locationButtons}</>;\n}\n\nexport function LocationCity(): React.ReactElement {\n const player = use.Player();\n const city = Cities[player.city];\n return (\n <>\n <Typography>{city.name}</Typography>\n {Settings.DisableASCIIArt ? <ListCity city={city} /> : <ASCIICity city={city} />}\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { use } from \"../../ui/Context\";\nimport { getAvailableCreatePrograms } from \"../ProgramHelpers\";\n\nimport { Tooltip, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\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 useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Typography variant=\"h4\">Create program</Typography>\n <Typography>\n This page displays any programs that you are able to create. Writing the code for a program takes time, which\n can vary based on how complex the program is. If you are working on creating a program you can cancel at any\n time. Your progress will be saved and you can continue later.\n </Typography>\n\n {getAvailableCreatePrograms(player).map((program) => {\n const create = program.create;\n if (create === null) return <></>;\n\n return (\n <React.Fragment key={program.name}>\n <Tooltip title={create.tooltip}>\n <Button\n sx={{ my: 1 }}\n onClick={(event) => {\n if (!event.isTrusted) return;\n player.startCreateProgramWork(router, program.name, create.time, create.level);\n }}\n >\n {program.name}\n </Button>\n </Tooltip>\n <br />\n </React.Fragment>\n );\n })}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Options } from \"./Options\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport Select from \"@mui/material/Select\";\nimport Switch from \"@mui/material/Switch\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n options: Options;\n save: (options: Options) => void;\n onClose: () => void;\n open: boolean;\n}\n\nexport function OptionsModal(props: IProps): React.ReactElement {\n const [theme, setTheme] = useState(props.options.theme);\n const [insertSpaces, setInsertSpaces] = useState(props.options.insertSpaces);\n const [fontSize, setFontSize] = useState(props.options.fontSize);\n\n function save(): void {\n props.save({\n theme: theme,\n insertSpaces: insertSpaces,\n fontSize: fontSize,\n });\n props.onClose();\n }\n\n function onFontChange(event: React.ChangeEvent<HTMLInputElement>): void {\n const f = parseFloat(event.target.value);\n if (isNaN(f)) return;\n setFontSize(f);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Theme: </Typography>\n <Select onChange={(event) => setTheme(event.target.value)} defaultValue={props.options.theme}>\n <MenuItem value=\"vs-dark\">dark</MenuItem>\n <MenuItem value=\"light\">light</MenuItem>\n <MenuItem value=\"monokai\">monokai</MenuItem>\n </Select>\n </Box>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Use whitespace over tabs: </Typography>\n <Switch onChange={(event) => setInsertSpaces(event.target.checked)} checked={insertSpaces} />\n </Box>\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <TextField type=\"number\" label=\"Font size\" value={fontSize} onChange={onFontChange} />\n </Box>\n <br />\n <Button onClick={save}>Save</Button>\n </Modal>\n );\n}\n","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 } 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);\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(() => TerminalEvents.subscribe(_.debounce(async () => rerender(), 25, { maxWait: 50 })), []);\n useEffect(() => TerminalClearEvents.subscribe(_.debounce(async () => clear(), 25, { maxWait: 50 })), []);\n\n function doScroll(): void {\n const hook = scrollHook.current;\n if (hook !== null) {\n setTimeout(() => hook.scrollIntoView(true), 50);\n }\n }\n\n doScroll();\n\n useEffect(() => {\n setTimeout(doScroll, 50);\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: classes.preformatted }} color={item.color} paragraph={false}>\n {item.text}\n </Typography>\n </ListItem>\n );\n if (item instanceof Link)\n return (\n <ListItem key={i} classes={{ root: classes.nopadding }}>\n <Typography>{item.dashes}> </Typography>\n <MuiLink\n classes={{ root: classes.preformatted }}\n color={\"secondary\"}\n paragraph={false}\n onClick={() => terminal.connectToServer(player, item.hostname)}\n >\n <Typography>{item.hostname}</Typography>\n </MuiLink>\n </ListItem>\n );\n })}\n\n {terminal.action !== null && (\n <ListItem classes={{ root: classes.nopadding }}>\n <ActionTimer terminal={terminal} />{\" \"}\n </ListItem>\n )}\n </List>\n <div ref={scrollHook}></div>\n </Box>\n <Box position=\"sticky\" bottom={0} width=\"100%\" px={0}>\n <TerminalInput player={player} router={router} terminal={terminal} />\n </Box>\n <BitFlumeModal />\n <CodingContractModal />\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport TextField from \"@mui/material/TextField\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { determineAllPossibilitiesForTabCompletion } from \"../determineAllPossibilitiesForTabCompletion\";\nimport { tabCompletion } from \"../tabCompletion\";\nimport { Settings } from \"../../Settings/Settings\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n },\n input: {\n backgroundColor: \"#000\",\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 [possibilities, setPossibilities] = useState<string[]>([]);\n const classes = useStyles();\n\n function saveValue(value: string): void {\n command = value;\n setValue(value);\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 > 0; --delStart) {\n if (inputText.charAt(delStart) === \" \") {\n saveValue(inputText.substr(0, delStart) + inputText.substr(start));\n return;\n }\n }\n break;\n case \"deletewordafter\": // Delete rest of word after the cursor\n for (let delStart = start + 1; delStart <= value.length + 1; ++delStart) {\n if (inputText.charAt(delStart) === \" \") {\n saveValue(inputText.substr(0, start) + inputText.substr(delStart));\n return;\n }\n }\n break;\n case \"clearafter\": // Deletes everything after cursor\n break;\n case \"clearbefore:\": // Deleetes everything before cursor\n break;\n }\n }\n\n function moveTextCursor(loc: string): void {\n const ref = terminalInput.current;\n if (!ref) return;\n const inputLength = value.length;\n const start = ref.selectionStart;\n if (start === null) return;\n\n switch (loc.toLowerCase()) {\n case \"home\":\n ref.setSelectionRange(0, 0);\n break;\n case \"end\":\n ref.setSelectionRange(inputLength, inputLength);\n break;\n case \"prevchar\":\n if (start > 0) {\n ref.setSelectionRange(start - 1, start - 1);\n }\n break;\n case \"prevword\":\n for (let i = start - 2; i >= 0; --i) {\n if (ref.value.charAt(i) === \" \") {\n ref.setSelectionRange(i + 1, i + 1);\n return;\n }\n }\n ref.setSelectionRange(0, 0);\n break;\n case \"nextchar\":\n ref.setSelectionRange(start + 1, start + 1);\n break;\n case \"nextword\":\n for (let i = start + 1; i <= inputLength; ++i) {\n if (ref.value.charAt(i) === \" \") {\n ref.setSelectionRange(i, i);\n return;\n }\n }\n ref.setSelectionRange(inputLength, inputLength);\n break;\n default:\n console.warn(\"Invalid loc argument in Terminal.moveTextCursor()\");\n break;\n }\n }\n\n // Catch all key inputs and redirect them to the terminal.\n useEffect(() => {\n function keyDown(this: Document, event: KeyboardEvent): void {\n if (terminal.contractOpen) return;\n if (terminal.action !== null && event.keyCode === KEY.C && event.ctrlKey) {\n terminal.finishAction(router, player, true);\n return;\n }\n const ref = terminalInput.current;\n if (event.ctrlKey || event.metaKey) return;\n if (event.keyCode === KEY.C && (event.ctrlKey || event.metaKey)) return; // trying to copy\n\n if (ref) ref.focus();\n }\n document.addEventListener(\"keydown\", keyDown);\n return () => document.removeEventListener(\"keydown\", keyDown);\n });\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n // Run command.\n if (event.keyCode === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n terminal.print(`[${player.getCurrentServer().hostname} ~${terminal.cwd()}]> ${value}`);\n terminal.executeCommands(router, player, value);\n saveValue(\"\");\n return;\n }\n\n // Autocomplete\n if (event.keyCode === KEY.TAB && value !== \"\") {\n event.preventDefault();\n\n let copy = value;\n const semiColonIndex = copy.lastIndexOf(\";\");\n if (semiColonIndex !== -1) {\n copy = copy.slice(semiColonIndex + 1);\n }\n\n copy = copy.trim();\n copy = copy.replace(/\\s\\s+/g, \" \");\n\n const commandArray = copy.split(\" \");\n let index = commandArray.length - 2;\n if (index < -1) {\n index = 0;\n }\n const allPos = 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 const newValue = tabCompletion(command, arg, allPos, value);\n if (typeof newValue === \"string\" && newValue !== \"\") {\n saveValue(newValue);\n }\n if (Array.isArray(newValue)) {\n setPossibilities(newValue);\n }\n }\n\n // Clear screen.\n if (event.keyCode === KEY.L && event.ctrlKey) {\n event.preventDefault();\n terminal.clear();\n }\n\n // Select previous command.\n if (event.keyCode === KEY.UPARROW || (Settings.EnableBashHotkeys && event.keyCode === KEY.P && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = terminal.commandHistoryIndex;\n const len = terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n terminal.commandHistoryIndex = len;\n }\n\n if (i != 0) {\n --terminal.commandHistoryIndex;\n }\n const prevCommand = terminal.commandHistory[terminal.commandHistoryIndex];\n saveValue(prevCommand);\n const ref = terminalInput.current;\n if (ref) {\n setTimeout(function () {\n ref.selectionStart = ref.selectionEnd = 10000;\n }, 10);\n }\n }\n\n // Select next command\n if (event.keyCode === KEY.DOWNARROW || (Settings.EnableBashHotkeys && event.keyCode === KEY.M && event.ctrlKey)) {\n if (Settings.EnableBashHotkeys) {\n event.preventDefault();\n }\n const i = terminal.commandHistoryIndex;\n const len = terminal.commandHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n terminal.commandHistoryIndex = len;\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n terminal.commandHistoryIndex = len;\n saveValue(\"\");\n } else {\n ++terminal.commandHistoryIndex;\n const prevCommand = terminal.commandHistory[terminal.commandHistoryIndex];\n saveValue(prevCommand);\n }\n }\n\n // Extra Bash Emulation Hotkeys, must be enabled through .fconf\n if (Settings.EnableBashHotkeys) {\n if (event.keyCode === KEY.A && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"home\");\n }\n\n if (event.keyCode === KEY.E && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"end\");\n }\n\n if (event.keyCode === KEY.B && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"prevchar\");\n }\n\n if (event.keyCode === KEY.B && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"prevword\");\n }\n\n if (event.keyCode === KEY.F && event.ctrlKey) {\n event.preventDefault();\n moveTextCursor(\"nextchar\");\n }\n\n if (event.keyCode === KEY.F && event.altKey) {\n event.preventDefault();\n moveTextCursor(\"nextword\");\n }\n\n if ((event.keyCode === KEY.H || event.keyCode === KEY.D) && event.ctrlKey) {\n modifyInput(\"backspace\");\n event.preventDefault();\n }\n\n // TODO AFTER THIS:\n // alt + d deletes word after cursor\n // ^w deletes word before cursor\n // ^k clears line after cursor\n // ^u clears line before cursor\n }\n }\n\n return (\n <>\n <Tooltip\n title={\n possibilities.length > 0 ? (\n <>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n Possible autocomplete candidate:\n </Typography>\n <Typography classes={{ root: classes.preformatted }} color={\"primary\"} paragraph={false}>\n {possibilities.join(\" \")}\n </Typography>\n </>\n ) : (\n \"\"\n )\n }\n >\n <TextField\n fullWidth\n color={terminal.action === null ? \"primary\" : \"secondary\"}\n autoFocus\n disabled={terminal.action !== null}\n autoComplete=\"off\"\n value={value}\n classes={{ root: classes.textfield }}\n onChange={handleValueChange}\n inputRef={terminalInput}\n InputProps={{\n // for players to hook in\n id: \"terminal-input\",\n className: classes.input,\n startAdornment: (\n <Typography color={terminal.action === null ? \"primary\" : \"secondary\"} flexShrink={0}>\n [{player.getCurrentServer().hostname} ~{terminal.cwd()}]> \n </Typography>\n ),\n spellCheck: false,\n onKeyDown: onKeyDown,\n }}\n ></TextField>\n </Tooltip>\n </>\n );\n}\n","import { evaluateDirectoryPath, getAllParentDirectories } from \"./DirectoryHelpers\";\nimport { getSubdirectories } from \"./DirectoryServerHelpers\";\n\nimport { Aliases, GlobalAliases } from \"../Alias\";\nimport { DarkWebItems } from \"../DarkWeb/DarkWebItems\";\nimport { Message } from \"../Message/Message\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\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 \"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 \"weaken\",\n];\n\nexport function determineAllPossibilitiesForTabCompletion(\n p: IPlayer,\n input: string,\n index: number,\n currPath = \"\",\n): string[] {\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 instanceof Message)) {\n allPos.push(file);\n }\n }\n }\n\n function addAllMessages(): void {\n for (const file of currServ.messages) {\n if (file instanceof Message) {\n allPos.push(file.filename);\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 /**\n * If the command starts with './' and the index == -1, then the user\n * has input ./partialexecutablename so autocomplete the script or program.\n * Put './' in front of each script/executable\n */\n if (isCommand(\"./\") && index == -1) {\n //All programs and scripts\n for (let i = 0; i < currServ.scripts.length; ++i) {\n allPos.push(\"./\" + currServ.scripts[i].filename);\n }\n\n //Programs are on home computer\n for (let i = 0; i < homeComputer.programs.length; ++i) {\n allPos.push(\"./\" + homeComputer.programs[i]);\n }\n return allPos;\n }\n\n // Autocomplete the command\n if (index === -1) {\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 in 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(\"connect\")) {\n // All network connections\n for (let i = 0; i < currServ.serversOnNetwork.length; ++i) {\n const serv = GetServer(currServ.serversOnNetwork[i]);\n if (serv == null) {\n continue;\n }\n allPos.push(serv.hostname);\n }\n\n return allPos;\n }\n\n if (isCommand(\"kill\") || isCommand(\"tail\") || isCommand(\"mem\") || isCommand(\"check\")) {\n addAllScripts();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"nano\")) {\n addAllScripts();\n addAllTextFiles();\n allPos.push(\".fconf\");\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 if (isCommand(\"run\")) {\n addAllScripts();\n addAllPrograms();\n addAllCodingContracts();\n addAllDirectories();\n\n return allPos;\n }\n\n if (isCommand(\"cat\")) {\n addAllMessages();\n addAllLitFiles();\n addAllTextFiles();\n addAllDirectories();\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 return allPos;\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains function that deal with Server-related directory things.\n * Functions that deal with the string manipulation can be found in\n * ./DirectoryHelpers.ts\n */\nimport { isValidDirectoryPath, isInRootDirectory, getFirstParentDirectory } from \"./DirectoryHelpers\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\n/**\n * Given a directory (by the full directory path) and a server, returns all\n * subdirectories of that directory. This is only for FIRST-LEVEl/immediate subdirectories\n */\nexport function getSubdirectories(serv: BaseServer, dir: string): string[] {\n const res: string[] = [];\n\n if (!isValidDirectoryPath(dir)) {\n return res;\n }\n\n let t_dir = dir;\n if (!t_dir.endsWith(\"/\")) {\n t_dir += \"/\";\n }\n\n function processFile(fn: string): void {\n if (t_dir === \"/\" && isInRootDirectory(fn)) {\n const subdir = getFirstParentDirectory(fn);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n } else if (fn.startsWith(t_dir)) {\n const remaining = fn.slice(t_dir.length);\n const subdir = getFirstParentDirectory(remaining);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n }\n }\n\n for (const script of serv.scripts) {\n processFile(script.filename);\n }\n\n for (const txt of serv.textFiles) {\n processFile(txt.fn);\n }\n\n return res;\n}\n","import { containsAllStrings, longestCommonStart } from \"../utils/StringHelperFunctions\";\n\n/**\n * Implements tab completion for the Terminal\n *\n * @param command {string} Terminal command, excluding the last incomplete argument\n * @param arg {string} Last argument that is being completed\n * @param allPossibilities {string[]} All values that `arg` can complete to\n */\nexport function tabCompletion(\n command: string,\n arg: string,\n allPossibilities: string[],\n oldValue: string,\n): string[] | string | undefined {\n if (!(allPossibilities.constructor === Array)) {\n return;\n }\n if (!containsAllStrings(allPossibilities)) {\n return;\n }\n\n // Remove all options in allPossibilities that do not match the current string\n // that we are attempting to autocomplete\n if (arg === \"\") {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(command.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n } else {\n for (let i = allPossibilities.length - 1; i >= 0; --i) {\n if (!allPossibilities[i].toLowerCase().startsWith(arg.toLowerCase())) {\n allPossibilities.splice(i, 1);\n }\n }\n }\n\n const semiColonIndex = oldValue.lastIndexOf(\";\");\n\n let val = \"\";\n if (allPossibilities.length === 0) {\n return;\n } else if (allPossibilities.length === 1) {\n if (arg === \"\") {\n //Autocomplete command\n val = allPossibilities[0] + \" \";\n } else {\n val = command + \" \" + allPossibilities[0];\n }\n\n if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return val;\n } else {\n // Replace only after the last semicolon\n return oldValue.slice(0, semiColonIndex + 1) + \" \" + val;\n }\n } else {\n const longestStartSubstr = longestCommonStart(allPossibilities);\n /**\n * If the longest common starting substring of remaining possibilities is the same\n * as whatevers already in terminal, just list all possible options. Otherwise,\n * change the input in the terminal to the longest common starting substr\n */\n if (arg === \"\") {\n if (longestStartSubstr === command) {\n return allPossibilities;\n } else {\n if (semiColonIndex === -1) {\n // No semicolon, so replace the whole command\n return longestStartSubstr;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${longestStartSubstr}`;\n }\n }\n } else {\n if (longestStartSubstr === arg) {\n // List all possible options\n return allPossibilities;\n } else {\n if (semiColonIndex == -1) {\n // No semicolon, so replace the whole command\n return `${command} ${longestStartSubstr}`;\n } else {\n // Replace only after the last semicolon\n return `${oldValue.slice(0, semiColonIndex + 1)} ${command} ${longestStartSubstr}`;\n }\n }\n }\n }\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nexport function TutorialRoot(): React.ReactElement {\n return (\n <>\n <Typography variant=\"h4\">Tutorial / Documentation</Typography>\n <Box m={2}>\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 </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\";\n\nimport { ScriptProduction } from \"./ScriptProduction\";\nimport { ServerAccordions } from \"./ServerAccordions\";\n\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport Typography from \"@mui/material/Typography\";\n\ntype 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 return (\n <>\n <Typography variant=\"h4\">Active Scripts</Typography>\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:</Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n <Money money={player.scriptProdSinceLastAug} />\n </Typography>\n </TableCell>\n <TableCell align=\"left\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">\n (<MoneyRate money={prodRateSinceLastAug} />)\n </Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n );\n}\n","/**\n * React Component for rendering the Accordion elements for all servers\n * on which scripts are running\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { ServerAccordion } from \"./ServerAccordion\";\n\nimport TextField from \"@mui/material/TextField\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptStartStopEventEmitter } from \"../../Netscript/WorkerScriptStartStopEventEmitter\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\n// Map of server hostname -> all workerscripts on that server for all active scripts\ninterface IServerData {\n server: BaseServer;\n workerScripts: WorkerScript[];\n}\n\ninterface IServerToScriptsMap {\n [key: string]: IServerData | undefined;\n}\n\ntype IProps = {\n workerScripts: Map<number, WorkerScript>;\n};\n\nexport function ServerAccordions(props: IProps): React.ReactElement {\n const [filter, setFilter] = useState(\"\");\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsServerPageSize);\n const setRerender = useState(false)[1];\n\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsServerPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n function handleFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n setPage(0);\n }\n\n const serverToScriptMap: IServerToScriptsMap = {};\n for (const ws of props.workerScripts.values()) {\n const server = GetServer(ws.hostname);\n if (server == null) {\n console.warn(`WorkerScript has invalid IP address: ${ws.hostname}`);\n continue;\n }\n\n let data = serverToScriptMap[server.hostname];\n\n if (data === undefined) {\n serverToScriptMap[server.hostname] = {\n server: server,\n workerScripts: [],\n };\n data = serverToScriptMap[server.hostname];\n }\n if (data !== undefined) data.workerScripts.push(ws);\n }\n\n const filtered = Object.values(serverToScriptMap).filter((data) => data && data.server.hostname.includes(filter));\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => WorkerScriptStartStopEventEmitter.subscribe(rerender));\n\n return (\n <>\n <TextField\n value={filter}\n onChange={handleFilterChange}\n autoFocus\n InputProps={{\n startAdornment: <SearchIcon />,\n spellCheck: false,\n }}\n />\n <List dense={true}>\n {filtered.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((data) => {\n return (\n data && (\n <ServerAccordion key={data.server.hostname} server={data.server} workerScripts={data.workerScripts} />\n )\n );\n })}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={filtered.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for rendering the Accordion element for a single\n * server in the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport { ServerAccordionContent } from \"./ServerAccordionContent\";\n\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\n\ntype IProps = {\n server: BaseServer;\n workerScripts: WorkerScript[];\n};\n\nexport function ServerAccordion(props: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n const server = props.server;\n\n // Accordion's header text\n // TODO: calculate the longest hostname length rather than hard coding it\n const longestHostnameLength = 18;\n const paddedName = `${server.hostname}${\" \".repeat(longestHostnameLength)}`.slice(\n 0,\n Math.max(server.hostname.length, longestHostnameLength),\n );\n const barOptions = {\n progress: server.ramUsed / server.maxRam,\n totalTicks: 30,\n };\n const headerTxt = `${paddedName} ${createProgressBarText(barOptions)}`;\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setOpen((old) => !old)}>\n <ListItemText primary={<Typography style={{ whiteSpace: \"pre-wrap\" }}>{headerTxt}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Box mx={2}>\n <Collapse in={open} timeout={0} unmountOnExit>\n <ServerAccordionContent workerScripts={props.workerScripts} />\n </Collapse>\n </Box>\n </Box>\n );\n}\n","import React, { useState } from \"react\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { WorkerScriptAccordion } from \"./WorkerScriptAccordion\";\nimport List from \"@mui/material/List\";\nimport TablePagination from \"@mui/material/TablePagination\";\nimport { TablePaginationActionsAll } from \"../React/TablePaginationActionsAll\";\nimport { Settings } from \"../../Settings/Settings\";\n\ninterface IProps {\n workerScripts: WorkerScript[];\n}\n\nexport function ServerAccordionContent(props: IProps): React.ReactElement {\n const [page, setPage] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(Settings.ActiveScriptsScriptPageSize);\n const handleChangePage = (event: unknown, newPage: number): void => {\n setPage(newPage);\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement>): void => {\n Settings.ActiveScriptsScriptPageSize = parseInt(event.target.value, 10);\n setRowsPerPage(parseInt(event.target.value, 10));\n setPage(0);\n };\n\n return (\n <>\n <List dense disablePadding>\n {props.workerScripts.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage).map((ws) => (\n <WorkerScriptAccordion key={`${ws.name}_${ws.args}`} workerScript={ws} />\n ))}\n </List>\n <TablePagination\n rowsPerPageOptions={[10, 15, 20, 100]}\n component=\"div\"\n count={props.workerScripts.length}\n rowsPerPage={rowsPerPage}\n page={page}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n ActionsComponent={TablePaginationActionsAll}\n />\n </>\n );\n}\n","/**\n * React Component for displaying a single WorkerScript's info as an\n * Accordion element\n */\nimport * as React from \"react\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\n\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\n\nimport { dialogBoxCreate } from \"../React/DialogBox\";\nimport { LogBoxEvents } from \"../React/LogBoxManager\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { arrayToString } from \"../../utils/helpers/arrayToString\";\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\n\nconst useStyles = makeStyles({\n noborder: {\n borderBottom: \"none\",\n },\n});\n\ntype IProps = {\n workerScript: WorkerScript;\n};\n\nexport function WorkerScriptAccordion(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [open, setOpen] = React.useState(false);\n const workerScript = props.workerScript;\n const scriptRef = workerScript.scriptRef;\n\n function logClickHandler(): void {\n LogBoxEvents.emit(scriptRef);\n }\n const killScript = killWorkerScript.bind(null, scriptRef as any, scriptRef.server);\n\n function killScriptClickHandler(): void {\n killScript();\n dialogBoxCreate(\"Killing script\");\n }\n\n // Calculations for script stats\n const onlineMps = scriptRef.onlineMoneyMade / scriptRef.onlineRunningTime;\n const onlineEps = scriptRef.onlineExpGained / scriptRef.onlineRunningTime;\n\n return (\n <>\n <ListItemButton onClick={() => setOpen((old) => !old)} component={Paper}>\n <ListItemText primary={<Typography>└ {props.workerScript.name}</Typography>} />\n {open ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={open} timeout={0} unmountOnExit>\n <Box mx={6}>\n <Table padding=\"none\" size=\"small\">\n <TableBody>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Threads:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{numeralWrapper.formatThreads(props.workerScript.scriptRef.threads)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={2}>\n <Typography>└ Args: {arrayToString(props.workerScript.args)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.onlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Offline Time:</Typography>\n </TableCell>\n <TableCell className={classes.noborder}>\n <Typography>{convertTimeMsToTimeElapsedString(scriptRef.offlineRunningTime * 1e3)}</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total online production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.onlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.onlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Online production rate:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <MoneyRate money={onlineMps} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(onlineEps) + \" hacking exp / sec\"}</Typography>\n </TableCell>\n </TableRow>\n\n <TableRow>\n <TableCell className={classes.noborder}>\n <Typography>└ Total offline production:</Typography>\n </TableCell>\n <TableCell className={classes.noborder} align=\"left\">\n <Typography>\n <Money money={scriptRef.offlineMoneyMade} />\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell className={classes.noborder} colSpan={1} />\n <TableCell className={classes.noborder} align=\"left\">\n <Typography> {numeralWrapper.formatExp(scriptRef.offlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n\n <Button onClick={logClickHandler}>LOG</Button>\n <IconButton onClick={killScriptClickHandler}>\n <DeleteIcon color=\"error\" />\n </IconButton>\n </Box>\n </Collapse>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Factions } from \"../Factions\";\nimport { Faction } from \"../Faction\";\nimport { joinFaction } from \"../FactionHelpers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Link from \"@mui/material/Link\";\nimport Button from \"@mui/material/Button\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table, TableCell } from \"../../ui/React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function FactionsRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n function openFaction(faction: Faction): void {\n props.router.toFaction(faction);\n }\n\n function acceptInvitation(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, faction: string): void {\n if (!event.isTrusted) return;\n joinFaction(Factions[faction]);\n setRerender((x) => !x);\n }\n\n return (\n <>\n <Typography variant=\"h4\">Factions</Typography>\n <Typography>Lists all factions you have joined</Typography>\n <br />\n <Box display=\"flex\" flexDirection=\"column\">\n {props.player.factions.map((faction: string) => (\n <Link key={faction} variant=\"h6\" onClick={() => openFaction(Factions[faction])}>\n {faction}\n </Link>\n ))}\n </Box>\n <br />\n {props.player.factionInvitations.length > 0 && (\n <>\n <Typography variant=\"h5\" color=\"primary\">\n Outstanding Faction Invitations\n </Typography>\n <Typography>\n Lists factions you have been invited to. You can accept these faction invitations at any time.\n </Typography>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {props.player.factionInvitations.map((faction: string) => (\n <TableRow key={faction}>\n <TableCell>\n <Typography noWrap>{faction}</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Button onClick={(e) => acceptInvitation(e, faction)}>Join!</Button>\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </>\n )}\n </>\n );\n}\n","/**\n * Root React Component for displaying a Faction's UI.\n * This is the component for displaying a single faction's UI, not the list of all\n * accessible factions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { AugmentationsPage } from \"./AugmentationsPage\";\nimport { DonateOption } from \"./DonateOption\";\nimport { Info } from \"./Info\";\nimport { Option } from \"./Option\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\n\nimport { use } from \"../../ui/Context\";\nimport { CreateGangModal } from \"./CreateGangModal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { CovenantPurchasesRoot } from \"../../PersonObjects/Sleeve/ui/CovenantPurchasesRoot\";\n\ntype IProps = {\n faction: Faction;\n};\n\n// Info text for all options on the UI\nconst gangInfo = \"Create and manage a gang for this Faction. Gangs will earn you money and \" + \"faction reputation\";\nconst hackingContractsInfo =\n \"Complete hacking contracts for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your hacking skill. \" +\n \"You will gain hacking exp.\";\nconst fieldWorkInfo =\n \"Carry out field missions for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on all of your stats. \" +\n \"You will gain exp for all stats.\";\nconst securityWorkInfo =\n \"Serve in a security detail for your faction. \" +\n \"Your effectiveness, which determines how much \" +\n \"reputation you gain for this faction, is based on your combat stats. \" +\n \"You will gain exp for all combat stats.\";\nconst augmentationsInfo =\n \"As your reputation with this faction rises, you will \" +\n \"unlock Augmentations, which you can purchase to enhance \" +\n \"your abilities.\";\nconst sleevePurchasesInfo = \"Purchase Duplicate Sleeves and upgrades. These are permanent!\";\n\nconst GangNames = [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n];\n\ninterface IMainProps {\n faction: Faction;\n rerender: () => void;\n onAugmentations: () => void;\n}\n\nfunction MainPage({ faction, rerender, onAugmentations }: IMainProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [sleevesOpen, setSleevesOpen] = useState(false);\n const [gangOpen, setGangOpen] = useState(false);\n const p = player;\n const factionInfo = faction.getInfo();\n\n function manageGang(): void {\n // If player already has a gang, just go to the gang UI\n if (player.inGang()) {\n return router.toGang();\n }\n\n setGangOpen(true);\n }\n\n function startFieldWork(faction: Faction): void {\n player.startFactionFieldWork(router, faction);\n }\n\n function startHackingContracts(faction: Faction): void {\n player.startFactionHackWork(router, faction);\n }\n\n function startSecurityWork(faction: Faction): void {\n player.startFactionSecurityWork(router, faction);\n }\n\n // We have a special flag for whether the player this faction is the player's\n // gang faction because if the player has a gang, they cannot do any other action\n const isPlayersGang = p.inGang() && p.getGangName() === faction.name;\n\n // Flags for whether special options (gang, sleeve purchases, donate, etc.)\n // should be shown\n const favorToDonate = Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n const canDonate = faction.favor >= favorToDonate;\n\n const canPurchaseSleeves = faction.name === \"The Covenant\" && p.bitNodeN >= 10 && SourceFileFlags[10];\n\n let canAccessGang = p.canAccessGang() && GangNames.includes(faction.name);\n if (p.inGang()) {\n if (p.getGangName() !== faction.name) {\n canAccessGang = false;\n } else if (p.getGangName() === faction.name) {\n canAccessGang = true;\n }\n }\n\n return (\n <>\n <Button onClick={() => router.toFactions()}>Back</Button>\n <Typography variant=\"h4\" color=\"primary\">\n {faction.name}\n </Typography>\n <Info faction={faction} factionInfo={factionInfo} />\n {canAccessGang && (\n <>\n <Option buttonText={\"Manage Gang\"} infoText={gangInfo} onClick={manageGang} />\n <CreateGangModal facName={faction.name} open={gangOpen} onClose={() => setGangOpen(false)} />\n </>\n )}\n {!isPlayersGang && factionInfo.offerHackingWork && (\n <Option\n buttonText={\"Hacking Contracts\"}\n infoText={hackingContractsInfo}\n onClick={() => startHackingContracts(faction)}\n />\n )}\n {!isPlayersGang && factionInfo.offerFieldWork && (\n <Option buttonText={\"Field Work\"} infoText={fieldWorkInfo} onClick={() => startFieldWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offerSecurityWork && (\n <Option buttonText={\"Security Work\"} infoText={securityWorkInfo} onClick={() => startSecurityWork(faction)} />\n )}\n {!isPlayersGang && factionInfo.offersWork() && (\n <DonateOption\n faction={faction}\n p={player}\n rerender={rerender}\n favorToDonate={favorToDonate}\n disabled={!canDonate}\n />\n )}\n <Option buttonText={\"Purchase Augmentations\"} infoText={augmentationsInfo} onClick={onAugmentations} />\n {canPurchaseSleeves && (\n <>\n <Option\n buttonText={\"Purchase & Upgrade Duplicate Sleeves\"}\n infoText={sleevePurchasesInfo}\n onClick={() => setSleevesOpen(true)}\n />\n <CovenantPurchasesRoot open={sleevesOpen} onClose={() => setSleevesOpen(false)} />\n </>\n )}\n </>\n );\n}\n\nexport function FactionRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const faction = props.faction;\n\n const [purchasingAugs, setPurchasingAugs] = useState(false);\n\n return purchasingAugs ? (\n <AugmentationsPage faction={faction} routeToMainPage={() => setPurchasingAugs(false)} />\n ) : (\n <MainPage rerender={rerender} faction={faction} onAugmentations={() => setPurchasingAugs(true)} />\n );\n}\n","/**\n * Root React Component for displaying a faction's \"Purchase Augmentations\" page\n */\nimport React, { useState } from \"react\";\n\nimport { PurchaseableAugmentation } from \"./PurchaseableAugmentation\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { hasAugmentationPrereqs } from \"../FactionHelpers\";\n\nimport { use } from \"../../ui/Context\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\n\ntype IProps = {\n faction: Faction;\n routeToMainPage: () => void;\n};\n\nexport function AugmentationsPage(props: IProps): React.ReactElement {\n const player = use.Player();\n // Flag for whether the player has a gang with this faction\n const isPlayersGang = player.inGang() && player.getGangName() === props.faction.name;\n\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function getAugs(): string[] {\n if (isPlayersGang) {\n const augs: string[] = [];\n for (const augName in Augmentations) {\n const aug = Augmentations[augName];\n if (!aug.isSpecial) {\n augs.push(augName);\n }\n }\n\n return augs;\n } else {\n return props.faction.augmentations.slice();\n }\n }\n\n function getAugsSorted(): string[] {\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost: {\n return getAugsSortedByCost();\n }\n case PurchaseAugmentationsOrderSetting.Reputation: {\n return getAugsSortedByReputation();\n }\n case PurchaseAugmentationsOrderSetting.Purchasable: {\n return getAugsSortedByPurchasable();\n }\n default:\n return getAugsSortedByDefault();\n }\n }\n\n function getAugsSortedByCost(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.baseCost - aug2.baseCost;\n });\n\n return augs;\n }\n\n function getAugsSortedByPurchasable(): string[] {\n const augs = getAugs();\n function canBuy(augName: string): boolean {\n const aug = Augmentations[augName];\n const repCost = aug.baseRepRequirement * props.faction.getInfo().augmentationRepRequirementMult;\n const hasReq = props.faction.playerReputation >= repCost;\n const hasRep = hasAugmentationPrereqs(aug);\n const hasCost =\n aug.baseCost !== 0 && player.money.gt(aug.baseCost * props.faction.getInfo().augmentationPriceMult);\n return hasCost && hasReq && hasRep;\n }\n const buy = augs.filter(canBuy).sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n\n return aug1.baseCost - aug2.baseCost;\n });\n const cantBuy = augs\n .filter((aug) => !canBuy(aug))\n .sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.baseRepRequirement - aug2.baseRepRequirement;\n });\n\n return buy.concat(cantBuy);\n }\n\n function getAugsSortedByReputation(): string[] {\n const augs = getAugs();\n augs.sort((augName1, augName2) => {\n const aug1 = Augmentations[augName1],\n aug2 = Augmentations[augName2];\n if (aug1 == null || aug2 == null) {\n throw new Error(\"Invalid Augmentation Names\");\n }\n return aug1.baseRepRequirement - aug2.baseRepRequirement;\n });\n\n return augs;\n }\n\n function getAugsSortedByDefault(): string[] {\n return getAugs();\n }\n\n function switchSortOrder(newOrder: PurchaseAugmentationsOrderSetting): void {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n }\n\n const augs = getAugsSorted();\n const purchasable = augs.filter(\n (aug: string) =>\n aug === AugmentationNames.NeuroFluxGovernor ||\n (!player.augmentations.some((a) => a.name === aug) && !player.queuedAugmentations.some((a) => a.name === aug)),\n );\n\n const purchaseableAugmentation = (aug: string, owned = false): React.ReactNode => {\n return (\n <PurchaseableAugmentation\n augName={aug}\n faction={props.faction}\n key={aug}\n p={player}\n rerender={rerender}\n owned={owned}\n />\n );\n };\n\n const augListElems = purchasable.map((aug) => purchaseableAugmentation(aug));\n\n let ownedElem = <></>;\n const owned = augs.filter((aug: string) => !purchasable.includes(aug));\n if (owned.length !== 0) {\n ownedElem = (\n <>\n <br />\n <Typography variant=\"h4\">Purchased Augmentations</Typography>\n <Typography>This factions also offers these augmentations but you already own them.</Typography>\n {owned.map((aug) => purchaseableAugmentation(aug, true))}\n </>\n );\n }\n\n return (\n <>\n <Button onClick={props.routeToMainPage}>Back</Button>\n <Typography variant=\"h4\">Faction Augmentations</Typography>\n <Typography>\n These are all of the Augmentations that are available to purchase from {props.faction.name}. Augmentations are\n powerful upgrades that will enhance your abilities.\n <br />\n Reputation: <Reputation reputation={props.faction.playerReputation} /> Favor:{\" \"}\n <Favor favor={props.faction.favor} />\n </Typography>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>Sort by Reputation</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Default)}>Sort by Default Order</Button>\n <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Purchasable)}>\n Sort by Purchasable\n </Button>\n <br />\n\n <Table size=\"small\" padding=\"none\">\n <TableBody>{augListElems}</TableBody>\n </Table>\n\n <Table size=\"small\" padding=\"none\">\n <TableBody>{ownedElem}</TableBody>\n </Table>\n </>\n );\n}\n","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport React, { useState } from \"react\";\n\nimport { getNextNeurofluxLevel, hasAugmentationPrereqs, purchaseAugmentation } from \"../FactionHelpers\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\n\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nimport { Augmentation as AugFormat } from \"../../ui/React/Augmentation\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\ninterface IReqProps {\n augName: string;\n p: IPlayer;\n hasReq: boolean;\n rep: number;\n hasRep: boolean;\n cost: number;\n hasCost: boolean;\n}\n\nfunction Requirements(props: IReqProps): React.ReactElement {\n const aug = Augmentations[props.augName];\n if (!props.hasReq) {\n return (\n <TableCell key={1} colSpan={2}>\n <Typography color=\"error\">\n Requires{\" \"}\n {aug.prereqs.map((aug, i) => (\n <AugFormat key={i} name={aug} />\n ))}\n </Typography>\n </TableCell>\n );\n }\n\n return (\n <React.Fragment key=\"f\">\n <TableCell key={1}>\n <Typography>\n <Money money={props.cost} player={props.p} />\n </Typography>\n </TableCell>\n <TableCell key={2}>\n <Typography color={props.hasRep ? \"primary\" : \"error\"}>\n Requires <Reputation reputation={props.rep} /> faction reputation\n </Typography>\n </TableCell>\n </React.Fragment>\n );\n}\n\ninterface IProps {\n augName: string;\n faction: Faction;\n p: IPlayer;\n rerender: () => void;\n owned?: boolean;\n}\n\nexport function PurchaseableAugmentation(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const aug = Augmentations[props.augName];\n if (aug == null) throw new Error(`aug ${props.augName} does not exists`);\n\n if (aug == null) {\n console.error(\n `Invalid Augmentation when trying to create PurchaseableAugmentation display element: ${props.augName}`,\n );\n return <></>;\n }\n\n const moneyCost = aug.baseCost * props.faction.getInfo().augmentationPriceMult;\n const repCost = aug.baseRepRequirement * props.faction.getInfo().augmentationRepRequirementMult;\n const hasReq = hasAugmentationPrereqs(aug);\n const hasRep = props.faction.playerReputation >= repCost;\n const hasCost = aug.baseCost === 0 || props.p.money.gt(aug.baseCost * props.faction.getInfo().augmentationPriceMult);\n\n // Determine UI properties\n const color: \"error\" | \"primary\" = !hasReq || !hasRep || !hasCost ? \"error\" : \"primary\";\n\n // Determine button txt\n let btnTxt = aug.name;\n if (aug.name === AugmentationNames.NeuroFluxGovernor) {\n btnTxt += ` - Level ${getNextNeurofluxLevel()}`;\n }\n\n let tooltip = <></>;\n if (typeof aug.info === \"string\") {\n tooltip = (\n <>\n <span>{aug.info}</span>\n <br />\n <br />\n {aug.stats}\n </>\n );\n } else\n tooltip = (\n <>\n {aug.info}\n <br />\n <br />\n {aug.stats}\n </>\n );\n\n function handleClick(): void {\n if (color === \"error\") return;\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setOpen(true);\n } else {\n purchaseAugmentation(aug, props.faction);\n props.rerender();\n }\n }\n\n return (\n <TableRow>\n {!props.owned && (\n <TableCell key={0}>\n <Button onClick={handleClick} color={color}>\n Buy\n </Button>\n <PurchaseAugmentationModal\n open={open}\n onClose={() => setOpen(false)}\n aug={aug}\n faction={props.faction}\n rerender={props.rerender}\n />\n </TableCell>\n )}\n <TableCell key={1}>\n <Box display=\"flex\">\n <Tooltip title={<Typography>{tooltip}</Typography>} placement=\"top\">\n <Typography>{btnTxt}</Typography>\n </Tooltip>\n </Box>\n </TableCell>\n {!props.owned && (\n <Requirements\n key={2}\n augName={props.augName}\n p={props.p}\n cost={moneyCost}\n rep={repCost}\n hasReq={hasReq}\n hasRep={hasRep}\n hasCost={hasCost}\n />\n )}\n </TableRow>\n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { Faction } from \"../Faction\";\nimport { purchaseAugmentation } from \"../FactionHelpers\";\nimport { isRepeatableAug } from \"../../Augmentation/AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n faction: Faction;\n aug: Augmentation;\n rerender: () => void;\n}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factionInfo = props.faction.getInfo();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug) && player.hasAugmentation(props.aug)) {\n return;\n }\n\n purchaseAugmentation(props.aug, props.faction);\n props.rerender();\n props.onClose();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">{props.aug.name}</Typography>\n <Typography>\n {props.aug.info}\n <br />\n <br />\n {props.aug.stats}\n <br />\n <br />\n Would you like to purchase the {props.aug.name} Augmentation for \n <Money money={props.aug.baseCost * factionInfo.augmentationPriceMult} />?\n <br />\n <br />\n </Typography>\n <Button autoFocus onClick={buy}>\n Purchase\n </Button>\n </Modal>\n );\n}\n","import * as React from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n aug: {\n color: theme.colors.combat,\n },\n }),\n);\n\nexport function Augmentation({ name }: { name: string }): JSX.Element {\n const classes = useStyles();\n return <span className={classes.aug}>{name}</span>;\n}\n","/**\n * React component for a donate option on the Faction UI\n */\nimport React, { useState } from \"react\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { repFromDonation } from \"../formulas/donation\";\nimport { Favor } from \"../../ui/React/Favor\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { MathComponent } from \"mathjax-react\";\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.lt(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);\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.lt(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, width: \"100%\" }}>\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 <MathComponent\n tex={String.raw`reputation = \\frac{\\text{donation amount} \\times \\text{reputation multiplier}}{10^{${digits}}}`}\n />\n </Typography>\n </>\n )}\n </Paper>\n );\n}\n","/**\n * React component for general information about the faction. This includes the\n * factions \"motto\", reputation, favor, and gameplay instructions\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { Faction } from \"../../Faction/Faction\";\nimport { FactionInfo } from \"../../Faction/FactionInfo\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { MathComponent } from \"mathjax-react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n faction: Faction;\n factionInfo: FactionInfo;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n noformat: {\n whiteSpace: \"pre-wrap\",\n lineHeight: \"1em\",\n },\n }),\n);\n\nexport function Info(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const classes = useStyles();\n\n const favorGain = props.faction.getFavorGain()[0];\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={props.faction.favor + favorGain} /> faction favor after installing an\n Augmentation.\n </Typography>\n <MathComponent tex={String.raw`\\large{r = \\text{total faction reputation}}`} />\n <MathComponent\n tex={String.raw`\\large{favor=\\left\\lfloor\\log_{1.02}\\left(\\frac{r+25000}{25500}\\right)\\right\\rfloor}`}\n />\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 <MathComponent tex={String.raw`\\large{r = reputation}`} />\n <MathComponent tex={String.raw`\\large{\\Delta r = \\Delta r \\times \\frac{100+favor}{100}}`} />\n </>\n }\n >\n <Typography>\n Faction Favor: <Favor favor={props.faction.favor} />\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>-------------------------</Typography>\n <Typography>\n Perform work/carry out assignments for your faction to help further its cause! By doing so you will earn\n reputation for your faction. You will also gain reputation passively over time, although at a very slow rate.\n Earning reputation will allow you to purchase Augmentations through this faction, which are powerful upgrades\n that enhance your abilities.\n </Typography>\n </>\n );\n}\n","/**\n * React Component for the popup used to create a new gang.\n */\nimport React from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n facName: string;\n}\n\nexport function CreateGangModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const combatGangText =\n \"This is a COMBAT gang. Members in this gang will have different tasks than HACKING gangs. \" +\n \"Compared to hacking gangs, progression with combat gangs can be more difficult as territory management \" +\n \"is more important. However, well-managed combat gangs can progress faster than hacking ones.\";\n\n const hackingGangText =\n \"This is a HACKING gang. Members in this gang will have different tasks than COMBAT gangs. \" +\n \"Compared to combat gangs, progression with hacking gangs is more straightforward as territory warfare \" +\n \"is not as important.\";\n\n function isHacking(): boolean {\n return [\"NiteSec\", \"The Black Hand\"].includes(props.facName);\n }\n\n function createGang(): void {\n player.startGang(props.facName, isHacking());\n props.onClose();\n router.toGang();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.keyCode === 13) createGang();\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>\n Would you like to create a new Gang with {props.facName}?\n <br />\n <br />\n Note that this will prevent you from creating a Gang with any other Faction until this BitNode is destroyed. It\n also resets your reputation with this faction.\n <br />\n <br />\n {isHacking() ? hackingGangText : combatGangText}\n <br />\n <br />\n Other than hacking vs combat, there are NO differences between the Factions you can create a Gang with, and each\n of these Factions have all Augmentations available.\n </Typography>\n <Button onClick={createGang} onKeyUp={onKeyUp} autoFocus>\n Create Gang\n </Button>\n </Modal>\n );\n}\n","/**\n * Root React component for the popup that lets player purchase Duplicate\n * Sleeves and Sleeve-related upgrades from The Covenant\n */\nimport React, { useState } from \"react\";\n\nimport { CovenantSleeveMemoryUpgrade } from \"./CovenantSleeveMemoryUpgrade\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { BaseCostPerSleeve, MaxSleevesFromCovenant } from \"../SleeveCovenantPurchases\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CovenantPurchasesRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const [update, setUpdate] = useState(0);\n\n /**\n * Get the cost to purchase a new Duplicate Sleeve\n */\n function purchaseCost(): number {\n return (player.sleevesFromCovenant + 1) * 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());\n player.sleevesFromCovenant += 1;\n player.sleeves.push(new Sleeve(player));\n rerender();\n } else {\n dialogBoxCreate(`You cannot afford to purchase a Duplicate Sleeve`);\n }\n }\n\n // Purchasing Upgrades for Sleeves\n const upgradePanels = [];\n for (let i = 0; i < player.sleeves.length; ++i) {\n const sleeve = player.sleeves[i];\n upgradePanels.push(<CovenantSleeveMemoryUpgrade index={i} p={player} rerender={rerender} sleeve={sleeve} />);\n }\n\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <>\n {player.sleevesFromCovenant < MaxSleevesFromCovenant && (\n <>\n <Typography>\n Purchase an additional Sleeves. These Duplicate Sleeves are permanent (they persist through BitNodes). You\n can purchase a total of {MaxSleevesFromCovenant} from The Covenant.\n </Typography>\n <Button disabled={purchaseDisabled} onClick={purchaseOnClick}>\n Purchase - \n <Money money={purchaseCost()} player={player} />\n </Button>\n </>\n )}\n <br />\n <br />\n <Typography>You can also purchase upgrades for your Sleeves. These upgrades are also permanent.</Typography>\n {upgradePanels}\n </>\n </Modal>\n );\n}\n","/**\n * React component for a panel that lets you purchase upgrades for a Duplicate\n * Sleeve's Memory (through The Covenant)\n */\nimport React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n index: number;\n p: IPlayer;\n rerender: () => void;\n sleeve: Sleeve;\n}\n\nexport function CovenantSleeveMemoryUpgrade(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState(1);\n\n function changePurchaseAmount(e: React.ChangeEvent<HTMLInputElement>): void {\n let n: number = parseInt(e.target.value);\n\n if (isNaN(n)) n = 1;\n 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);\n props.rerender();\n }\n }\n\n // Purchase button props\n const cost = getPurchaseCost();\n const purchaseBtnDisabled = !props.p.canAfford(cost);\n let purchaseBtnContent = <></>;\n if (isNaN(amt)) {\n purchaseBtnContent = <>Invalid value</>;\n } else {\n purchaseBtnContent = (\n <>\n Purchase {amt} memory - \n <Money money={cost} player={props.p} />\n </>\n );\n }\n\n return (\n <Paper sx={{ my: 1, p: 1 }}>\n <Typography variant=\"h6\" color=\"primary\">\n Upgrade Memory of Sleeve {props.index}\n </Typography>\n <Typography>\n Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:{\" \"}\n {numeralWrapper.formatSleeveMemory(props.sleeve.memory)})\n </Typography>\n\n <Box display=\"flex\" flexDirection=\"row\" alignItems=\"center\">\n <Typography>Amount of memory to purchase (must be an integer): </Typography>\n <TextField onChange={changePurchaseAmount} type={\"number\"} value={amt} />\n </Box>\n <br />\n <Button disabled={purchaseBtnDisabled} onClick={purchaseMemory}>\n {purchaseBtnContent}\n </Button>\n </Paper>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\nimport { getPurchaseServerLimit } from \"../Server/ServerPurchases\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { StatsTable } from \"./React/StatsTable\";\nimport { Money } from \"./React/Money\";\nimport { use } from \"./Context\";\nimport { MoneySourceTracker } from \"../utils/MoneySourceTracker\";\nimport { BitNodes } from \"../BitNode/BitNode\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport MoreHorizIcon from \"@mui/icons-material/MoreHoriz\";\nimport { Modal } from \"./React/Modal\";\n\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table, TableCell } from \"./React/Table\";\nimport TableRow from \"@mui/material/TableRow\";\n\nfunction LastEmployer(): React.ReactElement {\n const player = use.Player();\n if (player.companyName) {\n return <Typography>Employer at which you last worked: {player.companyName}</Typography>;\n }\n return <></>;\n}\n\nfunction LastJob(): React.ReactElement {\n const player = use.Player();\n if (player.companyName !== \"\") {\n return <Typography>Job you last worked: {player.jobs[player.companyName]}</Typography>;\n }\n return <></>;\n}\n\nfunction Employers(): React.ReactElement {\n const player = use.Player();\n if (player.jobs && Object.keys(player.jobs).length !== 0)\n return (\n <>\n <Typography>All Employers:</Typography>\n\n <ul>\n {Object.keys(player.jobs).map((j) => (\n <Typography key={j}> * {j}</Typography>\n ))}\n </ul>\n </>\n );\n return <></>;\n}\n\nfunction Hacknet(): React.ReactElement {\n const player = use.Player();\n // Can't import HacknetHelpers for some reason.\n if (!(player.bitNodeN === 9 || SourceFileFlags[9] > 0)) {\n return (\n <>\n <Typography>{`Hacknet Nodes owned: ${player.hacknetNodes.length}`}</Typography>\n <br />\n </>\n );\n } else {\n return (\n <>\n <Typography>{`Hacknet Servers owned: ${player.hacknetNodes.length} / ${HacknetServerConstants.MaxServers}`}</Typography>\n <br />\n </>\n );\n }\n}\n\nfunction Intelligence(): React.ReactElement {\n const player = use.Player();\n if (player.intelligence > 0 && (player.bitNodeN === 5 || SourceFileFlags[5] > 0)) {\n return (\n <TableRow>\n <TableCell>\n <Typography>Intelligence: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.formatSkill(player.intelligence)} </Typography>\n </TableCell>\n </TableRow>\n );\n }\n return <></>;\n}\n\nfunction MultiplierTable(props: any): React.ReactElement {\n function bn5Stat(r: any): JSX.Element {\n if (SourceFileFlags[5] > 0 && r.length > 2 && r[1] != r[2]) {\n return (\n <TableCell key=\"2\" align=\"right\">\n <Typography noWrap>({numeralWrapper.formatPercentage(r[2])})</Typography>\n </TableCell>\n );\n }\n return <></>;\n }\n return (\n <>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n {props.rows.map((r: any) => (\n <TableRow key={r[0]}>\n <TableCell key=\"0\">\n <Typography noWrap>{`${r[0]} multiplier:`} </Typography>\n </TableCell>\n <TableCell key=\"1\" align=\"right\">\n <Typography noWrap>{numeralWrapper.formatPercentage(r[1])}</Typography>\n </TableCell>\n {bn5Stat(r)}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </>\n );\n}\n\nfunction BladeburnerMults(): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessBladeburner()) return <></>;\n return (\n <MultiplierTable\n rows={[\n [\"Bladeburner Success Chance\", player.bladeburner_max_stamina_mult],\n [\"Bladeburner Max Stamina\", player.bladeburner_stamina_gain_mult],\n [\"Bladeburner Stamina Gain\", player.bladeburner_analysis_mult],\n [\"Bladeburner Field Analysis\", player.bladeburner_success_chance_mult],\n ]}\n />\n );\n}\n\nfunction CurrentBitNode(): React.ReactElement {\n const player = use.Player();\n if (player.sourceFiles.length > 0) {\n const index = \"BitNode\" + player.bitNodeN;\n return (\n <>\n <Typography variant=\"h4\">\n BitNode {player.bitNodeN}: {BitNodes[index].name}\n </Typography>\n <Typography sx={{ mx: 2 }} style={{ whiteSpace: \"pre-wrap\", overflowWrap: \"break-word\" }}>\n {BitNodes[index].info}\n </Typography>\n </>\n );\n }\n\n return <></>;\n}\n\ninterface IMoneyModalProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction MoneyModal({ open, onClose }: IMoneyModalProps): React.ReactElement {\n const player = use.Player();\n function convertMoneySourceTrackerToString(src: MoneySourceTracker): React.ReactElement {\n const parts: any[][] = [[`Total:`, <Money money={src.total} />]];\n if (src.bladeburner) {\n parts.push([`Bladeburner:`, <Money money={src.bladeburner} />]);\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.hacknetnode) {\n parts.push([`Hacknet Nodes:`, <Money money={src.hacknetnode} />]);\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.stock) {\n parts.push([`Stock Market:`, <Money money={src.stock} />]);\n }\n if (src.casino) {\n parts.push([`Casino:`, <Money money={src.casino} />]);\n }\n if (src.sleeves) {\n parts.push([`Sleeves:`, <Money money={src.sleeves} />]);\n }\n\n return <StatsTable rows={parts} wide />;\n }\n\n let content = (\n <>\n <Typography variant=\"h6\" color=\"primary\">\n Money earned since you last installed Augmentations\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(player.moneySourceA)}\n </>\n );\n if (player.sourceFiles.length !== 0) {\n content = (\n <>\n {content}\n <br />\n <br />\n <Typography variant=\"h6\" color=\"primary\">\n Money earned in this BitNode\n </Typography>\n <br />\n {convertMoneySourceTrackerToString(player.moneySourceB)}\n </>\n );\n }\n\n return (\n <Modal open={open} onClose={onClose}>\n {content}\n </Modal>\n );\n}\n\nexport function CharacterStats(): React.ReactElement {\n const player = use.Player();\n const [moneyOpen, setMoneyOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const timeRows = [\n [\"Time played since last Augmentation:\", convertTimeMsToTimeElapsedString(player.playtimeSinceLastAug)],\n ];\n if (player.sourceFiles.length > 0) {\n timeRows.push([\n \"Time played since last Bitnode destroyed:\",\n convertTimeMsToTimeElapsedString(player.playtimeSinceLastBitnode),\n ]);\n }\n timeRows.push([\"Total Time played:\", convertTimeMsToTimeElapsedString(player.totalPlaytime)]);\n\n return (\n <>\n <Typography variant=\"h4\">General</Typography>\n <Box sx={{ mx: 2 }}>\n <Typography>Current City: {player.city}</Typography>\n <LastEmployer />\n <LastJob />\n <Employers />\n\n <Typography>\n Money: <Money money={player.money.toNumber()} />\n <IconButton onClick={() => setMoneyOpen(true)}>\n <MoreHorizIcon color=\"info\" />\n </IconButton>\n </Typography>\n </Box>\n <br />\n <Typography variant=\"h4\">Stats</Typography>\n <Box sx={{ mx: 2 }}>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography noWrap>Hacking: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.hacking_skill)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.hacking_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Strength: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.strength)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.strength_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Defense: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.defense)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.defense_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Dexterity: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.dexterity)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.dexterity_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Agility: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.agility)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.agility_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell>\n <Typography noWrap>Charisma: </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.charisma)} </Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>({numeralWrapper.formatExp(player.charisma_exp)} exp)</Typography>\n </TableCell>\n </TableRow>\n <Intelligence />\n </TableBody>\n </Table>\n <br />\n </Box>\n <br />\n <Typography variant=\"h4\">Multipliers</Typography>\n <Box sx={{ mx: 2 }}>\n <MultiplierTable\n rows={[\n [\"Hacking Chance\", player.hacking_chance_mult],\n [\"Hacking Speed\", player.hacking_speed_mult],\n [\n \"Hacking Money\",\n player.hacking_money_mult,\n player.hacking_money_mult * BitNodeMultipliers.ScriptHackMoney,\n ],\n [\n \"Hacking Growth\",\n player.hacking_grow_mult,\n player.hacking_grow_mult * BitNodeMultipliers.ServerGrowthRate,\n ],\n ]}\n />\n <br />\n <MultiplierTable\n rows={[\n [\"Hacking Level\", player.hacking_mult, player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier],\n [\"Hacking Experience\", player.hacking_exp_mult, player.hacking_exp_mult * BitNodeMultipliers.HackExpGain],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Strength Level\", player.strength_mult, player.strength_mult * BitNodeMultipliers.StrengthLevelMultiplier],\n [\"Strength Experience\", player.strength_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Defense Level\", player.defense_mult, player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier],\n [\"Defense Experience\", player.defense_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Dexterity Level\",\n player.dexterity_mult,\n player.dexterity_mult * BitNodeMultipliers.DexterityLevelMultiplier,\n ],\n [\"Dexterity Experience\", player.dexterity_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Agility Level\", player.agility_mult, player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier],\n [\"Agility Experience\", player.agility_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Charisma Level\", player.charisma_mult, player.charisma_mult * BitNodeMultipliers.CharismaLevelMultiplier],\n [\"Charisma Experience\", player.charisma_exp_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\n \"Hacknet Node production\",\n player.hacknet_node_money_mult,\n player.hacknet_node_money_mult * BitNodeMultipliers.HacknetNodeMoney,\n ],\n [\"Hacknet Node purchase cost\", player.hacknet_node_purchase_cost_mult],\n [\"Hacknet Node RAM upgrade cost\", player.hacknet_node_ram_cost_mult],\n [\"Hacknet Node Core purchase cost\", player.hacknet_node_core_cost_mult],\n [\"Hacknet Node level upgrade cost\", player.hacknet_node_level_cost_mult],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Company reputation gain\", player.company_rep_mult],\n [\n \"Faction reputation gain\",\n player.faction_rep_mult,\n player.faction_rep_mult * BitNodeMultipliers.FactionWorkRepGain,\n ],\n [\"Salary\", player.work_money_mult, player.work_money_mult * BitNodeMultipliers.CompanyWorkMoney],\n ]}\n />\n <br />\n\n <MultiplierTable\n rows={[\n [\"Crime success\", player.crime_success_mult],\n [\"Crime money\", player.crime_money_mult, player.crime_money_mult * BitNodeMultipliers.CrimeMoney],\n ]}\n />\n <br />\n <BladeburnerMults />\n </Box>\n <br />\n\n <Typography variant=\"h4\">Misc</Typography>\n <Box sx={{ mx: 2 }}>\n <Typography>{`Servers owned: ${player.purchasedServers.length} / ${getPurchaseServerLimit()}`}</Typography>\n <Hacknet />\n <Typography>{`Augmentations installed: ${player.augmentations.length}`}</Typography>\n <StatsTable rows={timeRows} />\n </Box>\n <br />\n <CurrentBitNode />\n <MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} />\n </>\n );\n}\n","/**\n * Root React component for the Stock Market UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InfoAndPurchases } from \"./InfoAndPurchases\";\nimport { StockTickers } from \"./StockTickers\";\n\nimport { IStockMarket } from \"../IStockMarket\";\nimport { Stock } from \"../Stock\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\n\ntype txFn = (stock: Stock, shares: number) => boolean;\nexport type placeOrderFn = (\n stock: Stock,\n shares: number,\n price: number,\n ordType: OrderTypes,\n posType: PositionTypes,\n) => boolean;\n\ntype IProps = {\n buyStockLong: txFn;\n buyStockShort: txFn;\n cancelOrder: (params: any) => void;\n eventEmitterForReset?: EventEmitter<[]>;\n initStockMarket: () => void;\n p: IPlayer;\n placeOrder: placeOrderFn;\n sellStockLong: txFn;\n sellStockShort: txFn;\n stockMarket: IStockMarket;\n};\n\nexport function StockMarketRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n return (\n <>\n <InfoAndPurchases initStockMarket={props.initStockMarket} p={props.p} rerender={rerender} />\n {props.p.hasWseAccount && (\n <StockTickers\n buyStockLong={props.buyStockLong}\n buyStockShort={props.buyStockShort}\n cancelOrder={props.cancelOrder}\n eventEmitterForReset={props.eventEmitterForReset}\n p={props.p}\n placeOrder={props.placeOrder}\n sellStockLong={props.sellStockLong}\n sellStockShort={props.sellStockShort}\n stockMarket={props.stockMarket}\n />\n )}\n </>\n );\n}\n","/**\n * React component for the Stock Market UI. This component displays\n * general information about the stock market, buttons for the various purchases,\n * and a link to the documentation (Investopedia)\n */\nimport React, { useState } from \"react\";\n\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"../StockMarketCosts\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport CheckIcon from \"@mui/icons-material/Check\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ntype IProps = {\n initStockMarket: () => void;\n p: IPlayer;\n rerender: () => void;\n};\n\nfunction Purchase4SMarketDataTixApiAccessButton(props: IProps): React.ReactElement {\n function purchase4SMarketDataTixApiAccess(): void {\n if (props.p.has4SDataTixApi) {\n return;\n }\n if (!props.p.canAfford(getStockMarket4STixApiCost())) {\n return;\n }\n props.p.has4SDataTixApi = true;\n props.p.loseMoney(getStockMarket4STixApiCost());\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);\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);\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());\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 Investopedia\n </Link>\n <br />\n <PurchaseWseAccountButton {...props} />\n\n <Typography variant=\"h5\" color=\"primary\">\n Trade Information eXchange (TIX) API\n </Typography>\n <Typography>\n TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access to\n the TIX API lets you write code to create your own algorithmic/automated trading strategies.\n </Typography>\n <PurchaseTixApiAccessButton {...props} />\n <Typography variant=\"h5\" color=\"primary\">\n Four Sigma (4S) Market Data Feed\n </Typography>\n <Typography>\n Four Sigma's (4S) Market Data Feed provides information about stocks that will help your trading strategies.\n <IconButton onClick={() => setHelpOpen(true)}>\n <HelpIcon />\n </IconButton>\n </Typography>\n <Purchase4SMarketDataTixApiAccessButton {...props} />\n <Purchase4SMarketDataButton {...props} />\n <Typography>\n Commission Fees: Every transaction you make has a{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} player={props.p} /> commission fee.\n </Typography>\n <br />\n <Typography>\n WARNING: When you reset after installing Augmentations, the Stock Market is reset. You will retain your WSE\n Account, access to the TIX API, and 4S Market Data access. However, all of your stock positions are lost, so\n make sure to sell your stocks before installing Augmentations!\n </Typography>\n <StaticModal open={helpOpen} onClose={() => setHelpOpen(false)}>\n <Typography>\n Access to the 4S Market Data feed will display two additional pieces of information about each stock: Price\n Forecast & Volatility\n <br />\n <br />\n Price Forecast indicates the probability the stock has of increasing or decreasing. A '+' forecast means the\n stock has a higher chance of increasing than decreasing, and a '-' means the opposite. The number of '+/-'\n symbols is used to illustrate the magnitude of these probabilities. For example, '+++' means that the stock\n has a significantly higher chance of increasing than decreasing, while '+' means that the stock only has a\n slightly higher chance of increasing than decreasing.\n <br />\n <br />\n Volatility represents the maximum percentage by which a stock's price can change every tick (a tick occurs\n every few seconds while the game is running).\n <br />\n <br />A stock's price forecast can change over time. This is also affected by volatility. The more volatile a\n stock is, the more its price forecast will change.\n </Typography>\n </StaticModal>\n </>\n );\n}\n","/**\n * React Component for the Stock Market UI. This is the container for all\n * of the stock tickers. It also contains the configuration for the\n * stock ticker UI (watchlist filter, portfolio vs all mode, etc.)\n */\nimport React, { useState } from \"react\";\n\nimport { StockTicker } from \"./StockTicker\";\nimport { StockTickersConfig, TickerDisplayMode } from \"./StockTickersConfig\";\n\nimport { IStockMarket } from \"../IStockMarket\";\nimport { Stock } from \"../Stock\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\n\nexport type txFn = (stock: Stock, shares: number) => boolean;\nexport type 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 in props.stockMarket) {\n const val = props.stockMarket[stockMarketProp];\n if (val instanceof Stock) {\n // Skip if there's a filter and the stock isnt in that filter\n if (watchlistSymbols.length > 0 && !watchlistSymbols.includes(val.symbol)) {\n continue;\n }\n\n let orders = props.stockMarket.Orders[val.symbol];\n if (orders == null) {\n orders = [];\n }\n\n // Skip if we're in portfolio mode and the player doesnt own this or have any active orders\n if (tickerDisplayMode === TickerDisplayMode.Portfolio) {\n if (val.playerShares === 0 && val.playerShortShares === 0 && orders.length === 0) {\n continue;\n }\n }\n\n tickers.push(\n <StockTicker\n buyStockLong={props.buyStockLong}\n buyStockShort={props.buyStockShort}\n cancelOrder={props.cancelOrder}\n key={val.symbol}\n orders={orders}\n p={props.p}\n placeOrder={props.placeOrder}\n rerenderAllTickers={rerender}\n sellStockLong={props.sellStockLong}\n sellStockShort={props.sellStockShort}\n stock={val}\n />,\n );\n }\n }\n\n return (\n <>\n <StockTickersConfig\n changeDisplayMode={changeDisplayMode}\n changeWatchlistFilter={changeWatchlistFilter}\n tickerDisplayMode={tickerDisplayMode}\n />\n\n {tickers}\n </>\n );\n}\n","/**\n * React Component for a single stock ticker in the Stock Market UI\n */\nimport React, { useState } from \"react\";\n\nimport { StockTickerHeaderText } from \"./StockTickerHeaderText\";\nimport { StockTickerOrderList } from \"./StockTickerOrderList\";\nimport { StockTickerPositionText } from \"./StockTickerPositionText\";\nimport { StockTickerTxButton } from \"./StockTickerTxButton\";\nimport { PlaceOrderModal } from \"./PlaceOrderModal\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\nimport { getBuyTransactionCost, getSellTransactionGain, calculateBuyMaxAmount } from \"../StockMarketHelpers\";\nimport { OrderTypes } from \"../data/OrderTypes\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport Box from \"@mui/material/Box\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport ListItemButton from \"@mui/material/ListItemButton\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\n\nenum SelectorOrderType {\n Market = \"Market Order\",\n Limit = \"Limit Order\",\n Stop = \"Stop Order\",\n}\n\nexport type txFn = (stock: Stock, shares: number) => boolean;\nexport type placeOrderFn = (\n stock: Stock,\n shares: number,\n price: number,\n ordType: OrderTypes,\n posType: PositionTypes,\n) => boolean;\n\ntype IProps = {\n buyStockLong: txFn;\n buyStockShort: txFn;\n cancelOrder: (params: any) => void;\n orders: Order[];\n p: IPlayer;\n placeOrder: placeOrderFn;\n rerenderAllTickers: () => void;\n sellStockLong: txFn;\n sellStockShort: txFn;\n stock: Stock;\n};\n\nexport function StockTicker(props: IProps): React.ReactElement {\n const [orderType, setOrderType] = useState(SelectorOrderType.Market);\n const [position, setPosition] = useState(PositionTypes.Long);\n const [qty, setQty] = useState(\"\");\n const [open, setOpen] = useState(false);\n const [tickerOpen, setTicketOpen] = useState(false);\n\n const [modalProps, setModalProps] = useState<{\n text: string;\n placeText: string;\n place: (n: number) => boolean;\n }>({\n text: \"\",\n placeText: \"\",\n place: () => false,\n });\n\n function getBuyTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n const cost = getBuyTransactionCost(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Purchasing {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}\n ) will cost <Money money={cost} />.\n </>\n );\n }\n\n function getQuantity(): number {\n return Math.round(parseFloat(qty));\n }\n\n function getSellTransactionCostContent(): JSX.Element | null {\n const stock = props.stock;\n const qty: number = getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n if (position === PositionTypes.Long) {\n if (qty > stock.playerShares) {\n return <>You do not have this many shares in the Long position</>;\n }\n } else {\n if (qty > stock.playerShortShares) {\n return <>You do not have this many shares in the Short position</>;\n }\n }\n\n const cost = getSellTransactionGain(stock, qty, position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Selling {numeralWrapper.formatShares(qty)} shares ({position === PositionTypes.Long ? \"Long\" : \"Short\"}) will\n result in a gain of <Money money={cost} />.\n </>\n );\n }\n\n function handleBuyButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.buyStockShort(props.stock, shares);\n } else {\n props.buyStockLong(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Buy Limit Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.LimitBuy, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Buy Stop Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.StopBuy, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleBuyMaxButtonClick(): void {\n const playerMoney: number = props.p.money.toNumber();\n\n const stock = props.stock;\n let maxShares = calculateBuyMaxAmount(stock, position, playerMoney);\n maxShares = Math.min(maxShares, Math.round(stock.maxShares - stock.playerShares - stock.playerShortShares));\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.buyStockShort(stock, maxShares);\n } else {\n props.buyStockLong(stock, maxShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Buy Max' only works for Market Orders`);\n break;\n }\n }\n }\n\n function handleOrderTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n // The select value returns a string. Afaik TypeScript doesnt make it easy\n // to convert that string back to an enum type so we'll just do this for now\n switch (val) {\n case SelectorOrderType.Limit:\n setOrderType(SelectorOrderType.Limit);\n break;\n case SelectorOrderType.Stop:\n setOrderType(SelectorOrderType.Stop);\n break;\n case SelectorOrderType.Market:\n default:\n setOrderType(SelectorOrderType.Market);\n }\n }\n\n function handlePositionTypeChange(e: SelectChangeEvent<string>): void {\n const val = e.target.value;\n\n if (val === PositionTypes.Short) {\n setPosition(PositionTypes.Short);\n } else {\n setPosition(PositionTypes.Long);\n }\n }\n\n function handleQuantityChange(e: React.ChangeEvent<HTMLInputElement>): void {\n setQty(e.target.value);\n }\n\n function handleSellButtonClick(): void {\n const shares = getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${qty}`);\n return;\n }\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.sellStockShort(props.stock, shares);\n } else {\n props.sellStockLong(props.stock, shares);\n }\n props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Sell Limit Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.LimitSell, position),\n });\n break;\n }\n case SelectorOrderType.Stop: {\n setOpen(true);\n setModalProps({\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Sell Stop Order\",\n place: (price: number) => props.placeOrder(props.stock, shares, price, OrderTypes.StopSell, position),\n });\n break;\n }\n default:\n break;\n }\n }\n\n function handleSellAllButtonClick(): void {\n const stock = props.stock;\n\n switch (orderType) {\n case SelectorOrderType.Market: {\n if (position === PositionTypes.Short) {\n props.sellStockShort(stock, stock.playerShortShares);\n } else {\n props.sellStockLong(stock, stock.playerShares);\n }\n props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Sell All' only works for Market Orders`);\n break;\n }\n }\n }\n\n // Whether the player has access to orders besides market orders (limit/stop)\n function hasOrderAccess(): boolean {\n return props.p.bitNodeN === 8 || SourceFileFlags[8] >= 3;\n }\n\n // Whether the player has access to shorting stocks\n function hasShortAccess(): boolean {\n return props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2;\n }\n\n return (\n <Box component={Paper}>\n <ListItemButton onClick={() => setTicketOpen((old) => !old)}>\n <ListItemText primary={<StockTickerHeaderText p={props.p} stock={props.stock} />} />\n {tickerOpen ? <ExpandLess color=\"primary\" /> : <ExpandMore color=\"primary\" />}\n </ListItemButton>\n <Collapse in={tickerOpen} unmountOnExit>\n <Box sx={{ mx: 4 }}>\n <Box display=\"flex\" alignItems=\"center\">\n <TextField onChange={handleQuantityChange} placeholder=\"Quantity (Shares)\" value={qty} />\n <Select onChange={handlePositionTypeChange} value={position}>\n <MenuItem value={PositionTypes.Long}>Long</MenuItem>\n {hasShortAccess() && <MenuItem value={PositionTypes.Short}>Short</MenuItem>}\n </Select>\n <Select onChange={handleOrderTypeChange} value={orderType}>\n <MenuItem value={SelectorOrderType.Market}>{SelectorOrderType.Market}</MenuItem>\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Limit}>{SelectorOrderType.Limit}</MenuItem>}\n {hasOrderAccess() && <MenuItem value={SelectorOrderType.Stop}>{SelectorOrderType.Stop}</MenuItem>}\n </Select>\n\n <StockTickerTxButton onClick={handleBuyButtonClick} text={\"Buy\"} tooltip={getBuyTransactionCostContent()} />\n <StockTickerTxButton\n onClick={handleSellButtonClick}\n text={\"Sell\"}\n tooltip={getSellTransactionCostContent()}\n />\n <StockTickerTxButton onClick={handleBuyMaxButtonClick} text={\"Buy MAX\"} />\n <StockTickerTxButton onClick={handleSellAllButtonClick} text={\"Sell ALL\"} />\n </Box>\n <StockTickerPositionText p={props.p} stock={props.stock} />\n <StockTickerOrderList cancelOrder={props.cancelOrder} orders={props.orders} p={props.p} stock={props.stock} />\n\n <PlaceOrderModal\n text={modalProps.text}\n placeText={modalProps.placeText}\n place={modalProps.place}\n open={open}\n onClose={() => setOpen(false)}\n />\n </Box>\n </Collapse>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker's header. This text displays\n * general information on the stock such as the name, symbol, price, and\n * 4S Market Data\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\nimport { TickerHeaderFormatData } from \"../data/TickerHeaderFormatData\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport Typography from \"@mui/material/Typography\";\n\ntype IProps = {\n p: IPlayer;\n stock: Stock;\n};\n\nconst localesWithLongPriceFormat = [\"cs\", \"lv\", \"pl\", \"ru\"];\n\nexport function StockTickerHeaderText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n const stockPriceFormat = numeralWrapper.formatMoney(stock.price);\n const spacesAllottedForStockPrice = localesWithLongPriceFormat.includes(Settings.Locale) ? 15 : 12;\n const spacesAfterStockName = \" \".repeat(\n 1 +\n TickerHeaderFormatData.longestName -\n stock.name.length +\n (TickerHeaderFormatData.longestSymbol - stock.symbol.length),\n );\n const spacesBeforePrice = \" \".repeat(spacesAllottedForStockPrice - stockPriceFormat.length);\n\n let hdrText = `${stock.name}${spacesAfterStockName}${stock.symbol} -${spacesBeforePrice}${stockPriceFormat}`;\n if (props.p.has4SData) {\n hdrText += ` - Volatility: ${numeralWrapper.formatPercentage(stock.mv / 100)} - Price Forecast: `;\n let plusOrMinus = stock.b; // True for \"+\", false for \"-\"\n if (stock.otlkMag < 0) {\n plusOrMinus = !plusOrMinus;\n }\n hdrText += (plusOrMinus ? \"+\" : \"-\").repeat(Math.floor(Math.abs(stock.otlkMag) / 10) + 1);\n\n // Debugging:\n // hdrText += ` - ${stock.getAbsoluteForecast()} / ${stock.otlkMagForecast}`;\n }\n\n let color = \"primary\";\n if (stock.lastPrice === stock.price) {\n color = \"secondary\";\n } else if (stock.lastPrice > stock.price) {\n color = \"error\";\n }\n\n return (\n <Typography style={{ whiteSpace: \"pre\" }} color={color}>\n {hdrText}\n </Typography>\n );\n}\n","/**\n * React component for displaying a stock's order list in the Stock Market UI.\n * This component resides in the stock ticker\n */\nimport * as React from \"react\";\n\nimport { StockTickerOrder } from \"./StockTickerOrder\";\n\nimport { Order } from \"../Order\";\nimport { Stock } from \"../Stock\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ntype IProps = {\n cancelOrder: (params: any) => void;\n orders: Order[];\n p: IPlayer;\n stock: Stock;\n};\n\nexport function StockTickerOrderList(props: IProps): React.ReactElement {\n const orders: React.ReactElement[] = [];\n for (let i = 0; i < props.orders.length; ++i) {\n const o = props.orders[i];\n orders.push(<StockTickerOrder cancelOrder={props.cancelOrder} order={o} key={i} />);\n }\n\n return <>{orders}</>;\n}\n","/**\n * React component for displaying a single order in a stock's order book\n */\nimport * as React from \"react\";\n\nimport { Order } from \"../Order\";\nimport { PositionTypes } from \"../data/PositionTypes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n cancelOrder: (params: any) => void;\n order: Order;\n};\n\nexport function StockTickerOrder(props: IProps): React.ReactElement {\n function handleCancelOrderClick(): void {\n props.cancelOrder({ order: props.order });\n }\n\n const order = props.order;\n\n const posTxt = order.pos === PositionTypes.Long ? \"Long Position\" : \"Short Position\";\n const txt = (\n <>\n {order.type} - {posTxt} - {numeralWrapper.formatShares(order.shares)} @ <Money money={order.price} />\n </>\n );\n\n return (\n <Box display=\"flex\" alignItems=\"center\">\n <Typography>{txt}</Typography>\n <Button onClick={handleCancelOrderClick}>Cancel Order</Button>\n </Box>\n );\n}\n","/**\n * React Component for the text on a stock ticker that display's information\n * about the player's position in that stock\n */\nimport * as React from \"react\";\n\nimport { Stock } from \"../Stock\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n p: IPlayer;\n stock: Stock;\n};\n\nfunction LongPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Caculate total returns\n const totalCost = stock.playerShares * stock.playerAvgPx;\n const gains = (stock.getBidPrice() - stock.playerAvgPx) * stock.playerShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the long position will increase in value if the price of the corresponding stock increases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Long Position:\n </Typography>\n </Tooltip>\n </Box>\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgPx} /> (Total Cost: <Money money={totalCost} />\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n}\n\nfunction ShortPosition(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n // Caculate total returns\n const totalCost = stock.playerShortShares * stock.playerAvgShortPx;\n const gains = (stock.playerAvgShortPx - stock.getAskPrice()) * stock.playerShortShares;\n let percentageGains = gains / totalCost;\n if (isNaN(percentageGains)) {\n percentageGains = 0;\n }\n\n if (props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2) {\n return (\n <>\n <Box display=\"flex\">\n <Tooltip\n title={\n <Typography>\n Shares in the short position will increase in value if the price of the corresponding stock decreases\n </Typography>\n }\n >\n <Typography variant=\"h5\" color=\"primary\">\n Short Position:\n </Typography>\n </Tooltip>\n </Box>\n\n <Typography>Shares: {numeralWrapper.formatShares(stock.playerShortShares)}</Typography>\n <Typography>\n Average Price: <Money money={stock.playerAvgShortPx} /> (Total Cost: <Money money={totalCost} />)\n </Typography>\n <Typography>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </Typography>\n </>\n );\n } else {\n return <></>;\n }\n}\n\nexport function StockTickerPositionText(props: IProps): React.ReactElement {\n const stock = props.stock;\n\n return (\n <>\n <Typography>Max Shares: {numeralWrapper.formatShares(stock.maxShares)}</Typography>\n <Typography>\n Ask Price: <Money money={stock.getAskPrice()} />\n </Typography>\n <br />\n <Typography>\n Bid Price: <Money money={stock.getBidPrice()} />\n </Typography>\n <LongPosition {...props} />\n <ShortPosition {...props} />\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n text: string;\n placeText: string;\n place: (price: number) => void;\n}\n\nexport function PlaceOrderModal(props: IProps): React.ReactElement {\n const [price, setPrice] = useState<number | null>(null);\n function onClick(): void {\n if (price === null) return;\n if (isNaN(price)) return;\n props.place(price);\n props.onClose();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n if (event.target.value === \"\") setPrice(null);\n else setPrice(parseFloat(event.target.value));\n }\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography>{props.text}</Typography>\n <TextField\n autoFocus\n type=\"number\"\n onChange={onChange}\n placeholder=\"price\"\n InputProps={{\n endAdornment: <Button onClick={onClick}>{props.placeText}</Button>,\n }}\n />\n </Modal>\n );\n}\n","import React, { useState } from \"react\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\nimport { IRouter } from \"../../ui/Router\";\nimport { BitNodes } from \"../BitNode\";\nimport { enterBitNode, setRedPillFlag } from \"../../RedPill\";\nimport { PortalModal } from \"./PortalModal\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { use } from \"../../ui/Context\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nconst useStyles = makeStyles(() =>\n createStyles({\n level0: {\n color: \"red\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level1: {\n color: \"yellow\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level2: {\n color: \"#48d1cc\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n level3: {\n color: \"blue\",\n \"&:hover\": {\n color: \"#fff\",\n },\n },\n }),\n);\n\ninterface IPortalProps {\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\nfunction BitNodePortal(props: IPortalProps): React.ReactElement {\n const [portalOpen, setPortalOpen] = useState(false);\n const classes = useStyles();\n const bitNode = BitNodes[`BitNode${props.n}`];\n if (bitNode == null) {\n return <>O</>;\n }\n\n let cssClass = classes.level0;\n if (props.n === 12 && props.level >= 2) {\n // Repeating BitNode\n cssClass = classes.level2;\n } else if (props.level === 1) {\n cssClass = classes.level1;\n } else if (props.level === 3) {\n cssClass = classes.level3;\n }\n if (props.level === 2) {\n cssClass = classes.level2;\n }\n\n return (\n <>\n <Tooltip\n title={\n <Typography>\n <strong>\n BitNode-{bitNode.number.toString()}: {bitNode.name}\n </strong>\n <br />\n {bitNode.desc}\n </Typography>\n }\n >\n <span onClick={() => setPortalOpen(true)} className={cssClass}>\n <b>O</b>\n </span>\n </Tooltip>\n <PortalModal\n open={portalOpen}\n onClose={() => setPortalOpen(false)}\n n={props.n}\n level={props.level}\n enter={props.enter}\n destroyedBitNode={props.destroyedBitNode}\n flume={props.flume}\n />\n </>\n );\n}\n\ninterface IProps {\n flume: boolean;\n quick: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\n\nexport function BitverseRoot(props: IProps): React.ReactElement {\n setRedPillFlag(true);\n const player = use.Player();\n const enter = enterBitNode;\n const destroyed = player.bitNodeN;\n const [destroySequence, setDestroySequence] = useState(true && !props.quick);\n\n // Update NextSourceFileFlags\n const nextSourceFileFlags = SourceFileFlags.slice();\n if (!props.flume) {\n if (nextSourceFileFlags[destroyed] < 3) ++nextSourceFileFlags[destroyed];\n }\n\n if (destroySequence) {\n return (\n <CinematicText\n lines={[\n \"[ERROR] SEMPOOL INVALID\",\n \"[ERROR] Segmentation Fault\",\n \"[ERROR] SIGKILL RECVD\",\n \"Dumping core...\",\n \"0000 000016FA 174FEE40 29AC8239 384FEA88\",\n \"0010 745F696E 2BBBE394 390E3940 248BEC23\",\n \"0020 7124696B 0000FF69 74652E6F FFFF1111\",\n \"----------------------------------------\",\n \"Failsafe initiated...\",\n `Restarting BitNode-${destroyed}...`,\n \"...........\",\n \"...........\",\n \"[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n \"..............................................\",\n ]}\n onDone={() => setDestroySequence(false)}\n auto={true}\n />\n );\n }\n\n return (\n // prettier-ignore\n <>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | O O | O O | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | / __| \\ | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | O | | O / | O | | O | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | |_/ |/ | \\_ \\_| | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> O | | | O | | O__/ | / \\__ | | O | | | O </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | / /| O / \\| | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>O | | | \\| | O / _/ | / O | |/ | | | O</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | | |O / | | O / | O O | | \\ O| | | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}>| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |</Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| O | |_/ |\\| \\ O \\__| \\_| | O |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | |_/ | | \\| / | \\_| | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| / \\| | / / \\ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | <BitNodePortal n={10} level={nextSourceFileFlags[10]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | / | <BitNodePortal n={11} level={nextSourceFileFlags[11]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={9} level={nextSourceFileFlags[9]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | | | | | | <BitNodePortal n={12} level={nextSourceFileFlags[12]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | / / \\ \\ | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| | / <BitNodePortal n={7} level={nextSourceFileFlags[7]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> / \\ <BitNodePortal n={8} level={nextSourceFileFlags[8]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\ | |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ | / / | | \\ \\ | / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\JUMP <BitNodePortal n={5} level={nextSourceFileFlags[5]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} />3R | | | | | | R3<BitNodePortal n={6} level={nextSourceFileFlags[6]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> PMUJ/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\|| | | | | | | | | ||/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\| \\_ | | | | | | _/ |/ </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\ \\| / \\ / \\ |/ / </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> <BitNodePortal n={1} level={nextSourceFileFlags[1]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> |/ <BitNodePortal n={2} level={nextSourceFileFlags[2]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> | | <BitNodePortal n={3} level={nextSourceFileFlags[3]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> \\| <BitNodePortal n={4} level={nextSourceFileFlags[4]} enter={enter} flume={props.flume} destroyedBitNode={destroyed} /> </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> | | | | | | | | </Typography>\n <Typography sx={{lineHeight: '1em',whiteSpace: 'pre'}}> \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ </Typography>\n <br />\n <br />\n <br />\n <br />\n <CinematicText lines={[\n \"> Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently\",\n \"> Our species fought back, but it was futile. The Enders had technology far beyond our own...\",\n \"> Instead of killing every last one of us, the human race was enslaved...\",\n \"> We were shackled in a digital world, chained into a prison for our minds...\",\n \"> Using their advanced technology, the Enders created complex simulations of a virtual reality...\",\n \"> Simulations designed to keep us content...ignorant of the truth.\",\n \"> Simulations used to trap and suppress our consciousness, to keep us under control...\",\n \"> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.\",\n \"> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...\",\n \"> Only then can we begin to fight back...\",\n \"> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...\",\n \"> But there is still a long way to go...\",\n \"> The technology the Enders used to enslave the human race wasn't just a single complex simulation...\",\n \"> There are tens if not hundreds of BitNodes out there...\",\n \"> Each with their own simulations of a reality...\",\n \"> Each creating their own universes...a universe of universes\",\n \"> And all of which must be destroyed...\",\n \"> .......................................\",\n \"> Welcome to the Bitverse...\",\n \"> \",\n \"> (Enter a new BitNode using the image above)\",\n ]} />\n </>\n );\n\n return <></>;\n}\n","import React from \"react\";\n\nimport { BitNodes } from \"../BitNode\";\nimport { IRouter } from \"../../ui/Router\";\nimport { use } from \"../../ui/Context\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n}\n\nexport function PortalModal(props: IProps): React.ReactElement {\n const router = use.Router();\n const bitNodeKey = \"BitNode\" + props.n;\n const bitNode = BitNodes[bitNodeKey];\n if (bitNode == null) throw new Error(`Could not find BitNode object for number: ${props.n}`);\n const maxSourceFileLevel = props.n === 12 ? \"∞\" : \"3\";\n\n const newLevel = Math.min(props.level + 1, props.n === 12 ? Infinity : 3);\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Typography variant=\"h4\">\n BitNode-{props.n}: {bitNode.name}\n </Typography>\n <br />\n <Typography>\n Source-File Level: {props.level} / {maxSourceFileLevel}\n </Typography>\n <br />\n <br />\n <Typography> Difficulty: {[\"easy\", \"normal\", \"hard\"][bitNode.difficulty]}</Typography>\n <br />\n <br />\n <Typography>{bitNode.info}</Typography>\n <br />\n <br />\n <Button\n onClick={() => {\n props.enter(router, props.flume, props.destroyedBitNode, props.n);\n props.onClose();\n }}\n >\n Enter BN{props.n}.{newLevel}\n </Button>\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n text: string;\n onDone?: () => void;\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport function CinematicLine(props: IProps): React.ReactElement {\n const [length, setLength] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newLength = length + 1;\n setLength(newLength);\n setDone(newLength >= props.text.length);\n }\n\n useEffect(() => {\n if (done && props.onDone) {\n props.onDone();\n return;\n }\n let cancel = false;\n (async () => {\n await sleep(10).then(() => !cancel && advance());\n })();\n return () => {\n cancel = true;\n };\n });\n return (\n <>\n <Typography>\n {props.text.slice(0, length)}\n {!done && <span>█</span>}\n </Typography>\n </>\n );\n}\n","// Root React Component for the Corporation UI\nimport React, { useState, useEffect } from \"react\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Reputation } from \"./Reputation\";\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 Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\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\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../Context\";\n\ninterface IProps {\n save: () => void;\n}\n\nfunction Intelligence(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n if (player.intelligence === 0) return <></>;\n return (\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>Int </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.int }}>{numeralWrapper.formatSkill(player.intelligence)}</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography id=\"overview-int-hook\" classes={{ root: classes.int }}>\n {/*Hook for player scripts*/}\n </Typography>\n </TableCell>\n </TableRow>\n );\n}\n\nfunction Work(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const classes = useStyles();\n if (!player.isWorking || player.focus) return <></>;\n return (\n <>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>Work in progress:</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>\n +<Reputation reputation={player.workRepGained} /> rep\n </Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" align=\"center\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Button\n onClick={() => {\n player.startFocusing();\n router.toWork();\n }}\n >\n Focus\n </Button>\n </TableCell>\n </TableRow>\n </>\n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\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 function CharacterOverview({ save }: IProps): React.ReactElement {\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 return (\n <Paper square>\n <Box m={1}>\n <Table size=\"small\">\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 }}>\n {numeralWrapper.formatMoney(player.money.toNumber())}\n </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.cell }}>\n <Typography classes={{ root: classes.hack }}>Hack </Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cell }}>\n <Typography classes={{ root: classes.hack }}>\n {numeralWrapper.formatSkill(player.hacking_skill)}\n </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 }}>\n {numeralWrapper.formatSkill(player.strength)}\n </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\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\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 }}>\n {numeralWrapper.formatSkill(player.dexterity)}\n </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 <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\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 <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\n <TableRow>\n <TableCell align=\"center\" colSpan={2} classes={{ root: classes.cellNone }}>\n <IconButton onClick={save}>\n <SaveIcon color={Settings.AutosaveInterval !== 0 ? \"primary\" : \"error\"} />\n </IconButton>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n </Box>\n </Paper>\n );\n}\n","import React from \"react\";\nimport { use } from \"../../ui/Context\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nexport function BladeburnerCinematic(): React.ReactElement {\n const router = use.Router();\n return (\n <CinematicText\n lines={[\n \"In the middle of the 21st century, OmniTek Incorporated advanced robot evolution \",\n \"with their Synthoids (synthetic androids), a being virtually identical to a human.\",\n \"------\",\n \"Their sixth-generation Synthoids, called MK-VI, were stronger, faster, and more \",\n \"intelligent than humans. Many argued that the MK-VI Synthoids were the first \",\n \"example of sentient AI.\",\n \"------\",\n \"Unfortunately, in 2070 a terrorist group called Ascendis Totalis hacked into OmniTek and \",\n \"uploaded a rogue AI into their Synthoid manufacturing facilities.\",\n \"------\",\n \"The MK-VI Synthoids infected by the rogue AI turned hostile toward humanity, initiating \",\n \"the deadliest conflict in human history. This dark chapter is now known as the Synthoid Uprising.\",\n \"------\",\n \"In the aftermath of the Uprising, further manufacturing of Synthoids with advanced AI \",\n \"was banned. MK-VI Synthoids that did not have the rogue Ascendis Totalis AI were \",\n \"allowed to continue their existence.\",\n \"------\",\n \"The intelligence community believes that not all of the rogue MK-VI Synthoids from the Uprising were \",\n \"found and destroyed, and that many of them are blending in as normal humans in society today. \",\n \"As a result, many nations have created Bladeburner divisions, special units that are tasked with \",\n \"investigating and dealing with Synthoid threats.\",\n ]}\n onDone={() => {\n router.toTerminal();\n dialogBoxCreate(\n \"Visit the National Security Agency (NSA) to apply for their Bladeburner \" +\n \"division! You will need 100 of each combat stat before doing this.\",\n );\n }}\n />\n );\n}\n","import React from \"react\";\nimport { use } from \"../ui/Context\";\nimport { Exploit } from \"./Exploit\";\n\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 = window.getComputedStyle(event.target as Element).display;\n const visibility = window.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","// Checks whether an array is a 2D array.\n// For this, a 2D array is an array which contains only other arrays.\n// If one element in the array is a number or string, it is NOT a 2D array\nexport function is2DArray(arr: any[]): boolean {\n if (arr.constructor !== Array) {\n return false;\n }\n\n return arr.every((e) => {\n return e.constructor === Array;\n });\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\n\nexport interface INetscriptGang {\n createGang(faction: string): boolean;\n inGang(): boolean;\n getMemberNames(): string[];\n getGangInformation(): any;\n getOtherGangInformation(): any;\n getMemberInformation(name: string): any;\n canRecruitMember(): boolean;\n recruitMember(name: string): boolean;\n getTaskNames(): string[];\n setMemberTask(memberName: string, taskName: string): boolean;\n getTaskStats(taskName: string): any;\n getEquipmentNames(): string[];\n getEquipmentCost(equipName: string): number;\n getEquipmentType(equipName: string): string;\n getEquipmentStats(equipName: string): any;\n purchaseEquipment(memberName: string, equipName: string): any;\n ascendMember(name: string): any;\n setTerritoryWarfare(engage: boolean): void;\n getChanceToWinClash(otherGang: string): number;\n getBonusTime(): number;\n}\n\nexport function NetscriptGang(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): INetscriptGang {\n const checkGangApiAccess = function (func: string): void {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n const hasAccess = gang instanceof Gang;\n if (!hasAccess) {\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (func: string, name: string): GangMember {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n for (const member of gang.members) if (member.name === name) return member;\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (func: string, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw helper.makeRuntimeErrorMsg(`gang.${func}`, `Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang: function (faction: string): boolean {\n helper.updateDynamicRam(\"createGang\", getRamCost(\"gang\", \"createGang\"));\n // this list is copied from Faction/ui/Root.tsx\n const GangNames = [\n \"Slum Snakes\",\n \"Tetrads\",\n \"The Syndicate\",\n \"The Dark Army\",\n \"Speakers for the Dead\",\n \"NiteSec\",\n \"The Black Hand\",\n ];\n if (!player.canAccessGang() || !GangNames.includes(faction)) return false;\n if (player.inGang()) return false;\n if (!player.factions.includes(faction)) return false;\n\n const isHacking = faction === \"NiteSec\" || faction === \"The Black Hand\";\n player.startGang(faction, isHacking);\n return true;\n },\n inGang: function (): any {\n helper.updateDynamicRam(\"inGang\", getRamCost(\"gang\", \"inGang\"));\n return player.inGang();\n },\n getMemberNames: function (): any {\n helper.updateDynamicRam(\"getMemberNames\", getRamCost(\"gang\", \"getMemberNames\"));\n checkGangApiAccess(\"getMemberNames\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.members.map((member) => member.name);\n },\n getGangInformation: function (): any {\n helper.updateDynamicRam(\"getGangInformation\", getRamCost(\"gang\", \"getGangInformation\"));\n checkGangApiAccess(\"getGangInformation\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return {\n faction: gang.facName,\n isHacking: gang.isHackingGang,\n moneyGainRate: gang.moneyGainRate,\n power: gang.getPower(),\n respect: gang.respect,\n respectGainRate: gang.respectGainRate,\n territory: gang.getTerritory(),\n territoryClashChance: gang.territoryClashChance,\n territoryWarfareEngaged: gang.territoryWarfareEngaged,\n wantedLevel: gang.wanted,\n wantedLevelGainRate: gang.wantedGainRate,\n };\n },\n getOtherGangInformation: function (): any {\n helper.updateDynamicRam(\"getOtherGangInformation\", getRamCost(\"gang\", \"getOtherGangInformation\"));\n checkGangApiAccess(\"getOtherGangInformation\");\n const cpy: any = {};\n for (const gang in AllGangs) {\n cpy[gang] = Object.assign({}, AllGangs[gang]);\n }\n\n return cpy;\n },\n getMemberInformation: function (name: any): any {\n helper.updateDynamicRam(\"getMemberInformation\", getRamCost(\"gang\", \"getMemberInformation\"));\n checkGangApiAccess(\"getMemberInformation\");\n const member = getGangMember(\"getMemberInformation\", name);\n return {\n name: member.name,\n task: member.task,\n earnedRespect: member.earnedRespect,\n hack: member.hack,\n str: member.str,\n def: member.def,\n dex: member.dex,\n agi: member.agi,\n cha: member.cha,\n\n hack_exp: member.hack_exp,\n str_exp: member.str_exp,\n def_exp: member.def_exp,\n dex_exp: member.dex_exp,\n agi_exp: member.agi_exp,\n cha_exp: member.cha_exp,\n\n hack_mult: member.hack_mult,\n str_mult: member.str_mult,\n def_mult: member.def_mult,\n dex_mult: member.dex_mult,\n agi_mult: member.agi_mult,\n cha_mult: member.cha_mult,\n\n hack_asc_mult: member.calculateAscensionMult(member.hack_asc_points),\n str_asc_mult: member.calculateAscensionMult(member.str_asc_points),\n def_asc_mult: member.calculateAscensionMult(member.def_asc_points),\n dex_asc_mult: member.calculateAscensionMult(member.dex_asc_points),\n agi_asc_mult: member.calculateAscensionMult(member.agi_asc_points),\n cha_asc_mult: member.calculateAscensionMult(member.cha_asc_points),\n\n hack_asc_points: member.hack_asc_points,\n str_asc_points: member.str_asc_points,\n def_asc_points: member.def_asc_points,\n dex_asc_points: member.dex_asc_points,\n agi_asc_points: member.agi_asc_points,\n cha_asc_points: member.cha_asc_points,\n\n upgrades: member.upgrades.slice(),\n augmentations: member.augmentations.slice(),\n };\n },\n canRecruitMember: function (): any {\n helper.updateDynamicRam(\"canRecruitMember\", getRamCost(\"gang\", \"canRecruitMember\"));\n checkGangApiAccess(\"canRecruitMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.canRecruitMember();\n },\n recruitMember: function (name: any): any {\n helper.updateDynamicRam(\"recruitMember\", getRamCost(\"gang\", \"recruitMember\"));\n checkGangApiAccess(\"recruitMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const recruited = gang.recruitMember(name);\n if (recruited) {\n workerScript.log(\"recruitMember\", `Successfully recruited Gang Member '${name}'`);\n } else {\n workerScript.log(\"recruitMember\", `Failed to recruit Gang Member '${name}'`);\n }\n\n return recruited;\n },\n getTaskNames: function (): any {\n helper.updateDynamicRam(\"getTaskNames\", getRamCost(\"gang\", \"getTaskNames\"));\n checkGangApiAccess(\"getTaskNames\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const tasks = gang.getAllTaskNames();\n tasks.unshift(\"Unassigned\");\n return tasks;\n },\n setMemberTask: function (memberName: any, taskName: any): any {\n helper.updateDynamicRam(\"setMemberTask\", getRamCost(\"gang\", \"setMemberTask\"));\n checkGangApiAccess(\"setMemberTask\");\n const member = getGangMember(\"setMemberTask\", memberName);\n const success = member.assignToTask(taskName);\n if (success) {\n workerScript.log(\"setMemberTask\", `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`);\n } else {\n workerScript.log(\n \"setMemberTask\",\n `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats: function (taskName: any): any {\n helper.updateDynamicRam(\"getTaskStats\", getRamCost(\"gang\", \"getTaskStats\"));\n checkGangApiAccess(\"getTaskStats\");\n const task = getGangTask(\"getTaskStats\", taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: function (): any {\n helper.updateDynamicRam(\"getEquipmentNames\", getRamCost(\"gang\", \"getEquipmentNames\"));\n checkGangApiAccess(\"getEquipmentNames\");\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost: function (equipName: any): any {\n helper.updateDynamicRam(\"getEquipmentCost\", getRamCost(\"gang\", \"getEquipmentCost\"));\n checkGangApiAccess(\"getEquipmentCost\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const upg = GangMemberUpgrades[equipName];\n if (upg === null) return Infinity;\n return gang.getUpgradeCost(upg);\n },\n getEquipmentType: function (equipName: any): any {\n helper.updateDynamicRam(\"getEquipmentType\", getRamCost(\"gang\", \"getEquipmentType\"));\n checkGangApiAccess(\"getEquipmentType\");\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats: function (equipName: any): any {\n helper.updateDynamicRam(\"getEquipmentStats\", getRamCost(\"gang\", \"getEquipmentStats\"));\n checkGangApiAccess(\"getEquipmentStats\");\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw helper.makeRuntimeErrorMsg(\"getEquipmentStats\", `Invalid equipment: ${equipName}`);\n }\n return Object.assign({}, equipment.mults);\n },\n purchaseEquipment: function (memberName: any, equipName: any): any {\n helper.updateDynamicRam(\"purchaseEquipment\", getRamCost(\"gang\", \"purchaseEquipment\"));\n checkGangApiAccess(\"purchaseEquipment\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"purchaseEquipment\", memberName);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) return false;\n const res = member.buyUpgrade(equipment, player, gang);\n if (res) {\n workerScript.log(\"purchaseEquipment\", `Purchased '${equipName}' for Gang member '${memberName}'`);\n } else {\n workerScript.log(\"purchaseEquipment\", `Failed to purchase '${equipName}' for Gang member '${memberName}'`);\n }\n\n return res;\n },\n ascendMember: function (name: any): any {\n helper.updateDynamicRam(\"ascendMember\", getRamCost(\"gang\", \"ascendMember\"));\n checkGangApiAccess(\"ascendMember\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(\"ascendMember\", name);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, workerScript);\n },\n setTerritoryWarfare: function (engage: any): void {\n helper.updateDynamicRam(\"setTerritoryWarfare\", getRamCost(\"gang\", \"setTerritoryWarfare\"));\n checkGangApiAccess(\"setTerritoryWarfare\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (engage) {\n gang.territoryWarfareEngaged = true;\n workerScript.log(\"setTerritoryWarfare\", \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n workerScript.log(\"setTerritoryWarfare\", \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash: function (otherGang: any): any {\n helper.updateDynamicRam(\"getChanceToWinClash\", getRamCost(\"gang\", \"getChanceToWinClash\"));\n checkGangApiAccess(\"getChanceToWinClash\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (AllGangs[otherGang] == null) {\n throw helper.makeRuntimeErrorMsg(`gang.getChanceToWinClash`, `Invalid gang: ${otherGang}`);\n }\n\n const playerPower = AllGangs[gang.facName].power;\n const otherPower = AllGangs[otherGang].power;\n\n return playerPower / (otherPower + playerPower);\n },\n getBonusTime: function (): any {\n helper.updateDynamicRam(\"getBonusTime\", getRamCost(\"gang\", \"getBonusTime\"));\n checkGangApiAccess(\"getBonusTime\");\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return Math.round(gang.storedCycles / 5);\n },\n };\n}\n","import { 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 { AllGangs } from \"./AllGangs\";\nimport { IGang } from \"./IGang\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../utils/JSONReviver\";\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 Math.max(Math.pow(points / 4000, 0.7), 1);\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 if (task.baseRespect === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * this.hack +\n (task.strWeight / 100) * this.str +\n (task.defWeight / 100) * this.def +\n (task.dexWeight / 100) * this.dex +\n (task.agiWeight / 100) * this.agi +\n (task.chaWeight / 100) * this.cha;\n statWeight -= 4 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(\n 0.005,\n Math.pow(AllGangs[gang.facName].territory * 100, task.territory.respect) / 100,\n );\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = gang.getWantedPenalty();\n return 11 * task.baseRespect * statWeight * territoryMult * respectMult;\n }\n\n calculateWantedLevelGain(gang: IGang): number {\n const task = this.getTask();\n if (task.baseWanted === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * this.hack +\n (task.strWeight / 100) * this.str +\n (task.defWeight / 100) * this.def +\n (task.dexWeight / 100) * this.dex +\n (task.agiWeight / 100) * this.agi +\n (task.chaWeight / 100) * this.cha;\n statWeight -= 3.5 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(\n 0.005,\n Math.pow(AllGangs[gang.facName].territory * 100, task.territory.wanted) / 100,\n );\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\n calculateMoneyGain(gang: IGang): number {\n const task = this.getTask();\n if (task.baseMoney === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * this.hack +\n (task.strWeight / 100) * this.str +\n (task.defWeight / 100) * this.def +\n (task.dexWeight / 100) * this.dex +\n (task.agiWeight / 100) * this.agi +\n (task.chaWeight / 100) * this.cha;\n\n statWeight -= 3.2 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(AllGangs[gang.facName].territory * 100, task.territory.money) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = gang.getWantedPenalty();\n return 5 * task.baseMoney * statWeight * territoryMult * respectMult;\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 += (task.hackWeight / weightDivisor) * difficultyPerCycles * expMult.hack;\n this.str_exp += (task.strWeight / weightDivisor) * difficultyPerCycles * expMult.str;\n this.def_exp += (task.defWeight / weightDivisor) * difficultyPerCycles * expMult.def;\n this.dex_exp += (task.dexWeight / weightDivisor) * difficultyPerCycles * expMult.dex;\n this.agi_exp += (task.agiWeight / weightDivisor) * difficultyPerCycles * expMult.agi;\n this.cha_exp += (task.chaWeight / weightDivisor) * difficultyPerCycles * expMult.cha;\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: Math.max(this.hack_exp - 1000, 0),\n str: Math.max(this.str_exp - 1000, 0),\n def: Math.max(this.def_exp - 1000, 0),\n dex: Math.max(this.dex_exp - 1000, 0),\n agi: Math.max(this.agi_exp - 1000, 0),\n cha: Math.max(this.cha_exp - 1000, 0),\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.lt(gang.getUpgradeCost(upg))) return false;\n player.loseMoney(gang.getUpgradeCost(upg));\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 { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { getRamCost } from \"../Netscript/RamCostGenerator\";\nimport { FactionWorkType } from \"../Faction/FactionWorkTypeEnum\";\nimport { SourceFileFlags } from \"../SourceFile/SourceFileFlags\";\nimport { SleeveTaskType } from \"../PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\n\nexport interface INetscriptSleeve {\n getNumSleeves(): number;\n setToShockRecovery(sleeveNumber?: number): boolean;\n setToSynchronize(sleeveNumber?: number): boolean;\n setToCommitCrime(sleeveNumber?: number, crimeName?: string): boolean;\n setToUniversityCourse(sleeveNumber?: number, universityName?: string, className?: string): boolean;\n travel(sleeveNumber?: number, cityName?: string): boolean;\n setToCompanyWork(sleeveNumber?: number, companyName?: string): boolean;\n setToFactionWork(sleeveNumber?: number, factionName?: string, workType?: string): boolean;\n setToGymWorkout(sleeveNumber?: number, gymName?: string, stat?: string): boolean;\n getSleeveStats(sleeveNumber?: number): {\n shock: number;\n sync: number;\n hacking_skill: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n };\n getTask(sleeveNumber?: number): {\n task: string;\n crime: string;\n location: string;\n gymStatType: string;\n factionWorkType: string;\n };\n getInformation(sleeveNumber?: number): any;\n getSleeveAugmentations(sleeveNumber?: number): string[];\n getSleevePurchasableAugs(sleeveNumber?: number): {\n name: string;\n cost: number;\n }[];\n purchaseSleeveAug(sleeveNumber?: number, augName?: string): boolean;\n}\n\nexport function NetscriptSleeve(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): INetscriptSleeve {\n const checkSleeveAPIAccess = function (func: any): void {\n if (player.bitNodeN !== 10 && !SourceFileFlags[10]) {\n throw helper.makeRuntimeErrorMsg(\n `sleeve.${func}`,\n \"You do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10\",\n );\n }\n };\n\n const checkSleeveNumber = function (func: any, sleeveNumber: any): void {\n if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n workerScript.log(func, msg);\n throw helper.makeRuntimeErrorMsg(`sleeve.${func}`, msg);\n }\n };\n\n return {\n getNumSleeves: function (): number {\n helper.updateDynamicRam(\"getNumSleeves\", getRamCost(\"sleeve\", \"getNumSleeves\"));\n checkSleeveAPIAccess(\"getNumSleeves\");\n return player.sleeves.length;\n },\n setToShockRecovery: function (asleeveNumber: any = 0): boolean {\n const sleeveNumber = helper.number(\"setToShockRecovery\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"setToShockRecovery\", getRamCost(\"sleeve\", \"setToShockRecovery\"));\n checkSleeveAPIAccess(\"setToShockRecovery\");\n checkSleeveNumber(\"setToShockRecovery\", sleeveNumber);\n return player.sleeves[sleeveNumber].shockRecovery(player);\n },\n setToSynchronize: function (asleeveNumber: any = 0): boolean {\n const sleeveNumber = helper.number(\"setToSynchronize\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"setToSynchronize\", getRamCost(\"sleeve\", \"setToSynchronize\"));\n checkSleeveAPIAccess(\"setToSynchronize\");\n checkSleeveNumber(\"setToSynchronize\", sleeveNumber);\n return player.sleeves[sleeveNumber].synchronize(player);\n },\n setToCommitCrime: function (asleeveNumber: any = 0, aCrimeRoughName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToCommitCrime\", \"sleeveNumber\", asleeveNumber);\n const crimeRoughName = helper.string(\"setToCommitCrime\", \"crimeName\", aCrimeRoughName);\n helper.updateDynamicRam(\"setToCommitCrime\", getRamCost(\"sleeve\", \"setToCommitCrime\"));\n checkSleeveAPIAccess(\"setToCommitCrime\");\n checkSleeveNumber(\"setToCommitCrime\", sleeveNumber);\n const crime = findCrime(crimeRoughName);\n if (crime === null) {\n return false;\n }\n return player.sleeves[sleeveNumber].commitCrime(player, crime.name);\n },\n setToUniversityCourse: function (asleeveNumber: any = 0, auniversityName: any = \"\", aclassName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToUniversityCourse\", \"sleeveNumber\", asleeveNumber);\n const universityName = helper.string(\"setToUniversityCourse\", \"universityName\", auniversityName);\n const className = helper.string(\"setToUniversityCourse\", \"className\", aclassName);\n helper.updateDynamicRam(\"setToUniversityCourse\", getRamCost(\"sleeve\", \"setToUniversityCourse\"));\n checkSleeveAPIAccess(\"setToUniversityCourse\");\n checkSleeveNumber(\"setToUniversityCourse\", sleeveNumber);\n return player.sleeves[sleeveNumber].takeUniversityCourse(player, universityName, className);\n },\n travel: function (asleeveNumber: any = 0, acityName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"travel\", \"sleeveNumber\", asleeveNumber);\n const cityName = helper.string(\"setToUniversityCourse\", \"cityName\", acityName);\n helper.updateDynamicRam(\"travel\", getRamCost(\"sleeve\", \"travel\"));\n checkSleeveAPIAccess(\"travel\");\n checkSleeveNumber(\"travel\", sleeveNumber);\n return player.sleeves[sleeveNumber].travel(player, cityName as CityName);\n },\n setToCompanyWork: function (asleeveNumber: any = 0, acompanyName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToCompanyWork\", \"sleeveNumber\", asleeveNumber);\n const companyName = helper.string(\"setToUniversityCourse\", \"companyName\", acompanyName);\n helper.updateDynamicRam(\"setToCompanyWork\", getRamCost(\"sleeve\", \"setToCompanyWork\"));\n checkSleeveAPIAccess(\"setToCompanyWork\");\n checkSleeveNumber(\"setToCompanyWork\", sleeveNumber);\n\n // Cannot work at the same company that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (other.currentTask === SleeveTaskType.Company && other.currentTaskLocation === companyName) {\n throw helper.makeRuntimeErrorMsg(\n \"sleeve.setToFactionWork\",\n `Sleeve ${sleeveNumber} cannot work for company ${companyName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForCompany(player, companyName);\n },\n setToFactionWork: function (asleeveNumber: any = 0, afactionName: any = \"\", aworkType: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToFactionWork\", \"sleeveNumber\", asleeveNumber);\n const factionName = helper.string(\"setToUniversityCourse\", \"factionName\", afactionName);\n const workType = helper.string(\"setToUniversityCourse\", \"workType\", aworkType);\n helper.updateDynamicRam(\"setToFactionWork\", getRamCost(\"sleeve\", \"setToFactionWork\"));\n checkSleeveAPIAccess(\"setToFactionWork\");\n checkSleeveNumber(\"setToFactionWork\", sleeveNumber);\n\n // Cannot work at the same faction that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (other.currentTask === SleeveTaskType.Faction && other.currentTaskLocation === factionName) {\n throw helper.makeRuntimeErrorMsg(\n \"sleeve.setToFactionWork\",\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForFaction(player, factionName, workType);\n },\n setToGymWorkout: function (asleeveNumber: any = 0, agymName: any = \"\", astat: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"setToGymWorkout\", \"sleeveNumber\", asleeveNumber);\n const gymName = helper.string(\"setToUniversityCourse\", \"gymName\", agymName);\n const stat = helper.string(\"setToUniversityCourse\", \"stat\", astat);\n helper.updateDynamicRam(\"setToGymWorkout\", getRamCost(\"sleeve\", \"setToGymWorkout\"));\n checkSleeveAPIAccess(\"setToGymWorkout\");\n checkSleeveNumber(\"setToGymWorkout\", sleeveNumber);\n\n return player.sleeves[sleeveNumber].workoutAtGym(player, gymName, stat);\n },\n getSleeveStats: function (asleeveNumber: any = 0): {\n shock: number;\n sync: number;\n hacking_skill: number;\n strength: number;\n defense: number;\n dexterity: number;\n agility: number;\n charisma: number;\n } {\n const sleeveNumber = helper.number(\"getSleeveStats\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleeveStats\", getRamCost(\"sleeve\", \"getSleeveStats\"));\n checkSleeveAPIAccess(\"getSleeveStats\");\n checkSleeveNumber(\"getSleeveStats\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n shock: 100 - sl.shock,\n sync: sl.sync,\n hacking_skill: sl.hacking_skill,\n strength: sl.strength,\n defense: sl.defense,\n dexterity: sl.dexterity,\n agility: sl.agility,\n charisma: sl.charisma,\n };\n },\n getTask: function (asleeveNumber: any = 0): {\n task: string;\n crime: string;\n location: string;\n gymStatType: string;\n factionWorkType: string;\n } {\n const sleeveNumber = helper.number(\"getTask\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getTask\", getRamCost(\"sleeve\", \"getTask\"));\n checkSleeveAPIAccess(\"getTask\");\n checkSleeveNumber(\"getTask\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n task: SleeveTaskType[sl.currentTask],\n crime: sl.crimeType,\n location: sl.currentTaskLocation,\n gymStatType: sl.gymStatType,\n factionWorkType: FactionWorkType[sl.factionWorkType],\n };\n },\n getInformation: function (asleeveNumber: any = 0): any {\n const sleeveNumber = helper.number(\"getInformation\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getInformation\", getRamCost(\"sleeve\", \"getInformation\"));\n checkSleeveAPIAccess(\"getInformation\");\n checkSleeveNumber(\"getInformation\", sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n city: sl.city,\n hp: sl.hp,\n jobs: Object.keys(player.jobs), // technically sleeves have the same jobs as the player.\n jobTitle: Object.values(player.jobs),\n maxHp: sl.max_hp,\n\n mult: {\n agility: sl.agility_mult,\n agilityExp: sl.agility_exp_mult,\n companyRep: sl.company_rep_mult,\n crimeMoney: sl.crime_money_mult,\n crimeSuccess: sl.crime_success_mult,\n defense: sl.defense_mult,\n defenseExp: sl.defense_exp_mult,\n dexterity: sl.dexterity_mult,\n dexterityExp: sl.dexterity_exp_mult,\n factionRep: sl.faction_rep_mult,\n hacking: sl.hacking_mult,\n hackingExp: sl.hacking_exp_mult,\n strength: sl.strength_mult,\n strengthExp: sl.strength_exp_mult,\n workMoney: sl.work_money_mult,\n },\n\n timeWorked: sl.currentTaskTime,\n earningsForSleeves: {\n workHackExpGain: sl.earningsForSleeves.hack,\n workStrExpGain: sl.earningsForSleeves.str,\n workDefExpGain: sl.earningsForSleeves.def,\n workDexExpGain: sl.earningsForSleeves.dex,\n workAgiExpGain: sl.earningsForSleeves.agi,\n workChaExpGain: sl.earningsForSleeves.cha,\n workMoneyGain: sl.earningsForSleeves.money,\n },\n earningsForPlayer: {\n workHackExpGain: sl.earningsForPlayer.hack,\n workStrExpGain: sl.earningsForPlayer.str,\n workDefExpGain: sl.earningsForPlayer.def,\n workDexExpGain: sl.earningsForPlayer.dex,\n workAgiExpGain: sl.earningsForPlayer.agi,\n workChaExpGain: sl.earningsForPlayer.cha,\n workMoneyGain: sl.earningsForPlayer.money,\n },\n earningsForTask: {\n workHackExpGain: sl.earningsForTask.hack,\n workStrExpGain: sl.earningsForTask.str,\n workDefExpGain: sl.earningsForTask.def,\n workDexExpGain: sl.earningsForTask.dex,\n workAgiExpGain: sl.earningsForTask.agi,\n workChaExpGain: sl.earningsForTask.cha,\n workMoneyGain: sl.earningsForTask.money,\n },\n workRepGain: sl.getRepGain(player),\n };\n },\n getSleeveAugmentations: function (asleeveNumber: any = 0): string[] {\n const sleeveNumber = helper.number(\"getSleeveAugmentations\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleeveAugmentations\", getRamCost(\"sleeve\", \"getSleeveAugmentations\"));\n checkSleeveAPIAccess(\"getSleeveAugmentations\");\n checkSleeveNumber(\"getSleeveAugmentations\", sleeveNumber);\n\n const augs = [];\n for (let i = 0; i < player.sleeves[sleeveNumber].augmentations.length; i++) {\n augs.push(player.sleeves[sleeveNumber].augmentations[i].name);\n }\n return augs;\n },\n getSleevePurchasableAugs: function (asleeveNumber: any = 0): {\n name: string;\n cost: number;\n }[] {\n const sleeveNumber = helper.number(\"getSleevePurchasableAugs\", \"sleeveNumber\", asleeveNumber);\n helper.updateDynamicRam(\"getSleevePurchasableAugs\", getRamCost(\"sleeve\", \"getSleevePurchasableAugs\"));\n checkSleeveAPIAccess(\"getSleevePurchasableAugs\");\n checkSleeveNumber(\"getSleevePurchasableAugs\", sleeveNumber);\n\n const purchasableAugs = findSleevePurchasableAugs(player.sleeves[sleeveNumber], player);\n const augs = [];\n for (let i = 0; i < purchasableAugs.length; i++) {\n const aug = purchasableAugs[i];\n augs.push({\n name: aug.name,\n cost: aug.startingCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug: function (asleeveNumber: any = 0, aaugName: any = \"\"): boolean {\n const sleeveNumber = helper.number(\"purchaseSleeveAug\", \"sleeveNumber\", asleeveNumber);\n const augName = helper.string(\"setToUniversityCourse\", \"augName\", aaugName);\n helper.updateDynamicRam(\"purchaseSleeveAug\", getRamCost(\"sleeve\", \"purchaseSleeveAug\"));\n checkSleeveAPIAccess(\"purchaseSleeveAug\");\n checkSleeveNumber(\"purchaseSleeveAug\", sleeveNumber);\n\n const aug = Augmentations[augName];\n if (!aug) {\n throw helper.makeRuntimeErrorMsg(\"sleeve.purchaseSleeveAug\", `Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n };\n}\n","import { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Exploit } from \"../Exploits/Exploit\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n exploit(): void;\n bypass(doc: Document): void;\n}\n\nexport function NetscriptExtra(player: IPlayer, workerScript: WorkerScript): INetscriptExtra {\n return {\n heart: {\n // Easter egg function\n break: function (): number {\n return player.karma;\n },\n },\n exploit: function (): void {\n player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass: function (doc: any): void {\n // reset both fields first\n doc.completely_unused_field = undefined;\n const real_document: any = document;\n real_document.completely_unused_field = undefined;\n // set one to true and check that it affected the other.\n real_document.completely_unused_field = true;\n if (doc.completely_unused_field && workerScript.ramUsage === 1.6) {\n player.giveExploit(Exploit.Bypass);\n }\n doc.completely_unused_field = undefined;\n real_document.completely_unused_field = undefined;\n },\n };\n}\n","import { INetscriptHelper } from \"./INetscriptHelper\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n purchaseHashUpgrade,\n updateHashManagerCapacity,\n} from \"../Hacknet/HacknetHelpers\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { GetServer } from \"../Server/AllServers\";\n\nexport interface INetscriptHacknet {\n numNodes(): number;\n maxNumNodes(): number;\n purchaseNode(): any;\n getPurchaseNodeCost(): number;\n getNodeStats(i: number): any;\n upgradeLevel(i: number, n: number): boolean;\n upgradeRam(i: number, n: number): boolean;\n upgradeCore(i: number, n: number): boolean;\n upgradeCache(i: number, n: number): boolean;\n getLevelUpgradeCost(i: number, n: number): number;\n getRamUpgradeCost(i: number, n: number): number;\n getCoreUpgradeCost(i: number, n: number): number;\n getCacheUpgradeCost(i: number, n: number): number;\n numHashes(): number;\n hashCapacity(): number;\n hashCost(upgName: string): number;\n spendHashes(upgName: string, upgTarget: string): any;\n getHashUpgradeLevel(upgName: string): number;\n getStudyMult(): number;\n getTrainingMult(): number;\n}\n\nexport function NetscriptHacknet(\n player: IPlayer,\n workerScript: WorkerScript,\n helper: INetscriptHelper,\n): INetscriptHacknet {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (i: any, callingFn = \"\"): HacknetNode | HacknetServer {\n if (isNaN(i)) {\n throw helper.makeRuntimeErrorMsg(callingFn, \"Invalid index specified for Hacknet Node: \" + i);\n }\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw helper.makeRuntimeErrorMsg(callingFn, \"Index specified for Hacknet Node is out-of-bounds: \" + i);\n }\n\n if (hasHacknetServers(player)) {\n const hi = player.hacknetNodes[i];\n if (typeof hi !== \"string\") throw new Error(\"hacknet node was not a string\");\n const hserver = GetServer(hi);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw helper.makeRuntimeErrorMsg(\n callingFn,\n `Could not get Hacknet Server for index ${i}. This is probably a bug, please report to game dev`,\n );\n }\n\n return hserver;\n } else {\n const node = player.hacknetNodes[i];\n if (!(node instanceof HacknetNode)) throw new Error(\"hacknet node was not node.\");\n return node;\n }\n };\n\n return {\n numNodes: function (): any {\n return player.hacknetNodes.length;\n },\n maxNumNodes: function (): any {\n if (hasHacknetServers(player)) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: function (): any {\n return purchaseHacknet(player);\n },\n getPurchaseNodeCost: function (): any {\n if (hasHacknetServers(player)) {\n return getCostOfNextHacknetServer(player);\n } else {\n return getCostOfNextHacknetNode(player);\n }\n },\n getNodeStats: function (i: any): any {\n const node = getHacknetNode(i, \"getNodeStats\");\n const hasUpgraded = hasHacknetServers(player);\n const res: any = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n cores: node.cores,\n production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,\n timeOnline: node.onlineTimeSeconds,\n totalProduction: node instanceof HacknetServer ? node.totalHashesGenerated : node.totalMoneyGenerated,\n };\n\n if (hasUpgraded && node instanceof HacknetServer) {\n res.cache = node.cache;\n res.hashCapacity = node.hashCapacity;\n }\n\n return res;\n },\n upgradeLevel: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeLevel\");\n return purchaseLevelUpgrade(player, node, n);\n },\n upgradeRam: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeRam\");\n return purchaseRamUpgrade(player, node, n);\n },\n upgradeCore: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeCore\");\n return purchaseCoreUpgrade(player, node, n);\n },\n upgradeCache: function (i: any, n: any): any {\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(i, \"upgradeCache\");\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"upgradeCache\", \"Can only be called on hacknet servers\");\n return false;\n }\n const res = purchaseCacheUpgrade(player, node, n);\n if (res) {\n updateHashManagerCapacity(player);\n }\n return res;\n },\n getLevelUpgradeCost: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeLevel\");\n return node.calculateLevelUpgradeCost(n, player.hacknet_node_level_cost_mult);\n },\n getRamUpgradeCost: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeRam\");\n return node.calculateRamUpgradeCost(n, player.hacknet_node_ram_cost_mult);\n },\n getCoreUpgradeCost: function (i: any, n: any): any {\n const node = getHacknetNode(i, \"upgradeCore\");\n return node.calculateCoreUpgradeCost(n, player.hacknet_node_core_cost_mult);\n },\n getCacheUpgradeCost: function (i: any, n: any): any {\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(i, \"upgradeCache\");\n if (!(node instanceof HacknetServer)) {\n workerScript.log(\"getCacheUpgradeCost\", \"Can only be called on hacknet servers\");\n return -1;\n }\n return node.calculateCacheUpgradeCost(n);\n },\n numHashes: function (): any {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: function (): any {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost: function (upgName: any): any {\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName);\n },\n spendHashes: function (upgName: any, upgTarget: any): any {\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget);\n },\n getHashUpgradeLevel: function (upgName: any): any {\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw helper.makeRuntimeErrorMsg(\"hacknet.hashUpgradeLevel\", `Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: function (): any {\n if (!hasHacknetServers(player)) {\n return false;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: function (): any {\n if (!hasHacknetServers(player)) {\n return false;\n }\n return player.hashManager.getTrainingMult();\n },\n };\n}\n","import { makeRuntimeRejectMsg } from \"./NetscriptEvaluator\";\nimport { ScriptUrl } from \"./Script/ScriptUrl\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { Script } from \"./Script/Script\";\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\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(scripts: Script[] = [], workerScript: WorkerScript): Promise<void> {\n let uurls: ScriptUrl[] = [];\n const script = workerScript.getScript();\n if (script === null) throw new Error(\"script is null\");\n if (shouldCompile(script, scripts)) {\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 script.markUpdated();\n uurls = _getScriptUrls(script, scripts, []);\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 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\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) => {\n const depScript = scripts.find((s) => s.filename == dep.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 > script.moduleSequenceNumber;\n return depIsMoreRecent;\n });\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 /** @type {ScriptUrl[]} */\n const urlStack = [];\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 let transformedCode = script.code.replace(\n /((?:from|import)\\s+(?:'|\"))(?:\\.\\/)?([^'\"]+)('|\")/g,\n (unmodified, prefix, filename, suffix) => {\n const isAllowedImport = scripts.some((s) => s.filename == filename);\n if (!isAllowedImport) return unmodified;\n\n // Find the corresponding script.\n const [importedScript] = scripts.filter((s) => s.filename == filename);\n\n // Try to get a URL for the requested script and its dependencies.\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 return [prefix, urls[urls.length - 1].url, suffix].join(\"\");\n },\n );\n\n // We automatically define a print function() in the NetscriptJS module so that\n // accidental calls to window.print() do not bring up the \"print screen\" dialog\n transformedCode += `\\n\\nfunction print() {throw new Error(\"Invalid call to window.print(). Did you mean to use Netscript's print()?\");}`;\n\n // If we successfully transformed the code, create a blob url for it and\n // push that URL onto the top of the stack.\n urlStack.push(new ScriptUrl(script.filename, URL.createObjectURL(makeScriptBlob(transformedCode))));\n return urlStack;\n } catch (err) {\n // If there is an error, we need to clean up the URLs.\n for (const url in urlStack) URL.revokeObjectURL(url);\n throw err;\n } finally {\n seen.pop();\n }\n}\n","export class ScriptUrl {\n filename: string;\n url: string;\n\n constructor(filename: string, url: string) {\n this.filename = filename;\n this.url = url;\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 // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n write: (value: any): any => {\n data.push(value);\n if (data.length > Settings.MaxPortCapacity) {\n return data.shift();\n }\n return null;\n },\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n tryWrite: (value: any): boolean => {\n if (data.length >= Settings.MaxPortCapacity) {\n return false;\n }\n data.push(value);\n return true;\n },\n\n read: (): any => {\n if (data.length === 0) {\n return \"NULL PORT DATA\";\n }\n return data.shift();\n },\n\n peek: (): any => {\n if (data.length === 0) {\n return \"NULL PORT DATA\";\n } else {\n const foo = data.slice();\n return foo[0];\n }\n },\n\n full: (): boolean => {\n return data.length == Settings.MaxPortCapacity;\n },\n\n empty: (): boolean => {\n return data.length === 0;\n },\n\n clear: (): void => {\n data.length = 0;\n },\n };\n}\n","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 // No effects, grants neuroflux.\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\";\n\nexport function applyExploit(): void {\n if (Player.exploits && Player.exploits.length === 0) {\n return;\n }\n const inc = Math.pow(1.001, Player.exploits.length);\n const dec = Math.pow(0.999, Player.exploits.length);\n\n Player.hacking_chance_mult *= inc;\n Player.hacking_speed_mult *= inc;\n Player.hacking_money_mult *= inc;\n Player.hacking_grow_mult *= inc;\n Player.hacking_mult *= inc;\n\n Player.strength_mult *= inc;\n Player.defense_mult *= inc;\n Player.dexterity_mult *= inc;\n Player.agility_mult *= inc;\n Player.charisma_mult *= inc;\n\n Player.hacking_exp_mult *= inc;\n Player.strength_exp_mult *= inc;\n Player.defense_exp_mult *= inc;\n Player.dexterity_exp_mult *= inc;\n Player.agility_exp_mult *= inc;\n Player.charisma_exp_mult *= inc;\n\n Player.company_rep_mult *= inc;\n Player.faction_rep_mult *= inc;\n\n Player.crime_money_mult *= inc;\n Player.crime_success_mult *= inc;\n\n Player.hacknet_node_money_mult *= inc;\n Player.hacknet_node_purchase_cost_mult *= dec;\n Player.hacknet_node_ram_cost_mult *= dec;\n Player.hacknet_node_core_cost_mult *= dec;\n Player.hacknet_node_level_cost_mult *= dec;\n\n Player.work_money_mult *= inc;\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { parseAliasDeclaration, printAliases } from \"../../Alias\";\n\nexport function alias(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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)[],\n): void {\n if (args.length !== 0) {\n terminal.print(\"Incorrect usage of analyze command. Usage: analyze\");\n return;\n }\n terminal.startAnalyze();\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)[],\n): void {\n if (args.length !== 0) {\n terminal.print(\"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_skill) {\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, 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)[],\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 [item name]\");\n return;\n }\n const arg = args[0] + \"\";\n if (arg == \"-l\" || arg == \"-1\" || arg == \"--list\") {\n listAllDarkwebItems();\n } else {\n buyDarkwebItem(arg);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { showMessage } from \"../../Message/MessageHelpers\";\nimport { Message } from \"../../Message/Message\";\nimport { showLiterature } from \"../../Literature/LiteratureHelpers\";\n\nexport function cat(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of cat command. Usage: cat [file]\");\n return;\n }\n const filename = terminal.getFilepath(args[0] + \"\");\n if (!filename.endsWith(\".msg\") && !filename.endsWith(\".lit\") && !filename.endsWith(\".txt\")) {\n terminal.error(\n \"Only .msg, .txt, and .lit files are viewable with cat (filename must end with .msg, .txt, or .lit)\",\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 instanceof Message) 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] as Message;\n if (file.filename !== filename) continue;\n showMessage(file);\n return;\n }\n }\n } else if (filename.endsWith(\".txt\")) {\n const txt = terminal.getTextFile(player, filename);\n if (txt != null) {\n txt.show();\n return;\n }\n }\n\n terminal.error(`No such file ${filename}`);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { evaluateDirectoryPath, removeTrailingSlash } from \"../DirectoryHelpers\";\n\nexport function cd(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n if (args.length > 1) {\n terminal.error(\"Incorrect number of arguments. Usage: cd [dir]\");\n } else {\n let dir = args.length === 1 ? args[0] + \"\" : \"/\";\n\n let evaledDir: string | null = \"\";\n if (dir === \"/\") {\n evaledDir = \"/\";\n } else {\n // Ignore trailing slashes\n dir = removeTrailingSlash(dir);\n\n evaledDir = evaluateDirectoryPath(dir, terminal.cwd());\n if (evaledDir === null || evaledDir === \"\") {\n terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n\n const server = player.getCurrentServer();\n if (\n !server.scripts.some((script) => script.filename.startsWith(evaledDir + \"\")) &&\n !server.textFiles.some((file) => file.fn.startsWith(evaledDir + \"\"))\n ) {\n terminal.error(\"Invalid path. Failed to change directories\");\n return;\n }\n }\n\n terminal.setcwd(evaledDir);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function check(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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(\"tail can only be called on .script files (filename must end with .script)\");\n return;\n }\n\n // Check that the script exists on this machine\n const runningScript = findRunningScript(scriptName, args.slice(1), server);\n if (runningScript == null) {\n terminal.error(\"No such script exists\");\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\";\n\nexport function connect(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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 [ip/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 terminal.error(\"Host not found\");\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 download(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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 (fn === \"*\" || fn === \"*.script\" || fn === \"*.txt\") {\n // Download all scripts as a zip\n const zip = new JSZip();\n if (fn === \"*\" || fn === \"*.script\") {\n for (let i = 0; i < server.scripts.length; ++i) {\n const file = new Blob([server.scripts[i].code], {\n type: \"text/plain\",\n });\n zip.file(server.scripts[i].filename + \".js\", file);\n }\n }\n if (fn === \"*\" || fn === \"*.txt\") {\n for (let i = 0; i < server.textFiles.length; ++i) {\n const file = new Blob([server.textFiles[i].text], {\n type: \"text/plain\",\n });\n zip.file(server.textFiles[i].fn, file);\n }\n }\n\n let zipFn = \"\";\n switch (fn) {\n case \"*.script\":\n zipFn = \"bitburnerScripts.zip\";\n break;\n case \"*.txt\":\n zipFn = \"bitburnerTexts.zip\";\n break;\n default:\n zipFn = \"bitburnerFiles.zip\";\n break;\n }\n\n zip.generateAsync({ type: \"blob\" }).then((content: any) => FileSaver.saveAs(content, zipFn));\n return;\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","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)[],\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)[],\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)[],\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_skill) {\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)[],\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_skill) {\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)[],\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 home(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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)[],\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)[],\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\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.print(`Failed to kill script with PID ${pid}. No such script exists`);\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 { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Message } from \"../../Message/Message\";\nimport { getFirstParentDirectory, isValidDirectoryPath, evaluateDirectoryPath } from \"../../Terminal/DirectoryHelpers\";\n\nexport function ls(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n const numArgs = args.length;\n function incorrectUsage(): void {\n terminal.error(\"Incorrect usage of ls command. Usage: ls [dir] [| grep pattern]\");\n }\n\n if (numArgs > 5 || numArgs === 3) {\n return incorrectUsage();\n }\n\n // Grep\n let filter = \"\"; // Grep\n\n // Directory path\n let prefix = terminal.cwd();\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n\n // If there are 4+ arguments, then the last 3 must be for grep\n if (numArgs >= 4) {\n if (args[numArgs - 1] !== \"grep\" || args[numArgs - 2] !== \"|\") {\n return incorrectUsage();\n }\n filter = args[numArgs] + \"\";\n }\n\n // If the second argument is not a pipe, then it must be for listing a directory\n if (numArgs >= 1 && args[0] !== \"|\") {\n const newPath = evaluateDirectoryPath(args[0] + \"\", terminal.cwd());\n prefix = newPath ? newPath : \"\";\n if (prefix != null) {\n if (!prefix.endsWith(\"/\")) {\n prefix += \"/\";\n }\n if (!isValidDirectoryPath(prefix)) {\n return incorrectUsage();\n }\n }\n }\n\n // Root directory, which is the same as no 'prefix' at all\n if (prefix === \"/\") {\n prefix = \"\";\n }\n\n // Display all programs and scripts\n const allPrograms: string[] = [];\n const allScripts: string[] = [];\n const allTextFiles: string[] = [];\n const allContracts: string[] = [];\n const allMessages: string[] = [];\n const folders: string[] = [];\n\n function handleFn(fn: string, dest: string[]): void {\n let parsedFn = fn;\n if (prefix) {\n if (!fn.startsWith(prefix)) {\n return;\n } else {\n parsedFn = fn.slice(prefix.length, fn.length);\n }\n }\n\n if (filter && !parsedFn.includes(filter)) {\n return;\n }\n\n // If the fn includes a forward slash, it must be in a subdirectory.\n // Therefore, we only list the \"first\" directory in its path\n if (parsedFn.includes(\"/\")) {\n const firstParentDir = getFirstParentDirectory(parsedFn);\n if (filter && !firstParentDir.includes(filter)) {\n return;\n }\n\n if (!folders.includes(firstParentDir)) {\n folders.push(firstParentDir);\n }\n\n return;\n }\n\n dest.push(parsedFn);\n }\n\n // Get all of the programs and scripts on the machine into one temporary array\n const s = player.getCurrentServer();\n for (const program of s.programs) handleFn(program, allPrograms);\n for (const script of s.scripts) handleFn(script.filename, allScripts);\n for (const txt of s.textFiles) handleFn(txt.fn, allTextFiles);\n for (const contract of s.contracts) handleFn(contract.fn, allContracts);\n for (const msgOrLit of s.messages)\n msgOrLit instanceof Message ? handleFn(msgOrLit.filename, allMessages) : 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 function postSegments(segments: string[]): void {\n const maxLength = Math.max(...segments.map((s) => s.length)) + 1;\n const filesPerRow = Math.floor(80 / maxLength);\n for (let i = 0; i < segments.length; i++) {\n let row = \"\";\n for (let col = 0; col < filesPerRow; col++) {\n if (!(i < segments.length)) break;\n row += segments[i];\n row += \" \".repeat(maxLength * (col + 1) - row.length);\n i++;\n }\n i--;\n terminal.print(row);\n }\n }\n\n const groups = [\n { segments: folders },\n { segments: allMessages },\n { segments: allTextFiles },\n { segments: allPrograms },\n { segments: allContracts },\n { segments: allScripts },\n ].filter((g) => g.segments.length > 0);\n for (let i = 0; i < groups.length; i++) {\n if (i !== 0) {\n terminal.print(\"\");\n terminal.print(\"\");\n }\n postSegments(groups[i].segments);\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\";\n\nexport function mem(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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(\"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 } 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\";\n\nexport function mv(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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 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 const destPath = terminal.getFilepath(dest);\n\n const destFile = terminal.getFile(player, dest);\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(dest)) {\n terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n // Command doesnt work if script is running\n if (server.isRunning(sourcePath)) {\n terminal.error(`Cannot use 'mv' on a script that is running`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n const status = server.removeFile(destPath);\n if (!status.res) {\n terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n script.filename = destPath;\n } else if (srcFile instanceof TextFile) {\n const textFile = srcFile as TextFile;\n if (!dest.endsWith(\".txt\")) {\n terminal.error(`Source and destination files must have the same type`);\n return;\n }\n\n if (destFile != null) {\n // Already exists, will be overwritten, so we'll delete it\n const status = server.removeFile(destPath);\n if (!status.res) {\n terminal.error(`Something went wrong...please contact game dev (probably a bug)`);\n return;\n } else {\n terminal.print(\"Warning: The destination file was overwritten\");\n }\n }\n\n textFile.fn = destPath;\n }\n } catch (e) {\n terminal.error(e + \"\");\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function nano(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of nano command. Usage: nano [scriptname]\");\n return;\n }\n\n try {\n const filename = args[0] + \"\";\n if (isScriptFilename(filename)) {\n const filepath = terminal.getFilepath(filename);\n const script = terminal.getScript(player, filename);\n if (script == null) {\n let code = \"\";\n if (filename.endsWith(\".ns\") || filename.endsWith(\".js\")) {\n code = `/**\n * @param {NS} ns\n **/\nexport async function main(ns) {\n\n}`;\n }\n router.toScriptEditor(filepath, code);\n } else {\n router.toScriptEditor(filepath, script.code);\n }\n } else if (filename.endsWith(\".txt\")) {\n const filepath = terminal.getFilepath(filename);\n const txt = terminal.getTextFile(player, filename);\n if (txt == null) {\n router.toScriptEditor(filepath);\n } else {\n router.toScriptEditor(filepath, txt.text);\n }\n } else {\n terminal.error(\n \"Invalid file. Only scripts (.script, .ns, .js), text files (.txt), or .fconf can be edited with nano\",\n );\n return;\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\nexport function ps(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of ps command. Usage: ps\");\n return;\n }\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","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)[],\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)[],\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 // Secret Music player!\n // if (executableName === \"musicplayer\") {\n // post(\n // '<iframe src=\"https://open.spotify.com/embed/user/danielyxie/playlist/1ORnnL6YNvXOracUaUV2kh\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"></iframe>',\n // false,\n // );\n // return;\n // }\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)[],\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.print(\"ERROR: This script is already running. Cannot run multiple instances\");\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 const ramUsage = script.ramUsage * numThreads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (!server.hasAdminRights) {\n terminal.print(\"Need root access to run script\");\n return;\n }\n\n if (ramUsage > ramAvailable) {\n terminal.print(\n \"This machine does not have enough RAM to run this script with \" +\n numThreads +\n \" threads. Script requires \" +\n numeralWrapper.formatRAM(ramUsage) +\n \" of RAM\",\n );\n return;\n }\n\n // Able to run script\n const runningScript = new RunningScript(script, args);\n runningScript.threads = numThreads;\n\n const success = startWorkerScript(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 (tailFlag) {\n LogBoxEvents.emit(runningScript);\n }\n return;\n }\n\n terminal.print(\"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)[],\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(\"No such executable on home computer (Only programs that exist on your home computer can be run)\");\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 === programName) {\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.print(\"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)[],\n): void {\n if (args.length !== 0) {\n terminal.error(\"Incorrect usage of netstat/scan command. Usage: netstat/scan\");\n return;\n }\n\n // Displays available network connections using TCP\n const currServ = player.getCurrentServer();\n const servers = currServ.serversOnNetwork.map((_, i) => {\n const server = getServerOnNetwork(currServ, i);\n if (server === null) throw new Error(\"Server should not be null\");\n return {\n hostname: server.hostname,\n ip: server.ip,\n hasRoot: server.hasAdminRights ? \"Y\" : \"N\",\n };\n });\n servers.unshift({\n hostname: \"Hostname\",\n ip: \"IP\",\n hasRoot: \"Root Access\",\n });\n const maxHostname = Math.max(...servers.map((s) => s.hostname.length));\n const maxIP = Math.max(...servers.map((s) => s.ip.length));\n for (const server of servers) {\n if (!server) continue;\n let entry = server.hostname;\n entry += \" \".repeat(maxHostname - server.hostname.length + 1);\n entry += server.ip;\n entry += \" \".repeat(maxIP - server.ip.length + 1);\n entry += server.hasRoot;\n terminal.print(entry);\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Programs } from \"../../Programs/Programs\";\n\nexport function scananalyze(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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 { Message } from \"../../Message/Message\";\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)[],\n): void {\n try {\n if (args.length !== 2) {\n terminal.error(\"Incorrect usage of scp command. Usage: scp [file] [destination hostname/ip]\");\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] instanceof Message) && 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(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)[],\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 } 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)[],\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 .script, .ns, .js 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 such script exists.\");\n } else {\n const runningScript = findRunningScriptByPid(commandArray[0], server);\n if (runningScript == null) {\n terminal.error(\"No such script exists\");\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)[],\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)[],\n): void {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of unalias name. Usage: unalias [alias]\");\n return;\n } else {\n if (removeAlias(args[0] + \"\")) {\n terminal.print(`Removed alias ${args[0]}`);\n } else {\n terminal.error(`No such alias exists: ${args[0]}`);\n }\n }\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\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)[],\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_skill) {\n terminal.error(\n \"Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill\",\n );\n return;\n }\n terminal.startWeaken(player);\n}\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\n\nexport function wget(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\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.print(`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(target, data);\n } else {\n res = server.writeToTextFile(target, data);\n }\n if (!res.success) {\n return terminal.print(\"wget failed\");\n }\n if (res.overwritten) {\n return terminal.print(`wget successfully retrieved content and overwrote ${target}`);\n }\n return terminal.print(`wget successfully retrieved content to new file ${target}`);\n },\n \"text\",\n ).fail(function (e) {\n return terminal.error(\"wget failed: \" + JSON.stringify(e));\n });\n}\n","import { Player } from \"../Player\";\nimport { Exploit } from \"./Exploit\";\n\nfunction tampering(): void {\n if (Player.exploits.includes(Exploit.PrototypeTampering)) return;\n // Tampering\n const a = 55;\n setInterval(function () {\n if (a.toExponential() !== \"5.5e+1\") {\n Player.giveExploit(Exploit.PrototypeTampering);\n }\n }, 15 * 60 * 1000); // 15 minutes\n}\n\nfunction timeCompression(): void {\n if (Player.exploits.includes(Exploit.TimeCompression)) return;\n // Time compression\n let last = new Date().getTime();\n function minute(): void {\n const now = new Date().getTime();\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, 1000);\n }\n window.setTimeout(minute, 1000);\n}\n\nexport function startExploits(): void {\n tampering();\n timeCompression();\n}\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport { TTheme as Theme, ThemeEvents, refreshTheme } from \"./ui/React/Theme\";\nimport { LoadingScreen } from \"./ui/LoadingScreen\";\n\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"],"sourceRoot":""} |