bitburner-src/main.bundle.js.map
2021-09-24 21:49:49 -04:00

1 line
3.9 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Constants.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./utils/DialogBox.tsx","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./utils/StringHelperFunctions.ts","webpack:///./src/ui/React/Money.tsx","webpack:///./src/Settings/Settings.ts","webpack:///./src/Augmentation/Augmentations.ts","webpack:///./utils/JSONReviver.js","webpack:///./utils/helpers/getRandomInt.ts","webpack:///./src/ui/React/createPopup.tsx","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/ui/React/StdButton.tsx","webpack:///./src/ui/Router.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/Server/AllServers.ts","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx","webpack:///./src/ui/Context.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/Server/Server.ts","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Company/Companies.ts","webpack:///./src/SourceFile/SourceFileFlags.ts","webpack:///./src/Server/SpecialServerIps.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/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./utils/helpers/keyCodes.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/Hacking.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./utils/helpers/isString.ts","webpack:///./src/Terminal.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/Message/Message.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Netscript/killWorkerScript.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/Missions.jsx","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/Faction/FactionWorkTypeEnum.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./utils/helpers/createProgressBarText.ts","webpack:///./utils/uiHelpers/createElement.ts","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/Corporation/Material.ts","webpack:///./src/Faction/Faction.ts","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/ui/React/AutoupdatingStdButton.tsx","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/utils/SetTimeoutRef.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/Crime/Crime.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/Bladeburner/Bladeburner.ts","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/ui/React/StatsTable.tsx","webpack:///./utils/helpers/addOffset.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/utils/EventEmitter.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:///./utils/helpers/exceptionAlert.ts","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/Bladeburner/BlackOperations.ts","webpack:///./src/Bladeburner/GeneralActions.ts","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/Bladeburner/data/Icons.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./utils/helpers/arrayToString.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/ui/React/BBAccordion.tsx","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/ui/React/StdButtonPurchased.tsx","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./utils/uiHelpers/removeElementById.ts","webpack:///./utils/IPAddress.ts","webpack:///./utils/helpers/compareArrays.ts","webpack:///./utils/LogBox.tsx","webpack:///./src/ui/React/Theme.tsx","webpack:///./src/Bladeburner/Action.ts","webpack:///./src/SaveObject.tsx","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Terminal/ITerminal.ts","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts","webpack:///./utils/uiHelpers/getElementById.ts","webpack:///./src/Prestige.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/SourceFile/SourceFiles.ts","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Casino/Game.tsx","webpack:///./src/Script/RunningScript.ts","webpack:///./src/Script/Script.ts","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/ExportBonus.tsx","webpack:///./src/ui/InteractiveTutorial/ITutorialEvents.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/Corporation/OfficeSpace.ts","webpack:///./src/Corporation/IndustryUpgrades.ts","webpack:///./src/Hacknet/HashManager.ts","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/Faction/ui/Option.tsx","webpack:///./utils/helpers/getTimestamp.ts","webpack:///./utils/helpers/roundToTwo.ts","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/db.tsx","webpack:///./src/Corporation/Product.ts","webpack:///./src/Bladeburner/City.ts","webpack:///./src/Locations/City.ts","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./utils/uiHelpers/removeElement.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/Corporation/Employee.ts","webpack:///./src/Crime/CrimeHelpers.ts","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/Gang/Gang.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/Netscript/Pid.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./utils/helpers/getRandomByte.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/StockMarket/ui/PlaceOrderPopup.tsx","webpack:///./src/Server/BaseServer.ts","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/Server/formulas/grow.ts","webpack:///./utils/helpers/isValidIPAddress.ts","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/Faction/FactionInfo.tsx","webpack:///./utils/uiHelpers/createPopup.ts","webpack:///./src/Programs/ProgramHelpers.ts","webpack:///./src/ui/React/AugmentationAccordion.tsx","webpack:///./src/SourceFile/PlayerOwnedSourceFile.ts","webpack:///./src/Bladeburner/ui/TeamSizePopup.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/ThirdParty/JSInterpreter.js","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","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/Corporation/ui/HeaderTab.tsx","webpack:///./src/ui/React/MuiButton.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/engine.tsx","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/Corporation/ui/CityTab.tsx","webpack:///./utils/uiHelpers/getSelectData.ts","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Locations/ui/GenericLocation.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/ui/React/MuiPaper.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/ui/React/Popup.tsx","webpack:///./src/ui/React/CodingContractPopup.tsx","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/BitNode/ui/BitFlumePopup.tsx","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.ts","webpack:///./src/PersonObjects/Player/PlayerObject.ts","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./utils/helpers/clearObject.ts","webpack:///./src/Company/data/CompaniesMetadata.ts","webpack:///./src/Corporation/Research.ts","webpack:///./src/Corporation/data/ResearchMetadata.ts","webpack:///./utils/uiHelpers/clearEventListeners.ts","webpack:///./src/StockMarket/data/InitStockMetadata.ts","webpack:///./src/ui/createStatusText.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/InstalledAugmentationsAndSourceFiles.tsx","webpack:///./src/Augmentation/ui/InstalledAugmentations.tsx","webpack:///./src/Augmentation/ui/ListConfiguration.tsx","webpack:///./src/Augmentation/ui/OwnedSourceFiles.tsx","webpack:///./src/ui/React/SourceFileAccordion.tsx","webpack:///./src/Augmentation/ui/SourceFileMinus1.tsx","webpack:///./src/Augmentation/ui/PlayerMultipliers.tsx","webpack:///./src/Augmentation/ui/PurchasedAugmentations.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/TravelPopup.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/ui/ContractPage.tsx","webpack:///./src/Bladeburner/ui/ContractList.tsx","webpack:///./src/Bladeburner/ui/ContractElem.tsx","webpack:///./src/Bladeburner/ui/OperationPage.tsx","webpack:///./src/Bladeburner/ui/OperationList.tsx","webpack:///./src/Bladeburner/ui/OperationElem.tsx","webpack:///./src/Bladeburner/ui/BlackOpPage.tsx","webpack:///./src/Bladeburner/ui/BlackOpList.tsx","webpack:///./src/Bladeburner/ui/BlackOpElem.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/GangMemberUpgradePopup.tsx","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/Gang/ui/GangMemberAccordion.tsx","webpack:///./src/Gang/ui/GangMemberAccordionContent.tsx","webpack:///./src/Gang/ui/GangMemberStats.tsx","webpack:///./src/Gang/ui/AscensionPopup.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/RecruitPopup.tsx","webpack:///./src/Gang/ui/TerritorySubpage.tsx","webpack:///./src/Corporation/ui/CorporationRoot.tsx","webpack:///./src/Corporation/ui/NewIndustryPopup.tsx","webpack:///./src/Corporation/Industry.ts","webpack:///./src/utils/calculateEffectWithFactors.ts","webpack:///./src/Corporation/ProductRatingWeights.ts","webpack:///./src/Corporation/ui/MainPanel.tsx","webpack:///./src/Corporation/ui/CityTabs.tsx","webpack:///./src/Corporation/ui/ExpandNewCityPopup.tsx","webpack:///./src/Corporation/ui/Industry.tsx","webpack:///./src/Corporation/ui/IndustryOffice.tsx","webpack:///./src/Corporation/ui/UpgradeOfficeSizePopup.tsx","webpack:///./src/Corporation/ui/HireEmployeePopup.tsx","webpack:///./src/Corporation/ui/ThrowPartyPopup.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/MakeProductPopup.tsx","webpack:///./src/Corporation/ui/ResearchPopup.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/DiscontinueProductPopup.tsx","webpack:///./src/Corporation/ui/ExportPopup.tsx","webpack:///./src/Corporation/ui/LimitProductProductionPopup.tsx","webpack:///./src/Corporation/ui/MaterialMarketTaPopup.tsx","webpack:///./src/Corporation/ui/SellMaterialPopup.tsx","webpack:///./src/Corporation/ui/SellProductPopup.tsx","webpack:///./src/Corporation/ui/PurchaseMaterialPopup.tsx","webpack:///./src/Corporation/ui/ProductMarketTaPopup.tsx","webpack:///./src/Corporation/ui/SmartSupplyPopup.tsx","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Corporation/ui/IndustryProductEquation.tsx","webpack:///./src/Corporation/ui/Overview.tsx","webpack:///./src/Corporation/ui/LevelableUpgrade.tsx","webpack:///./src/Corporation/ui/UnlockUpgrade.tsx","webpack:///./src/Corporation/ui/BribeFactionPopup.tsx","webpack:///./src/Corporation/ui/SellSharesPopup.tsx","webpack:///./src/Corporation/ui/BuybackSharesPopup.tsx","webpack:///./src/Corporation/ui/IssueDividendsPopup.tsx","webpack:///./src/Corporation/ui/IssueNewSharesPopup.tsx","webpack:///./src/Corporation/ui/FindInvestorsPopup.tsx","webpack:///./src/Corporation/ui/GoPublicPopup.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/SleeveAugmentationsPopup.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelPopup.tsx","webpack:///./src/PersonObjects/Sleeve/ui/EarningsTableElement.tsx","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsContent.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreEarningsContent.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/Hacknet/ui/HacknetRoot.tsx","webpack:///./src/Hacknet/ui/GeneralInfo.tsx","webpack:///./src/Hacknet/ui/HacknetNodeElem.tsx","webpack:///./src/Hacknet/HashUpgrade.ts","webpack:///./src/Hacknet/data/HashUpgradesMetadata.tsx","webpack:///./src/Hacknet/ui/HacknetServerElem.tsx","webpack:///./src/Hacknet/ui/HashUpgradePopup.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/data/CompanyPositionsMetadata.ts","webpack:///./src/Company/ui/QuitJobPopup.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/CreateCorporationPopup.tsx","webpack:///./src/Locations/ui/TechVendorLocation.tsx","webpack:///./src/Locations/ui/RamButton.tsx","webpack:///./utils/helpers/isPowerOfTwo.ts","webpack:///./src/Locations/ui/TorButton.tsx","webpack:///./src/Locations/LocationsHelpers.tsx","webpack:///./src/Locations/ui/CoresButton.tsx","webpack:///./src/Locations/ui/PurchaseServerPopup.tsx","webpack:///./src/Locations/ui/TravelConfirmationPopup.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/ui/React/MuiTextField.tsx","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/Root.tsx","webpack:///./src/ScriptEditor/ui/OptionsPopup.tsx","webpack:///./src/Gang/GangMember.ts","webpack:///./src/Netscript/Environment.ts","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/Script/ScriptUrl.ts","webpack:///./src/NetscriptPort.ts","webpack:///./src/utils/helpers/is2DArray.ts","webpack:///./src/Milestones/ui/MilestonesRoot.tsx","webpack:///./src/Terminal/ui/TerminalRoot.tsx","webpack:///./src/Terminal/ui/TerminalInput.tsx","webpack:///./src/Terminal/determineAllPossibilitiesForTabCompletion.ts","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/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/HackingMission/ui/HackingMissionRoot.tsx","webpack:///./src/Faction/ui/FactionRoot.tsx","webpack:///./src/Faction/ui/AugmentationsPage.tsx","webpack:///./src/Faction/ui/PurchaseableAugmentation.tsx","webpack:///./src/Faction/ui/PurchaseAugmentationPopup.tsx","webpack:///./src/ui/React/Augmentation.tsx","webpack:///./src/Faction/ui/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveUpgrades.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/ui/React/PopupCloseButton.tsx","webpack:///./src/ui/React/PopupButton.tsx","webpack:///./src/Faction/ui/CreateGangPopup.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/ui/React/ErrorBoundary.tsx","webpack:///./src/BitNode/ui/BitverseRoot.tsx","webpack:///./src/BitNode/ui/PortalPopup.tsx","webpack:///./src/ui/React/CinematicLine.tsx","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/Bladeburner/ui/BladeburnerCinematic.tsx","webpack:///./src/Faction/ui/InvitationPopup.tsx","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/hack.ts","webpack:///./src/Terminal/commands/help.ts","webpack:///./src/Terminal/commands/home.ts","webpack:///./src/Terminal/commands/hostname.ts","webpack:///./src/Terminal/commands/ifconfig.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/wget.ts","webpack:///./src/Exploits/tampering.ts","webpack:///./src/Exploits/unclickable.ts","webpack:///./src/index.tsx","webpack:///./src/engineStyle.ts"],"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","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","IntelligenceHackingMissionBaseExpGain","HackingMissionRepToDiffConversion","HackingMissionRepToRewardConversion","HackingMissionSpamTimeIncrease","HackingMissionTransferAttackIncrease","HackingMissionMiscDefenseIncrease","HackingMissionDifficultyToHacking","HackingMissionHowToPlay","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","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","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","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","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","MessagePopup","props","content","dialogBoxCreate","txt","preformatted","popupId","Array","from","map","getRandomInt","join","createPopup","dangerouslySetInnerHTML","__html","replace","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","hack","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","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","undefined","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","random","Money","player","Error","canAfford","className","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","EnableBashHotkeys","EnableTimestamps","Locale","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","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","combat","cha","int","rep","Settings","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","init","assign","load","Augmentations","ctor","log","constructors","fromJSON","Generic_toJSON","ctorName","obj","keys","index","Generic_fromJSON","min","lower","upper","gameContainer","document","addEventListener","getGameContainer","container","getElementById","removeEventListener","deepestPopupId","id","rootComponent","onClose","backgroundColor","createElement","class","display","mouseDown","event","srcElement","HTMLElement","removePopup","appendChild","ReactDOM","removeElementById","CityName","Factions","loadFactions","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","faction","AddToFactions","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","StdButton","hasTooltip","tooltip","disabled","addClasses","tooltipMarkup","onClick","onKeyUp","style","autoFocus","text","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","generateStatsDescription","addToFactions","factionList","augmentations","addToAllFactions","fac","facObj","toJSON","AllServers","ipExists","ip","createUniqueRandomIp","createRandomIp","AddToAllServers","server","serverIp","hostname","initForeignServers","homeComputer","networkLayers","propertiesToPatternMatch","toNumber","metadata","serverMetadata","serverParams","numOpenPortsRequired","organizationName","maxRamExponent","maxRam","pow","prop","Server","filename","literature","messages","specialName","SpecialServerIps","addIp","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","prestigeAllServers","member","loadAllServers","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","emit","iTutorialPrevStep","innerHTML","LiteratureNames","HackersStartingHandbook","gotitBtn","float","padding","innerText","clickListener","getHomeComputer","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","safetlyCreateUniqueServer","GetServerByHostname","numCycleForGrowth","growth","ajdGrowthRate","hackDifficulty","serverGrowthPercentage","serverGrowth","processSingleServerGrowth","threads","cores","calculateServerGrowth","oldMoneyAvailable","moneyAvailable","isValidNumber","moneyMax","usedCycles","fortify","ceil","prestigeHomeComputer","homeComp","hasBitflume","includes","Programs","BitFlume","runningScripts","isConnectedTo","ramUsed","NukeProgram","scripts","forEach","script","updateRamUsage","isValidIPAddress","getServerOnNetwork","isBackdoorInstalled","backdoorInstalled","EmployeePositions","Operations","Engineer","Business","Management","RandD","Unassigned","t_homeComp","adminRights","purchasedByPlayer","currentServer","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","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","focus","hackExpGain","strExpGain","defExpGain","dexExpGain","agiExpGain","chaExpGain","moneyGain","startWork","router","getWorkHackExpGain","getWorkStrExpGain","getWorkDefExpGain","getWorkDexExpGain","getWorkAgiExpGain","getWorkChaExpGain","getWorkRepGain","getWorkMoneyGain","timeNeededToCompleteWork","toWork","cancelationPenalty","specialIp","work","overMax","comp","Companies","influenceStockThroughCompanyWork","finishWork","cancelled","sing","playerReputation","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","fulcrumIP","SpecialServerNames","BitRunnersServer","fulcrumSecretServer","AevumFulcrumTechnologies","bitrunnersFac","bitrunnerIP","bitrunnersServer","theblackhandFac","tbhIP","TheBlackHandServer","blackhandServer","nitesecFac","nitesecIP","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","ram","tiandihuiFac","cybersecFac","cyberSecIP","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","Context","React","createContext","Router","use","useContext","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","BaseServer","super","createRandomString","requiredHackingSkill","baseDifficulty","minDifficulty","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","hasHacknetServers","purchaseHacknet","numOwned","getCostOfNextHacknetServer","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","lt","calculateLevelUpgradeCost","levelsToMax","gt","getMaxNumberRamUpgrades","calculateRamUpgradeCost","HacknetServer","log2","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","purchaseRamUpgrade","purchaseCoreUpgrade","purchaseCacheUpgrade","processHacknetEarnings","HashManager","hashes","updateHashRate","h","process","totalHashesGenerated","storeHashes","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","upgrade","upg","HashUpgrades","refundUpgrade","target","e","division","sciResearch","qty","changeRank","skillPoints","generateRandomContract","initCompanies","oldCompanies","companiesMetadata","loadCompanies","updateSourceFileFlags","sf","lvl","FulcrumSecretTechnologies","TheDarkArmyServer","DaedalusServer","WorldDaemon","SpecialServerIpsMap","prestigeSpecialServerIps","loadSpecialServerIps","initSpecialServerIps","PositionTypes","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","unlock","LevelUpgrade","priceMult","upgrades","IssueDividends","percent","dividendPercentage","SellMaterial","mat","price","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","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","isTrusted","AllGangs","power","territory","Tetrads","NiteSec","loadAllGangs","companyPositionMetadata","CompanyPosition","StockSymbols","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","updateHashCapacity","seconds","hashRate","prodMult","runScript","calculateHashGainRate","useStyles","makeStyles","root","borderBottom","small","width","TableCell","classes","Table","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","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","reputation","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","fn","getDifficulty","getMaxNumTries","getType","isSolution","solution","Promise","resolve","CodingContractPopup","Cancelled","onAttempt","val","Success","Failure","calculateHackingChance","difficultyMult","chance","calculateHackingExpGain","expGain","calculatePercentMoneyHacked","percentMoneyHacked","calculateHackingTime","skillFactor","calculateGrowTime","calculateWeakenTime","isScriptFilename","createStyles","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","toHackingMission","GameRoot","engine","terminal","setPage","useState","Work","Terminal","determineStartPage","setRerender","setFaction","flume","setFlume","quick","setQuick","setLocation","Infiltration","Location","Job","cinematicText","setCinematicText","rerender","old","useEffect","subscribe","ActiveScripts","Bladeburner","Stats","CreateProgram","DevMenu","Options","Gang","Hacknet","Milestones","Resleeves","CreateScript","Sleeves","Tutorial","City","Travel","BitVerse","BladeburnerCinematic","HackingMission","scrollTo","Provider","save","saveObject","saveGame","enter","enterBitNode","flexDirection","flexGrow","px","height","workerScripts","buyStockLong","buyStockShort","eventEmitterForReset","sellStockLong","sellStockShort","export","exportGame","forceKill","exportGameFn","onExport","installAugmentationsFn","makeNode","Node","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","inviteToFaction","InvitationPopup","factionInfo","getInfo","enemies","enemy","startHackingMission","mission","setInMission","hasAugmentationPrereqs","hasPrereqs","prereqAug","augmentationPriceMult","queuedAugmentation","getNextNeurofluxLevel","nextLevel","currLevel","processPassiveFactionRepGain","offersWork","getGangName","hRep","sRep","fRep","rate","removeLeadingSlash","removeTrailingSlash","isValidFilename","match","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","lastIndexOf","getFirstParentDirectory","getAllParentDirectories","lastSlash","isInRootDirectory","evaluateDirectoryPath","currPath","reconstructedPath","pop","evaluateFilePath","String","TTerminal","MoneyCost","Message","msg","recvd","count","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","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","killWorkerScript","rerenderUi","WorkerScript","stopAndCleanUpWorkerScript","RunningScript","killWorkerScriptByPid","pid","compareArrays","env","stopFlag","delay","clearTimeout","delayResolve","killNetscriptDelay","roundToTwo","ramUsage","runningScript","delete","WorkerScriptStartStopEventEmitter","removeWorkerScript","Adjuster","setValue","label","placeholder","add","subtract","tons","onChange","InputProps","startAdornment","title","transform","endAdornment","Aliases","GlobalAliases","loadAliases","loadGlobalAliases","printAliases","parseAliasDeclaration","dec","global","matches","trim","addGlobalAlias","addAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","netscriptDelay","setTimeoutRef","makeRuntimeRejectMsg","lineNum","resolveNetscriptRequestedThreads","functionName","requestedThreads","requestedThreadsAsInt","isScriptErrorMessage","Literature","ClickableTag","CopyableText","copy","tooltipClasses","textClasses","state","tooltipVisible","copyText","body","select","setSelectionRange","execCommand","removeChild","setState","setTimeout","render","tag","Tag_h1","Tag_span","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","inMission","currMission","bool","$","keydown","selectedNode","keyCode","actionButtons","click","NodeTypes","NodeActions","atk","def","maxhp","plyrCtrl","enmyCtrl","el","action","targetedCount","conn","started","playerCores","playerNodes","playerAtk","playerDef","enemyCores","enemyDatabases","enemyNodes","enemyAtk","enemyDef","miscNodes","availablePositions","jsplumbinstance","clearAllSelectedNodes","hackMissionInst","deselect","setPosition","y","setControlledByPlayer","classList","remove","setControlledByEnemy","untarget","createPageDom","cpuCores","setNodePosition","removeAvailablePosition","numFirewalls","numDatabases","totalNodes","xlimit","randMult","addOffset","setNodeRandomPosition","calculateDefenses","calculateAttacks","createMap","gain","headerText","inGameGuideBtn","startBtn","setAttribute","start","forfeitMission","finishMission","timer","actionsContainer","atkTooltip","scanTooltip","WeakenTooltip","fortifyTooltip","overflowTooltip","dropconnTooltip","playerStats","enemyStats","color","setActionButtonsActive","setActionButton","nodeType","endpoints","detachFrom","timeDisplay","setActionButtonsInactive","active","averageAttack","createNodeDomElement","configurePlayerNodeElement","nodeDiv","txtEl","updateNodeDomElement","getNodeFromElement","selectNodeWrapper","selectNode","multiselectNode","firstChild","configureEnemyNodeElement","nodeReachable","nodeReachableByEnemy","initJsPlumb","clearEventListeners","instance","jsPlumb","getInstance","DragOptions","cursor","zIndex","PaintStyle","gradient","stops","stroke","strokeWidth","makeSource","deleteEndpointsOnEmpty","maxConnections","anchor","connector","makeTarget","targetNode","connection","sourceEndpoint","targetEndpoint","dropAllConnectionsFromNode","allConns","getAllConnections","dropAllConnectionsToNode","beingTargeted","processNode","enemyAISelectAction","updateTimer","targetId","calcStats","plyr","enmyHacking","dmg","calculateAttackDamage","eff","calculateScanEffect","calculateWeakenEffect","calculateFortifyEffect","calculateOverflowEffect","conqueredByPlayer","isMiscNode","swapNodes","orig","dest","unmakeTarget","unmakeSource","rand","hacking","trunc","win","UpgradeType","gangMemberUpgradesMetadata","upgType","Weapon","dex","agi","Armor","Vehicle","Rootkit","MoneyRate","FactionWorkType","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","fnName","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","interpreter","Interpreter","scope","NetscriptFunctions","entry","tempWrapper","fnArgs","arguments","pseudoToNative","cb","fnPromise","then","catch","err","setProperty","createAsyncFunction","createNativeFunction","nativeToPseudo","reject","runInterpreter","errorMessage","startWorkerScript","parent","createAndAddWorkerScript","runningScriptObj","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","createProgressBarText","derived","progress","totalTicks","bars","dashes","tagName","tabIndex","setElementAnchor","checked","pattern","maxLength","setElementInput","for","htmlFor","setElementLabel","inputListener","changeListener","onkeyup","onkeydown","onfocus","setElementListeners","visibility","marginLeft","marginTop","border","cssFloat","fontSize","whiteSpace","top","left","overflow","setElementStyle","tooltipleft","tooltipsmall","tooltiplow","setElementTooltip","AceKeybindingSetting","CodeMirrorKeybindingSetting","CodeMirrorThemeSetting","EditorSetting","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","sll","prd","imp","totalExp","marketTa2Price","gainFavor","rolloverRep","getFavorGain","totalRep","favorToRep","newFavor","repToFavor","newRep","MaterialSizes","Water","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AICores","AutoupdatingStdButton","componentDidMount","intervalTime","interval","setInterval","tick","componentWillUnmount","clearInterval","prevState","aria-label","KeyHandler","elem","ref","onKeyDown","onFailure","automated","TimerProgress","withStyles","palette","background","paper","bar","transition","main","LinearProgress","GameTimer","setV","intervalId","onExpire","millis","item","xs","variant","interpolate","settings","out","lerpD","lerp","Trivial","Normal","Hard","Impossible","Map","getBuyTransactionCost","posType","getSellTransactionGain","processTransactionForecastMovement","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","GangMemberUpgrades","GangMemberUpgrade","createTaskTracker","Person","calculateStat","getFactionHackingWorkRepGain","updateStatLevels","commit","div","successRate","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","endQuote","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","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","failures","loss","damage","rankLoss","hpLoss","hpLost","calculateHospitalizationCost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","staminaGain","staminaBonus","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","breakdown","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","StatsTable","rows","wide","MuiTable","row","align","noWrap","midpoint","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","uuidv4","uuid","subscribers","sub","constructLocation","asciiArt","LocationsMetadata","addLocation","getArrow","setRedPillFlag","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","timePassed","confidence","dataMap","serv","timesGrown","host","offlineRunningTime","offlineExpGained","timesWeakened","coreBonus","findRunningScript","findRunningScriptByPid","TextFile","append","download","file","Blob","navigator","msSaveOrOpenBlob","url","URL","createObjectURL","revokeObjectURL","show","getTextFile","textFiles","createTextFile","fileName","lineNumber","sendMessage","forced","showMessage","serverHostname","addMessageToServer","checkForMessagesToSend","jumper0","Messages","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","redpill","redpillOwned","flightName","Flight","AddToAllMessages","loadMessages","initMessages","calculateExp","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","actionName","Action","SourceFile","bitnodeKey","bitnode","stealthIcon","xmlns","viewBox","fill","killIcon","updateMoneyGainRate","moneyGainRatePerSecond","totalMoneyGenerated","onlineTimeSeconds","HashUpgradesMetadata","HashUpgrade","vals","getStockMarket4SDataCost","getStockMarket4STixApiCost","ApplyToJobButton","getJobRequirementTooltip","BBAccordion","handleHeaderClick","panelOpened","panelInitiallyOpened","headerClass","headerContent","AccordionPanel","opened","panelClass","panelContent","shouldComponentUpdate","nextProps","Exploit","names","UndocumentedFunctionCall","EditSaveFile","PrototypeTampering","Unclickable","Bypass","ExploitName","StdButtonPurchased","DarkWebItems","DarkWebItem","HTTPWormProgram","SQLInjectProgram","DeepscanV2","AutolinkProgram","ServerProfilerProgram","ServerProfiler","RamCalculationErrorCode","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","removeElement","getRandomByte","ScriptLogPopup","close","unmountComponentAtNode","closeHandler","onMouseDown","preventDefault","clientX","clientY","offsetLeft","clientWidth","offsetTop","mouseMove","right","bottom","mouseUp","logs","logBoxCreate","ThemeEvents","refreshTheme","createTheme","colors","light","dark","default","typography","fontFamily","button","textTransform","components","MuiInputBase","styleOverrides","userSelect","MuiInput","borderBottomColor","underline","MuiInputLabel","MuiButton","borderRadius","MuiSelect","icon","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","maxWidth","MuiSlider","valueLabel","MuiDrawer","scrollbarWidth","paperAnchorDockedLeft","borderRight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","TTheme","children","injectFirst","sum","EPSILON","decay","inst","getSuccessChance","baseTime","skillFac","effDexterity","statFac","getTeamSuccessBonus","getActionTypeSkillSuccessBonus","est","popEst","clamp","real","low","high","competence","stat","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","BitburnerSaveObject","getSaveString","PlayerSave","stringify","TempAllServers","AllServersSave","CompaniesSave","FactionsSave","SpecialServerIpsSave","AliasesSave","GlobalAliasesSave","MessagesSave","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","AllGangsSave","btoa","unescape","encodeURIComponent","createStatusText","epochTime","now","bn","loadGame","decodeURIComponent","escape","atob","saveObj","ver","anyPlayer","positionName","evaluateVersionCompatibility","createNewUpdateText","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","nsFuncsGenerator","sanitizedPid","found","Environment","getScriptOnServer","shouldLog","func","program","orderType","refs","orderBook","executeOrder","isBuy","CorporationState","numUnlockUpgrades","CorporationUnlockUpgrades","CorporationUpgrades","upgradeMultipliers","addFunds","isFinite","getState","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","MaxSleevesFromCovenant","BaseCostPerSleeve","PopupId","createSleevePurchasesFromCovenantPopup","CovenantPurchasesRoot","closeFn","elementId","maintainMembership","keep","finishAction","WorldDaemonIP","DaedalusServerIP","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","modal","alignItems","justifyContent","boxShadow","maxHeight","Modal","open","closeAfterTransition","in","sx","Game","reachedLimit","reached","logEntry","logUpd","displayLog","recordHack","moneyGained","recordGrow","recordWeaken","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","filenameElem","calculateRamUsage","researchMetadata","canGetBonus","setLastExportBonus","unixTime","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","sanitizeRewardType","numFactions","randFaction","allJobs","servers","randIndex","atCapacity","hasResearch","emp","hireRandomEmployee","maxEne","maxHap","maxMor","perfMult","hasAutobrew","hasAutoparty","salaryPaid","mor","hap","ene","calculateEmployeeProductivity","employeeProd","prod","calculateProductivity","cre","sal","Employee","experience","creativity","efficiency","salary","assignEmployeeToJob","unassignEmployeeFromJob","minEne","minHap","getUpgrade","getUpgradeCost","getCost","capacity","newCap","Favor","sanitizedSource","Option","my","buttonText","infoText","formattedHours","getHours","formattedMinutes","getMinutes","getMonth","getDate","decimal","oldhp","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","async","request","put","deleteGame","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","awareness","popularity","reqMat","ProductRatingWeights","rat","Quality","Performance","Durability","Reliability","Aesthetics","Features","locations","TickerDisplayMode","StockTickersConfig","renderDisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","expandAllTickers","collapseAllTickers","changeWatchlistFilter","canAccessGang","getGangFaction","hasGangWith","startGang","Element","parentNode","debug","currentCity","onTravel","WorldMap","SuccessChance","morale","happiness","energy","det","cyclesUntilRaise","trainingEff","effCre","effEff","prodBase","createUI","panel","selector","options","selectedIndex","pro","findCrime","roughName","hasTorRouter","checkIfConnectedToDarkweb","darkwebIp","listAllDarkwebItems","buyDarkwebItem","itemName","ReputationRate","tooltiptext","reqRep","defaultInterpreter","toNative","pseudoObj","nativeObj","getProperty","hasProperty","properties","updateDynamicRam","ramCost","dynamicLoadedFns","dynamicRamUsage","safeGetServer","callingFnName","makeRuntimeErrorMsg","scriptArgs","getRunningScriptByPid","getCannotFindRunningScriptErrorMessage","checkTixApiAccess","callingFn","getStockFromSymbol","failOnHacknetServer","getHacknetNode","hi","errstack","userstack","stackline","dependency","dependencies","parseChromeStackline","lineMatch","funcMatch","chromeCall","parseFirefoxStackline","lio","firefoxCall","rejectMsg","checkFormulasAccess","extra","checkSingularityAccess","checkBladeburnerAccess","skipjoined","checkBladeburnerCity","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","getCodingContract","getContract","checkGangApiAccess","getGangMember","members","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","functions","maxNumNodes","hasUpgraded","production","timeOnline","totalProduction","getHashUpgradeLevel","hostnames","hackAmount","netscriptCanGrow","growTime","moneyBefore","moneyAfter","logGrowPercent","influenceStockThroughServerGrow","netscriptCanWeaken","weakenTime","tprintf","possibleLogs","tail","openPortCount","sshPortOpen","ftpPortOpen","smtpPortOpen","httpPortOpen","sqlPortOpen","argsForNewScript","scriptServer","spawnDelay","killByPid","scriptsRunning","ip1","ip2","destServer","currServ","txtFile","newFile","sourceScript","oldScript","newScript","grep","allFiles","processes","speed","purchaseCost","coreCost","levelCost","sanitizedPosType","orderPos","ltype","lpos","stockMarketOrders","forecast","hostnameStr","port","iport","status","removeFile","suc","offlineMoneyMade","argsForScript","tFormat","milliseconds","milliPrecision","textElement","yesBtn","noBtn","writeToScriptFile","writeToTextFile","overwritten","fail","cityname","darkweb","setcwd","other","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","repNeededToDonate","crimeRoughName","Slums","purchased","facname","augs","isHackingGang","moneyGainRate","getPower","respect","respectGainRate","getTerritory","territoryClashChance","territoryWarfareEngaged","wantedLevel","wanted","wantedLevelGainRate","wantedGainRate","cpy","earnedRespect","hack_exp","str_exp","def_exp","dex_exp","agi_exp","cha_exp","hack_mult","str_mult","def_mult","dex_mult","agi_mult","cha_mult","hack_asc_mult","calculateAscensionMult","hack_asc_points","str_asc_mult","str_asc_points","def_asc_mult","def_asc_points","dex_asc_mult","dex_asc_points","agi_asc_mult","agi_asc_points","cha_asc_mult","cha_asc_points","recruited","tasks","getAllTaskNames","unshift","memberName","taskName","assignToTask","getGangTask","equipName","equipment","buyUpgrade","canAscend","engage","otherGang","playerPower","worldHeader","expandIndustry","industryName","expandCity","unlockUpgrade","upgradeName","levelUpgrade","issueDividends","sellMaterial","sellProduct","discontinueProduct","setSmartSupply","enabled","setSmartSupplyUseLeftovers","buyMaterial","assignJob","hireEmployee","upgradeOfficeSize","purchaseWarehouse","upgradeWarehouse","buyCoffee","hireAdVert","makeProduct","exportMaterial","sourceDivision","targetDivision","targetCity","cancelExportMaterial","setMaterialMarketTA1","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","returnReward","is2DArray","answerComponents","creward","removeContract","tries","crimeName","sl","jobTitle","purchasableAugs","findSleevePurchasableAugs","formulas","basic","hackPercent","growPercent","hackTime","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","extraCores","hacknetNodeCost","constants","hacknetServers","hashGainRate","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","cacheUpgradeCost","extraCache","HScalculateCacheUpgradeCost","hashUpgradeCost","hacknetServerCost","HScalculateServerCost","bypass","doc","completely_unused_field","real_document","flags","Boolean","numDashes","ret","libarg","argv","fromEntries","getFunctionNames","functionNames","entries","storedTerritoryAndPowerCycles","notifyMemberDeath","cycles","processGains","processExperienceGains","processTerritoryAndPowerGains","moneyGains","respectGains","wantedLevelGains","justice","calculateRespectGain","calculateMoneyGain","calculateWantedLevelGain","baseWanted","recordEarnedRespect","oldWanted","newWanted","gangName","calculatePower","gainRoll","multiplicativeGain","additiveGain","others","thisGang","thisPwr","thisChance","calculateTerritoryGain","winGang","loseGang","powerBonus","territoryGain","clash","won","baseDeathChance","modifiedDeathChance","killMember","getRespectNeededToRecruitMember","GangMember","getWantedPenalty","memberTotal","totalRespect","lostRespect","ascend","getDiscount","discount","moneyHacked","orgName","percTotalMoneyHacked","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","pidCounter","tempCounter","has","MAX_SAFE_INTEGER","CinematicText","setI","done","setDone","lines","onDone","newI","auto","initValue","Hand","cards","addCards","removeByIndex","baseCheck","initialCheck","StockTickerTxButton","PlaceOrderPopup","setPrice","place","placeText","contractName","rs","specialReferenceIF","specialReferenceFOR","specialReferenceWHILE","memCheckGlobalKey","parseOnlyRamCalculate","dependencyMap","completedParses","Set","parseQueue","parseCode","moduleName","parseOnlyCalculateDeps","additionalModules","initialModule","nextModule","URLImportError","ImportError","unresolvedRefs","resolvedRefs","prefix","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","numServerGrowthCycles","adjGrowthRate","numServerGrowthCyclesAdjusted","ipaddress","byteRange","RegExp","litObj","Literatures","FactionInfo","offerHackingMission","augmentationRepRequirementMult","Illuminati","Daedalus","ECorp","MegaCorp","NWO","BitRunners","Silhouette","Netburners","CyberSec","Bladeburners","elems","getAvailableCreatePrograms","AugmentationAccordion","displayName","TeamSizePopup","baseRespect","baseMoney","hackWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","BlinkingCursor","purchaseResleeve","augKey","generateResleeves","Resleeve","baseNumAugs","numAugs","augKeys","randKey","randAug","ownedAugNames","availableAugs","isAvailableForSleeve","HashRate","createTravelPopup","TravelConfirmationPopup","ASCIIWorldMap","ListWorldMap","TravelAgencyRoot","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","reverse","howmany","opt_begin","opt_end","opt_separator","iLength","element","isa","jLength","searchElement","opt_fromIndex","STRING","fromCharCode","compareString","locales","localeCompare","separator","limit","jsList","regexp","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","ERROR","digits","toFixed","precision","toPrecision","radix","Function","UTC","rgx","populateRegExp","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","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_","TablePaginationActionsAll","useTheme","rowsPerPage","onPageChange","flexShrink","ml","direction","fma","ex","canAccessBladeburner","inBladeburner","startBladeburner","automate","cls","help","stop","createTreantMarkup","childrenArray","htmlClass","HTMLclass","findNode","setParent","chart","nodeStructure","queue","getMultiplierHelper","getProductProductionMultiplier","HeaderTab","current","textPrimary","textSecondary","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","startTampering","startUnclickable","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","CityTab","getSelectText","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","serverType","serverName","GenericLocation","locContent","locName","Hospital","Special","TechVendor","University","Casino","getLocationSpecificContent","ReactCard","card","hidden","Clubs","Spades","flexWrap","CursorPositions","positions","saveCursor","getCursor","column","libSource","allFactionAugs","factionAugs","factionAug","repFromDonation","TickerHeaderFormatData","longestName","longestSymbol","isNumber","ParseCommands","allCommands","flat","ParseCommand","inQuote","prevChar","escaped","TerminalHelpText","HelpTexts","analyze","backdoor","cat","check","expr","free","ifconfig","lscpu","mem","nano","sudov","unalias","outputHistory","startHack","startBackdoor","startAnalyze","finishHack","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","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","helper","evaluated","multed","Popup","keyDown","setAnswer","contractType","htmlID","requireHackingLevel","targetServer","BitFlumePopup","numAugReq","AevumGalacticCybersystems","Sector12DeltaOne","AevumPolice","NewTokyoNoodleBar","Sector12JoesGuns","generalMethods","hasAugmentation","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","elemId","newElem","cloneNode","replaceChild","statusElement","animation","maxClearanceLevel","startingSecurityLevel","AevumCasino","Sector12CityHall","WorldStockExchange","textfield","InteractiveTutorialRoot","contents","canNext","square","nobackground","Overview","setOpen","Loading","openedMixin","transitions","easing","sharp","duration","enteringScreen","overflowX","closedMixin","leavingScreen","breakpoints","up","Drawer","styled","shouldForwardProp","boxSizing","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","clickCreateScripts","clickStats","clickActiveScripts","clickCreateProgram","clickFactions","clickAugmentations","clickHacknet","clickCity","clickTravel","clickJob","clickBladeburner","clickGang","clickTutorial","handleShortcuts","altKey","timeout","unmountOnExit","clsx","badgeContent","AugmentationsRoot","InstalledAugmentationsAndSourceFiles","rerenderFlag","collapseAllHeaders","expandAllHeaders","sortByAcquirementTime","sortInOrder","listRef","ul","tickers","getElementsByClassName","ticker","HTMLButtonElement","contains","Alphabetically","collapseAllButtonsFn","expandAllButtonsFn","sortByAcquirementTimeFn","sortInOrderFn","InstalledAugmentations","sourceAugs","aug1","aug2","ListConfiguration","OwnedSourceFiles","sourceSfs","sf1","sf2","sfs","sfObj","SourceFileAccordion","SourceFileMinus1","PlayerMultipliers","augP","calculateAugmentedStats","MultiplierTable","textAlign","improvements","PurchasedAugmentations","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","TravelPopup","Line","Console","lastRef","useRef","consoleHistoryIndex","setConsoleHistoryIndex","scrollToBottom","scrollTop","scrollHeight","id2","currentTarget","prevCommand","AllPages","Header","GeneralActionPage","GeneralActionList","actions","GeneralActionElem","isActive","computedActionTimeCurrent","ContractPage","ContractList","ContractElem","estimatedSuccessChance","autolevelCheckboxId","OperationPage","OperationList","OperationElem","BlackOpPage","BlackOpList","blackopName","blackop","BlackOpElem","hasReqdRank","SkillPage","valid","onUpgrade","SkillList","SkillElem","canLevel","GangRoot","management","setManagement","ManagementSubpage","GangStats","territoryMult","territoryStr","BonusTime","CyclerPerSecond","bonusMillis","GangMemberList","setFilter","onRecruit","GangMemberUpgradePopup","NextReveal","GangMemberUpgradePanel","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","purchasedUpgrade","upgradeButton","asc","closePopup","createDescription","GangMemberAccordion","GangMemberAccordionContent","onAscend","onTaskChange","GangMemberStats","AscensionPopup","preAscend","getCurrentAscensionMults","postAscend","getAscensionMultsAfterAscend","TaskSelector","setCurrentTask","TaskDescription","RecruitButton","RecruitPopup","setName","recruit","TerritorySubpage","formatTerritory","gangNames","g","clashVictoryChance","otherGangTerritory","ExpandButton","industryType","NewIndustryPopup","setDivisionName","CorporationRoot","possibleIndustries","setIndustry","newIndustry","defaultValue","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","MainPanel","ExpandNewCityPopup","cityStateSetter","setCity","CityTabs","dropdown","countEmployee","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","nf","AutoAssignJob","numJob","numUnassigned","AutoManagement","vechain","totalMorale","totalHappiness","totalEnergy","totalSalary","avgMorale","avgHappiness","avgEnergy","IndustryOffice","employeeManualAssignMode","setEmployeeManualAssignMode","buttonStyle","hireEmployeeButtonClass","autohireEmployeeButtonClass","HireEmployeePopup","UpgradeOfficeSizePopup","ThrowPartyPopup","upgradeCost","upgradeCost15","maxMult","maxNum","multIncrease","upgradeCostMax","upgradeSize","UpgradeSizeButton","NameEmployeePopup","nameEmployee","HireEmployeeButton","mult1","mult2","mult3","emp1","emp2","emp3","setCost","IndustryOverview","renderUpgrade","makeProductButton","createProductButtonText","createProductPopupText","hasMaxProducts","MakeProductPopup","popupText","renderMakeProductButton","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","ResearchPopup","renderText","renderUpgrades","allCities","design","setDesign","marketing","setMarketing","tpe","boxContent","nodeAlign","rootOrientation","siblingSeparation","connectors","Treant","allResearch","sanitizedName","ProductComponent","nfB","hasUpgradeDashboard","sellButtonText","openSellProductPopup","SellProductPopup","limitProductionButtonText","openLimitProductProdutionPopup","LimitProductProductionPopup","openDiscontinueProductPopup","DiscontinueProductPopup","openProductMarketTaPopup","ProductMarketTaPopup","MaterialComponent","tutorial","purchaseButtonText","purchaseButtonClass","openPurchaseMaterialPopup","PurchaseMaterialPopup","openExportPopup","ExportPopup","openSellMaterialPopup","SellMaterialPopup","openMaterialMarketTaPopup","MaterialMarketTaPopup","shouldFlash","IndustryWarehouse","sizeUsageStyle","upgradeWarehouseClass","ratioLines","stateText","mats","isRelevantMaterial","SmartSupplyPopup","renderWarehouseUI","setAmt","removeExport","currentDivision","possibleCities","setLimit","limitProductProduction","MarketTA2","newCost","setNewCost","initialPrice","setChecked","iQty","setQty","setPx","BulkPurchaseText","parsedAmt","amount","matSize","BulkPurchase","setBuyAmt","bulkPurchase","purchaseMaterial","Leftover","matNameId","IndustryProductEquation","reqs","reqAmt","raw","tex","DividendsStats","issuedShares","Mult","Button","PublicButtons","PrivateButtons","BribeButton","Upgrades","fundingAvailable","fundingRound","findInvestorsClassName","findInvestorsTooltip","FindInvestorsPopup","GoPublicPopup","upgradeData","sellSharesOnCd","sellSharesClass","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesClass","issueNewSharesTooltip","SellSharesPopup","BuybackSharesPopup","IssueNewSharesPopup","IssueDividendsPopup","canBribe","bribeFactionsClass","BribeFactionPopup","playerEarnings","storedTime","LevelableUpgrade","UU","setStock","selectedFaction","setSelectedFaction","getRepText","bribe","setShares","sell","stockSaleResults","newSharePrice","newSharesUntilUpdate","buybackPrice","setPercent","EffectText","maxNewSharesUnrounded","maxNewShares","newShares","issueNewShares","privateShares","percShares","roundMultiplier","funding","investShares","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","setX","difficulties","setRight","generateLeftSide","char","shiftKey","getChar","guarding","setGuarding","words","makeAnswer","guess","setGuess","nextGuess","choices","positive","option","negative","array","shuffleArray","makeChoices","setIndex","newIndex","arrows","generateCode","symbols","puzzle","randChar","generatePuzzle","generateAnswer","setPos","cell","move","mines","minefield","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","reduce","fieldEquals","wiresmin","wiresmax","rules","colorNames","red","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","mx","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","setLocale","diagnosticOpen","setDiagnosticOpen","deleteGameOpen","setDeleteOpen","themeEditorOpen","setThemeEditorOpen","gutterBottom","sm","newValue","valueLabelDisplay","marks","control","method","src","alt","File","FileReader","FileList","ii","files","reader","onload","readAsText","onConfirm","confirmationText","ServerAccordion","component","Paper","FileDiagnosticModal","ips","ConfirmationModal","ColorEditor","setColor","hideTextfield","hex","ThemeEditorModal","SleeveRoot","SleeveElem","abc","setABC","doing","SleeveAugmentationsPopup","renderToStaticMarkup","EarningsTableElement","StatsElement","MoreStatsContent","MoreEarningsContent","universitySelectorOptions","gymSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","second","facInfo","universities","gyms","Synchronize","canDo","getABC","s0","setS0","setS1","setS2","validActions","detailsF","details","details2","detail","HacknetRoot","purchaseMultiplier","setPurchaseMultiplier","purchaseMultiplierOnClicks","multiplier","onClicks","HashUpgradePopup","GeneralInfo","HacknetNodeElem","purchaseMult","upgradeLevelContent","upgradeLevelClass","upgradeRamContent","upgradeRamClass","upgradeCoresContent","upgradeCoresClass","upgradeLevelCost","upgradeRamCost","upgradeCoreCost","effectText","costPerLevel","hasTargetServer","HacknetServerElem","upgradeCacheContent","upgradeCacheClass","upgradeCacheCost","upgradeElems","HacknetUpgradeElem","selectedServer","setSelectedServer","effect","btnClass","MultiplierButton","MultiplierButtons","buttons","btnProps","PlayerInfo","hasServers","PurchaseButton","CompanyLocation","isEmployedHere","QuitJobPopup","onQuit","GymLocation","btnStyle","trainStrength","trainDefense","trainDexterity","trainAgility","train","HospitalLocation","getHealed","currHp","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","createCorporationPopup","CreateCorporationPopup","handleBladeburner","new","handleResleeving","renderBladeburner","TechVendorLocation","openPurchaseServer","PurchaseServerPopup","purchaseServerButtons","RamButton","TorButton","purchaseTorRouter","CoresButton","maxCores","setHostname","tryToPurchaseServer","UniversityLocation","take","dataStructuresCost","networksCost","algorithmsCost","managementCost","leadershipCost","GameType","CasinoLocation","game","renderGames","Coin","Slots","Roulette","Blackjack","renderGame","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","backgroundColorStyles","formControlStyles","useInputStyles","focused","useLabelStyles","MuiTextField","InputLabelProps","CoinFlip","investment","playLock","play","updateInvestment","letter","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","rng","canPlay","lock","strategy","currentNumber","playerWin","getPayout","payLines","SlotMachine","locks","checkWinnings","getTable","stoppedOne","getPaylineData","payline","point","countSequence","CorruptableText","setContent","randFrom","randomize","LocationLetter","ASCIICity","locationLettersRegex","letterMap","lineElems","startI","endI","locationI","ListCity","locationButtons","LocationCity","ProgramsRoot","populate","exclude","lastFilename","lastCode","lastPosition","Root","editorRef","setFilename","setCode","setRAM","setOptions","insertSpaces","getPosition","textFile","updateRAM","maybeSave","ctrlKey","metaKey","newOptions","OptionsPopup","beforeMount","monaco","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","typescript","javascriptDefaults","addExtraLib","typescriptDefaults","onMount","editor","loading","defaultLanguage","newCode","pretty","beautifyCode","indent_with_tabs","indent_size","brace_style","setTheme","setInsertSpaces","points","unassignFromTask","statWeight","respectMult","calc","difficultyPerCycles","getGainedAscensionPoints","getAscensionResults","applyUpgrade","respectToDeduct","lookup","makeScriptBlob","loadedModule","uurls","shouldCompile","_getScriptUrls","depScript","seen","urlStack","transformedCode","unmodified","suffix","importedScript","urls","ScriptUrl","full","empty","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","paragraph","nopadding","overflowWrap","TerminalRoot","scrollHook","setKey","doScroll","hook","scrollIntoView","debounce","maxWait","TerminalInput","terminalInput","possibilities","setPossibilities","saveValue","moveTextCursor","inputLength","selectionStart","autoComplete","inputRef","spellCheck","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","iphostname","addAllMessages","t_dir","processFile","subdir","remaining","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","ActiveScriptsRoot","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setRowsPerPage","serverToScriptMap","filtered","dense","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","disablePadding","noborder","WorkerScriptAccordion","logClickHandler","killScript","onlineMps","onlineEps","FactionsRoot","openFaction","acceptInvitation","HackingMissionRoot","GangNames","FactionRoot","purchasingAugs","setPurchasingAugs","routeToPurchaseAugs","sleevePurchases","routeToMainPage","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","CreateGangPopup","manageGang","startHackingContracts","startFieldWork","startSecurityWork","AugmentationsPage","getAugs","switchSortOrder","newOrder","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","getAugsSorted","purchasable","purchaseableAugmentation","augListElems","ownedElem","Requirements","hasCost","PurchaseableAugmentation","btnTxt","PurchaseAugmentationPopup","placement","disableFocusListener","disableTouchListener","enterNextDelay","enterDelay","leaveDelay","leaveTouchDelay","DonateOption","donateAmt","setDonateAmt","noformat","Info","setUpdate","purchaseDisabled","upgradePanels","popup","CovenantSleeveUpgrades","CovenantSleeveMemoryUpgrade","changePurchaseAmount","purchaseMemory","maxMemory","getPurchaseCost","inputId","purchaseBtnDisabled","purchaseBtnContent","PopupCloseButton","PopupButton","handleClick","keyListener","LastEmployer","LastJob","Employers","Intelligence","bn5Stat","BladeburnerMults","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","parts","hacknetnode","hospitalization","infiltration","CharacterStats","moneyOpen","setMoneyOpen","timeRows","StockMarketRoot","blockStyleMarkup","InfoAndPurchases","handleClick4SMarketDataHelpTip","purchaseWseAccount","purchaseTixApiAccess","purchase4SMarketDataTixApiAccess","renderPurchaseWseAccountButton","renderPurchaseTixApiAccessButton","renderPurchase4SMarketDataButton","renderPurchase4SMarketDataTixApiAccessButton","StockTickers","AllStocks","watchlistFilter","watchlistSymbols","watchlist","sanitizedWatchlist","stockMarketProp","rerenderAllTickers","errorBoundaryProps","SelectorOrderType","StockTicker","Market","getBuyTransactionCostContent","getSellTransactionCostContent","handleBuyButtonClick","handleBuyMaxButtonClick","handleOrderTypeChange","handlePositionTypeChange","handleQuantityChange","handleSellButtonClick","handleSellAllButtonClick","getQuantity","Limit","Stop","playerMoney","toggle","nextElementSibling","hasOrderAccess","hasShortAccess","localesWithLongPriceFormat","StockTickerHeaderText","stockPriceFormat","spacesAllottedForStockPrice","spacesAfterStockName","spacesBeforePrice","hdrText","plusOrMinus","styleMarkup","StockTickerOrderList","StockTickerOrder","handleCancelOrderClick","posTxt","StockTickerPositionText","renderLongPosition","percentageGains","renderShortPosition","ErrorBoundary","errorInfo","hasError","componentDidCatch","componentStack","hasEventEmitter","unsubscribe","BitNodePortal","bitNode","cssClass","PortalPopup","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileFlags","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","cellNone","CharacterOverview","findIndex","srcFile","sourceFileObject","incMult","decMult","normalServer","evaledDir","zip","JSZip","zipFn","generateAsync","FileSaver","saveAs","sanitizedExpr","used","avail","usedPercent","numArgs","incorrectUsage","newPath","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","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","clickTheUnclickable","getComputedStyle","targetElement"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KAAKR,EAAaH,KACpDc,EAAQd,GAAYG,EAAYH,IAKlC,IAFGe,GAAqBA,EAAoBhB,GAEtCO,EAASC,QACdD,EAASU,OAATV,GAOD,OAHAW,EAAgBJ,KAAKK,MAAMD,EAAiBb,GAAkB,IAGvDe,IAER,SAASA,IAER,IADA,IAAIC,EACIf,EAAI,EAA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AYnmC,YAE5D54E,KAAKkjI,2BAA2BljI,KAAKuhI,MAAO,cAAeL,GAE3DA,EAAU,WAER,OADAltH,MAAM9Y,UAAUitB,KAAK/sB,KAAK4E,KAAK++G,YACxB/+G,MAETA,KAAKkjI,2BAA2BljI,KAAKuhI,MAAO,OAAQL,GAEpDlhI,KAAKo+H,WAAW9iI,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,8CAC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,IACA,2HACA,4HACA,IACA,+BACA,IACA,8GACA,IACA,uHACA,uCACA,IACA,uDACA,KAEFwtE,QAAS,CACP,SACA,IACA,0GACA,mHACA,kHACA,iCAEFC,SAAU,CACR,WACA,IACA,6FACA,IACA,+BACA,KAEF9tF,IAAK,CACH,qBACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,yGAEF+tF,IAAK,CACH,aACA,IACA,6EACA,IACA,aACA,IACA,cACA,IACA,mBAEFroC,GAAI,CACF,WACA,IACA,yGACA,iFACA,IACA,qBACA,IACA,WACA,IACA,UAEFsoC,MAAO,CACL,gCACA,IACA,+HACA,uDACA,kIACA,IACA,gCACA,IACA,gGACA,IACA,mCAEF14H,MAAO,CACL,QACA,IACA,mIACA,wIAEF6wH,IAAK,CACH,MACA,IACA,mIACA,0IAEFrvH,QAAS,CACP,wBACA,IACA,6GACA,sIACA,kEAEF84E,SAAU,CACR,8BACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEFq+C,KAAM,CACJ,iCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,oBACA,IACA,sFAEFC,KAAM,CACJ,OACA,IACA,iIACA,iCAEF79H,KAAM,CACJ,OACA,IACA,uHACA,KAEF+1H,KAAM,CACJ,iBACA,IACA,yHACA,0HACA,mEACA,IACA,aACA,IACA,qBAEFnnG,KAAM,CACJ,2GAEFzR,SAAU,CAAC,WAAY,IAAK,6CAC5B2gH,SAAU,CAAC,WAAY,IAAK,+CAC5Bt8H,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,8BAEFm8H,MAAO,CAAC,QAAS,IAAK,yDAEtBC,IAAK,CACH,qCACA,IACA,6HACA,2HACA,gFACA,IACA,iBACA,IACA,uBACA,IACA,4HACA,kFAEF7iF,GAAI,CACF,kBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,iEACA,IACA,iCAEF8iF,KAAM,CACJ,mBACA,IACA,sGACA,2FACA,mBAEFp8H,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,KAEFtB,KAAM,CACJ,OACA,IACA,6HACA,4CAEF,eAAgB,CACd,4BACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,yGACA,UACA,IACA,2GACA,uEAEF4B,IAAK,CACH,iCACA,IACA,2EACA,oGACA,oCACA,kFAEFu8H,MAAO,CAAC,QAAS,IAAK,qEAEtBtyB,KAAM,CACJ,+BACA,IACA,oHACA,uHACA,oEACA,IACA,0BACA,IACA,gFACA,IACA,4BAEF9mC,IAAK,CACH,MACA,IACA,yGACA,gCAEFq5D,QAAS,CACP,uBACA,IACA,mFACA,IACA,iDACA,IACA,gBACA,IACA,kCACA,IACA,YACA,IACA,mGAEFl4H,KAAM,CACJ,2BACA,IACA,iGACA,oGACA,0CACA,IACA,mGACA,iDACA,IACA,kG,2wBClVG,MAAMk7C,GAA8B,+BAEjB,MAFiB,yBAId,IAJc,8BAKnB,GALmB,wBAON,CAAC,IAAI6wC,IAAQ,cAAa/nG,IAAUC,QAAW,aAPzC,wBAU1B,GAV0B,kBAc/B,KAEVugD,QAAQjZ,EAAiB3gB,EAAiB8oG,GACpB,OAAhBxyH,KAAKstE,SACTttE,KAAKstE,OAAO09B,UAAaloG,IAAUE,WAAawvH,EAAU,IACtDxyH,KAAKstE,OAAO09B,SAAW,KAAMhrG,KAAK4v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Z,YACA,SACA,MACA,cACA,QACA,SACA,YACA,SACA,MACA,OACA,SACA,OACA,UACA,WACA,OACA,YACA,UACA,SACA,MACA,MACA,OACA,QACA,YACA,UACA,KACA,SACA,SACA,YACA,QACA,YACA,UACA,UACA,WACA,WACA,YACA,SACA,OACA,MACA,aACA,aACA,YACA,OACA,SACA,WACA,QACA,aACA,SACA,UACA,cACA,UACA,OACA,MACA,WACA,SACA,cACA,MACA,aACA,WACA,OACA,MACA,UACA,QACA,WACA,UACA,aACA,QACA,UACA,MACA,OACA,SACA,WACA,WACA,UACA,QACA,cACA,cACA,YACA,SACA,OACA,SACA,QACA,WACA,WACA,WACA,OACA,SACA,WACA,YACA,OACA,OACA,YACA,YACA,OACA,QACA,UACA,YACA,WACA,aACA,YACA,OACA,WACA,WACA,SACA,MACA,WACA,UACA,SACA,gBACA,OACA,QACA,UACA,QACA,QACA,UACA,YACA,QACA,YACA,UACA,QACA,SACA,SACA,QACA,UACA,cACA,QACA,aACA,MACA,UACA,OACA,WACA,WACA,UACA,SACA,aACA,YACA,SACA,SACA,SACA,OACA,WACA,QACA,OACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,SACA,QACA,UACA,UACA,UACA,UACA,aACA,WACA,QACA,SACA,MACA,WACA,SACA,aACA,UACA,MACA,OACA,SACA,UACA,OACA,OACA,UACA,SACA,aACA,SACA,SACA,SACA,SACA,SACA,WACA,SACA,YACA,QACA,QACA,YACA,WACA,oBACA,WACA,OACA,UACA,cACA,UACA,SACA,UACA,gBACA,OACA,SACA,QACA,MACA,WACA,WACA,WACA,cACA,SACA,UACA,QACA,eACA,WACA,OACA,OACA,SACA,MACA,OACA,iBACA,WACA,UACA,UACA,UACA,iBACA,QACA,MACA,YACA,UACA,SACA,OACA,SACA,UACA,WACA,YACA,cACA,MACA,OACA,MACA,MACA,Q,6BCrTF,yFAaA,MAAMR,EAKF,CACFxiF,QAAS,CAAEzS,MAAO,KAAO/pB,KAAM,GAC/By8B,OAAQ,CAAE1S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AASK,oBAAoB,mBAAoBopK,IAJ/C13L,QAAQkrB,MAAM,qE,4FCbpB,sEAcA,SAASuvC,IACPslC,cACA1wE,IAAS66C,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFj8C,SAASI,eAAe,uBAb5BgB,IAAS66C,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFj8C,SAASI,eAAe,uBAcxByxE,IAAYllC,UAAUH,I,2NCzBxB,yO","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([1208,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 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","/**\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 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 IntelligenceHackingMissionBaseExpGain: number;\n HackingMissionRepToDiffConversion: number;\n HackingMissionRepToRewardConversion: number;\n HackingMissionSpamTimeIncrease: number;\n HackingMissionTransferAttackIncrease: number;\n HackingMissionMiscDefenseIncrease: number;\n HackingMissionDifficultyToHacking: number;\n HackingMissionHowToPlay: string;\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.54.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 IntelligenceHackingMissionBaseExpGain: 3, // Hacking Mission difficulty multiplied by this to get exp gain\n\n // Hacking Missions\n // TODO Move this into Hacking Mission implementation\n HackingMissionRepToDiffConversion: 10000, // Faction rep is divided by this to get mission difficulty\n HackingMissionRepToRewardConversion: 7, // Faction rep divided byt his to get mission rep reward\n HackingMissionSpamTimeIncrease: 25000, // How much time limit increase is gained when conquering a Spam Node (ms)\n HackingMissionTransferAttackIncrease: 1.05, // Multiplier by which the attack for all Core Nodes is increased when conquering a Transfer Node\n HackingMissionMiscDefenseIncrease: 1.05, // The amount by which every misc node's defense is multiplied when one is conquered\n HackingMissionDifficultyToHacking: 135, // Difficulty is multiplied by this to determine enemy's \"hacking\" level (to determine effects of scan/attack, etc)\n HackingMissionHowToPlay:\n \"Hacking missions are a minigame that, if won, will reward you with faction reputation.<br><br>\" +\n \"In this game you control a set of Nodes and use them to try and defeat an enemy. Your Nodes \" +\n \"are colored blue, while the enemy's are red. There are also other nodes on the map colored gray \" +\n \"that initially belong to neither you nor the enemy. The goal of the game is \" +\n \"to capture all of the enemy's Database nodes within the time limit. \" +\n \"If you fail to do this, you will lose.<br><br>\" +\n \"Each Node has three stats: Attack, Defense, and HP. There are five different actions that \" +\n \"a Node can take:<br><br> \" +\n \"Attack - Targets an enemy Node and lowers its HP. The effectiveness is determined by the owner's Attack, the Player's \" +\n \"hacking level, and the enemy's defense.<br><br>\" +\n \"Scan - Targets an enemy Node and lowers its Defense. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the \" +\n \"enemy's defense.<br><br>\" +\n \"Weaken - Targets an enemy Node and lowers its Attack. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's \" +\n \"defense.<br><br>\" +\n \"Fortify - Raises the Node's Defense. The effectiveness is determined by your hacking level.<br><br>\" +\n \"Overflow - Raises the Node's Attack but lowers its Defense. The effectiveness is determined by your hacking level.<br><br>\" +\n \"Note that when determining the effectiveness of the above actions, the TOTAL Attack or Defense of the team is used, not just the \" +\n \"Attack/Defense of the individual Node that is performing the action.<br><br>\" +\n \"To capture a Node, you must lower its HP down to 0.<br><br>\" +\n \"There are six different types of Nodes:<br><br>\" +\n \"CPU Core - These are your main Nodes that are used to perform actions. Capable of performing every action<br><br>\" +\n \"Firewall - Nodes with high defense. These Nodes can 'Fortify'<br><br>\" +\n \"Database - A special type of Node. The player's objective is to conquer all of the enemy's Database Nodes within \" +\n \"the time limit. These Nodes cannot perform any actions<br><br>\" +\n \"Spam - Conquering one of these Nodes will slow the enemy's trace, giving the player additional time to complete \" +\n \"the mission. These Nodes cannot perform any actions<br><br>\" +\n \"Transfer - Conquering one of these nodes will increase the Attack of all of your CPU Cores by a small fixed percentage. \" +\n \"These Nodes are capable of performing every action except the 'Attack' action<br><br>\" +\n \"Shield - Nodes with high defense. These Nodes can 'Fortify'<br><br>\" +\n \"To assign an action to a Node, you must first select one of your Nodes. This can be done by simply clicking on it. Double-clicking \" +\n \"a node will select all of your Nodes of the same type (e.g. select all CPU Core Nodes or all Transfer Nodes). Note that only Nodes \" +\n \"that can perform actions (CPU Core, Transfer, Shield, Firewall) can be selected. Selected Nodes will be denoted with a white highlight. After selecting a Node or multiple Nodes, \" +\n \"select its action using the Action Buttons near the top of the screen. Every action also has a corresponding keyboard \" +\n \"shortcut.<br><br>\" +\n \"For certain actions such as attacking, scanning, and weakening, the Node performing the action must have a target. To target \" +\n \"another node, simply click-and-drag from the 'source' Node to a target. A Node can only have one target, and you can target \" +\n \"any Node that is adjacent to one of your Nodes (immediately above, below, or to the side. NOT diagonal). Furthermore, only CPU Cores and Transfer Nodes \" +\n \"can target, since they are the only ones that can perform the related actions. To remove a target, you can simply click on the line that represents \" +\n \"the connection between one of your Nodes and its target. Alternatively, you can select the 'source' Node and click the 'Drop Connection' button, \" +\n \"or press 'd'.<br><br>\" +\n \"Other Notes:<br><br>\" +\n \"-Whenever a miscellenaous Node (not owned by the player or enemy) is conquered, the defense of all remaining miscellaneous Nodes that \" +\n \"are not actively being targeted will increase by a fixed percentage.<br><br>\" +\n \"-Whenever a Node is conquered, its stats are significantly reduced<br><br>\" +\n \"-Miscellaneous Nodes slowly raise their defense over time<br><br>\" +\n \"-Nodes slowly regenerate health over time.\",\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 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.54.0 - 2021-09-20 One big react node (hydroflame & community)\n -------------------------------------------\n\n ** UI **\n\n * The UI is now completely(ish) in react and I'm starting to implement\n Material-UI everywhere. This will help make the game feel more consistent.\n * Major help from (@threehams)\n * New Terminal\n * New Active Scripts page\n * New sidebar.\n * New Character overview\n * New tutorial\n * New options page\n * New create program page (@Nolshine)\n\n ** Netscript ** \n\n * Add companyName to getPlayer\n\n ** Factions **\n\n * Megacorp factions are no longer removed when installing.\n\n ** Corporation **\n\n * All research tooltips are always visible.\n * Smart supply is enabled by default if purchased (@Nolshine)\n\n ** Misc. **\n\n * Fix \"Game saved\" animation. (@Nolshine)\n * Update commitCrime documentation (@Tryneus)\n * Fix logbox scrolling weird (@Nolshine)\n * Fix weird scrolling in corporations (@BartKoppelmans)\n * Fix typo (@BartKoppelmans & @Nolshine)\n * Delete game now has a confirmation modal (@Nolshine)\n * Fix issue where skills would not get properly updated when entering new\n BN. (@Nolshine)\n * Convert create gang to popup (@vmesecher)\n * Fixed a bug that prevented travel to Sector-12 and New Tokyo when not using\n ASCII art.\n * nerf noodle bar\n`,\n\n /*\n\n\n*/\n};\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 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 * 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\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 { createPopup } from \"../src/ui/React/createPopup\";\nimport { getRandomInt } from \"./helpers/getRandomInt\";\n\nimport React from \"react\";\n\ninterface IProps {\n content: JSX.Element;\n}\n\nfunction MessagePopup(props: IProps): React.ReactElement {\n return <>{props.content}</>;\n}\n\nexport function dialogBoxCreate(txt: string | JSX.Element, preformatted = false): void {\n const popupId =\n `popup-` +\n Array.from(Array(16))\n .map(() => `${getRandomInt(0, 9)}`)\n .join(\"\");\n if (typeof txt === \"string\") {\n if (preformatted) {\n // For text files as they are often computed data that\n // shouldn't be wrapped and should retain tabstops.\n createPopup(popupId, MessagePopup, {\n content: <pre dangerouslySetInnerHTML={{ __html: txt }} />,\n });\n } else {\n createPopup(popupId, MessagePopup, {\n content: (\n <p\n dangerouslySetInnerHTML={{\n __html: txt.replace(/(?:\\r\\n|\\r|\\n)/g, \"<br />\"),\n }}\n />\n ),\n });\n }\n } else {\n createPopup(popupId, MessagePopup, {\n content: txt,\n });\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 { EqualityFunc } from \"../src/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 * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n money: number | string;\n player?: IPlayer;\n}\nexport function Money(props: IProps): JSX.Element {\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={\"unbuyable samefont\"}>{numeralWrapper.formatMoney(props.money)}</span>;\n }\n return (\n <span className={\"money-gold samefont\"}>\n {typeof props.money === \"number\" ? numeralWrapper.formatMoney(props.money) : props.money}\n </span>\n );\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 * 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 };\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\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 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 },\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 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\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 },\n init() {\n Object.assign(Settings, defaultSettings);\n },\n load(saveString: string) {\n Object.assign(Settings, JSON.parse(saveString));\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\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.\nfunction Reviver(key, value) {\n var ctor;\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 ctor = Reviver.constructors[value.ctor] || window[value.ctor];\n\n if (typeof ctor === \"function\" && typeof ctor.fromJSON === \"function\") {\n return ctor.fromJSON(value);\n }\n }\n return value;\n}\nReviver.constructors = {}; // A list of constructors the smart reviver should know about\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)\nfunction Generic_toJSON(ctorName, obj, keys) {\n var data, key;\n\n if (!keys) {\n keys = Object.keys(obj); // Only \"own\" properties are included\n }\n\n data = {};\n for (let index = 0; index < keys.length; ++index) {\n 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\nfunction Generic_fromJSON(ctor, data) {\n var obj, name;\n\n obj = new ctor();\n for (name in data) {\n obj[name] = data[name];\n }\n return obj;\n}\n\nexport { Reviver, Generic_toJSON, Generic_fromJSON };\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","/**\n * Create a pop-up dialog box using React.\n *\n * Calling this function with the same ID and React Root Component will trigger a re-render\n *\n * @param id The (hopefully) unique identifier for the popup container\n * @param rootComponent Root React Component for the content (NOT the popup containers themselves)\n */\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\n\nimport { Popup } from \"./Popup\";\n\nimport { createElement } from \"../../../utils/uiHelpers/createElement\";\nimport { removeElementById } from \"../../../utils/uiHelpers/removeElementById\";\n\nlet gameContainer: HTMLElement;\n\n(function () {\n function getGameContainer(): void {\n const container = document.getElementById(\"entire-game-container\");\n if (container == null) {\n throw new Error(`Failed to find game container DOM element`);\n }\n\n gameContainer = container;\n document.removeEventListener(\"DOMContentLoaded\", getGameContainer);\n }\n\n document.addEventListener(\"DOMContentLoaded\", getGameContainer);\n})();\n\n// This variable is used to avoid setting the semi-transparent background\n// several times on top of one another. Sometimes there's several popup at once.\nlet deepestPopupId = \"\";\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function createPopup<T>(\n id: string,\n rootComponent: (props: T) => React.ReactElement,\n props: T,\n onClose?: () => void,\n): HTMLElement | null {\n let container = document.getElementById(id);\n if (container == null) {\n function onClick(this: HTMLElement, event: MouseEvent): void {\n if (!event.srcElement) return;\n if (!(event.srcElement instanceof HTMLElement)) return;\n const clickedId = (event.srcElement as HTMLElement).id;\n if (clickedId !== id) return;\n removePopup(id);\n if (onClose) onClose();\n }\n const backgroundColor = deepestPopupId === \"\" ? \"rgba(0,0,0,0.5)\" : \"rgba(0,0,0,0)\";\n container = createElement(\"div\", {\n class: \"popup-box-container\",\n display: \"flex\",\n id: id,\n backgroundColor: backgroundColor,\n mouseDown: onClick,\n });\n\n gameContainer.appendChild(container);\n }\n\n if (deepestPopupId === \"\") deepestPopupId = id;\n ReactDOM.render(\n <Popup\n content={rootComponent}\n id={id}\n props={props}\n removePopup={() => {\n removePopup(id);\n if (onClose) onClose();\n }}\n />,\n container,\n );\n\n return container;\n}\n\n/**\n * Closes a popup created with the createPopup() function above\n */\nexport function removePopup(id: string): void {\n const content = document.getElementById(`${id}`);\n if (content == null) return;\n\n ReactDOM.unmountComponentAtNode(content);\n\n removeElementById(id);\n removeElementById(`${id}-close`);\n if (id === deepestPopupId) deepestPopupId = \"\";\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","/**\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}\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","/**\n * Basic stateless button\n * Uses the 'std-button' css class\n */\nimport * as React from \"react\";\n\ninterface IStdButtonProps {\n addClasses?: string;\n autoFocus?: boolean;\n disabled?: boolean;\n id?: string;\n onClick?: (e: React.MouseEvent<HTMLElement>) => any;\n onKeyUp?: (e: React.KeyboardEvent<HTMLElement>) => any;\n style?: any;\n text: string | JSX.Element;\n tooltip?: string | JSX.Element;\n}\n\ntype IInnerHTMLMarkup = {\n __html: string;\n};\n\nexport function StdButton(props: IStdButtonProps): React.ReactElement {\n const hasTooltip = props.tooltip != null && props.tooltip !== \"\";\n let className = props.disabled ? \"std-button-disabled\" : \"std-button\";\n if (hasTooltip) {\n className += \" tooltip\";\n }\n\n if (typeof props.addClasses === \"string\") {\n className += ` ${props.addClasses}`;\n }\n\n // Tooltip will be set using inner HTML\n let tooltip;\n if (hasTooltip) {\n if (typeof props.tooltip === \"string\") {\n const tooltipMarkup: IInnerHTMLMarkup = {\n __html: props.tooltip,\n };\n tooltip = <span className={\"tooltiptext\"} dangerouslySetInnerHTML={tooltipMarkup}></span>;\n } else {\n tooltip = <span className={\"tooltiptext\"}>{props.tooltip}</span>;\n }\n }\n\n return (\n <button\n className={className}\n id={props.id}\n onClick={props.onClick}\n onKeyUp={props.onKeyUp}\n style={props.style}\n autoFocus={props.autoFocus}\n >\n {props.text}\n {hasTooltip && tooltip}\n </button>\n );\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 CreateScript,\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 HackingMission,\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 toHackingMission(faction: Faction): 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;\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;\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) this.stats = params.stats;\n else this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);\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","import { Server } from \"./Server\";\nimport { SpecialServerIps } from \"./SpecialServerIps\";\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\";\n\n/**\n * Map of all Servers that exist in the game\n * Key (string) = IP\n * Value = Server object\n */\nexport let AllServers: IMap<Server | HacknetServer> = {};\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 const serverIp = server.ip;\n if (ipExists(serverIp)) {\n console.warn(`IP of server that's being added: ${serverIp}`);\n console.warn(`Hostname of the server thats being added: ${server.hostname}`);\n console.warn(`The server that already has this IP is: ${AllServers[serverIp].hostname}`);\n throw new Error(\"Error: Trying to add a server with an existing IP\");\n }\n\n AllServers[serverIp] = server;\n}\n\ninterface IServerParams {\n hackDifficulty?: number;\n hostname: string;\n ip: string;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired: number;\n organizationName: string;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n\n [key: string]: any;\n}\n\nexport function initForeignServers(homeComputer: Server): void {\n /* Create a randomized network for all the foreign servers */\n //Groupings for creating a randomized network\n const networkLayers: Server[][] = [];\n for (let i = 0; i < 15; i++) {\n networkLayers.push([]);\n }\n\n // Essentially any property that is of type 'number | IMinMaxRange'\n const propertiesToPatternMatch: string[] = [\n \"hackDifficulty\",\n \"moneyAvailable\",\n \"requiredHackingSkill\",\n \"serverGrowth\",\n ];\n\n const toNumber = (value: any): any => {\n switch (typeof value) {\n case \"number\":\n return value;\n case \"object\":\n return getRandomInt(value.min, value.max);\n default:\n throw Error(`Do not know how to convert the type '${typeof value}' to a number`);\n }\n };\n\n for (const metadata of serverMetadata) {\n const serverParams: IServerParams = {\n hostname: metadata.hostname,\n ip: createUniqueRandomIp(),\n numOpenPortsRequired: metadata.numOpenPortsRequired,\n organizationName: metadata.organizationName,\n };\n\n if (metadata.maxRamExponent !== undefined) {\n serverParams.maxRam = Math.pow(2, toNumber(metadata.maxRamExponent));\n }\n\n for (const prop of propertiesToPatternMatch) {\n if (metadata[prop] !== undefined) {\n serverParams[prop] = toNumber(metadata[prop]);\n }\n }\n\n const server = new Server(serverParams);\n for (const filename of metadata.literature || []) {\n server.messages.push(filename);\n }\n\n if (metadata.specialName !== undefined) {\n SpecialServerIps.addIp(metadata.specialName, server.ip);\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.ip);\n server2.serversOnNetwork.push(server1.ip);\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","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.6,\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 | string | undefined;\n x1: number;\n x5: number;\n x10: number;\n MAX: string;\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\nimport { createElement } from \"../utils/uiHelpers/createElement\";\nimport { createPopup } from \"../utils/uiHelpers/createPopup\";\nimport { removeElementById } from \"../utils/uiHelpers/removeElementById\";\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 // Create a popup with final introductory stuff\n const popupId = \"interactive-tutorial-ending-popup\";\n const txt = createElement(\"p\", {\n innerHTML:\n \"If you are new to the game, the following links may be useful for you!<br><br>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html' target='_blank'>Getting Started Guide</a>\" +\n \"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/' target='_blank'>Documentation</a><br><br>\" +\n \"The Beginner's Guide to Hacking was added to your home computer! It contains some tips/pointers for starting out with the game. \" +\n \"To read it, go to Terminal and enter<br><br>cat \" +\n LiteratureNames.HackersStartingHandbook,\n });\n const gotitBtn = createElement(\"a\", {\n class: \"a-link-button\",\n float: \"right\",\n padding: \"6px\",\n innerText: \"Got it!\",\n clickListener: () => {\n removeElementById(popupId);\n },\n });\n createPopup(popupId, [txt, gotitBtn]);\n\n Player.getHomeComputer().messages.push(LiteratureNames.HackersStartingHandbook);\n ITutorialEvents.emit();\n}\n\nexport { iTutorialSteps, iTutorialEnd, iTutorialStart, iTutorialNextStep, ITutorial, iTutorialPrevStep };\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 { AllServers, 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 { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Programs } from \"../Programs/Programs\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\n\nimport { isValidNumber } from \"../utils/helpers/isValidNumber\";\nimport { isValidIPAddress } from \"../../utils/helpers/isValidIPAddress\";\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 (GetServerByHostname(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 (GetServerByHostname(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): 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 cycles =\n Math.log(growth) /\n (Math.log(ajdGrowthRate) * p.hacking_grow_mult * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate);\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 *= 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);\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 server object with corresponding hostname\n// Relatively slow, would rather not use this a lot\nexport function GetServerByHostname(hostname: string): Server | HacknetServer | null {\n for (const ip in AllServers) {\n if (AllServers.hasOwnProperty(ip)) {\n if (AllServers[ip].hostname == hostname) {\n return AllServers[ip];\n }\n }\n }\n\n return null;\n}\n\n//Get server by IP or hostname. Returns null if invalid\nexport function getServer(s: string): Server | HacknetServer | null {\n if (!isValidIPAddress(s)) {\n return GetServerByHostname(s);\n }\n if (AllServers[s] !== undefined) {\n return AllServers[s];\n }\n\n return null;\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): Server | HacknetServer | 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 AllServers[server.serversOnNetwork[i]];\n}\n\nexport function isBackdoorInstalled(server: Server | HacknetServer): boolean {\n if (\"backdoorInstalled\" in server) {\n return server.backdoorInstalled;\n }\n return false;\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","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 } 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 { ICodingContractReward } from \"../../CodingContracts\";\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 { hasHacknetServers } from \"../../Hacknet/HacknetHelpers\";\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 { AllServers, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { safetlyCreateUniqueServer } from \"../../Server/ServerHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SpecialServerIps, SpecialServerNames } from \"../../Server/SpecialServerIps\";\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\";\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 \"../../../utils/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) {\n /* Initialize Player's home computer */\n var 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.homeComputer = t_homeComp.ip;\n this.currentServer = t_homeComp.ip;\n AddToAllServers(t_homeComp);\n\n this.getHomeComputer().programs.push(Programs.NukeProgram.name);\n}\n\nexport function prestigeAugmentation(this: IPlayer) {\n var homeComp = this.getHomeComputer();\n this.currentServer = homeComp.ip;\n this.homeComputer = homeComp.ip;\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) {\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 var 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 (var 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) {\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) {\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) {\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) {\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) {\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\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) {\n const focusBonus = this.focus ? 1 : 0.8;\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) {\n const specialIp = SpecialServerIps[this.companyName];\n if (typeof specialIp === \"string\" && specialIp !== \"\") {\n const server = AllServers[specialIp];\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 var 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(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 var 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 var 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(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 var 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 var 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) {\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) {\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) {\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) {\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(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 var 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 var 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 var 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 (var i = 0; i < this.getHomeComputer().programs.length; ++i) {\n var programFile = this.getHomeComputer().programs[i];\n if (programFile.startsWith(programName) && programFile.endsWith(\"%-INC\")) {\n var res = programFile.split(\"-\");\n if (res.length != 3) {\n break;\n }\n var 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 var reqLvl = this.createProgramReqLvl;\n var 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 var 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 var perc = (Math.floor((this.timeWorkedCreateProgram / this.timeNeededToCompleteWork) * 10000) / 100).toString();\n var 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 var cost = 0;\n var 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 var 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&nbsp;\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 let 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var offset = company.jobStatReqOffset;\n var reqHacking = position.requiredHacking > 0 ? position.requiredHacking + offset : 0;\n var reqStrength = position.requiredStrength > 0 ? position.requiredStrength + offset : 0;\n var reqDefense = position.requiredDefense > 0 ? position.requiredDefense + offset : 0;\n var reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n var reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n var 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 var 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 var srcFileKey = \"SourceFile\" + this.sourceFiles[i].n;\n var 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 let invitedFactions: Faction[] = []; //Array which will hold all Factions the player should be invited to\n\n var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 fulcrumIP = SpecialServerIps[SpecialServerNames.BitRunnersServer];\n if (typeof fulcrumIP !== \"string\") throw new Error(\"Fulcrum Secret Technologies should be string\");\n const fulcrumSecretServer = AllServers[fulcrumIP];\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 bitrunnerIP = SpecialServerIps[SpecialServerNames.BitRunnersServer];\n if (typeof bitrunnerIP !== \"string\") throw new Error(\"BitRunners should be string\");\n const bitrunnersServer = AllServers[bitrunnerIP];\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 tbhIP = SpecialServerIps[SpecialServerNames.TheBlackHandServer];\n if (typeof tbhIP !== \"string\") throw new Error(\"TheBlackHand should be string\");\n const blackhandServer = AllServers[tbhIP];\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 nitesecIP = SpecialServerIps[SpecialServerNames.NiteSecServer];\n if (typeof nitesecIP !== \"string\") throw new Error(\"NiteSec should be string\");\n const nitesecServer = AllServers[nitesecIP];\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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var 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 var netburnersFac = Factions[\"Netburners\"];\n var totalHacknetRam = 0;\n var totalHacknetCores = 0;\n var 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 = AllServers[v];\n if (hserver instanceof Server) 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 var 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 cyberSecIP = SpecialServerIps[SpecialServerNames.CyberSecServer];\n if (typeof cyberSecIP !== \"string\") throw new Error(\"cybersec should be string\");\n const cybersecServer = AllServers[cyberSecIP];\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) {\n this.bitNodeN = n;\n}\n\nexport function queueAugmentation(this: IPlayer, name: string) {\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) {\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 var 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 var factions = this.factions.slice();\n factions = factions.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 var repGain = CONSTANTS.CodingContractBaseCompanyRepGain * difficulty;\n Companies[reward.name].playerReputation += repGain;\n return `Gained ${repGain} company reputation for ${reward.name}`;\n break;\n case CodingContractRewardType.Money:\n default:\n var moneyGain = CONSTANTS.CodingContractBaseMoneyGain * difficulty * BitNodeMultipliers.CodingContractMoney;\n this.gainMoney(moneyGain);\n this.recordMoneySource(moneyGain, \"codingcontract\");\n return `Gained ${numeralWrapper.formatMoney(moneyGain)}`;\n break;\n }\n /* eslint-enable no-case-declarations */\n}\n\nexport function travel(this: IPlayer, to: CityName) {\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) {\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) {\n return this.bitNodeN === 10 || SourceFileFlags[10] > 0;\n}\n\nexport function giveExploit(this: IPlayer, exploit: Exploit) {\n if (!this.exploits.includes(exploit)) {\n this.exploits.push(exploit);\n }\n}\n\nexport function getIntelligenceBonus(this: IPlayer, weight: number) {\n return calculateIntelligenceBonus(this.intelligence, weight);\n}\n\nexport function getCasinoWinnings(this: IPlayer) {\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 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","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","// 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 * @param perc - Whether it should be changed by a percentage, or a flat value\n */\n changeMaximumMoney(n: number, perc = false): void {\n if (perc) {\n this.moneyMax *= n;\n } else {\n this.moneyMax += n;\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","/**\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 { AllServers } from \"../Server/AllServers\";\nimport { GetServerByHostname } from \"../Server/ServerHelpers\";\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 = AllServers[ip];\n if (hserver instanceof Server) throw new Error(`player nodes shoud not be Server`);\n hserver.updateHashRate(player.hacknet_node_money_mult);\n const h = hserver.process(numCycles);\n hserver.totalHashesGenerated += h;\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 = AllServers[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 = GetServerByHostname(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 = GetServerByHostname(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n return false;\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMaximumMoney(upg.value, true);\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","import { IMap } from \"../types\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../../utils/JSONReviver\";\n\n/* Holds IP of Special Servers */\nexport const SpecialServerNames: IMap<string> = {\n FulcrumSecretTechnologies: \"Fulcrum Secret Technologies Server\",\n CyberSecServer: \"CyberSec Server\",\n NiteSecServer: \"NiteSec Server\",\n TheBlackHandServer: \"The Black Hand Server\",\n BitRunnersServer: \"BitRunners Server\",\n TheDarkArmyServer: \"The Dark Army Server\",\n DaedalusServer: \"Daedalus Server\",\n WorldDaemon: \"w0r1d_d43m0n\",\n};\n\nexport class SpecialServerIpsMap {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: Function | string;\n\n addIp(name: string, ip: string): void {\n this[name] = ip;\n }\n\n getIp(name: string): string {\n return this[name] as string;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): any {\n return Generic_toJSON(\"SpecialServerIpsMap\", this);\n }\n\n // Initializes a SpecialServerIpsMap Object from a JSON save state\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): SpecialServerIpsMap {\n return Generic_fromJSON(SpecialServerIpsMap, value.data);\n }\n}\n\nReviver.constructors.SpecialServerIpsMap = SpecialServerIpsMap;\n\nexport let SpecialServerIps: SpecialServerIpsMap = new SpecialServerIpsMap();\n\nexport function prestigeSpecialServerIps(): void {\n for (const member in SpecialServerIps) {\n delete SpecialServerIps[member];\n }\n\n SpecialServerIps = new SpecialServerIpsMap();\n}\n\nexport function loadSpecialServerIps(saveString: string): void {\n SpecialServerIps = JSON.parse(saveString, Reviver);\n}\n\nexport function initSpecialServerIps(): void {\n SpecialServerIps = new SpecialServerIpsMap();\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 { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nexport const Crimes: IMap<Crime> = {\n Shoplift: new Crime(\"Shoplift\", CONSTANTS.CrimeShoplift, 2e3, 15e3, 1 / 20, 0.1, {\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n dexterity_exp: 2,\n agility_exp: 2,\n }),\n\n RobStore: new Crime(\"Rob Store\", CONSTANTS.CrimeRobStore, 60e3, 400e3, 1 / 5, 0.5, {\n hacking_exp: 30,\n dexterity_exp: 45,\n agility_exp: 45,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Mug: new Crime(\"Mug\", CONSTANTS.CrimeMug, 4e3, 36e3, 1 / 5, 0.25, {\n strength_exp: 3,\n defense_exp: 3,\n dexterity_exp: 3,\n agility_exp: 3,\n\n strength_success_weight: 1.5,\n defense_success_weight: 0.5,\n dexterity_success_weight: 1.5,\n agility_success_weight: 0.5,\n }),\n\n Larceny: new Crime(\"Larceny\", CONSTANTS.CrimeLarceny, 90e3, 800e3, 1 / 3, 1.5, {\n hacking_exp: 45,\n dexterity_exp: 60,\n agility_exp: 60,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n DealDrugs: new Crime(\"Deal Drugs\", CONSTANTS.CrimeDrugs, 10e3, 120e3, 1, 0.5, {\n dexterity_exp: 5,\n agility_exp: 5,\n charisma_exp: 10,\n\n charisma_success_weight: 3,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n }),\n\n BondForgery: new Crime(\"Bond Forgery\", CONSTANTS.CrimeBondForgery, 300e3, 4.5e6, 1 / 2, 0.1, {\n hacking_exp: 100,\n dexterity_exp: 150,\n charisma_exp: 15,\n\n hacking_success_weight: 0.05,\n dexterity_success_weight: 1.25,\n\n intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n TraffickArms: new Crime(\"Traffick Arms\", CONSTANTS.CrimeTraffickArms, 40e3, 600e3, 2, 1, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 20,\n charisma_exp: 40,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n }),\n\n Homicide: new Crime(\"Homicide\", CONSTANTS.CrimeHomicide, 3e3, 45e3, 1, 3, {\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n\n strength_success_weight: 2,\n defense_success_weight: 2,\n dexterity_success_weight: 0.5,\n agility_success_weight: 0.5,\n\n kills: 1,\n }),\n\n GrandTheftAuto: new Crime(\"Grand Theft Auto\", CONSTANTS.CrimeGrandTheftAuto, 80e3, 1.6e6, 8, 5, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 80,\n charisma_exp: 40,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 4,\n agility_success_weight: 2,\n charisma_success_weight: 2,\n\n intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Kidnap: new Crime(\"Kidnap\", CONSTANTS.CrimeKidnap, 120e3, 3.6e6, 5, 6, {\n strength_exp: 80,\n defense_exp: 80,\n dexterity_exp: 80,\n agility_exp: 80,\n charisma_exp: 80,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Assassination: new Crime(\"Assassination\", CONSTANTS.CrimeAssassination, 300e3, 12e6, 8, 10, {\n strength_exp: 300,\n defense_exp: 300,\n dexterity_exp: 300,\n agility_exp: 300,\n\n strength_success_weight: 1,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n\n kills: 1,\n }),\n\n Heist: new Crime(\"Heist\", CONSTANTS.CrimeHeist, 600e3, 120e6, 18, 15, {\n hacking_exp: 450,\n strength_exp: 450,\n defense_exp: 450,\n dexterity_exp: 450,\n agility_exp: 450,\n charisma_exp: 450,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n charisma_success_weight: 1,\n\n intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n};\n","import * as React from \"react\";\n\nexport function trusted(f: () => void): (event: React.MouseEvent<HTMLElement, MouseEvent>) => any {\n return function (event: React.MouseEvent<HTMLElement, MouseEvent>): any {\n if (!event.isTrusted) return;\n f();\n };\n}\n","import { 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","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companyPositionMetadata } from \"./data/CompanyPositionsMetadata\";\nimport { CompanyPosition, IConstructorParams } from \"./CompanyPosition\";\nimport { IMap } from \"../types\";\n\nexport const CompanyPositions: IMap<CompanyPosition> = {};\n\nfunction addCompanyPosition(params: IConstructorParams): void {\n if (CompanyPositions[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n CompanyPositions[params.name] = new CompanyPosition(params);\n}\n\ncompanyPositionMetadata.forEach((e) => {\n addCompanyPosition(e);\n});\n","import { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const StockSymbols: IMap<string> = {};\n\n// Stocks for companies at which you can work\nStockSymbols[LocationName.AevumECorp] = \"ECP\";\nStockSymbols[LocationName.Sector12MegaCorp] = \"MGCP\";\nStockSymbols[LocationName.Sector12BladeIndustries] = \"BLD\";\nStockSymbols[LocationName.AevumClarkeIncorporated] = \"CLRK\";\nStockSymbols[LocationName.VolhavenOmniTekIncorporated] = \"OMTK\";\nStockSymbols[LocationName.Sector12FourSigma] = \"FSIG\";\nStockSymbols[LocationName.ChongqingKuaiGongInternational] = \"KGI\";\nStockSymbols[LocationName.AevumFulcrumTechnologies] = \"FLCM\";\nStockSymbols[LocationName.IshimaStormTechnologies] = \"STM\";\nStockSymbols[LocationName.NewTokyoDefComm] = \"DCOMM\";\nStockSymbols[LocationName.VolhavenHeliosLabs] = \"HLS\";\nStockSymbols[LocationName.NewTokyoVitaLife] = \"VITA\";\nStockSymbols[LocationName.Sector12IcarusMicrosystems] = \"ICRS\";\nStockSymbols[LocationName.Sector12UniversalEnergy] = \"UNV\";\nStockSymbols[LocationName.AevumAeroCorp] = \"AERO\";\nStockSymbols[LocationName.VolhavenOmniaCybersystems] = \"OMN\";\nStockSymbols[LocationName.ChongqingSolarisSpaceSystems] = \"SLRS\";\nStockSymbols[LocationName.NewTokyoGlobalPharmaceuticals] = \"GPH\";\nStockSymbols[LocationName.IshimaNovaMedical] = \"NVMD\";\nStockSymbols[LocationName.AevumWatchdogSecurity] = \"WDS\";\nStockSymbols[LocationName.VolhavenLexoCorp] = \"LXO\";\nStockSymbols[LocationName.AevumRhoConstruction] = \"RHOC\";\nStockSymbols[LocationName.Sector12AlphaEnterprises] = \"APHE\";\nStockSymbols[LocationName.VolhavenSysCoreSecurities] = \"SYSC\";\nStockSymbols[LocationName.VolhavenCompuTek] = \"CTK\";\nStockSymbols[LocationName.AevumNetLinkTechnologies] = \"NTLK\";\nStockSymbols[LocationName.IshimaOmegaSoftware] = \"OMGA\";\nStockSymbols[LocationName.Sector12FoodNStuff] = \"FNS\";\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","/**\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\n return this.hashRate * seconds;\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 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 { IMap } from \"../../src/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 { 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 \"../../utils/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 * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function Reputation(reputation: number | string): JSX.Element {\n return (\n <span className={\"reputation samefont\"}>\n {typeof reputation === \"number\" ? numeralWrapper.formatReputation(reputation) : reputation}\n </span>\n );\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 { createPopup, removePopup } from \"./ui/React/createPopup\";\nimport { CodingContractPopup } from \"./ui/React/CodingContractPopup\";\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 const popupId = `coding-contract-prompt-popup-${this.fn}`;\n return new Promise<CodingContractResult>((resolve) => {\n createPopup(\n popupId,\n CodingContractPopup,\n {\n c: this,\n popupId: popupId,\n onClose: () => {\n resolve(CodingContractResult.Cancelled);\n removePopup(popupId);\n },\n onAttempt: (val: string) => {\n if (this.isSolution(val)) {\n resolve(CodingContractResult.Success);\n } else {\n resolve(CodingContractResult.Failure);\n }\n removePopup(popupId);\n },\n },\n () => resolve(CodingContractResult.Cancelled),\n );\n });\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): any {\n return Generic_toJSON(\"CodingContract\", this);\n }\n\n /**\n * Initiatizes a CodingContract from a JSON save state.\n */\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n static fromJSON(value: any): CodingContract {\n return Generic_fromJSON(CodingContract, value.data);\n }\n}\n\nReviver.constructors.CodingContract = CodingContract;\n","export enum OrderTypes {\n LimitBuy = \"Limit Buy Order\",\n LimitSell = \"Limit Sell Order\",\n StopBuy = \"Stop Buy Order\",\n StopSell = \"Stop Sell Order\",\n}\n","import { 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","export function isScriptFilename(f: string): boolean {\n return f.endsWith(\".js\") || f.endsWith(\".script\") || f.endsWith(\".ns\");\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 \"../../utils/DialogBox\";\nimport { AllServers } 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/Root\";\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 { HackingMissionRoot } from \"../HackingMission/ui/HackingMissionRoot\";\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\";\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 toHackingMission: () => {\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.CreateScript);\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 toHackingMission: (faction: Faction) => {\n setPage(Page.HackingMission);\n setFaction(faction);\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.HackingMission ? (\n <HackingMissionRoot faction={faction} />\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 player={player} />\n ) : page === Page.Stats ? (\n <CharacterStats />\n ) : page === Page.CreateScript ? (\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 player={player} />\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 hostname of Object.keys(AllServers)) {\n AllServers[hostname].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 </Context.Router.Provider>\n </Context.Player.Provider>\n );\n}\n","// Defines the ResearchTree that is common to all Corporation Industries\n// i.e. all Industries have these types of Research available to unlock\nimport { Research } from \"../Research\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { ResearchTree, Node } from \"../ResearchTree\";\n\nfunction makeNode(name: string): Node {\n const research: Research | null = ResearchMap[name];\n if (research == null) {\n throw new Error(`Invalid research name: ${name}`);\n }\n\n return new Node({ text: research.name, cost: research.cost });\n}\n\n// Creates the Nodes for the BaseResearchTree.\n// Return the Root Node\nfunction createBaseResearchTreeNodes(): Node {\n const rootNode: Node = makeNode(\"Hi-Tech R&D Laboratory\");\n const autoBrew: Node = makeNode(\"AutoBrew\");\n const autoParty: Node = makeNode(\"AutoPartyManager\");\n const autoDrugs: Node = makeNode(\"Automatic Drug Administration\");\n const bulkPurchasing: Node = makeNode(\"Bulk Purchasing\");\n const cph4: Node = makeNode(\"CPH4 Injections\");\n const drones: Node = makeNode(\"Drones\");\n const dronesAssembly: Node = makeNode(\"Drones - Assembly\");\n const dronesTransport: Node = makeNode(\"Drones - Transport\");\n const goJuice: Node = makeNode(\"Go-Juice\");\n const hrRecruitment: Node = makeNode(\"HRBuddy-Recruitment\");\n const hrTraining: Node = makeNode(\"HRBuddy-Training\");\n const joywire: Node = makeNode(\"JoyWire\");\n const marketta1: Node = makeNode(\"Market-TA.I\");\n const marketta2: Node = makeNode(\"Market-TA.II\");\n const overclock: Node = makeNode(\"Overclock\");\n const scAssemblers: Node = makeNode(\"Self-Correcting Assemblers\");\n const stimu: Node = makeNode(\"Sti.mu\");\n\n autoDrugs.addChild(goJuice);\n autoDrugs.addChild(cph4);\n\n drones.addChild(dronesAssembly);\n drones.addChild(dronesTransport);\n\n hrRecruitment.addChild(hrTraining);\n\n marketta1.addChild(marketta2);\n\n overclock.addChild(stimu);\n\n rootNode.addChild(autoBrew);\n rootNode.addChild(autoParty);\n rootNode.addChild(autoDrugs);\n rootNode.addChild(bulkPurchasing);\n rootNode.addChild(drones);\n rootNode.addChild(hrRecruitment);\n rootNode.addChild(joywire);\n rootNode.addChild(marketta1);\n rootNode.addChild(overclock);\n rootNode.addChild(scAssemblers);\n\n return rootNode;\n}\n\nexport function getBaseResearchTreeCopy(): ResearchTree {\n const baseResearchTree: ResearchTree = new ResearchTree();\n baseResearchTree.setRoot(createBaseResearchTreeNodes());\n\n return baseResearchTree;\n}\n\n// Base Research Tree for Industry's that make products\nexport function getProductIndustryResearchTreeCopy(): ResearchTree {\n const researchTree: ResearchTree = new ResearchTree();\n const root = createBaseResearchTreeNodes();\n\n const upgradeFulcrum = makeNode(\"uPgrade: Fulcrum\");\n const upgradeCapacity1 = makeNode(\"uPgrade: Capacity.I\");\n const upgradeCapacity2 = makeNode(\"uPgrade: Capacity.II\");\n const upgradeDashboard = makeNode(\"uPgrade: Dashboard\");\n\n upgradeCapacity1.addChild(upgradeCapacity2);\n upgradeFulcrum.addChild(upgradeCapacity1);\n upgradeFulcrum.addChild(upgradeDashboard);\n root.addChild(upgradeFulcrum);\n\n researchTree.setRoot(root);\n\n return researchTree;\n}\n","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 { HackingMission, setInMission } from \"../Missions\";\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 \"../../utils/DialogBox\";\nimport { createPopup } from \"../ui/React/createPopup\";\nimport { InvitationPopup } from \"./ui/InvitationPopup\";\n\nexport function inviteToFaction(faction: Faction): void {\n Player.factionInvitations.push(faction.name);\n faction.alreadyInvited = true;\n if (!Settings.SuppressFactionInvites) {\n const popupId = \"faction-invitation\";\n createPopup(popupId, InvitationPopup, {\n player: Player,\n faction: faction,\n popupId: popupId,\n });\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 (var 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\nexport function startHackingMission(faction: Faction): void {\n const mission = new HackingMission(faction.playerReputation, faction);\n setInMission(true, mission); //Sets inMission flag to true\n mission.init();\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 var hasPrereqs = hasAugmentationPrereqs(aug);\n if (!hasPrereqs) {\n var txt = \"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 let 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 let 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 var 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 var nextLevel = getNextNeurofluxLevel();\n --nextLevel;\n var mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n aug.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;\n aug.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (var 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 (var 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 (var 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 (var 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 * 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","/**\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 { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n money: number;\n corp: ICorporation;\n}\nexport function MoneyCost(props: IProps): JSX.Element {\n if (!props.corp.funds.gt(props.money))\n return <span className={\"unbuyable samefont\"}>{numeralWrapper.formatMoney(props.money)}</span>;\n\n return <span className={\"money-gold samefont\"}>{numeralWrapper.formatMoney(props.money)}</span>;\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","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","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 { 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 * 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 { AllServers } from \"../Server/AllServers\";\n\nimport { compareArrays } from \"../../utils/helpers/compareArrays\";\nimport { roundToTwo } from \"../../utils/helpers/roundToTwo\";\n\nexport function killWorkerScript(runningScriptObj: RunningScript, serverIp: 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 serverIp?: 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 serverIp === \"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.serverIp == serverIp && 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.serverIp;\n const name = workerScript.name;\n\n // Get the server on which the script runs\n const server = AllServers[ip];\n if (server == null) {\n console.error(`Could not find server on which this script is running: ${ip}`);\n return;\n }\n\n // Recalculate ram used on that server\n server.ramUsed = roundToTwo(server.ramUsed - workerScript.ramUsage);\n if (server.ramUsed < 0) {\n console.warn(\n `Server (${server.hostname}) RAM usage went negative (if it's due to floating pt imprecision, it's okay): ${server.ramUsed}`,\n );\n server.ramUsed = 0;\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 // 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","/**\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 { setTimeoutRef } from \"./utils/SetTimeoutRef\";\n\nimport { isString } from \"../utils/helpers/isString\";\nimport { AllServers } 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 = setTimeoutRef(() => {\n workerScript.delay = null;\n resolve();\n }, time);\n workerScript.delayResolve = resolve;\n });\n}\n\nexport function makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string, exp: any = null) {\n var lineNum = \"\";\n if (exp != null) {\n var num = getErrorLineNumber(exp, workerScript);\n lineNum = \" (Line \" + num + \")\";\n }\n const server = AllServers[workerScript.serverIp];\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${workerScript.serverIp}`);\n }\n\n return \"|\" + server.hostname + \"|\" + workerScript.name + \"|\" + msg + lineNum;\n}\n\nexport function resolveNetscriptRequestedThreads(\n workerScript: WorkerScript,\n functionName: string,\n requestedThreads: number,\n) {\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 getErrorLineNumber(exp: any, workerScript: WorkerScript): number {\n return -1;\n // TODO wtf is codeCode?\n\n // var code = workerScript.scriptRef.codeCode();\n\n // //Split code up to the start of the node\n // try {\n // code = code.substring(0, exp.start);\n // return (code.match(/\\n/g) || []).length + 1;\n // } catch (e) {\n // return -1;\n // }\n}\n\nexport function isScriptErrorMessage(msg: string): boolean {\n if (!isString(msg)) {\n return false;\n }\n let 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 * as React from \"react\";\n\nexport enum ClickableTag {\n Tag_span,\n Tag_h1,\n}\n\ntype IProps = {\n value: string;\n tag: ClickableTag;\n};\n\ntype IState = {\n tooltipVisible: boolean;\n};\n\nexport class CopyableText extends React.Component<IProps, IState> {\n public static defaultProps = {\n //Default span to prevent destroying current clickables\n tag: ClickableTag.Tag_span,\n };\n\n constructor(props: IProps) {\n super(props);\n\n this.copy = this.copy.bind(this);\n this.tooltipClasses = this.tooltipClasses.bind(this);\n this.textClasses = this.textClasses.bind(this);\n\n this.state = {\n tooltipVisible: false,\n };\n }\n\n copy(): void {\n const copyText = document.createElement(\"textarea\");\n copyText.value = this.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 this.setState({ tooltipVisible: true });\n setTimeout(() => this.setState({ tooltipVisible: false }), 1000);\n }\n\n tooltipClasses(): string {\n let classes = \"copy_tooltip_text\";\n if (this.state.tooltipVisible) {\n classes += \" copy_tooltip_text_visible\";\n }\n\n return classes;\n }\n\n textClasses(): string {\n let classes = \"copy_tooltip noselect text\";\n if (this.state.tooltipVisible) {\n classes += \" copy_tooltip_copied\";\n }\n\n return classes;\n }\n\n render(): React.ReactNode {\n switch (this.props.tag) {\n case ClickableTag.Tag_h1:\n return (\n <h1 className={this.textClasses()} onClick={this.copy}>\n {this.props.value}\n <span className={this.tooltipClasses()}>Copied!</span>\n </h1>\n );\n case ClickableTag.Tag_span:\n return (\n <span className={this.textClasses()} onClick={this.copy}>\n <b>{this.props.value}</b>\n <span className={this.tooltipClasses()}>Copied!</span>\n </span>\n );\n }\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 \"../../utils/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() {\n for (var 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: <></>,\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: <></>,\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 // 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 (var 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 var 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 var ownedAug = new PlayerOwnedAugmentation(aug.name);\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations() {\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}\n\nfunction augmentationExists(name: string) {\n return Augmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation): boolean {\n const augName = aug instanceof Augmentation ? aug.name : aug;\n\n if (augName === AugmentationNames.NeuroFluxGovernor) {\n return true;\n }\n\n return false;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\n","import { CONSTANTS } from \"./Constants\";\nimport { Player } from \"./Player\";\n\nimport { dialogBoxCreate } from \"../utils/DialogBox\";\nimport { formatNumber } from \"../utils/StringHelperFunctions\";\nimport { Reputation } from \"./ui/React/Reputation\";\n\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { isString } from \"../utils/helpers/isString\";\n\nimport { clearEventListeners } from \"../utils/uiHelpers/clearEventListeners\";\nimport { Router } from \"./ui/GameRoot\";\n\n// For some reason `jsplumb` needs to be imported exactly like this,\n// lowercase p, and later in the code used as `jsPlumb` uppercase P. wtf.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport jsplumb from \"jsplumb\";\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nlet inMission = false; // Flag to denote whether a mission is running\nlet currMission = null;\nfunction setInMission(bool, mission) {\n inMission = bool;\n if (bool) {\n currMission = mission;\n } else {\n currMission = null;\n }\n}\n\n// Keyboard shortcuts\n$(document).keydown(function (e) {\n if (inMission && currMission && currMission.selectedNode.length != 0) {\n switch (e.keyCode) {\n case 65: // a for Attack\n currMission.actionButtons[0].click();\n break;\n case 83: // s for Scan\n currMission.actionButtons[1].click();\n break;\n case 87: // w for Weaken\n currMission.actionButtons[2].click();\n break;\n case 70: // f for Fortify\n currMission.actionButtons[3].click();\n break;\n case 82: // r for Overflow\n currMission.actionButtons[4].click();\n break;\n case 68: // d for Detach connection\n currMission.actionButtons[5].click();\n break;\n default:\n break;\n }\n }\n});\n\nlet NodeTypes = {\n Core: \"CPU Core Node\", // All actions available\n Firewall: \"Firewall Node\", // No actions available\n Database: \"Database Node\", // No actions available\n Spam: \"Spam Node\", // No actions Available\n Transfer: \"Transfer Node\", // Can Weaken, Scan, Fortify and Overflow\n Shield: \"Shield Node\", // Can Fortify\n};\n\nlet NodeActions = {\n Attack: \"Attacking\", // Damaged based on attack stat + hacking level + opp def\n Scan: \"Scanning\", // -Def for target, affected by attack and hacking level\n Weaken: \"Weakening\", // -Attack for target, affected by attack and hacking level\n Fortify: \"Fortifying\", // +Defense for Node, affected by hacking level\n Overflow: \"Overflowing\", // +Attack but -Defense for Node, affected by hacking level\n};\n\nfunction Node(type, stats) {\n this.type = type;\n this.atk = stats.atk ? stats.atk : 0;\n this.def = stats.def ? stats.def : 0;\n this.hp = stats.hp ? stats.hp : 0;\n this.maxhp = this.hp;\n this.plyrCtrl = false;\n this.enmyCtrl = false;\n this.pos = [0, 0]; // x, y\n this.el = null; // Holds the Node's DOM element\n this.action = null;\n this.targetedCount = 0; // Count of how many connections this node is the target of\n\n /**\n * Holds the JsPlumb Connection object for this Node, where this Node is the Source (since each Node\n * can only have 1 outgoing Connection)\n */\n this.conn = null;\n}\n\nNode.prototype.setPosition = function (x, y) {\n this.pos = [x, y];\n};\n\nNode.prototype.setControlledByPlayer = function () {\n this.plyrCtrl = true;\n this.enmyCtrl = false;\n if (this.el) {\n this.el.classList.remove(\"hack-mission-enemy-node\");\n this.el.classList.add(\"hack-mission-player-node\");\n }\n};\n\nNode.prototype.setControlledByEnemy = function () {\n this.plyrCtrl = false;\n this.enmyCtrl = true;\n if (this.el) {\n this.el.classList.remove(\"hack-mission-player-node\");\n this.el.classList.add(\"hack-mission-enemy-node\");\n }\n};\n\n// Sets this node to be the active node\nNode.prototype.select = function (actionButtons) {\n if (this.enmyCtrl) {\n return;\n }\n this.el.classList.add(\"hack-mission-player-node-active\");\n\n // Make all buttons inactive\n for (var i = 0; i < actionButtons.length; ++i) {\n actionButtons[i].classList.remove(\"a-link-button\");\n actionButtons[i].classList.add(\"a-link-button-inactive\");\n }\n\n switch (this.type) {\n case NodeTypes.Core:\n // All buttons active\n for (var i = 0; i < actionButtons.length; ++i) {\n actionButtons[i].classList.remove(\"a-link-button-inactive\");\n actionButtons[i].classList.add(\"a-link-button\");\n }\n break;\n case NodeTypes.Transfer:\n actionButtons[1].classList.remove(\"a-link-button-inactive\");\n actionButtons[1].classList.add(\"a-link-button\");\n actionButtons[2].classList.remove(\"a-link-button-inactive\");\n actionButtons[2].classList.add(\"a-link-button\");\n actionButtons[3].classList.remove(\"a-link-button-inactive\");\n actionButtons[3].classList.add(\"a-link-button\");\n actionButtons[4].classList.remove(\"a-link-button-inactive\");\n actionButtons[4].classList.add(\"a-link-button\");\n actionButtons[5].classList.remove(\"a-link-button-inactive\");\n actionButtons[5].classList.add(\"a-link-button\");\n break;\n case NodeTypes.Shield:\n case NodeTypes.Firewall:\n actionButtons[3].classList.remove(\"a-link-button-inactive\");\n actionButtons[3].classList.add(\"a-link-button\");\n break;\n default:\n break;\n }\n};\n\nNode.prototype.deselect = function (actionButtons) {\n this.el.classList.remove(\"hack-mission-player-node-active\");\n for (var i = 0; i < actionButtons.length; ++i) {\n actionButtons[i].classList.remove(\"a-link-button\");\n actionButtons[i].classList.add(\"a-link-button-inactive\");\n }\n};\n\nNode.prototype.untarget = function () {\n if (this.targetedCount === 0) {\n console.warn(`Node ${this.el.id} is being 'untargeted' when it has no target count`);\n return;\n }\n --this.targetedCount;\n};\n\n/**\n * Hacking mission instance\n * @param rep {number} How much reputation the player has for the faction\n * @param fac {Faction} Faction for which this mission is being conducted\n */\nfunction HackingMission(rep, fac) {\n this.faction = fac;\n\n this.started = false;\n this.time = 180000; // 5 minutes to start, milliseconds\n\n this.playerCores = [];\n this.playerNodes = []; // Non-core nodes\n this.playerAtk = 0;\n this.playerDef = 0;\n\n this.enemyCores = [];\n this.enemyDatabases = [];\n this.enemyNodes = []; // Non-core nodes\n this.enemyAtk = 0;\n this.enemyDef = 0;\n\n this.miscNodes = [];\n\n this.selectedNode = []; // Which of the player's nodes are currently selected\n\n this.actionButtons = []; // DOM buttons for actions\n\n this.availablePositions = [];\n for (var r = 0; r < 8; ++r) {\n for (var c = 0; c < 8; ++c) {\n this.availablePositions.push([r, c]);\n }\n }\n\n this.map = [];\n for (var i = 0; i < 8; ++i) {\n this.map.push([null, null, null, null, null, null, null, null]);\n }\n\n this.jsplumbinstance = null;\n\n this.difficulty = rep / CONSTANTS.HackingMissionRepToDiffConversion + 1;\n this.reward = 250 + rep / CONSTANTS.HackingMissionRepToRewardConversion;\n}\n\nHackingMission.prototype.init = function () {\n // Create Header DOM\n this.createPageDom();\n\n // Create player starting nodes\n var home = Player.getHomeComputer();\n for (var i = 0; i < home.cpuCores; ++i) {\n var stats = {\n atk: Player.hacking_skill / 7.5 + 30,\n def: Player.hacking_skill / 20,\n hp: Player.hacking_skill / 4,\n };\n this.playerCores.push(new Node(NodeTypes.Core, stats));\n this.playerCores[i].setControlledByPlayer();\n this.setNodePosition(this.playerCores[i], i, 0);\n this.removeAvailablePosition(i, 0);\n }\n\n // Randomly generate enemy nodes (CPU and Firewall) based on difficulty\n var numNodes = Math.min(8, Math.max(1, Math.round(this.difficulty / 4)));\n var numFirewalls = Math.min(20, getRandomInt(Math.round(this.difficulty / 3), Math.round(this.difficulty / 3) + 1));\n var numDatabases = Math.min(10, getRandomInt(1, Math.round(this.difficulty / 3) + 1));\n var totalNodes = numNodes + numFirewalls + numDatabases;\n var xlimit = 7 - Math.floor(totalNodes / 8);\n var randMult = addOffset(0.8 + this.difficulty / 5, 10);\n for (var i = 0; i < numNodes; ++i) {\n var stats = {\n atk: randMult * getRandomInt(80, 86),\n def: randMult * getRandomInt(5, 10),\n hp: randMult * getRandomInt(210, 230),\n };\n this.enemyCores.push(new Node(NodeTypes.Core, stats));\n this.enemyCores[i].setControlledByEnemy();\n this.setNodeRandomPosition(this.enemyCores[i], xlimit);\n }\n for (var i = 0; i < numFirewalls; ++i) {\n var stats = {\n atk: 0,\n def: randMult * getRandomInt(10, 20),\n hp: randMult * getRandomInt(275, 300),\n };\n this.enemyNodes.push(new Node(NodeTypes.Firewall, stats));\n this.enemyNodes[i].setControlledByEnemy();\n this.setNodeRandomPosition(this.enemyNodes[i], xlimit);\n }\n for (var i = 0; i < numDatabases; ++i) {\n var stats = {\n atk: 0,\n def: randMult * getRandomInt(30, 55),\n hp: randMult * getRandomInt(210, 275),\n };\n var node = new Node(NodeTypes.Database, stats);\n node.setControlledByEnemy();\n this.setNodeRandomPosition(node, xlimit);\n this.enemyDatabases.push(node);\n }\n this.calculateDefenses();\n this.calculateAttacks();\n this.createMap();\n};\n\nHackingMission.prototype.createPageDom = function () {\n var container = document.getElementById(\"mission-container\");\n\n var favorMult = 1 + this.faction.favor / 100;\n var gain = this.reward * Player.faction_rep_mult * favorMult;\n var headerText = document.createElement(\"p\");\n ReactDOM.render(\n <>\n You are about to start a hacking mission! You will gain {Reputation(gain)} faction reputation with{\" \"}\n {this.faction.name} if you win. Click the 'Start' button to begin.\n </>,\n headerText,\n );\n headerText.style.display = \"block\";\n headerText.classList.add(\"hack-mission-header-element\");\n headerText.style.width = \"80%\";\n\n var inGameGuideBtn = document.createElement(\"a\");\n inGameGuideBtn.innerText = \"How to Play\";\n inGameGuideBtn.classList.add(\"a-link-button\");\n inGameGuideBtn.style.display = \"inline-block\";\n inGameGuideBtn.classList.add(\"hack-mission-header-element\");\n inGameGuideBtn.addEventListener(\"click\", function () {\n dialogBoxCreate(CONSTANTS.HackingMissionHowToPlay);\n return false;\n });\n\n // Start button will get replaced with forfeit when game is started\n var startBtn = document.createElement(\"a\");\n startBtn.innerHTML = \"Start\";\n startBtn.setAttribute(\"id\", \"hack-mission-start-btn\");\n startBtn.classList.add(\"a-link-button\");\n startBtn.classList.add(\"hack-mission-header-element\");\n startBtn.style.display = \"inline-block\";\n startBtn.addEventListener(\"click\", () => {\n this.start();\n return false;\n });\n\n var forfeitMission = document.createElement(\"a\");\n forfeitMission.innerHTML = \"Forfeit Mission (Exit)\";\n forfeitMission.classList.add(\"a-link-button\");\n forfeitMission.classList.add(\"hack-mission-header-element\");\n forfeitMission.style.display = \"inline-block\";\n forfeitMission.addEventListener(\"click\", () => {\n this.finishMission(false);\n return false;\n });\n\n var timer = document.createElement(\"p\");\n timer.setAttribute(\"id\", \"hacking-mission-timer\");\n timer.style.display = \"inline-block\";\n timer.style.margin = \"6px\";\n\n // Create Action Buttons (Attack/Scan/Weaken/ etc...)\n var actionsContainer = document.createElement(\"span\");\n actionsContainer.style.display = \"block\";\n actionsContainer.classList.add(\"hack-mission-action-buttons-container\");\n for (var i = 0; i < 6; ++i) {\n this.actionButtons.push(document.createElement(\"a\"));\n this.actionButtons[i].style.display = \"inline-block\";\n this.actionButtons[i].classList.add(\"a-link-button-inactive\"); // Disabled at start\n this.actionButtons[i].classList.add(\"tooltip\"); // Disabled at start\n this.actionButtons[i].classList.add(\"hack-mission-header-element\");\n actionsContainer.appendChild(this.actionButtons[i]);\n }\n this.actionButtons[0].innerText = \"Attack(a)\";\n var atkTooltip = document.createElement(\"span\");\n atkTooltip.classList.add(\"tooltiptexthigh\");\n atkTooltip.innerText =\n \"Lowers the targeted node's HP. The effectiveness of this depends on \" +\n \"this node's Attack level, your hacking level, and the opponent's defense level.\";\n this.actionButtons[0].appendChild(atkTooltip);\n this.actionButtons[1].innerText = \"Scan(s)\";\n var scanTooltip = document.createElement(\"span\");\n scanTooltip.classList.add(\"tooltiptexthigh\");\n scanTooltip.innerText =\n \"Lowers the targeted node's defense. The effectiveness of this depends on \" +\n \"this node's Attack level, your hacking level, and the opponent's defense level.\";\n this.actionButtons[1].appendChild(scanTooltip);\n this.actionButtons[2].innerText = \"Weaken(w)\";\n var WeakenTooltip = document.createElement(\"span\");\n WeakenTooltip.classList.add(\"tooltiptexthigh\");\n WeakenTooltip.innerText =\n \"Lowers the targeted node's attack. The effectiveness of this depends on \" +\n \"this node's Attack level, your hacking level, and the opponent's defense level.\";\n this.actionButtons[2].appendChild(WeakenTooltip);\n this.actionButtons[3].innerText = \"Fortify(f)\";\n var fortifyTooltip = document.createElement(\"span\");\n fortifyTooltip.classList.add(\"tooltiptexthigh\");\n fortifyTooltip.innerText =\n \"Raises this node's Defense level. The effectiveness of this depends on \" + \"your hacking level\";\n this.actionButtons[3].appendChild(fortifyTooltip);\n this.actionButtons[4].innerText = \"Overflow(r)\";\n var overflowTooltip = document.createElement(\"span\");\n overflowTooltip.classList.add(\"tooltiptexthigh\");\n overflowTooltip.innerText =\n \"Raises this node's Attack level but lowers its Defense level. The effectiveness \" +\n \"of this depends on your hacking level.\";\n this.actionButtons[4].appendChild(overflowTooltip);\n this.actionButtons[5].innerText = \"Drop Connection(d)\";\n var dropconnTooltip = document.createElement(\"span\");\n dropconnTooltip.classList.add(\"tooltiptexthigh\");\n dropconnTooltip.innerText =\n \"Removes this Node's current connection to some target Node, if it has one. This can \" +\n \"also be done by simply clicking the white connection line.\";\n this.actionButtons[5].appendChild(dropconnTooltip);\n\n // Player/enemy defense displays will be in action container\n var playerStats = document.createElement(\"p\");\n var enemyStats = document.createElement(\"p\");\n playerStats.style.display = \"inline-block\";\n enemyStats.style.display = \"inline-block\";\n playerStats.style.color = \"#00ccff\";\n enemyStats.style.color = \"red\";\n playerStats.style.margin = \"4px\";\n enemyStats.style.margin = \"4px\";\n playerStats.setAttribute(\"id\", \"hacking-mission-player-stats\");\n enemyStats.setAttribute(\"id\", \"hacking-mission-enemy-stats\");\n actionsContainer.appendChild(playerStats);\n actionsContainer.appendChild(enemyStats);\n\n // Set Action Button event listeners\n this.actionButtons[0].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n if (this.selectedNode[0].type !== NodeTypes.Core) {\n return;\n }\n this.setActionButtonsActive(this.selectedNode[0].type);\n this.setActionButton(NodeActions.Attack, false); // Set attack button inactive\n this.selectedNode.forEach(function (node) {\n node.action = NodeActions.Attack;\n });\n });\n\n this.actionButtons[1].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n var nodeType = this.selectedNode[0].type; // In a multiselect, every Node will have the same type\n if (nodeType !== NodeTypes.Core && nodeType !== NodeTypes.Transfer) {\n return;\n }\n this.setActionButtonsActive(nodeType);\n this.setActionButton(NodeActions.Scan, false); // Set scan button inactive\n this.selectedNode.forEach(function (node) {\n node.action = NodeActions.Scan;\n });\n });\n\n this.actionButtons[2].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n var nodeType = this.selectedNode[0].type; // In a multiselect, every Node will have the same type\n if (nodeType !== NodeTypes.Core && nodeType !== NodeTypes.Transfer) {\n return;\n }\n this.setActionButtonsActive(nodeType);\n this.setActionButton(NodeActions.Weaken, false); // Set Weaken button inactive\n this.selectedNode.forEach(function (node) {\n node.action = NodeActions.Weaken;\n });\n });\n\n this.actionButtons[3].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n this.setActionButtonsActive(this.selectedNode[0].type);\n this.setActionButton(NodeActions.Fortify, false); // Set Fortify button inactive\n this.selectedNode.forEach(function (node) {\n node.action = NodeActions.Fortify;\n });\n });\n\n this.actionButtons[4].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n var nodeType = this.selectedNode[0].type;\n if (nodeType !== NodeTypes.Core && nodeType !== NodeTypes.Transfer) {\n return;\n }\n this.setActionButtonsActive(nodeType);\n this.setActionButton(NodeActions.Overflow, false); // Set Overflow button inactive\n this.selectedNode.forEach(function (node) {\n node.action = NodeActions.Overflow;\n });\n });\n\n this.actionButtons[5].addEventListener(\"click\", () => {\n if (!(this.selectedNode.length > 0)) {\n console.error(\"Pressing Action button without selected node\");\n return;\n }\n this.selectedNode.forEach(function (node) {\n if (node.conn) {\n var endpoints = node.conn.endpoints;\n endpoints[0].detachFrom(endpoints[1]);\n }\n node.action = NodeActions.Fortify;\n });\n });\n\n var timeDisplay = document.createElement(\"p\");\n\n container.appendChild(headerText);\n container.appendChild(inGameGuideBtn);\n container.appendChild(startBtn);\n container.appendChild(forfeitMission);\n container.appendChild(timer);\n container.appendChild(actionsContainer);\n container.appendChild(timeDisplay);\n};\n\nHackingMission.prototype.setActionButtonsInactive = function () {\n for (var i = 0; i < this.actionButtons.length; ++i) {\n this.actionButtons[i].classList.remove(\"a-link-button\");\n this.actionButtons[i].classList.add(\"a-link-button-inactive\");\n }\n};\n\nHackingMission.prototype.setActionButtonsActive = function (nodeType = null) {\n for (var i = 0; i < this.actionButtons.length; ++i) {\n this.actionButtons[i].classList.add(\"a-link-button\");\n this.actionButtons[i].classList.remove(\"a-link-button-inactive\");\n }\n\n /**\n * For Transfer, FireWall and Shield Nodes, certain buttons should always be disabled\n * 0 = Attack, 1 = Scan, 2 = Weaken, 3 = Fortify, 4 = overflow, 5 = Drop conn\n */\n if (nodeType) {\n switch (nodeType) {\n case NodeTypes.Firewall:\n case NodeTypes.Shield:\n this.actionButtons[0].classList.remove(\"a-link-button\");\n this.actionButtons[0].classList.add(\"a-link-button-inactive\");\n this.actionButtons[1].classList.remove(\"a-link-button\");\n this.actionButtons[1].classList.add(\"a-link-button-inactive\");\n this.actionButtons[2].classList.remove(\"a-link-button\");\n this.actionButtons[2].classList.add(\"a-link-button-inactive\");\n this.actionButtons[4].classList.remove(\"a-link-button\");\n this.actionButtons[4].classList.add(\"a-link-button-inactive\");\n this.actionButtons[5].classList.remove(\"a-link-button\");\n this.actionButtons[5].classList.add(\"a-link-button-inactive\");\n break;\n case NodeTypes.Transfer:\n this.actionButtons[0].classList.remove(\"a-link-button\");\n this.actionButtons[0].classList.add(\"a-link-button-inactive\");\n break;\n default:\n break;\n }\n }\n};\n\n// True for active, false for inactive\nHackingMission.prototype.setActionButton = function (i, active = true) {\n if (isString(i)) {\n switch (i) {\n case NodeActions.Attack:\n i = 0;\n break;\n case NodeActions.Scan:\n i = 1;\n break;\n case NodeActions.Weaken:\n i = 2;\n break;\n case NodeActions.Fortify:\n i = 3;\n break;\n case NodeActions.Overflow:\n default:\n i = 4;\n break;\n }\n }\n if (active) {\n this.actionButtons[i].classList.remove(\"a-link-button-inactive\");\n this.actionButtons[i].classList.add(\"a-link-button\");\n } else {\n this.actionButtons[i].classList.remove(\"a-link-button\");\n this.actionButtons[i].classList.add(\"a-link-button-inactive\");\n }\n};\n\nHackingMission.prototype.calculateAttacks = function () {\n var total = 0;\n for (var i = 0; i < this.playerCores.length; ++i) {\n total += this.playerCores[i].atk;\n }\n for (var i = 0; i < this.playerNodes.length; ++i) {\n total += this.playerNodes[i].atk;\n }\n this.playerAtk = total;\n document.getElementById(\"hacking-mission-player-stats\").innerHTML =\n \"Player Attack: \" + formatNumber(this.playerAtk, 1) + \"<br>\" + \"Player Defense: \" + formatNumber(this.playerDef, 1);\n total = 0;\n for (var i = 0; i < this.enemyCores.length; ++i) {\n total += this.enemyCores[i].atk;\n }\n for (var i = 0; i < this.enemyDatabases.length; ++i) {\n total += this.enemyDatabases[i].atk;\n }\n for (var i = 0; i < this.enemyNodes.length; ++i) {\n total += this.enemyNodes[i].atk;\n }\n this.enemyAtk = total;\n document.getElementById(\"hacking-mission-enemy-stats\").innerHTML =\n \"Enemy Attack: \" + formatNumber(this.enemyAtk, 1) + \"<br>\" + \"Enemy Defense: \" + formatNumber(this.enemyDef, 1);\n};\n\nHackingMission.prototype.calculateDefenses = function () {\n var total = 0;\n for (var i = 0; i < this.playerCores.length; ++i) {\n total += this.playerCores[i].def;\n }\n for (var i = 0; i < this.playerNodes.length; ++i) {\n total += this.playerNodes[i].def;\n }\n this.playerDef = total;\n document.getElementById(\"hacking-mission-player-stats\").innerHTML =\n \"Player Attack: \" + formatNumber(this.playerAtk, 1) + \"<br>\" + \"Player Defense: \" + formatNumber(this.playerDef, 1);\n total = 0;\n for (var i = 0; i < this.enemyCores.length; ++i) {\n total += this.enemyCores[i].def;\n }\n for (var i = 0; i < this.enemyDatabases.length; ++i) {\n total += this.enemyDatabases[i].def;\n }\n for (var i = 0; i < this.enemyNodes.length; ++i) {\n total += this.enemyNodes[i].def;\n }\n this.enemyDef = total;\n document.getElementById(\"hacking-mission-enemy-stats\").innerHTML =\n \"Enemy Attack: \" + formatNumber(this.enemyAtk, 1) + \"<br>\" + \"Enemy Defense: \" + formatNumber(this.enemyDef, 1);\n};\n\nHackingMission.prototype.removeAvailablePosition = function (x, y) {\n for (var i = 0; i < this.availablePositions.length; ++i) {\n if (this.availablePositions[i][0] === x && this.availablePositions[i][1] === y) {\n this.availablePositions.splice(i, 1);\n return;\n }\n }\n console.warn(`removeAvailablePosition() did not remove ${x}, ${y}`);\n};\n\nHackingMission.prototype.setNodePosition = function (nodeObj, x, y) {\n if (!(nodeObj instanceof Node)) {\n console.warn(\"Non-Node object passed into setNodePOsition\");\n return;\n }\n if (isNaN(x) || isNaN(y)) {\n console.error(`Invalid values (${x}, ${y}) passed as (x, y) for setNodePosition`);\n return;\n }\n nodeObj.pos = [x, y];\n this.map[x][y] = nodeObj;\n};\n\nHackingMission.prototype.setNodeRandomPosition = function (nodeObj, xlimit = 0) {\n var i = getRandomInt(0, this.availablePositions.length - 1);\n if (this.availablePositions[i][1] < xlimit) {\n // Recurse if not within limit\n return this.setNodeRandomPosition(nodeObj, xlimit);\n }\n var pos = this.availablePositions.splice(i, 1);\n pos = pos[0];\n this.setNodePosition(nodeObj, pos[0], pos[1]);\n};\n\nHackingMission.prototype.createMap = function () {\n // Use a grid\n var map = document.createElement(\"div\");\n map.classList.add(\"hack-mission-grid\");\n map.setAttribute(\"id\", \"hacking-mission-map\");\n document.getElementById(\"mission-container\").appendChild(map);\n\n // Create random Nodes for every space in the map that\n // hasn't been filled yet. The stats of each Node will be based on\n // the player/enemy attack\n var averageAttack = (this.playerAtk + this.enemyAtk) / 2;\n for (var x = 0; x < 8; ++x) {\n for (var y = 0; y < 8; ++y) {\n if (!(this.map[x][y] instanceof Node)) {\n var node,\n type = getRandomInt(0, 2);\n var randMult = addOffset(0.85 + this.difficulty / 2, 15);\n switch (type) {\n case 0: // Spam\n var stats = {\n atk: 0,\n def: averageAttack * 1.1 + getRandomInt(15, 45),\n hp: randMult * getRandomInt(200, 225),\n };\n node = new Node(NodeTypes.Spam, stats);\n break;\n case 1: // Transfer\n var stats = {\n atk: 0,\n def: averageAttack * 1.1 + getRandomInt(15, 45),\n hp: randMult * getRandomInt(250, 275),\n };\n node = new Node(NodeTypes.Transfer, stats);\n break;\n case 2: // Shield\n default:\n var stats = {\n atk: 0,\n def: averageAttack * 1.1 + getRandomInt(30, 70),\n hp: randMult * getRandomInt(300, 320),\n };\n node = new Node(NodeTypes.Shield, stats);\n break;\n }\n this.setNodePosition(node, x, y);\n this.removeAvailablePosition(x, y);\n this.miscNodes.push(node);\n }\n }\n }\n\n // Create DOM elements in order\n for (var r = 0; r < 8; ++r) {\n for (var c = 0; c < 8; ++c) {\n this.createNodeDomElement(this.map[r][c]);\n }\n }\n\n // Configure all Player CPUS\n for (var i = 0; i < this.playerCores.length; ++i) {\n this.configurePlayerNodeElement(this.playerCores[i].el);\n }\n};\n\nHackingMission.prototype.createNodeDomElement = function (nodeObj) {\n var nodeDiv = document.createElement(\"a\"),\n txtEl = document.createElement(\"p\");\n nodeObj.el = nodeDiv;\n\n // Set the node element's id based on its coordinates\n var id = \"hacking-mission-node-\" + nodeObj.pos[0] + \"-\" + nodeObj.pos[1];\n nodeDiv.setAttribute(\"id\", id);\n txtEl.setAttribute(\"id\", id + \"-txt\");\n\n // Set node classes for owner\n nodeDiv.classList.add(\"hack-mission-node\");\n if (nodeObj.plyrCtrl) {\n nodeDiv.classList.add(\"hack-mission-player-node\");\n } else if (nodeObj.enmyCtrl) {\n nodeDiv.classList.add(\"hack-mission-enemy-node\");\n }\n\n // Set node classes based on type\n var txt;\n switch (nodeObj.type) {\n case NodeTypes.Core:\n txt = \"CPU Core<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-cpu-node\");\n break;\n case NodeTypes.Firewall:\n txt = \"Firewall<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-firewall-node\");\n break;\n case NodeTypes.Database:\n txt = \"Database<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-database-node\");\n break;\n case NodeTypes.Spam:\n txt = \"Spam<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-spam-node\");\n break;\n case NodeTypes.Transfer:\n txt = \"Transfer<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-transfer-node\");\n break;\n case NodeTypes.Shield:\n default:\n txt = \"Shield<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n nodeDiv.classList.add(\"hack-mission-shield-node\");\n break;\n }\n\n txt += \"<br>Atk: \" + formatNumber(nodeObj.atk, 1) + \"<br>Def: \" + formatNumber(nodeObj.def, 1);\n txtEl.innerHTML = txt;\n\n nodeDiv.appendChild(txtEl);\n document.getElementById(\"hacking-mission-map\").appendChild(nodeDiv);\n};\n\nHackingMission.prototype.updateNodeDomElement = function (nodeObj) {\n if (nodeObj.el == null) {\n console.error(\"Calling updateNodeDomElement on a Node without an element\");\n return;\n }\n\n let id = \"hacking-mission-node-\" + nodeObj.pos[0] + \"-\" + nodeObj.pos[1];\n let txtEl = document.getElementById(id + \"-txt\");\n\n // Set node classes based on type\n let txt;\n switch (nodeObj.type) {\n case NodeTypes.Core:\n txt = \"CPU Core<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n case NodeTypes.Firewall:\n txt = \"Firewall<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n case NodeTypes.Database:\n txt = \"Database<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n case NodeTypes.Spam:\n txt = \"Spam<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n case NodeTypes.Transfer:\n txt = \"Transfer<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n case NodeTypes.Shield:\n default:\n txt = \"Shield<br>\" + \"HP: \" + formatNumber(nodeObj.hp, 1);\n break;\n }\n\n txt += \"<br>Atk: \" + formatNumber(nodeObj.atk, 1) + \"<br>Def: \" + formatNumber(nodeObj.def, 1);\n if (nodeObj.action) {\n txt += \"<br>\" + nodeObj.action;\n }\n txtEl.innerHTML = txt;\n};\n\n/**\n * Gets a Node DOM elements corresponding Node object using its\n * element id. Function accepts either the DOM element object or the ID as\n * an argument\n */\nHackingMission.prototype.getNodeFromElement = function (el) {\n var id;\n if (isString(el)) {\n id = el;\n } else {\n id = el.id;\n }\n id = id.replace(\"hacking-mission-node-\", \"\");\n var res = id.split(\"-\");\n if (res.length != 2) {\n console.error(\"Parsing hacking mission node id. could not find coordinates\");\n return null;\n }\n var x = res[0],\n y = res[1];\n if (isNaN(x) || isNaN(y) || x >= 8 || y >= 8 || x < 0 || y < 0) {\n console.error(`Unexpected values (${x}, ${y}) for (x, y)`);\n return null;\n }\n return this.map[x][y];\n};\n\nfunction selectNode(hackMissionInst, el) {\n var nodeObj = hackMissionInst.getNodeFromElement(el);\n if (nodeObj == null) {\n console.error(\"Failed getting Node object\");\n }\n if (!nodeObj.plyrCtrl) {\n return;\n }\n\n clearAllSelectedNodes(hackMissionInst);\n nodeObj.select(hackMissionInst.actionButtons);\n hackMissionInst.selectedNode.push(nodeObj);\n}\n\nfunction multiselectNode(hackMissionInst, el) {\n var nodeObj = hackMissionInst.getNodeFromElement(el);\n if (nodeObj == null) {\n console.error(\"Failed getting Node Object in multiselectNode()\");\n }\n if (!nodeObj.plyrCtrl) {\n return;\n }\n\n clearAllSelectedNodes(hackMissionInst);\n var type = nodeObj.type;\n if (type === NodeTypes.Core) {\n hackMissionInst.playerCores.forEach(function (node) {\n node.select(hackMissionInst.actionButtons);\n hackMissionInst.selectedNode.push(node);\n });\n } else {\n hackMissionInst.playerNodes.forEach(function (node) {\n if (node.type === type) {\n node.select(hackMissionInst.actionButtons);\n hackMissionInst.selectedNode.push(node);\n }\n });\n }\n}\n\nfunction clearAllSelectedNodes(hackMissionInst) {\n if (hackMissionInst.selectedNode.length > 0) {\n hackMissionInst.selectedNode.forEach(function (node) {\n node.deselect(hackMissionInst.actionButtons);\n });\n hackMissionInst.selectedNode.length = 0;\n }\n}\n\n/**\n * Configures a DOM element representing a player-owned node to\n * be selectable and actionable.\n * Note: Does NOT change its css class. This is handled by Node.setControlledBy...\n */\nHackingMission.prototype.configurePlayerNodeElement = function (el) {\n var nodeObj = this.getNodeFromElement(el);\n if (nodeObj == null) {\n console.error(\"Failed getting Node object\");\n }\n\n // Add event listener\n const selectNodeWrapper = () => {\n selectNode(this, el);\n };\n el.addEventListener(\"click\", selectNodeWrapper);\n\n const multiselectNodeWrapper = () => {\n multiselectNode(this, el);\n };\n el.addEventListener(\"dblclick\", multiselectNodeWrapper);\n\n if (el.firstChild) {\n el.firstChild.addEventListener(\"click\", selectNodeWrapper);\n }\n};\n\n/**\n * Configures a DOM element representing an enemy-node by removing\n * any event listeners\n */\nHackingMission.prototype.configureEnemyNodeElement = function (el) {\n // Deselect node if it was the selected node\n var nodeObj = this.getNodeFromElement(el);\n for (var i = 0; i < this.selectedNode.length; ++i) {\n if (this.selectedNode[i] == nodeObj) {\n nodeObj.deselect(this.actionButtons);\n this.selectedNode.splice(i, 1);\n break;\n }\n }\n};\n\n/**\n * Returns bool indicating whether a node is reachable by player\n * by checking if any of the adjacent nodes are owned by the player\n */\nHackingMission.prototype.nodeReachable = function (node) {\n var x = node.pos[0],\n y = node.pos[1];\n if (x > 0 && this.map[x - 1][y].plyrCtrl) {\n return true;\n }\n if (x < 7 && this.map[x + 1][y].plyrCtrl) {\n return true;\n }\n if (y > 0 && this.map[x][y - 1].plyrCtrl) {\n return true;\n }\n if (y < 7 && this.map[x][y + 1].plyrCtrl) {\n return true;\n }\n return false;\n};\n\nHackingMission.prototype.nodeReachableByEnemy = function (node) {\n if (node == null) {\n return false;\n }\n var x = node.pos[0],\n y = node.pos[1];\n if (x > 0 && this.map[x - 1][y].enmyCtrl) {\n return true;\n }\n if (x < 7 && this.map[x + 1][y].enmyCtrl) {\n return true;\n }\n if (y > 0 && this.map[x][y - 1].enmyCtrl) {\n return true;\n }\n if (y < 7 && this.map[x][y + 1].enmyCtrl) {\n return true;\n }\n return false;\n};\n\nHackingMission.prototype.start = function () {\n this.started = true;\n this.initJsPlumb();\n var startBtn = clearEventListeners(\"hack-mission-start-btn\");\n startBtn.classList.remove(\"a-link-button\");\n startBtn.classList.add(\"a-link-button-inactive\");\n};\n\nHackingMission.prototype.initJsPlumb = function () {\n var instance = jsPlumb.getInstance({\n DragOptions: { cursor: \"pointer\", zIndex: 2000 },\n PaintStyle: {\n gradient: {\n stops: [\n [0, \"#FFFFFF\"],\n [1, \"#FFFFFF\"],\n ],\n },\n stroke: \"#FFFFFF\",\n strokeWidth: 8,\n },\n });\n\n this.jsplumbinstance = instance;\n\n // All player cores are sources\n for (var i = 0; i < this.playerCores.length; ++i) {\n instance.makeSource(this.playerCores[i].el, {\n deleteEndpointsOnEmpty: true,\n maxConnections: 1,\n anchor: \"Continuous\",\n connector: \"Flowchart\",\n });\n }\n\n // Everything else is a target\n for (var i = 0; i < this.enemyCores.length; ++i) {\n instance.makeTarget(this.enemyCores[i].el, {\n maxConnections: -1,\n anchor: \"Continuous\",\n connector: \"Flowchart\",\n });\n }\n for (var i = 0; i < this.enemyDatabases.length; ++i) {\n instance.makeTarget(this.enemyDatabases[i].el, {\n maxConnections: -1,\n anchor: \"Continuous\",\n connector: [\"Flowchart\"],\n });\n }\n for (var i = 0; i < this.enemyNodes.length; ++i) {\n instance.makeTarget(this.enemyNodes[i].el, {\n maxConnections: -1,\n anchor: \"Continuous\",\n connector: \"Flowchart\",\n });\n }\n for (var i = 0; i < this.miscNodes.length; ++i) {\n instance.makeTarget(this.miscNodes[i].el, {\n maxConnections: -1,\n anchor: \"Continuous\",\n connector: \"Flowchart\",\n });\n }\n\n // Clicking a connection drops it\n instance.bind(\"click\", (conn) => {\n // Cannot drop enemy's connections\n const sourceNode = this.getNodeFromElement(conn.source);\n if (sourceNode.enmyCtrl) {\n return;\n }\n\n var endpoints = conn.endpoints;\n endpoints[0].detachFrom(endpoints[1]);\n });\n\n // Connection events\n instance.bind(\"connection\", (info) => {\n var targetNode = this.getNodeFromElement(info.target);\n\n // Do not detach for enemy nodes\n var thisNode = this.getNodeFromElement(info.source);\n if (thisNode.enmyCtrl) {\n return;\n }\n\n // If the node is not reachable, drop the connection\n if (!this.nodeReachable(targetNode)) {\n info.sourceEndpoint.detachFrom(info.targetEndpoint);\n return;\n }\n\n var sourceNode = this.getNodeFromElement(info.source);\n sourceNode.conn = info.connection;\n var targetNode = this.getNodeFromElement(info.target);\n ++targetNode.targetedCount;\n });\n\n // Detach Connection events\n instance.bind(\"connectionDetached\", (info) => {\n var sourceNode = this.getNodeFromElement(info.source);\n sourceNode.conn = null;\n var targetNode = this.getNodeFromElement(info.target);\n targetNode.untarget();\n });\n};\n\n// Drops all connections where the specified node is the source\nHackingMission.prototype.dropAllConnectionsFromNode = function (node) {\n var allConns = this.jsplumbinstance.getAllConnections();\n for (var i = allConns.length - 1; i >= 0; --i) {\n if (allConns[i].source == node.el) {\n allConns[i].endpoints[0].detachFrom(allConns[i].endpoints[1]);\n }\n }\n};\n\n// Drops all connections where the specified node is the target\nHackingMission.prototype.dropAllConnectionsToNode = function (node) {\n var allConns = this.jsplumbinstance.getAllConnections();\n for (var i = allConns.length - 1; i >= 0; --i) {\n if (allConns[i].target == node.el) {\n allConns[i].endpoints[0].detachFrom(allConns[i].endpoints[1]);\n }\n }\n node.beingTargeted = false;\n};\n\nvar storedCycles = 0;\nHackingMission.prototype.process = function (numCycles = 1) {\n if (!this.started) {\n return;\n }\n storedCycles += numCycles;\n if (storedCycles < 2) {\n return;\n } // Only process every 3 cycles minimum\n\n var res = false;\n // Process actions of all player nodes\n this.playerCores.forEach((node) => {\n res |= this.processNode(node, storedCycles);\n });\n\n this.playerNodes.forEach((node) => {\n if (node.type === NodeTypes.Transfer || node.type === NodeTypes.Shield || node.type === NodeTypes.Firewall) {\n res |= this.processNode(node, storedCycles);\n }\n });\n\n // Process actions of all enemy nodes\n this.enemyCores.forEach((node) => {\n this.enemyAISelectAction(node);\n res |= this.processNode(node, storedCycles);\n });\n\n this.enemyNodes.forEach((node) => {\n if (node.type === NodeTypes.Transfer || node.type === NodeTypes.Shield || node.type === NodeTypes.Firewall) {\n this.enemyAISelectAction(node);\n res |= this.processNode(node, storedCycles);\n }\n });\n\n // The hp of enemy databases increases slowly\n this.enemyDatabases.forEach((node) => {\n node.maxhp += 0.1 * storedCycles;\n node.hp += 0.1 * storedCycles;\n });\n\n if (res) {\n this.calculateAttacks();\n this.calculateDefenses();\n }\n\n // Win if all enemy databases are conquered\n if (this.enemyDatabases.length === 0) {\n this.finishMission(true);\n return;\n }\n\n // Lose if all your cores are gone\n if (this.playerCores.length === 0) {\n this.finishMission(false);\n return;\n }\n\n // Defense/hp of misc nodes increases slowly over time\n this.miscNodes.forEach((node) => {\n node.def += 0.1 * storedCycles;\n node.maxhp += 0.05 * storedCycles;\n node.hp += 0.1 * storedCycles;\n if (node.hp > node.maxhp) {\n node.hp = node.maxhp;\n }\n this.updateNodeDomElement(node);\n });\n\n // Update timer and check if player lost\n this.time -= storedCycles * CONSTANTS._idleSpeed;\n if (this.time <= 0) {\n this.finishMission(false);\n return;\n }\n this.updateTimer();\n\n storedCycles = 0;\n};\n\n// Returns a bool representing whether defenses need to be re-calculated\nHackingMission.prototype.processNode = function (nodeObj, numCycles = 1) {\n if (nodeObj.action == null) {\n return;\n }\n\n var targetNode = null,\n def,\n atk;\n if (nodeObj.conn) {\n if (nodeObj.conn.target != null) {\n targetNode = this.getNodeFromElement(nodeObj.conn.target);\n } else {\n targetNode = this.getNodeFromElement(nodeObj.conn.targetId);\n }\n\n if (targetNode == null) {\n // Player is in the middle of dragging the connection,\n // so the target node is null. Do nothing here\n } else if (targetNode.plyrCtrl) {\n def = this.playerDef;\n atk = this.enemyAtk;\n } else if (targetNode.enmyCtrl) {\n def = this.enemyDef;\n atk = this.playerAtk;\n } else {\n // Misc Node\n def = targetNode.def;\n nodeObj.plyrCtrl ? (atk = this.playerAtk) : (atk = this.enemyAtk);\n }\n }\n\n // Calculations are per second, so divide everything by 5\n var calcStats = false,\n plyr = nodeObj.plyrCtrl;\n var enmyHacking = this.difficulty * CONSTANTS.HackingMissionDifficultyToHacking;\n switch (nodeObj.action) {\n case NodeActions.Attack:\n if (targetNode == null) {\n break;\n }\n if (nodeObj.conn == null) {\n break;\n }\n var dmg = this.calculateAttackDamage(atk, def, plyr ? Player.hacking_skill : enmyHacking);\n targetNode.hp -= (dmg / 5) * numCycles;\n break;\n case NodeActions.Scan:\n if (targetNode == null) {\n break;\n }\n if (nodeObj.conn == null) {\n break;\n }\n var eff = this.calculateScanEffect(atk, def, plyr ? Player.hacking_skill : enmyHacking);\n targetNode.def -= (eff / 5) * numCycles;\n calcStats = true;\n break;\n case NodeActions.Weaken:\n if (targetNode == null) {\n break;\n }\n if (nodeObj.conn == null) {\n break;\n }\n var eff = this.calculateWeakenEffect(atk, def, plyr ? Player.hacking_skill : enmyHacking);\n targetNode.atk -= (eff / 5) * numCycles;\n calcStats = true;\n break;\n case NodeActions.Fortify:\n var eff = this.calculateFortifyEffect(Player.hacking_skill);\n nodeObj.def += (eff / 5) * numCycles;\n calcStats = true;\n break;\n case NodeActions.Overflow:\n var eff = this.calculateOverflowEffect(Player.hacking_skill);\n if (nodeObj.def < eff) {\n break;\n }\n nodeObj.def -= (eff / 5) * numCycles;\n nodeObj.atk += (eff / 5) * numCycles;\n calcStats = true;\n break;\n default:\n console.error(`Invalid Node Action: ${nodeObj.action}`);\n break;\n }\n\n // Stats can't go below 0\n if (nodeObj.atk < 0) {\n nodeObj.atk = 0;\n }\n if (nodeObj.def < 0) {\n nodeObj.def = 0;\n }\n if (targetNode && targetNode.atk < 0) {\n targetNode.atk = 0;\n }\n if (targetNode && targetNode.def < 0) {\n targetNode.def = 0;\n }\n\n // Conquering a node\n if (targetNode && targetNode.hp <= 0) {\n var conqueredByPlayer = nodeObj.plyrCtrl;\n targetNode.hp = targetNode.maxhp;\n targetNode.action = null;\n targetNode.conn = null;\n if (this.selectedNode == targetNode) {\n targetNode.deselect(this.actionButtons);\n }\n\n // The conquered node has its stats reduced\n targetNode.atk /= 2;\n targetNode.def /= 3.5;\n\n // Flag for whether the target node was a misc node\n var isMiscNode = !targetNode.plyrCtrl && !targetNode.enmyCtrl;\n\n // Remove all connections from Node\n this.dropAllConnectionsToNode(targetNode);\n this.dropAllConnectionsFromNode(targetNode);\n\n // Changes the css class and turn the node into a JsPlumb Source/Target\n if (conqueredByPlayer) {\n targetNode.setControlledByPlayer();\n this.jsplumbinstance.unmakeTarget(targetNode.el);\n this.jsplumbinstance.makeSource(targetNode.el, {\n deleteEndpointsOnEmpty: true,\n maxConnections: 1,\n anchor: \"Continuous\",\n connector: \"Flowchart\",\n });\n } else {\n targetNode.setControlledByEnemy();\n nodeObj.conn = null; // Clear connection\n this.jsplumbinstance.unmakeSource(targetNode.el);\n this.jsplumbinstance.makeTarget(targetNode.el, {\n maxConnections: -1,\n anchor: \"Continuous\",\n connector: [\"Flowchart\"],\n });\n }\n\n calcStats = true;\n\n // Helper function to swap nodes between the respective enemyNodes/playerNodes arrays\n function swapNodes(orig, dest, targetNode) {\n for (var i = 0; i < orig.length; ++i) {\n if (orig[i] == targetNode) {\n var node = orig.splice(i, 1);\n node = node[0];\n dest.push(node);\n break;\n }\n }\n }\n\n switch (targetNode.type) {\n case NodeTypes.Core:\n if (conqueredByPlayer) {\n swapNodes(this.enemyCores, this.playerCores, targetNode);\n this.configurePlayerNodeElement(targetNode.el);\n } else {\n swapNodes(this.playerCores, this.enemyCores, targetNode);\n this.configureEnemyNodeElement(targetNode.el);\n }\n break;\n case NodeTypes.Firewall:\n if (conqueredByPlayer) {\n swapNodes(this.enemyNodes, this.playerNodes, targetNode);\n } else {\n swapNodes(this.playerNodes, this.enemyNodes, targetNode);\n this.configureEnemyNodeElement(targetNode.el);\n }\n break;\n case NodeTypes.Database:\n if (conqueredByPlayer) {\n swapNodes(this.enemyDatabases, this.playerNodes, targetNode);\n } else {\n swapNodes(this.playerNodes, this.enemyDatabases, targetNode);\n }\n break;\n case NodeTypes.Spam:\n if (conqueredByPlayer) {\n swapNodes(isMiscNode ? this.miscNodes : this.enemyNodes, this.playerNodes, targetNode);\n // Conquering spam node increases time limit\n this.time += CONSTANTS.HackingMissionSpamTimeIncrease;\n } else {\n swapNodes(isMiscNode ? this.miscNodes : this.playerNodes, this.enemyNodes, targetNode);\n }\n\n break;\n case NodeTypes.Transfer:\n // Conquering a Transfer node increases the attack of all cores by some percentages\n if (conqueredByPlayer) {\n swapNodes(isMiscNode ? this.miscNodes : this.enemyNodes, this.playerNodes, targetNode);\n this.playerCores.forEach(function (node) {\n node.atk *= CONSTANTS.HackingMissionTransferAttackIncrease;\n });\n this.configurePlayerNodeElement(targetNode.el);\n } else {\n swapNodes(isMiscNode ? this.miscNodes : this.playerNodes, this.enemyNodes, targetNode);\n this.enemyCores.forEach(function (node) {\n node.atk *= CONSTANTS.HackingMissionTransferAttackIncrease;\n });\n this.configureEnemyNodeElement(targetNode.el);\n }\n break;\n case NodeTypes.Shield:\n if (conqueredByPlayer) {\n swapNodes(isMiscNode ? this.miscNodes : this.enemyNodes, this.playerNodes, targetNode);\n this.configurePlayerNodeElement(targetNode.el);\n } else {\n swapNodes(isMiscNode ? this.miscNodes : this.playerNodes, this.enemyNodes, targetNode);\n this.configureEnemyNodeElement(targetNode.el);\n }\n break;\n }\n\n // If a misc node was conquered, the defense for all misc nodes increases by some fixed amount\n if (isMiscNode) {\n //&& conqueredByPlayer) {\n this.miscNodes.forEach((node) => {\n if (node.targetedCount === 0) {\n node.def *= CONSTANTS.HackingMissionMiscDefenseIncrease;\n }\n });\n }\n }\n\n // Update node DOMs\n this.updateNodeDomElement(nodeObj);\n if (targetNode) {\n this.updateNodeDomElement(targetNode);\n }\n return calcStats;\n};\n\n// Enemy \"AI\" for CPU Core and Transfer Nodes\nHackingMission.prototype.enemyAISelectAction = function (nodeObj) {\n if (nodeObj == null) {\n return;\n }\n switch (nodeObj.type) {\n case NodeTypes.Core:\n /**\n * Select a single RANDOM target from miscNodes and player's Nodes\n * If it is reachable, it will target it. If not, no target will\n * be selected for now, and the next time process() gets called this will repeat\n */\n if (nodeObj.conn == null) {\n if (this.miscNodes.length === 0) {\n // Randomly pick a player node and attack it if its reachable\n var rand = getRandomInt(0, this.playerNodes.length - 1);\n var node;\n if (this.playerNodes.length === 0) {\n node = null;\n } else {\n node = this.playerNodes[rand];\n }\n if (this.nodeReachableByEnemy(node)) {\n // Create connection\n nodeObj.conn = this.jsplumbinstance.connect({\n source: nodeObj.el,\n target: node.el,\n });\n ++node.targetedCount;\n } else {\n // Randomly pick a player core and attack it if its reachable\n rand = getRandomInt(0, this.playerCores.length - 1);\n if (this.playerCores.length === 0) {\n return; // No Misc Nodes, no player Nodes, no Player cores. Player lost\n } else {\n node = this.playerCores[rand];\n }\n\n if (this.nodeReachableByEnemy(node)) {\n // Create connection\n nodeObj.conn = this.jsplumbinstance.connect({\n source: nodeObj.el,\n target: node.el,\n });\n ++node.targetedCount;\n }\n }\n } else {\n // Randomly pick a misc node and attack it if its reachable\n var rand = getRandomInt(0, this.miscNodes.length - 1);\n var node = this.miscNodes[rand];\n if (this.nodeReachableByEnemy(node)) {\n nodeObj.conn = this.jsplumbinstance.connect({\n source: nodeObj.el,\n target: node.el,\n });\n ++node.targetedCount;\n }\n }\n\n // If no connection was made, set the Core to Fortify\n nodeObj.action = NodeActions.Fortify;\n } else {\n // If this node has a selected target\n var targetNode;\n if (nodeObj.conn.target) {\n targetNode = this.getNodeFromElement(nodeObj.conn.target);\n } else {\n targetNode = this.getNodeFromElement(nodeObj.conn.targetId);\n }\n if (targetNode == null) {\n console.error(\"Error getting Target node Object in enemyAISelectAction()\");\n }\n\n if (targetNode.def > this.enemyAtk + 15) {\n if (nodeObj.def < 50) {\n nodeObj.action = NodeActions.Fortify;\n } else {\n nodeObj.action = NodeActions.Overflow;\n }\n } else if (Math.abs(targetNode.def - this.enemyAtk) <= 15) {\n nodeObj.action = NodeActions.Scan;\n } else {\n nodeObj.action = NodeActions.Attack;\n }\n }\n break;\n case NodeTypes.Transfer:\n // Switch between fortifying and overflowing as necessary\n if (nodeObj.def < 125) {\n nodeObj.action = NodeActions.Fortify;\n } else {\n nodeObj.action = NodeActions.Overflow;\n }\n break;\n case NodeTypes.Firewall:\n case NodeTypes.Shield:\n nodeObj.action = NodeActions.Fortify;\n break;\n default:\n break;\n }\n};\n\nvar hackEffWeightSelf = 130; // Weight for Node actions on self\nvar hackEffWeightTarget = 25; // Weight for Node Actions against Target\nvar hackEffWeightAttack = 80; // Weight for Attack action\n\n// Returns damage per cycle based on stats\nHackingMission.prototype.calculateAttackDamage = function (atk, def, hacking = 0) {\n return Math.max(0.55 * (atk + hacking / hackEffWeightAttack - def), 1);\n};\n\nHackingMission.prototype.calculateScanEffect = function (atk, def, hacking = 0) {\n return Math.max(0.6 * (atk + hacking / hackEffWeightTarget - def * 0.95), 2);\n};\n\nHackingMission.prototype.calculateWeakenEffect = function (atk, def, hacking = 0) {\n return Math.max(atk + hacking / hackEffWeightTarget - def * 0.95, 2);\n};\n\nHackingMission.prototype.calculateFortifyEffect = function (hacking = 0) {\n return (0.9 * hacking) / hackEffWeightSelf;\n};\n\nHackingMission.prototype.calculateOverflowEffect = function (hacking = 0) {\n return (0.95 * hacking) / hackEffWeightSelf;\n};\n\n// Updates timer display\nHackingMission.prototype.updateTimer = function () {\n var timer = document.getElementById(\"hacking-mission-timer\");\n\n // Convert time remaining to a string of the form mm:ss\n var seconds = Math.round(this.time / 1000);\n var minutes = Math.trunc(seconds / 60);\n seconds %= 60;\n var str = (\"0\" + minutes).slice(-2) + \":\" + (\"0\" + seconds).slice(-2);\n timer.innerText = \"Time left: \" + str;\n};\n\n// The 'win' argument is a bool for whether or not the player won\nHackingMission.prototype.finishMission = function (win) {\n inMission = false;\n currMission = null;\n\n if (win) {\n var favorMult = 1 + this.faction.favor / 100;\n var gain = this.reward * Player.faction_rep_mult * favorMult;\n dialogBoxCreate(\n <>\n Mission won! You earned {Reputation(gain)} reputation with {this.faction.name}\n </>,\n );\n Player.gainIntelligenceExp(Math.pow(this.difficulty * CONSTANTS.IntelligenceHackingMissionBaseExpGain, 0.5));\n this.faction.playerReputation += gain;\n } else {\n dialogBoxCreate(\"Mission lost/forfeited! You did not gain any faction reputation.\");\n }\n Router.toFaction();\n};\n\nexport { HackingMission, inMission, setInMission, currMission };\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 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","export enum FactionWorkType {\n Field,\n Hacking,\n None,\n Security,\n}\n","/**\n * Functions for handling WorkerScripts, which are the underlying mechanism\n * that allows for scripts to run\n */\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { 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 { Player } from \"./Player\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport { getRamUsageFromRunningScript } from \"./Script/RunningScriptHelpers\";\nimport { scriptCalculateOfflineProduction } from \"./Script/ScriptHelpers\";\nimport { Script } from \"./Script/Script\";\nimport { AllServers } from \"./Server/AllServers\";\nimport { Server } from \"./Server/Server\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Settings } from \"./Settings/Settings\";\nimport { setTimeoutRef } from \"./utils/SetTimeoutRef\";\n\nimport { generate } from \"escodegen\";\n\nimport { dialogBoxCreate } from \"../utils/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 (var i = 0; i < CONSTANTS.NumNetscriptPorts; ++i) {\n NetscriptPorts.push(NetscriptPort());\n}\n\nexport function prestigeWorkerScripts() {\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: Function): Function {\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), null);\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 (let 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 var codeWithImports, codeLineOffset;\n try {\n let 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 var interpreterInitialization = function (int: any, scope: any) {\n //Add the Netscript environment\n var ns = NetscriptFunctions(workerScript);\n for (let name in ns) {\n let 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 let tempWrapper = function () {\n let 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 < arguments.length - 1; ++i) {\n if (typeof arguments[i] === \"object\" || arguments[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(arguments[i]));\n } else {\n fnArgs.push(arguments[i]);\n }\n }\n let cb = arguments[arguments.length - 1];\n let fnPromise = entry.apply(null, fnArgs);\n fnPromise\n .then(function (res: any) {\n cb(res);\n })\n .catch(function (err: any) {\n 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 === \"read\" ||\n name === \"tryWrite\" ||\n name === \"run\" ||\n name === \"exec\"\n ) {\n let tempWrapper = function () {\n let 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 < arguments.length; ++i) {\n if (typeof arguments[i] === \"object\" || arguments[i].constructor === Array) {\n fnArgs.push(int.pseudoToNative(arguments[i]));\n } else {\n fnArgs.push(arguments[i]);\n }\n }\n\n return entry.apply(null, fnArgs);\n };\n int.setProperty(scope, name, int.createNativeFunction(tempWrapper));\n } else {\n let tempWrapper = function () {\n let res = entry.apply(null, arguments);\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 var 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() {\n try {\n if (workerScript.env.stopFlag) {\n return reject(workerScript);\n }\n\n if (interpreter.step()) {\n setTimeoutRef(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 var 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 let script = getScript(scriptName);\n if (script == null) {\n throw new Error(\"'Import' failed due to invalid script: \" + scriptName);\n }\n let 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 let namespace = node.specifiers[0].local.name;\n let fnNames: string[] = []; //Names only\n let 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 let 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 let 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 var 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 var 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 var 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 // If the WorkerScript is no longer \"running\", then this means its execution was\n // already stopped somewhere else (maybe by something like exit()). This prevents\n // the script from being cleaned up twice\n if (w === undefined || !w.running) {\n return;\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 serverIp = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n\n let msg = `RUNTIME ERROR<br>${scriptName}@${serverIp}<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) {\n var 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() {\n let 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 property in AllServers) {\n if (AllServers.hasOwnProperty(property)) {\n const server = AllServers[property];\n\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/**\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 let 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 let 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","/**\n * Represents the possible configuration values that can be provided when creating the progress bar text.\n */\ninterface IProgressBarConfiguration {\n /**\n * Current progress, taken as a decimal (i.e. '0.6' to represent '60%')\n */\n progress?: number;\n\n /**\n * Total number of ticks in progress bar. Preferably a factor of 100.\n */\n totalTicks?: number;\n}\n\n/**\n * Represents concrete configuration values when creating the progress bar text.\n */\ninterface IProgressBarConfigurationMaterialized extends IProgressBarConfiguration {\n progress: number;\n totalTicks: number;\n}\n\n/**\n * Creates a graphical \"progress bar\"\n * e.g.: [||||---------------]\n * @param params The configuration parameters for the progress bar\n */\nexport function createProgressBarText(params: IProgressBarConfiguration): string {\n // Default values\n const defaultParams: IProgressBarConfigurationMaterialized = {\n progress: 0,\n totalTicks: 20,\n };\n\n // tslint:disable-next-line:prefer-object-spread\n const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params);\n // Ensure it is 0..1\n derived.progress = Math.max(Math.min(derived.progress, 1), 0);\n\n // This way there is always at least one bar filled in...\n const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1);\n const dashes: number = Math.max(derived.totalTicks - bars, 0);\n\n // String.prototype.repeat isn't completley supported, but good enough for our purposes\n return `[${\"|\".repeat(bars)}${\"-\".repeat(dashes)}]`;\n}\n","/**\n * Options specific to creating an anchor (\"<a>\") element.\n */\ninterface ICreateElementAnchorOptions {\n href?: string;\n target?: string;\n text?: string;\n}\n\n/**\n * Options specific to creating an input (\"<input>\") element.\n */\ninterface ICreateElementInputOptions {\n checked?: boolean;\n max?: string;\n maxLength?: number;\n min?: string;\n name?: string;\n pattern?: string;\n placeholder?: string;\n step?: string;\n type?: string;\n value?: string;\n}\n\n/**\n * Options specific to creating a label (\"<label>\") element.\n */\ninterface ICreateElementLabelOptions {\n for?: string;\n}\n\n/**\n * Options for setting up event listeners on the element.\n */\ninterface ICreateElementListenerOptions {\n changeListener?(this: HTMLElement, ev: Event): any;\n clickListener?(this: HTMLElement, ev: MouseEvent): any;\n mouseDown?(this: HTMLElement, ev: MouseEvent): any;\n inputListener?(this: HTMLElement, ev: Event): any;\n onfocus?(this: HTMLElement, ev: FocusEvent): any;\n onkeydown?(this: HTMLElement, ev: KeyboardEvent): any;\n onkeyup?(this: HTMLElement, ev: KeyboardEvent): any;\n}\n\n/**\n * Options for setting up the inline-styling of element.\n * NOTE: Relying on CSS styling should be preferred over forcing the higher specificity via inline styles.\n */\ninterface ICreateElementStyleOptions {\n backgroundColor?: string;\n border?: string;\n color?: string;\n display?: string;\n float?: string;\n fontSize?: string;\n margin?: string;\n marginLeft?: string;\n marginTop?: string;\n overflow?: string;\n padding?: string;\n position?: string;\n visibility?: string;\n whiteSpace?: string;\n width?: string;\n height?: string;\n top?: string;\n left?: string;\n}\n\n/**\n * Options for adding an in-game tooltip to the element.\n */\ninterface ICreateElementTooltipOptions {\n tooltip?: string;\n tooltipleft?: string;\n tooltipsmall?: string;\n tooltiplow?: string;\n}\n\n/**\n * All possible configuration options when creating an element.\n */\ninterface ICreateElementOptions\n extends ICreateElementStyleOptions,\n ICreateElementListenerOptions,\n ICreateElementInputOptions,\n ICreateElementAnchorOptions,\n ICreateElementLabelOptions,\n ICreateElementTooltipOptions {\n /**\n * CSS Class(es) to initially set.\n */\n class?: string;\n\n /**\n * A (hopefully) unique identifier for the element.\n */\n id?: string;\n\n innerHTML?: string;\n innerText?: string;\n tabIndex?: number;\n}\n\nfunction setElementAnchor(el: HTMLAnchorElement, params: ICreateElementAnchorOptions): void {\n if (params.text !== undefined) {\n el.text = params.text;\n }\n if (params.href !== undefined) {\n el.href = params.href;\n }\n if (params.target !== undefined) {\n el.target = params.target;\n }\n}\n\nfunction setElementInput(el: HTMLInputElement, params: ICreateElementInputOptions): void {\n if (params.name !== undefined) {\n el.name = params.name;\n }\n if (params.value !== undefined) {\n el.value = params.value;\n }\n if (params.type !== undefined) {\n el.type = params.type;\n }\n if (params.checked !== undefined) {\n el.checked = params.checked;\n }\n if (params.pattern !== undefined) {\n el.pattern = params.pattern;\n }\n if (params.maxLength !== undefined) {\n el.maxLength = params.maxLength;\n }\n if (params.placeholder !== undefined) {\n el.placeholder = params.placeholder;\n }\n if (params.max !== undefined) {\n el.max = params.max;\n }\n if (params.min !== undefined) {\n el.min = params.min;\n }\n if (params.step !== undefined) {\n el.step = params.step;\n }\n}\n\nfunction setElementLabel(el: HTMLLabelElement, params: ICreateElementLabelOptions): void {\n if (params.for !== undefined) {\n el.htmlFor = params.for;\n }\n}\n\nfunction setElementListeners(el: HTMLElement, params: ICreateElementListenerOptions): void {\n // tslint:disable:no-unbound-method\n if (params.clickListener !== undefined) {\n el.addEventListener(\"click\", params.clickListener);\n }\n if (params.mouseDown !== undefined) {\n el.addEventListener(\"mousedown\", params.mouseDown);\n }\n if (params.inputListener !== undefined) {\n el.addEventListener(\"input\", params.inputListener);\n }\n if (params.changeListener !== undefined) {\n el.addEventListener(\"change\", params.changeListener);\n }\n if (params.onkeyup !== undefined) {\n el.addEventListener(\"keyup\", params.onkeyup);\n }\n if (params.onkeydown !== undefined) {\n el.addEventListener(\"keydown\", params.onkeydown);\n }\n if (params.onfocus !== undefined) {\n el.addEventListener(\"focus\", params.onfocus);\n }\n // tslint:enable:no-unbound-method\n}\n\nfunction setElementStyle(el: HTMLElement, params: ICreateElementStyleOptions): void {\n if (params.display !== undefined) {\n el.style.display = params.display;\n }\n if (params.visibility !== undefined) {\n el.style.visibility = params.visibility;\n }\n if (params.margin !== undefined) {\n el.style.margin = params.margin;\n }\n if (params.marginLeft !== undefined) {\n el.style.marginLeft = params.marginLeft;\n }\n if (params.marginTop !== undefined) {\n el.style.marginTop = params.marginTop;\n }\n if (params.padding !== undefined) {\n el.style.padding = params.padding;\n }\n if (params.color !== undefined) {\n el.style.color = params.color;\n }\n if (params.border !== undefined) {\n el.style.border = params.border;\n }\n if (params.float !== undefined) {\n el.style.cssFloat = params.float;\n }\n if (params.fontSize !== undefined) {\n el.style.fontSize = params.fontSize;\n }\n if (params.whiteSpace !== undefined) {\n el.style.whiteSpace = params.whiteSpace;\n }\n if (params.width !== undefined) {\n el.style.width = params.width;\n }\n if (params.height !== undefined) {\n el.style.height = params.height;\n }\n if (params.top !== undefined) {\n el.style.top = params.top;\n }\n if (params.left !== undefined) {\n el.style.left = params.left;\n }\n if (params.backgroundColor !== undefined) {\n el.style.backgroundColor = params.backgroundColor;\n }\n if (params.position !== undefined) {\n el.style.position = params.position;\n }\n if (params.overflow !== undefined) {\n el.style.overflow = params.overflow;\n }\n}\n\nfunction setElementTooltip(el: HTMLElement, params: ICreateElementTooltipOptions): void {\n if (params.tooltip !== undefined && params.tooltip !== \"\") {\n el.className += \" tooltip\";\n el.appendChild(\n createElement(\"span\", {\n class: \"tooltiptext\",\n innerHTML: params.tooltip,\n }),\n );\n } else if (params.tooltipleft !== undefined) {\n el.className += \" tooltip\";\n el.appendChild(\n createElement(\"span\", {\n class: \"tooltiptextleft\",\n innerHTML: params.tooltipleft,\n }),\n );\n } else if (params.tooltipsmall !== undefined) {\n el.className += \" tooltip\";\n el.appendChild(\n createElement(\"span\", {\n class: \"tooltiptext smallfont\",\n innerHTML: params.tooltipsmall,\n }),\n );\n } else if (params.tooltiplow !== undefined) {\n el.className += \"tooltip\";\n el.appendChild(\n createElement(\"span\", {\n class: \"tooltiptextlow\",\n innerHTML: params.tooltiplow,\n }),\n );\n }\n}\n\n/**\n * An all-in-one-call way of creating an element to be added to the DOM at some point.\n * @param tagName The HTML tag/element name\n * @param params Additional parameters to set on the element\n */\nexport function createElement(tagName: string, params: ICreateElementOptions = {}): HTMLElement {\n const el: HTMLElement = document.createElement(tagName);\n\n if (params.id !== undefined) {\n el.id = params.id;\n }\n if (params.class !== undefined) {\n el.className = params.class;\n }\n if (params.innerHTML !== undefined) {\n el.innerHTML = params.innerHTML;\n }\n if (params.innerText !== undefined) {\n el.innerText = params.innerText;\n }\n if (params.tabIndex !== undefined) {\n el.tabIndex = params.tabIndex;\n }\n\n setElementAnchor(el as HTMLAnchorElement, params);\n setElementInput(el as HTMLInputElement, params);\n setElementLabel(el as HTMLLabelElement, params);\n setElementListeners(el, params);\n setElementStyle(el, params);\n setElementTooltip(el, params);\n\n return el;\n}\n","// Enums that defined allowed values for setting configuration\n\n/**\n * Allowed values for 'Keybinding/Keymap' setting in Ace editor\n */\nexport enum AceKeybindingSetting {\n Ace = \"ace\",\n Emacs = \"emacs\",\n Vim = \"vim\",\n}\n\n/**\n * Allowed values for 'Keybinding/Keymap' setting in Code Mirror editor\n */\nexport enum CodeMirrorKeybindingSetting {\n Default = \"default\",\n Emacs = \"emacs\",\n Sublime = \"sublime\",\n Vim = \"vim\",\n}\n\n/**\n * Allowed values for 'Theme' setting in Code Mirror editor\n */\nexport enum CodeMirrorThemeSetting {\n Monokai = \"monokai\",\n Day_3024 = \"3024-day\",\n Night_3024 = \"3024-night\",\n abcdef = \"abcdef\",\n Ambiance_mobile = \"ambiance-mobile\",\n Ambiance = \"ambiance\",\n Base16_dark = \"base16-dark\",\n Base16_light = \"base16-light\",\n Bespin = \"bespin\",\n Blackboard = \"blackboard\",\n Cobalt = \"cobalt\",\n Colorforth = \"colorforth\",\n Darcula = \"darcula\",\n Dracula = \"dracula\",\n Duotone_dark = \"duotone-dark\",\n Duotone_light = \"duotone-light\",\n Eclipse = \"eclipse\",\n Elegant = \"elegant\",\n Erlang_dark = \"erlang-dark\",\n Gruvbox_dark = \"gruvbox-dark\",\n Hopscotch = \"hopscotch\",\n Icecoder = \"icecoder\",\n Idea = \"idea\",\n Isotope = \"isotope\",\n Lesser_dark = \"lesser-dark\",\n Liquibyte = \"liquibyte\",\n Lucario = \"lucario\",\n Material = \"material\",\n Mbo = \"mbo\",\n Mdn_like = \"mdn-like\",\n Midnight = \"midnight\",\n Neat = \"neat\",\n Neo = \"neo\",\n Night = \"night\",\n Oceanic_next = \"oceanic-next\",\n Panda_syntax = \"panda-syntax\",\n Paraiso_dark = \"paraiso-dark\",\n Paraiso_light = \"paraiso-light\",\n Pastel_on_dark = \"pastel-on-dark\",\n Railscasts = \"railscasts\",\n Rubyblue = \"rubyblue\",\n Seti = \"seti\",\n Shadowfox = \"shadowfox\",\n Solarized = \"solarized\",\n SolarizedDark = \"solarized dark\",\n ssms = \"ssms\",\n The_matrix = \"the-matrix\",\n Tomorrow_night_bright = \"tomorrow-night-bright\",\n Tomorrow_night_eighties = \"tomorrow-night-eighties\",\n Ttcn = \"ttcn\",\n Twilight = \"twilight\",\n Vibrant_ink = \"vibrant-ink\",\n xq_dark = \"xq-dark\",\n xq_light = \"xq-light\",\n Yeti = \"yeti\",\n Zenburn = \"zenburn\",\n}\n\n/**\n * Allowed values for the \"Editor\" setting\n */\nexport enum EditorSetting {\n Ace = \"Ace\",\n CodeMirror = \"CodeMirror\",\n}\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 { 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","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 * Basic stateless button that automatically re-renders itself every X seconds\n * Uses the 'std-button' css class\n *\n * NOT recommended for usage - only if you really have to\n */\nimport * as React from \"react\";\n\ninterface IProps {\n label?: string;\n disabled?: boolean;\n intervalTime?: number;\n onClick?: (e: React.MouseEvent<HTMLElement>) => any;\n style?: any;\n text: string | JSX.Element;\n tooltip?: string;\n}\n\ninterface IState {\n i: number;\n}\n\ntype IInnerHTMLMarkup = {\n __html: string;\n};\n\nexport class AutoupdatingStdButton extends React.Component<IProps, IState> {\n /**\n * Timer ID for auto-updating implementation (returned value from setInterval())\n */\n interval = 0;\n\n constructor(props: IProps) {\n super(props);\n this.state = {\n i: 0,\n };\n }\n\n componentDidMount(): void {\n const time = this.props.intervalTime ? this.props.intervalTime : 1000;\n this.interval = window.setInterval(() => this.tick(), time);\n }\n\n componentWillUnmount(): void {\n clearInterval(this.interval);\n }\n\n tick(): void {\n this.setState((prevState) => ({\n i: prevState.i + 1,\n }));\n }\n\n render(): React.ReactNode {\n const hasTooltip = this.props.tooltip != null && this.props.tooltip !== \"\";\n\n let className = this.props.disabled ? \"std-button-disabled\" : \"std-button\";\n if (hasTooltip) {\n className += \" tooltip\";\n }\n\n // Tooltip will eb set using inner HTML\n const tooltipMarkup: IInnerHTMLMarkup = {\n __html: this.props.tooltip ? this.props.tooltip : \"\",\n };\n\n return (\n <button\n aria-label={this.props.label || \"\"}\n className={className}\n onClick={this.props.onClick}\n style={this.props.style}\n >\n {this.props.text}\n {hasTooltip && <span className={\"tooltiptext\"} dangerouslySetInnerHTML={tooltipMarkup}></span>}\n </button>\n );\n }\n}\n","import React, { useEffect } from \"react\";\n\ninterface IProps {\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n onFailure: (options?: { automated: boolean }) => void;\n}\n\nexport function KeyHandler(props: IProps): React.ReactElement {\n let elem: any;\n useEffect(() => elem.focus());\n\n function onKeyDown(event: React.KeyboardEvent<HTMLElement>): void {\n if (!event.isTrusted) {\n props.onFailure({ automated: true });\n return;\n }\n props.onKeyDown(event);\n }\n\n // invisible autofocused element that eats all the keypress for the minigames.\n return <div tabIndex={1} ref={(c) => (elem = c)} onKeyDown={onKeyDown} />;\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","// This is a reference to the native setTimeout() function\n// setTimeout() is used in various places around the game's source code.\n// This reference is used to make sure that if players alter window.setTimeout()\n// through NetscriptJS, then the game will still function properly\nexport const setTimeoutRef = window.setTimeout.bind(window);\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","/**\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","// 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 { 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","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 </>\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 \"../../utils/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 desc:\n \"Identify and locate Synthoids. This contract involves reconnaissance \" +\n \"and information-gathering ONLY. Do NOT engage. Stealth is of the utmost importance.<br><br>\" +\n \"Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for \" +\n \"whatever city you are currently in.\",\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 desc:\n \"Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.<br><br>\" +\n \"Successfully completing a Bounty Hunter contract will lower the population in your \" +\n \"current city, and will also increase its chaos level.\",\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 desc:\n \"Hunt down and retire (kill) rogue Synthoids.<br><br>\" +\n \"Successfully completing a Retirement contract will lower the population in your current \" +\n \"city, and will also increase its chaos level.\",\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 desc:\n \"As a field agent, investigate and identify Synthoid \" +\n \"populations, movements, and operations.<br><br>Successful \" +\n \"Investigation ops will increase the accuracy of your \" +\n \"synthoid data.<br><br>\" +\n \"You will NOT lose HP from failed Investigation ops.\",\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 desc:\n \"Conduct undercover operations to identify hidden \" +\n \"and underground Synthoid communities and organizations.<br><br>\" +\n \"Successful Undercover ops will increase the accuracy of your synthoid \" +\n \"data.\",\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 desc: \"Conduct a sting operation to bait and capture particularly \" + \"notorious Synthoid criminals.\",\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 desc:\n \"Lead an assault on a known Synthoid community. Note that \" +\n \"there must be an existing Synthoid community in your current city \" +\n \"in order for this Operation to be successful.\",\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 desc:\n \"Lead a covert operation to retire Synthoids. The \" +\n \"objective is to complete the task without \" +\n \"drawing any attention. Stealth and discretion are key.\",\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 desc:\n \"Assassinate Synthoids that have been identified as \" +\n \"important, high-profile social and political leaders \" +\n \"in the Synthoid communities.\",\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 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 \"../../utils/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!\", false);\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.ip);\n\n // Connect new server to home computer\n const homeComputer = p.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.ip);\n newServ.serversOnNetwork.push(homeComputer.ip);\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 { numeralWrapper } from \"../ui/numeralFormat\";\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 // Text that describes how the space in this Warehouse is being used\n // Used to create a tooltip in the UI\n breakdown = \"\";\n\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 this.breakdown = \"\";\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 if (mat.qty > 0) {\n this.breakdown += matName + \": \" + numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\") + \"<br>\";\n }\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 \"../../utils/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\";\n\nexport function Hashes(hashes: number | string): JSX.Element {\n return (\n <span className={\"money-gold samefont\"}>\n {typeof hashes === \"number\" ? numeralWrapper.formatHashes(hashes) : hashes}\n </span>\n );\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[]) => (\n <TableRow key={row[0]}>\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","/**\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","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 * 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","/**\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--------- \n / 39 | 41 \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","import React from \"react\";\n\nexport function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport function getArrow(event: React.KeyboardEvent<HTMLElement>): 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 { 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 \"../utils/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 var sourceFileKey = \"SourceFile\" + bitNodeNumber.toString();\n var 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 var alreadyOwned = false;\n var ownedSourceFile = null;\n for (var 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 var 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 \"You received a Source-File for destroying a BitNode!<br><br>\" + sourceFile.name + \"<br><br>\" + sourceFile.info,\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 { AllServers } from \"../Server/AllServers\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { processSingleServerGrowth } from \"../Server/ServerHelpers\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { compareArrays } from \"../../utils/helpers/compareArrays\";\n\nexport function scriptCalculateOfflineProduction(runningScript: RunningScript) {\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 ip in runningScript.dataMap) {\n if (runningScript.dataMap.hasOwnProperty(ip)) {\n if (runningScript.dataMap[ip][2] == 0 || runningScript.dataMap[ip][2] == null) {\n continue;\n }\n const serv = AllServers[ip];\n if (serv == null) {\n continue;\n }\n const timesGrown = Math.round(\n ((0.5 * runningScript.dataMap[ip][2]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called on ${serv.hostname} ${timesGrown} times while offline`);\n const host = AllServers[runningScript.server];\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 ip in runningScript.dataMap) {\n if (runningScript.dataMap.hasOwnProperty(ip)) {\n if (runningScript.dataMap[ip][3] == 0 || runningScript.dataMap[ip][3] == null) {\n continue;\n }\n const serv = AllServers[ip];\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 = AllServers[runningScript.server];\n const timesWeakened = Math.round(\n ((0.5 * runningScript.dataMap[ip][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(filename: string, args: (string | number)[], server: BaseServer) {\n for (var 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) {\n for (var 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 { setTimeoutRef } from \"./utils/SetTimeoutRef\";\nimport { dialogBoxCreate } from \"../utils/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 setTimeoutRef(() => {\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}`, true);\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 \"../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 false,\n );\n}\n","import { Message } from \"./Message\";\nimport { Augmentations } from \"../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Programs } from \"../Programs/Programs\";\nimport { inMission } from \"../Missions\";\nimport { Player } from \"../Player\";\nimport { redPillFlag } from \"../RedPill\";\nimport { GetServerByHostname } from \"../Server/ServerHelpers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../utils/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 var 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 var server = GetServerByHostname(serverHostname);\n if (server == null) {\n console.warn(`Could not find server ${serverHostname}`);\n return;\n }\n for (var i = 0; i < server.messages.length; ++i) {\n const msg = server.messages[i];\n if (typeof msg === \"string\") continue;\n if (msg.filename === msg.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() {\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 && !inMission) {\n sendMessage(redpill, true);\n } else if (redpill && redpillOwned) {\n //If player has already destroyed a BitNode, message is not forced\n if (!redPillFlag && !inMission) {\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\nlet 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() {\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","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 { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetNodeConstants } from \"../data/Constants\";\n\nexport function calculateMoneyGainRate(level: number, ram: number, cores: number, mult: number): number {\n const gainPerLevel = HacknetNodeConstants.MoneyGainPerLevel;\n\n const levelMult = level * gainPerLevel;\n const ramMult = Math.pow(1.035, ram - 1);\n const coresMult = (cores + 5) / 6;\n return levelMult * ramMult * coresMult * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetNodeConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetNodeConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += HacknetNodeConstants.LevelBaseCost * Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return (HacknetNodeConstants.BaseCost / 2) * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetNodeConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetNodeConstants.RamBaseCost;\n const mult = Math.pow(HacknetNodeConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCore: number, extraLevels = 1, costMult = 1): number {\n const sanitizedCores = Math.round(extraLevels);\n if (isNaN(sanitizedCores) || sanitizedCores < 1) {\n return 0;\n }\n\n if (startingCore >= HacknetNodeConstants.MaxCores) {\n return Infinity;\n }\n\n const coreBaseCost = HacknetNodeConstants.CoreBaseCost;\n const mult = HacknetNodeConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCore;\n for (let i = 0; i < sanitizedCores; ++i) {\n totalCost += coreBaseCost * Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateNodeCost(n: number, mult = 1): number {\n if (n <= 0) {\n return 0;\n }\n return HacknetNodeConstants.BaseCost * Math.pow(HacknetNodeConstants.PurchaseNextMult, n - 1) * mult;\n}\n","import { 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 desc:\n \"Obadiah Zenyatta is the leader of a RedWater PMC. It has long \" +\n \"been known among the intelligence community that Zenyatta, along \" +\n \"with the rest of the PMC, is a Synthoid.<br><br>\" +\n \"The goal of Operation Typhoon is to find and eliminate \" +\n \"Zenyatta and RedWater by any means necessary. After the task \" +\n \"is completed, the actions must be covered up from the general public.\",\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 desc:\n \"AeroCorp is one of the world's largest defense contractors. \" +\n \"Its leader, Steve Watataki, is thought to be a supporter of \" +\n \"Synthoid rights. He must be removed.<br><br>\" +\n \"The goal of Operation Zero is to covertly infiltrate AeroCorp and \" +\n \"uncover any incriminating evidence or \" +\n \"information against Watataki that will cause him to be removed \" +\n \"from his position at AeroCorp. Incriminating evidence can be \" +\n \"fabricated as a last resort. Be warned that AeroCorp has some of \" +\n \"the most advanced security measures in the world.\",\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 desc:\n \"We have recently discovered an underground publication \" +\n \"group called Samizdat. Even though most of their publications \" +\n \"are nonsensical conspiracy theories, the average human is \" +\n \"gullible enough to believe them. Many of their works discuss \" +\n \"Synthoids and pose a threat to society. The publications are spreading \" +\n \"rapidly in China and other Eastern countries.<br><br>\" +\n \"Samizdat has done a good job of keeping hidden and anonymous. \" +\n \"However, we've just received intelligence that their base of \" +\n \"operations is in Ishima's underground sewer systems. Your task is to \" +\n \"investigate the sewer systems, and eliminate Samizdat. They must \" +\n \"never publish anything again.\",\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 desc:\n \"Several months ago Titan Laboratories' Bioengineering department \" +\n \"was infiltrated by Synthoids. As far as we know, Titan Laboratories' \" +\n \"management has no knowledge about this. We don't know what the \" +\n \"Synthoids are up to, but the research that they could \" +\n \"be conducting using Titan Laboraties' vast resources is potentially \" +\n \"very dangerous.<br><br>\" +\n \"Your goal is to enter and destroy the Bioengineering department's \" +\n \"facility in Aevum. The task is not just to retire the Synthoids there, but \" +\n \"also to destroy any information or research at the facility that \" +\n \"is relevant to the Synthoids and their goals.\",\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 desc:\n \"One of our undercover agents, Agent Carter, has informed us of a \" +\n \"massive weapons deal going down in Dubai between rogue Russian \" +\n \"militants and a radical Synthoid community. These weapons are next-gen \" +\n \"plasma and energy weapons. It is critical for the safety of humanity \" +\n \"that this deal does not happen.<br><br>\" +\n \"Your task is to intercept the deal. Leave no survivors.\",\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 desc:\n \"Our analysts have discovered that the popular Red Rabbit brothel in \" +\n \"Amsterdam is run and 'staffed' by MK-VI Synthoids. Intelligence \" +\n \"suggests that the profit from this brothel is used to fund a large \" +\n \"black market arms trafficking operation.<br><br>\" +\n \"The goal of this operation is to take out the leaders that are running \" +\n \"the Red Rabbit brothel. Try to limit the number of other casualties, \" +\n \"but do what you must to complete the mission.\",\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 desc:\n \"The CIA has just encountered a new security threat. A new \" +\n \"criminal group, lead by a shadowy operative who calls himself \" +\n \"Juggernaut, has been smuggling drugs and weapons (including \" +\n \"suspected bioweapons) into Sector-12. We also have reason \" +\n \"to believe the tried to break into one of Universal Energy's \" +\n \"facilities in order to cause a city-wide blackout. The CIA \" +\n \"suspects that Juggernaut is a heavily-augmented Synthoid, and \" +\n \"have thus enlisted our help.<br><br>\" +\n \"Your mission is to eradicate Juggernaut and his followers.\",\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 desc:\n \"The Tetrads criminal organization is suspected of \" +\n \"reverse-engineering the MK-VI Synthoid design. We believe \" +\n \"they altered and possibly improved the design and began \" +\n \"manufacturing their own Synthoid models in order to bolster \" +\n \"their criminal activities.<br><br>\" +\n \"Your task is to infiltrate and destroy the Tetrads' base of operations \" +\n \"in Los Angeles. Intelligence tells us that their base houses \" +\n \"one of their Synthoid manufacturing units.\",\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 desc:\n \"CODE RED SITUATION. Our intelligence tells us that VitaLife \" +\n \"has discovered a new android cloning technology. This technology \" +\n \"is supposedly capable of cloning Synthoid, not only physically \" +\n \"but also their advanced AI modules. We do not believe that \" +\n \"VitaLife is trying to use this technology illegally or \" +\n \"maliciously, but if any Synthoids were able to infiltrate the \" +\n \"corporation and take advantage of this technology then the \" +\n \"results would be catastrophic.<br><br>\" +\n \"We do not have the power or jurisdiction to shutdown this down \" +\n \"through legal or political means, so we must resort to a covert \" +\n \"operation. Your goal is to destroy this technology and eliminate \" +\n \"anyone who was involved in its creation.\",\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 desc:\n \"Despite your success in eliminating VitaLife's new android-replicating \" +\n \"technology in Operation K, we've discovered that a small group of \" +\n \"MK-VI Synthoids were able to make off with the schematics and design \" +\n \"of the technology before the Operation. It is almost a certainty that \" +\n \"these Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.<br><br>\" +\n \"The goal of Operation Deckard is to hunt down these Synthoids and retire \" +\n \"them. I don't need to tell you how critical this mission is.\",\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 desc:\n \"A week ago Blade Industries reported a small break-in at one \" +\n \"of their Aevum Augmentation storage facitilities. We figured out \" +\n \"that The Dark Army was behind the heist, and didn't think any more \" +\n \"of it. However, we've just discovered that several known MK-VI Synthoids \" +\n \"were part of that break-in group.<br><br>\" +\n \"We cannot have Synthoids upgrading their already-enhanced abilities \" +\n \"with Augmentations. Your task is to hunt down the associated Dark Army \" +\n \"members and eliminate them.\",\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 desc:\n \"Based on information gathered from Operation Tyrell, we've discovered \" +\n \"that The Dark Army was well aware that there were Synthoids amongst \" +\n \"their ranks. Even worse, we believe that The Dark Army is working \" +\n \"together with other criminal organizations such as The Syndicate and \" +\n \"that they are planning some sort of large-scale takeover of multiple major \" +\n \"cities, most notably Aevum. We suspect that Synthoids have infiltrated \" +\n \"the ranks of these criminal factions and are trying to stage another \" +\n \"Synthoid uprising.<br><br>\" +\n \"The best way to deal with this is to prevent it before it even happens. \" +\n \"The goal of Operation Wallace is to destroy the Dark Army and \" +\n \"Syndicate factions in Aevum immediately. Leave no survivors.\",\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 desc:\n \"China's Solaris Space Systems is secretly launching the first \" +\n \"manned spacecraft in over a decade using Synthoids. We believe \" +\n \"China is trying to establish the first off-world colonies.<br><br>\" +\n \"The mission is to prevent this launch without instigating an \" +\n \"international conflict. When you accept this mission you will be \" +\n \"officially disavowed by the NSA and the national government until after you \" +\n \"successfully return. In the event of failure, all of the operation's \" +\n \"team members must not let themselves be captured alive.\",\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 desc:\n \"Our intelligence tells us that Fulcrum Technologies is developing \" +\n \"a quantum supercomputer using human brains as core \" +\n \"processors. This supercomputer \" +\n \"is rumored to be able to store vast amounts of data and \" +\n \"perform computations unmatched by any other supercomputer on the \" +\n \"planet. But more importantly, the use of organic human brains \" +\n \"means that the supercomputer may be able to reason abstractly \" +\n \"and become self-aware.<br><br>\" +\n \"I do not need to remind you why sentient-level AIs pose a serious \" +\n \"threat to all of mankind.<br><br>\" +\n \"The research for this project is being conducted at one of Fulcrum \" +\n \"Technologies secret facilities in Aevum, codenamed 'Alpha Ranch'. \" +\n \"Infiltrate the compound, delete and destroy the work, and then find and kill the \" +\n \"project lead.\",\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 desc:\n \"DreamSense Technologies is an advertising company that uses \" +\n \"special technology to transmit their ads into the peoples \" +\n \"dreams and subconcious. They do this using broadcast transmitter \" +\n \"towers. Based on information from our agents and informants in \" +\n \"Chonqging, we have reason to believe that one of the broadcast \" +\n \"towers there has been compromised by Synthoids and is being used \" +\n \"to spread pro-Synthoid propaganda.<br><br>\" +\n \"The mission is to destroy this broadcast tower. Speed and \" +\n \"stealth are of the upmost important for this.\",\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 desc:\n \"Our analysts have uncovered a gathering of MK-VI Synthoids \" +\n \"that have taken up residence in the Sector-12 Slums. We \" +\n \"don't know if they are rogue Synthoids from the Uprising, \" +\n \"but we do know that they have been stockpiling \" +\n \"weapons, money, and other resources. This makes them dangerous.<br><br>\" +\n \"This is a full-scale assault operation to find and retire all of these \" +\n \"Synthoids in the Sector-12 Slums.\",\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 desc:\n \"Our superiors have ordered us to eradicate everything and everyone \" +\n \"in an underground facility located in Aevum. They tell us \" +\n \"that the facility houses many dangerous Synthoids and \" +\n \"belongs to a terrorist organization called \" +\n \"'The Covenant'. We have no prior intelligence about this \" +\n \"organization, so you are going in blind.\",\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 desc:\n \"OmniTek Incorporated, the original designer and manufacturer of Synthoids, \" +\n \"has notified us of a malfunction in their AI design. This malfunction, \" +\n \"when triggered, causes MK-VI Synthoids to become radicalized and seek out \" +\n \"the destruction of humanity. They say that this bug affects all MK-VI Synthoids, \" +\n \"not just the rogue ones from the Uprising.<br><br>\" +\n \"OmniTek has also told us they they believe someone has triggered this \" +\n \"malfunction in a large group of MK-VI Synthoids, and that these newly-radicalized Synthoids \" +\n \"are now amassing in Volhaven to form a terrorist group called Ultron.<br><br>\" +\n \"Intelligence suggests Ultron is heavily armed and that their members are \" +\n \"augmented. We believe Ultron is making moves to take control of \" +\n \"and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).<br><br>\" +\n \"Your task is to find and destroy 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 desc:\n \"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)<br><br>\" +\n \"Throughout all of humanity's history, we have relied on \" +\n \"technology to survive, conquer, and progress. Its advancement became our primary goal. \" +\n \"And at the peak of human civilization technology turned into \" +\n \"power. Global, absolute power.<br><br>\" +\n \"It seems that the universe is not without a sense of irony.<br><br>\" +\n \"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\",\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 desc:\n \"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)<br><br>\" +\n \"The bits are all around us. The daemons that hold the Node \" +\n \"together can manifest themselves in many different ways.<br><br>\" +\n \"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\",\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 desc: \"Yesterday we obeyed kings and bent our neck to emperors. \" + \"Today we kneel only to truth.\",\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 desc:\n \"Improve your abilities at the Bladeburner unit's specialized training \" +\n \"center. Doing this gives experience for all combat stats and also \" +\n \"increases your max stamina.\",\n });\n\n actionName = \"Field Analysis\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n desc:\n \"Mine and analyze Synthoid-related data. This improves the \" +\n \"Bladeburner's unit intelligence on Synthoid locations and \" +\n \"activities. Completing this action will improve the accuracy \" +\n \"of your Synthoid population estimated in the current city.<br><br>\" +\n \"Does NOT require stamina.\",\n });\n\n actionName = \"Recruitment\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n desc:\n \"Attempt to recruit members for your Bladeburner team. These members \" +\n \"can help you conduct operations.<br><br>\" +\n \"Does NOT require stamina.\",\n });\n\n actionName = \"Diplomacy\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n desc:\n \"Improve diplomatic relations with the Synthoid population. \" +\n \"Completing this action will reduce the Chaos level in your current city.<br><br>\" +\n \"Does NOT require stamina.\",\n });\n\n actionName = \"Hyperbolic Regeneration Chamber\";\n GeneralActions[actionName] = new Action({\n name: actionName,\n desc:\n \"Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. \" +\n \"This will slowly heal your wounds and slightly increase your stamina.<br><br>\",\n });\n})();\n","import { BitNodes } from \"../BitNode/BitNode\";\n\nexport class SourceFile {\n info: string;\n lvl = 1;\n n: number;\n name: string;\n owned = false;\n\n constructor(number: number, info = \"\") {\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 * 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","/**\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 \"../../utils/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\", false);\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\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\n\ntype IProps = {\n company: Company;\n entryPosType: CompanyPosition;\n onClick: (e: React.MouseEvent<HTMLElement>) => void;\n p: IPlayer;\n style?: any;\n text: string;\n};\n\nexport class ApplyToJobButton extends React.Component<IProps, any> {\n constructor(props: IProps) {\n super(props);\n\n this.getJobRequirementTooltip = this.getJobRequirementTooltip.bind(this);\n }\n\n getJobRequirementTooltip(): string {\n const pos = this.props.p.getNextCompanyPosition(this.props.company, this.props.entryPosType);\n if (pos == null) {\n return \"\";\n }\n\n if (!this.props.company.hasPosition(pos)) {\n return \"\";\n }\n\n return getJobRequirementText(this.props.company, pos, true);\n }\n\n render(): React.ReactNode {\n return (\n <StdButton\n onClick={this.props.onClick}\n style={this.props.style}\n text={this.props.text}\n tooltip={this.getJobRequirementTooltip()}\n />\n );\n }\n}\n","/**\n * React component to create an accordion element\n */\nimport * as React from \"react\";\n\ntype IProps = {\n headerClass?: string; // Override default class\n headerContent: React.ReactElement;\n panelClass?: string; // Override default class\n panelContent: React.ReactElement;\n panelInitiallyOpened?: boolean;\n style?: string;\n};\n\ntype IState = {\n panelOpened: boolean;\n};\n\nexport class BBAccordion extends React.Component<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n\n this.handleHeaderClick = this.handleHeaderClick.bind(this);\n\n this.state = {\n panelOpened: props.panelInitiallyOpened ? props.panelInitiallyOpened : false,\n };\n }\n\n handleHeaderClick(): void {\n this.setState({\n panelOpened: !this.state.panelOpened,\n });\n }\n\n render(): React.ReactNode {\n let className = \"accordion-header\";\n if (typeof this.props.headerClass === \"string\") {\n className = this.props.headerClass;\n }\n\n if (this.state.panelOpened) className += \" active\";\n\n return (\n <>\n <button className={className} onClick={this.handleHeaderClick}>\n {this.props.headerContent}\n </button>\n <AccordionPanel\n opened={this.state.panelOpened}\n panelClass={this.props.panelClass}\n panelContent={this.props.panelContent}\n />\n </>\n );\n }\n}\n\ntype IPanelProps = {\n opened: boolean;\n panelClass?: string; // Override default class\n panelContent: React.ReactElement;\n};\n\nclass AccordionPanel extends React.Component<IPanelProps, any> {\n shouldComponentUpdate(nextProps: IPanelProps): boolean {\n return this.props.opened || nextProps.opened;\n }\n\n render(): React.ReactNode {\n let className = \"accordion-panel\";\n if (typeof this.props.panelClass === \"string\") {\n className = this.props.panelClass;\n }\n\n if (!this.props.opened) return <></>;\n\n return (\n <div className={className} style={{ display: \"block\" }}>\n {this.props.panelContent}\n </div>\n );\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 UndocumentedFunctionCall = \"UndocumentedFunctionCall\",\n Unclickable = \"Unclickable\",\n PrototypeTampering = \"PrototypeTampering\",\n Bypass = \"Bypass\",\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 UndocumentedFunctionCall: \"by looking beyond the documentation.\",\n EditSaveFile: \"by editing your save file.\",\n PrototypeTampering: \"by tampering with Numbers prototype.\",\n Unclickable: \"by clicking the unclickable.\",\n Bypass: \"by circumventing the ram cost of document.\",\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","/**\n * Event emitter that triggers when scripts are started/stopped\n */\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nexport const WorkerScriptStartStopEventEmitter = new EventEmitter<[]>();\n","/**\n * Stateless button that represents something that has been purchased.\n */\nimport * as React from \"react\";\n\ninterface IStdButtonPurchasedProps {\n onClick?: (e: React.MouseEvent<HTMLElement>) => any;\n style?: any;\n text: string;\n tooltip?: string;\n}\n\ntype IInnerHTMLMarkup = {\n __html: string;\n};\n\nexport class StdButtonPurchased extends React.Component<IStdButtonPurchasedProps, any> {\n constructor(props: IStdButtonPurchasedProps) {\n super(props);\n this.hasTooltip = this.hasTooltip.bind(this);\n this.tooltip = this.tooltip.bind(this);\n }\n\n hasTooltip(): boolean {\n return this.props.tooltip != null && this.props.tooltip !== \"\";\n }\n\n tooltip(): string {\n if (!this.props.tooltip) return \"\";\n return this.props.tooltip;\n }\n\n render(): React.ReactNode {\n let className = \"std-button-bought\";\n if (this.hasTooltip()) {\n className += \" tooltip\";\n }\n\n // Tooltip will be set using inner HTML\n let tooltipMarkup: IInnerHTMLMarkup = {\n __html: \"\",\n };\n if (this.hasTooltip()) {\n tooltipMarkup = {\n __html: this.tooltip(),\n };\n }\n\n return (\n <button className={className} onClick={this.props.onClick} style={this.props.style}>\n {this.props.text}\n {this.hasTooltip() && <span className={\"tooltiptext\"} dangerouslySetInnerHTML={tooltipMarkup}></span>}\n </button>\n );\n }\n}\n","import { DarkWebItem } from \"./DarkWebItem\";\nimport { IMap } from \"../types\";\nimport { Programs } from \"../Programs/Programs\";\n\nexport const DarkWebItems: IMap<DarkWebItem> = {\n BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, \"Opens up SSH Ports\"),\n FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, \"Opens up FTP Ports\"),\n RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, \"Opens up SMTP Ports\"),\n HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, \"Opens up HTTP Ports\"),\n SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, \"Opens up SQL Ports\"),\n 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","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n URLImportError = -3,\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 { getElementById } from \"./getElementById\";\nimport { removeElement } from \"./removeElement\";\n\n/**\n * Given its id, this function removes an element AND its children\n * @param id The HTML identifier to search for and remove.\n */\nexport function removeElementById(id: string): void {\n try {\n const elem: HTMLElement = getElementById(id);\n removeElement(elem);\n } catch (e) {\n // Probably should log this as we're trying to remove elements that don't exist.\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","import React, { useState, useEffect } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { killWorkerScript } from \"../src/Netscript/killWorkerScript\";\nimport { RunningScript } from \"../src/Script/RunningScript\";\n\nimport { createElement } from \"./uiHelpers/createElement\";\nimport { removeElementById } from \"./uiHelpers/removeElementById\";\n\nlet gameContainer: HTMLElement;\n\n(function () {\n function getGameContainer(): void {\n const container = document.getElementById(\"entire-game-container\");\n if (container == null) {\n throw new Error(`Failed to find game container DOM element`);\n }\n\n gameContainer = container;\n document.removeEventListener(\"DOMContentLoaded\", getGameContainer);\n }\n\n document.addEventListener(\"DOMContentLoaded\", getGameContainer);\n})();\n\ninterface IProps {\n script: RunningScript;\n container: HTMLElement;\n id: string;\n}\n\nfunction ScriptLogPopup(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n\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 close(): void {\n const content = document.getElementById(props.id);\n if (content == null) return;\n ReactDOM.unmountComponentAtNode(content);\n removeElementById(props.id);\n }\n\n useEffect(() => {\n function closeHandler(event: KeyboardEvent): void {\n if (event.keyCode === 27) {\n close();\n }\n }\n\n document.addEventListener(\"keydown\", closeHandler);\n\n return () => {\n document.removeEventListener(\"keydown\", closeHandler);\n };\n }, []);\n\n function kill(): void {\n killWorkerScript(props.script, props.script.server, true);\n close();\n }\n\n function drag(event: React.MouseEvent<HTMLElement, MouseEvent>): void {\n event.preventDefault();\n let x = event.clientX;\n let y = event.clientY;\n let left = props.container.offsetLeft + props.container.clientWidth / 2;\n let top = props.container.offsetTop + props.container.clientWidth / 5;\n function mouseMove(event: MouseEvent): void {\n left += event.clientX - x;\n top += event.clientY - y;\n props.container.style.left = left + \"px\";\n props.container.style.top = top + \"px\";\n // reset right and bottom to avoid the window stretching\n props.container.style.right = \"\";\n props.container.style.bottom = \"\";\n x = event.clientX;\n y = event.clientY;\n }\n function mouseUp(): void {\n document.removeEventListener(\"mouseup\", mouseUp);\n document.removeEventListener(\"mousemove\", mouseMove);\n }\n document.addEventListener(\"mouseup\", mouseUp);\n document.addEventListener(\"mousemove\", mouseMove);\n }\n\n return (\n <>\n <div className=\"log-box-header\" onMouseDown={drag}>\n <p>\n {props.script.filename} {props.script.args.map((x: any): string => `${x}`).join(\" \")}\n </p>\n <div>\n <button className=\"log-box-button\" onClick={kill}>\n Kill Script\n </button>\n <button className=\"log-box-button\" onClick={close}>\n Close\n </button>\n </div>\n </div>\n <div className=\"log-box-log-container\">\n <p>\n {props.script.logs.map(\n (line: string, i: number): JSX.Element => (\n <span key={i} style={{ whiteSpace: \"pre-line\" }}>\n {line}\n <br />\n </span>\n ),\n )}\n </p>\n </div>\n </>\n );\n}\n\nexport function logBoxCreate(script: RunningScript): void {\n const id = script.server + \"-\" + script.filename + script.args.map((x: any): string => `${x}`).join(\"-\");\n if (document.getElementById(id) !== null) return;\n const container = createElement(\"div\", {\n class: \"log-box-container\",\n id: id,\n });\n gameContainer.appendChild(container);\n ReactDOM.render(<ScriptLogPopup script={script} id={id} container={container} />, container);\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() {\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 },\n typography: {\n fontFamily: \"monospace\",\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 },\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 },\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 },\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 desc?: 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 desc = \"\";\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 if (params && params.desc) this.desc = params.desc;\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","import { loadAliases, loadGlobalAliases, Aliases, GlobalAliases } from \"./Alias\";\nimport { Companies, loadCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Engine } from \"./engine\";\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 { AllServers, loadAllServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { loadSpecialServerIps, SpecialServerIps } from \"./Server/SpecialServerIps\";\nimport { SourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\n\nimport { createStatusText } from \"./ui/createStatusText\";\n\nimport { setTimeoutRef } from \"./utils/SetTimeoutRef\";\nimport * as ExportBonus from \"./ExportBonus\";\n\nimport { dialogBoxCreate } from \"../utils/DialogBox\";\nimport { clearEventListeners } from \"../utils/uiHelpers/clearEventListeners\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON } from \"../utils/JSONReviver\";\nimport { save } from \"./db\";\n\nimport Decimal from \"decimal.js\";\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 SpecialServerIpsSave = \"\";\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 // Delete all logs from all running scripts\n var TempAllServers = JSON.parse(JSON.stringify(AllServers), Reviver);\n for (var ip in TempAllServers) {\n var server = TempAllServers[ip];\n if (server == null) {\n continue;\n }\n for (var i = 0; i < server.runningScripts.length; ++i) {\n var runningScriptObj = server.runningScripts[i];\n runningScriptObj.logs.length = 0;\n runningScriptObj.logs = [];\n }\n }\n\n this.AllServersSave = JSON.stringify(TempAllServers);\n this.CompaniesSave = JSON.stringify(Companies);\n this.FactionsSave = JSON.stringify(Factions);\n this.SpecialServerIpsSave = JSON.stringify(SpecialServerIps);\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 var 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(() => createStatusText(\"Game saved!\"))\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 var 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 var 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 setTimeoutRef(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) {\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 loadSpecialServerIps(saveObj.SpecialServerIpsSave);\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 (saveObj.hasOwnProperty(\"VersionSave\")) {\n try {\n var 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 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\n return true;\n}\n\nfunction createNewUpdateText() {\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() {\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\nlet saveObject = new BitburnerSaveObject();\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 console.warn(`Sleeve.getRepGain() called for invalid task type: ${this.currentTask}`);\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 time = this.storedCycles * CONSTANTS.MilliPerCycle;\n let cyclesUsed = this.storedCycles;\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 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 break;\n case SleeveTaskType.Synchro:\n this.sync = Math.min(100, this.sync + p.getIntelligenceBonus(0.5) * 0.0002 * cyclesUsed);\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:\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 this.currentTaskMaxTime = CONSTANTS.MillisecondsPer8Hours;\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 this.currentTaskMaxTime = CONSTANTS.MillisecondsPer20Hours;\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\";\n\n constructor(time: number, action: \"h\" | \"b\" | \"a\") {\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 finishHack(router: IRouter, 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","/**\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 { AllServers } 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 serverIp: string;\n\n constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => any) {\n this.name = runningScriptObj.filename;\n this.serverIp = 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 = AllServers[this.serverIp];\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${this.serverIp}`);\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 = AllServers[this.serverIp];\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 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 \"../../utils/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 \"../../utils/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","/**\n * Implements the purchasing of extra Duplicate Sleeves from The Covenant,\n * as well as the purchasing of upgrades (memory)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { CovenantPurchasesRoot } from \"./ui/CovenantPurchasesRoot\";\nimport { createPopup, removePopup } from \"../../ui/React/createPopup\";\n\nexport const MaxSleevesFromCovenant = 5;\nexport const BaseCostPerSleeve = 10e12;\nexport const PopupId = \"covenant-sleeve-purchases-popup\";\n\nexport function createSleevePurchasesFromCovenantPopup(p: IPlayer): void {\n createPopup(PopupId, CovenantPurchasesRoot, {\n p: p,\n closeFn: () => removePopup(PopupId),\n });\n}\n","/**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute,\n * throwing an error if it is unable to find it.\n * @param elementId The HTML ID to retrieve the element by.\n * @throws {Error} When the 'elementId' cannot be found.\n */\nexport function getElementById(elementId: string): HTMLElement {\n const el: HTMLElement | null = document.getElementById(elementId);\n if (el === null) {\n throw new Error(`Unable to find element with id '${elementId}'`);\n }\n\n return el;\n}\n","import { Augmentations } from \"./Augmentation/Augmentations\";\nimport { augmentationExists, initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { Companies, initCompanies } from \"./Company/Companies\";\nimport { resetIndustryResearchTrees } from \"./Corporation/IndustryData\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Engine } from \"./engine\";\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 { AllServers, AddToAllServers, initForeignServers, prestigeAllServers } from \"./Server/AllServers\";\nimport { prestigeHomeComputer } from \"./Server/ServerHelpers\";\nimport { SourceFileFlags, updateSourceFileFlags } from \"./SourceFile/SourceFileFlags\";\nimport { SpecialServerIps, prestigeSpecialServerIps, SpecialServerNames } from \"./Server/SpecialServerIps\";\nimport { deleteStockMarket, initStockMarket, initSymbolToStockMap } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { dialogBoxCreate } from \"../utils/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 // Delete Special Server IPs\n prestigeSpecialServerIps(); // 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 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\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 WorldDaemonIP = SpecialServerIps[SpecialServerNames.WorldDaemon];\n if (typeof WorldDaemonIP !== \"string\") throw new Error(\"WorldDaemonIP should be string\");\n const WorldDaemon = AllServers[WorldDaemonIP];\n const DaedalusServerIP = SpecialServerIps[SpecialServerNames.DaedalusServer];\n if (typeof DaedalusServerIP !== \"string\") throw new Error(\"DaedalusServerIP should be string\");\n const DaedalusServer = AllServers[DaedalusServerIP];\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.ip);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.ip);\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 var homeComp = Player.getHomeComputer();\n\n // Delete all servers except home computer\n prestigeAllServers(); // Must be done before initForeignServers()\n\n // Delete Special Server IPs\n prestigeSpecialServerIps();\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 (var member in Companies) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n // Reset favor for factions\n for (var 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 (var 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 * WichmannHill 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","import { SourceFile } from \"./SourceFile\";\nimport { IMap } from \"../types\";\n\nexport const SourceFiles: IMap<SourceFile> = {};\n\nSourceFiles[\"SourceFile1\"] = new SourceFile(\n 1,\n \"This Source-File lets the player start with 32GB of RAM on his/her \" +\n \"home computer. It also increases all of the player's multipliers by:<br><br>\" +\n \"Level 1: 16%<br>\" +\n \"Level 2: 24%<br>\" +\n \"Level 3: 28%\",\n);\nSourceFiles[\"SourceFile2\"] = new SourceFile(\n 2,\n \"This Source-File allows you to form gangs in other BitNodes \" +\n \"once your karma decreases to a certain value. It also increases the player's \" +\n \"crime success rate, crime money, and charisma multipliers by:<br><br>\" +\n \"Level 1: 24%<br>\" +\n \"Level 2: 36%<br>\" +\n \"Level 3: 42%\",\n);\nSourceFiles[\"SourceFile3\"] = new SourceFile(\n 3,\n \"This Source-File lets you create corporations on other BitNodes (although \" +\n \"some BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers by:<br>\" +\n \"Level 1: 8%<br>\" +\n \"Level 2: 12%<br>\" +\n \"Level 3: 14%\",\n);\nSourceFiles[\"SourceFile4\"] = new SourceFile(\n 4,\n \"This Source-File lets you access and use the Singularity Functions in every BitNode. Every \" +\n \"level of this Source-File opens up more of the Singularity Functions you can use.\",\n);\nSourceFiles[\"SourceFile5\"] = new SourceFile(\n 5,\n \"This Source-File grants a special new stat called Intelligence. Intelligence \" +\n \"is unique because it is permanent and persistent (it never gets reset back to 1). However, \" +\n \"gaining Intelligence experience is much slower than other stats, and it is also hidden (you won't \" +\n \"know when you gain experience and how much). Higher Intelligence levels will boost your production \" +\n \"for many actions in the game. In addition, this Source-File will unlock the getBitNodeMultipliers() \" +\n \"and getServer() Netscript functions, as well as the formulas API, and will raise all of your \" +\n \"hacking-related multipliers by:<br><br> \" +\n \"Level 1: 8%<br>\" +\n \"Level 2: 12%<br>\" +\n \"Level 3: 14%\",\n);\nSourceFiles[\"SourceFile6\"] = new SourceFile(\n 6,\n \"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 stats by:<br><br>\" +\n \"Level 1: 8%<br>\" +\n \"Level 2: 12%<br>\" +\n \"Level 3: 14%\",\n);\nSourceFiles[\"SourceFile7\"] = new SourceFile(\n 7,\n \"This Source-File allows you to access the Bladeburner Netscript API in other \" +\n \"BitNodes. In addition, this Source-File will increase all of your Bladeburner multipliers by:<br><br>\" +\n \"Level 1: 8%<br>\" +\n \"Level 2: 12%<br>\" +\n \"Level 3: 14%\",\n);\nSourceFiles[\"SourceFile8\"] = new SourceFile(\n 8,\n \"This Source-File grants the following benefits:<br><br>\" +\n \"Level 1: Permanent access to WSE and TIX API<br>\" +\n \"Level 2: Ability to short stocks in other BitNodes<br>\" +\n \"Level 3: Ability to use limit/stop orders in other BitNodes<br><br>\" +\n \"This Source-File also increases your hacking growth multipliers by: \" +\n \"<br>Level 1: 12%<br>Level 2: 18%<br>Level 3: 21%\",\n);\nSourceFiles[\"SourceFile9\"] = new SourceFile(\n 9,\n \"This Source-File grants the following benefits:<br><br>\" +\n \"Level 1: Permanently unlocks the Hacknet Server in other BitNodes<br>\" +\n \"Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode<br>\" +\n \"Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode<br><br>\" +\n \"(Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT \" +\n \"when installing Augmentations)\",\n);\nSourceFiles[\"SourceFile10\"] = new SourceFile(\n 10,\n \"This Source-File unlocks Sleeve technology in other BitNodes. Each level of this \" +\n \"Source-File also grants you a Duplicate Sleeve\",\n);\nSourceFiles[\"SourceFile11\"] = new SourceFile(\n 11,\n \"This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate \" +\n \"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:<br><br>\" +\n \"Level 1: 32%<br>\" +\n \"Level 2: 48%<br>\" +\n \"Level 3: 56%<br><br>\" +\n \"It also reduces the price increase for every aug bought by:<br><br>\" +\n \"Level 1: 4%<br>\" +\n \"Level 2: 6%<br>\" +\n \"Level 3: 7%\",\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\";\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: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport const Modal = (props: IProps): React.ReactElement => {\n const classes = useStyles();\n return (\n <M open={props.open} onClose={props.onClose} closeAfterTransition className={classes.modal}>\n <Fade in={props.open}>\n <div className={classes.paper}>\n <Box sx={{ m: 2 }}>{props.children}</Box>\n </div>\n </Fade>\n </M>\n );\n};\n","import * as React from \"react\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { dialogBoxCreate } from \"../../utils/DialogBox\";\n\nconst gainLimit = 10e9;\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 * 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: server ip] -> 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 // IP 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(serverIp: string, moneyGained: number, n = 1): void {\n if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) {\n this.dataMap[serverIp] = [0, 0, 0, 0];\n }\n this.dataMap[serverIp][0] += moneyGained;\n this.dataMap[serverIp][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(serverIp: string, n = 1): void {\n if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) {\n this.dataMap[serverIp] = [0, 0, 0, 0];\n }\n this.dataMap[serverIp][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(serverIp: string, n = 1): void {\n if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) {\n this.dataMap[serverIp] = [0, 0, 0, 0];\n }\n this.dataMap[serverIp][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","/**\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 { setTimeoutRef } from \"../utils/SetTimeoutRef\";\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 // IP 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; // IP 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 setTimeoutRef(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(code: string, serverIp: string, otherScripts: Script[]): void {\n // Update code and filename\n this.code = code.replace(/^\\s+|\\s+$/g, \"\");\n\n const filenameElem: HTMLInputElement | null = document.getElementById(\"script-editor-filename\") as HTMLInputElement;\n if (filenameElem == null) {\n console.error(`Failed to get Script filename DOM element`);\n return;\n }\n this.filename = filenameElem.value;\n this.server = serverIp;\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 }\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","// 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 { Factions } from \"./Faction/Factions\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\nexport let LastExportBonus = 0;\n\nconst bonusTimer = 24 * 60 * 60 * 1000; // 24h\nexport function canGetBonus(): boolean {\n const now = new Date().getTime();\n if (now - LastExportBonus > bonusTimer) return true;\n return false;\n}\n\nexport function onExport(p: IPlayer): void {\n if (!canGetBonus()) return;\n for (const facName of p.factions) {\n Factions[facName].favor++;\n }\n LastExportBonus = new Date().getTime();\n}\n\nexport function setLastExportBonus(unixTime: number): void {\n LastExportBonus = unixTime;\n}\n","import { EventEmitter } from \"../../utils/EventEmitter\";\nexport const ITutorialEvents = new EventEmitter<[]>();\n","import {\n CodingContract,\n CodingContractRewardType,\n CodingContractTypes,\n ICodingContractReward,\n} from \"./CodingContracts\";\nimport { Factions } from \"./Faction/Factions\";\nimport { Player } from \"./Player\";\nimport { AllServers } from \"./Server/AllServers\";\nimport { GetServerByHostname } from \"./Server/ServerHelpers\";\nimport { SpecialServerNames } from \"./Server/SpecialServerIps\";\nimport { Server } from \"./Server/Server\";\nimport { HacknetServer } from \"./Hacknet/HacknetServer\";\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 = GetServerByHostname(params.server);\n if (server == null) {\n server = AllServers[params.server];\n }\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(): Server | HacknetServer {\n const servers = Object.keys(AllServers);\n let randIndex = getRandomInt(0, servers.length - 1);\n let randServer = AllServers[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 !== SpecialServerNames.WorldDaemon\n ) {\n break;\n }\n randIndex = getRandomInt(0, servers.length - 1);\n randServer = AllServers[servers[randIndex]];\n }\n\n return randServer;\n}\n\nfunction getRandomFilename(server: Server | HacknetServer, 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 { 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 mult = getRandomInt(76, 100) / 100;\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 * mult,\n charisma: cha * mult,\n experience: exp * mult,\n creativity: cre * mult,\n efficiency: eff * mult,\n salary: sal * mult,\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","/**\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 * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nexport function Favor(favor: number | string): JSX.Element {\n return (\n <span className={\"light-yellow samefont\"}>\n {typeof favor === \"number\" ? numeralWrapper.formatFavor(favor) : favor}\n </span>\n );\n}\n","/**\n * This is an object that is used to keep track of where all of the player's\n * money is coming from (or going to)\n */\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/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 * 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 { StdButton } from \"../../ui/React/StdButton\";\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 * 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","/**\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","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 { Engine } from \"./engine\";\nimport { createStatusText } from \"./ui/createStatusText\";\n\nfunction 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>, ev: Event) {\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\ninterface ILoadCallback {\n success: (s: string) => void;\n error?: () => void;\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\ninterface ISaveCallback {\n success: () => void;\n error?: () => void;\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 { 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 this.mku = 100 / (advMult * Math.pow(this.qlt + 0.001, 0.65) * (busRatio + mgmtRatio));\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) 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","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 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\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\n\nexport enum TickerDisplayMode {\n AllStocks,\n Portfolio,\n}\n\ntype IProps = {\n changeDisplayMode: () => void;\n changeWatchlistFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;\n collapseAllTickers: () => void;\n expandAllTickers: () => void;\n tickerDisplayMode: TickerDisplayMode;\n};\n\nexport class StockTickersConfig extends React.Component<IProps, any> {\n constructor(props: IProps) {\n super(props);\n }\n\n renderDisplayModeButton(): React.ReactNode {\n let txt = \"\";\n let tooltip = \"\";\n if (this.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 <StdButton onClick={this.props.changeDisplayMode} text={txt} tooltip={tooltip} />;\n }\n\n render(): React.ReactNode {\n return (\n <div>\n {this.renderDisplayModeButton()}\n <StdButton onClick={this.props.expandAllTickers} text=\"Expand Tickers\" />\n <StdButton onClick={this.props.collapseAllTickers} text=\"Collapse Tickers\" />\n\n <input\n className=\"text-input\"\n id=\"stock-market-watchlist-filter\"\n onChange={this.props.changeWatchlistFilter}\n placeholder=\"Filter Stocks by symbol (comma-separated list)\"\n type=\"text\"\n />\n </div>\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","/**\n * For a given element, this function removes it AND its children\n * @param elem The element to remove.\n */\nexport function removeElement(elem: Element | null): void {\n if (elem === null) {\n // tslint:disable-next-line:no-console\n console.debug(\"The element passed into 'removeElement' was null.\");\n\n return;\n }\n if (!(elem instanceof Element)) {\n // tslint:disable-next-line:no-console\n console.debug(\"The element passed into 'removeElement' was not an instance of an Element.\");\n\n return;\n }\n\n while (elem.firstChild !== null) {\n elem.removeChild(elem.firstChild);\n }\n\n if (elem.parentNode !== null) {\n elem.parentNode.removeChild(elem);\n }\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.12,\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\";\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 <span\n className=\"tooltip\"\n style={{\n color: \"white\",\n whiteSpace: \"nowrap\",\n margin: \"0px\",\n padding: \"0px\",\n }}\n onClick={() => props.onTravel(props.city)}\n >\n <span className=\"tooltiptext\">{props.city}</span>\n <b>{props.city[0]}</b>\n </span>\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 <div className=\"noselect\">\n <pre> ,_ . ._. _. .</pre>\n <pre> , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-</pre>\n <pre> /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_</pre>\n <pre> / ,/'-/~ '\\ ,' _ , '<City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Volhaven} />,'|~ ._/-, /~</pre>\n <pre> ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~</pre>\n <pre>.-~ '| '',\\~|\\ _\\~ ,_ , <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Chongqing} /> /,</pre>\n <pre> '\\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Sector12} /> /'~ |_/~\\\\,-,~ \\ \" ,_,/ |</pre>\n <pre> | / ._-~'\\_ _~| \\ ) <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.NewTokyo} /></pre>\n <pre> \\ __-\\ '/ ~ |\\ \\_ / ~</pre>\n <pre> ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,</pre>\n <pre> ~-_' _; '\\ '-, \\,' /\\/ |</pre>\n <pre> '\\_,~'\\_ \\_ _, /' ' |, /|'</pre>\n <pre> / \\_ ~ | / \\ ~'; -,_.</pre>\n <pre> | ~\\ | | , '-_, ,; ~ ~\\</pre>\n <pre> \\, <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Aevum} /> / \\ / /| ,-, , -,</pre>\n <pre> | ,/ | |' |/ ,- ~ \\ '.</pre>\n <pre> ,| ,/ \\ ,/ \\ <City onTravel={props.onTravel} currentCity={props.currentCity} city={CityName.Ishima} /> |</pre>\n <pre> / | ~ -~~-, / _</pre>\n <pre> | ,-' ~ /</pre>\n <pre> / ,' ~</pre>\n <pre> ',| ~</pre>\n <pre> ~'</pre>\n </div>\n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\n\ninterface IProps {\n chance: number[];\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n if (props.chance[0] === props.chance[1]) {\n return <>{formatNumber(props.chance[0] * 100, 1)}%</>;\n }\n\n return (\n <>\n {formatNumber(props.chance[0] * 100, 1)}% ~ {formatNumber(props.chance[1] * 100, 1)}%\n </>\n );\n}\n","import { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, Reviver } from \"../../utils/JSONReviver\";\nimport { createElement } from \"../../utils/uiHelpers/createElement\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\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 //'panel' is the DOM element on which to create the UI\n createUI(panel: HTMLElement, corporation: ICorporation, industry: IIndustry): void {\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 panel.style.color = \"white\";\n panel.appendChild(\n createElement(\"p\", {\n id: \"cmpy-mgmt-employee-\" + this.name + \"-panel-text\",\n innerHTML:\n \"Morale: \" +\n formatNumber(this.mor, 3) +\n \"<br>\" +\n \"Happiness: \" +\n formatNumber(this.hap, 3) +\n \"<br>\" +\n \"Energy: \" +\n formatNumber(this.ene, 3) +\n \"<br>\" +\n \"Intelligence: \" +\n formatNumber(effInt, 3) +\n \"<br>\" +\n \"Charisma: \" +\n formatNumber(effCha, 3) +\n \"<br>\" +\n \"Experience: \" +\n formatNumber(this.exp, 3) +\n \"<br>\" +\n \"Creativity: \" +\n formatNumber(effCre, 3) +\n \"<br>\" +\n \"Efficiency: \" +\n formatNumber(effEff, 3) +\n \"<br>\" +\n \"Salary: \" +\n numeralWrapper.format(this.sal, \"$0.000a\") +\n \"/ s<br>\",\n }),\n );\n\n //Selector for employee position\n const selector = createElement(\"select\", {}) as HTMLSelectElement;\n for (const key in EmployeePositions) {\n if (EmployeePositions.hasOwnProperty(key)) {\n selector.add(\n createElement(\"option\", {\n text: EmployeePositions[key],\n value: EmployeePositions[key],\n }) as HTMLOptionElement,\n );\n }\n }\n\n selector.addEventListener(\"change\", () => {\n this.pos = selector.options[selector.selectedIndex].value;\n });\n\n //Set initial value of selector\n for (let i = 0; i < selector.length; ++i) {\n if (selector.options[i].value === this.pos) {\n selector.selectedIndex = i;\n break;\n }\n }\n panel.appendChild(selector);\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 { Crimes } from \"./Crimes\";\nimport { Crime } from \"./Crime\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../../utils/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`, false);\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","/**\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 { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { AddToAllServers, AllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { SpecialServerIps } from \"../../Server/SpecialServerIps\";\n\nexport function hasTorRouter(this: IPlayer): boolean {\n return SpecialServerIps.hasOwnProperty(\"Darkweb Server\");\n}\n\nexport function getCurrentServer(this: IPlayer): Server | HacknetServer {\n const server = AllServers[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 = AllServers[this.homeComputer];\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.ip);\n\n // Configure the HacknetServer to actually act as a Server\n AddToAllServers(server);\n const homeComputer = this.getHomeComputer();\n homeComputer.serversOnNetwork.push(server.ip);\n server.serversOnNetwork.push(homeComputer.ip);\n\n return server;\n}\n","import { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"../Player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServerIps } from \"../Server/SpecialServerIps\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { isValidIPAddress } from \"../../utils/helpers/isValidIPAddress\";\n\n//Posts a \"help\" message if connected to DarkWeb\nexport function checkIfConnectedToDarkweb(): void {\n if (SpecialServerIps.hasOwnProperty(\"Darkweb Server\")) {\n const darkwebIp = SpecialServerIps.getIp(\"Darkweb Server\");\n if (!isValidIPAddress(darkwebIp)) {\n return;\n }\n const server = Player.getCurrentServer();\n if (server !== null && darkwebIp == server.ip) {\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}\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 { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Reputation } from \"../../ui/React/Reputation\";\n\nexport function ReputationRate(reputation: number): JSX.Element {\n return Reputation(`${numeralWrapper.formatReputation(reputation)} / sec`);\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 { 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 { Gang } from \"./Gang/Gang\";\nimport { AllGangs } from \"./Gang/AllGangs\";\nimport { GangMemberTasks } from \"./Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"./Gang/GangMemberUpgrades\";\nimport { Factions, factionExists } from \"./Faction/Factions\";\nimport { joinFaction, purchaseAugmentation } from \"./Faction/FactionHelpers\";\nimport { FactionWorkType } from \"./Faction/FactionWorkTypeEnum\";\nimport { netscriptCanGrow, netscriptCanHack, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\n\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 {\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 { inMission } from \"./Missions\";\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\";\n\nimport { AllServers, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport {\n GetServerByHostname,\n getServer,\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 { SpecialServerIps } from \"./Server/SpecialServerIps\";\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 { NetscriptPort } from \"./NetscriptPort\";\nimport { SleeveTaskType } from \"./PersonObjects/Sleeve/SleeveTaskTypesEnum\";\nimport { findSleevePurchasableAugs } from \"./PersonObjects/Sleeve/SleeveHelpers\";\nimport { Exploit } from \"./Exploits/Exploit\";\nimport { Router } from \"./ui/GameRoot\";\n\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { setTimeoutRef } from \"./utils/SetTimeoutRef\";\nimport { is2DArray } from \"./utils/helpers/is2DArray\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\n\nimport { logBoxCreate } from \"../utils/LogBox\";\nimport { arrayToString } from \"../utils/helpers/arrayToString\";\nimport { isString } from \"../utils/helpers/isString\";\n\nimport { createElement } from \"../utils/uiHelpers/createElement\";\nimport { createPopup } from \"../utils/uiHelpers/createPopup\";\nimport { removeElementById } from \"../utils/uiHelpers/removeElementById\";\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\";\nimport { HacknetNode } from \"./Hacknet/HacknetNode\";\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 (var key in pseudoObj.properties) {\n const val = pseudoObj.properties[key];\n nativeObj[key] = toNative(val);\n }\n }\n return nativeObj;\n}\n\ninterface NS {\n [key: string]: any;\n}\n\nfunction NetscriptFunctions(workerScript: WorkerScript): NS {\n const updateDynamicRam = function (fnName: string, ramCost: number) {\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.serverIp}`);\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 &nbsp;&nbsp;const scan = eval('ns.scan');\n\n * Using map access to do the same\n &nbsp;&nbsp;const scan = ns['scan'];\n\n * Saving script in the improper order.\n &nbsp;&nbsp;Increase the cost of an imported script, save it, then run the\n &nbsp;&nbsp;parent. To fix this just re-open & save every script in order\n &nbsp;&nbsp;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 = \"\") {\n var 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) {\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.serverIp;\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) {\n if (typeof callingFnName !== \"string\" || callingFnName === \"\") {\n callingFnName = \"getRunningScriptgetRunningScriptByPid\";\n }\n\n for (const name of Object.keys(AllServers)) {\n const server = AllServers[name];\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) {\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 = \"\") {\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 = \"\") {\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 = \"\") {\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 // Utility function to get Hacknet Node object\n const getHacknetNode = function (i: any, callingFn: any = \"\"): HacknetNode | HacknetServer {\n if (isNaN(i)) {\n throw makeRuntimeErrorMsg(callingFn, \"Invalid index specified for Hacknet Node: \" + i);\n }\n if (i < 0 || i >= Player.hacknetNodes.length) {\n throw 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 !== \"number\") throw new Error(\"hacknet node was not number\");\n const hserver = AllServers[hi];\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw 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 const makeRuntimeErrorMsg = function (caller: string, msg: 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 function parseChromeStackline(line: string) {\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) {\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 let 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) {\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) {\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) {\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) {\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 checkSleeveAPIAccess = function (func: any) {\n if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {\n throw 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) {\n if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n workerScript.log(func, msg);\n throw makeRuntimeErrorMsg(`sleeve.${func}`, msg);\n }\n };\n\n const getCodingContract = function (func: any, ip: any, fn: any) {\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 checkGangApiAccess = function (func: any) {\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 makeRuntimeErrorMsg(`gang.${func}`, `You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (func: any, name: any) {\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 makeRuntimeErrorMsg(`gang.${func}`, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (func: any, name: any) {\n const task = GangMemberTasks[name];\n if (!task) {\n throw makeRuntimeErrorMsg(`gang.${func}`, `Invalid task: '${name}'`);\n }\n\n return task;\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) {\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 = {}) {\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 var hackChance = calculateHackingChance(server, Player);\n var rand = Math.random();\n var expGainedOnSuccess = calculateHackingExpGain(server, Player) * threads;\n var 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.ip, 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: IArguments): 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 functions = {\n hacknet: {\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 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 sprintf: sprintf,\n vsprintf: vsprintf,\n scan: function (ip: any = workerScript.serverIp, hostnames: any = true): any {\n updateDynamicRam(\"scan\", getRamCost(\"scan\"));\n var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scan\", `Invalid IP/hostname: ${ip}.`);\n }\n var out = [];\n for (var i = 0; i < server.serversOnNetwork.length; i++) {\n var entry;\n const s = getServerOnNetwork(server, i);\n if (s === null) continue;\n if (hostnames) {\n entry = s.hostname;\n } else {\n entry = s.ip;\n }\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.serverIp);\n if (!(host instanceof Server)) {\n workerScript.log(\"grow\", \"Cannot be executed on this server.\");\n return false;\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 var 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 server.moneyAvailable += 1 * threads; // It can be grown even if it has no money\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n workerScript.scriptRef.recordGrow(server.ip, threads);\n var 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): 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);\n },\n weaken: function (ip: any, { threads: requestedThreads }: any = {}): any {\n updateDynamicRam(\"weaken\", getRamCost(\"weaken\"));\n var 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.serverIp);\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.ip, 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 (): any {\n if (arguments.length === 0) {\n throw makeRuntimeErrorMsg(\"print\", \"Takes at least 1 argument.\");\n }\n workerScript.print(argsToString(arguments));\n },\n tprint: function (): any {\n if (arguments.length === 0) {\n throw makeRuntimeErrorMsg(\"tprint\", \"Takes at least 1 argument.\");\n }\n Terminal.print(`${workerScript.scriptRef.filename}: ${argsToString(arguments)}`);\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.serverIp, ...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 logBoxCreate(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): 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 var argsForNewScript = [];\n for (var i = 2; i < arguments.length; ++i) {\n argsForNewScript.push(arguments[i]);\n }\n var scriptServer = getServer(workerScript.serverIp);\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, argsForNewScript, workerScript, threads);\n },\n exec: function (scriptname: any, ip: any, threads: any = 1): 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 var argsForNewScript = [];\n for (var i = 3; i < arguments.length; ++i) {\n argsForNewScript.push(arguments[i]);\n }\n var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"exec\", `Invalid IP/hostname: ${ip}`);\n }\n return runScriptFromScript(\"exec\", server, scriptname, argsForNewScript, workerScript, threads);\n },\n spawn: function (scriptname: any, threads: 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 setTimeoutRef(() => {\n if (isNaN(threads) || threads <= 0) {\n throw makeRuntimeErrorMsg(\"spawn\", `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n var argsForNewScript = [];\n for (var i = 2; i < arguments.length; ++i) {\n argsForNewScript.push(arguments[i]);\n }\n var scriptServer = getServer(workerScript.serverIp);\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, argsForNewScript, 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.ip);\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.serverIp): 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.ip, 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 var 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 var 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.serverIp);\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 var found = false;\n for (var 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 (var 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 (var 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 (var 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 var 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.ip;\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.serverIp): any {\n updateDynamicRam(\"ps\", getRamCost(\"ps\"));\n var 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 var 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 var scriptServer = getServer(workerScript.serverIp);\n if (scriptServer == null) {\n throw makeRuntimeErrorMsg(\"getIp\", \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.ip;\n },\n getHostname: function (): any {\n updateDynamicRam(\"getHostname\", getRamCost(\"getHostname\"));\n var scriptServer = getServer(workerScript.serverIp);\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 let copy = Object.assign({}, BitNodeMultipliers);\n return copy;\n },\n getServer: function (ip: any): any {\n updateDynamicRam(\"getServer\", getRamCost(\"getServer\"));\n if (SourceFileFlags[5] <= 0 && Player.bitNodeN !== 5) {\n throw makeRuntimeErrorMsg(\"getServer\", \"Requires Source-File 5 to run.\");\n }\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.serverIp): any {\n updateDynamicRam(\"fileExists\", getRamCost(\"fileExists\"));\n if (filename === undefined) {\n throw makeRuntimeErrorMsg(\"fileExists\", \"Usage: fileExists(scriptname, [server])\");\n }\n var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"fileExists\", `Invalid IP/hostname: ${ip}`);\n }\n for (var i = 0; i < server.scripts.length; ++i) {\n if (filename == server.scripts[i].filename) {\n return true;\n }\n }\n for (var i = 0; i < server.programs.length; ++i) {\n if (filename.toLowerCase() == server.programs[i].toLowerCase()) {\n return true;\n }\n }\n for (var 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 var txtFile = getTextFile(filename, server);\n if (txtFile != null) {\n return true;\n }\n return false;\n },\n isRunning: function (fn: any, ip: any = workerScript.serverIp, ...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 var 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 var 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 (let 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 var 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 var 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.ip);\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.ip);\n newServ.serversOnNetwork.push(homeComputer.ip);\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 = GetServerByHostname(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 var ip = server.ip;\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.serverIp) {\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 var found = false;\n for (var 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 delete AllServers[ip];\n\n // Delete from home computer\n found = false;\n var homeComputer = Player.getHomeComputer();\n for (var 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 var res: string[] = [];\n Player.purchasedServers.forEach(function (ip) {\n if (hostname) {\n var 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 var 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.ip, server.scripts);\n server.scripts.push(script);\n return true;\n }\n mode === \"w\" ? (script.code = data) : (script.code += data);\n script.updateRamUsage(server.scripts);\n script.markUpdated();\n } else {\n // Write to text file\n let txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, data, server);\n return true;\n }\n if (mode === \"w\") {\n txtFile.write(data);\n } else {\n txtFile.append(data);\n }\n }\n return true;\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 var 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 return iport.read();\n } else if (isString(port)) {\n // Read from script or text file\n let fn = port;\n let server = getServer(workerScript.serverIp);\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 let script = workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n let 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 return iport.peek();\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 var fn = port;\n var server = getServer(workerScript.serverIp);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"clear\", \"Error getting Server. This is a bug. Report to dev.\");\n }\n var 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.serverIp;\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 var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scriptRunning\", `Invalid IP/hostname: ${ip}`);\n }\n for (var 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 var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"scriptKill\", `Invalid IP/hostname: ${ip}`);\n }\n var suc = false;\n for (var i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript(server.runningScripts[i], server.ip);\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.serverIp): any {\n updateDynamicRam(\"getScriptRam\", getRamCost(\"getScriptRam\"));\n var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptRam\", `Invalid IP/hostname: ${ip}`);\n }\n for (var 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): any {\n updateDynamicRam(\"getRunningScript\", getRamCost(\"getRunningScript\"));\n\n let runningScript;\n if (arguments.length === 0) {\n runningScript = workerScript.scriptRef;\n } else if (typeof fn === \"number\") {\n runningScript = getRunningScriptByPid(fn, \"getRunningScript\");\n } else {\n const scriptArgs = [];\n for (var i = 2; i < arguments.length; ++i) {\n scriptArgs.push(arguments[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): any {\n updateDynamicRam(\"getScriptIncome\", getRamCost(\"getScriptIncome\"));\n if (arguments.length === 0) {\n var 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 var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptIncome\", `Invalid IP/hostnamed: ${ip}`);\n }\n var argsForScript = [];\n for (var i = 2; i < arguments.length; ++i) {\n argsForScript.push(arguments[i]);\n }\n var runningScriptObj = findRunningScript(scriptname, argsForScript, server);\n if (runningScriptObj == null) {\n workerScript.log(\n \"getScriptIncome\",\n `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(argsForScript)}`,\n );\n return -1;\n }\n return runningScriptObj.onlineMoneyMade / runningScriptObj.onlineRunningTime;\n }\n },\n getScriptExpGain: function (scriptname: any, ip: any): any {\n updateDynamicRam(\"getScriptExpGain\", getRamCost(\"getScriptExpGain\"));\n if (arguments.length === 0) {\n var 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 var server = getServer(ip);\n if (server == null) {\n throw makeRuntimeErrorMsg(\"getScriptExpGain\", `Invalid IP/hostnamed: ${ip}`);\n }\n var argsForScript = [];\n for (var i = 2; i < arguments.length; ++i) {\n argsForScript.push(arguments[i]);\n }\n var runningScriptObj = findRunningScript(scriptname, argsForScript, server);\n if (runningScriptObj == null) {\n workerScript.log(\n \"getScriptExpGain\",\n `No such script '${scriptname}' on '${server.hostname}' with args: ${arrayToString(argsForScript)}`,\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 // The id for this popup will consist of the first 20 characters of the prompt string..\n // Thats hopefully good enough to be unique\n const popupId = `prompt-popup-${txt.slice(0, 20)}`;\n const textElement = createElement(\"p\", { innerHTML: txt });\n\n return new Promise(function (resolve) {\n const yesBtn = createElement(\"button\", {\n class: \"popup-box-button\",\n innerText: \"Yes\",\n clickListener: () => {\n removeElementById(popupId);\n resolve(true);\n },\n });\n\n const noBtn = createElement(\"button\", {\n class: \"popup-box-button\",\n innerText: \"No\",\n clickListener: () => {\n removeElementById(popupId);\n resolve(false);\n },\n });\n\n createPopup(popupId, [textElement, yesBtn, noBtn]);\n });\n },\n wget: async function (url: any, target: any, ip: any = workerScript.serverIp): 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 var 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 (inMission) {\n workerScript.log(\"universityCourse\", \"You are in the middle of a mission.\");\n return;\n }\n if (Player.isWorking) {\n var txt = Player.singularityStopWork();\n workerScript.log(\"universityCourse\", txt);\n }\n\n var 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 var 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 (inMission) {\n workerScript.log(\"gymWorkout\", \"You are in the middle of a mission.\");\n return;\n }\n if (Player.isWorking) {\n var txt = Player.singularityStopWork();\n workerScript.log(\"gymWorkout\", txt);\n }\n var 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 (SpecialServerIps[\"Darkweb Server\"] != null) {\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 var 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 SpecialServerIps.addIp(\"Darkweb Server\", darkweb.ip);\n\n Player.getHomeComputer().serversOnNetwork.push(darkweb.ip);\n darkweb.serversOnNetwork.push(Player.getHomeComputer().ip);\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 (SpecialServerIps[\"Darkweb Server\"] == null) {\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 let 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().ip;\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.ip == hostname || other.hostname == hostname) {\n Player.getCurrentServer().isConnectedTo = false;\n Player.currentServer = target.ip;\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: SpecialServerIps.hasOwnProperty(\"Darkweb Server\"),\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: SpecialServerIps.hasOwnProperty(\"Darkweb Server\"),\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 || inMission;\n },\n stopAction: function (): any {\n updateDynamicRam(\"stopAction\", getRamCost(\"stopAction\"));\n checkSingularityAccess(\"stopAction\", 1);\n if (Player.isWorking) {\n Router.toTerminal();\n var 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 ${homeComputer.maxRam}GB 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 // Cant work while in a mission\n if (inMission) {\n workerScript.log(\"workForCompany\", \"You are in the middle of a mission.\");\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 var 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 var 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 (inMission) {\n workerScript.log(\"workForFaction\", \"You are in the middle of a mission.\");\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 var fac = Factions[name];\n // Arrays listing factions that allow each time of work\n var 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 var 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 var 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 (inMission) {\n workerScript.log(\"createProgram\", \"You are in the middle of a mission.\");\n return;\n }\n if (Player.isWorking) {\n var 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 if (inMission) {\n workerScript.log(\"commitCrime\", \"You are in the middle of a mission.\");\n return;\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 var res = [];\n for (var i = 0; i < Player.augmentations.length; ++i) {\n res.push(Player.augmentations[i].name);\n }\n if (purchased) {\n for (var 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 let 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 setTimeoutRef(() => {\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 setTimeoutRef(() => {\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: {\n createGang: function (faction: any): any {\n 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 updateDynamicRam(\"inGang\", getRamCost(\"gang\", \"inGang\"));\n return Player.inGang();\n },\n getMemberNames: function (): any {\n 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 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 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 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 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 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 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 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 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 updateDynamicRam(\"getEquipmentNames\", getRamCost(\"gang\", \"getEquipmentNames\"));\n checkGangApiAccess(\"getEquipmentNames\");\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost: function (equipName: any): any {\n 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 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 updateDynamicRam(\"getEquipmentStats\", getRamCost(\"gang\", \"getEquipmentStats\"));\n checkGangApiAccess(\"getEquipmentStats\");\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw makeRuntimeErrorMsg(\"getEquipmentStats\", `Invalid equipment: ${equipName}`);\n }\n return Object.assign({}, equipment.mults);\n },\n purchaseEquipment: function (memberName: any, equipName: any): any {\n 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 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): any {\n 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 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 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 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 }, // end gang namespace\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 checkBladeburnerAccess(\"joinBladeburnerDivision\", true);\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 const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\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.serverIp, { 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 let 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.serverIp): 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.serverIp): 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.serverIp): 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.serverIp): 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 // Duplicate Sleeve API\n sleeve: {\n getNumSleeves: function (): any {\n updateDynamicRam(\"getNumSleeves\", getRamCost(\"sleeve\", \"getNumSleeves\"));\n checkSleeveAPIAccess(\"getNumSleeves\");\n return Player.sleeves.length;\n },\n setToShockRecovery: function (sleeveNumber: any = 0): any {\n updateDynamicRam(\"setToShockRecovery\", getRamCost(\"sleeve\", \"setToShockRecovery\"));\n checkSleeveAPIAccess(\"setToShockRecovery\");\n checkSleeveNumber(\"setToShockRecovery\", sleeveNumber);\n return Player.sleeves[sleeveNumber].shockRecovery(Player);\n },\n setToSynchronize: function (sleeveNumber: any = 0): any {\n updateDynamicRam(\"setToSynchronize\", getRamCost(\"sleeve\", \"setToSynchronize\"));\n checkSleeveAPIAccess(\"setToSynchronize\");\n checkSleeveNumber(\"setToSynchronize\", sleeveNumber);\n return Player.sleeves[sleeveNumber].synchronize(Player);\n },\n setToCommitCrime: function (sleeveNumber: any = 0, crimeName: any = \"\"): any {\n updateDynamicRam(\"setToCommitCrime\", getRamCost(\"sleeve\", \"setToCommitCrime\"));\n checkSleeveAPIAccess(\"setToCommitCrime\");\n checkSleeveNumber(\"setToCommitCrime\", sleeveNumber);\n return Player.sleeves[sleeveNumber].commitCrime(Player, crimeName);\n },\n setToUniversityCourse: function (sleeveNumber: any = 0, universityName: any = \"\", className: any = \"\"): any {\n 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 (sleeveNumber: any = 0, cityName: any = \"\"): any {\n updateDynamicRam(\"travel\", getRamCost(\"sleeve\", \"travel\"));\n checkSleeveAPIAccess(\"travel\");\n checkSleeveNumber(\"travel\", sleeveNumber);\n return Player.sleeves[sleeveNumber].travel(Player, cityName);\n },\n setToCompanyWork: function (sleeveNumber: any = 0, companyName: any = \"\"): any {\n 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 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 (sleeveNumber: any = 0, factionName: any = \"\", workType: any = \"\"): any {\n 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 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 (sleeveNumber: any = 0, gymName: any = \"\", stat: any = \"\"): any {\n 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 (sleeveNumber: any = 0): any {\n 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 (sleeveNumber: any = 0): any {\n 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 (sleeveNumber: any = 0): any {\n 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 tor: SpecialServerIps.hasOwnProperty(\"Darkweb Server\"), // There's no reason not to give that infomation here as well. Worst case scenario it isn't used.\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 (sleeveNumber: any = 0): any {\n 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 (sleeveNumber: any = 0): any {\n 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 (sleeveNumber: any = 0, augName: any = \"\"): any {\n updateDynamicRam(\"purchaseSleeveAug\", getRamCost(\"sleeve\", \"purchaseSleeveAug\"));\n checkSleeveAPIAccess(\"purchaseSleeveAug\");\n checkSleeveNumber(\"purchaseSleeveAug\", sleeveNumber);\n\n const aug = Augmentations[augName];\n if (!aug) {\n throw makeRuntimeErrorMsg(\"sleeve.purchaseSleeveAug\", `Invalid aug: ${augName}`);\n }\n\n return Player.sleeves[sleeveNumber].tryBuyAugmentation(Player, aug);\n },\n }, // End 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 heart: {\n // Easter egg function\n break: function (): number {\n return Player.karma;\n },\n },\n exploit: function (): any {\n Player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass: function (doc: any): any {\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 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 };\n\n function getFunctionNames(obj: NS): string[] {\n const functionNames: string[] = [];\n for (const [key, value] of Object.entries(obj)) {\n if (typeof value == \"function\") {\n functionNames.push(key);\n } else if (typeof value == \"object\") {\n functionNames.push(...getFunctionNames(value));\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 * 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 \"../../utils/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","/**\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 { 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 React, { useState } from \"react\";\n\nimport { CinematicLine } from \"./CinematicLine\";\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 <div>\n {props.lines.slice(0, i).map((line, i) => (\n <pre key={i}>{line}</pre>\n ))}\n {props.lines.length > i && <CinematicLine key={i} text={props.lines[i]} onDone={advance} />}\n {!props.auto && props.onDone && done && (\n <button className=\"std-button\" onClick={props.onDone}>\n Continue ...\n </button>\n )}\n </div>\n );\n}\n","import { getRandomInt } from \"./getRandomInt\";\n\n/**\n * Gets a random value in the range of a byte (0 - 255), or up to the maximum.\n * @param max The maximum value (up to 255).\n */\nexport function getRandomByte(max: number): number {\n // Technically 2^8 is 256, but the values are 0-255, not 1-256.\n const byteMaximum = 255;\n const upper: number = Math.max(Math.min(max, byteMaximum), 0);\n\n return getRandomInt(0, upper);\n}\n","/**\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 * 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 * 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 * 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\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n let className = \"stock-market-input std-button\";\n\n const hasTooltip = props.tooltip != null;\n if (hasTooltip) {\n className += \" tooltip\";\n }\n\n return (\n <button className={className} onClick={props.onClick}>\n {props.text}\n {props.tooltip != null && <span className={\"tooltiptext\"}>{props.tooltip}</span>}\n </button>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n text: string;\n placeText: string;\n place: (price: number) => void;\n popupId: string;\n}\n\nexport function PlaceOrderPopup(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 removePopup(props.popupId);\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 <>\n <p>{props.text}</p>\n <input autoFocus={true} className=\"text-input\" type=\"number\" onChange={onChange} placeholder=\"price\" />\n <button className=\"std-button\" onClick={onClick}>\n {props.placeText}\n </button>\n </>\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.ip, 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","/**\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 let 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 (let ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix))) {\n for (let 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 (let 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) {\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 let internalToExternal: { [key: string]: string | undefined } = {};\n\n let 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() {\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 { 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","/**\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 { Literatures } from \"./Literatures\";\nimport { dialogBoxCreate } from \"../../utils/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. Its 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 { createElement } from \"./createElement\";\nimport { getElementById } from \"./getElementById\";\n\ninterface ICreatePopupOptions {\n backgroundColor?: string;\n}\n\n/**\n * Creates the necessary DOM elements to present an in-game popup to the player.\n * @param id The (hopefully) unique identifier for the popup container.\n * @param elems The collection of HTML Elements to show within the popup.\n */\nexport function createPopup(id: string, elems: HTMLElement[], options: ICreatePopupOptions = {}): HTMLDivElement {\n const container: HTMLDivElement = createElement(\"div\", {\n class: \"popup-box-container\",\n display: \"flex\",\n id: id,\n }) as HTMLDivElement;\n const content: HTMLElement = createElement(\"div\", {\n class: \"popup-box-content\",\n id: `${id}-content`,\n });\n\n for (const elem of elems) {\n content.appendChild(elem);\n }\n\n // Configurable Options\n if (options.backgroundColor) {\n content.style.backgroundColor = options.backgroundColor;\n }\n\n container.appendChild(content);\n getElementById(\"entire-game-container\").appendChild(container);\n\n return container;\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 * as React from \"react\";\n\nimport { BBAccordion } from \"./BBAccordion\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\ntype IProps = {\n aug: Augmentation;\n level?: number | string | null;\n};\n\nexport function AugmentationAccordion(props: IProps): React.ReactElement {\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 <BBAccordion\n headerContent={<>{displayName}</>}\n panelContent={\n <p>\n <span dangerouslySetInnerHTML={{ __html: props.aug.info }} />\n <br />\n <br />\n {props.aug.stats}\n </p>\n }\n />\n );\n }\n\n return (\n <BBAccordion\n headerContent={<>{displayName}</>}\n panelContent={\n <p>\n {props.aug.info}\n <br />\n <br />\n {props.aug.stats}\n </p>\n }\n />\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 React, { useState } from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { Action } from \"../Action\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: Action;\n popupId: string;\n}\n\nexport function TeamSizePopup(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 removePopup(props.popupId);\n }\n\n return (\n <>\n <p>\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 </p>\n <input\n autoFocus\n type=\"number\"\n placeholder=\"Team size\"\n className=\"text-input\"\n onChange={(event) => setTeamSize(parseFloat(event.target.value))}\n />\n <a className=\"a-link-button\" onClick={confirmTeamSize}>\n Confirm\n </a>\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 from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n return (\n <span style={{ fontSize: \"1em\" }} className={\"blinking-cursor\"}>\n |\n </span>\n );\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 { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nexport function HashRate(hashes: number): JSX.Element {\n return 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 * as React from \"react\";\n\nimport { CityName } from \"../data/CityNames\";\nimport { TravelConfirmationPopup } from \"./TravelConfirmationPopup\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { Money } from \"../../ui/React/Money\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\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 dialogBoxCreate(`You cannot afford to travel to ${to}`);\n return;\n }\n\n p.loseMoney(cost);\n p.travel(to);\n dialogBoxCreate(<span className=\"noselect\">You are now in {to}!</span>);\n router.toCity();\n}\n\nfunction createTravelPopup(p: IPlayer, router: IRouter, city: CityName): void {\n if (Settings.SuppressTravelConfirmation) {\n travel(p, router, city);\n return;\n }\n const popupId = `travel-confirmation`;\n createPopup(popupId, TravelConfirmationPopup, {\n player: p,\n city: city,\n travel: () => travel(p, router, city),\n popupId: popupId,\n });\n}\n\nfunction ASCIIWorldMap(props: IProps): React.ReactElement {\n return (\n <div className=\"noselect\">\n <p>\n From here, you can travel to any other city! A ticket costs{\" \"}\n <Money money={CONSTANTS.TravelCost} player={props.p} />.\n </p>\n <WorldMap\n currentCity={props.p.city}\n onTravel={(city: CityName) => createTravelPopup(props.p, props.router, city)}\n />\n </div>\n );\n}\n\nfunction ListWorldMap(props: IProps): React.ReactElement {\n return (\n <div>\n <p>\n From here, you can travel to any other city! A ticket costs{\" \"}\n <Money money={CONSTANTS.TravelCost} player={props.p} />.\n </p>\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 <StdButton\n key={city}\n onClick={() => createTravelPopup(props.p, props.router, city as CityName)}\n style={{ display: \"block\" }}\n text={`Travel to ${city}`}\n />\n );\n })}\n </div>\n );\n}\n\nexport function TravelAgencyRoot(props: IProps): React.ReactElement {\n return (\n <>\n <h1>Travel Agency</h1>\n {Settings.DisableASCIIArt ? (\n <ListWorldMap p={props.p} router={props.router} />\n ) : (\n <ASCIIWorldMap p={props.p} router={props.router} />\n )}\n </>\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 { AllServers } 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 = AllServers[script.server];\n if (server == null) {\n return 0;\n }\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === script.filename) {\n // Cache the ram usage for the next call\n script.ramUsage = server.scripts[i].ramUsage;\n return script.ramUsage;\n }\n }\n\n return 0;\n}\n","import * 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} aria-label=\"first page\">\n {theme.direction === \"rtl\" ? <LastPageIcon /> : <FirstPageIcon />}\n </IconButton>\n <IconButton onClick={handleBackButtonClick} disabled={page === 0} aria-label=\"previous page\">\n {theme.direction === \"rtl\" ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}\n </IconButton>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"next page\"\n >\n {theme.direction === \"rtl\" ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={page >= Math.ceil(count / rowsPerPage) - 1}\n aria-label=\"last page\"\n >\n {theme.direction === \"rtl\" ? <FirstPageIcon /> : <LastPageIcon />}\n </IconButton>\n </Box>\n );\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) {\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 React from \"react\";\n\ninterface IProps {\n current: boolean;\n text: string;\n onClick: () => void;\n}\n\nexport function HeaderTab(props: IProps): React.ReactElement {\n let className = \"cmpy-mgmt-header-tab\";\n if (props.current) {\n className += \" current\";\n }\n\n return (\n <button className={className} onClick={props.onClick}>\n {props.text}\n </button>\n );\n}\n","/**\n * Wrapper around material-ui's Button component that styles it with\n * Bitburner's UI theme\n */\n\nimport React from \"react\";\nimport { Button, ButtonProps } from \"@mui/material\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nconst useStyles = makeStyles({\n // Tries to emulate StdButton in buttons.scss\n root: {\n backgroundColor: \"#555\",\n border: \"1px solid #333\",\n color: \"white\",\n margin: \"5px\",\n padding: \"3px 5px\",\n \"&:hover\": {\n backgroundColor: \"#666\",\n },\n\n borderRadius: 0,\n },\n textPrimary: {\n color: \"rgb( 144, 202, 249)\",\n },\n textSecondary: {\n color: \"rgb(244, 143, 177)\",\n },\n disabled: {\n backgroundColor: \"#333\",\n color: \"#fff\",\n cursor: \"default\",\n },\n});\n\nexport const MuiButton: React.FC<ButtonProps> = (props: ButtonProps) => {\n return (\n <Button\n {...props}\n classes={{\n ...useStyles(),\n ...props.classes,\n }}\n />\n );\n};\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\";\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 { inMission, currMission } from \"./Missions\";\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 { initSpecialServerIps } from \"./Server/SpecialServerIps\";\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 { dialogBoxCreate } from \"../utils/DialogBox\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\n\nimport { startTampering } from \"./Exploits/tampering\";\nimport { startUnclickable } from \"./Exploits/unclickable\";\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 // Mission\n if (inMission && currMission) {\n currMission.process(numCycles);\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 var 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\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.corporation instanceof Corporation) {\n Player.corporation.process(Player);\n }\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 startTampering();\n startUnclickable();\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 var offlineProductionFromHacknetNodes = processHacknetEarnings(Player, numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers(Player) ? (\n <>{Hashes(offlineProductionFromHacknetNodes)} hashes</>\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 var 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 dialogBoxCreate(\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(offlineReputation)} divided amongst your factions.\n </>,\n );\n } else {\n // No save found, start new game\n initBitNodeMultipliers(Player);\n initSpecialServerIps();\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 },\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() {\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","/**\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","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 * 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","import React from \"react\";\n\ninterface IProps {\n onClick: () => void;\n name: string;\n current: boolean;\n}\n\nexport function CityTab(props: IProps): React.ReactElement {\n let className = \"cmpy-mgmt-city-tab\";\n if (props.current) {\n className += \" current\";\n }\n\n return (\n <button className={className} onClick={props.onClick}>\n {props.name}\n </button>\n );\n}\n","export function getSelectValue(selector: HTMLSelectElement | null): string {\n if (selector == null) {\n return \"\";\n }\n if (selector.options.length <= 0) {\n return \"\";\n }\n if (selector.selectedIndex < 0) {\n return \"\";\n }\n return selector.options[selector.selectedIndex].value;\n}\n\nexport function getSelectText(selector: HTMLSelectElement | null): string {\n if (selector == null) {\n return \"\";\n }\n if (selector.options.length <= 0) {\n return \"\";\n }\n if (selector.selectedIndex < 0) {\n return \"\";\n }\n return selector.options[selector.selectedIndex].text;\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 { AllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\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 serverType: number;\n onChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;\n style: any;\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: Server | HacknetServer): 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 serverName in AllServers) {\n const server = AllServers[serverName];\n if (isValidServer(server)) {\n servers.push(\n <option key={server.hostname} value={server.hostname}>\n {server.hostname}\n </option>,\n );\n }\n }\n\n return (\n <select className={\"dropdown\"} onChange={props.onChange} style={props.style}>\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\";\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 { SpecialServerIps } from \"../../Server/SpecialServerIps\";\nimport { getServer, isBackdoorInstalled } from \"../../Server/ServerHelpers\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\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} p={player} />);\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 ip = SpecialServerIps.getIp(loc.name);\n const server = getServer(ip);\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <div>\n <StdButton onClick={() => router.toCity()} style={{ display: \"block\" }} text={\"Return to World\"} />\n <h1 className=\"noselect\">\n {backdoorInstalled && !Settings.DisableTextEffects ? <CorruptableText content={loc.name} /> : loc.name}\n </h1>\n {locContent}\n </div>\n );\n}\n","import React, { FC } from \"react\";\nimport { Card, Suit } from \"./Card\";\n\ntype Props = {\n card: Card;\n hidden?: boolean;\n};\n\nexport const ReactCard: FC<Props> = ({ card, hidden }) => {\n let suit: React.ReactNode;\n switch (card.suit) {\n case Suit.Clubs:\n suit = <span>&#9827;</span>;\n break;\n case Suit.Diamonds:\n suit = <span>&#9830;</span>;\n break;\n case Suit.Hearts:\n suit = <span>&#9829;</span>;\n break;\n case Suit.Spades:\n suit = <span>&#9824;</span>;\n break;\n default:\n throw new Error(`MissingCaseException: ${card.suit}`);\n }\n return (\n <div className={`casino-card ${card.isRedSuit() ? \"red\" : \"black\"}`}>\n <>\n <div className=\"value\">{hidden ? \" - \" : card.formatValue()}</div>\n <div className={`suit`}>{hidden ? \" - \" : suit}</div>\n </>\n </div>\n );\n};\n","/**\n * Wrapper around material-ui's Button component that styles it with\n * Bitburner's UI theme\n */\n\nimport React from \"react\";\nimport { Paper, PaperProps } from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nconst useStyles = makeStyles({\n root: {\n backgroundColor: \"rgb(30, 30, 30)\",\n border: \"2px solid #000\",\n borderRadius: \"10px\",\n display: \"inline-block\",\n flexWrap: \"wrap\",\n padding: \"10px\",\n },\n});\n\nexport const MuiPaper: React.FC<PaperProps> = (props: PaperProps) => {\n return (\n <Paper\n {...props}\n classes={{\n ...useStyles(),\n ...props.classes,\n }}\n />\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 = `interface NS {\n args: string[];\n /**\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n * Example documentation for scan.\n */\n scan(ip: string, hostnames: boolean): string[];\n hack(ip: string, threads: number, stock: boolean): Promise<string>;\n hackAnalyzeThreads(ip: string, hackAmount: number): number;\n hackAnalyzePercent(ip: string): number;\n hackChance(ip: string): number;\n sleep(time: number): Promise<void>;\n grow(ip: string, threads: number, stock: boolean): Promise<string>;\n growthAnalyze(ip: string, growth: number): number;\n weaken(ip: string, threads: boolean): Promise<string>;\n print(...args: any[]): void;\n tprint(...args: any[]): void;\n clearLog(): void;\n disableLog(fn: string): void;\n enableLog(fn: string): void;\n isLogEnabled(fn: string): boolean;\n getScriptLogs(fn: string, ip: string, ...scriptArgs: any[]): string[];\n tail(fn: string, ip: string, ...scriptArgs: any[]): void;\n nuke(ip: string): boolean;\n brutessh(ip: string): boolean;\n ftpcrack(ip: string): boolean;\n relaysmtp(ip: string): boolean;\n httpworm(ip: string): boolean;\n sqlinject(ip: string): boolean;\n run(scriptname: string, threads: number): number;\n exec(scriptname: string, ip: string, threads: number): number;\n spawn(scriptname: string, threads: number): void;\n kill(filename: string, ip: string, ...scriptArgs: any[]): boolean;\n killall(ip: string): boolean;\n exit(): void;\n scp(scriptname: string, ip1: string, ip2: string): boolean;\n ls(ip: string, grep: string): string[];\n ps(ip: string): {filename: string, threads: number, args: string[], pid: number}[];\n hasRootAccess(ip: string): boolean;\n getIp(): string;\n getHostname(): string;\n getHackingLevel(): number;\n getHackingMultipliers(): number;\n getHacknetMultipliers(): number;\n getBitNodeMultipliers(): number;\n getServer(ip: string): any;\n getServerMoneyAvailable(ip: string): number;\n getServerSecurityLevel(ip: string): number;\n getServerBaseSecurityLevel(ip: string): number;\n getServerMinSecurityLevel(ip: string): number;\n getServerRequiredHackingLevel(ip: string): number;\n getServerMaxMoney(ip: string): number;\n getServerGrowth(ip: string): number;\n getServerNumPortsRequired(ip: string): number;\n getServerRam(ip: string): number[];\n getServerMaxRam(ip: string): number;\n getServerUsedRam(ip: string): number;\n serverExists(ip: string): boolean;\n fileExists(filename: string, ip: string): boolean;\n isRunning(fn: string, ip: string, ...scriptArgs: any[]): boolean;\n getStockSymbols(): string[];\n getStockPrice(symbol: string): number;\n getStockAskPrice(symbol: string): number;\n getStockBidPrice(symbol: string): number;\n getStockPosition(symbol: string): number;\n getStockMaxShares(symbol: string): number;\n getStockPurchaseCost(symbol: string, shares: number, posType: string): number;\n getStockSaleGain(symbol: string, shares: number, posType: string): number;\n buyStock(symbol: string, shares: number): number;\n sellStock(symbol: string, shares: number): number;\n shortStock(symbol: string, shares: number): number;\n sellShort(symbol: string, shares: number): number;\n placeOrder(symbol: string, shares: number, price: number, type: string, pos: string): boolean;\n cancelOrder(symbol: string, shares: number, price: number, type: string, pos: string): boolean;\n getOrders(): any;\n getStockVolatility(symbol: string): number;\n getStockForecast(symbol: string): number;\n getPurchasedServerLimit(): number;\n getPurchasedServerMaxRam(): number;\n getPurchasedServerCost(ram: number): number;\n purchaseServer(hostname: string, ram: number): string;\n deleteServer(hostname: string): boolean;\n getPurchasedServers(hostname: string): string[];\n write(port: number, data: string, mode: string): boolean;\n tryWrite(port: number, data: string): boolean;\n read(port: number): any;\n peek(port: number): any;\n clear(port: number): number;\n getPortHandle(port: number): any; // netscript port\n rm(fn: string, ip: string): boolean;\n scriptRunning(scriptname: string, ip: string): boolean;\n scriptKill(scriptname: string, ip: string): boolean;\n getScriptName(): string;\n getScriptRam(scriptname: string, ip: string): number;\n getRunningScript(fn: string, ip: string): any; // running script\n getHackTime(ip: string): number;\n getGrowTime(ip: string): number;\n getWeakenTime(ip: string): number;\n getScriptIncome(scriptname: string, ip: string): number;\n getScriptExpGain(scriptname: string, ip: string): number;\n nFormat(n: number, format: string): string;\n tFormat(milliseconds: number, milliPrecision: boolean): string;\n getTimeSinceLastAug(): number;\n prompt(txt: string): Promise<boolean>;\n getFavorToDonate(): number;\n universityCourse(universityName: string, className: string): boolean;\n gymWorkout(gymName: string, stat: string): boolean;\n travelToCity(cityname: string): boolean;\n purchaseTor(): boolean;\n purchaseProgram(programName: string): boolean;\n getCurrentServer(): any; // server object\n connect(hostname: string): boolean;\n manualHack(): Promise<string>;\n installBackdoor(): Promise<void>;\n getStats(): any; // complex type\n getCharacterInformation(): any; // complex type\n getPlayer(): any; // complex type\n hospitalize(): number;\n isBusy(): boolean;\n stopAction(): boolean;\n upgradeHomeRam(): number;\n getUpgradeHomeRamCost(): number;\n workForCompany(companyName: string): boolean;\n applyToCompany(companyName: string, field: string): boolean;\n getCompanyRep(companyName: string): number;\n getCompanyFavor(companyName: string): number;\n getCompanyFavorGain(companyName: string): number;\n checkFactionInvitations(): string[];\n joinFaction(name: string): boolean;\n workForFaction(name: string, type: string): boolean;\n getFactionRep(name: string): number;\n getFactionFavor(name: string): number;\n getFactionFavorGain(name: string): number;\n donateToFaction(name: string, amt: number): boolean;\n createProgram(name: string): boolean;\n commitCrime(crimeRoughName: string): number;\n getCrimeChance(crimeRoughName: string): boolean;\n getCrimeStats(crimeRoughName: string): any; // complex type\n getOwnedAugmentations(purchased: boolean): string[];\n getOwnedSourceFiles(): any; // complex type\n getAugmentationsFromFaction(facname: string): string[];\n getAugmentationCost(name: string): number;\n getAugmentationPrereq(name: string): string[];\n getAugmentationPrice(name: string): number;\n getAugmentationRepReq(name: string): number;\n getAugmentationStats(name: string): any; // complex type\n purchaseAugmentation(faction: string, name: string): boolean;\n softReset(cbScript: string): void;\n installAugmentations(cbScript: string): void;\n exploit(): void;\n bypass(doc: any): void;\n flags(data: any): any;\n}`;\n","import { Milestone } from \"./Milestone\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServerByHostname } from \"../Server/ServerHelpers\";\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 = GetServerByHostname(\"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 = GetServerByHostname(\"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 [ip/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 \"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 \"ifconfig Displays the IP address 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 \"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/ip]\",\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 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 ifconfig: [\"ipconfig\", \" \", \"Prints the IP address 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 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 { AllServers } from \"../Server/AllServers\";\n\nimport { removeLeadingSlash, isInRootDirectory, evaluateFilePath } from \"./DirectoryHelpers\";\nimport { checkIfConnectedToDarkweb } from \"../DarkWeb/DarkWeb\";\nimport { iTutorialNextStep, iTutorialSteps, ITutorial } from \"../InteractiveTutorial\";\nimport { GetServerByHostname, getServer, getServerOnNetwork } from \"../Server/ServerHelpers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { SpecialServerIps, SpecialServerNames } from \"../Server/SpecialServerIps\";\nimport { Settings } from \"../Settings/Settings\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\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 { hack } from \"./commands/hack\";\nimport { help } from \"./commands/help\";\nimport { home } from \"./commands/home\";\nimport { hostname } from \"./commands/hostname\";\nimport { ifconfig } from \"./commands/ifconfig\";\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 { 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 this.startAction(calculateHackingTime(server, player) / 4, \"h\");\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 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\"): 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\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 (\n SpecialServerIps[SpecialServerNames.WorldDaemon] &&\n SpecialServerIps[SpecialServerNames.WorldDaemon] == server.ip\n ) {\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 only gains 25% exp for failure? TODO Can change this later to balance\n player.gainHackingExp(expGainedOnFailure);\n this.print(\n `Failed to hack ${server.hostname}. Gained ${numeralWrapper.formatExp(expGainedOnFailure)} hacking exp`,\n );\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 (\n SpecialServerIps[SpecialServerNames.WorldDaemon] &&\n SpecialServerIps[SpecialServerNames.WorldDaemon] == server.ip\n ) {\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 HacknetServer) ? 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 === \"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 ip in AllServers) {\n visited[ip] = 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.ip] || d > depth) {\n continue; // Already visited or out-of-depth\n } else if (!all && isHacknet) {\n continue; // Hacknet Server\n } else {\n visited[s.ip] = 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.ip;\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 = GetServerByHostname(\"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 (commandArray[0] == \"connect\" && (commandArray[1] == \"n00dles\" || commandArray[1] == n00dlesServ.ip)) {\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 alias: alias,\n analyze: analyze,\n backdoor: backdoor,\n buy: buy,\n cat: cat,\n cd: cd,\n check: check,\n cls: () => this.clear(),\n clear: () => this.clear(),\n connect: connect,\n download: download,\n expr: expr,\n free: free,\n hack: hack,\n help: help,\n home: home,\n hostname: hostname,\n ifconfig: ifconfig,\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 \"scan-analyze\": scananalyze,\n scp: scp,\n sudov: sudov,\n tail: tail,\n top: top,\n unalias: unalias,\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 \"&nbsp;&nbsp;&nbsp;&nbsp;3 + 1\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;2 + 2\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;2 + 1 + 1\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;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 += \"&nbsp;&nbsp;&nbsp;&nbsp;[\\n\";\n d += n\n .map(\n (line: number[]) =>\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[\" +\n line.map((x: number) => `${x}`.padStart(2, \" \")).join(\",\") +\n \"]\",\n )\n .join(\"\\n\");\n d += \"\\n&nbsp;&nbsp;&nbsp;&nbsp;]\\n\";\n d += [\n \"\\nHere is an example of what spiral order should be:\\n\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;[\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1, 2, 3]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4, 5, 6]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[7, 8, 9]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;]\\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 \"&nbsp;&nbsp;&nbsp;&nbsp;[\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;&nbsp;2,&nbsp;&nbsp;3,&nbsp;&nbsp;4]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[5,&nbsp;&nbsp;6,&nbsp;&nbsp;7,&nbsp;&nbsp;8]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[9,&nbsp;10,&nbsp;11,&nbsp;12]\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;]\\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 = [\"&nbsp;\".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 \"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2],\\n\",\n \"&nbsp;&nbsp;&nbsp;&nbsp;[3,4],\\n\",\n \"&nbsp;&nbsp;&nbsp;[6,5,7],\\n\",\n \"&nbsp;&nbsp;[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","/**\n * React component for a popup content container\n *\n * Takes in a prop for rendering the content inside the popup\n */\nimport React, { useEffect } from \"react\";\n\ninterface IProps<T> {\n content: (props: T) => React.ReactElement;\n id: string;\n props: T;\n removePopup: () => void;\n}\n\nexport function Popup<T>(props: IProps<T>): React.ReactElement {\n function keyDown(event: KeyboardEvent): void {\n if (event.key === \"Escape\") props.removePopup();\n }\n\n useEffect(() => {\n document.addEventListener(\"keydown\", keyDown);\n return () => {\n document.removeEventListener(\"keydown\", keyDown);\n };\n });\n\n return (\n <div className={\"popup-box-content\"} id={`${props.id}-content`}>\n {React.createElement(props.content, props.props)}\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nimport { CodingContract, CodingContractType, CodingContractTypes } from \"../../CodingContracts\";\nimport { ClickableTag, CopyableText } from \"./CopyableText\";\n\ntype IProps = {\n c: CodingContract;\n popupId: string;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n};\n\nexport function CodingContractPopup(props: IProps): React.ReactElement {\n const [answer, setAnswer] = useState(\"\");\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 // 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 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 <div>\n <CopyableText value={props.c.type} tag={ClickableTag.Tag_h1} />\n <br />\n <br />\n <p>\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 </p>\n <br />\n <p>{description}</p>\n <br />\n <input\n className=\"text-input\"\n style={{ width: \"50%\", marginTop: \"8px\" }}\n autoFocus={true}\n placeholder=\"Enter Solution here\"\n value={answer}\n onChange={onChange}\n onKeyDown={onKeyDown}\n />\n <button className={\"std-button\"} onClick={() => props.onAttempt(answer)}>\n Solve\n </button>\n </div>\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 { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { convertTimeMsToTimeElapsedString } from \"../../../utils/StringHelperFunctions\";\nimport { getServer } from \"../../Server/ServerHelpers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { BitFlumePopup } from \"../../BitNode/ui/BitFlumePopup\";\n\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 HacknetServer) {\n terminal.print(`ServerProfiler.exe cannot be run on a Hacknet Server.`);\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: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {\n const popupId = \"bitflume-popup\";\n createPopup(popupId, BitFlumePopup, {\n player: player,\n router: router,\n popupId: popupId,\n });\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\";\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: \"Fulcrum Secret Technologies Server\",\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: \"BitRunners Server\",\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: \"The Black Hand Server\",\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: \"NiteSec Server\",\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: \"The Dark Army Server\",\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: \"CyberSec Server\",\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: \"Daedalus Server\",\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: \"w0r1d_d43m0n\",\n },\n];\n","import React from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n popupId: string;\n}\n\nexport function BitFlumePopup(props: IProps): React.ReactElement {\n function flume(): void {\n props.router.toBitVerse(true, false);\n removePopup(props.popupId);\n }\n return (\n <>\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 <br />\n <br />\n <button className=\"std-button\" onClick={flume}>\n Travel to the BitVerse\n </button>\n </>\n );\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 { 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 homeComputer: string;\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: () => Server | HacknetServer;\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: 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 //IP Address of Starting (home) computer\n this.homeComputer = \"\";\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","import { getElementById } from \"./getElementById\";\n\n/**\n * Given an element by its ID, removes all event listeners from that element by cloning and\n * replacing. Then returns the new cloned element.\n * @param elemId The HTML ID to retrieve the element by.\n */\nexport function clearEventListeners(elemId: string | HTMLElement): HTMLElement | null {\n try {\n let elem: HTMLElement;\n if (typeof elemId === \"string\") {\n elem = getElementById(elemId);\n } else {\n elem = elemId;\n }\n\n const newElem: HTMLElement = elem.cloneNode(true) as HTMLElement;\n if (elem.parentNode !== null) {\n elem.parentNode.replaceChild(newElem, elem);\n }\n\n return newElem;\n } catch (e) {\n // tslint:disable-next-line:no-console\n console.error(e);\n\n return null;\n }\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","import { setTimeoutRef } from \"../utils/SetTimeoutRef\";\nimport { getElementById } from \"../../utils/uiHelpers/getElementById\";\nimport { Action } from \"../types\";\n\nconst threeSeconds = 3000;\nlet x: number | undefined;\n\n/**\n * Displays a status message to the player for approximately 3 seconds.\n * @param text The status text to display\n */\nexport function createStatusText(text: string): void {\n const statusElement: HTMLElement = getElementById(\"status-text\");\n const handler: Action = () => {\n statusElement.innerText = \"\";\n statusElement.style.display = \"none\";\n statusElement.classList.remove(\"status-text\");\n };\n\n if (x !== undefined) {\n clearTimeout(x);\n // Likely not needed due to clearTimeout, but just in case...\n x = undefined;\n // reset the element's animation\n statusElement.style.animation = \"none\";\n setTimeout(function () {\n statusElement.style.animation = \"\";\n }, 10);\n }\n\n statusElement.style.display = \"block\";\n statusElement.classList.add(\"status-text\");\n statusElement.innerText = text;\n\n x = setTimeoutRef(handler, threeSeconds);\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","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.\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.HackingMission || router.page() === Page.Loading)\n 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 { inMission } from \"../../Missions\";\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 clickCreateScripts(): 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 || inMission) 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 clickCreateScripts();\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={\"Create Scripts\"}\n className={clsx({\n [classes.active]: props.page === Page.CreateScript,\n })}\n onClick={clickCreateScripts}\n >\n <ListItemIcon>\n <CreateIcon color={props.page !== Page.CreateScript ? \"secondary\" : \"primary\"} />\n </ListItemIcon>\n <ListItemText>\n <Typography color={props.page !== Page.CreateScript ? \"secondary\" : \"primary\"}>\n Create Script\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 * as React from \"react\";\n\nimport { InstalledAugmentationsAndSourceFiles } from \"./InstalledAugmentationsAndSourceFiles\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\n\nimport { Player } from \"../../Player\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { canGetBonus } from \"../../ExportBonus\";\n\ntype IProps = {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n};\n\ntype IState = {\n rerender: boolean;\n};\n\nexport class AugmentationsRoot extends React.Component<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n this.state = {\n rerender: false,\n };\n this.export = this.export.bind(this);\n }\n\n export(): void {\n this.props.exportGameFn();\n this.setState({\n rerender: !this.state.rerender,\n });\n }\n\n render(): React.ReactNode {\n function exportBonusStr(): string {\n if (canGetBonus()) return \"(+1 favor to all factions)\";\n return \"\";\n }\n\n return (\n <>\n <div className=\"augmentations-content\">\n <h1>Purchased Augmentations</h1>\n <p>\n Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to\n install them.\n </p>\n <p>WARNING: Installing your Augmentations resets most of your progress, including:</p>\n <br />\n <p>- Stats/Skill levels and Experience</p>\n <p>- Money</p>\n <p>- Scripts on every computer but your home computer</p>\n <p>- Purchased servers</p>\n <p>- Hacknet Nodes</p>\n <p>- Faction/Company reputation</p>\n <p>- Stocks</p>\n <br />\n <p>\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\n you will lose all programs besides NUKE.exe)\n </p>\n <StdButton\n onClick={this.props.installAugmentationsFn}\n text=\"Install Augmentations\"\n tooltip=\"'I never asked for this'\"\n />\n <StdButton\n addClasses=\"flashing-button\"\n onClick={this.export}\n text={`Backup Save ${exportBonusStr()}`}\n tooltip=\"It's always a good idea to backup/export your save!\"\n />\n <PurchasedAugmentations />\n <h1>Installed Augmentations</h1>\n <p>\n {`List of all Augmentations ${Player.sourceFiles.length > 0 ? \"and Source Files \" : \"\"} ` +\n `that have been installed. You have gained the effects of these.`}\n </p>\n <InstalledAugmentationsAndSourceFiles />\n <br /> <br />\n <PlayerMultipliers />\n </div>\n </>\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 * as React from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { ListConfiguration } from \"./ListConfiguration\";\nimport { OwnedSourceFiles } from \"./OwnedSourceFiles\";\nimport { SourceFileMinus1 } from \"./SourceFileMinus1\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\n\ntype IProps = {\n // nothing special.\n};\n\ntype IState = {\n rerenderFlag: boolean;\n};\n\nexport class InstalledAugmentationsAndSourceFiles extends React.Component<IProps, IState> {\n listRef: React.RefObject<HTMLUListElement>;\n\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n rerenderFlag: false,\n };\n\n this.collapseAllHeaders = this.collapseAllHeaders.bind(this);\n this.expandAllHeaders = this.expandAllHeaders.bind(this);\n this.sortByAcquirementTime = this.sortByAcquirementTime.bind(this);\n this.sortInOrder = this.sortInOrder.bind(this);\n\n this.listRef = React.createRef();\n }\n\n collapseAllHeaders(): void {\n const ul = this.listRef.current;\n if (ul == null) {\n return;\n }\n const tickers = ul.getElementsByClassName(\"accordion-header\");\n for (let i = 0; i < tickers.length; ++i) {\n const ticker = tickers[i];\n if (!(ticker instanceof HTMLButtonElement)) {\n continue;\n }\n\n if (ticker.classList.contains(\"active\")) {\n ticker.click();\n }\n }\n }\n\n expandAllHeaders(): void {\n const ul = this.listRef.current;\n if (ul == null) {\n return;\n }\n const tickers = ul.getElementsByClassName(\"accordion-header\");\n for (let i = 0; i < tickers.length; ++i) {\n const ticker = tickers[i];\n if (!(ticker instanceof HTMLButtonElement)) {\n continue;\n }\n\n if (!ticker.classList.contains(\"active\")) {\n ticker.click();\n }\n }\n }\n\n rerender(): void {\n this.setState((prevState) => {\n return {\n rerenderFlag: !prevState.rerenderFlag,\n };\n });\n }\n\n sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n this.rerender();\n }\n\n sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n this.rerender();\n }\n\n render(): React.ReactNode {\n return (\n <>\n <ListConfiguration\n collapseAllButtonsFn={this.collapseAllHeaders}\n expandAllButtonsFn={this.expandAllHeaders}\n sortByAcquirementTimeFn={this.sortByAcquirementTime}\n sortInOrderFn={this.sortInOrder}\n />\n <ul className=\"augmentations-list\" ref={this.listRef}>\n <SourceFileMinus1 />\n <OwnedSourceFiles />\n <InstalledAugmentations />\n </ul>\n </>\n );\n }\n}\n","/**\n * React Component for displaying a list of the player's installed Augmentations\n * on the Augmentations UI\n */\nimport * as React from \"react\";\n\nimport { Player } from \"../../Player\";\nimport { Augmentations } from \"../../Augmentation/Augmentations\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\n\nimport { AugmentationAccordion } from \"../../ui/React/AugmentationAccordion\";\n\nexport function InstalledAugmentations(): React.ReactElement {\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 const augs = 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 (\n <li key={e.name}>\n <AugmentationAccordion aug={aug} level={level} />\n </li>\n );\n });\n\n return <>{augs}</>;\n}\n","/**\n * React Component for configuring the way installed augmentations and\n * Source-Files are displayed in the Augmentations UI\n */\nimport * as React from \"react\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\n\ntype IProps = {\n collapseAllButtonsFn: () => void;\n expandAllButtonsFn: () => void;\n sortByAcquirementTimeFn: () => void;\n sortInOrderFn: () => void;\n};\n\nexport function ListConfiguration(props: IProps): React.ReactElement {\n return (\n <>\n <StdButton onClick={props.expandAllButtonsFn} text=\"Expand All\" />\n <StdButton onClick={props.collapseAllButtonsFn} text=\"Collapse All\" />\n <StdButton\n onClick={props.sortInOrderFn}\n text=\"Sort in Order\"\n tooltip=\"Sorts the Augmentations alphabetically and Source-Files in numeral order\"\n />\n <StdButton\n onClick={props.sortByAcquirementTimeFn}\n text=\"Sort by Acquirement Time\"\n tooltip=\"Sorts the Augmentations and Source-Files based on when you acquired them (same as default)\"\n />\n </>\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 const sfs = 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 (\n <li key={e.n}>\n <SourceFileAccordion level={e.lvl} sf={sfObj} />\n </li>\n );\n });\n\n return <>{sfs}</>;\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 * as React from \"react\";\n\nimport { BBAccordion } from \"./BBAccordion\";\n\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\n\ntype IProps = {\n level: number;\n sf: SourceFile;\n};\n\nexport function SourceFileAccordion(props: IProps): React.ReactElement {\n const maxLevel = props.sf.n === 12 ? \"∞\" : \"3\";\n\n return (\n <BBAccordion\n headerContent={\n <>\n {props.sf.name}\n <br />\n {`Level ${props.level} / ${maxLevel}`}\n </>\n }\n panelContent={<p dangerouslySetInnerHTML={{ __html: props.sf.info }}></p>}\n />\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 { Exploit, ExploitName } from \"../../Exploits/Exploit\";\n\nimport { BBAccordion } from \"../../ui/React/BBAccordion\";\n\nexport function SourceFileMinus1(): React.ReactElement {\n const exploits = Player.exploits;\n\n if (exploits.length === 0) {\n return <></>;\n }\n\n return (\n <li key={-1}>\n <BBAccordion\n headerContent={\n <>\n Source-File -1: Exploits in the BitNodes\n <br />\n Level {exploits.length} / ?\n </>\n }\n panelContent={\n <>\n <p>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web\n ecosystem.\n </p>\n <p>It increases all of the player's multipliers by 0.1%</p>\n <br />\n\n <p>You have found the following exploits:</p>\n <ul>\n {exploits.map((c: Exploit) => (\n <li key={c}>* {ExploitName(c)}</li>\n ))}\n </ul>\n </>\n }\n />\n </li>\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\";\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\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n function MultiplierTable(rows: any[]): React.ReactElement {\n function improvements(r: number): JSX.Element[] {\n let elems: JSX.Element[] = [];\n if (r) {\n elems = [<td key=\"2\">&nbsp;{\"=>\"}&nbsp;</td>, <td key=\"3\">{numeralWrapper.formatPercentage(r)}</td>];\n }\n return elems;\n }\n\n return (\n <table>\n <tbody>\n {rows.map((r: any) => (\n <tr key={r[0]}>\n <td key=\"0\">\n <span>{r[0]} multiplier:&nbsp;</span>\n </td>\n <td key=\"1\" style={{ textAlign: \"right\" }}>\n {numeralWrapper.formatPercentage(r[1])}\n </td>\n {improvements(r[2])}\n </tr>\n ))}\n </tbody>\n </table>\n );\n }\n\n function BladeburnerMults(): React.ReactElement {\n if (!Player.canAccessBladeburner()) return <></>;\n return (\n <>\n {MultiplierTable([\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 <br />\n </>\n );\n }\n\n return (\n <>\n <p>\n <strong>\n <u>Multipliers:</u>\n </strong>\n </p>\n <br />\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n {MultiplierTable([\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 <br />\n\n <BladeburnerMults />\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\";\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(\n <li key={`${ownedAug.name}${ownedAug.level}`}>\n <AugmentationAccordion aug={aug} level={level} />\n </li>,\n );\n }\n\n return <ul className=\"augmentations-list\">{augs}</ul>;\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\";\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 <h1>Development Menu - Only meant to be used for testing/debugging</h1>\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 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 <h2>General</h2>\n </AccordionSummary>\n <AccordionDetails>\n <div>\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 </div>\n <div>\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 </div>\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 { 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 <h2>Experience / Stats</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text text-center\">All:</span>\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 <span className=\"text text-center\">Hacking:</span>\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 <span className=\"text text-center\">Strength:</span>\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 <span className=\"text text-center\">Defense:</span>\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 <span className=\"text text-center\">Dexterity:</span>\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 <span className=\"text text-center\">Agility:</span>\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 <span className=\"text text-center\">Charisma:</span>\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 <span className=\"text text-center\">Intelligence:</span>\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 <span className=\"text text-center\">Karma:</span>\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 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 <h2>Factions</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Faction:</span>\n </td>\n <td>\n <FormControl>\n <InputLabel id=\"factions-select\">Faction</InputLabel>\n <Select\n labelId=\"factions-select\"\n id=\"factions-dropdown\"\n className=\"dropdown exp-input\"\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 <span className=\"text\">Reputation:</span>\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 <span className=\"text\">Favor:</span>\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 <span className=\"text\">All Reputation:</span>\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 <span className=\"text\">All Favor:</span>\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 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 <h2>Augmentations</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Aug:</span>\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 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 <h2>Source-Files</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Exploits:</span>\n </td>\n <td>\n <Button onClick={clearExploits}>Clear</Button>\n </td>\n </tr>\n <tr key={\"sf-all\"}>\n <td>\n <span className=\"text\">All:</span>\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 <span className=\"text\">SF-{i}:</span>\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 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 <h2>Programs</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Program:</span>\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 <span className=\"text\">Add:</span>\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 Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { AllServers } from \"../../Server/AllServers\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServerByHostname } from \"../../Server/ServerHelpers\";\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 = GetServerByHostname(server);\n if (s === null) return;\n if (s instanceof HacknetServer) 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 i in AllServers) {\n const s = AllServers[i];\n if (s instanceof HacknetServer) 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 = GetServerByHostname(server);\n if (s === null) return;\n if (s instanceof HacknetServer) return;\n s.hackDifficulty = s.minDifficulty;\n }\n\n function minAllSecurity(): void {\n for (const i in AllServers) {\n const server = AllServers[i];\n if (server instanceof HacknetServer) continue;\n server.hackDifficulty = server.minDifficulty;\n }\n }\n\n function maxMoney(): void {\n const s = GetServerByHostname(server);\n if (s === null) return;\n if (s instanceof HacknetServer) return;\n s.moneyAvailable = s.moneyMax;\n }\n\n function maxAllMoney(): void {\n for (const i in AllServers) {\n const server = AllServers[i];\n if (server instanceof HacknetServer) continue;\n server.moneyAvailable = server.moneyMax;\n }\n }\n\n return (\n <Accordion TransitionProps={{ unmountOnExit: true }}>\n <AccordionSummary expandIcon={<ExpandMoreIcon />}>\n <h2>Servers</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Server:</span>\n </td>\n <td colSpan={2}>\n <Select id=\"dev-servers-dropdown\" className=\"dropdown\" onChange={setServerDropdown} value={server}>\n {Object.values(AllServers).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 <span className=\"text\">Root:</span>\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 <span className=\"text\">Security:</span>\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 <span className=\"text\">Money:</span>\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 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 <h2>Companies</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Company:</span>\n </td>\n <td colSpan={3}>\n <Select id=\"dev-companies-dropdown\" className=\"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 <span className=\"text\">Reputation:</span>\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 <span className=\"text\">Favor:</span>\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 <span className=\"text\">All Reputation:</span>\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 <span className=\"text\">All Favor:</span>\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 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 <h2>Bladeburner</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Rank:</span>\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 <span className=\"text\">Cycles:</span>\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 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 <h2>Gang</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Cycles:</span>\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 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 <h2>Corporation</h2>\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 <span className=\"text\">Cycles:</span>\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 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 <h2>Coding Contracts</h2>\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 Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../../utils/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 <h2>Stock Market</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Symbol:</span>\n </td>\n <td>\n <TextField placeholder=\"symbol/'all'\" onChange={setStockSymbolField} />\n </td>\n </tr>\n <tr>\n <td>\n <span className=\"text\">Price:</span>\n </td>\n <td>\n <TextField placeholder=\"$$$\" onChange={setStockPriceField} />\n <Button onClick={doSetStockPrice}>Set</Button>\n </td>\n </tr>\n <tr>\n <td>\n <span className=\"text\">Caps:</span>\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 { 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 <h2>Sleeves</h2>\n </AccordionSummary>\n <AccordionDetails>\n <table>\n <tbody>\n <tr>\n <td>\n <span className=\"text\">Shock:</span>\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 <span className=\"text\">Sync:</span>\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 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 <h2>Time skip</h2>\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 from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { use } from \"../../ui/Context\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nexport function BladeburnerRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <></>;\n return (\n <div className=\"bladeburner-container\">\n <div style={{ height: \"60%\", display: \"block\", position: \"relative\" }}>\n <div\n style={{\n height: \"100%\",\n width: \"30%\",\n display: \"inline-block\",\n border: \"1px solid white\",\n }}\n >\n <Stats bladeburner={bladeburner} player={player} router={router} />\n </div>\n <Console bladeburner={bladeburner} player={player} />\n </div>\n <div\n style={{\n width: \"70%\",\n display: \"block\",\n border: \"1px solid white\",\n marginTop: \"6px\",\n padding: \"6px\",\n position: \"relative\",\n }}\n >\n <AllPages bladeburner={bladeburner} player={player} />\n </div>\n </div>\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 { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { TravelPopup } from \"./TravelPopup\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\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 openStaminaHelp(): void {\n dialogBoxCreate(\n \"Performing actions will use up your stamina.<br><br>\" +\n \"Your max stamina is determined primarily by your agility stat.<br><br>\" +\n \"Your stamina gain rate is determined by both your agility and your \" +\n \"max stamina. Higher max stamina leads to a higher gain rate.<br><br>\" +\n \"Once your \" +\n \"stamina falls below 50% of its max value, it begins to negatively \" +\n \"affect the success rate of your contracts/operations. This penalty \" +\n \"is shown in the overview panel. If the penalty is 15%, then this means \" +\n \"your success rate would be multipled by 85% (100 - 15).<br><br>\" +\n \"Your max stamina and stamina gain rate can also be increased by \" +\n \"training, or through skills and Augmentation upgrades.\",\n );\n }\n\n function openPopulationHelp(): void {\n dialogBoxCreate(\n \"The success rate of your contracts/operations depends on \" +\n \"the population of Synthoids in your current city. \" +\n \"The success rate that is shown to you is only an estimate, \" +\n \"and it is based on your Synthoid population estimate.<br><br>\" +\n \"Therefore, it is important that this Synthoid population estimate \" +\n \"is accurate so that you have a better idea of your \" +\n \"success rate for contracts/operations. Certain \" +\n \"actions will increase the accuracy of your population \" +\n \"estimate.<br><br>\" +\n \"The Synthoid populations of cities can change due to your \" +\n \"actions or random events. If random events occur, they will \" +\n \"be logged in the Bladeburner Console.\",\n );\n }\n\n function openTravel(): void {\n const popupId = \"bladeburner-travel-popup\";\n createPopup(popupId, TravelPopup, {\n bladeburner: props.bladeburner,\n popupId: popupId,\n });\n }\n\n function openFaction(): void {\n const faction = Factions[\"Bladeburners\"];\n if (faction.isMember) {\n props.router.toFaction(faction);\n } else {\n if (props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(faction);\n dialogBoxCreate(\"Congratulations! You were accepted into the Bladeburners faction\");\n } else {\n dialogBoxCreate(\"You need a rank of 25 to join the Bladeburners Faction!\");\n }\n }\n }\n\n return (\n <>\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Rank: {formatNumber(props.bladeburner.rank, 2)}\n <span className=\"tooltiptext\">Your rank within the Bladeburner division.</span>\n </p>\n <br />\n <p>\n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n </p>\n <div className=\"help-tip\" onClick={openStaminaHelp}>\n ?\n </div>\n <br />\n <p>Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%</p>\n <br />\n <p>Team Size: {formatNumber(props.bladeburner.teamSize, 0)}</p>\n <p>Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}</p>\n <br />\n <p>Num Times Hospitalized: {props.bladeburner.numHosp}</p>\n <p>\n Money Lost From Hospitalizations: <Money money={props.bladeburner.moneyLost} />\n </p>\n <br />\n <p>Current City: {props.bladeburner.city}</p>\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n <span className=\"tooltiptext\">\n This is your Bladeburner division's estimate of how many Synthoids exist in your current city.\n </span>\n </p>\n <div className=\"help-tip\" onClick={openPopulationHelp}>\n ?\n </div>\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Est. Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}\n <span className=\"tooltiptext\">\n This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.\n </span>\n </p>\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n City Chaos: {formatNumber(props.bladeburner.getCurrentCity().chaos)}\n <span className=\"tooltiptext\">\n The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a chaos\n level can make contracts and operations harder.\n </span>\n </p>\n <br />\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Bonus time:{\" \"}\n {convertTimeMsToTimeElapsedString(\n (props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000,\n )}\n <br />\n <span className=\"tooltiptext\">\n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by browser).\n Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.\n </span>\n </p>\n <p>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</p>\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 <a onClick={openTravel} className=\"a-link-button\" style={{ display: \"inline-block\" }}>\n Travel\n </a>\n <a onClick={openFaction} className=\"a-link-button tooltip\" style={{ display: \"inline-block\" }}>\n <span className=\"tooltiptext\">\n Apply to the Bladeburner Faction, or go to the faction page if you are already a member\n </span>\n Faction\n </a>\n <br />\n <br />\n </>\n );\n}\n","import React from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n popupId: string;\n}\n\nexport function TravelPopup(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n removePopup(props.popupId);\n }\n\n return (\n <>\n <p>\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 </p>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <button key={city} className=\"std-button\" 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 );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface ILineProps {\n content: any;\n}\n\nfunction Line(props: ILineProps): React.ReactElement {\n return (\n <tr>\n <td className=\"bladeburner-console-line\" style={{ color: \"var(--my-font-color)\", whiteSpace: \"pre-wrap\" }}>\n {props.content}\n </td>\n </tr>\n );\n}\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function Console(props: IProps): React.ReactElement {\n const lastRef = useRef<HTMLDivElement>(null);\n const setRerender = useState(false)[1];\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 (!lastRef.current) return;\n lastRef.current.scrollTop = lastRef.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 const command = event.currentTarget.value;\n event.currentTarget.value = \"\";\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(props.player, command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n rerender();\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 <div ref={lastRef} className=\"bladeburner-console-div\">\n <table className=\"bladeburner-console-table\">\n <tbody>\n {/*\n TODO: optimize this.\n using `i` as a key here isn't great because it'll re-render everything\n everytime the console reaches max length.\n */}\n {props.bladeburner.consoleLogs.map((log: any, i: number) => (\n <Line key={i} content={log} />\n ))}\n <tr key=\"input\" id=\"bladeburner-console-input-row\" className=\"bladeburner-console-input-row\">\n <td className=\"bladeburner-console-input-cell\">\n <pre>{\"> \"}</pre>\n <input\n autoFocus\n className=\"bladeburner-console-input\"\n tabIndex={1}\n type=\"text\"\n onKeyDown={handleKeyDown}\n />\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { GeneralActionPage } from \"./GeneralActionPage\";\nimport { ContractPage } from \"./ContractPage\";\nimport { OperationPage } from \"./OperationPage\";\nimport { BlackOpPage } from \"./BlackOpPage\";\nimport { SkillPage } from \"./SkillPage\";\nimport { stealthIcon, killIcon } from \"../data/Icons\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function AllPages(props: IProps): React.ReactElement {\n const [page, setPage] = useState(\"General\");\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 Header(props: { name: string }): React.ReactElement {\n return (\n <a\n onClick={() => setPage(props.name)}\n className={page !== props.name ? \"bladeburner-nav-button noselect\" : \"bladeburner-nav-button-inactive noselect\"}\n >\n {props.name}\n </a>\n );\n }\n return (\n <>\n <Header name={\"General\"} />\n <Header name={\"Contracts\"} />\n <Header name={\"Operations\"} />\n <Header name={\"BlackOps\"} />\n <Header name={\"Skills\"} />\n <div style={{ display: \"block\", margin: \"4px\", padding: \"4px\" }}>\n {page === \"General\" && <GeneralActionPage bladeburner={props.bladeburner} player={props.player} />}\n {page === \"Contracts\" && <ContractPage bladeburner={props.bladeburner} player={props.player} />}\n {page === \"Operations\" && <OperationPage bladeburner={props.bladeburner} player={props.player} />}\n {page === \"BlackOps\" && <BlackOpPage bladeburner={props.bladeburner} player={props.player} />}\n {page === \"Skills\" && <SkillPage bladeburner={props.bladeburner} />}\n </div>\n <span className=\"text\">\n {stealthIcon} = This action requires stealth, {killIcon} = This action involves retirement\n </span>\n </>\n );\n}\n","import * as React from \"react\";\nimport { GeneralActionList } from \"./GeneralActionList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionPage(props: IProps): React.ReactElement {\n return (\n <>\n <p style={{ display: \"block\", margin: \"4px\", padding: \"4px\" }}>\n These are generic actions that will assist you in your Bladeburner duties. They will not affect your Bladeburner\n rank in any way.\n </p>\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 <li key={action.name} className=\"bladeburner-action\">\n <GeneralActionElem bladeburner={props.bladeburner} action={action} player={props.player} />\n </li>\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 { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: any;\n}\n\nexport function GeneralActionElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\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 function onStart(): void {\n props.bladeburner.action.type = ActionTypes[props.action.name as string];\n props.bladeburner.action.name = props.action.name;\n props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n return (\n <>\n <h2 style={{ display: \"inline-block\" }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </>\n ) : (\n <CopyableText value={props.action.name} />\n )}\n </h2>\n {isActive ? (\n <p style={{ display: \"block\" }}>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </p>\n ) : (\n <>\n <a onClick={onStart} className=\"a-link-button\" style={{ margin: \"3px\", padding: \"3px\" }}>\n Start\n </a>\n </>\n )}\n <br />\n <br />\n <pre style={{ display: \"inline-block\" }} dangerouslySetInnerHTML={{ __html: props.action.desc }}></pre>\n <br />\n <br />\n <pre style={{ display: \"inline-block\" }}>\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n {successChance !== -1 && (\n <>\n <br />\n Estimated success chance: {formatNumber(successChance * 100, 1)}%\n </>\n )}\n </pre>\n </>\n );\n}\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n <p style={{ display: \"block\", margin: \"4px\", padding: \"4px\" }}>\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 </p>\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 <li key={name} className=\"bladeburner-action\">\n <ContractElem bladeburner={props.bladeburner} action={contracts[name]} player={props.player} />\n </li>\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 { stealthIcon, killIcon } from \"../data/Icons\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: any;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner);\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const maxLevel = props.action.level >= props.action.maxLevel;\n const actionTime = props.action.getActionTime(props.bladeburner);\n const autolevelCheckboxId = `bladeburner-${props.action.name}-autolevel-checkbox`;\n\n function onStart(): void {\n props.bladeburner.action.type = ActionTypes.Contract;\n props.bladeburner.action.name = props.action.name;\n props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function increaseLevel(): void {\n ++props.action.level;\n if (isActive) props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function decreaseLevel(): void {\n --props.action.level;\n if (isActive) props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function onAutolevel(event: React.ChangeEvent<HTMLInputElement>): void {\n props.action.autoLevel = event.target.checked;\n setRerender((old) => !old);\n }\n\n return (\n <>\n <h2 style={{ display: \"inline-block\" }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </>\n ) : (\n <CopyableText value={props.action.name} />\n )}\n </h2>\n {isActive ? (\n <p style={{ display: \"block\" }}>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </p>\n ) : (\n <>\n <a onClick={onStart} className=\"a-link-button\" style={{ margin: \"3px\", padding: \"3px\" }}>\n Start\n </a>\n </>\n )}\n <br />\n <br />\n <pre className=\"tooltip\" style={{ display: \"inline-block\" }}>\n <span className=\"tooltiptext\">\n {props.action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed\n for next level\n </span>\n Level: {props.action.level} / {props.action.maxLevel}\n </pre>\n <a\n onClick={increaseLevel}\n style={{ padding: \"2px\", margin: \"2px\" }}\n className={`tooltip ${maxLevel ? \"a-link-button-inactive\" : \"a-link-button\"}`}\n >\n {isActive && <span className=\"tooltiptext\">WARNING: changing the level will restart the Operation</span>}↑\n </a>\n <a\n onClick={decreaseLevel}\n style={{ padding: \"2px\", margin: \"2px\" }}\n className={`tooltip ${props.action.level <= 1 ? \"a-link-button-inactive\" : \"a-link-button\"}`}\n >\n {isActive && <span className=\"tooltiptext\">WARNING: changing the level will restart the Operation</span>}↓\n </a>\n <br />\n <br />\n <pre style={{ display: \"inline-block\" }}>\n <span dangerouslySetInnerHTML={{ __html: props.action.desc }} />\n <br />\n <br />\n Estimated success chance: <SuccessChance chance={estimatedSuccessChance} />{\" \"}\n {props.action.isStealth ? stealthIcon : <></>}\n {props.action.isKill ? killIcon : <></>}\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 </pre>\n <br />\n <label className=\"tooltip\" style={{ color: \"white\" }} htmlFor={autolevelCheckboxId}>\n Autolevel:\n <span className=\"tooltiptext\">Automatically increase operation level when possible</span>\n </label>\n <input type=\"checkbox\" id={autolevelCheckboxId} checked={props.action.autoLevel} onChange={onAutolevel} />\n </>\n );\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n <p style={{ display: \"block\", margin: \"4px\", padding: \"4px\" }}>\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 </p>\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 <li key={name} className=\"bladeburner-action\">\n <OperationElem bladeburner={props.bladeburner} action={operations[name]} player={props.player} />\n </li>\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 { stealthIcon, killIcon } from \"../data/Icons\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { TeamSizePopup } from \"./TeamSizePopup\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: any;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner);\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const maxLevel = props.action.level >= props.action.maxLevel;\n const actionTime = props.action.getActionTime(props.bladeburner);\n const autolevelCheckboxId = `bladeburner-${props.action.name}-autolevel-checkbox`;\n\n function onStart(): void {\n props.bladeburner.action.type = ActionTypes.Operation;\n props.bladeburner.action.name = props.action.name;\n props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function onTeam(): void {\n const popupId = \"bladeburner-operation-set-team-size-popup\";\n createPopup(popupId, TeamSizePopup, {\n bladeburner: props.bladeburner,\n action: props.action,\n popupId: popupId,\n });\n }\n\n function increaseLevel(): void {\n ++props.action.level;\n if (isActive) props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function decreaseLevel(): void {\n --props.action.level;\n if (isActive) props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function onAutolevel(event: React.ChangeEvent<HTMLInputElement>): void {\n props.action.autoLevel = event.target.checked;\n setRerender((old) => !old);\n }\n\n return (\n <>\n <h2 style={{ display: \"inline-block\" }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </>\n ) : (\n <CopyableText value={props.action.name} />\n )}\n </h2>\n {isActive ? (\n <p style={{ display: \"block\" }}>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </p>\n ) : (\n <>\n <a onClick={onStart} className=\"a-link-button\" style={{ margin: \"3px\", padding: \"3px\" }}>\n Start\n </a>\n <a onClick={onTeam} style={{ margin: \"3px\", padding: \"3px\" }} className=\"a-link-button\">\n Set Team Size (Curr Size: {formatNumber(props.action.teamCount, 0)})\n </a>\n </>\n )}\n <br />\n <br />\n <pre className=\"tooltip\" style={{ display: \"inline-block\" }}>\n <span className=\"tooltiptext\">\n {props.action.getSuccessesNeededForNextLevel(BladeburnerConstants.OperationSuccessesPerLevel)} successes\n needed for next level\n </span>\n Level: {props.action.level} / {props.action.maxLevel}\n </pre>\n <a\n onClick={increaseLevel}\n style={{ padding: \"2px\", margin: \"2px\" }}\n className={`tooltip ${maxLevel ? \"a-link-button-inactive\" : \"a-link-button\"}`}\n >\n {isActive && <span className=\"tooltiptext\">WARNING: changing the level will restart the Operation</span>}↑\n </a>\n <a\n onClick={decreaseLevel}\n style={{ padding: \"2px\", margin: \"2px\" }}\n className={`tooltip ${props.action.level <= 1 ? \"a-link-button-inactive\" : \"a-link-button\"}`}\n >\n {isActive && <span className=\"tooltiptext\">WARNING: changing the level will restart the Operation</span>}↓\n </a>\n <br />\n <br />\n <pre style={{ display: \"inline-block\" }}>\n <span dangerouslySetInnerHTML={{ __html: props.action.desc }} />\n <br />\n <br />\n Estimated success chance: <SuccessChance chance={estimatedSuccessChance} />{\" \"}\n {props.action.isStealth ? stealthIcon : <></>}\n {props.action.isKill ? killIcon : <></>}\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 </pre>\n <br />\n <label className=\"tooltip\" style={{ color: \"white\" }} htmlFor={autolevelCheckboxId}>\n Autolevel:\n <span className=\"tooltiptext\">Automatically increase operation level when possible</span>\n </label>\n <input type=\"checkbox\" id={autolevelCheckboxId} checked={props.action.autoLevel} onChange={onAutolevel} />\n </>\n );\n}\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n return (\n <>\n <p style={{ display: \"block\", margin: \"4px\", padding: \"4px\" }}>\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 </p>\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 <li key={blackop.name} className=\"bladeburner-action\">\n <BlackOpElem bladeburner={props.bladeburner} action={blackop} player={props.player} />\n </li>\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 { stealthIcon, killIcon } from \"../data/Icons\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { TeamSizePopup } from \"./TeamSizePopup\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: any;\n}\n\nexport function BlackOpElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\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 estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner);\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 function onStart(): void {\n props.bladeburner.action.type = ActionTypes.BlackOperation;\n props.bladeburner.action.name = props.action.name;\n props.bladeburner.startAction(props.player, props.bladeburner.action);\n setRerender((old) => !old);\n }\n\n function onTeam(): void {\n const popupId = \"bladeburner-operation-set-team-size-popup\";\n createPopup(popupId, TeamSizePopup, {\n bladeburner: props.bladeburner,\n action: props.action,\n popupId: popupId,\n });\n }\n\n return (\n <>\n <h2 style={{ display: \"inline-block\" }}>\n {isActive ? (\n <>\n <CopyableText value={props.action.name} /> (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n </>\n ) : (\n <CopyableText value={props.action.name} />\n )}\n </h2>\n {isActive ? (\n <p style={{ display: \"block\" }}>\n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n </p>\n ) : (\n <>\n <a\n className={hasReqdRank ? \"a-link-button\" : \"a-link-button-inactive\"}\n style={{ margin: \"3px\", padding: \"3px\" }}\n onClick={onStart}\n >\n Start\n </a>\n <a onClick={onTeam} style={{ margin: \"3px\", padding: \"3px\" }} className=\"a-link-button\">\n Set Team Size (Curr Size: {formatNumber(props.action.teamCount, 0)})\n </a>\n </>\n )}\n <br />\n <br />\n <p style={{ display: \"inline-block\" }} dangerouslySetInnerHTML={{ __html: props.action.desc }} />\n <br />\n <br />\n <p style={{ display: \"block\", color: hasReqdRank ? \"white\" : \"red\" }}>\n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n </p>\n <br />\n <pre style={{ display: \"inline-block\" }}>\n Estimated Success Chance: <SuccessChance chance={estimatedSuccessChance} />{\" \"}\n {props.action.isStealth ? stealthIcon : <></>}\n {props.action.isKill ? killIcon : <></>}\n <br />\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n </pre>\n </>\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\";\n\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 <p>\n <strong>Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}</strong>\n </p>\n <p>\n You will gain one skill point every {BladeburnerConstants.RanksPerSkillPoint} ranks.\n <br />\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 <br />\n </p>\n <br />\n {valid(mults[\"successChanceAll\"]) && <p>Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}</p>}\n {valid(mults[\"successChanceStealth\"]) && (\n <p>Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}</p>\n )}\n {valid(mults[\"successChanceKill\"]) && (\n <p>Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}</p>\n )}\n {valid(mults[\"successChanceContract\"]) && (\n <p>Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}</p>\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n <p>Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}</p>\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n <p>Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}</p>\n )}\n {valid(mults[\"actionTime\"]) && <p>Action Time: x{formatNumber(mults[\"actionTime\"], 3)}</p>}\n {valid(mults[\"effHack\"]) && <p>Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}</p>}\n {valid(mults[\"effStr\"]) && <p>Strength: x{formatNumber(mults[\"effStr\"], 3)}</p>}\n {valid(mults[\"effDef\"]) && <p>Defense: x{formatNumber(mults[\"effDef\"], 3)}</p>}\n {valid(mults[\"effDex\"]) && <p>Dexterity: x{formatNumber(mults[\"effDex\"], 3)}</p>}\n {valid(mults[\"effAgi\"]) && <p>Agility: x{formatNumber(mults[\"effAgi\"], 3)}</p>}\n {valid(mults[\"effCha\"]) && <p>Charisma: x{formatNumber(mults[\"effCha\"], 3)}</p>}\n {valid(mults[\"effInt\"]) && <p>Intelligence: x{formatNumber(mults[\"effInt\"], 3)}</p>}\n {valid(mults[\"stamina\"]) && <p>Stamina: x{formatNumber(mults[\"stamina\"], 3)}</p>}\n {valid(mults[\"money\"]) && <p>Contract Money: x{formatNumber(mults[\"money\"], 3)}</p>}\n {valid(mults[\"expGain\"]) && <p>Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}</p>}\n <br />\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 <li key={skill} className=\"bladeburner-action\">\n <SkillElem bladeburner={props.bladeburner} skill={Skills[skill]} onUpgrade={props.onUpgrade} />\n </li>\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\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 <>\n <h2 style={{ display: \"inline-block\" }}>\n <CopyableText value={props.skill.name} />\n </h2>\n <a\n onClick={onClick}\n style={{ display: \"inline-block\", margin: \"3px\", padding: \"3px\" }}\n className={canLevel && !maxLvl ? \"a-link-button\" : \"a-link-button-inactive\"}\n >\n Level\n </a>\n <br />\n <br />\n <p style={{ display: \"block\" }}>Level: {currentLevel}</p>\n {maxLvl ? (\n <p style={{ color: \"red\", display: \"block\" }}>MAX LEVEL</p>\n ) : (\n <p style={{ display: \"block\" }}>Skill Points required: {formatNumber(pointCost, 0)}</p>\n )}\n <p style={{ display: \"inline-block\" }} dangerouslySetInnerHTML={{ __html: props.skill.desc }} />\n </>\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 { use } from \"../../ui/Context\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { Gang } from \"../Gang\";\n\nexport function GangRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const gang = (function () {\n if (player.gang === null) throw new Error(\"Gang should not be null\");\n return player.gang;\n })();\n const [management, setManagement] = useState(true);\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 back(): void {\n router.toFaction(Factions[gang.facName]);\n }\n\n return (\n <div className=\"gang-container\">\n <a className=\"a-link-button\" style={{ display: \"inline-block\" }} onClick={back}>\n Back\n </a>\n <a\n className={management ? \"a-link-button-inactive\" : \"a-link-button\"}\n style={{ display: \"inline-block\" }}\n onClick={() => setManagement(true)}\n >\n Gang Management\n </a>\n <a\n className={!management ? \"a-link-button-inactive\" : \"a-link-button\"}\n style={{ display: \"inline-block\" }}\n onClick={() => setManagement(false)}\n >\n Gang Territory\n </a>\n {management ? <ManagementSubpage gang={gang} player={player} /> : <TerritorySubpage gang={gang} />}\n </div>\n );\n}\n","/**\n * React Component for the subpage that manages gang members, the main page.\n */\nimport React from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GangStats } from \"./GangStats\";\nimport { Gang } from \"../Gang\";\nimport { GangMemberList } from \"./GangMemberList\";\n\ninterface IProps {\n gang: Gang;\n player: IPlayer;\n}\n\nexport function ManagementSubpage(props: IProps): React.ReactElement {\n return (\n <div style={{ display: \"block\" }}>\n <p className=\"noselect\" style={{ width: \"70%\" }}>\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 {props.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 </p>\n <br />\n <GangStats gang={props.gang} />\n <br />\n <GangMemberList gang={props.gang} player={props.player} />\n </div>\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\";\nimport { Gang } from \"../Gang\";\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\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function GangStats(props: IProps): React.ReactElement {\n const territoryMult = AllGangs[props.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 <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Respect: {numeralWrapper.formatRespect(props.gang.respect)} (\n {numeralWrapper.formatRespect(5 * props.gang.respectGainRate)} / sec)\n <span className=\"tooltiptext\">\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 </span>\n </p>\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Wanted Level: {numeralWrapper.formatWanted(props.gang.wanted)} (\n {numeralWrapper.formatWanted(5 * props.gang.wantedGainRate)} / sec)\n <span className=\"tooltiptext\">\n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder it\n will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n </span>\n </p>\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Wanted Level Penalty: -{formatNumber((1 - props.gang.getWantedPenalty()) * 100, 2)}%\n <span className=\"tooltiptext\">Penalty for respect and money gain rates due to Wanted Level</span>\n </p>\n <br />\n <div>\n <p style={{ display: \"inline-block\" }}>\n Money gain rate: <MoneyRate money={5 * props.gang.moneyGainRate} />\n </p>\n </div>\n <br />\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Territory: {territoryStr}%\n <span className=\"tooltiptext\">The percentage of total territory your Gang controls</span>\n </p>\n <br />\n <p style={{ display: \"inline-block\" }}>\n Faction reputation: {Reputation(Factions[props.gang.facName].playerReputation)}\n </p>\n <br />\n <BonusTime gang={props.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\";\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 <>\n <p className=\"tooltip\" style={{ display: \"inline-block\" }}>\n Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}\n <span className=\"tooltiptext noselect\">\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 </span>\n </p>\n <br />\n </>\n );\n}\n","/**\n * React Component for the list of gang members on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberUpgradePopup } from \"./GangMemberUpgradePopup\";\nimport { GangMemberAccordion } from \"./GangMemberAccordion\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\nimport { RecruitButton } from \"./RecruitButton\";\n\ninterface IProps {\n gang: Gang;\n player: IPlayer;\n}\n\nexport function GangMemberList(props: IProps): React.ReactElement {\n const [filter, setFilter] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function openUpgradePopup(): void {\n const popupId = `gang-upgrade-popup`;\n createPopup(popupId, GangMemberUpgradePopup, {\n gang: props.gang,\n player: props.player,\n popupId: popupId,\n });\n }\n\n function onFilterChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setFilter(event.target.value);\n }\n\n const members = props.gang.members.filter(\n (member: GangMember) => member.name.indexOf(filter) > -1 || member.task.indexOf(filter) > -1,\n );\n\n return (\n <>\n <RecruitButton onRecruit={() => setRerender((old) => !old)} gang={props.gang} />\n <br />\n <input\n className=\"text-input noselect\"\n placeholder=\"Filter gang member\"\n style={{ margin: \"5px\", padding: \"5px\" }}\n value={filter}\n onChange={onFilterChange}\n />\n <a className=\"a-link-button\" style={{ display: \"inline-block\" }} onClick={openUpgradePopup}>\n Manage Equipment\n </a>\n <ul>\n {members.map((member: GangMember) => (\n <li key={member.name}>\n <GangMemberAccordion gang={props.gang} member={member} />\n </li>\n ))}\n </ul>\n </>\n );\n}\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState, useEffect } from \"react\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { GangMember } from \"../GangMember\";\nimport { Gang } from \"../Gang\";\nimport { UpgradeType } from \"../data/upgrades\";\n\ninterface INextRevealProps {\n gang: Gang;\n upgrades: string[];\n type: UpgradeType;\n player: IPlayer;\n}\n\nfunction NextReveal(props: INextRevealProps): React.ReactElement {\n const upgrades = Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (props.player.money.gt(props.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 <p>\n Next at <Money money={upgrades[0].cost} />\n </p>\n );\n}\n\ninterface IPanelProps {\n member: GangMember;\n gang: Gang;\n player: IPlayer;\n}\n\nfunction GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function filterUpgrades(list: string[], type: UpgradeType): GangMemberUpgrade[] {\n return Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (props.player.money.lt(props.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 function purchasedUpgrade(upgName: string): React.ReactElement {\n const upg = GangMemberUpgrades[upgName];\n return (\n <div key={upgName} className=\"gang-owned-upgrade tooltip\">\n {upg.name}\n <span className=\"tooltiptext\" dangerouslySetInnerHTML={{ __html: upg.desc }} />\n </div>\n );\n }\n\n function upgradeButton(upg: GangMemberUpgrade, left = false): React.ReactElement {\n function onClick(): void {\n props.member.buyUpgrade(upg, props.player, props.gang);\n setRerender((old) => !old);\n }\n return (\n <a\n key={upg.name}\n className=\"a-link-button tooltip\"\n style={{\n margin: \"2px\",\n padding: \"2px\",\n display: \"block\",\n fontSize: \"11px\",\n }}\n onClick={onClick}\n >\n {upg.name} - <Money money={props.gang.getUpgradeCost(upg)} player={props.player} />\n <span className={left ? \"tooltiptextleft\" : \"tooltiptext\"} dangerouslySetInnerHTML={{ __html: upg.desc }} />\n </a>\n );\n }\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n return (\n <div style={{ border: \"1px solid white\" }}>\n <h1>\n {props.member.name}({props.member.task})\n </h1>\n <pre style={{ fontSize: \"14px\", display: \"inline-block\", width: \"20%\" }}>\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 </pre>\n <div className=\"gang-owned-upgrades-div noselect\">\n Purchased Upgrades: {props.member.upgrades.map((upg: string) => purchasedUpgrade(upg))}\n {props.member.augmentations.map((upg: string) => purchasedUpgrade(upg))}\n </div>\n <div className=\"noselect\" style={{ width: \"20%\", display: \"inline-block\" }}>\n <h2>Weapons</h2>\n {weaponUpgrades.map((upg) => upgradeButton(upg))}\n <NextReveal\n gang={props.gang}\n type={UpgradeType.Weapon}\n player={props.player}\n upgrades={props.member.upgrades}\n />\n </div>\n <div className=\"noselect\" style={{ width: \"20%\", display: \"inline-block\" }}>\n <h2>Armor</h2>\n {armorUpgrades.map((upg) => upgradeButton(upg))}\n <NextReveal gang={props.gang} type={UpgradeType.Armor} player={props.player} upgrades={props.member.upgrades} />\n </div>\n <div className=\"noselect\" style={{ width: \"20%\", display: \"inline-block\" }}>\n <h2>Vehicles</h2>\n {vehicleUpgrades.map((upg) => upgradeButton(upg))}\n <NextReveal\n gang={props.gang}\n type={UpgradeType.Vehicle}\n player={props.player}\n upgrades={props.member.upgrades}\n />\n </div>\n <div className=\"noselect\" style={{ width: \"20%\", display: \"inline-block\" }}>\n <h2>Rootkits</h2>\n {rootkitUpgrades.map((upg) => upgradeButton(upg, true))}\n <NextReveal\n gang={props.gang}\n type={UpgradeType.Rootkit}\n player={props.player}\n upgrades={props.member.upgrades}\n />\n </div>\n <div className=\"noselect\" style={{ width: \"20%\", display: \"inline-block\" }}>\n <h2>Augmentations</h2>\n {augUpgrades.map((upg) => upgradeButton(upg, true))}\n <NextReveal\n gang={props.gang}\n type={UpgradeType.Augmentation}\n player={props.player}\n upgrades={props.member.upgrades}\n />\n </div>\n </div>\n );\n}\n\ninterface IProps {\n gang: Gang;\n player: IPlayer;\n popupId: string;\n}\n\nexport function GangMemberUpgradePopup(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [filter, setFilter] = useState(\"\");\n\n function closePopup(this: Window, ev: KeyboardEvent): void {\n if (ev.keyCode !== 27) return;\n removePopup(props.popupId);\n }\n\n useEffect(() => {\n window.addEventListener<\"keydown\">(\"keydown\", closePopup);\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => {\n clearInterval(id);\n window.removeEventListener<\"keydown\">(\"keydown\", closePopup);\n };\n }, []);\n\n return (\n <>\n <input\n className=\"text-input noselect\"\n value={filter}\n placeholder=\"Filter gang member\"\n onChange={(event) => setFilter(event.target.value)}\n />\n <p className=\"tooltip\" style={{ marginLeft: \"6px\", display: \"inline-block\" }}>\n Discount: -{numeralWrapper.formatPercentage(1 - 1 / props.gang.getDiscount())}\n <span className=\"tooltiptext noselect\">\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 </span>\n </p>\n {props.gang.members.map((member: GangMember) => (\n <GangMemberUpgradePanel key={member.name} player={props.player} gang={props.gang} 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","/**\n * React Component for a gang member on the management subpage.\n */\nimport React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\nimport { BBAccordion } from \"../../ui/React/BBAccordion\";\nimport { GangMemberAccordionContent } from \"./GangMemberAccordionContent\";\n\ninterface IProps {\n gang: Gang;\n member: GangMember;\n}\n\nexport function GangMemberAccordion(props: IProps): React.ReactElement {\n return (\n <BBAccordion\n panelInitiallyOpened={true}\n headerContent={<>{props.member.name}</>}\n panelContent={<GangMemberAccordionContent gang={props.gang} member={props.member} />}\n />\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 { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n gang: Gang;\n member: GangMember;\n}\n\nexport function GangMemberAccordionContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n return (\n <>\n <div className={\"gang-member-info-div tooltip\"}>\n <GangMemberStats onAscend={() => setRerender((old) => !old)} gang={props.gang} member={props.member} />\n </div>\n <div className={\"gang-member-info-div\"}>\n <TaskSelector onTaskChange={() => setRerender((old) => !old)} gang={props.gang} member={props.member} />\n </div>\n <div className={\"gang-member-info-div\"}>\n <TaskDescription member={props.member} />\n </div>\n </>\n );\n}\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\nimport { AscensionPopup } from \"./AscensionPopup\";\n\ninterface IProps {\n member: GangMember;\n gang: Gang;\n onAscend: () => void;\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n function ascend(): void {\n const popupId = `gang-management-ascend-member ${props.member.name}`;\n createPopup(popupId, AscensionPopup, {\n member: props.member,\n gang: props.gang,\n popupId: popupId,\n onAscend: props.onAscend,\n });\n }\n\n function openAscensionHelp(): void {\n dialogBoxCreate(\n <>\n Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their stat\n multipliers.\n <br />\n <br />\n The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp they\n have.\n <br />\n <br />\n Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect equal\n to the total respect earned by the member.\n </>,\n );\n }\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n\n return (\n <>\n <span className=\"tooltiptext smallfont\">\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)} 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)} 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)} 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)} 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)} 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)} Asc)\n </span>\n <pre>\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 </pre>\n <br />\n {props.member.canAscend() && (\n <>\n <button className=\"accordion-button noselect\" onClick={ascend}>\n Ascend\n </button>\n <div className=\"help-tip noselect\" style={{ marginTop: \"5px\" }} onClick={openAscensionHelp}>\n ?\n </div>\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 { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\n\ninterface IProps {\n member: GangMember;\n gang: Gang;\n popupId: string;\n onAscend: () => void;\n}\n\nexport function AscensionPopup(props: IProps): React.ReactElement {\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 = props.gang.ascendMember(props.member);\n dialogBoxCreate(\n <p>\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 </p>,\n );\n removePopup(props.popupId);\n }\n\n function cancel(): void {\n removePopup(props.popupId);\n }\n\n // const ascendBenefits = props.member.getAscensionResults();\n const preAscend = props.member.getCurrentAscensionMults();\n const postAscend = props.member.getAscensionMultsAfterAscend();\n\n return (\n <>\n <pre>\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\")} =&gt; x\n {numeralWrapper.format(postAscend.hack, \"0.000\")}\n <br />\n Strength: x{numeralWrapper.format(preAscend.str, \"0.000\")} =&gt; x\n {numeralWrapper.format(postAscend.str, \"0.000\")}\n <br />\n Defense: x{numeralWrapper.format(preAscend.def, \"0.000\")} =&gt; x\n {numeralWrapper.format(postAscend.def, \"0.000\")}\n <br />\n Dexterity: x{numeralWrapper.format(preAscend.dex, \"0.000\")} =&gt; x\n {numeralWrapper.format(postAscend.dex, \"0.000\")}\n <br />\n Agility: x{numeralWrapper.format(preAscend.agi, \"0.000\")} =&gt; x\n {numeralWrapper.format(postAscend.agi, \"0.000\")}\n <br />\n Charisma: x{numeralWrapper.format(preAscend.cha, \"0.000\")} =&gt; x\n {numeralWrapper.format(postAscend.cha, \"0.000\")}\n <br />\n </pre>\n <button className=\"std-button\" onClick={confirm}>\n Ascend\n </button>\n <button className=\"std-button\" onClick={cancel}>\n Cancel\n </button>\n </>\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 { Gang } from \"../Gang\";\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n member: GangMember;\n gang: Gang;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n function onChange(event: React.ChangeEvent<HTMLSelectElement>): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = props.gang.getAllTaskNames();\n\n const data = [\n [`Money:`, <MoneyRate money={5 * props.member.calculateMoneyGain(props.gang)} />],\n [`Respect:`, `${numeralWrapper.formatRespect(5 * props.member.calculateRespectGain(props.gang))} / sec`],\n [`Wanted Level:`, `${numeralWrapper.formatWanted(5 * props.member.calculateWantedLevelGain(props.gang))} / sec`],\n [`Total Respect:`, `${numeralWrapper.formatRespect(props.member.earnedRespect)}`],\n ];\n\n return (\n <>\n <select onChange={onChange} className=\"dropdown noselect\" value={currentTask}>\n <option key={0} value={\"---\"}>\n ---\n </option>\n {tasks.map((task: string, i: number) => (\n <option key={i + 1} value={task}>\n {task}\n </option>\n ))}\n </select>\n <div>\n <StatsTable rows={data} />\n </div>\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\";\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 <p className=\"inline noselect\" 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 from \"react\";\nimport { Gang } from \"../Gang\";\nimport { RecruitPopup } from \"./RecruitPopup\";\nimport { GangConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { createPopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n gang: Gang;\n onRecruit: () => void;\n}\n\nexport function RecruitButton(props: IProps): React.ReactElement {\n if (props.gang.members.length >= GangConstants.MaximumGangMembers) {\n return <></>;\n }\n\n if (!props.gang.canRecruitMember()) {\n const respect = props.gang.getRespectNeededToRecruitMember();\n return (\n <>\n <a className=\"a-link-button-inactive\" style={{ display: \"inline-block\", margin: \"10px\" }}>\n Recruit Gang Member\n </a>\n <p style={{ margin: \"10px\", color: \"red\", display: \"inline-block\" }}>\n {formatNumber(respect, 2)} respect needed to recruit next member\n </p>\n </>\n );\n }\n\n function onClick(): void {\n const popupId = \"recruit-gang-member-popup\";\n createPopup(popupId, RecruitPopup, {\n gang: props.gang,\n popupId: popupId,\n onRecruit: props.onRecruit,\n });\n }\n\n return (\n <>\n <a className=\"a-link-button\" onClick={onClick} style={{ display: \"inline-block\", margin: \"10px\" }}>\n Recruit Gang Member\n </a>\n </>\n );\n}\n","/**\n * React Component for the popup used to recruit new gang members.\n */\nimport React, { useState } from \"react\";\nimport { Gang } from \"../Gang\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\n\ninterface IRecruitPopupProps {\n gang: Gang;\n popupId: string;\n onRecruit: () => void;\n}\n\nexport function RecruitPopup(props: IRecruitPopupProps): React.ReactElement {\n const [name, setName] = useState(\"\");\n\n function recruit(): void {\n if (name === \"\") {\n dialogBoxCreate(\"You must enter a name for your Gang member!\");\n return;\n }\n if (!props.gang.canRecruitMember()) {\n dialogBoxCreate(\"You cannot recruit another Gang member!\");\n return;\n }\n\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 (!props.gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n removePopup(props.popupId);\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 <>\n <p className=\"noselect\">Enter a name for your new Gang member:</p>\n <br />\n <input\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n className=\"text-input noselect\"\n type=\"text\"\n placeholder=\"unique name\"\n />\n <a className=\"std-button\" onClick={recruit}>\n Recruit Gang Member\n </a>\n </>\n );\n}\n","/**\n * React Component for the territory subpage.\n */\nimport React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { AllGangs } from \"../AllGangs\";\nimport { Gang } from \"../Gang\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function TerritorySubpage(props: IProps): React.ReactElement {\n function openWarfareHelp(): void {\n dialogBoxCreate(\n \"This percentage represents the chance you have of \" +\n \"'clashing' with with another gang. If you do not \" +\n \"wish to gain/lose territory, then keep this \" +\n \"percentage at 0% by not engaging in territory warfare.\",\n );\n }\n\n function 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\n const playerPower = AllGangs[props.gang.facName].power;\n function otherGangTerritory(name: string): React.ReactElement {\n const power = AllGangs[name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n return (\n <span key={name}>\n <u>{name}</u>\n <br />\n Power: {formatNumber(power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[name].territory)}%<br />\n Chance to win clash with this gang: {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n <br />\n <br />\n </span>\n );\n }\n\n const gangNames = Object.keys(AllGangs).filter((g) => g != props.gang.facName);\n\n return (\n <div style={{ width: \"70%\" }}>\n <p className=\"noselect\">\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 </p>\n <input\n checked={props.gang.territoryWarfareEngaged}\n id=\"warfare\"\n type=\"checkbox\"\n style={{ display: \"inline-block\", margin: \"2px\" }}\n onChange={(event) => (props.gang.territoryWarfareEngaged = event.target.checked)}\n />\n <label htmlFor=\"warfare\" className=\"tooltip noselect\" style={{ color: \"white\", display: \"inline-block\" }}>\n Engage in Territory Warfare\n <span className=\"tooltiptext\" style={{ display: \"inline-block\" }}>\n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance to\n gradually decrease until it reaches 0%.\n </span>\n </label>\n <br />\n <p style={{ display: \"inline-block\" }}>\n Territory Clash Chance: {numeralWrapper.formatPercentage(props.gang.territoryClashChance, 3)}\n </p>\n <div className=\"help-tip noselect\" style={{ display: \"inline-block\" }} onClick={openWarfareHelp}>\n ?\n </div>\n <br />\n\n <input\n checked={props.gang.notifyMemberDeath}\n id=\"notify\"\n type=\"checkbox\"\n style={{ display: \"inline-block\", margin: \"2px\" }}\n onChange={(event) => (props.gang.notifyMemberDeath = event.target.checked)}\n />\n <label htmlFor=\"warfare\" className=\"tooltip noselect\" style={{ color: \"white\", display: \"inline-block\" }}>\n Notify about Gang Member Deaths\n <span className=\"tooltiptext\" style={{ display: \"inline-block\" }}>\n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members dies in a\n territory clash.\n </span>\n </label>\n <br />\n <fieldset style={{ display: \"block\", margin: \"6px\" }}>\n <p>\n <b>\n <u>{props.gang.facName}</u>\n </b>\n <br />\n Power: {formatNumber(AllGangs[props.gang.facName].power, 6)}\n <br />\n Territory: {formatTerritory(AllGangs[props.gang.facName].territory)}%\n <br />\n <br />\n {gangNames.map((name) => otherGangTerritory(name))}\n </p>\n </fieldset>\n </div>\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 { HeaderTab } from \"./HeaderTab\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustryPopup } from \"./NewIndustryPopup\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { use } from \"../../ui/Context\";\n\ninterface IExpandButtonProps {\n corp: ICorporation;\n setDivisionName: (name: string) => void;\n}\n\nfunction ExpandButton(props: IExpandButtonProps): React.ReactElement {\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n )\n .sort();\n if (possibleIndustries.length === 0) return <></>;\n\n function openNewIndustryPopup(): void {\n const popupId = \"cmpy-mgmt-expand-industry-popup\";\n createPopup(popupId, NewIndustryPopup, {\n corp: props.corp,\n setDivisionName: props.setDivisionName,\n popupId: popupId,\n });\n }\n\n return <HeaderTab current={false} onClick={openNewIndustryPopup} text={\"Expand into new Industry\"} />;\n}\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(\"Overview\");\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n return (\n <div className=\"cmpy-mgmt-container\">\n <div>\n <HeaderTab\n current={divisionName === \"Overview\"}\n key={\"overview\"}\n onClick={() => setDivisionName(\"Overview\")}\n text={corporation.name}\n />\n {corporation.divisions.map((division: IIndustry) => (\n <HeaderTab\n current={division.name === divisionName}\n key={division.name}\n onClick={() => setDivisionName(division.name)}\n text={division.name}\n />\n ))}\n <ExpandButton corp={corporation} setDivisionName={setDivisionName} />\n </div>\n <MainPanel rerender={rerender} corp={corporation} divisionName={divisionName} player={player} />\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustry } from \"../Actions\";\n\ninterface IProps {\n corp: ICorporation;\n popupId: string;\n setDivisionName: (name: string) => void;\n}\n// Create a popup that lets the player create a new industry.\n// This is created when the player clicks the \"Expand into new Industry\" header tab\nexport function NewIndustryPopup(props: IProps): React.ReactElement {\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n props.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 function newIndustry(): void {\n try {\n NewIndustry(props.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 removePopup(props.popupId);\n }\n\n function onNameChange(event: React.ChangeEvent<HTMLInputElement>): void {\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: React.ChangeEvent<HTMLSelectElement>): 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 <p>Create a new division to expand into a new industry:</p>\n <select className=\"dropdown\" defaultValue={industry} onChange={onIndustryChange}>\n {possibleIndustries.map((industry: string) => (\n <option key={industry} value={industry}>\n {industry}\n </option>\n ))}\n </select>\n <p>{desc(props.corp)}</p>\n <br />\n <br />\n\n <p>Division name:</p>\n <input\n autoFocus={true}\n value={name}\n onChange={onNameChange}\n onKeyDown={onKeyDown}\n type=\"text\"\n className=\"text-input\"\n style={{ display: \"block\" }}\n maxLength={30}\n pattern=\"[a-zA-Z0-9-_]\"\n />\n <span onClick={newIndustry} className=\"popup-box-button\">\n Create Division\n </span>\n </>\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 \"../../utils/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\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\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 if (prod.data[warehouse.loc][0] > 0) {\n warehouse.breakdown += prodName + \": \" + formatNumber(prod.data[warehouse.loc][0] * prod.siz, 0) + \"<br>\";\n }\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 = buyAmt;\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 { 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","// 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 { Overview } from \"./Overview\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n corp: ICorporation;\n player: IPlayer;\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const division =\n props.divisionName !== \"Overview\"\n ? props.corp.divisions.find((division: IIndustry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) {\n return (\n <div id=\"cmpy-mgmt-panel\">\n <Overview {...props} />\n </div>\n );\n } else {\n return (\n <div id=\"cmpy-mgmt-panel\">\n <CityTabs\n rerender={props.rerender}\n division={division}\n corp={props.corp}\n city={CityName.Sector12}\n player={props.player}\n />\n </div>\n );\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 { CityTab } from \"./CityTab\";\nimport { ExpandNewCityPopup } from \"./ExpandNewCityPopup\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IExpandButtonProps {\n corp: ICorporation;\n division: IIndustry;\n setCity: (name: string) => void;\n}\n\nfunction ExpandButton(props: IExpandButtonProps): React.ReactElement {\n function openExpandNewCityModal(): void {\n const popupId = \"cmpy-mgmt-expand-city-popup\";\n createPopup(popupId, ExpandNewCityPopup, {\n popupId: popupId,\n corp: props.corp,\n division: props.division,\n cityStateSetter: props.setCity,\n });\n }\n\n const possibleCities = Object.keys(props.division.offices).filter(\n (cityName: string) => props.division.offices[cityName] === 0,\n );\n if (possibleCities.length === 0) return <></>;\n\n return (\n <CityTab\n current={false}\n key={\"Expand into new City\"}\n name={\"Expand into new City\"}\n onClick={openExpandNewCityModal}\n />\n );\n}\n\ninterface IProps {\n city: string;\n division: IIndustry;\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const [city, setCity] = useState(props.city);\n\n const office = props.division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <></>;\n }\n\n return (\n <>\n {Object.values(props.division.offices).map(\n (office: OfficeSpace | 0) =>\n office !== 0 && (\n <CityTab\n current={city === office.loc}\n key={office.loc}\n name={office.loc}\n onClick={() => setCity(office.loc)}\n />\n ),\n )}\n <ExpandButton corp={props.corp} division={props.division} setCity={setCity} />\n <Industry\n rerender={props.rerender}\n corp={props.corp}\n division={props.division}\n city={city}\n warehouse={props.division.warehouses[city]}\n office={office}\n player={props.player}\n />\n </>\n );\n}\n","import React, { useRef } from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { ICorporation } from \"../ICorporation\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\n\ninterface IProps {\n popupId: string;\n corp: ICorporation;\n division: IIndustry;\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCityPopup(props: IProps): React.ReactElement {\n const dropdown = useRef<HTMLSelectElement>(null);\n\n function expand(): void {\n if (dropdown.current === null) return;\n try {\n NewCity(props.corp, props.division, dropdown.current.value);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(`Opened a new office in ${dropdown.current.value}!`);\n\n props.cityStateSetter(dropdown.current.value);\n removePopup(props.popupId);\n }\n return (\n <>\n <p>\n Would you like to expand into a new city by opening an office? This would cost{\" \"}\n <MoneyCost money={CorporationConstants.OfficeInitialCost} corp={props.corp} />\n </p>\n <select ref={dropdown} className=\"dropdown\" style={{ margin: \"5px\" }}>\n {Object.keys(props.division.offices)\n .filter((cityName: string) => props.division.offices[cityName] === 0)\n .map((cityName: string) => (\n <option key={cityName} value={cityName}>\n {cityName}\n </option>\n ))}\n </select>\n <button\n className=\"std-button\"\n style={{ display: \"inline-block\" }}\n onClick={expand}\n disabled={props.corp.funds.lt(0)}\n >\n Confirm\n </button>\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 { ICorporation } from \"../ICorporation\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n return (\n <div>\n <div className={\"cmpy-mgmt-industry-left-panel\"}>\n <IndustryOverview\n rerender={props.rerender}\n player={props.player}\n corp={props.corp}\n division={props.division}\n currentCity={props.city}\n office={props.office}\n />\n <IndustryOffice\n rerender={props.rerender}\n player={props.player}\n corp={props.corp}\n division={props.division}\n office={props.office}\n />\n </div>\n <div className={\"cmpy-mgmt-industry-right-panel\"}>\n <IndustryWarehouse\n rerender={props.rerender}\n player={props.player}\n corp={props.corp}\n currentCity={props.city}\n division={props.division}\n warehouse={props.warehouse}\n />\n </div>\n </div>\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 { IIndustry } from \"../IIndustry\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { getSelectText } from \"../../../utils/uiHelpers/getSelectData\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { UpgradeOfficeSizePopup } from \"./UpgradeOfficeSizePopup\";\nimport { HireEmployeePopup } from \"./HireEmployeePopup\";\nimport { ThrowPartyPopup } from \"./ThrowPartyPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n office: OfficeSpace;\n player: IPlayer;\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 <button className={\"std-button tooltip\"} onClick={() => props.switchMode((old) => !old)}>\n Switch to Auto Mode\n <span className={\"tooltiptext\"}>\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 </span>\n </button>\n );\n } else {\n return (\n <button className={\"std-button tooltip\"} onClick={() => props.switchMode((old) => !old)}>\n Switch to Manual Mode\n <span className={\"tooltiptext\"}>\n Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs\n </span>\n </button>\n );\n }\n}\n\nfunction ManualManagement(props: IProps): React.ReactElement {\n const [employee, setEmployee] = useState<Employee | null>(\n props.office.employees.length > 0 ? props.office.employees[0] : null,\n );\n\n const employeeInfoDivStyle = {\n color: \"white\",\n margin: \"4px\",\n padding: \"4px\",\n };\n\n // Employee Selector\n const employees = [];\n for (let i = 0; i < props.office.employees.length; ++i) {\n employees.push(<option key={props.office.employees[i].name}>{props.office.employees[i].name}</option>);\n }\n\n function employeeSelectorOnChange(e: React.ChangeEvent<HTMLSelectElement>): void {\n const name = getSelectText(e.target);\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 <option key={positionNames[i]} value={positionNames[i]}>\n {positionNames[i]}\n </option>,\n );\n if (emp != null && emp.pos === positionNames[i]) {\n employeePositionSelectorInitialValue = positionNames[i];\n }\n }\n\n function employeePositionSelectorOnChange(e: React.ChangeEvent<HTMLSelectElement>): void {\n if (employee === null) return;\n const pos = getSelectText(e.target);\n employee.pos = pos;\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 * props.corp.getEmployeeCreMultiplier() * props.division.getEmployeeCreMultiplier() : 0;\n const effCha = emp ? emp.cha * props.corp.getEmployeeChaMultiplier() * props.division.getEmployeeChaMultiplier() : 0;\n const effInt = emp ? emp.int * props.corp.getEmployeeIntMultiplier() * props.division.getEmployeeIntMultiplier() : 0;\n const effEff = emp ? emp.eff * props.corp.getEmployeeEffMultiplier() * props.division.getEmployeeEffMultiplier() : 0;\n\n return (\n <div style={employeeInfoDivStyle}>\n <select className=\"dropdown\" onChange={employeeSelectorOnChange}>\n {employees}\n </select>\n {employee != null && (\n <p>\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 </p>\n )}\n {employee != null && (\n <select\n className=\"dropdown\"\n onChange={employeePositionSelectorOnChange}\n value={employeePositionSelectorInitialValue}\n >\n {employeePositions}\n </select>\n )}\n </div>\n );\n}\n\ninterface IAutoAssignProps {\n office: OfficeSpace;\n corp: ICorporation;\n division: IIndustry;\n player: IPlayer;\n job: string;\n desc: string;\n rerender: () => void;\n}\n\nfunction AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\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(props.corp, props.division);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.unassignEmployeeFromJob(props.job);\n props.office.calculateEmployeeProductivity(props.corp, props.division);\n props.rerender();\n }\n const positionHeaderStyle = {\n fontSize: \"15px\",\n margin: \"5px 0px 5px 0px\",\n width: \"50%\",\n };\n return (\n <>\n <h2 className={\"tooltip\"} style={positionHeaderStyle}>\n {props.job} ({numJob})<span className={\"tooltiptext\"}>{props.desc}</span>\n </h2>\n <button className={numUnassigned > 0 ? \"std-button\" : \"a-link-button-inactive\"} onClick={assignEmployee}>\n +\n </button>\n <button className={numJob > 0 ? \"std-button\" : \"a-link-button-inactive\"} onClick={unassignEmployee}>\n -\n </button>\n <br />\n </>\n );\n}\n\nfunction AutoManagement(props: IProps): React.ReactElement {\n const numUnassigned = countEmployee(props.office.employees, EmployeePositions.Unassigned);\n const vechain = props.corp.unlockUpgrades[4] === 1; // Has Vechain upgrade\n\n // Calculate average morale, happiness, and energy. Also salary\n // TODO is this efficient?\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 <p>\n <strong>Unassigned Employees: {numUnassigned}</strong>\n </p>\n <br />\n <table>\n <tbody>\n <tr>\n <td>\n <p>Avg Employee Morale:</p>\n </td>\n <td>\n <p>{numeralWrapper.format(avgMorale, \"0.000\")}</p>\n </td>\n </tr>\n <tr>\n <td>\n <p>Avg Employee Happiness:</p>\n </td>\n <td>\n <p>{numeralWrapper.format(avgHappiness, \"0.000\")}</p>\n </td>\n </tr>\n <tr>\n <td>\n <p>Avg Employee Energy:</p>\n </td>\n <td>\n <p>{numeralWrapper.format(avgEnergy, \"0.000\")}</p>\n </td>\n </tr>\n <tr>\n <td>\n <p>Total Employee Salary:</p>\n </td>\n <td>\n <p>\n <Money money={totalSalary} />\n </p>\n </td>\n </tr>\n {vechain && (\n <>\n <tr>\n <td>\n <p className={\"tooltip\"} style={{ display: \"inline-block\" }}>\n Material Production:\n <span className={\"tooltiptext\"}>\n The base amount of material this office can produce. Does not include production multipliers from\n upgrades and materials. This value is based off the productivity of your Operations, Engineering,\n and Management employees\n </span>\n </p>\n </td>\n <td>\n <p>{numeralWrapper.format(props.division.getOfficeProductivity(props.office), \"0.000\")}</p>\n </td>\n </tr>\n <tr>\n <td>\n <p className={\"tooltip\"} style={{ display: \"inline-block\" }}>\n Product Production:\n <span className={\"tooltiptext\"}>\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 </span>\n </p>\n </td>\n <td>\n <p>\n {numeralWrapper.format(\n props.division.getOfficeProductivity(props.office, {\n forProduct: true,\n }),\n \"0.000\",\n )}\n </p>\n </td>\n </tr>\n <tr>\n <td>\n <p className={\"tooltip\"} style={{ display: \"inline-block\" }}>\n Business Multiplier:\n <span className={\"tooltiptext\"}>\n The effect this office's 'Business' employees has on boosting sales\n </span>\n </p>\n </td>\n <td>\n <p>x{numeralWrapper.format(props.division.getBusinessFactor(props.office), \"0.000\")}</p>\n </td>\n </tr>\n </>\n )}\n </tbody>\n </table>\n <AutoAssignJob\n rerender={props.rerender}\n office={props.office}\n corp={props.corp}\n division={props.division}\n player={props.player}\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 corp={props.corp}\n division={props.division}\n player={props.player}\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 corp={props.corp}\n division={props.division}\n player={props.player}\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 corp={props.corp}\n division={props.division}\n player={props.player}\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 corp={props.corp}\n division={props.division}\n player={props.player}\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 corp={props.corp}\n division={props.division}\n player={props.player}\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 </>\n );\n}\n\nexport function IndustryOffice(props: IProps): React.ReactElement {\n const [employeeManualAssignMode, setEmployeeManualAssignMode] = useState(false);\n\n const buttonStyle = {\n fontSize: \"13px\",\n };\n\n // Hire Employee button\n let hireEmployeeButtonClass = \"tooltip\";\n if (props.office.atCapacity()) {\n hireEmployeeButtonClass += \" a-link-button-inactive\";\n } else {\n hireEmployeeButtonClass += \" std-button\";\n if (props.office.employees.length === 0) {\n hireEmployeeButtonClass += \" flashing-button\";\n }\n }\n\n function openHireEmployeePopup(): void {\n const popupId = \"cmpy-mgmt-hire-employee-popup\";\n createPopup(popupId, HireEmployeePopup, {\n rerender: props.rerender,\n office: props.office,\n corp: props.corp,\n popupId: popupId,\n player: props.player,\n });\n }\n\n // Autohire employee button\n let autohireEmployeeButtonClass = \"tooltip\";\n if (props.office.atCapacity()) {\n autohireEmployeeButtonClass += \" a-link-button-inactive\";\n } else {\n autohireEmployeeButtonClass += \" std-button\";\n }\n function autohireEmployeeButtonOnClick(): void {\n if (props.office.atCapacity()) return;\n props.office.hireRandomEmployee();\n props.rerender();\n }\n\n function openUpgradeOfficeSizePopup(): void {\n const popupId = \"cmpy-mgmt-upgrade-office-size-popup\";\n createPopup(popupId, UpgradeOfficeSizePopup, {\n rerender: props.rerender,\n office: props.office,\n corp: props.corp,\n popupId: popupId,\n player: props.player,\n });\n }\n\n function openThrowPartyPopup(): void {\n const popupId = \"cmpy-mgmt-throw-office-party-popup\";\n createPopup(popupId, ThrowPartyPopup, {\n office: props.office,\n corp: props.corp,\n popupId: popupId,\n });\n }\n\n return (\n <div className={\"cmpy-mgmt-employee-panel\"}>\n <h1 style={{ margin: \"4px 0px 5px 0px\" }}>Office Space</h1>\n <p>\n Size: {props.office.employees.length} / {props.office.size} employees\n </p>\n <button className={hireEmployeeButtonClass} onClick={openHireEmployeePopup} style={buttonStyle}>\n Hire Employee\n {props.office.employees.length === 0 && (\n <span className={\"tooltiptext\"}>\n You'll need to hire some employees to get your operations started! It's recommended to have at least one\n employee in every position\n </span>\n )}\n </button>\n <button className={autohireEmployeeButtonClass} onClick={autohireEmployeeButtonOnClick} style={buttonStyle}>\n Autohire Employee\n <span className={\"tooltiptext\"}>Automatically hires an employee and gives him/her a random name</span>\n </button>\n <br />\n <button\n className={\"std-button tooltip\"}\n onClick={openUpgradeOfficeSizePopup}\n style={buttonStyle}\n disabled={props.corp.funds.lt(0)}\n >\n Upgrade size\n <span className={\"tooltiptext\"}>Upgrade the office's size so that it can hold more employees!</span>\n </button>\n {!props.division.hasResearch(\"AutoPartyManager\") && (\n <button\n className={\"std-button tooltip\"}\n onClick={openThrowPartyPopup}\n style={buttonStyle}\n disabled={props.corp.funds.lt(0)}\n >\n Throw Party\n <span className={\"tooltiptext\"}>\n \"Throw an office party to increase your employee's morale and happiness\"\n </span>\n </button>\n )}\n <br />\n\n <div>\n <SwitchButton manualMode={employeeManualAssignMode} switchMode={setEmployeeManualAssignMode} />\n </div>\n {employeeManualAssignMode ? (\n <ManualManagement\n rerender={props.rerender}\n corp={props.corp}\n division={props.division}\n office={props.office}\n player={props.player}\n />\n ) : (\n <AutoManagement\n rerender={props.rerender}\n corp={props.corp}\n division={props.division}\n office={props.office}\n player={props.player}\n />\n )}\n </div>\n );\n}\n","import React from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { UpgradeOfficeSize } from \"../Actions\";\n\ninterface IProps {\n office: OfficeSpace;\n corp: ICorporation;\n popupId: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function UpgradeOfficeSizePopup(props: IProps): React.ReactElement {\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 = props.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 function upgradeSize(cost: number, size: number): void {\n if (props.corp.funds.lt(cost)) {\n dialogBoxCreate(\"You don't have enough company funds to purchase this upgrade!\");\n } else {\n UpgradeOfficeSize(props.corp, props.office, size);\n dialogBoxCreate(\"Office space increased! It can now hold \" + props.office.size + \" employees\");\n props.rerender();\n }\n removePopup(props.popupId);\n }\n\n interface IUpgradeButton {\n cost: number;\n size: number;\n corp: ICorporation;\n }\n\n function UpgradeSizeButton(props: IUpgradeButton): React.ReactElement {\n return (\n <button\n className={\"tooltip \" + (props.corp.funds.lt(props.cost) ? \"a-link-button-inactive\" : \"a-link-button\")}\n style={{ display: \"inline-block\", margin: \"4px\" }}\n onClick={() => upgradeSize(props.cost, props.size)}\n >\n by {props.size}\n <span className=\"tooltiptext\">{numeralWrapper.formatMoney(props.cost)}</span>\n </button>\n );\n }\n\n return (\n <>\n <p>Increase the size of your office space to fit additional employees!</p>\n <p>Upgrade size: </p>\n <UpgradeSizeButton corp={props.corp} cost={upgradeCost} size={CorporationConstants.OfficeInitialSize} />\n <UpgradeSizeButton corp={props.corp} cost={upgradeCost15} size={CorporationConstants.OfficeInitialSize * 5} />\n <UpgradeSizeButton\n corp={props.corp}\n cost={upgradeCostMax}\n size={maxNum * CorporationConstants.OfficeInitialSize}\n />\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { createPopup, removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getRandomInt } from \"../../../utils/helpers/getRandomInt\";\nimport { formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { Employee } from \"../Employee\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\n\ninterface INameEmployeeProps {\n office: OfficeSpace;\n corp: ICorporation;\n popupId: string;\n employee: Employee;\n player: IPlayer;\n rerender: () => void;\n}\n\nfunction NameEmployeePopup(props: INameEmployeeProps): React.ReactElement {\n const [name, setName] = useState(\"\");\n function nameEmployee(): void {\n for (let i = 0; i < props.office.employees.length; ++i) {\n if (props.office.employees[i].name === name) {\n dialogBoxCreate(\"You already have an employee with this nickname!\");\n return;\n }\n }\n props.employee.name = name;\n props.office.employees.push(props.employee);\n props.rerender();\n removePopup(props.popupId);\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) nameEmployee();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setName(event.target.value);\n }\n\n return (\n <>\n <p>Give your employee a nickname!</p>\n <input\n value={name}\n className=\"text-input\"\n type=\"text\"\n placeholder=\"Employee nickname\"\n onKeyDown={onKeyDown}\n onChange={onChange}\n />\n <button className=\"std-button\" onClick={nameEmployee}>\n Hire!\n </button>\n </>\n );\n}\n\ninterface IHireEmployeeProps {\n employee: Employee;\n office: OfficeSpace;\n popupId: string;\n player: IPlayer;\n corp: ICorporation;\n rerender: () => void;\n}\n\nfunction HireEmployeeButton(props: IHireEmployeeProps): React.ReactElement {\n function hire(): void {\n const popupId = \"cmpy-mgmt-name-employee-popup\";\n createPopup(popupId, NameEmployeePopup, {\n rerender: props.rerender,\n office: props.office,\n corp: props.corp,\n popupId: popupId,\n player: props.player,\n employee: props.employee,\n });\n removePopup(props.popupId);\n }\n\n return (\n <div onClick={hire} className=\"cmpy-mgmt-find-employee-option\">\n Intelligence: {formatNumber(props.employee.int, 1)}\n <br />\n Charisma: {formatNumber(props.employee.cha, 1)}\n <br />\n Experience: {formatNumber(props.employee.exp, 1)}\n <br />\n Creativity: {formatNumber(props.employee.cre, 1)}\n <br />\n Efficiency: {formatNumber(props.employee.eff, 1)}\n <br />\n Salary: {numeralWrapper.formatMoney(props.employee.sal)} \\ s<br />\n </div>\n );\n}\n\ninterface IProps {\n office: OfficeSpace;\n corp: ICorporation;\n popupId: string;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function HireEmployeePopup(props: IProps): React.ReactElement {\n if (props.office.atCapacity()) return <></>;\n\n //Generate three random employees (meh, decent, amazing)\n const mult1 = getRandomInt(25, 50) / 100;\n const mult2 = getRandomInt(51, 75) / 100;\n const mult3 = getRandomInt(76, 100) / 100;\n const int = getRandomInt(50, 100);\n const cha = getRandomInt(50, 100);\n const exp = getRandomInt(50, 100);\n const cre = getRandomInt(50, 100);\n const eff = getRandomInt(50, 100);\n const sal = CorporationConstants.EmployeeSalaryMultiplier * (int + cha + exp + cre + eff);\n\n const emp1 = new Employee({\n intelligence: int * mult1,\n charisma: cha * mult1,\n experience: exp * mult1,\n creativity: cre * mult1,\n efficiency: eff * mult1,\n salary: sal * mult1,\n });\n\n const emp2 = new Employee({\n intelligence: int * mult2,\n charisma: cha * mult2,\n experience: exp * mult2,\n creativity: cre * mult2,\n efficiency: eff * mult2,\n salary: sal * mult2,\n });\n\n const emp3 = new Employee({\n intelligence: int * mult3,\n charisma: cha * mult3,\n experience: exp * mult3,\n creativity: cre * mult3,\n efficiency: eff * mult3,\n salary: sal * mult3,\n });\n\n return (\n <>\n <h1>Select one of the following candidates for hire:</h1>\n <HireEmployeeButton\n rerender={props.rerender}\n employee={emp1}\n office={props.office}\n corp={props.corp}\n popupId={props.popupId}\n player={props.player}\n />\n <HireEmployeeButton\n rerender={props.rerender}\n employee={emp2}\n office={props.office}\n corp={props.corp}\n popupId={props.popupId}\n player={props.player}\n />\n <HireEmployeeButton\n rerender={props.rerender}\n employee={emp3}\n office={props.office}\n corp={props.corp}\n popupId={props.popupId}\n player={props.player}\n />\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { ICorporation } from \"../ICorporation\";\nimport { ThrowParty } from \"../Actions\";\n\ninterface IProps {\n office: OfficeSpace;\n corp: ICorporation;\n popupId: string;\n}\n\nexport function ThrowPartyPopup(props: IProps): React.ReactElement {\n const [cost, setCost] = useState<number | null>(null);\n\n function changeCost(event: React.ChangeEvent<HTMLInputElement>): void {\n setCost(parseFloat(event.target.value));\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else {\n const totalCost = cost * props.office.employees.length;\n if (props.corp.funds.lt(totalCost)) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(props.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 removePopup(props.popupId);\n }\n }\n }\n\n function EffectText(props: { cost: number | null; office: OfficeSpace }): React.ReactElement {\n let cost = props.cost;\n if (cost !== null && (isNaN(cost) || cost < 0)) return <p>Invalid value entered!</p>;\n if (cost === null) cost = 0;\n return (\n <p>Throwing this party will cost a total of {numeralWrapper.formatMoney(cost * props.office.employees.length)}</p>\n );\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) throwParty();\n }\n\n return (\n <>\n <p>Enter the amount of money you would like to spend PER EMPLOYEE on this office party</p>\n <EffectText cost={cost} office={props.office} />\n <input\n autoFocus={true}\n className=\"text-input\"\n type=\"number\"\n style={{ margin: \"5px\" }}\n placeholder=\"$ / employee\"\n onChange={changeCost}\n onKeyDown={onKeyDown}\n />\n <button className=\"std-button\" onClick={throwParty}>\n Throw Party\n </button>\n </>\n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industries } from \"../IndustryData\";\nimport { IndustryUpgrades } from \"../IndustryUpgrades\";\nimport { IIndustry } from \"../IIndustry\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { createProgressBarText } from \"../../../utils/helpers/createProgressBarText\";\nimport { MakeProductPopup } from \"./MakeProductPopup\";\nimport { ResearchPopup } from \"./ResearchPopup\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { Money } from \"../../ui/React/Money\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MoneyCost } from \"./MoneyCost\";\n\ninterface IProps {\n corp: ICorporation;\n currentCity: string;\n division: IIndustry;\n office: OfficeSpace;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n function renderMakeProductButton(): React.ReactElement {\n let createProductButtonText = \"\";\n let createProductPopupText = \"\";\n switch (props.division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n createProductPopupText = \"Build and manage a new restaurant!\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n createProductPopupText = \"Create a new tobacco product!\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n createProductPopupText = \"Design and develop a new pharmaceutical drug!\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n createProductPopupText = \"Design and manufacture a new computer hardware product!\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n createProductPopupText = \"Design and create a new robot or robotic system!\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n createProductPopupText = \"Develop a new piece of software!\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n createProductPopupText = \"Build and manage a new hospital!\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n createProductPopupText = \"Develop a new piece of real estate property!\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n createProductPopupText = \"Create a new product!\";\n return <></>;\n }\n createProductPopupText +=\n \"<br><br>To begin developing a product, \" +\n \"first choose the city in which it will be designed. The stats of your employees \" +\n \"in the selected city affect the properties of the finished product, such as its \" +\n \"quality, performance, and durability.<br><br>\" +\n \"You can also choose to invest money in the design and marketing of \" +\n \"the product. Investing money in its design will result in a superior product. \" +\n \"Investing money in marketing the product will help the product's sales.\";\n\n const hasMaxProducts = props.division.hasMaximumNumberProducts();\n\n const className = hasMaxProducts ? \"a-link-button-inactive tooltip\" : \"std-button\";\n const buttonStyle = {\n margin: \"6px\",\n display: \"inline-block\",\n };\n\n function openMakeProductPopup(): void {\n const popupId = \"cmpy-mgmt-create-product-popup\";\n createPopup(popupId, MakeProductPopup, {\n popupText: createProductPopupText,\n division: props.division,\n corp: props.corp,\n popupId: popupId,\n });\n }\n\n function shouldFlash(): boolean {\n return Object.keys(props.division.products).length === 0;\n }\n\n return (\n <button\n className={className + (shouldFlash() ? \" flashing-button\" : \"\")}\n onClick={openMakeProductPopup}\n style={buttonStyle}\n disabled={props.corp.funds.lt(0)}\n >\n {createProductButtonText}\n {hasMaxProducts && (\n <span className={\"tooltiptext\"}>\n You have reached the maximum number of products: {props.division.getMaximumNumberProducts()}\n </span>\n )}\n </button>\n );\n }\n\n function renderText(): React.ReactElement {\n const vechain = props.corp.unlockUpgrades[4] === 1;\n const profit = props.division.lastCycleRevenue.minus(props.division.lastCycleExpenses).toNumber();\n\n let advertisingInfo = false;\n const advertisingFactors = props.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 productionMultHelpTipOnClick(): void {\n // Wrapper for createProgressBarText()\n // Converts the industry's \"effectiveness factors\"\n // into a graphic (string) depicting how high that effectiveness is\n function convertEffectFacToGraphic(fac: number): string {\n return createProgressBarText({\n progress: fac,\n totalTicks: 20,\n });\n }\n\n dialogBoxCreate(\n \"Owning Hardware, Robots, AI Cores, and Real Estate \" +\n \"can boost your Industry's production. The effect these \" +\n \"materials have on your production varies between Industries. \" +\n \"For example, Real Estate may be very effective for some Industries, \" +\n \"but ineffective for others.<br><br>\" +\n \"This division's production multiplier is calculated by summing \" +\n \"the individual production multiplier of each of its office locations. \" +\n \"This production multiplier is applied to each office. Therefore, it is \" +\n \"beneficial to expand into new cities as this can greatly increase the \" +\n \"production multiplier of your entire Division.<br><br>\" +\n \"Below are approximations for how effective each material is at boosting \" +\n \"this industry's production multiplier (Bigger bars = more effective):<br><br>\" +\n `Hardware:&nbsp;&nbsp;&nbsp; ${convertEffectFacToGraphic(props.division.hwFac)}<br>` +\n `Robots:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${convertEffectFacToGraphic(props.division.robFac)}<br>` +\n `AI Cores:&nbsp;&nbsp;&nbsp; ${convertEffectFacToGraphic(props.division.aiFac)}<br>` +\n `Real Estate: ${convertEffectFacToGraphic(props.division.reFac)}`,\n );\n }\n\n function openResearchPopup(): void {\n const popupId = \"corporation-research-popup-box\";\n createPopup(popupId, ResearchPopup, {\n industry: props.division,\n popupId: popupId,\n });\n }\n\n return (\n <div>\n Industry: {props.division.type} (Corp Funds: <Money money={props.corp.funds.toNumber()} />)\n <br /> <br />\n Awareness: {numeralWrapper.format(props.division.awareness, \"0.000\")} <br />\n Popularity: {numeralWrapper.format(props.division.popularity, \"0.000\")} <br />\n {advertisingInfo !== false && (\n <p className={\"tooltip\"}>\n Advertising Multiplier: x{numeralWrapper.format(totalAdvertisingFac, \"0.000\")}\n <span className={\"tooltiptext cmpy-mgmt-advertising-info\"}>\n Total multiplier for this industrys sales due to its awareness and popularity\n <br />\n Awareness Bonus: x{numeralWrapper.format(Math.pow(awarenessFac, 0.85), \"0.000\")}\n <br />\n Popularity Bonus: x{numeralWrapper.format(Math.pow(popularityFac, 0.85), \"0.000\")}\n <br />\n Ratio Multiplier: x{numeralWrapper.format(Math.pow(ratioFac, 0.85), \"0.000\")}\n </span>\n </p>\n )}\n {advertisingInfo}\n <br />\n <br />\n <table>\n <tbody>\n <tr>\n <td>\n <p>Revenue: </p>\n </td>\n <td>\n <p>\n <Money money={props.division.lastCycleRevenue.toNumber()} /> / s\n </p>\n </td>\n </tr>\n <tr>\n <td>\n <p>Expenses: </p>\n </td>\n <td>\n <p>\n <Money money={props.division.lastCycleExpenses.toNumber()} /> / s\n </p>\n </td>\n </tr>\n <tr>\n <td>\n <p>Profit: </p>\n </td>\n <td>\n <p>\n <Money money={profit} /> / s\n </p>\n </td>\n </tr>\n </tbody>\n </table>\n <br />\n <p className={\"tooltip\"}>\n Production Multiplier: {numeralWrapper.format(props.division.prodMult, \"0.00\")}\n <span className={\"tooltiptext\"}>\n Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real\n Estate\n </span>\n </p>\n <div className={\"help-tip\"} onClick={productionMultHelpTipOnClick}>\n ?\n </div>\n <br /> <br />\n <p className={\"tooltip\"}>\n Scientific Research: {numeralWrapper.format(props.division.sciResearch.qty, \"0.000a\")}\n <span className={\"tooltiptext\"}>\n Scientific Research increases the quality of the materials and products that you produce.\n </span>\n </p>\n <button className={\"help-tip\"} onClick={openResearchPopup}>\n Research\n </button>\n </div>\n );\n }\n\n function renderUpgrades(): React.ReactElement[] {\n const upgrades = [];\n for (const index in IndustryUpgrades) {\n const upgrade = IndustryUpgrades[index];\n\n // AutoBrew research disables the Coffee upgrade\n if (props.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, props.division.upgrades[i]);\n break;\n }\n\n function onClick(): void {\n if (props.corp.funds.lt(cost)) return;\n props.corp.funds = props.corp.funds.minus(cost);\n props.division.upgrade(upgrade, {\n corporation: props.corp,\n office: props.office,\n });\n props.rerender();\n }\n\n upgrades.push(\n renderUpgrade({\n key: index,\n onClick: onClick,\n text: (\n <>\n {upgrade[4]} - <MoneyCost money={cost} corp={props.corp} />\n </>\n ),\n tooltip: upgrade[5],\n }),\n );\n }\n\n return upgrades;\n }\n\n interface IRenderUpgradeProps {\n key: string;\n onClick: () => void;\n text: JSX.Element;\n tooltip: string;\n }\n\n function renderUpgrade(props: IRenderUpgradeProps): React.ReactElement {\n return (\n <div className={\"cmpy-mgmt-upgrade-div tooltip\"} onClick={props.onClick} key={props.key}>\n {props.text}\n {props.tooltip != null && <span className={\"tooltiptext\"}>{props.tooltip}</span>}\n </div>\n );\n }\n\n const makeProductButton = renderMakeProductButton();\n\n return (\n <div className={\"cmpy-mgmt-industry-overview-panel\"}>\n {renderText()}\n <br />\n <u className={\"industry-purchases-and-upgrades-header\"}>Purchases & Upgrades</u>\n <br />\n {renderUpgrades()} <br />\n {props.division.makesProducts && makeProductButton}\n </div>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { Industries } from \"../IndustryData\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MakeProduct } from \"../Actions\";\n\ninterface IProps {\n popupText: string;\n division: IIndustry;\n corp: ICorporation;\n popupId: string;\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 MakeProductPopup(props: IProps): React.ReactElement {\n const allCities = Object.keys(props.division.offices).filter(\n (cityName: string) => props.division.offices[cityName] !== 0,\n );\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 (props.division.hasMaximumNumberProducts()) return <></>;\n\n function makeProduct(): void {\n if (design === null || marketing === null) return;\n try {\n MakeProduct(props.corp, props.division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n removePopup(props.popupId);\n }\n\n function onCityChange(event: React.ChangeEvent<HTMLSelectElement>): 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 <>\n <p dangerouslySetInnerHTML={{ __html: props.popupText }} />\n <select className=\"dropdown\" style={{ margin: \"5px\" }} onChange={onCityChange} defaultValue={city}>\n {allCities.map((cityName: string) => (\n <option key={cityName} value={cityName}>\n {cityName}\n </option>\n ))}\n </select>\n <input\n onChange={onProductNameChange}\n className=\"text-input\"\n style={{ margin: \"5px\" }}\n placeholder={productPlaceholder(props.division.type)}\n />\n <br />\n <input\n onChange={onDesignChange}\n autoFocus={true}\n type=\"number\"\n className=\"text-input\"\n style={{ margin: \"5px\" }}\n placeholder={\"Design investment\"}\n />\n <input\n onChange={onMarketingChange}\n onKeyDown={onKeyDown}\n type=\"number\"\n className=\"text-input\"\n style={{ margin: \"5px\" }}\n placeholder={\"Marketing investment\"}\n />\n <button className=\"std-button\" onClick={makeProduct}>\n Develop Product\n </button>\n </>\n );\n}\n","import React, { useEffect } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { IndustryResearchTrees } from \"../IndustryData\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Treant } from \"treant-js\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Research } from \"../Actions\";\n\ninterface IProps {\n industry: IIndustry;\n popupId: string;\n}\n\n// Create the Research Tree UI for this Industry\nexport function ResearchPopup(props: IProps): React.ReactElement {\n const researchTree = IndustryResearchTrees[props.industry.type];\n if (researchTree === undefined) return <></>;\n useEffect(() => {\n {\n const boxContent = document.getElementById(`${props.popupId}-content`);\n if (boxContent != null) {\n boxContent.style.minHeight = \"80vh\";\n }\n }\n\n // Get the tree's markup (i.e. config) for Treant\n const markup = researchTree.createTreantMarkup();\n markup.chart.container = \"#\" + props.popupId + \"-content\";\n markup.chart.nodeAlign = \"BOTTOM\";\n markup.chart.rootOrientation = \"WEST\";\n markup.chart.siblingSeparation = 40;\n markup.chart.connectors = {\n type: \"step\",\n style: {\n \"arrow-end\": \"block-wide-long\",\n stroke: \"white\",\n \"stroke-width\": 2,\n },\n };\n\n Treant(markup);\n\n // Add Event Listeners for all Nodes\n const allResearch = researchTree.getAllNodes();\n for (let i = 0; i < allResearch.length; ++i) {\n // If this is already Researched, skip it\n if (props.industry.researched[allResearch[i]] === true) {\n continue;\n }\n\n // Get the DOM Element to add a click listener to it\n const sanitizedName = allResearch[i].replace(/\\s/g, \"\");\n const div = document.getElementById(sanitizedName + \"-corp-research-click-listener\");\n if (div == null) {\n console.warn(`Could not find Research Tree div for ${sanitizedName}`);\n continue;\n }\n\n div.addEventListener(\"click\", () => {\n try {\n Research(props.industry, allResearch[i]);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(\n `Researched ${allResearch[i]}. It may take a market cycle ` +\n `(~${CorporationConstants.SecsPerMarketCycle} seconds) before the effects of ` +\n `the Research apply.`,\n );\n removePopup(props.popupId);\n });\n }\n });\n\n return (\n <div id={props.popupId}>\n <div>\n Research points: {props.industry.sciResearch.qty}\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 </div>\n </div>\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Material } from \"../Material\";\nimport { Product } from \"../Product\";\nimport { Warehouse } from \"../Warehouse\";\nimport { DiscontinueProductPopup } from \"./DiscontinueProductPopup\";\nimport { ExportPopup } from \"./ExportPopup\";\nimport { LimitProductProductionPopup } from \"./LimitProductProductionPopup\";\nimport { MaterialMarketTaPopup } from \"./MaterialMarketTaPopup\";\nimport { SellMaterialPopup } from \"./SellMaterialPopup\";\nimport { SellProductPopup } from \"./SellProductPopup\";\nimport { PurchaseMaterialPopup } from \"./PurchaseMaterialPopup\";\nimport { ProductMarketTaPopup } from \"./ProductMarketTaPopup\";\nimport { SmartSupplyPopup } from \"./SmartSupplyPopup\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createPopup } from \"../../ui/React/createPopup\";\n\nimport { isString } from \"../../../utils/helpers/isString\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\n\ninterface IProductProps {\n corp: ICorporation;\n division: IIndustry;\n city: string;\n product: Product;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nfunction ProductComponent(props: IProductProps): React.ReactElement {\n const corp = props.corp;\n const division = props.division;\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 function openSellProductPopup(): void {\n const popupId = \"cmpy-mgmt-limit-product-production-popup\";\n createPopup(popupId, SellProductPopup, {\n product: product,\n city: city,\n popupId: popupId,\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 function openLimitProductProdutionPopup(): void {\n const popupId = \"cmpy-mgmt-limit-product-production-popup\";\n createPopup(popupId, LimitProductProductionPopup, {\n product: product,\n city: city,\n popupId: popupId,\n });\n }\n\n function openDiscontinueProductPopup(): void {\n const popupId = \"cmpy-mgmt-discontinue-product-popup\";\n createPopup(popupId, DiscontinueProductPopup, {\n rerender: props.rerender,\n product: product,\n industry: division,\n corp: props.corp,\n popupId: popupId,\n player: props.player,\n });\n }\n\n function openProductMarketTaPopup(): void {\n const popupId = \"cmpy-mgmt-marketta-popup\";\n createPopup(popupId, ProductMarketTaPopup, {\n product: product,\n industry: division,\n popupId: popupId,\n });\n }\n\n // Unfinished Product\n if (!product.fin) {\n return (\n <div className={\"cmpy-mgmt-warehouse-product-div\"}>\n <p>\n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n </p>\n <br />\n <p>{numeralWrapper.format(product.prog, \"0.00\")}% complete</p>\n <br />\n\n {hasUpgradeDashboard && (\n <div>\n <button className={\"std-button\"} onClick={openSellProductPopup}>\n {sellButtonText}\n </button>\n <br />\n <button className={\"std-button\"} onClick={openLimitProductProdutionPopup}>\n {limitProductionButtonText}\n </button>\n <button className={\"std-button\"} onClick={openDiscontinueProductPopup}>\n Discontinue\n </button>\n {division.hasResearch(\"Market-TA.I\") && (\n <button className={\"std-button\"} onClick={openProductMarketTaPopup}>\n Market-TA\n </button>\n )}\n </div>\n )}\n </div>\n );\n }\n\n return (\n <div className={\"cmpy-mgmt-warehouse-product-div\"}>\n <p className={\"tooltip\"}>\n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n <span className={\"tooltiptext\"}>\n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n <br />\n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n </span>\n </p>\n <br />\n <p className={\"tooltip\"}>\n Rating: {numeralWrapper.format(product.rat, nf)}\n <span className={\"tooltiptext\"}>\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 </span>\n </p>\n <br />\n <p className={\"tooltip\"}>\n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n <span className={\"tooltiptext\"}>An estimate of the material cost it takes to create this Product.</span>\n </p>\n <br />\n <p className={\"tooltip\"}>\n Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}\n <span className={\"tooltiptext\"}>\n An estimate of how much consumers are willing to pay for this product. Setting the sale price above this may\n result in less sales. Setting the sale price below this may result in more sales.\n </span>\n </p>\n\n <div>\n <button className={\"std-button\"} onClick={openSellProductPopup}>\n {sellButtonText}\n </button>\n <br />\n <button className={\"std-button\"} onClick={openLimitProductProdutionPopup}>\n {limitProductionButtonText}\n </button>\n <button className={\"std-button\"} onClick={openDiscontinueProductPopup}>\n Discontinue\n </button>\n {division.hasResearch(\"Market-TA.I\") && (\n <button className={\"std-button\"} onClick={openProductMarketTaPopup}>\n Market-TA\n </button>\n )}\n </div>\n </div>\n );\n}\n\ninterface IMaterialProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nfunction MaterialComponent(props: IMaterialProps): React.ReactElement {\n const corp = props.corp;\n const division = props.division;\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 const purchaseButtonClass = tutorial ? \"std-button flashing-button tooltip\" : \"std-button\";\n\n function openPurchaseMaterialPopup(): void {\n const popupId = \"cmpy-mgmt-material-purchase-popup\";\n createPopup(popupId, PurchaseMaterialPopup, {\n mat: mat,\n industry: division,\n warehouse: warehouse,\n corp: props.corp,\n popupId: popupId,\n });\n }\n\n function openExportPopup(): void {\n const popupId = \"cmpy-mgmt-export-popup\";\n createPopup(popupId, ExportPopup, {\n mat: mat,\n corp: props.corp,\n popupId: popupId,\n });\n }\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 function openSellMaterialPopup(): void {\n const popupId = \"cmpy-mgmt-material-sell-popup\";\n createPopup(popupId, SellMaterialPopup, {\n mat: mat,\n corp: props.corp,\n popupId: popupId,\n });\n }\n\n function openMaterialMarketTaPopup(): void {\n const popupId = \"cmpy-mgmt-export-popup\";\n createPopup(popupId, MaterialMarketTaPopup, {\n mat: mat,\n industry: division,\n corp: props.corp,\n popupId: popupId,\n });\n }\n\n function shouldFlash(): boolean {\n return props.division.prodMats.includes(props.mat.name) && !mat.sllman[0];\n }\n\n return (\n <div className={\"cmpy-mgmt-warehouse-material-div\"}>\n <div style={{ display: \"inline-block\" }}>\n <p className={\"tooltip\"}>\n {mat.name}: {numeralWrapper.format(mat.qty, nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n <span className={\"tooltiptext\"}>\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 </span>\n </p>\n <br />\n <p className={\"tooltip\"}>\n MP: {numeralWrapper.formatMoney(mat.bCost)}\n <span className={\"tooltiptext\"}>\n Market Price: The price you would pay if you were to buy this material on the market\n </span>\n </p>{\" \"}\n <br />\n <p className={\"tooltip\"}>\n Quality: {numeralWrapper.format(mat.qlt, \"0.00a\")}\n <span className={\"tooltiptext\"}>The quality of your material. Higher quality will lead to more sales</span>\n </p>\n </div>\n\n <div style={{ display: \"inline-block\" }}>\n <button\n className={purchaseButtonClass}\n onClick={openPurchaseMaterialPopup}\n disabled={props.warehouse.smartSupplyEnabled && Object.keys(props.division.reqMats).includes(props.mat.name)}\n >\n {purchaseButtonText}\n {tutorial && (\n <span className={\"tooltiptext\"}>Purchase your required materials to get production started!</span>\n )}\n </button>\n\n {corp.unlockUpgrades[0] === 1 && (\n <button className={\"std-button\"} onClick={openExportPopup}>\n Export\n </button>\n )}\n <br />\n\n <button className={`std-button${shouldFlash() ? \" flashing-button\" : \"\"}`} onClick={openSellMaterialPopup}>\n {sellButtonText}\n </button>\n\n {division.hasResearch(\"Market-TA.I\") && (\n <button className={\"std-button\"} onClick={openMaterialMarketTaPopup}>\n Market-TA\n </button>\n )}\n </div>\n </div>\n );\n}\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n function renderWarehouseUI(): React.ReactElement {\n if (props.warehouse === 0) return <></>;\n // General Storage information at the top\n const sizeUsageStyle = {\n color: props.warehouse.sizeUsed >= props.warehouse.size ? \"red\" : \"white\",\n margin: \"5px\",\n };\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = props.corp.funds.gt(sizeUpgradeCost);\n const upgradeWarehouseClass = canAffordUpgrade ? \"std-button\" : \"a-link-button-inactive\";\n function upgradeWarehouseOnClick(): void {\n if (props.division === null) return;\n if (props.warehouse === 0) return;\n ++props.warehouse.level;\n props.warehouse.updateSize(props.corp, props.division);\n props.corp.funds = props.corp.funds.minus(sizeUpgradeCost);\n props.rerender();\n }\n\n function openSmartSupplyPopup(): void {\n if (props.warehouse === 0) return;\n const popupId = \"cmpy-mgmt-smart-supply-popup\";\n createPopup(popupId, SmartSupplyPopup, {\n division: props.division,\n warehouse: props.warehouse,\n corp: props.corp,\n player: props.player,\n popupId: popupId,\n });\n }\n\n const ratioLines = [];\n for (const matName in props.division.reqMats) {\n if (props.division.reqMats.hasOwnProperty(matName)) {\n const text = [\" *\", props.division.reqMats[matName], matName].join(\" \");\n ratioLines.push(\n <div key={matName}>\n <p>{text}</p>\n </div>,\n );\n }\n }\n\n // Current State:\n let stateText;\n switch (props.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: ${props.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) {\n // Only create UI for materials that are relevant for the industry\n if (isRelevantMaterial(matName, props.division)) {\n mats.push(\n <MaterialComponent\n rerender={props.rerender}\n city={props.currentCity}\n corp={props.corp}\n division={props.division}\n key={matName}\n mat={props.warehouse.materials[matName]}\n warehouse={props.warehouse}\n />,\n );\n }\n }\n }\n\n // Create React components for products\n const products = [];\n if (props.division.makesProducts && Object.keys(props.division.products).length > 0) {\n for (const productName in props.division.products) {\n const product = props.division.products[productName];\n if (product instanceof Product) {\n products.push(\n <ProductComponent\n rerender={props.rerender}\n player={props.player}\n city={props.currentCity}\n corp={props.corp}\n division={props.division}\n key={productName}\n product={product}\n />,\n );\n }\n }\n }\n\n return (\n <div className={\"cmpy-mgmt-warehouse-panel\"}>\n <p className={\"tooltip\"} style={sizeUsageStyle}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n <span className={\"tooltiptext\"} dangerouslySetInnerHTML={{ __html: props.warehouse.breakdown }}></span>\n </p>\n\n <button className={upgradeWarehouseClass} onClick={upgradeWarehouseOnClick}>\n Upgrade Warehouse Size - <MoneyCost money={sizeUpgradeCost} corp={props.corp} />\n </button>\n\n <p>This industry uses the following equation for it's production: </p>\n <br />\n <br />\n <IndustryProductEquation division={props.division} />\n <br />\n <br />\n <p>\n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n </p>\n <br />\n\n <p>{stateText}</p>\n\n {props.corp.unlockUpgrades[1] && (\n <>\n <button className=\"std-button\" onClick={openSmartSupplyPopup}>\n Configure Smart Supply\n </button>\n </>\n )}\n\n {mats}\n\n {products}\n </div>\n );\n }\n\n function purchaseWarehouse(division: IIndustry, city: string): void {\n PurchaseWarehouse(props.corp, division, city);\n props.rerender();\n }\n\n if (props.warehouse instanceof Warehouse) {\n return renderWarehouseUI();\n } else {\n return (\n <div className={\"cmpy-mgmt-warehouse-panel\"}>\n <button\n className={\"std-button\"}\n onClick={() => purchaseWarehouse(props.division, props.currentCity)}\n disabled={props.corp.funds.lt(CorporationConstants.WarehouseInitialCost)}\n >\n Purchase Warehouse (\n <MoneyCost money={CorporationConstants.WarehouseInitialCost} corp={props.corp} />)\n </button>\n </div>\n );\n }\n}\n","import React from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Product } from \"../Product\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n product: Product;\n industry: IIndustry;\n corp: ICorporation;\n popupId: string;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductPopup(props: IProps): React.ReactElement {\n function discontinue(): void {\n props.industry.discontinueProduct(props.product);\n removePopup(props.popupId);\n props.rerender();\n }\n\n return (\n <>\n <p>\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 </p>\n <button className=\"popup-box-button\" onClick={discontinue}>\n Discontinue\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Material } from \"../Material\";\nimport { Export } from \"../Export\";\nimport { IIndustry } from \"../IIndustry\";\nimport { ExportMaterial } from \"../Actions\";\n\ninterface IProps {\n mat: Material;\n corp: ICorporation;\n popupId: string;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportPopup(props: IProps): React.ReactElement {\n if (props.corp.divisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n if (Object.keys(props.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>(props.corp.divisions[0].name);\n const [city, setCity] = useState<string>(Object.keys(props.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: React.ChangeEvent<HTMLSelectElement>): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: React.ChangeEvent<HTMLSelectElement>): 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 removePopup(props.popupId);\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 = props.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 <>\n <p>\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 </p>\n <select className=\"dropdown\" onChange={onIndustryChange} defaultValue={industry}>\n {props.corp.divisions.map((division: IIndustry) => (\n <option key={division.name} value={division.name}>\n {division.name}\n </option>\n ))}\n </select>\n <select className=\"dropdown\" onChange={onCityChange} defaultValue={city}>\n {possibleCities.map((cityName: string) => {\n if (currentDivision.warehouses[cityName] === 0) return;\n return (\n <option key={cityName} value={cityName}>\n {cityName}\n </option>\n );\n })}\n </select>\n <input className=\"text-input\" placeholder=\"Export amount / s\" onChange={onAmtChange} />\n <button className=\"std-button\" style={{ display: \"inline-block\" }} onClick={exportMaterial}>\n Export\n </button>\n <p>\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 </p>\n {props.mat.exp.map((exp: Export, index: number) => (\n <div key={index} className=\"cmpy-mgmt-existing-export\" onClick={() => removeExport(exp)}>\n Industry: {exp.ind}\n <br />\n City: {exp.city}\n <br />\n Amount/s: {exp.amt}\n </div>\n ))}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { Product } from \"../Product\";\nimport { LimitProductProduction } from \"../Actions\";\n\ninterface IProps {\n product: Product;\n city: string;\n popupId: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionPopup(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 removePopup(props.popupId);\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 <>\n <p>\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 </p>\n <input\n autoFocus={true}\n className=\"text-input\"\n style={{ margin: \"5px\" }}\n placeholder=\"Limit\"\n type=\"number\"\n onChange={onChange}\n onKeyDown={onKeyDown}\n />\n <button\n className=\"std-button\"\n style={{ margin: \"5px\", display: \"inline-block\" }}\n onClick={limitProductProduction}\n >\n Limit production\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IIndustry } from \"../IIndustry\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Material } from \"../Material\";\n\ninterface IMarketTA2Props {\n industry: IIndustry;\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n if (!props.industry.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 <p>\n <br />\n <u>\n <strong>Market-TA.II</strong>\n </u>\n <br />\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 </p>\n <input className=\"text-input\" type=\"number\" style={{ marginTop: \"4px\" }} onChange={onChange} value={newCost} />\n <div style={{ display: \"block\" }}>\n <label className=\"tooltip\" htmlFor=\"cmpy-mgmt-marketa2-checkbox\" style={{ color: \"white\" }}>\n Use Market-TA.II for Auto-Sale Price\n <span className=\"tooltiptext\">\n If this is enabled, then this Material will automatically be sold at the optimal price such that the amount\n sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced\n materials will be sold)\n </span>\n </label>\n <input\n id=\"cmpy-mgmt-marketa2-checkbox\"\n type=\"checkbox\"\n onChange={onMarketTA2}\n checked={props.mat.marketTa2}\n style={{ margin: \"3px\" }}\n />\n </div>\n <p>\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 </p>\n </>\n );\n}\n\ninterface IProps {\n mat: Material;\n industry: IIndustry;\n corp: ICorporation;\n popupId: string;\n}\n\n// Create a popup that lets the player use the Market TA research for Materials\nexport function MaterialMarketTaPopup(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 <>\n <p>\n <u>\n <strong>Market-TA.I</strong>\n </u>\n <br />\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 </p>\n <div style={{ display: \"block\" }}>\n <label className=\"tooltip\" htmlFor=\"cmpy-mgmt-marketa1-checkbox\" style={{ color: \"white\" }}>\n Use Market-TA.I for Auto-Sale Price\n <span className=\"tooltiptext\">\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 </span>\n </label>\n <input\n id=\"cmpy-mgmt-marketa1-checkbox\"\n type=\"checkbox\"\n onChange={onMarketTA1}\n checked={props.mat.marketTa1}\n style={{ margin: \"3px\" }}\n />\n </div>\n <MarketTA2 mat={props.mat} industry={props.industry} />\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Material } from \"../Material\";\nimport { SellMaterial } from \"../Actions\";\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 mat: Material;\n corp: ICorporation;\n popupId: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialPopup(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\n removePopup(props.popupId);\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 <>\n <p>\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 </p>\n <br />\n <input\n className=\"text-input\"\n value={amt}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n style={{ marginTop: \"4px\" }}\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <input\n className=\"text-input\"\n value={price}\n type=\"text\"\n placeholder=\"Sell price\"\n style={{ marginTop: \"4px\" }}\n onChange={onPriceChange}\n onKeyDown={onKeyDown}\n />\n <button className=\"std-button\" onClick={sellMaterial}>\n Confirm\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { Product } from \"../Product\";\nimport { SellProduct } from \"../Actions\";\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 product: Product;\n city: string;\n popupId: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductPopup(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 removePopup(props.popupId);\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 <>\n <p>\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 </p>\n <br />\n <input\n className=\"text-input\"\n value={iQty}\n autoFocus={true}\n type=\"text\"\n placeholder=\"Sell amount\"\n style={{ marginTop: \"4px\" }}\n onChange={onAmtChange}\n onKeyDown={onKeyDown}\n />\n <input\n className=\"text-input\"\n value={px}\n type=\"text\"\n placeholder=\"Sell price\"\n style={{ marginTop: \"4px\" }}\n onChange={onPriceChange}\n onKeyDown={onKeyDown}\n />\n <button className=\"std-button\" onClick={sellProduct}>\n Confirm\n </button>\n <div style={{ border: \"1px solid white\", display: \"inline-block\" }}>\n <label htmlFor={props.popupId + \"-checkbox\"}>Use same 'Sell Amount' for all cities</label>\n <input\n checked={checked}\n onChange={onCheckedChange}\n id={props.popupId + \"-checkbox\"}\n style={{ margin: \"2px\" }}\n type=\"checkbox\"\n />\n </div>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { MaterialSizes } from \"../MaterialSizes\";\nimport { Warehouse } from \"../Warehouse\";\nimport { Material } from \"../Material\";\nimport { IIndustry } from \"../IIndustry\";\nimport { ICorporation } from \"../ICorporation\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BuyMaterial } from \"../Actions\";\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 IProps {\n mat: Material;\n industry: IIndustry;\n warehouse: Warehouse;\n corp: ICorporation;\n popupId: string;\n}\n\nfunction BulkPurchase(props: IProps): React.ReactElement {\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 (props.corp.funds.gt(cost)) {\n props.corp.funds = props.corp.funds.minus(cost);\n props.mat.qty += amount;\n } else {\n dialogBoxCreate(`You cannot afford this purchase.`);\n return;\n }\n\n removePopup(props.popupId);\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 <p>\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 </p>\n <BulkPurchaseText warehouse={props.warehouse} mat={props.mat} amount={buyAmt} />\n <input\n onChange={onChange}\n type=\"number\"\n placeholder=\"Bulk Purchase amount\"\n style={{ margin: \"5px\" }}\n onKeyDown={onKeyDown}\n />\n <button className=\"std-button\" onClick={bulkPurchase}>\n Confirm Bulk Purchase\n </button>\n </>\n );\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialPopup(props: IProps): React.ReactElement {\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : null);\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 removePopup(props.popupId);\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n removePopup(props.popupId);\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 <>\n <p>\n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n </p>\n <input\n onChange={onChange}\n className=\"text-input\"\n autoFocus={true}\n placeholder=\"Purchase amount\"\n type=\"number\"\n style={{ margin: \"5px\" }}\n onKeyDown={onKeyDown}\n />\n <button onClick={purchaseMaterial} className=\"std-button\">\n Confirm\n </button>\n <button onClick={clearPurchase} className=\"std-button\">\n Clear Purchase\n </button>\n {props.industry.hasResearch(\"Bulk Purchasing\") && (\n <BulkPurchase\n corp={props.corp}\n mat={props.mat}\n industry={props.industry}\n warehouse={props.warehouse}\n popupId={props.popupId}\n />\n )}\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Product } from \"../Product\";\n\ninterface IProps {\n product: Product;\n industry: IIndustry;\n popupId: string;\n}\n\nfunction MarketTA2(props: IProps): React.ReactElement {\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 <p>\n <br />\n <u>\n <strong>Market-TA.II</strong>\n </u>\n <br />\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 </p>\n <input className=\"text-input\" onChange={onChange} value={value} type=\"number\" style={{ marginTop: \"4px\" }} />\n <div style={{ display: \"block\" }}>\n <label className=\"tooltip\" htmlFor=\"cmpy-mgmt-marketa2-checkbox\" style={{ color: \"white\" }}>\n Use Market-TA.II for Auto-Sale Price\n <span className=\"tooltiptext\">\n If this is enabled, then this Product will automatically be sold at the optimal price such that the amount\n sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all produced\n materials will be sold).\n </span>\n </label>\n <input\n className=\"text-input\"\n onChange={onCheckedChange}\n id=\"cmpy-mgmt-marketa2-checkbox\"\n style={{ margin: \"3px\" }}\n type=\"checkbox\"\n checked={props.product.marketTa2}\n />\n </div>\n <p>\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 </p>\n </>\n );\n}\n\n// Create a popup that lets the player use the Market TA research for Products\nexport function ProductMarketTaPopup(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 <>\n <p>\n <u>\n <strong>Market-TA.I</strong>\n </u>\n <br />\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 </p>\n <div style={{ display: \"block\" }}>\n <label className=\"tooltip\" htmlFor=\"cmpy-mgmt-marketa1-checkbox\" style={{ color: \"white\" }}>\n Use Market-TA.I for Auto-Sale Price\n <span className=\"tooltiptext\">\n If this is enabled, then this Product will automatically be sold at the price identified by Market-TA.I\n (i.e. the price shown above).\n </span>\n </label>\n <input\n onChange={onChange}\n className=\"text-input\"\n id=\"cmpy-mgmt-marketa1-checkbox\"\n style={{ margin: \"3px\" }}\n type=\"checkbox\"\n checked={props.product.marketTa1}\n />\n </div>\n {props.industry.hasResearch(\"Market-TA.II\") && (\n <MarketTA2 product={props.product} industry={props.industry} popupId={props.popupId} />\n )}\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Warehouse } from \"../Warehouse\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { SetSmartSupply, SetSmartSupplyUseLeftovers } from \"../Actions\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Material } from \"../Material\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\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 const matNameId = `${props.matName}-use-leftovers`;\n return (\n <div key={props.matName}>\n <label style={{ color: \"white\" }} htmlFor={matNameId}>\n {props.warehouse.materials[props.matName].name}\n </label>\n <input type={\"checkbox\"} id={matNameId} onChange={onChange} style={{ margin: \"3px\" }} checked={checked} />\n <br />\n </div>\n );\n}\n\ninterface IProps {\n division: IIndustry;\n warehouse: Warehouse;\n corp: ICorporation;\n player: IPlayer;\n popupId: string;\n}\n\nexport function SmartSupplyPopup(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n // Smart Supply Checkbox\n const smartSupplyCheckboxId = \"cmpy-mgmt-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(props.division.reqMats).includes(matName)) continue;\n mats.push(<Leftover key={matName} warehouse={props.warehouse} matName={matName} />);\n }\n\n return (\n <>\n <label style={{ color: \"white\" }} htmlFor={smartSupplyCheckboxId}>\n Enable Smart Supply\n </label>\n <input\n type={\"checkbox\"}\n id={smartSupplyCheckboxId}\n onChange={smartSupplyOnChange}\n style={{ margin: \"3px\" }}\n checked={props.warehouse.smartSupplyEnabled}\n />\n <br />\n <p>Use materials already in the warehouse instead of buying new ones, if available:</p>\n {mats}\n </>\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 <span className=\"text\">\n <MathComponent\n display={false}\n tex={reqs.join(\"+\") + String.raw`\\Rightarrow` + prod.map((p) => String.raw`1\\text{ }${p}`).join(\"+\")}\n />\n </span>\n );\n}\n","// React Component for displaying Corporation Overview info\nimport React from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionPopup } from \"./BribeFactionPopup\";\nimport { SellSharesPopup } from \"./SellSharesPopup\";\nimport { BuybackSharesPopup } from \"./BuybackSharesPopup\";\nimport { IssueDividendsPopup } from \"./IssueDividendsPopup\";\nimport { IssueNewSharesPopup } from \"./IssueNewSharesPopup\";\nimport { FindInvestorsPopup } from \"./FindInvestorsPopup\";\nimport { GoPublicPopup } from \"./GoPublicPopup\";\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 { createPopup } from \"../../ui/React/createPopup\";\nimport { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\nexport function Overview({ corp, player, rerender }: IProps): React.ReactElement {\n const profit: number = corp.revenue.minus(corp.expenses).toNumber();\n\n return (\n <div>\n <p>\n Total Funds: <Money money={corp.funds.toNumber()} />\n <br />\n Total Revenue: <Money money={corp.revenue.toNumber()} /> / s<br />\n Total Expenses: <Money money={corp.expenses.toNumber()} /> / s\n <br />\n Total Profits: <Money money={profit} /> / s<br />\n <DividendsStats corp={corp} profit={profit} />\n Publicly Traded: {corp.public ? \"Yes\" : \"No\"}\n <br />\n Owned Stock Shares: {numeralWrapper.format(corp.numShares, \"0.000a\")}\n <br />\n Stock Price: {corp.public ? <Money money={corp.sharePrice} /> : \"N/A\"}\n <br />\n </p>\n <p className=\"tooltip\">\n Total Stock Shares: {numeralWrapper.format(corp.totalShares, \"0.000a\")}\n <span className=\"tooltiptext\">\n Outstanding Shares: {numeralWrapper.format(corp.issuedShares, \"0.000a\")}\n <br />\n Private Shares: {numeralWrapper.format(corp.totalShares - corp.issuedShares - corp.numShares, \"0.000a\")}\n </span>\n </p>\n <br />\n <br />\n <Mult name=\"Production Multiplier: \" mult={corp.getProductionMultiplier()} />\n <Mult name=\"Storage Multiplier: \" mult={corp.getStorageMultiplier()} />\n <Mult name=\"Advertising Multiplier: \" mult={corp.getAdvertisingMultiplier()} />\n <Mult name=\"Empl. Creativity Multiplier: \" mult={corp.getEmployeeCreMultiplier()} />\n <Mult name=\"Empl. Charisma Multiplier: \" mult={corp.getEmployeeChaMultiplier()} />\n <Mult name=\"Empl. Intelligence Multiplier: \" mult={corp.getEmployeeIntMultiplier()} />\n <Mult name=\"Empl. Efficiency Multiplier: \" mult={corp.getEmployeeEffMultiplier()} />\n <Mult name=\"Sales Multiplier: \" mult={corp.getSalesMultiplier()} />\n <Mult name=\"Scientific Research Multiplier: \" mult={corp.getScientificResearchMultiplier()} />\n <br />\n <BonusTime corp={corp} />\n <div>\n <Button\n className=\"a-link-button\"\n display=\"inline-block\"\n onClick={() => corp.getStarterGuide(player)}\n text=\"Getting Started Guide\"\n tooltip={\n \"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' \" +\n \"This is a .lit file that guides you through the beginning of setting up a Corporation and \" +\n \"provides some tips/pointers for helping you get started with managing it.\"\n }\n />\n {corp.public ? (\n <PublicButtons corp={corp} player={player} rerender={rerender} />\n ) : (\n <PrivateButtons corp={corp} player={player} rerender={rerender} />\n )}\n <BribeButton corp={corp} player={player} />\n </div>\n <br />\n <Upgrades corp={corp} player={player} rerender={rerender} />\n </div>\n );\n}\n\ninterface IPrivateButtonsProps {\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n// Render the buttons for when your Corporation is still private\nfunction PrivateButtons({ corp, player, rerender }: IPrivateButtonsProps): React.ReactElement {\n function openFindInvestorsPopup(): void {\n const popupId = \"cmpy-mgmt-find-investors-popup\";\n createPopup(popupId, FindInvestorsPopup, {\n rerender,\n player,\n popupId,\n corp: corp,\n });\n }\n\n function openGoPublicPopup(): void {\n const popupId = \"cmpy-mgmt-go-public-popup\";\n createPopup(popupId, GoPublicPopup, {\n rerender,\n player,\n popupId,\n corp: corp,\n });\n }\n\n const fundingAvailable = corp.fundingRound < 4;\n const findInvestorsClassName = fundingAvailable ? \"std-button\" : \"a-link-button-inactive\";\n const findInvestorsTooltip = fundingAvailable\n ? \"Search for private investors who will give you startup funding in exchangefor equity (stock shares) in your company\"\n : undefined;\n\n return (\n <>\n <Button\n className={findInvestorsClassName}\n onClick={openFindInvestorsPopup}\n text=\"Find Investors\"\n tooltip={findInvestorsTooltip}\n display=\"inline-block\"\n />\n <Button\n className=\"std-button\"\n onClick={openGoPublicPopup}\n display=\"inline-block\"\n text=\"Go Public\"\n tooltip={\n \"Become a publicly traded and owned entity. Going public \" +\n \"involves issuing shares for an IPO. Once you are a public \" +\n \"company, your shares will be traded on the stock market.\"\n }\n />\n <br />\n </>\n );\n}\n\ninterface IUpgradeProps {\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ corp, player, rerender }: IUpgradeProps): React.ReactElement {\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return <h1>Upgrades are unlocked once you create an industry.</h1>;\n }\n\n return (\n <div className={\"cmpy-mgmt-upgrade-container\"}>\n <h1 className={\"cmpy-mgmt-upgrade-header\"}> Unlocks </h1>\n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => corp.unlockUpgrades[upgrade[0]] === 0)\n .map((upgrade: CorporationUnlockUpgrade) => (\n <UnlockUpgrade rerender={rerender} player={player} corp={corp} upgradeData={upgrade} key={upgrade[0]} />\n ))}\n\n <h1 className={\"cmpy-mgmt-upgrade-header\"}> Upgrades </h1>\n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i])\n .map((upgrade: CorporationUpgrade) => (\n <LevelableUpgrade rerender={rerender} player={player} corp={corp} upgrade={upgrade} key={upgrade[0]} />\n ))}\n </div>\n );\n}\n\ninterface IPublicButtonsProps {\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ corp, player, rerender }: IPublicButtonsProps): React.ReactElement {\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesClass = sellSharesOnCd ? \"a-link-button-inactive\" : \"std-button\";\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 issueNewSharesClass = issueNewSharesOnCd ? \"a-link-button-inactive\" : \"std-button\";\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n function openSellSharesPopup(): void {\n const popupId = \"cmpy-mgmt-sell-shares-popup\";\n createPopup(popupId, SellSharesPopup, {\n corp: corp,\n player,\n popupId,\n rerender,\n });\n }\n\n function openBuybackSharesPopup(): void {\n const popupId = \"corp-buyback-shares-popup\";\n createPopup(popupId, BuybackSharesPopup, {\n rerender,\n player,\n popupId,\n corp: corp,\n });\n }\n\n function openIssueNewSharesPopup(): void {\n const popupId = \"cmpy-mgmt-issue-new-shares-popup\";\n createPopup(popupId, IssueNewSharesPopup, {\n popupId,\n corp: corp,\n });\n }\n\n function openIssueDividendsPopup(): void {\n const popupId = \"cmpy-mgmt-issue-dividends-popup\";\n createPopup(popupId, IssueDividendsPopup, {\n popupId,\n corp: corp,\n });\n }\n\n return (\n <>\n <Button\n className={sellSharesClass}\n display=\"inline-block\"\n onClick={openSellSharesPopup}\n text=\"Sell Shares\"\n tooltip={sellSharesTooltip}\n />\n <Button\n className=\"std-button\"\n display=\"inline-block\"\n onClick={openBuybackSharesPopup}\n text=\"Buyback shares\"\n tooltip=\"Buy back shares you that previously issued or sold at market price.\"\n />\n <br />\n <Button\n className={issueNewSharesClass}\n display=\"inline-block\"\n onClick={openIssueNewSharesPopup}\n text=\"Issue New Shares\"\n tooltip={issueNewSharesTooltip}\n />\n <Button\n className=\"std-button\"\n display=\"inline-block\"\n onClick={openIssueDividendsPopup}\n text=\"Issue Dividends\"\n tooltip=\"Manage the dividends that are paid out to shareholders (including yourself)\"\n />\n <br />\n </>\n );\n}\n\n// Generic Function for Creating a button\ninterface ICreateButtonProps {\n text: string;\n className?: string;\n display?: string;\n tooltip?: string;\n onClick?: (event: React.MouseEvent) => void;\n}\n\nfunction Button({ className = \"std-button\", text, display, tooltip, onClick }: ICreateButtonProps): React.ReactElement {\n const hasTooltip = tooltip != null;\n if (hasTooltip) className += \" tooltip\";\n return (\n <button className={className} onClick={onClick} style={{ display: display ? display : \"block\" }}>\n {text}\n {hasTooltip && <span className={\"tooltiptext\"}>{tooltip}</span>}\n </button>\n );\n}\n\ninterface IBribeButtonProps {\n player: IPlayer;\n corp: ICorporation;\n}\nfunction BribeButton({ player, corp }: IBribeButtonProps): React.ReactElement {\n function openBribeFactionPopup(): void {\n const popupId = \"corp-bribe-popup\";\n createPopup(popupId, BribeFactionPopup, {\n player,\n popupId,\n corp: corp,\n });\n }\n\n const canBribe = corp.determineValuation() >= CorporationConstants.BribeThreshold || true;\n const bribeFactionsClass = canBribe ? \"a-link-button\" : \"a-link-button-inactive\";\n return (\n <Button\n className={bribeFactionsClass}\n display=\"inline-block\"\n onClick={openBribeFactionPopup}\n text=\"Bribe Factions\"\n tooltip={\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 );\n}\n\ninterface IDividendsStatsProps {\n corp: ICorporation;\n profit: number;\n}\nfunction DividendsStats({ corp, profit }: IDividendsStatsProps): React.ReactElement {\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 <>\n Retained Profits (after dividends): <Money money={retainedEarnings} /> / s\n <br />\n <br />\n Dividend Percentage: {numeralWrapper.format(corp.dividendPercentage / 100, \"0%\")}\n <br />\n Dividends per share: <Money money={dividendsPerShare} /> / s<br />\n Your earnings as a shareholder (Pre-Tax): <Money money={playerEarnings} /> / s<br />\n Dividend Tax Rate: {corp.dividendTaxPercentage}%<br />\n Your earnings as a shareholder (Post-Tax):{\" \"}\n <Money money={playerEarnings * (1 - corp.dividendTaxPercentage / 100)} /> / s<br />\n <br />\n </>\n );\n}\n\ninterface IMultProps {\n name: string;\n mult: number;\n}\nfunction Mult({ name, mult }: IMultProps): React.ReactElement {\n if (mult <= 1) return <></>;\n return (\n <p>\n {name}\n {numeralWrapper.format(mult, \"0.000\")}\n <br />\n </p>\n );\n}\n\ninterface IBonusTimeProps {\n corp: ICorporation;\n}\n// Returns a string with general information about Corporation\nfunction BonusTime({ corp }: IBonusTimeProps): React.ReactElement {\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <></>;\n return (\n <p>\n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n <br />\n <br />\n </p>\n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const data = props.upgrade;\n const level = props.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 text = (\n <>\n {data[4]} - <MoneyCost money={cost} corp={props.corp} />\n </>\n );\n const tooltip = data[5];\n function onClick(): void {\n if (props.corp.funds.lt(cost)) return;\n try {\n LevelUpgrade(props.corp, props.upgrade);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <button className={\"cmpy-mgmt-upgrade-div tooltip\"} style={{ width: \"45%\" }} onClick={onClick}>\n {text}\n <span className={\"tooltiptext\"}>{tooltip}</span>\n </button>\n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n corp: ICorporation;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const data = props.upgradeData;\n const text = (\n <>\n {data[2]} - <MoneyCost money={data[1]} corp={props.corp} />\n </>\n );\n const tooltip = data[3];\n function onClick(): void {\n if (props.corp.funds.lt(data[1])) return;\n try {\n UU(props.corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n <button className={\"cmpy-mgmt-upgrade-div tooltip\"} style={{ width: \"45%\" }} onClick={onClick}>\n {text}\n <span className={\"tooltiptext\"}>{tooltip}</span>\n </button>\n );\n}\n","import React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n popupId: string;\n corp: ICorporation;\n player: IPlayer;\n}\n\nexport function BribeFactionPopup(props: IProps): React.ReactElement {\n const [money, setMoney] = useState<number | null>(0);\n const [stock, setStock] = useState<number | null>(0);\n const [selectedFaction, setSelectedFaction] = useState(\n props.player.factions.length > 0 ? props.player.factions[0] : \"\",\n );\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: React.ChangeEvent<HTMLSelectElement>): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number, stock: number): number {\n return (money + stock * props.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 (props.corp.funds.lt(money)) {\n return \"ERROR: You do not have this much money to bribe with\";\n } else if (stock > props.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 (fac == null) {\n dialogBoxCreate(\"ERROR: You must select a faction to bribe\");\n }\n if (isNaN(money) || isNaN(stock) || money < 0 || stock < 0) {\n } else if (props.corp.funds.lt(money)) {\n } else if (stock > props.corp.numShares) {\n } else {\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 props.corp.funds = props.corp.funds.minus(money);\n props.corp.numShares -= stock;\n removePopup(props.popupId);\n }\n }\n\n return (\n <>\n <p>You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.</p>\n <select className=\"dropdown\" style={{ margin: \"3px\" }} defaultValue={selectedFaction} onChange={changeFaction}>\n {props.player.factions.map((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return;\n return (\n <option key={name} value={name}>\n {name}\n </option>\n );\n })}\n </select>\n <p>{getRepText(money ? money : 0, stock ? stock : 0)}</p>\n <input\n className=\"text-input\"\n onChange={onMoneyChange}\n placeholder=\"Corporation funds\"\n style={{ margin: \"5px\" }}\n />\n <input className=\"text-input\" onChange={onStockChange} placeholder=\"Stock Shares\" style={{ margin: \"5px\" }} />\n <button\n className=\"a-link-button\"\n onClick={() => bribe(money ? money : 0, stock ? stock : 0)}\n style={{ display: \"inline-block\" }}\n >\n Bribe\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n corp: ICorporation;\n player: IPlayer;\n popupId: string;\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 SellSharesPopup(props: IProps): React.ReactElement {\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 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 > props.corp.numShares) {\n return <>You don't have this many shares to sell!</>;\n } else {\n const stockSaleResults = props.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 (isNaN(shares) || shares <= 0) {\n dialogBoxCreate(\"ERROR: Invalid value for number of shares\");\n } else if (shares > props.corp.numShares) {\n dialogBoxCreate(\"ERROR: You don't have this many shares to sell\");\n } else {\n const stockSaleResults = props.corp.calculateShareSale(shares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n props.corp.numShares -= shares;\n if (isNaN(props.corp.issuedShares)) {\n console.error(`Corporation issuedShares is NaN: ${props.corp.issuedShares}`);\n const res = props.corp.issuedShares;\n if (isNaN(res)) {\n props.corp.issuedShares = 0;\n } else {\n props.corp.issuedShares = res;\n }\n }\n props.corp.issuedShares += shares;\n props.corp.sharePrice = newSharePrice;\n props.corp.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n props.corp.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n props.player.gainMoney(profit);\n props.player.recordMoneySource(profit, \"corporation\");\n removePopup(props.popupId);\n dialogBoxCreate(\n `Sold ${numeralWrapper.formatMoney(shares)} shares for ` +\n `${numeralWrapper.formatMoney(profit)}. ` +\n `The corporation's stock price fell to ${numeralWrapper.formatMoney(props.corp.sharePrice)} ` +\n `as a result of dilution.`,\n );\n\n props.rerender();\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void {\n if (event.keyCode === 13) sell();\n }\n\n return (\n <>\n <p>\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(props.corp.sharePrice)}\n </p>\n <ProfitIndicator shares={shares} corp={props.corp} />\n <br />\n <input\n autoFocus={true}\n className=\"text-input\"\n type=\"number\"\n placeholder=\"Shares to sell\"\n style={{ margin: \"5px\" }}\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <button onClick={sell} className=\"a-link-button\" style={{ display: \"inline-block\" }}>\n Sell shares\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IProps {\n player: IPlayer;\n popupId: string;\n corp: ICorporation;\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 BuybackSharesPopup(props: IProps): React.ReactElement {\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 = props.corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n\n function buy(): void {\n if (shares === null) return;\n const tempStockPrice = props.corp.sharePrice;\n const buybackPrice = tempStockPrice * 1.1;\n if (isNaN(shares) || shares <= 0) {\n dialogBoxCreate(\"ERROR: Invalid value for number of shares\");\n } else if (shares > props.corp.issuedShares) {\n dialogBoxCreate(\"ERROR: There are not this many oustanding shares to buy back\");\n } else if (shares * buybackPrice > props.player.money) {\n dialogBoxCreate(\n \"ERROR: You do not have enough money to purchase this many shares (you need \" +\n numeralWrapper.format(shares * buybackPrice, \"$0.000a\") +\n \")\",\n );\n } else {\n props.corp.numShares += shares;\n if (isNaN(props.corp.issuedShares)) {\n console.warn(\"Corporation issuedShares is NaN: \" + props.corp.issuedShares);\n console.warn(\"Converting to number now\");\n const res = props.corp.issuedShares;\n if (isNaN(res)) {\n props.corp.issuedShares = 0;\n } else {\n props.corp.issuedShares = res;\n }\n }\n props.corp.issuedShares -= shares;\n props.player.loseMoney(shares * buybackPrice);\n removePopup(props.popupId);\n props.rerender();\n }\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 > props.corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(props.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 <>\n <p>\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(props.corp.issuedShares)} outstanding stock shares.\n </p>\n <CostIndicator />\n <br />\n <input\n autoFocus={true}\n className=\"text-input\"\n type=\"number\"\n placeholder=\"Shares to buyback\"\n style={{ margin: \"5px\" }}\n onChange={changeShares}\n onKeyDown={onKeyDown}\n />\n <button onClick={buy} className=\"a-link-button\" style={{ display: \"inline-block\" }}>\n Buy shares\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IssueDividends } from \"../Actions\";\n\ninterface IProps {\n popupId: string;\n corp: ICorporation;\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 IssueDividendsPopup(props: IProps): React.ReactElement {\n const [percent, setPercent] = useState<number | null>(null);\n\n function issueDividends(): void {\n if (percent === null) return;\n try {\n IssueDividends(props.corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n removePopup(props.popupId);\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(null);\n else setPercent(parseFloat(event.target.value));\n }\n\n return (\n <>\n <p>\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 </p>\n <input\n autoFocus={true}\n onChange={onChange}\n onKeyDown={onKeyDown}\n className=\"text-input\"\n placeholder=\"Dividend %\"\n type=\"number\"\n style={{ margin: \"5px\" }}\n />\n <button onClick={issueDividends} className=\"std-button\" style={{ display: \"inline-block\" }}>\n Allocate Dividend Percentage\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { getRandomInt } from \"../../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\n\ninterface IEffectTextProps {\n corp: ICorporation;\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n if (props.shares === null) return <></>;\n const newSharePrice = Math.round(props.corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(props.corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return <p>Invalid input</p>;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return <p>Must issue at least 10 million new shares</p>;\n }\n\n if (newShares > maxNewShares) {\n return <p>You cannot issue that many shares</p>;\n }\n\n return (\n <p>\n Issue ${numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n </p>\n );\n}\n\ninterface IProps {\n corp: ICorporation;\n popupId: string;\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 IssueNewSharesPopup(props: IProps): React.ReactElement {\n const [shares, setShares] = useState<number | null>(null);\n const maxNewSharesUnrounded = Math.round(props.corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n function issueNewShares(): void {\n if (shares === null) return;\n const newSharePrice = Math.round(props.corp.sharePrice * 0.9);\n let newShares = shares;\n if (isNaN(newShares)) {\n dialogBoxCreate(\"Invalid input for number of new shares\");\n return;\n }\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n if (newShares < 10e6 || newShares > maxNewShares) {\n dialogBoxCreate(\"Invalid input for number of new shares\");\n return;\n }\n\n const profit = newShares * newSharePrice;\n props.corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n props.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 props.corp.issuedShares += newShares - privateShares;\n props.corp.funds = props.corp.funds.plus(profit);\n props.corp.immediatelyUpdateSharePrice();\n\n removePopup(props.popupId);\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(props.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 <>\n <p>\n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n <br />\n <br />\n &nbsp;* You can issue at most {numeralWrapper.formatMoney(maxNewShares)} new shares\n <br />\n &nbsp;* New shares are sold at a 10% discount\n <br />\n &nbsp;* You can only issue new shares once every 12 hours\n <br />\n &nbsp;* Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n <br />\n &nbsp;* 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 </p>\n <EffectText corp={props.corp} shares={shares} />\n <input\n className=\"text-input\"\n autoFocus={true}\n placeholder=\"# New Shares\"\n style={{ margin: \"5px\" }}\n onChange={onChange}\n onKeyDown={onKeyDown}\n />\n <button onClick={issueNewShares} className=\"std-button\" style={{ display: \"inline-block\" }}>\n Issue New Shares\n </button>\n </>\n );\n}\n","import React from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n corp: ICorporation;\n popupId: string;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsPopup(props: IProps): React.ReactElement {\n const val = props.corp.determineValuation();\n let percShares = 0;\n let roundMultiplier = 4;\n switch (props.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 props.corp.fundingRound++;\n props.corp.addFunds(funding);\n props.corp.numShares -= investShares;\n props.rerender();\n removePopup(props.popupId);\n }\n return (\n <>\n <p>\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 </p>\n <button onClick={findInvestors} className=\"std-button\">\n Accept\n </button>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n corp: ICorporation;\n popupId: string;\n player: IPlayer;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicPopup(props: IProps): React.ReactElement {\n const [shares, setShares] = useState(\"\");\n const initialSharePrice = props.corp.determineValuation() / props.corp.totalShares;\n\n function goPublic(): void {\n const numShares = parseFloat(shares);\n const initialSharePrice = props.corp.determineValuation() / props.corp.totalShares;\n if (isNaN(numShares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (numShares > props.corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n props.corp.public = true;\n props.corp.sharePrice = initialSharePrice;\n props.corp.issuedShares = numShares;\n props.corp.numShares -= numShares;\n props.corp.addFunds(numShares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${props.corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(numShares * initialSharePrice)} in your IPO`,\n );\n removePopup(props.popupId);\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 <>\n <p>\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(props.corp.numShares, \"0.000a\")} of shares that you can issue.\n </p>\n <input\n className=\"text-input\"\n value={shares}\n onChange={onChange}\n autoFocus={true}\n type=\"number\"\n placeholder=\"Shares to issue\"\n onKeyDown={onKeyDown}\n />\n <button className=\"std-button\" onClick={goPublic}>\n Go Public\n </button>\n </>\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 { StdButton } from \"../../ui/React/StdButton\";\nimport { Location } from \"../../Locations/Location\";\nimport Grid from \"@mui/material/Grid\";\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 <h1>Infiltrating {props.Location.name}</h1>\n </Grid>\n <Grid item xs={10}>\n <h2>Maximum level: {props.MaxLevel}</h2>\n </Grid>\n <Grid item xs={10}>\n <pre>[{coloredArrow(props.Difficulty)}]</pre>\n <pre>{` ^ ^ ^ ^`}</pre>\n <pre>{` Trivial Normal Hard Impossible`}</pre>\n </Grid>\n <Grid item xs={10}>\n <p>\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 </p>\n <br />\n <p>The minigames you play are randomly selected. It might take you few tries to get used to them.</p>\n <br />\n <p>No game require use of the mouse.</p>\n <br />\n <p>Spacebar is the default action/confirm button.</p>\n <br />\n <p>Everything that uses arrow can also use WASD</p>\n <br />\n <p>Sometimes the rest of the keyboard is used.</p>\n </Grid>\n <Grid item xs={3}>\n <StdButton onClick={props.start} text={\"Start\"} />\n </Grid>\n <Grid item xs={3}>\n <StdButton onClick={props.cancel} text={\"Cancel\"} />\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\";\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 <h3>\n Level: {level}&nbsp;/&nbsp;{props.MaxLevel}\n </h3>\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\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 <h1>Get Ready!</h1>\n <h1>{x}</h1>\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\";\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: React.KeyboardEvent<HTMLElement>): 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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Close the brackets</h1>\n <p style={{ fontSize: \"5em\" }}>\n {`${left}${right}`}\n <BlinkingCursor />\n </p>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Slash when his guard is down!</h1>\n <p style={{ fontSize: \"5em\" }}>{guarding ? \"!Guarding!\" : \"!ATTACKING!\"}</p>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Type it backward</h1>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <p style={{ transform: \"scaleX(-1)\" }}>{answer}</p>\n </Grid>\n <Grid item xs={6}>\n <p>\n {guess}\n <BlinkingCursor />\n </p>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1>Say something nice about the guard.</h1>\n <KeyHandler onKeyDown={press} onFailure={props.onFailure} />\n </Grid>\n <Grid item xs={6}>\n <h2 style={{ fontSize: \"2em\" }}>↑</h2>\n <h2 style={{ fontSize: \"2em\" }}>{choices[index]}</h2>\n <h2 style={{ fontSize: \"2em\" }}>↓</h2>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Enter the Code!</h1>\n <p style={{ fontSize: \"5em\" }}>{code[index]}</p>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Match the symbols!</h1>\n <h2 style={{ fontSize: fontSize }}>\n Targets:{\" \"}\n {answer.map((a, i) => {\n if (i == index)\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\", color: \"blue\" }}>\n {a}&nbsp;\n </span>\n );\n return (\n <span key={`${i}`} style={{ fontSize: \"1em\" }}>\n {a}&nbsp;\n </span>\n );\n })}\n </h2>\n <br />\n {grid.map((line, y) => (\n <div key={y}>\n <pre>\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}&nbsp;\n </span>\n );\n return (\n <span key={`${x}${y}`} style={{ fontSize: fontSize }}>\n {cell}&nbsp;\n </span>\n );\n })}\n </pre>\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\";\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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>{memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}</h1>\n {minefield.map((line, y) => (\n <div key={y}>\n <pre>\n {line.map((cell, x) => {\n if (memoryPhase) {\n if (minefield[y][x]) return <span key={x}>[?]&nbsp;</span>;\n return <span key={x}>[&nbsp;]&nbsp;</span>;\n } else {\n if (x == pos[0] && y == pos[1]) return <span key={x}>[X]&nbsp;</span>;\n if (answer[y][x]) return <span key={x}>[.]&nbsp;</span>;\n return <span key={x}>[&nbsp;]&nbsp;</span>;\n }\n })}\n </pre>\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 { 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(event: React.KeyboardEvent<HTMLElement>): 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 <h1 className={\"noselect\"}>Cut the wires with the following properties! (keyboard 1 to 9)</h1>\n {questions.map((question, i) => (\n <h3 key={i}>{question.toString()}</h3>\n ))}\n <pre>\n {new Array(wires.length).fill(0).map((_, i) => (\n <span key={i}>&nbsp;{i + 1}&nbsp;&nbsp;&nbsp;&nbsp;</span>\n ))}\n </pre>\n {new Array(8).fill(0).map((_, i) => (\n <div key={i}>\n <pre>\n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j])\n return <span key={j}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>;\n return (\n <span key={j} style={{ color: wire.colors[i % wire.colors.length] }}>\n |{wire.tpe}|&nbsp;&nbsp;&nbsp;\n </span>\n );\n })}\n </pre>\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 { StdButton } from \"../../ui/React/StdButton\";\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\";\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: React.ChangeEvent<HTMLSelectElement>): void {\n setFaction(event.target.value);\n }\n\n return (\n <>\n <Grid container spacing={3}>\n <Grid item xs={10}>\n <h1>Infiltration successful!</h1>\n </Grid>\n <Grid item xs={10}>\n <h2>You can trade the confidential information you found for money or reputation.</h2>\n <select className={\"dropdown\"} onChange={changeDropdown}>\n <option key={\"none\"} value={\"none\"}>\n {\"none\"}\n </option>\n {player.factions\n .filter((f) => Factions[f].getInfo().offersWork())\n .map((f) => (\n <option key={f} value={f}>\n {f}\n </option>\n ))}\n </select>\n <StdButton\n onClick={trade}\n text={\n <>\n {\"Trade for \"}\n {Reputation(repGain)}\n {\" reputation\"}\n </>\n }\n />\n </Grid>\n <Grid item xs={3}>\n <StdButton\n onClick={sell}\n text={\n <>\n {\"Sell for \"}\n <Money money={moneyGain} />\n </>\n }\n />\n </Grid>\n <Grid item xs={3}>\n <StdButton onClick={quitInfiltration} text={\"Quit\"} />\n </Grid>\n </Grid>\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { IPlayer } from \"../../IPlayer\";\nimport { generateResleeves } from \"../Resleeving\";\nimport { Resleeve } from \"../Resleeve\";\nimport { ResleeveElem } from \"./ResleeveElem\";\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\ninterface IProps {\n player: IPlayer;\n}\n\nexport function ResleeveRoot(props: IProps): React.ReactElement {\n const [sort, setSort] = useState(SortOption.Cost);\n // Randomly create all Resleeves if they dont already exist\n if (props.player.resleeves.length === 0) {\n props.player.resleeves = generateResleeves();\n }\n\n function onSortChange(event: React.ChangeEvent<HTMLSelectElement>): 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 props.player.resleeves.sort(sortFunction);\n\n return (\n <>\n <p style={{ display: \"block\", width: \"75%\" }}>\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 </p>\n <p style={{ display: \"inline-block\" }}>Sort By: </p>\n <select className=\"dropdown\" defaultValue={sort} onChange={onSortChange}>\n {Object.keys(SortOption).map((opt) => (\n <option key={opt} value={opt}>\n {SortOption[opt]}\n </option>\n ))}\n </select>\n {props.player.resleeves.map((resleeve, i) => (\n <ResleeveElem key={i} player={props.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 \"../../../../utils/DialogBox\";\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 <h2>\n <u>Total Multipliers:</u>\n </h2>\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 </>,\n );\n }\n\n function onAugChange(event: React.ChangeEvent<HTMLSelectElement>): 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 <div className=\"resleeve-elem\" style={{ display: \"block\" }}>\n <div className=\"resleeve-panel\" style={{ width: \"30%\" }}>\n <p>\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 </p>\n <button className=\"std-button\" onClick={openStats}>\n Multipliers\n </button>\n </div>\n <div className=\"resleeve-panel\" style={{ width: \"50%\" }}>\n <select className=\"resleeve-aug-selector dropdown\" onChange={onAugChange}>\n {props.resleeve.augmentations.map((aug) => (\n <option key={aug.name} value={aug.name}>\n {aug.name}\n </option>\n ))}\n </select>\n <p>{currentAug !== undefined && currentAug.info}</p>\n </div>\n <div className=\"resleeve-panel\" style={{ width: \"20%\" }}>\n <p>\n It costs <Money money={cost} player={props.player} /> to purchase this Sleeve.\n </p>\n <button className=\"std-button\" onClick={purchase}>\n Purchase\n </button>\n </div>\n </div>\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(faction.playerReputation)}). <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(player.workRepGained)} ({ReputationRate(player.workRepGainRate * CYCLES_PER_SEC)}) reputation\n 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 function unfocus(): void {\n player.stopFocusing();\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(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(player.workRepGained)} ({ReputationRate(player.workRepGainRate * CYCLES_PER_SEC)}) reputation\n 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(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(player.workRepGained)} (\n {Reputation(`${numeralWrapper.formatExp(player.workRepGainRate * CYCLES_PER_SEC)} / 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 <p>You are attempting to {player.crimeType}.</p>\n <br />\n\n <p>\n Time remaining: {convertTimeMsToTimeElapsedString(player.timeNeededToCompleteWork - player.timeWorked)}\n </p>\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 \"../../../utils/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\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\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 <Tooltip title={<Typography>Sets the locale for displaying numbers.</Typography>}>\n <Typography>Locale&nbsp;</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+ngFSD6VOHrPweH9QATsp+PMe9QM9vmq+s2bGtTbZaYrFqM3M97SnQ0l7IQ5yuOzdZhRdfysu5uJ8dnuHUzq4gLSzqMnZ6/3c+PoHB8AS1nYHUVL4U0+ogZsO1s97IAQyfck9SaoFlxVtqQhkb8752MkQJJvGu3ZQSQGcVC4hFDPk8prXqyq4BU/k/EliwoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldz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DWzFGvruKnnLbDAF6VR5w/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 { AllServers } 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 ip: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = AllServers[props.ip];\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 ips: string[] = [];\n for (const ip of Object.keys(AllServers)) {\n ips.push(ip);\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 {ips.map((ip: string) => (\n <ServerAccordion key={ip} ip={ip} />\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 TextField from \"@mui/material/TextField\";\nimport DoneIcon from \"@mui/icons-material/Done\";\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\nfunction ColorEditor({ name }: { name: string }): React.ReactElement {\n const [color, setColor] = useState(Settings.theme[name]);\n if (color === undefined) return <></>;\n const valid = color.match(/#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})/g);\n\n function set(): void {\n if (!valid) return;\n Settings.theme[name] = color;\n ThemeEvents.emit();\n }\n\n function revert(): void {\n Settings.theme[name] = defaultSettings.theme[name];\n setColor(defaultSettings.theme[name]);\n ThemeEvents.emit();\n }\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>): void {\n setColor(event.target.value);\n }\n\n function onColorPickerChange(newValue: Color): void {\n setColor(\"#\" + newValue.hex.toLowerCase());\n }\n\n return (\n <>\n <TextField\n sx={{ mx: 1 }}\n label={name}\n value={color}\n onChange={onChange}\n variant=\"standard\"\n InputProps={{\n startAdornment: (\n <>\n <ColorPicker hideTextfield value={color} onChange={onColorPickerChange} />\n </>\n ),\n endAdornment: (\n <>\n <IconButton onClick={set} disabled={!valid}>\n <DoneIcon color={valid ? \"primary\" : \"error\"} />\n </IconButton>\n <IconButton onClick={revert}>\n <ReplyIcon color=\"primary\" />\n </IconButton>\n </>\n ),\n }}\n />\n </>\n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n return (\n <Modal open={props.open} onClose={props.onClose}>\n <Button color=\"primary\">primary</Button>\n <Button color=\"secondary\">secondary</Button>\n <Button color=\"warning\">warning</Button>\n <Button color=\"info\">info</Button>\n <Button color=\"error\">error</Button>\n <Typography color=\"primary\">primary</Typography>\n <Typography color=\"secondary\">secondary</Typography>\n <Typography color=\"warning\">warning</Typography>\n <Typography color=\"info\">info</Typography>\n <Typography color=\"error\">error</Typography>\n <br />\n <ColorEditor name=\"primarylight\" />\n <ColorEditor name=\"primary\" />\n <ColorEditor name=\"primarydark\" />\n\n <br />\n <ColorEditor name=\"errorlight\" />\n <ColorEditor name=\"error\" />\n <ColorEditor name=\"errordark\" />\n\n <br />\n <ColorEditor name=\"secondarylight\" />\n <ColorEditor name=\"secondary\" />\n <ColorEditor name=\"secondarydark\" />\n\n <br />\n <ColorEditor name=\"warninglight\" />\n <ColorEditor name=\"warning\" />\n <ColorEditor name=\"warningdark\" />\n\n <br />\n <ColorEditor name=\"infolight\" />\n <ColorEditor name=\"info\" />\n <ColorEditor name=\"infodark\" />\n\n <br />\n <ColorEditor name=\"welllight\" />\n <ColorEditor name=\"well\" />\n <ColorEditor name=\"white\" />\n <ColorEditor name=\"black\" />\n\n <br />\n <ColorEditor name=\"hp\" />\n <ColorEditor name=\"money\" />\n <ColorEditor name=\"hack\" />\n <ColorEditor name=\"combat\" />\n <ColorEditor name=\"cha\" />\n <ColorEditor name=\"int\" />\n <ColorEditor name=\"rep\" />\n </Modal>\n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../../IPlayer\";\n\nimport { SleeveElem } from \"../ui/SleeveElem\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function SleeveRoot(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, 150);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <h1>Sleeves</h1>\n <p>\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 </p>\n\n <button className=\"std-button\" style={{ display: \"inline-block\" }}>\n FAQ\n </button>\n <a\n className=\"std-button\"\n style={{ display: \"inline-block\" }}\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/advancedgameplay/sleeves.html#duplicate-sleeves\"\n >\n Documentation\n </a>\n <ul>\n {props.player.sleeves.map((sleeve, i) => (\n <li key={i}>\n <SleeveElem rerender={rerender} player={props.player} sleeve={sleeve} />\n </li>\n ))}\n </ul>\n </>\n );\n}\n","import React, { useState } from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { SleeveTaskType } from \"../SleeveTaskTypesEnum\";\n\nimport { IPlayer } from \"../../IPlayer\";\nimport { CONSTANTS } from \"../../../Constants\";\n\nimport { Crimes } from \"../../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../../../../utils/DialogBox\";\n\nimport { createProgressBarText } from \"../../../../utils/helpers/createProgressBarText\";\n\nimport { createPopup } from \"../../../ui/React/createPopup\";\n\nimport { SleeveAugmentationsPopup } from \"../ui/SleeveAugmentationsPopup\";\nimport { TravelPopup } from \"../ui/TravelPopup\";\nimport { EarningsTableElement } from \"../ui/EarningsTableElement\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { StatsElement } from \"../ui/StatsElement\";\nimport { MoreStatsContent } from \"../ui/MoreStatsContent\";\nimport { MoreEarningsContent } from \"../ui/MoreEarningsContent\";\nimport { TaskSelector } from \"../ui/TaskSelector\";\nimport { FactionWorkType } from \"../../../Faction/FactionWorkTypeEnum\";\n\ninterface IProps {\n player: IPlayer;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function openMoreStats(): void {\n dialogBoxCreate(<MoreStatsContent sleeve={props.sleeve} />);\n }\n\n function openTravel(): void {\n const popupId = \"sleeve-travel-popup\";\n createPopup(popupId, TravelPopup, {\n popupId: popupId,\n sleeve: props.sleeve,\n player: props.player,\n rerender: props.rerender,\n });\n }\n\n function openManageAugmentations(): void {\n const popupId = \"sleeve-augmentation-popup\";\n createPopup(popupId, SleeveAugmentationsPopup, {\n sleeve: props.sleeve,\n player: props.player,\n });\n }\n\n function openMoreEarnings(): void {\n dialogBoxCreate(<MoreEarningsContent sleeve={props.sleeve} />);\n }\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(props.player, abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(props.player, abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(props.player, abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(props.player, abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(props.player, abc[2], abc[1]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery(props.player);\n break;\n case \"Synchronize\":\n props.sleeve.synchronize(props.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\n // elems.taskProgressBar.innerText = createProgressBarText({\n // progress: props.sleeve.currentTaskTime / props.sleeve.currentTaskMaxTime,\n // totalTicks: 25,\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(props.player);\n data.push([`Reputation:`, ReputationRate(5 * repGain)]);\n }\n\n // elems.taskProgressBar.innerText = \"\";\n }\n\n return (\n <div className=\"sleeve-elem\">\n <div className=\"sleeve-panel\" style={{ width: \"25%\" }}>\n <div className=\"sleeve-stats-text\">\n <StatsElement sleeve={props.sleeve} />\n <button className=\"std-button\" onClick={openMoreStats}>\n More Stats\n </button>\n <button\n className={`std-button${props.player.money.lt(CONSTANTS.TravelCost) ? \" tooltip\" : \"\"}`}\n onClick={openTravel}\n disabled={props.player.money.lt(CONSTANTS.TravelCost)}\n >\n Travel\n {props.player.money.lt(CONSTANTS.TravelCost) && <span className=\"tooltiptext\">Not enough money</span>}\n </button>\n <button\n className={`std-button${props.sleeve.shock < 100 ? \" tooltip\" : \"\"}`}\n onClick={openManageAugmentations}\n style={{ display: \"block\" }}\n disabled={props.sleeve.shock < 100}\n >\n Manage Augmentations\n {props.sleeve.shock < 100 && <span className=\"tooltiptext\">Unlocked when sleeve has fully recovered</span>}\n </button>\n </div>\n </div>\n <div className=\"sleeve-panel\" style={{ width: \"40%\" }}>\n <TaskSelector player={props.player} sleeve={props.sleeve} setABC={setABC} />\n <p>{desc}</p>\n <p>\n {props.sleeve.currentTask === SleeveTaskType.Crime &&\n createProgressBarText({\n progress: props.sleeve.currentTaskTime / props.sleeve.currentTaskMaxTime,\n totalTicks: 25,\n })}\n </p>\n <button className=\"std-button\" onClick={setTask}>\n Set Task\n </button>\n </div>\n <div className=\"sleeve-panel\" style={{ width: \"35%\" }}>\n <EarningsTableElement title=\"Earnings (Pre-Synchronization)\" stats={data} />\n <button className=\"std-button\" onClick={openMoreEarnings}>\n More Earnings Info\n </button>\n </div>\n </div>\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 { IPlayer } from \"../../IPlayer\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { renderToStaticMarkup } from \"react-dom/server\";\n\ninterface IProps {\n sleeve: Sleeve;\n player: IPlayer;\n}\n\nexport function SleeveAugmentationsPopup(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, 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, props.player);\n\n function purchaseAugmentation(aug: Augmentation): void {\n props.sleeve.tryBuyAugmentation(props.player, aug);\n rerender();\n }\n\n return (\n <div className=\"noselect\">\n <p style={{ display: \"block\" }}>Owned Augmentations:</p>\n <div style={{ width: \"70%\" }}>\n {ownedAugNames.map((augName) => {\n const aug = Augmentations[augName];\n let tooltip = aug.info;\n if (typeof tooltip !== \"string\") {\n tooltip = renderToStaticMarkup(tooltip);\n }\n tooltip += \"<br /><br />\";\n tooltip += renderToStaticMarkup(aug.stats);\n return (\n <div key={augName} className=\"gang-owned-upgrade tooltip\">\n {augName}\n <span className=\"tooltiptext\" dangerouslySetInnerHTML={{ __html: tooltip }}></span>\n </div>\n );\n })}\n </div>\n <p>\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 </p>\n {availableAugs.map((aug) => {\n let info = aug.info;\n if (typeof info !== \"string\") {\n info = renderToStaticMarkup(info);\n }\n info += \"<br /><br />\";\n info += renderToStaticMarkup(aug.stats);\n\n return (\n <div key={aug.name} className=\"cmpy-mgmt-upgrade-div\" onClick={() => purchaseAugmentation(aug)}>\n <div style={{ fontSize: \"12px\", padding: \"2px\" }}>\n <h2>{aug.name}</h2>\n <br />\n Cost: <Money money={aug.startingCost} player={props.player} />\n <br />\n <br />\n <span dangerouslySetInnerHTML={{ __html: info }}></span>\n </div>\n </div>\n );\n })}\n </div>\n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { removePopup } from \"../../../ui/React/createPopup\";\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 \"../../../../utils/DialogBox\";\n\ninterface IProps {\n popupId: string;\n sleeve: Sleeve;\n player: IPlayer;\n rerender: () => void;\n}\n\nexport function TravelPopup(props: IProps): React.ReactElement {\n function travel(city: string): void {\n if (!props.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 props.player.loseMoney(CONSTANTS.TravelCost);\n props.sleeve.resetTaskStatus();\n removePopup(props.popupId);\n props.rerender();\n }\n\n return (\n <>\n <p>\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={props.player} />. It will\n also set your current sleeve task to idle.\n </p>\n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n <button key={city} className=\"std-button\" onClick={() => travel(city)}>\n {city}\n </button>\n ))\n ) : (\n <WorldMap currentCity={props.sleeve.city} onTravel={(city: CityName) => travel(city)} />\n )}\n </>\n );\n}\n","import * as React from \"react\";\n\ninterface IProps {\n title: string;\n stats: any[][];\n}\n\nexport function EarningsTableElement(props: IProps): React.ReactElement {\n return (\n <>\n <pre>{props.title}</pre>\n <table>\n <tbody>\n {props.stats.map((stat: any[], i: number) => (\n <tr key={i}>\n {stat.map((s: any, i: number) => {\n let style = {};\n if (i !== 0) {\n style = { textAlign: \"right\" };\n }\n return (\n <td style={style} key={i}>\n {s}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport * as React from \"react\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n let style = {};\n style = { textAlign: \"right\" };\n return (\n <>\n <table>\n <tbody>\n <tr>\n <td className=\"character-hp-cell\">HP: </td>\n <td className=\"character-hp-cell\" style={style}>\n {numeralWrapper.formatHp(props.sleeve.hp)} / {numeralWrapper.formatHp(props.sleeve.max_hp)}\n </td>\n </tr>\n <tr>\n <td>City: </td>\n <td style={style}>{props.sleeve.city}</td>\n </tr>\n <tr>\n <td className=\"character-hack-cell\">Hacking: </td>\n <td className=\"character-hack-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.hacking_skill)}\n </td>\n </tr>\n <tr>\n <td className=\"character-combat-cell\">Strength: </td>\n <td className=\"character-combat-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.strength)}\n </td>\n </tr>\n <tr>\n <td className=\"character-combat-cell\">Defense: </td>\n <td className=\"character-combat-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.defense)}\n </td>\n </tr>\n <tr>\n <td className=\"character-combat-cell\">Dexterity: </td>\n <td className=\"character-combat-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.dexterity)}\n </td>\n </tr>\n <tr>\n <td className=\"character-combat-cell\">Agility: </td>\n <td className=\"character-combat-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.agility)}\n </td>\n </tr>\n <tr>\n <td className=\"character-cha-cell\">Charisma: </td>\n <td className=\"character-cha-cell\" style={style}>\n {numeralWrapper.formatSkill(props.sleeve.charisma)}\n </td>\n </tr>\n <tr>\n <td className=\"character-int-cell\">Shock: </td>\n <td className=\"character-int-cell\" style={style}>\n {numeralWrapper.formatSleeveShock(100 - props.sleeve.shock)}\n </td>\n </tr>\n <tr>\n <td className=\"character-int-cell\">Sync: </td>\n <td className=\"character-int-cell\" style={style}>\n {numeralWrapper.formatSleeveSynchro(props.sleeve.sync)}\n </td>\n </tr>\n <tr>\n <td className=\"character-int-cell\">Memory: </td>\n <td className=\"character-int-cell\" style={style}>\n {numeralWrapper.formatSleeveMemory(props.sleeve.memory)}\n </td>\n </tr>\n </tbody>\n </table>\n </>\n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport * as React from \"react\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function MoreStatsContent(props: IProps): React.ReactElement {\n return (\n <>\n <StatsTable\n rows={[\n [\"Hacking: \", props.sleeve.hacking_skill, `(${numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp)`],\n [\"Strength: \", props.sleeve.strength, `(${numeralWrapper.formatExp(props.sleeve.strength_exp)} exp)`],\n [\"Defense: \", props.sleeve.defense, `(${numeralWrapper.formatExp(props.sleeve.defense_exp)} exp)`],\n [\"Dexterity: \", props.sleeve.dexterity, `(${numeralWrapper.formatExp(props.sleeve.dexterity_exp)} exp)`],\n [\"Agility: \", props.sleeve.agility, `(${numeralWrapper.formatExp(props.sleeve.agility_exp)} exp)`],\n [\"Charisma: \", props.sleeve.charisma, `(${numeralWrapper.formatExp(props.sleeve.charisma_exp)} exp)`],\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 [\"Dexterity Experience multiplier: \", numeralWrapper.formatPercentage(props.sleeve.dexterity_exp_mult)],\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 [\"Faction Reputation Gain multiplier: \", numeralWrapper.formatPercentage(props.sleeve.faction_rep_mult)],\n [\"Company Reputation Gain multiplier: \", numeralWrapper.formatPercentage(props.sleeve.company_rep_mult)],\n [\"Salary multiplier: \", numeralWrapper.formatPercentage(props.sleeve.work_money_mult)],\n [\"Crime Money multiplier: \", numeralWrapper.formatPercentage(props.sleeve.crime_money_mult)],\n [\"Crime Success multiplier: \", numeralWrapper.formatPercentage(props.sleeve.crime_success_mult)],\n ]}\n title=\"Multipliers:\"\n />\n </>\n );\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\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function MoreEarningsContent(props: IProps): React.ReactElement {\n return (\n <>\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 </>\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\";\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: React.ChangeEvent<HTMLSelectElement>): 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: React.ChangeEvent<HTMLSelectElement>): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: React.ChangeEvent<HTMLSelectElement>): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n <select className=\"dropdown\" onChange={onS0Change} defaultValue={s0}>\n {validActions.map((task) => (\n <option key={task} value={task}>\n {task}\n </option>\n ))}\n </select>\n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <select className=\"dropdown\" onChange={onS1Change} defaultValue={s1}>\n {details.first.map((detail) => (\n <option key={detail} value={detail}>\n {detail}\n </option>\n ))}\n </select>\n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <select className=\"dropdown\" onChange={onS2Change} defaultValue={s2}>\n {details2.map((detail) => (\n <option key={detail} value={detail}>\n {detail}\n </option>\n ))}\n </select>\n )}\n </>\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 { HashUpgradePopup } from \"./HashUpgradePopup\";\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 { AllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\n\nimport { createPopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function HacknetRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [purchaseMultiplier, setPurchaseMultiplier] = useState<number | string>(PurchaseMultipliers.x1);\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function createHashUpgradesPopup(): void {\n const id = \"hacknet-server-hash-upgrades-popup\";\n createPopup(id, HashUpgradePopup, {\n player: props.player,\n });\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 = AllServers[node];\n if (hserver instanceof Server) throw new Error(\"node was a normal 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 = AllServers[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 Server) throw new Error(\"node was normal 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 <h1>Hacknet {hasHacknetServers(props.player) ? \"Servers\" : \"Nodes\"}</h1>\n <GeneralInfo hasHacknetServers={hasHacknetServers(props.player)} />\n\n <PurchaseButton cost={purchaseCost} multiplier={purchaseMultiplier} onClick={handlePurchaseButtonClick} />\n\n <br />\n <div id={\"hacknet-nodes-money-multipliers-div\"}>\n <PlayerInfo totalProduction={totalProduction} player={props.player} />\n <MultiplierButtons onClicks={purchaseMultiplierOnClicks} purchaseMultiplier={purchaseMultiplier} />\n </div>\n\n {hasHacknetServers(props.player) && (\n <button className={\"std-button\"} onClick={createHashUpgradesPopup} style={{ display: \"block\" }}>\n {\"Spend Hashes on Upgrades\"}\n </button>\n )}\n\n <ul id={\"hacknet-nodes-list\"}>{nodes}</ul>\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\";\n\ninterface IProps {\n hasHacknetServers: boolean;\n}\n\nexport function GeneralInfo(props: IProps): React.ReactElement {\n return (\n <div>\n <p className={\"hacknet-general-info\"}>\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 </p>\n {!props.hasHacknetServers ? (\n <>\n <p className={\"hacknet-general-info\"}>\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 </p>\n <p className={\"hacknet-general-info\"}>\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 </p>\n </>\n ) : (\n <>\n <p className={\"hacknet-general-info\"}>\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 </p>\n <p className={\"hacknet-general-info\"}>\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 </p>\n </>\n )}\n </div>\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\ninterface IProps {\n node: HacknetNode;\n purchaseMultiplier: number | string;\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, upgradeLevelClass;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelContent = <>MAX LEVEL</>;\n upgradeLevelClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeLevelCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeLevelCost)) {\n upgradeLevelClass = \"std-button-disabled\";\n } else {\n upgradeLevelClass = \"std-button\";\n }\n }\n function upgradeLevelOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel);\n }\n purchaseLevelUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n let upgradeRamContent, upgradeRamClass;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRamContent = <>MAX RAM</>;\n upgradeRamClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeRamCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeRamCost)) {\n upgradeRamClass = \"std-button-disabled\";\n } else {\n upgradeRamClass = \"std-button\";\n }\n }\n function upgradeRamOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam);\n }\n purchaseRamUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n let upgradeCoresContent, upgradeCoresClass;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresContent = <>MAX CORES</>;\n upgradeCoresClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeCoreCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeCoreCost)) {\n upgradeCoresClass = \"std-button-disabled\";\n } else {\n upgradeCoresClass = \"std-button\";\n }\n }\n function upgradeCoresOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores);\n }\n purchaseCoreUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n return (\n <li className={\"hacknet-node\"}>\n <div className={\"hacknet-node-container\"}>\n <div className={\"row\"}>\n <h1 style={{ fontSize: \"1em\" }}>{node.name}</h1>\n </div>\n <div className={\"row\"}>\n <p>Production:</p>\n <span className={\"text money-gold\"}>\n <Money money={node.totalMoneyGenerated} player={props.player} /> (\n <MoneyRate money={node.moneyGainRatePerSecond} />)\n </span>\n </div>\n <div className={\"row\"}>\n <p>Level:</p>\n <span className={\"text upgradable-info\"}>{node.level}</span>\n <button className={upgradeLevelClass} onClick={upgradeLevelOnClick}>\n {upgradeLevelContent}\n </button>\n </div>\n <div className={\"row\"}>\n <p>RAM:</p>\n <span className={\"text upgradable-info\"}>{node.ram}GB</span>\n <button className={upgradeRamClass} onClick={upgradeRamOnClick}>\n {upgradeRamContent}\n </button>\n </div>\n <div className={\"row\"}>\n <p>Cores:</p>\n <span className={\"text upgradable-info\"}>{node.cores}</span>\n <button className={upgradeCoresClass} onClick={upgradeCoresOnClick}>\n {upgradeCoresContent}\n </button>\n </div>\n </div>\n </li>\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 * 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\";\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, upgradeLevelClass;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelContent = <>MAX LEVEL</>;\n upgradeLevelClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeLevelCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeLevelCost)) {\n upgradeLevelClass = \"std-button-disabled\";\n } else {\n upgradeLevelClass = \"std-button\";\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, upgradeRamClass;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamContent = <>MAX RAM</>;\n upgradeRamClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeRamCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeRamCost)) {\n upgradeRamClass = \"std-button-disabled\";\n } else {\n upgradeRamClass = \"std-button\";\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, upgradeCoresClass;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresContent = <>MAX CORES</>;\n upgradeCoresClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeCoreCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeCoreCost)) {\n upgradeCoresClass = \"std-button-disabled\";\n } else {\n upgradeCoresClass = \"std-button\";\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, upgradeCacheClass;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheContent = <>MAX CACHE</>;\n upgradeCacheClass = \"std-button-disabled\";\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 Upgrade x{multiplier} - <Money money={upgradeCacheCost} player={props.player} />\n </>\n );\n if (props.player.money.lt(upgradeCacheCost)) {\n upgradeCacheClass = \"std-button-disabled\";\n } else {\n upgradeCacheClass = \"std-button\";\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 <li className={\"hacknet-node\"}>\n <div className={\"hacknet-node-container\"}>\n <div className={\"row\"}>\n <h1 style={{ fontSize: \"1em\" }}>{node.hostname}</h1>\n </div>\n <div className={\"row\"}>\n <p>Production:</p>\n <span className={\"text money-gold\"}>\n {Hashes(node.totalHashesGenerated)} ({HashRate(node.hashRate)})\n </span>\n </div>\n <div className={\"row\"}>\n <p>Hash Capacity:</p>\n <span className={\"text\"}>{Hashes(node.hashCapacity)}</span>\n </div>\n <div className={\"row\"}>\n <p>Level:</p>\n <span className={\"text upgradable-info\"}>{node.level}</span>\n <button className={upgradeLevelClass} onClick={upgradeLevelOnClick}>\n {upgradeLevelContent}\n </button>\n </div>\n <div className={\"row\"}>\n <p>RAM:</p>\n <span className={\"text upgradable-info\"}>{node.maxRam}GB</span>\n <button className={upgradeRamClass} onClick={upgradeRamOnClick}>\n {upgradeRamContent}\n </button>\n </div>\n <div className={\"row\"}>\n <p>Cores:</p>\n <span className={\"text upgradable-info\"}>{node.cores}</span>\n <button className={upgradeCoresClass} onClick={upgradeCoresOnClick}>\n {upgradeCoresContent}\n </button>\n </div>\n <div className={\"row\"}>\n <p>Cache Level:</p>\n <span className={\"text upgradable-info\"}>{node.cache}</span>\n <button className={upgradeCacheClass} onClick={upgradeCacheOnClick}>\n {upgradeCacheContent}\n </button>\n </div>\n </div>\n </li>\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 { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function HashUpgradePopup(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(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = props.player.hashManager;\n if (!(hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n const upgradeElems = Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return (\n <HacknetUpgradeElem\n player={props.player}\n upg={upg}\n hashManager={hashManager}\n key={upg.name}\n rerender={rerender}\n />\n );\n });\n\n return (\n <div>\n <p>Spend your hashes on a variety of different upgrades</p>\n <p>Hashes: {Hashes(props.player.hashManager.hashes)}</p>\n {upgradeElems}\n </div>\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 \"../../../utils/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\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: React.ChangeEvent<HTMLSelectElement>): 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 const btnClass = canPurchase ? \"std-button\" : \"std-button-disabled\";\n\n // We'll reuse a Bladeburner css class\n return (\n <div className={\"bladeburner-action\"}>\n <CopyableText value={upg.name} />\n <p>\n Cost: {Hashes(cost)}, Bought: {level} times\n </p>\n\n <p>{upg.desc}</p>\n <button className={btnClass} onClick={purchase}>\n Purchase\n </button>\n {level > 0 && effect && <p>{effect}</p>}\n {upg.hasTargetServer && (\n <ServerDropdown serverType={ServerType.Foreign} onChange={changeTargetServer} style={{ margin: \"5px\" }} />\n )}\n </div>\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\";\n\ninterface IMultiplierProps {\n className: string;\n key: string;\n onClick: () => void;\n text: string;\n}\n\nfunction MultiplierButton(props: IMultiplierProps): React.ReactElement {\n return (\n <button className={props.className} 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 className: props.purchaseMultiplier === PurchaseMultipliers[mult] ? \"std-button-disabled\" : \"std-button\",\n key: mult,\n onClick: onClicks[i],\n text: mult,\n };\n\n buttons.push(<MultiplierButton {...btnProps} />);\n }\n\n return <span id={\"hacknet-nodes-multipliers\"}>{buttons}</span>;\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\";\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(props.totalProduction);\n } else {\n prod = <MoneyRate money={props.totalProduction} />;\n }\n\n return (\n <p id={\"hacknet-nodes-money\"}>\n <span>Money: </span>\n <Money money={props.player.money.toNumber()} />\n <br />\n\n {hasServers && (\n <>\n <span>\n Hashes: {Hashes(props.player.hashManager.hashes)} / {Hashes(props.player.hashManager.capacity)}\n </span>\n <br />\n </>\n )}\n\n <span>Total Hacknet {hasServers ? \"Server\" : \"Node\"} Production: </span>\n {prod}\n </p>\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\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 className = Player.canAfford(cost) ? \"std-button\" : \"std-button-disabled\";\n let text;\n let style = {};\n if (hasHacknetServers(Player)) {\n if (hasMaxNumberHacknetServers(Player)) {\n className = \"std-button-disabled\";\n text = <>Hacknet Server limit reached</>;\n style = { color: \"red\" };\n } else {\n text = (\n <>\n Purchase Hacknet Server - <Money money={cost} player={Player} />\n </>\n );\n }\n } else {\n text = (\n <>\n Purchase Hacknet Node - <Money money={cost} player={Player} />\n </>\n );\n }\n\n return (\n <button className={className} onClick={props.onClick} style={style}>\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\";\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 { StdButton } from \"../../ui/React/StdButton\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { use } from \"../../ui/Context\";\nimport { QuitJobPopup } from \"../../Company/ui/QuitJobPopup\";\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 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 function quit(e: React.MouseEvent<HTMLElement>): void {\n if (!e.isTrusted) return;\n const popupId = `quit-job-popup`;\n createPopup(popupId, QuitJobPopup, {\n locName: props.locName,\n company: company,\n player: p,\n onQuit: rerender,\n popupId: popupId,\n });\n }\n\n const isEmployedHere = jobTitle != null;\n const favorGain = company.getFavorGain();\n\n return (\n <div>\n {isEmployedHere && (\n <div>\n <p>Job Title: {jobTitle}</p>\n <br />\n <p style={{ display: \"block\" }}>-------------------------</p>\n <br />\n <p className={\"tooltip\"}>\n Company reputation: {Reputation(company.playerReputation)}\n <span className={\"tooltiptext\"}>\n You will earn {Favor(favorGain[0])} company favor upon resetting after installing Augmentations\n </span>\n </p>\n <br />\n <br />\n <p style={{ display: \"block\" }}>-------------------------</p>\n <br />\n <p className={\"tooltip\"}>\n Company Favor: {Favor(company.favor)}\n <span className={\"tooltiptext\"}>\n Company favor increases the rate at which you earn reputation for this company by 1% per favor. Company\n favor is gained whenever you reset after installing Augmentations. The amount of favor you gain depends on\n how much reputation you have with the comapny.\n </span>\n </p>\n <br />\n <br />\n <p style={{ display: \"block\" }}>-------------------------</p>\n <br />\n <StdButton onClick={work} text={\"Work\"} />\n &nbsp;&nbsp;&nbsp;&nbsp;\n <StdButton onClick={quit} text={\"Quit\"} />\n </div>\n )}\n {company.hasAgentPositions() && (\n <ApplyToJobButton\n company={company}\n entryPosType={CompanyPositions[posNames.AgentCompanyPositions[0]]}\n onClick={applyForAgentJob}\n p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\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 p={p}\n style={{ display: \"block\" }}\n text={\"Apply to be a part-time Waiter\"}\n />\n )}\n {location.infiltrationData != null && (\n <StdButton onClick={startInfiltration} style={{ display: \"block\" }} text={\"Infiltrate Company\"} />\n )}\n <br />\n <br />\n <br />\n <br />\n <br />\n </div>\n );\n}\n","// Metadata used for constructing Company Positions\nimport { IConstructorParams } from \"../CompanyPosition\";\nimport * as posNames from \"./companypositionnames\";\n\nexport const companyPositionMetadata: IConstructorParams[] = [\n {\n name: posNames.SoftwareCompanyPositions[0], // Software Enginering Intern\n nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n baseSalary: 33,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.05,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n baseSalary: 80,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.1,\n reqdHacking: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n baseSalary: 165,\n charismaEffectiveness: 20,\n charismaExpGain: 0.08,\n hackingEffectiveness: 80,\n hackingExpGain: 0.4,\n reqdCharisma: 51,\n reqdHacking: 251,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n nextPosition: posNames.SoftwareCompanyPositions[4], // Head of Software\n baseSalary: 500,\n charismaEffectiveness: 25,\n charismaExpGain: 0.1,\n hackingEffectiveness: 75,\n hackingExpGain: 0.8,\n reqdCharisma: 151,\n reqdHacking: 401,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.SoftwareCompanyPositions[4], // Head of Software\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 800,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 400e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n nextPosition: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n baseSalary: 1650,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1.1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n nextPosition: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n baseSalary: 2310,\n charismaEffectiveness: 30,\n charismaExpGain: 0.6,\n hackingEffectiveness: 70,\n hackingExpGain: 1.2,\n reqdCharisma: 401,\n reqdHacking: 601,\n reqdReputation: 1.6e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n nextPosition: null,\n baseSalary: 2640,\n charismaEffectiveness: 35,\n charismaExpGain: 1,\n hackingEffectiveness: 65,\n hackingExpGain: 1.5,\n reqdCharisma: 501,\n reqdHacking: 751,\n reqdReputation: 3.2e6,\n repMultiplier: 2,\n },\n {\n name: posNames.ITCompanyPositions[0], // IT Intern\n nextPosition: posNames.ITCompanyPositions[1], // IT Analyst\n baseSalary: 26,\n charismaEffectiveness: 10,\n charismaExpGain: 0.01,\n hackingEffectiveness: 90,\n hackingExpGain: 0.04,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.ITCompanyPositions[1], // IT Analyst\n nextPosition: posNames.ITCompanyPositions[2], // IT Manager\n baseSalary: 66,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.08,\n reqdHacking: 26,\n reqdReputation: 7e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.ITCompanyPositions[2], // IT Manager\n nextPosition: posNames.ITCompanyPositions[3], // Systems Administrator\n baseSalary: 132,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.3,\n reqdCharisma: 51,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.ITCompanyPositions[3], // Systems Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.2,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.SecurityEngineerCompanyPositions[0], // Security Engineer\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer\n nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Adminsitrator\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[0], // Business Intern\n nextPosition: posNames.BusinessCompanyPositions[1], // Business Analyst\n baseSalary: 46,\n charismaEffectiveness: 90,\n charismaExpGain: 0.08,\n hackingEffectiveness: 10,\n hackingExpGain: 0.01,\n reqdCharisma: 1,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.BusinessCompanyPositions[1], // Business Analyst\n nextPosition: posNames.BusinessCompanyPositions[2], // Business Manager\n baseSalary: 100,\n charismaEffectiveness: 85,\n charismaExpGain: 0.15,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 51,\n reqdHacking: 6,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.BusinessCompanyPositions[2], // Business Manager\n nextPosition: posNames.BusinessCompanyPositions[3], // Operations Manager\n baseSalary: 200,\n charismaEffectiveness: 85,\n charismaExpGain: 0.3,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 101,\n reqdHacking: 51,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[3], // Operations Manager\n nextPosition: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n baseSalary: 660,\n charismaEffectiveness: 85,\n charismaExpGain: 0.4,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 226,\n reqdHacking: 51,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n nextPosition: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n baseSalary: 1950,\n charismaEffectiveness: 90,\n charismaExpGain: 1,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 501,\n reqdHacking: 76,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n nextPosition: null,\n baseSalary: 3900,\n charismaEffectiveness: 90,\n charismaExpGain: 1.5,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 751,\n reqdHacking: 101,\n reqdReputation: 3.2e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SecurityCompanyPositions[0], // Police Officer\n nextPosition: posNames.SecurityCompanyPositions[1], // Police Chief\n baseSalary: 82,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.04,\n reqdHacking: 11,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[1], // Police Chief\n nextPosition: null,\n baseSalary: 460,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.1,\n reqdHacking: 101,\n reqdStrength: 301,\n reqdDefense: 301,\n reqdDexterity: 301,\n reqdAgility: 301,\n reqdCharisma: 151,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[2], // Security Guard\n nextPosition: posNames.SecurityCompanyPositions[3], // Security Officer\n baseSalary: 50,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.01,\n strengthExpGain: 0.04,\n defenseExpGain: 0.04,\n dexterityExpGain: 0.04,\n agilityExpGain: 0.04,\n charismaExpGain: 0.02,\n reqdStrength: 51,\n reqdDefense: 51,\n reqdDexterity: 51,\n reqdAgility: 51,\n reqdCharisma: 1,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[3], // Security Officer\n nextPosition: posNames.SecurityCompanyPositions[4], // Security Supervisor\n baseSalary: 195,\n hackingEffectiveness: 10,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 10,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.05,\n reqdHacking: 26,\n reqdStrength: 151,\n reqdDefense: 151,\n reqdDexterity: 151,\n reqdAgility: 151,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SecurityCompanyPositions[4], // Security Supervisor\n nextPosition: posNames.SecurityCompanyPositions[5], // Head of Security\n baseSalary: 660,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.02,\n strengthExpGain: 0.12,\n defenseExpGain: 0.12,\n dexterityExpGain: 0.12,\n agilityExpGain: 0.12,\n charismaExpGain: 0.1,\n reqdHacking: 26,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 101,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[5], // Head of Security\n nextPosition: null,\n baseSalary: 1320,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.05,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.15,\n reqdHacking: 51,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 151,\n reqdReputation: 144e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.AgentCompanyPositions[0], // Field Agent\n nextPosition: posNames.AgentCompanyPositions[1], // Secret Agent\n baseSalary: 330,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 20,\n hackingExpGain: 0.04,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.05,\n reqdHacking: 101,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 101,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.AgentCompanyPositions[1], // Secret Agent\n nextPosition: posNames.AgentCompanyPositions[2], // Special Operative\n baseSalary: 990,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.1,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.1,\n reqdHacking: 201,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 201,\n reqdReputation: 32e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.AgentCompanyPositions[2], // Special Operative\n nextPosition: null,\n baseSalary: 2000,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.15,\n strengthExpGain: 0.2,\n defenseExpGain: 0.2,\n dexterityExpGain: 0.2,\n agilityExpGain: 0.2,\n charismaExpGain: 0.15,\n reqdHacking: 251,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 251,\n reqdReputation: 162e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.MiscCompanyPositions[0], // Waiter\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.05,\n repMultiplier: 1,\n },\n {\n name: posNames.MiscCompanyPositions[1], // Employee\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[0], // Software Consultant\n nextPosition: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n baseSalary: 66,\n hackingEffectiveness: 80,\n charismaEffectiveness: 20,\n hackingExpGain: 0.08,\n charismaExpGain: 0.03,\n reqdHacking: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n nextPosition: null,\n baseSalary: 132,\n hackingEffectiveness: 75,\n charismaEffectiveness: 25,\n hackingExpGain: 0.25,\n charismaExpGain: 0.06,\n reqdHacking: 251,\n reqdCharisma: 51,\n repMultiplier: 1.2,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[0], // Business Consultant\n nextPosition: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n baseSalary: 66,\n hackingEffectiveness: 20,\n charismaEffectiveness: 80,\n hackingExpGain: 0.015,\n charismaExpGain: 0.15,\n reqdHacking: 6,\n reqdCharisma: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n nextPosition: null,\n baseSalary: 525,\n hackingEffectiveness: 15,\n charismaEffectiveness: 85,\n hackingExpGain: 0.015,\n charismaExpGain: 0.3,\n reqdHacking: 51,\n reqdCharisma: 226,\n repMultiplier: 1.2,\n },\n {\n name: posNames.PartTimeCompanyPositions[0], // Part-time waiter\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.PartTimeCompanyPositions[1], // Part-time employee\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.03,\n repMultiplier: 1,\n },\n];\n","import React from \"react\";\nimport { Company } from \"../Company\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n locName: string;\n company: Company;\n player: IPlayer;\n onQuit: () => void;\n popupId: string;\n}\n\nexport function QuitJobPopup(props: IProps): React.ReactElement {\n function quit(): void {\n props.player.quitJob(props.locName);\n props.onQuit();\n removePopup(props.popupId);\n }\n\n return (\n <>\n Would you like to quit your job at {props.company.name}?\n <br />\n <br />\n <button autoFocus={true} className=\"std-button\" onClick={quit}>\n Quit\n </button>\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 * as React from \"react\";\n\nimport { Location } from \"../Location\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getServer } from \"../../Server/ServerHelpers\";\nimport { Server } from \"../../Server/Server\";\nimport { SpecialServerIps } from \"../../Server/SpecialServerIps\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\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 class GymLocation extends React.Component<IProps, any> {\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.trainStrength = this.trainStrength.bind(this);\n this.trainDefense = this.trainDefense.bind(this);\n this.trainDexterity = this.trainDexterity.bind(this);\n this.trainAgility = this.trainAgility.bind(this);\n\n this.calculateCost = this.calculateCost.bind(this);\n }\n\n calculateCost(): number {\n const ip = SpecialServerIps.getIp(this.props.loc.name);\n const server = getServer(ip);\n if (server == null || !server.hasOwnProperty(\"backdoorInstalled\")) return this.props.loc.costMult;\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return this.props.loc.costMult * discount;\n }\n\n train(stat: string): void {\n const loc = this.props.loc;\n this.props.p.startClass(this.props.router, this.calculateCost(), loc.expMult, stat);\n }\n\n trainStrength(): void {\n this.train(CONSTANTS.ClassGymStrength);\n }\n\n trainDefense(): void {\n this.train(CONSTANTS.ClassGymDefense);\n }\n\n trainDexterity(): void {\n this.train(CONSTANTS.ClassGymDexterity);\n }\n\n trainAgility(): void {\n this.train(CONSTANTS.ClassGymAgility);\n }\n\n render(): React.ReactNode {\n const cost = CONSTANTS.ClassGymBaseCost * this.calculateCost();\n\n return (\n <div>\n <StdButton\n onClick={this.trainStrength}\n style={this.btnStyle}\n text={\n <>\n Train Strength (<Money money={cost} player={this.props.p} /> / sec)\n </>\n }\n />\n <StdButton\n onClick={this.trainDefense}\n style={this.btnStyle}\n text={\n <>\n Train Defense (<Money money={cost} player={this.props.p} /> / sec)\n </>\n }\n />\n <StdButton\n onClick={this.trainDexterity}\n style={this.btnStyle}\n text={\n <>\n Train Dexterity (<Money money={cost} player={this.props.p} /> / sec)\n </>\n }\n />\n <StdButton\n onClick={this.trainAgility}\n style={this.btnStyle}\n text={\n <>\n Train Agility (<Money money={cost} player={this.props.p} /> / sec)\n </>\n }\n />\n </div>\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\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\n\nimport { AutoupdatingStdButton } from \"../../ui/React/AutoupdatingStdButton\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../../utils/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 <AutoupdatingStdButton\n onClick={this.getHealed}\n style={this.btnStyle}\n text={\n <>\n Get treatment for wounds - <Money money={cost} player={this.props.p} />\n </>\n }\n />\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\";\n\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { AutoupdatingStdButton } from \"../../ui/React/AutoupdatingStdButton\";\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 <div>\n <AutoupdatingStdButton\n label={`Shoplift (${numeralWrapper.formatPercentage(shopliftChance)} chance of success)`}\n intervalTime={5e3}\n onClick={shoplift}\n style={{ display: \"block\" }}\n text={`Shoplift (${numeralWrapper.formatPercentage(shopliftChance)} chance of success)`}\n tooltip={\"Attempt to shoplift from a low-end retailer\"}\n />\n <AutoupdatingStdButton\n label={`Rob store (${numeralWrapper.formatPercentage(robStoreChance)} chance of success)`}\n intervalTime={5e3}\n onClick={robStore}\n style={{ display: \"block\" }}\n text={`Rob store (${numeralWrapper.formatPercentage(robStoreChance)} chance of success)`}\n tooltip={\"Attempt to commit armed robbery on a high-end store\"}\n />\n <AutoupdatingStdButton\n label={`Mug someone (${numeralWrapper.formatPercentage(mugChance)} chance of success)`}\n intervalTime={5e3}\n onClick={mug}\n style={{ display: \"block\" }}\n text={`Mug someone (${numeralWrapper.formatPercentage(mugChance)} chance of success)`}\n tooltip={\"Attempt to mug a random person on the street\"}\n />\n <AutoupdatingStdButton\n label={`Larceny (${numeralWrapper.formatPercentage(larcenyChance)} chance of success)`}\n intervalTime={5e3}\n onClick={larceny}\n style={{ display: \"block\" }}\n text={`Larceny (${numeralWrapper.formatPercentage(larcenyChance)} chance of success)`}\n tooltip={\"Attempt to rob property from someone's house\"}\n />\n <AutoupdatingStdButton\n label={`Deal Drugs (${numeralWrapper.formatPercentage(drugsChance)} chance of success)`}\n intervalTime={5e3}\n onClick={dealDrugs}\n style={{ display: \"block\" }}\n text={`Deal Drugs (${numeralWrapper.formatPercentage(drugsChance)} chance of success)`}\n tooltip={\"Attempt to deal drugs\"}\n />\n <AutoupdatingStdButton\n label={`Bond Forgery (${numeralWrapper.formatPercentage(bondChance)} chance of success)`}\n intervalTime={5e3}\n onClick={bondForgery}\n style={{ display: \"block\" }}\n text={`Bond Forgery (${numeralWrapper.formatPercentage(bondChance)} chance of success)`}\n tooltip={\"Attempt to forge corporate bonds\"}\n />\n <AutoupdatingStdButton\n label={`Traffick illegal Arms (${numeralWrapper.formatPercentage(armsChance)} chance of success)`}\n intervalTime={5e3}\n onClick={traffickArms}\n style={{ display: \"block\" }}\n text={`Traffick illegal Arms (${numeralWrapper.formatPercentage(armsChance)} chance of success)`}\n tooltip={\"Attempt to smuggle illegal arms into the city\"}\n />\n <AutoupdatingStdButton\n label={`Homicide (${numeralWrapper.formatPercentage(homicideChance)} chance of success)`}\n intervalTime={5e3}\n onClick={homicide}\n style={{ display: \"block\" }}\n text={`Homicide (${numeralWrapper.formatPercentage(homicideChance)} chance of success)`}\n tooltip={\"Attempt to murder a random person on the street\"}\n />\n <AutoupdatingStdButton\n label={`Grand theft Auto (${numeralWrapper.formatPercentage(gtaChance)} chance of success)`}\n intervalTime={5e3}\n onClick={grandTheftAuto}\n style={{ display: \"block\" }}\n text={`Grand theft Auto (${numeralWrapper.formatPercentage(gtaChance)} chance of success)`}\n tooltip={\"Attempt to commit grand theft auto\"}\n />\n <AutoupdatingStdButton\n label={`Kidnap and Ransom (${numeralWrapper.formatPercentage(kidnapChance)} chance of success)`}\n intervalTime={5e3}\n onClick={kidnap}\n style={{ display: \"block\" }}\n text={`Kidnap and Ransom (${numeralWrapper.formatPercentage(kidnapChance)} chance of success)`}\n tooltip={\"Attempt to kidnap and ransom a high-profile-target\"}\n />\n <AutoupdatingStdButton\n label={`Assassinate (${numeralWrapper.formatPercentage(assassinateChance)} chance of success)`}\n intervalTime={5e3}\n onClick={assassinate}\n style={{ display: \"block\" }}\n text={`Assassinate (${numeralWrapper.formatPercentage(assassinateChance)} chance of success)`}\n tooltip={\"Attempt to assassinate a high-profile target\"}\n />\n <AutoupdatingStdButton\n label={`Heist (${numeralWrapper.formatPercentage(heistChance)} chance of success)`}\n intervalTime={5e3}\n onClick={heist}\n style={{ display: \"block\" }}\n text={`Heist (${numeralWrapper.formatPercentage(heistChance)} chance of success)`}\n tooltip={\"Attempt to pull off the ultimate heist\"}\n />\n </div>\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\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationPopup } from \"../../Corporation/ui/CreateCorporationPopup\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { AutoupdatingStdButton } from \"../../ui/React/AutoupdatingStdButton\";\nimport { StdButton } from \"../../ui/React/StdButton\";\n\nimport { dialogBoxCreate } from \"../../../utils/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 * Click handler for \"Create Corporation\" button at Sector-12 City Hall\n */\n function createCorporationPopup(): void {\n const popupId = `create-start-corporation-popup`;\n createPopup(popupId, CreateCorporationPopup, {\n player: player,\n popupId: popupId,\n router: router,\n });\n }\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 <StdButton onClick={handleBladeburner} style={{ display: \"block\" }} text={text} />;\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 <StdButton onClick={EatNoodles} style={{ display: \"block\" }} text={\"Eat noodles\"} />;\n }\n\n function renderCreateCorporation(): React.ReactElement {\n if (!player.canAccessCorporation()) {\n return (\n <>\n <p>\n <i>A business man is yelling at a clerk. You should come back later.</i>\n </p>\n </>\n );\n }\n return (\n <AutoupdatingStdButton\n disabled={!player.canAccessCorporation() || player.hasCorporation()}\n onClick={createCorporationPopup}\n style={{ display: \"block\" }}\n text={\"Create a Corporation\"}\n />\n );\n }\n\n function renderResleeving(): React.ReactElement {\n if (!player.canAccessResleeving()) {\n return <></>;\n }\n return <StdButton onClick={handleResleeving} style={{ display: \"block\" }} text={\"Re-Sleeve\"} />;\n }\n\n switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderResleeving();\n }\n case LocationName.Sector12CityHall: {\n return renderCreateCorporation();\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\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 { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\nimport { IRouter } from \"../../ui/Router\";\n\ninterface IProps {\n player: IPlayer;\n popupId: string;\n router: IRouter;\n}\n\nexport function CreateCorporationPopup(props: IProps): React.ReactElement {\n if (!props.player.canAccessCorporation() || props.player.hasCorporation()) {\n removePopup(props.popupId);\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 (!props.player.canAfford(150e9)) {\n dialogBoxCreate(\"You don't have enough money to create a corporation! You need $150b.\");\n return;\n }\n\n if (name == \"\") {\n dialogBoxCreate(\"Invalid company name!\");\n return;\n }\n\n props.player.startCorporation(name);\n props.player.loseMoney(150e9);\n\n dialogBoxCreate(\n \"Congratulations! You just self-funded your own corporation. You can visit \" +\n \"and manage your company in the City.\",\n );\n removePopup(props.popupId);\n props.router.toCorporation();\n }\n\n function seed(): void {\n if (name == \"\") {\n dialogBoxCreate(\"Invalid company name!\");\n return;\n }\n\n props.player.startCorporation(name, 500e6);\n\n dialogBoxCreate(\n \"Congratulations! You just started your own corporation with government seed money. \" +\n \"You can visit and manage your company in the City.\",\n );\n removePopup(props.popupId);\n props.router.toCorporation();\n }\n\n return (\n <>\n <p>\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 </p>\n <input autoFocus={true} className=\"text-input\" placeholder=\"Corporation Name\" onChange={onChange} value={name} />\n <button className=\"std-button\" onClick={seed} disabled={name == \"\"}>\n Use seed money\n </button>\n <button className=\"std-button\" onClick={selfFund} disabled={name == \"\" || !props.player.canAfford(150e9)}>\n Self-Fund (<Money money={150e9} player={props.player} />)\n </button>\n </>\n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a tech vendor\n *\n * This subcomponent renders all of the buttons for purchasing things from tech vendors\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { Location } from \"../Location\";\nimport { RamButton } from \"./RamButton\";\nimport { TorButton } from \"./TorButton\";\nimport { CoresButton } from \"./CoresButton\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getPurchaseServerCost } from \"../../Server/ServerPurchases\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { Money } from \"../../ui/React/Money\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { PurchaseServerPopup } from \"./PurchaseServerPopup\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n};\n\nexport function TechVendorLocation(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function openPurchaseServer(ram: number, cost: number, p: IPlayer): void {\n const popupId = \"purchase-server-popup\";\n createPopup(popupId, PurchaseServerPopup, {\n ram: ram,\n cost: cost,\n p: p,\n popupId: popupId,\n rerender: rerender,\n });\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n const btnStyle = { display: \"block\" };\n\n const purchaseServerButtons: React.ReactNode[] = [];\n for (let i = props.loc.techVendorMinRam; i <= props.loc.techVendorMaxRam; i *= 2) {\n const cost = getPurchaseServerCost(i);\n purchaseServerButtons.push(\n <StdButton\n key={i}\n onClick={() => openPurchaseServer(i, cost, props.p)}\n style={btnStyle}\n text={\n <>\n Purchase {i}GB Server - <Money money={cost} player={props.p} />\n </>\n }\n disabled={!props.p.canAfford(cost)}\n />,\n );\n }\n\n return (\n <div>\n {purchaseServerButtons}\n <br />\n <p className=\"noselect\">\n <i>\"You can order bigger servers via scripts. We don't take custom order in person.\"</i>\n </p>\n <br />\n <TorButton p={props.p} rerender={rerender} />\n <RamButton p={props.p} rerender={rerender} />\n <CoresButton p={props.p} rerender={rerender} />\n </div>\n );\n}\n","import React from \"react\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { purchaseRamForHomeComputer } from \"../../Server/ServerPurchases\";\n\nimport { StdButtonPurchased } from \"../../ui/React/StdButtonPurchased\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MathComponent } from \"mathjax-react\";\n\ntype IProps = {\n p: IPlayer;\n rerender: () => void;\n};\n\nexport function RamButton(props: IProps): React.ReactElement {\n const btnStyle = { display: \"block\" };\n\n const homeComputer = props.p.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n return <StdButtonPurchased style={btnStyle} text={\"Upgrade 'home' RAM - MAX\"} />;\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 <StdButton\n disabled={!props.p.canAfford(cost)}\n onClick={buy}\n style={btnStyle}\n text={\n <>\n Upgrade 'home' RAM ({homeComputer.maxRam}GB -&gt; {homeComputer.maxRam * 2}GB) -{\" \"}\n <Money money={cost} player={props.p} />\n </>\n }\n tooltip={<MathComponent tex={String.raw`\\large{cost = 3.2 \\times 10^3 \\times 1.58^{log_2{(ram)}}}`} />}\n />\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","import React from \"react\";\n\nimport { purchaseTorRouter } from \"../LocationsHelpers\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { StdButtonPurchased } from \"../../ui/React/StdButtonPurchased\";\nimport { StdButton } from \"../../ui/React/StdButton\";\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 const btnStyle = { display: \"block\" };\n\n function buy(): void {\n purchaseTorRouter(props.p);\n props.rerender();\n }\n\n if (props.p.hasTorRouter()) {\n return <StdButtonPurchased style={btnStyle} text={\"TOR Router - Purchased\"} />;\n }\n\n return (\n <StdButton\n disabled={!props.p.canAfford(CONSTANTS.TorRouterCost)}\n onClick={buy}\n style={btnStyle}\n text={\n <>\n Purchase TOR router - <Money money={CONSTANTS.TorRouterCost} player={props.p} />\n </>\n }\n />\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\";\nimport { SpecialServerIps } from \"../Server/SpecialServerIps\";\n\nimport { dialogBoxCreate } from \"../../utils/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 SpecialServerIps.addIp(\"Darkweb Server\", darkweb.ip);\n\n p.getHomeComputer().serversOnNetwork.push(darkweb.ip);\n darkweb.serversOnNetwork.push(p.getHomeComputer().ip);\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\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { StdButtonPurchased } from \"../../ui/React/StdButtonPurchased\";\nimport { StdButton } from \"../../ui/React/StdButton\";\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 btnStyle = { display: \"block\" };\n\n const homeComputer = props.p.getHomeComputer();\n const maxCores = homeComputer.cpuCores >= 8;\n if (maxCores) {\n return <StdButtonPurchased style={btnStyle} text={\"Upgrade 'home' cores - MAX\"} />;\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 <StdButton\n disabled={!props.p.canAfford(cost)}\n onClick={buy}\n style={btnStyle}\n text={\n <>\n Upgrade 'home' cores ({homeComputer.cpuCores} -&gt; {homeComputer.cpuCores + 1}) -{\" \"}\n <Money money={cost} player={props.p} />\n </>\n }\n tooltip={<MathComponent tex={String.raw`\\large{cost = 10^9 \\times 7.5 ^{\\text{cores}}}`} />}\n />\n );\n}\n","/**\n * React Component for the popup used to purchase a new server.\n */\nimport React, { useState } from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { purchaseServer } from \"../../Server/ServerPurchases\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { StdButton } from \"../../ui/React/StdButton\";\n\ninterface IPurchaseServerPopupProps {\n ram: number;\n cost: number;\n p: IPlayer;\n popupId: string;\n rerender: () => void;\n}\n\nexport function PurchaseServerPopup(props: IPurchaseServerPopupProps): React.ReactElement {\n const [hostname, setHostname] = useState(\"\");\n\n function tryToPurchaseServer(): void {\n purchaseServer(hostname, props.ram, props.cost, props.p);\n\n removePopup(props.popupId);\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 <>\n Would you like to purchase a new server with {numeralWrapper.formatRAM(props.ram)} of RAM for{\" \"}\n <Money money={props.cost} player={props.p} />?\n <br />\n <br />\n Please enter the server hostname below:\n <br />\n <div className=\"popup-box-input-div\">\n <input\n autoFocus\n onKeyUp={onKeyUp}\n onChange={onChange}\n className=\"text-input noselect\"\n type=\"text\"\n placeholder=\"Unique Hostname\"\n />\n <StdButton onClick={tryToPurchaseServer} text=\"Purchase Server\" disabled={!props.p.canAfford(props.cost)} />\n </div>\n </>\n );\n}\n","import React from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Money } from \"../../ui/React/Money\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n player: IPlayer;\n city: string;\n travel: () => void;\n popupId: string;\n}\n\nexport function TravelConfirmationPopup(props: IProps): React.ReactElement {\n const cost = CONSTANTS.TravelCost;\n function travel(): void {\n props.travel();\n removePopup(props.popupId);\n }\n\n return (\n <>\n <span>\n Would you like to travel to {props.city}? The trip will cost <Money money={cost} player={props.player} />.\n </span>\n <br />\n <br />\n <button className=\"std-button\" onClick={travel}>\n Travel\n </button>\n </>\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\";\n\nimport { Location } from \"../Location\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { getServer } from \"../../Server/ServerHelpers\";\nimport { Server } from \"../../Server/Server\";\nimport { SpecialServerIps } from \"../../Server/SpecialServerIps\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\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 ip = SpecialServerIps.getIp(props.loc.name);\n const server = getServer(ip);\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 <div>\n <StdButton\n onClick={study}\n style={{ display: \"block\" }}\n text={`Study Computer Science (free)`}\n tooltip={earnHackingExpTooltip}\n />\n <StdButton\n onClick={dataStructures}\n style={{ display: \"block\" }}\n text={\n <>\n Take Data Structures course (\n <Money money={dataStructuresCost} player={player} /> / sec)\n </>\n }\n tooltip={earnHackingExpTooltip}\n />\n <StdButton\n onClick={networks}\n style={{ display: \"block\" }}\n text={\n <>\n Take Networks course (\n <Money money={networksCost} player={player} /> / sec)\n </>\n }\n tooltip={earnHackingExpTooltip}\n />\n <StdButton\n onClick={algorithms}\n style={{ display: \"block\" }}\n text={\n <>\n Take Algorithms course (\n <Money money={algorithmsCost} player={player} /> / sec)\n </>\n }\n tooltip={earnHackingExpTooltip}\n />\n <StdButton\n onClick={management}\n style={{ display: \"block\" }}\n text={\n <>\n Take Management course (\n <Money money={managementCost} player={player} /> / sec)\n </>\n }\n tooltip={earnCharismaExpTooltip}\n />\n <StdButton\n onClick={leadership}\n style={{ display: \"block\" }}\n text={\n <>\n Take Leadership course (\n <Money money={leadershipCost} player={player} /> / sec)\n </>\n }\n tooltip={earnCharismaExpTooltip}\n />\n </div>\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 { Blackjack } from \"../../Casino/Blackjack\";\nimport { CoinFlip } from \"../../Casino/CoinFlip\";\nimport { Roulette } from \"../../Casino/Roulette\";\nimport { SlotMachine } from \"../../Casino/SlotMachine\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { StdButton } from \"../../ui/React/StdButton\";\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\ntype IState = {\n game: GameType;\n};\n\nexport class CasinoLocation extends React.Component<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n game: GameType.None,\n };\n\n this.updateGame = this.updateGame.bind(this);\n }\n\n updateGame(game: GameType): void {\n this.setState({\n game,\n });\n }\n\n renderGames(): React.ReactNode {\n return (\n <>\n <StdButton onClick={() => this.updateGame(GameType.Coin)} text={\"Play coin flip\"} />\n <br />\n <StdButton onClick={() => this.updateGame(GameType.Slots)} text={\"Play slots\"} />\n <br />\n <StdButton onClick={() => this.updateGame(GameType.Roulette)} text={\"Play roulette\"} />\n <br />\n <StdButton onClick={() => this.updateGame(GameType.Blackjack)} text={\"Play blackjack\"} />\n </>\n );\n }\n\n renderGame(): React.ReactNode {\n let elem = null;\n switch (this.state.game) {\n case GameType.Coin:\n elem = <CoinFlip p={this.props.p} />;\n break;\n case GameType.Slots:\n elem = <SlotMachine p={this.props.p} />;\n break;\n case GameType.Roulette:\n elem = <Roulette p={this.props.p} />;\n break;\n case GameType.Blackjack:\n elem = <Blackjack p={this.props.p} />;\n break;\n case GameType.None:\n break;\n default:\n throw new Error(`MissingCaseException: ${this.state.game}`);\n }\n\n return (\n <>\n <StdButton onClick={() => this.updateGame(GameType.None)} text={\"Stop playing\"} />\n {elem}\n </>\n );\n }\n\n render(): React.ReactNode {\n if (this.state.game === GameType.None) {\n return this.renderGames();\n } else {\n return this.renderGame();\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 { MuiTextField } from \"../ui/React/MuiTextField\";\nimport { MuiButton } from \"../ui/React/MuiButton\";\nimport { MuiPaper } from \"../ui/React/MuiPaper\";\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 <div>\n {/* Wager input */}\n <div>\n <MuiTextField\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 variant=\"filled\"\n style={{\n width: \"200px\",\n }}\n InputProps={{\n startAdornment: <InputAdornment position=\"start\">$</InputAdornment>,\n }}\n />\n\n <p>\n {\"Total earnings this session: \"}\n <Money money={gains} />\n </p>\n </div>\n\n {/* Buttons */}\n {!gameInProgress ? (\n <div>\n <MuiButton onClick={this.startOnClick} disabled={wagerInvalid || !this.canStartGame()}>\n Start\n </MuiButton>\n </div>\n ) : (\n <div>\n <MuiButton onClick={this.playerHit}>Hit</MuiButton>\n <MuiButton color=\"secondary\" onClick={this.playerStay}>\n Stay\n </MuiButton>\n </div>\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 <div>\n <MuiPaper variant=\"outlined\" 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 </MuiPaper>\n\n <br />\n\n <MuiPaper variant=\"outlined\" 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 </MuiPaper>\n </div>\n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n <p>\n {result}\n {this.isPlayerWinResult(result) && (\n <>\n {\" You gained \"}\n <Money money={this.state.bet} />\n </>\n )}\n {result === Result.DealerWon && (\n <>\n {\" You lost \"}\n <Money money={this.state.bet} />\n </>\n )}\n </p>\n )}\n </div>\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 * Wrapper around material-ui's TextField component that styles it with\n * Bitburner's UI theme\n */\n\nimport React from \"react\";\nimport { TextField, TextFieldProps } from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nconst backgroundColorStyles = {\n backgroundColor: \"rgba(57, 54, 54, 0.9)\",\n \"&:hover\": {\n backgroundColor: \"rgba(70, 70, 70, 0.9)\",\n },\n};\n\nconst formControlStyles = {\n border: \"1px solid #e2e2e1\",\n overflow: \"hidden\",\n borderRadius: 4,\n color: \"white\",\n ...backgroundColorStyles,\n};\n\nconst useStyles = makeStyles({\n root: {\n ...formControlStyles,\n },\n});\n\nconst useInputStyles = makeStyles({\n root: {\n ...backgroundColorStyles,\n color: \"white\",\n },\n focused: {\n backgroundColor: \"rgba(70, 70, 70, 0.9)\",\n },\n disabled: {\n color: \"white\",\n },\n});\n\nconst useLabelStyles = makeStyles({\n root: {\n color: \"white\",\n },\n focused: {\n color: \"white !important\", // Need important to override styles from FormLabel\n },\n disabled: {\n color: \"white !important\", // Need important to override styles from FormLabel\n },\n});\n\nexport const MuiTextField: React.FC<TextFieldProps> = (props: TextFieldProps) => {\n return (\n <TextField\n {...props}\n classes={{\n ...useStyles(),\n ...props.classes,\n }}\n InputProps={{\n classes: {\n ...useInputStyles(),\n ...props.InputProps?.classes,\n },\n ...props.InputProps,\n }}\n InputLabelProps={{\n classes: {\n ...useLabelStyles(),\n ...props.InputLabelProps?.classes,\n },\n ...props.InputLabelProps,\n }}\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 * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { StdButton } from \"../ui/React/StdButton\";\nimport { BadRNG } from \"./RNG\";\nimport { Game } from \"./Game\";\nimport { trusted } from \"./utils\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n investment: number;\n result: any;\n status: string;\n playLock: boolean;\n};\n\nconst minPlay = 0;\nconst maxPlay = 10e3;\n\nexport class CoinFlip extends Game<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n investment: 1000,\n result: <span> </span>,\n status: \"\",\n playLock: false,\n };\n\n this.play = this.play.bind(this);\n this.updateInvestment = this.updateInvestment.bind(this);\n }\n\n updateInvestment(e: React.FormEvent<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 this.setState({ investment: investment });\n }\n\n play(guess: string): void {\n if (this.reachedLimit(this.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 this.setState({\n result: <span className={correct ? \"text\" : \"failure\"}>{letter}</span>,\n status: correct ? \" win!\" : \"lose!\",\n playLock: true,\n });\n setTimeout(() => this.setState({ playLock: false }), 250);\n if (correct) {\n this.win(this.props.p, this.state.investment);\n } else {\n this.win(this.props.p, -this.state.investment);\n }\n if (this.reachedLimit(this.props.p)) return;\n }\n\n render(): React.ReactNode {\n return (\n <>\n <pre>{`+———————+`}</pre>\n <pre>{`| | | |`}</pre>\n <pre>\n {`| | `}\n {this.state.result}\n {` | |`}\n </pre>\n <pre>{`| | | |`}</pre>\n <pre>{`+———————+`}</pre>\n <span className=\"text\">Play for: </span>\n <input type=\"number\" className=\"text-input\" onChange={this.updateInvestment} value={this.state.investment} />\n <br />\n <StdButton onClick={trusted(() => this.play(\"H\"))} text={\"Head!\"} disabled={this.state.playLock} />\n <StdButton onClick={trusted(() => this.play(\"T\"))} text={\"Tail!\"} disabled={this.state.playLock} />\n <h1>{this.state.status}</h1>\n </>\n );\n }\n}\n","import * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { StdButton } from \"../ui/React/StdButton\";\nimport { Money } from \"../ui/React/Money\";\nimport { Game } from \"./Game\";\nimport { WHRNG } from \"./RNG\";\nimport { trusted } from \"./utils\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n investment: number;\n canPlay: boolean;\n status: string | JSX.Element;\n n: number;\n lock: boolean;\n strategy: Strategy;\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 class Roulette extends Game<IProps, IState> {\n interval = -1;\n rng: WHRNG;\n\n constructor(props: IProps) {\n super(props);\n\n this.rng = new WHRNG(new Date().getTime());\n this.state = {\n investment: 1000,\n canPlay: true,\n status: \"waiting\",\n n: 0,\n lock: true,\n strategy: {\n payout: 0,\n match: (): boolean => {\n return false;\n },\n },\n };\n\n this.step = this.step.bind(this);\n this.currentNumber = this.currentNumber.bind(this);\n this.updateInvestment = this.updateInvestment.bind(this);\n }\n\n componentDidMount(): void {\n this.interval = window.setInterval(this.step, 50);\n }\n\n step(): void {\n if (!this.state.lock) {\n this.setState({ n: Math.floor(Math.random() * 37) });\n }\n }\n\n componentWillUnmount(): void {\n clearInterval(this.interval);\n }\n\n updateInvestment(e: React.FormEvent<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 this.setState({ investment: investment });\n }\n\n currentNumber(): string {\n if (this.state.n === 0) return \"0\";\n const color = isRed(this.state.n) ? \"R\" : \"B\";\n return `${this.state.n}${color}`;\n }\n\n play(s: Strategy): void {\n if (this.reachedLimit(this.props.p)) return;\n this.setState({\n canPlay: false,\n lock: false,\n status: \"playing\",\n strategy: s,\n });\n setTimeout(() => {\n let n = Math.floor(this.rng.random() * 37);\n let status = <></>;\n let gain = 0;\n let playerWin = this.state.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 (this.state.strategy.match(n)) {\n n = (n + 1) % 36;\n }\n }\n if (playerWin) {\n gain = this.state.investment * this.state.strategy.payout;\n status = (\n <>\n won <Money money={gain} />\n </>\n );\n } else {\n gain = -this.state.investment;\n status = (\n <>\n lost <Money money={-gain} />\n </>\n );\n }\n this.win(this.props.p, gain);\n this.setState({\n canPlay: true,\n lock: true,\n status: status,\n n: n,\n });\n this.reachedLimit(this.props.p);\n }, 1600);\n }\n\n render(): React.ReactNode {\n return (\n <>\n <h1>{this.currentNumber()}</h1>\n <input\n type=\"number\"\n className=\"text-input\"\n onChange={this.updateInvestment}\n placeholder={\"Amount to play\"}\n value={this.state.investment}\n disabled={!this.state.canPlay}\n />\n <h1>{this.state.status}</h1>\n <table>\n <tbody>\n <tr>\n <td>\n <StdButton text={\"3\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(3)))} />\n </td>\n <td>\n <StdButton text={\"6\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(6)))} />\n </td>\n <td>\n <StdButton text={\"9\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(9)))} />\n </td>\n <td>\n <StdButton text={\"12\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(12)))} />\n </td>\n <td>\n <StdButton text={\"15\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(15)))} />\n </td>\n <td>\n <StdButton text={\"18\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(18)))} />\n </td>\n <td>\n <StdButton text={\"21\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(21)))} />\n </td>\n <td>\n <StdButton text={\"24\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(24)))} />\n </td>\n <td>\n <StdButton text={\"27\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(27)))} />\n </td>\n <td>\n <StdButton text={\"30\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(30)))} />\n </td>\n <td>\n <StdButton text={\"33\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(33)))} />\n </td>\n <td>\n <StdButton text={\"36\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(36)))} />\n </td>\n </tr>\n <tr>\n <td>\n <StdButton text={\"2\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(2)))} />\n </td>\n <td>\n <StdButton text={\"5\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(5)))} />\n </td>\n <td>\n <StdButton text={\"8\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(8)))} />\n </td>\n <td>\n <StdButton text={\"11\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(11)))} />\n </td>\n <td>\n <StdButton text={\"14\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(14)))} />\n </td>\n <td>\n <StdButton text={\"17\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(17)))} />\n </td>\n <td>\n <StdButton text={\"20\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(20)))} />\n </td>\n <td>\n <StdButton text={\"23\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(23)))} />\n </td>\n <td>\n <StdButton text={\"26\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(26)))} />\n </td>\n <td>\n <StdButton text={\"29\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(29)))} />\n </td>\n <td>\n <StdButton text={\"32\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(32)))} />\n </td>\n <td>\n <StdButton text={\"35\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(35)))} />\n </td>\n </tr>\n <tr>\n <td>\n <StdButton text={\"1\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(1)))} />\n </td>\n <td>\n <StdButton text={\"4\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(4)))} />\n </td>\n <td>\n <StdButton text={\"7\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(7)))} />\n </td>\n <td>\n <StdButton text={\"10\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(10)))} />\n </td>\n <td>\n <StdButton text={\"13\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(13)))} />\n </td>\n <td>\n <StdButton text={\"16\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(16)))} />\n </td>\n <td>\n <StdButton text={\"19\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(19)))} />\n </td>\n <td>\n <StdButton text={\"22\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(22)))} />\n </td>\n <td>\n <StdButton text={\"25\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(25)))} />\n </td>\n <td>\n <StdButton text={\"28\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(28)))} />\n </td>\n <td>\n <StdButton text={\"31\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(31)))} />\n </td>\n <td>\n <StdButton text={\"34\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(34)))} />\n </td>\n </tr>\n <tr>\n <td colSpan={4}>\n <StdButton\n text={\"1 to 12\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Third1))}\n />\n </td>\n <td colSpan={4}>\n <StdButton\n text={\"13 to 24\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Third2))}\n />\n </td>\n <td colSpan={4}>\n <StdButton\n text={\"25 to 36\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Third3))}\n />\n </td>\n </tr>\n <tr>\n <td colSpan={2}>\n <StdButton\n text={\"Red\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Red))}\n />\n </td>\n <td colSpan={2}>\n <StdButton\n text={\"Black\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Black))}\n />\n </td>\n <td colSpan={2}>\n <StdButton\n text={\"Odd\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Odd))}\n />\n </td>\n <td colSpan={2}>\n <StdButton\n text={\"Even\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Even))}\n />\n </td>\n <td colSpan={2}>\n <StdButton\n text={\"High\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.High))}\n />\n </td>\n <td colSpan={2}>\n <StdButton\n text={\"Low\"}\n disabled={!this.state.canPlay}\n onClick={trusted(() => this.play(strategies.Low))}\n />\n </td>\n </tr>\n <tr>\n <td>\n <StdButton text={\"0\"} disabled={!this.state.canPlay} onClick={trusted(() => this.play(Single(0)))} />\n </td>\n </tr>\n </tbody>\n </table>\n </>\n );\n }\n}\n","import * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { StdButton } from \"../ui/React/StdButton\";\nimport { Money } from \"../ui/React/Money\";\nimport { WHRNG } from \"./RNG\";\nimport { Game } from \"./Game\";\nimport { trusted } from \"./utils\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n index: number[];\n locks: number[];\n investment: number;\n canPlay: boolean;\n status: string | JSX.Element;\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 class SlotMachine extends Game<IProps, IState> {\n rng: WHRNG;\n interval = -1;\n\n constructor(props: IProps) {\n super(props);\n this.rng = new WHRNG(this.props.p.totalPlaytime);\n\n this.state = {\n index: [0, 0, 0, 0, 0],\n investment: 1000,\n locks: [0, 0, 0, 0, 0],\n canPlay: true,\n status: \"waiting\",\n };\n\n this.play = this.play.bind(this);\n this.lock = this.lock.bind(this);\n this.unlock = this.unlock.bind(this);\n this.step = this.step.bind(this);\n this.checkWinnings = this.checkWinnings.bind(this);\n this.getTable = this.getTable.bind(this);\n this.updateInvestment = this.updateInvestment.bind(this);\n }\n\n componentDidMount(): void {\n this.interval = window.setInterval(this.step, 50);\n }\n\n step(): void {\n let stoppedOne = false;\n const index = this.state.index.slice();\n for (const i in index) {\n if (index[i] === this.state.locks[i] && !stoppedOne) continue;\n index[i] = (index[i] + 1) % symbols.length;\n stoppedOne = true;\n }\n\n this.setState({ index: index });\n\n if (stoppedOne && index.every((e, i) => e === this.state.locks[i])) {\n this.checkWinnings();\n }\n }\n\n componentWillUnmount(): void {\n clearInterval(this.interval);\n }\n\n getTable(): string[][] {\n return [\n [\n symbols[(this.state.index[0] + symbols.length - 1) % symbols.length],\n symbols[(this.state.index[1] + symbols.length - 1) % symbols.length],\n symbols[(this.state.index[2] + symbols.length - 1) % symbols.length],\n symbols[(this.state.index[3] + symbols.length - 1) % symbols.length],\n symbols[(this.state.index[4] + symbols.length - 1) % symbols.length],\n ],\n [\n symbols[this.state.index[0]],\n symbols[this.state.index[1]],\n symbols[this.state.index[2]],\n symbols[this.state.index[3]],\n symbols[this.state.index[4]],\n ],\n [\n symbols[(this.state.index[0] + 1) % symbols.length],\n symbols[(this.state.index[1] + 1) % symbols.length],\n symbols[(this.state.index[2] + 1) % symbols.length],\n symbols[(this.state.index[3] + 1) % symbols.length],\n symbols[(this.state.index[4] + 1) % symbols.length],\n ],\n ];\n }\n\n play(): void {\n if (this.reachedLimit(this.props.p)) return;\n this.setState({ status: \"playing\" });\n this.win(this.props.p, -this.state.investment);\n if (!this.state.canPlay) return;\n this.unlock();\n setTimeout(this.lock, this.rng.random() * 2000 + 1000);\n }\n\n lock(): void {\n this.setState({\n locks: [\n Math.floor(this.rng.random() * symbols.length),\n Math.floor(this.rng.random() * symbols.length),\n Math.floor(this.rng.random() * symbols.length),\n Math.floor(this.rng.random() * symbols.length),\n Math.floor(this.rng.random() * symbols.length),\n ],\n });\n }\n\n checkWinnings(): void {\n const t = this.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 = -this.state.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 += this.state.investment * payout;\n this.win(this.props.p, this.state.investment * payout);\n }\n\n this.setState({\n status: (\n <>\n {gains > 0 ? \"gained\" : \"lost\"} <Money money={Math.abs(gains)} />\n </>\n ),\n canPlay: true,\n });\n if (this.reachedLimit(this.props.p)) return;\n }\n\n unlock(): void {\n this.setState({\n locks: [-1, -1, -1, -1, -1],\n canPlay: false,\n });\n }\n\n updateInvestment(e: React.FormEvent<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 this.setState({ investment: investment });\n }\n\n render(): React.ReactNode {\n const t = this.getTable();\n // prettier-ignore\n return (\n <>\n<pre>+———————————————————————+</pre>\n<pre>| | {t[0][0]} | {t[0][1]} | {t[0][2]} | {t[0][3]} | {t[0][4]} | |</pre>\n<pre>| | | | | | | |</pre>\n<pre>| | {symbols[this.state.index[0]]} | {symbols[this.state.index[1]]} | {symbols[this.state.index[2]]} | {symbols[this.state.index[3]]} | {symbols[this.state.index[4]]} | |</pre>\n<pre>| | | | | | | |</pre>\n<pre>| | {symbols[(this.state.index[0]+1)%symbols.length]} | {symbols[(this.state.index[1]+1)%symbols.length]} | {symbols[(this.state.index[2]+1)%symbols.length]} | {symbols[(this.state.index[3]+1)%symbols.length]} | {symbols[(this.state.index[4]+1)%symbols.length]} | |</pre>\n<pre>+———————————————————————+</pre>\n <input\n type=\"number\"\n className=\"text-input\"\n onChange={this.updateInvestment}\n placeholder={\"Amount to play\"}\n value={this.state.investment}\n disabled={!this.state.canPlay}\n />\n <StdButton\n onClick={trusted(this.play)}\n text={\"Spin!\"}\n disabled={!this.state.canPlay}\n />\n <h1>{this.state.status}</h1>\n <h2>Pay lines</h2>\n\n<pre>----- ····· ·····</pre>\n<pre>····· ----- ·····</pre>\n<pre>····· ····· -----</pre>\n<br />\n\n<pre>··^·· \\···/ \\···/</pre>\n<pre>·/·\\· ·\\·/· ·---·</pre>\n<pre>/···\\ ··v·· ·····</pre>\n<br />\n\n<pre>····· ·---· ·····</pre>\n<pre>·---· /···\\ \\···/</pre>\n<pre>/···\\ ····· ·---·</pre>\n </>\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 { StdButton } from \"../../ui/React/StdButton\";\nimport { use } from \"../../ui/Context\";\nimport { IRouter } from \"../../ui/Router\";\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 className=\"tooltip\"\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(<pre key={i}>{lineElems(lines[i])}</pre>);\n }\n\n return <div className=\"noselect\">{elems}</div>;\n}\n\nfunction ListCity(props: IProps): React.ReactElement {\n const router = use.Router();\n const locationButtons = props.city.locations.map((locName) => {\n return (\n <li key={locName}>\n <StdButton onClick={() => toLocation(router, Locations[locName])} text={locName} />\n </li>\n );\n });\n\n return <ul>{locationButtons}</ul>;\n}\n\nexport function LocationCity(): React.ReactElement {\n const player = use.Player();\n const city = Cities[player.city];\n return (\n <div className=\"noselect\">\n <h2>{city.name}</h2>\n {Settings.DisableASCIIArt ? <ListCity city={city} /> : <ASCIICity city={city} />}\n </div>\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { use } from \"../../ui/Context\";\nimport { getAvailableCreatePrograms } from \"../ProgramHelpers\";\n\nimport { Box, ButtonGroup, 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, 1000);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <div>\n <Box>\n <Typography>\n This page displays any programs that you are able to create. Writing the code for a program takes time,\n which can vary based on how complex the program is. If you are working on creating a program you can cancel\n at any time. Your progress will be saved and you can continue later.\n </Typography>\n </Box>\n <ButtonGroup>\n {getAvailableCreatePrograms(player).map((program) => {\n const create = program.create;\n if (create === null) return <></>;\n\n return (\n <Tooltip key={program.name} title={create.tooltip}>\n <Button\n onClick={() => {\n player.startCreateProgramWork(router, program.name, create.time, create.level);\n }}\n >\n {program.name}\n </Button>\n </Tooltip>\n );\n })}\n </ButtonGroup>\n </div>\n </>\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport Editor from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { OptionsPopup } from \"./OptionsPopup\";\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 \"../../../utils/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 \"../../ScriptEditor/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\";\n\nlet loaded = false;\nlet symbols: string[] = [];\n(function () {\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 [options, setOptions] = useState<Options>({\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\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(code, props.player.currentServer, server.scripts);\n found = true;\n }\n }\n\n if (!found) {\n const script = new Script();\n script.saveScript(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(code, props.player.currentServer, server.scripts);\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(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 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 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 = filename;\n setFilename(event.target.value);\n }\n\n function openOptions(): void {\n const id = \"script-editor-options-popup\";\n const newOptions = {\n theme: \"\",\n insertSpaces: false,\n };\n Object.assign(newOptions, options);\n createPopup(id, OptionsPopup, {\n id: id,\n options: newOptions,\n save: (options: Options) => {\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n },\n });\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 }\n\n async function updateRAM(): Promise<void> {\n const codeCopy = code + \"\";\n const ramUsage = await calculateRamUsage(codeCopy, props.player.getCurrentServer().scripts);\n if (ramUsage > 0) {\n setRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage));\n return;\n }\n switch (ramUsage) {\n case RamCalculationErrorCode.ImportError: {\n setRAM(\"RAM: Import Error\");\n break;\n }\n case RamCalculationErrorCode.URLImportError: {\n setRAM(\"RAM: HTTP Import Error\");\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n setRAM(\"RAM: Syntax Error\");\n break;\n }\n }\n return new Promise<void>(() => undefined);\n }\n\n useEffect(() => {\n const id = setInterval(updateRAM, 1000);\n return () => clearInterval(id);\n }, [code]);\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 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 loaded = true;\n }\n\n return (\n <>\n <div id=\"script-editor-filename-wrapper\">\n <p id=\"script-editor-filename-tag\" className=\"noselect\">\n {\" \"}\n <strong style={{ backgroundColor: \"#555\" }}>Script name: </strong>\n </p>\n <input\n id=\"script-editor-filename\"\n type=\"text\"\n maxLength={100}\n tabIndex={1}\n value={filename}\n onChange={onFilenameChange}\n />\n <StdButton text={\"options\"} onClick={openOptions} />\n </div>\n <Editor\n beforeMount={beforeMount}\n onMount={onMount}\n loading={<p>Loading script editor!</p>}\n height=\"90%\"\n defaultLanguage=\"javascript\"\n defaultValue={code}\n onChange={updateCode}\n theme={options.theme}\n options={options}\n />\n <div id=\"script-editor-buttons-wrapper\">\n <StdButton text={\"Beautify\"} onClick={beautify} />\n <p id=\"script-editor-status-text\" style={{ display: \"inline-block\", margin: \"10px\" }}>\n {ram}\n </p>\n <button className=\"std-button\" style={{ display: \"inline-block\" }} onClick={save}>\n Save & Close (Ctrl/Cmd + b)\n </button>\n <a\n className=\"std-button\"\n style={{ display: \"inline-block\" }}\n target=\"_blank\"\n href=\"https://bitburner.readthedocs.io/en/latest/index.html\"\n >\n Netscript Documentation\n </a>\n </div>\n </>\n );\n}\n","import React, { useState } from \"react\";\nimport { Options } from \"./Options\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n id: string;\n options: Options;\n save: (options: Options) => void;\n}\n\nexport function OptionsPopup(props: IProps): React.ReactElement {\n const [theme, setTheme] = useState(props.options.theme);\n const [insertSpaces, setInsertSpaces] = useState(props.options.insertSpaces);\n\n function save(): void {\n props.save({\n theme: theme,\n insertSpaces: insertSpaces,\n });\n removePopup(props.id);\n }\n\n return (\n <div className=\"editor-options-container noselect\">\n <div className=\"editor-options-line\">\n <p>Theme: </p>\n <select className=\"dropdown\" onChange={(event) => setTheme(event.target.value)} defaultValue={theme}>\n <option value=\"vs-dark\">vs-dark</option>\n <option value=\"light\">light</option>\n </select>\n </div>\n <div className=\"editor-options-line\">\n <p>Use whitespace over tabs: </p>\n <input type=\"checkbox\" onChange={(event) => setInsertSpaces(event.target.checked)} checked={insertSpaces} />\n </div>\n <br />\n <StdButton style={{ width: \"50px\" }} text={\"Save\"} onClick={save} />\n </div>\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","/**\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","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) {\n let loadedModule;\n let uurls: ScriptUrl[] = [];\n let 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 loadedModule = await script.module;\n\n let 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","// 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 { 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 _ 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}&gt;&nbsp;</Typography>\n <MuiLink\n classes={{ root: classes.preformatted }}\n color={\"secondary\"}\n paragraph={false}\n onClick={() => terminal.connectToServer(player, item.hostname)}\n >\n {item.hostname}\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 </>\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 Paper from \"@mui/material/Paper\";\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 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\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 {possibilities.length > 0 && (\n <Paper square>\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 </Paper>\n )}\n <TextField\n variant=\"standard\"\n color={terminal.action === null ? \"primary\" : \"secondary\"}\n autoFocus\n disabled={terminal.action !== null}\n autoComplete=\"off\"\n classes={{ root: classes.textfield }}\n value={value}\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 <>\n <Typography color={terminal.action === null ? \"primary\" : \"secondary\"} flexShrink={0}>\n [{player.getCurrentServer().hostname}&nbsp;~{terminal.cwd()}]&gt;&nbsp;\n </Typography>\n </>\n ),\n spellCheck: false,\n onKeyDown: onKeyDown,\n }}\n ></TextField>\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 { AllServers } 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 \"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\",\n \"scan-analyze\",\n \"scp\",\n \"sudov\",\n \"tail\",\n \"theme\",\n \"top\",\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 iphostname in AllServers) {\n allPos.push(AllServers[iphostname].ip);\n allPos.push(AllServers[iphostname].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 = AllServers[currServ.serversOnNetwork[i]];\n if (serv == null) {\n continue;\n }\n allPos.push(serv.ip);\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 (AKA Links to 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, 20);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n <Typography>\n This page displays a list of all of your scripts that are currently running across every machine. It also\n provides information about each script's production. The scripts are categorized by the hostname of the servers\n on which they are running.\n </Typography>\n\n <ScriptProduction />\n <ServerAccordions {...props} />\n </>\n );\n}\n","/**\n * React Component for displaying the total production and production rate\n * of scripts on the 'Active Scripts' UI page\n */\nimport * as React from \"react\";\n\nimport { Money } from \"../React/Money\";\nimport { MoneyRate } from \"../React/MoneyRate\";\nimport { use } from \"../Context\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n cell: {\n borderBottom: \"none\",\n padding: theme.spacing(1),\n margin: theme.spacing(1),\n whiteSpace: \"nowrap\",\n },\n size: {\n width: \"1px\",\n },\n }),\n);\nexport function ScriptProduction(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n const prodRateSinceLastAug = player.scriptProdSinceLastAug / (player.playtimeSinceLastAug / 1000);\n\n return (\n <Table size=\"small\" classes={{ root: classes.size }}>\n <TableBody>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" classes={{ root: classes.cell }}>\n <Typography variant=\"body2\">Total production:</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/ServerHelpers\";\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.serverIp);\n if (server == null) {\n console.warn(`WorkerScript has invalid IP address: ${ws.serverIp}`);\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 color=\"primary\"\n autoFocus\n variant=\"standard\"\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 \"../../../utils/DialogBox\";\nimport { logBoxCreate } from \"../../../utils/LogBox\";\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 const logClickHandler = logBoxCreate.bind(null, scriptRef);\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>&nbsp;{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>&nbsp;{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>&nbsp;{numeralWrapper.formatExp(scriptRef.offlineExpGained) + \" hacking exp\"}</Typography>\n </TableCell>\n </TableRow>\n </TableBody>\n </Table>\n\n <Button onClick={logClickHandler}>\n <Typography>LOG</Typography>\n </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, 1000);\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=\"h5\" color=\"primary\">\n Factions\n </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","import React, { useEffect } from \"react\";\n\nimport { startHackingMission } from \"../../Faction/FactionHelpers\";\nimport { Faction } from \"../../Faction/Faction\";\n\ninterface IProps {\n faction: Faction;\n}\n\nexport function HackingMissionRoot(props: IProps): React.ReactElement {\n useEffect(() => startHackingMission(props.faction));\n return <div id=\"mission-container\"></div>;\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 { createSleevePurchasesFromCovenantPopup } from \"../../PersonObjects/Sleeve/SleeveCovenantPurchases\";\nimport { SourceFileFlags } from \"../../SourceFile/SourceFileFlags\";\n\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { use } from \"../../ui/Context\";\nimport { CreateGangPopup } from \"./CreateGangPopup\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\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 hackingMissionInfo =\n \"Attempt a hacking mission for your faction. \" +\n \"A mission is a mini game that, if won, earns you \" +\n \"significant reputation with this faction. (Recommended hacking level: 200+)\";\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\nexport function FactionRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const faction = props.faction;\n\n const player = use.Player();\n const router = use.Router();\n const [purchasingAugs, setPurchasingAugs] = useState(false);\n\n function manageGang(faction: Faction): 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 const popupId = \"create-gang-popup\";\n createPopup(popupId, CreateGangPopup, {\n popupId: popupId,\n facName: faction.name,\n player: player,\n router: router,\n });\n }\n\n // Route to the main faction page\n function routeToMain(): void {\n setPurchasingAugs(false);\n }\n\n // Route to the purchase augmentation UI for this faction\n function routeToPurchaseAugs(): void {\n setPurchasingAugs(true);\n }\n\n function sleevePurchases(): void {\n createSleevePurchasesFromCovenantPopup(player);\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 startHackingMission(faction: Faction): void {\n player.singularityStopWork();\n router.toHackingMission(faction);\n }\n\n function startSecurityWork(faction: Faction): void {\n player.startFactionSecurityWork(router, faction);\n }\n\n function MainPage({ faction }: { faction: Faction }): React.ReactElement {\n const p = player;\n const factionInfo = faction.getInfo();\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 && <Option buttonText={\"Manage Gang\"} infoText={gangInfo} onClick={() => manageGang(faction)} />}\n {!isPlayersGang && factionInfo.offerHackingMission && (\n <Option\n buttonText={\"Hacking Mission\"}\n infoText={hackingMissionInfo}\n onClick={() => startHackingMission(faction)}\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={routeToPurchaseAugs} />\n {canPurchaseSleeves && (\n <Option\n buttonText={\"Purchase & Upgrade Duplicate Sleeves\"}\n infoText={sleevePurchasesInfo}\n onClick={sleevePurchases}\n />\n )}\n </>\n );\n }\n\n return purchasingAugs ? (\n <AugmentationsPage faction={faction} routeToMainPage={routeToMain} />\n ) : (\n <MainPage faction={faction} />\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 { StdButton } from \"../../ui/React/StdButton\";\nimport { use } from \"../../ui/Context\";\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 moneyCost = aug.baseCost * props.faction.getInfo().augmentationPriceMult;\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 <div>\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 </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 </div>\n );\n}\n","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport * as React from \"react\";\n\nimport { getNextNeurofluxLevel, hasAugmentationPrereqs, purchaseAugmentation } from \"../FactionHelpers\";\nimport { PurchaseAugmentationPopup } from \"./PurchaseAugmentationPopup\";\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\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { IMap } from \"../../types\";\n\nimport { StdButton } from \"../../ui/React/StdButton\";\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 let color = !props.hasRep || !props.hasCost ? \"error\" : \"primary\";\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(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 aug = Augmentations[props.augName];\n if (aug == null) throw new Error(`aug ${props.augName} does not exists`);\n\n // Whether the player has this augmentations (purchased OR installed)\n function owned(): boolean {\n let owned = false;\n for (const queuedAug of props.p.queuedAugmentations) {\n if (queuedAug.name === props.augName) {\n owned = true;\n break;\n }\n }\n\n for (const installedAug of props.p.augmentations) {\n if (installedAug.name === props.augName) {\n owned = true;\n break;\n }\n }\n\n return owned;\n }\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 const popupId = \"purchase-augmentation-popup\";\n createPopup(popupId, PurchaseAugmentationPopup, {\n aug: aug,\n faction: props.faction,\n player: props.p,\n rerender: props.rerender,\n popupId: popupId,\n });\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 </TableCell>\n )}\n <TableCell key={1}>\n <Box display=\"flex\">\n <Tooltip\n title={<Typography>{tooltip}</Typography>}\n placement=\"top\"\n disableFocusListener\n disableTouchListener\n enterNextDelay={1000}\n enterDelay={500}\n leaveDelay={0}\n leaveTouchDelay={0}\n >\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/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { purchaseAugmentation } from \"../FactionHelpers\";\nimport { isRepeatableAug } from \"../../Augmentation/AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n player: IPlayer;\n faction: Faction;\n aug: Augmentation;\n rerender: () => void;\n popupId: string;\n}\n\nexport function PurchaseAugmentationPopup(props: IProps): React.ReactElement {\n const factionInfo = props.faction.getInfo();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug) && props.player.hasAugmentation(props.aug)) {\n return;\n }\n\n purchaseAugmentation(props.aug, props.faction);\n props.rerender();\n removePopup(props.popupId);\n }\n\n return (\n <>\n <h2>{props.aug.name}</h2>\n <br />\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&nbsp;\n <Money money={props.aug.baseCost * factionInfo.augmentationPriceMult} />?\n <br />\n <br />\n <button autoFocus={true} className=\"std-button\" onClick={buy}>\n Purchase\n </button>\n </>\n );\n}\n","import * as React from \"react\";\n\nexport function Augmentation({ name }: { name: string }): JSX.Element {\n return (\n <span className={\"samefont\"} style={{ color: \"white\" }}>\n {name}\n </span>\n );\n}\n","/**\n * React component for a donate option on the Faction UI\n */\nimport React, { useState } from \"react\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { Faction } from \"../../Faction/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 { StdButton } from \"../../ui/React/StdButton\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../../../utils/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\nconst inputStyleMarkup = {\n margin: \"5px\",\n height: \"26px\",\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 console.log(\"set\");\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(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(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(props.favorToDonate)} favor with {props.faction.name}\n </Typography>\n ) : (\n <>\n <TextField\n variant=\"standard\"\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 { AutoupdatingParagraph } from \"../../ui/React/AutoupdatingParagraph\";\nimport { ParagraphWithTooltip } from \"../../ui/React/ParagraphWithTooltip\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { MathComponent } from \"mathjax-react\";\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 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((theme: Theme) =>\n createStyles({\n noformat: {\n whiteSpace: \"pre-wrap\",\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, 1000);\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(props.faction.favor + favorGain)} faction favor after installing an 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>Reputation: {Reputation(props.faction.playerReputation)}</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>Faction Favor: {Favor(props.faction.favor)}</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 * 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 { CovenantSleeveUpgrades } from \"./CovenantSleeveUpgrades\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { BaseCostPerSleeve, MaxSleevesFromCovenant, PopupId } from \"../SleeveCovenantPurchases\";\nimport { IPlayer } from \"../../IPlayer\";\n\nimport { PopupCloseButton } from \"../../../ui/React/PopupCloseButton\";\nimport { StdButton } from \"../../../ui/React/StdButton\";\nimport { Money } from \"../../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../../../utils/DialogBox\";\n\ninterface IProps {\n closeFn: () => void;\n p: IPlayer;\n}\n\nexport function CovenantPurchasesRoot(props: IProps): React.ReactElement {\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 (props.p.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 (!props.p.canAfford(purchaseCost())) {\n purchaseDisabled = true;\n }\n if (props.p.sleevesFromCovenant >= MaxSleevesFromCovenant) {\n purchaseDisabled = true;\n }\n\n function purchaseOnClick(): void {\n if (props.p.sleevesFromCovenant >= MaxSleevesFromCovenant) return;\n\n if (props.p.canAfford(purchaseCost())) {\n props.p.loseMoney(purchaseCost());\n props.p.sleevesFromCovenant += 1;\n props.p.sleeves.push(new Sleeve(props.p));\n rerender();\n } else {\n dialogBoxCreate(`You cannot afford to purchase a Duplicate Sleeve`, false);\n }\n }\n\n // Purchasing Upgrades for Sleeves\n const upgradePanels = [];\n for (let i = 0; i < props.p.sleeves.length; ++i) {\n const sleeve = props.p.sleeves[i];\n upgradePanels.push(<CovenantSleeveUpgrades {...props} sleeve={sleeve} index={i} rerender={rerender} key={i} />);\n }\n\n return (\n <div>\n <PopupCloseButton popup={PopupId} text={\"Close\"} />\n {props.p.sleevesFromCovenant < MaxSleevesFromCovenant && (\n <>\n <p>\n Would you like to purchase an additional Duplicate Sleeve from The Covenant for{\" \"}\n <Money money={purchaseCost()} player={props.p} />?\n </p>\n <br />\n <p>\n These Duplicate Sleeves are permanent (they persist through BitNodes). You can purchase a total of{\" \"}\n {MaxSleevesFromCovenant} from The Covenant.\n </p>\n <StdButton disabled={purchaseDisabled} onClick={purchaseOnClick} text={\"Purchase\"} />\n </>\n )}\n <br />\n <br />\n <p>\n Here, you can also purchase upgrades for your Duplicate Sleeves. These upgrades are also permanent, meaning they\n persist across BitNodes.\n </p>\n {upgradePanels}\n </div>\n );\n}\n","/**\n * React Component for a panel that lets you purchase upgrades for a single\n * Duplicate Sleeve through The Covenant\n */\nimport * as React from \"react\";\n\nimport { CovenantSleeveMemoryUpgrade } from \"./CovenantSleeveMemoryUpgrade\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\n\ninterface IProps {\n index: number;\n p: IPlayer;\n rerender: () => void;\n sleeve: Sleeve;\n}\n\nexport class CovenantSleeveUpgrades extends React.Component<IProps, any> {\n render(): React.ReactNode {\n return (\n <div className={\"bladeburner-action\"}>\n <h1>Duplicate Sleeve {this.props.index}</h1>\n <CovenantSleeveMemoryUpgrade {...this.props} />\n </div>\n );\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 * as React from \"react\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { StdButton } from \"../../../ui/React/StdButton\";\nimport { Money } from \"../../../ui/React/Money\";\n\ninterface IProps {\n index: number;\n p: IPlayer;\n rerender: () => void;\n sleeve: Sleeve;\n}\n\ninterface IState {\n amt: number;\n}\n\nexport class CovenantSleeveMemoryUpgrade extends React.Component<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n amt: 1,\n };\n\n this.changePurchaseAmount = this.changePurchaseAmount.bind(this);\n this.purchaseMemory = this.purchaseMemory.bind(this);\n }\n\n 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 - this.props.sleeve.memory;\n if (n > maxMemory) n = maxMemory;\n\n this.setState({\n amt: n,\n });\n }\n\n getPurchaseCost(): number {\n if (isNaN(this.state.amt)) {\n return Infinity;\n }\n\n const maxMemory = 100 - this.props.sleeve.memory;\n if (this.state.amt > maxMemory) {\n return Infinity;\n }\n\n return this.props.sleeve.getMemoryUpgradeCost(this.state.amt);\n }\n\n purchaseMemory(): void {\n const cost = this.getPurchaseCost();\n if (this.props.p.canAfford(cost)) {\n this.props.sleeve.upgradeMemory(this.state.amt);\n this.props.p.loseMoney(cost);\n this.props.rerender();\n }\n }\n\n render(): React.ReactNode {\n const inputId = `sleeve-${this.props.index}-memory-upgrade-input`;\n\n // Memory cannot go above 100\n const maxMemory = 100 - this.props.sleeve.memory;\n\n // Purchase button props\n const cost = this.getPurchaseCost();\n const purchaseBtnDisabled = !this.props.p.canAfford(cost);\n let purchaseBtnContent;\n if (isNaN(this.state.amt)) {\n purchaseBtnContent = <>Invalid value</>;\n } else if (this.state.amt > maxMemory) {\n purchaseBtnContent = <>Memory cannot exceed 100</>;\n } else {\n purchaseBtnContent = (\n <>\n Purchase {this.state.amt} memory - <Money money={cost} player={this.props.p} />?\n </>\n );\n }\n\n return (\n <div>\n <h2>\n <u>Upgrade Memory</u>\n </h2>\n <p>\n Purchase a memory upgrade for your sleeve. Note that a sleeve's max memory is 100 (current:{\" \"}\n {numeralWrapper.formatSleeveMemory(this.props.sleeve.memory)})\n </p>\n\n <label htmlFor={inputId}>Amount of memory to purchase (must be an integer):</label>\n <input\n className=\"text-input\"\n id={inputId}\n onChange={this.changePurchaseAmount}\n type={\"number\"}\n value={this.state.amt}\n />\n <br />\n <StdButton disabled={purchaseBtnDisabled} onClick={this.purchaseMemory} text={purchaseBtnContent} />\n </div>\n );\n }\n}\n","/**\n * Close button for popup dialog boxes\n * It creates an event handler such that pressing Esc will close the binded popup\n *\n * Should only be used in other React components, otherwise it may not be properly\n * unmounted\n */\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\n\nimport { removeElement } from \"../../../utils/uiHelpers/removeElement\";\nimport { IPopupButtonProps, PopupButton } from \"./PopupButton\";\n\nexport interface IPopupCloseButtonProps extends IPopupButtonProps {\n class?: string;\n popup: HTMLElement | string;\n style?: any;\n text: string;\n onClose: () => void;\n}\n\nexport class PopupCloseButton extends PopupButton {\n constructor(props: IPopupCloseButtonProps) {\n super(props);\n\n this.closePopup = this.closePopup.bind(this);\n }\n\n closePopup(): void {\n if (this.props.onClose) this.props.onClose();\n let popup: HTMLElement | null;\n if (typeof this.props.popup === \"string\") {\n popup = document.getElementById(this.props.popup);\n } else {\n popup = this.props.popup;\n }\n\n // TODO Check if this is okay? This is essentially calling to unmount a\n // parent component\n if (popup instanceof HTMLElement) {\n // Removes everything inside the wrapper container\n ReactDOM.unmountComponentAtNode(popup);\n removeElement(popup); // Removes the wrapper container\n }\n }\n\n render(): React.ReactNode {\n const className = this.props.class ? this.props.class : \"std-button\";\n\n return (\n <button className={className} onClick={this.closePopup} style={this.props.style}>\n {this.props.text}\n </button>\n );\n }\n}\n","/**\n * Basic button for popup dialog boxes\n * It creates an event handler such that pressing Esc will perform the click handler.\n *\n * Should only be used in other React components, otherwise it may not be properly\n * unmounted\n */\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\n\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { removeElement } from \"../../../utils/uiHelpers/removeElement\";\n\nexport interface IPopupButtonProps {\n class?: string;\n popup: HTMLElement | string;\n style?: any;\n text: string;\n onClose?: () => void;\n}\n\nexport class PopupButton extends React.Component<IPopupButtonProps, any> {\n constructor(props: IPopupButtonProps) {\n super(props);\n this.handleClick = this.handleClick.bind(this);\n this.keyListener = this.keyListener.bind(this);\n }\n\n componentDidMount(): void {\n document.addEventListener(\"keydown\", this.keyListener);\n }\n\n componentWillUnmount(): void {\n document.removeEventListener(\"keydown\", this.keyListener);\n }\n\n handleClick(): void {\n if (this.props.onClose) this.props.onClose();\n //We might be able to remove this?\n //Clickhandler from the props will override this anyhow.\n let popup: HTMLElement | null;\n if (typeof this.props.popup === \"string\") {\n popup = document.getElementById(this.props.popup);\n } else {\n popup = this.props.popup;\n }\n // TODO Check if this is okay? This is essentially calling to unmount a parent component\n if (popup instanceof HTMLElement) {\n ReactDOM.unmountComponentAtNode(popup); // Removes everything inside the wrapper container\n removeElement(popup); // Removes the wrapper container\n }\n }\n\n keyListener(e: KeyboardEvent): void {\n //This doesn't really make sense, a button doesnt have to listen to escape IMO\n //Too affraid to remove it since im not sure what it will break.. But yuck..\n if (e.keyCode === KEY.ESC) {\n this.handleClick();\n }\n }\n\n render(): React.ReactNode {\n const className = this.props.class ? this.props.class : \"std-button\";\n\n return (\n <button className={className} onClick={this.handleClick} style={this.props.style}>\n {this.props.text}\n </button>\n );\n }\n}\n","/**\n * React Component for the popup used to create a new gang.\n */\nimport React from \"react\";\nimport { removePopup } from \"../../ui/React/createPopup\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface ICreateGangPopupProps {\n popupId: string;\n facName: string;\n player: IPlayer;\n router: IRouter;\n}\n\nexport function CreateGangPopup(props: ICreateGangPopupProps): React.ReactElement {\n const player = props.player;\n const router = props.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 removePopup(props.popupId);\n router.toGang();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.keyCode === 13) createGang();\n }\n\n return (\n <>\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 <div className=\"popup-box-input-div\">\n <StdButton\n onClick={createGang}\n onKeyUp={onKeyUp}\n text=\"Create Gang\"\n style={{ float: \"right\" }}\n autoFocus={true}\n />\n </div>\n </>\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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography>{numeralWrapper.formatSkill(player.intelligence)}&nbsp;</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:`}&nbsp;</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=\"h5\" color=\"primary\">\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, 20);\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=\"h5\" color=\"primary\">\n General\n </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=\"h5\" color=\"primary\">\n Stats\n </Typography>\n <Box sx={{ mx: 2 }}>\n <Table size=\"small\" padding=\"none\">\n <TableBody>\n <TableRow>\n <TableCell>\n <Typography noWrap>Hacking:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.hacking_skill)}&nbsp;</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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.strength)}&nbsp;</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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.defense)}&nbsp;</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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.dexterity)}&nbsp;</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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.agility)}&nbsp;</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:&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\">\n <Typography noWrap>{numeralWrapper.formatSkill(player.charisma)}&nbsp;</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=\"h5\" color=\"primary\">\n Multipliers\n </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=\"h5\" color=\"primary\">\n Misc\n </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 <div className=\"stock-market-container\">\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 </div>\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 * as React from \"react\";\n\nimport { getStockMarket4SDataCost, getStockMarket4STixApiCost } from \"../StockMarketCosts\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { StdButton } from \"../../ui/React/StdButton\";\nimport { StdButtonPurchased } from \"../../ui/React/StdButtonPurchased\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\n\ntype IProps = {\n initStockMarket: () => void;\n p: IPlayer;\n rerender: () => void;\n};\n\nconst blockStyleMarkup = {\n display: \"block\",\n};\n\nexport class InfoAndPurchases extends React.Component<IProps, any> {\n constructor(props: IProps) {\n super(props);\n\n this.handleClick4SMarketDataHelpTip = this.handleClick4SMarketDataHelpTip.bind(this);\n this.purchaseWseAccount = this.purchaseWseAccount.bind(this);\n this.purchaseTixApiAccess = this.purchaseTixApiAccess.bind(this);\n this.purchase4SMarketData = this.purchase4SMarketData.bind(this);\n this.purchase4SMarketDataTixApiAccess = this.purchase4SMarketDataTixApiAccess.bind(this);\n }\n\n handleClick4SMarketDataHelpTip(): void {\n dialogBoxCreate(\n \"Access to the 4S Market Data feed will display two additional pieces \" +\n \"of information about each stock: Price Forecast & Volatility<br><br>\" +\n \"Price Forecast indicates the probability the stock has of increasing or \" +\n \"decreasing. A '+' forecast means the stock has a higher chance of increasing \" +\n \"than decreasing, and a '-' means the opposite. The number of '+/-' symbols \" +\n \"is used to illustrate the magnitude of these probabilities. For example, \" +\n \"'+++' means that the stock has a significantly higher chance of increasing \" +\n \"than decreasing, while '+' means that the stock only has a slightly higher chance \" +\n \"of increasing than decreasing.<br><br>\" +\n \"Volatility represents the maximum percentage by which a stock's price \" +\n \"can change every tick (a tick occurs every few seconds while the game \" +\n \"is running).<br><br>\" +\n \"A stock's price forecast can change over time. This is also affected by volatility. \" +\n \"The more volatile a stock is, the more its price forecast will change.\",\n );\n }\n\n purchaseWseAccount(): void {\n if (this.props.p.hasWseAccount) {\n return;\n }\n if (!this.props.p.canAfford(CONSTANTS.WSEAccountCost)) {\n return;\n }\n this.props.p.hasWseAccount = true;\n this.props.initStockMarket();\n this.props.p.loseMoney(CONSTANTS.WSEAccountCost);\n this.props.rerender();\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n }\n\n purchaseTixApiAccess(): void {\n if (this.props.p.hasTixApiAccess) {\n return;\n }\n if (!this.props.p.canAfford(CONSTANTS.TIXAPICost)) {\n return;\n }\n this.props.p.hasTixApiAccess = true;\n this.props.p.loseMoney(CONSTANTS.TIXAPICost);\n this.props.rerender();\n }\n\n purchase4SMarketData(): void {\n if (this.props.p.has4SData) {\n return;\n }\n if (!this.props.p.canAfford(getStockMarket4SDataCost())) {\n return;\n }\n this.props.p.has4SData = true;\n this.props.p.loseMoney(getStockMarket4SDataCost());\n this.props.rerender();\n }\n\n purchase4SMarketDataTixApiAccess(): void {\n if (this.props.p.has4SDataTixApi) {\n return;\n }\n if (!this.props.p.canAfford(getStockMarket4STixApiCost())) {\n return;\n }\n this.props.p.has4SDataTixApi = true;\n this.props.p.loseMoney(getStockMarket4STixApiCost());\n this.props.rerender();\n }\n\n renderPurchaseWseAccountButton(): React.ReactElement {\n if (this.props.p.hasWseAccount) {\n return <StdButtonPurchased text={\"WSE Account - Purchased\"} />;\n } else {\n const cost = CONSTANTS.WSEAccountCost;\n return (\n <StdButton\n disabled={!this.props.p.canAfford(cost)}\n onClick={this.purchaseWseAccount}\n text={\n <>\n Buy WSE Account - <Money money={cost} player={this.props.p} />\n </>\n }\n />\n );\n }\n }\n\n renderPurchaseTixApiAccessButton(): React.ReactElement {\n if (this.props.p.hasTixApiAccess) {\n return <StdButtonPurchased text={\"TIX API Access - Purchased\"} />;\n } else {\n const cost = CONSTANTS.TIXAPICost;\n return (\n <StdButton\n disabled={!this.props.p.canAfford(cost) || !this.props.p.hasWseAccount}\n onClick={this.purchaseTixApiAccess}\n style={blockStyleMarkup}\n text={\n <>\n Buy Trade Information eXchange (TIX) API Access - <Money money={cost} player={this.props.p} />\n </>\n }\n />\n );\n }\n }\n\n renderPurchase4SMarketDataButton(): React.ReactElement {\n if (this.props.p.has4SData) {\n return (\n <StdButtonPurchased\n text={\"4S Market Data - Purchased\"}\n tooltip={\"Lets you view additional pricing and volatility information about stocks\"}\n />\n );\n } else {\n const cost = getStockMarket4SDataCost();\n return (\n <StdButton\n disabled={!this.props.p.canAfford(cost) || !this.props.p.hasWseAccount}\n onClick={this.purchase4SMarketData}\n text={\n <>\n Buy 4S Market Data Access - <Money money={cost} player={this.props.p} />\n </>\n }\n tooltip={\"Lets you view additional pricing and volatility information about stocks\"}\n />\n );\n }\n }\n\n renderPurchase4SMarketDataTixApiAccessButton(): React.ReactElement {\n if (!this.props.p.hasTixApiAccess) {\n return (\n <StdButton disabled={true} text={`Buy 4S Market Data TIX API Access`} tooltip={\"Requires TIX API Access\"} />\n );\n } else if (this.props.p.has4SDataTixApi) {\n return (\n <StdButtonPurchased\n text={\"4S Market Data TIX API - Purchased\"}\n tooltip={\"Let you access 4S Market Data through Netscript\"}\n />\n );\n } else {\n const cost = getStockMarket4STixApiCost();\n return (\n <StdButton\n disabled={!this.props.p.canAfford(cost)}\n onClick={this.purchase4SMarketDataTixApiAccess}\n text={\n <>\n Buy 4S Market Data TIX API Access - <Money money={cost} player={this.props.p} />\n </>\n }\n tooltip={\"Let you access 4S Market Data through Netscript\"}\n />\n );\n }\n }\n\n render(): React.ReactNode {\n const documentationLink = \"https://bitburner.readthedocs.io/en/latest/basicgameplay/stockmarket.html\";\n return (\n <div className={\"stock-market-info-and-purchases\"}>\n <p>Welcome to the World Stock Exchange (WSE)!</p>\n <button className={\"std-button\"}>\n <a href={documentationLink} target={\"_blank\"}>\n Investopedia\n </a>\n </button>\n <br />\n <p>To begin trading, you must first purchase an account:</p>\n {this.renderPurchaseWseAccountButton()}\n\n <h2>Trade Information eXchange (TIX) API</h2>\n <p>\n TIX, short for Trade Information eXchange, is the communications protocol used by the WSE. Purchasing access\n to the TIX API lets you write code to create your own algorithmic/automated trading strategies.\n </p>\n {this.renderPurchaseTixApiAccessButton()}\n <h2>Four Sigma (4S) Market Data Feed</h2>\n <p>\n Four Sigma's (4S) Market Data Feed provides information about stocks that will help your trading strategies.\n </p>\n {this.renderPurchase4SMarketDataButton()}\n <button className={\"help-tip-big\"} onClick={this.handleClick4SMarketDataHelpTip}>\n ?\n </button>\n {this.renderPurchase4SMarketDataTixApiAccessButton()}\n <p>\n Commission Fees: Every transaction you make has a{\" \"}\n <Money money={CONSTANTS.StockMarketCommission} player={this.props.p} /> commission fee.\n </p>\n <br />\n <p>\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 </p>\n </div>\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 * as React 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\nimport { ErrorBoundary } from \"../../ui/React/ErrorBoundary\";\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\ntype IState = {\n rerenderFlag: boolean;\n tickerDisplayMode: TickerDisplayMode;\n watchlistFilter: string;\n watchlistSymbols: string[];\n};\n\nexport class StockTickers extends React.Component<IProps, IState> {\n listRef: React.RefObject<HTMLUListElement>;\n\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n rerenderFlag: false,\n tickerDisplayMode: TickerDisplayMode.AllStocks,\n watchlistFilter: \"\",\n watchlistSymbols: [],\n };\n\n this.changeDisplayMode = this.changeDisplayMode.bind(this);\n this.changeWatchlistFilter = this.changeWatchlistFilter.bind(this);\n this.collapseAllTickers = this.collapseAllTickers.bind(this);\n this.expandAllTickers = this.expandAllTickers.bind(this);\n this.rerender = this.rerender.bind(this);\n\n this.listRef = React.createRef();\n }\n\n changeDisplayMode(): void {\n if (this.state.tickerDisplayMode === TickerDisplayMode.AllStocks) {\n this.setState({\n tickerDisplayMode: TickerDisplayMode.Portfolio,\n });\n } else {\n this.setState({\n tickerDisplayMode: TickerDisplayMode.AllStocks,\n });\n }\n }\n\n changeWatchlistFilter(e: React.ChangeEvent<HTMLInputElement>): void {\n const watchlist = e.target.value;\n const sanitizedWatchlist = watchlist.replace(/\\s/g, \"\");\n\n this.setState({\n watchlistFilter: watchlist,\n });\n\n if (sanitizedWatchlist !== \"\") {\n this.setState({\n watchlistSymbols: sanitizedWatchlist.split(\",\"),\n });\n } else {\n this.setState({\n watchlistSymbols: [],\n });\n }\n }\n\n collapseAllTickers(): void {\n const ul = this.listRef.current;\n if (ul == null) {\n return;\n }\n const tickers = ul.getElementsByClassName(\"accordion-header\");\n for (let i = 0; i < tickers.length; ++i) {\n const ticker = tickers[i];\n if (!(ticker instanceof HTMLButtonElement)) {\n continue;\n }\n\n if (ticker.classList.contains(\"active\")) {\n ticker.click();\n }\n }\n }\n\n expandAllTickers(): void {\n const ul = this.listRef.current;\n if (ul == null) {\n return;\n }\n const tickers = ul.getElementsByClassName(\"accordion-header\");\n for (let i = 0; i < tickers.length; ++i) {\n const ticker = tickers[i];\n if (!(ticker instanceof HTMLButtonElement)) {\n continue;\n }\n\n if (!ticker.classList.contains(\"active\")) {\n ticker.click();\n }\n }\n }\n\n rerender(): void {\n this.setState((prevState) => {\n return {\n rerenderFlag: !prevState.rerenderFlag,\n };\n });\n }\n\n render(): React.ReactNode {\n const tickers: React.ReactElement[] = [];\n for (const stockMarketProp in this.props.stockMarket) {\n const val = this.props.stockMarket[stockMarketProp];\n if (val instanceof Stock) {\n // Skip if there's a filter and the stock isnt in that filter\n if (this.state.watchlistSymbols.length > 0 && !this.state.watchlistSymbols.includes(val.symbol)) {\n continue;\n }\n\n let orders = this.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 (this.state.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={this.props.buyStockLong}\n buyStockShort={this.props.buyStockShort}\n cancelOrder={this.props.cancelOrder}\n key={val.symbol}\n orders={orders}\n p={this.props.p}\n placeOrder={this.props.placeOrder}\n rerenderAllTickers={this.rerender}\n sellStockLong={this.props.sellStockLong}\n sellStockShort={this.props.sellStockShort}\n stock={val}\n />,\n );\n }\n }\n\n const errorBoundaryProps = {\n eventEmitterForReset: this.props.eventEmitterForReset,\n id: \"StockTickersErrorBoundary\",\n };\n\n return (\n <ErrorBoundary {...errorBoundaryProps}>\n <StockTickersConfig\n changeDisplayMode={this.changeDisplayMode}\n changeWatchlistFilter={this.changeWatchlistFilter}\n collapseAllTickers={this.collapseAllTickers}\n expandAllTickers={this.expandAllTickers}\n tickerDisplayMode={this.state.tickerDisplayMode}\n />\n\n <ul id=\"stock-market-list\" ref={this.listRef}>\n {tickers}\n </ul>\n </ErrorBoundary>\n );\n }\n}\n","/**\n * React Component for a single stock ticker in the Stock Market UI\n */\nimport * as React from \"react\";\n\nimport { StockTickerHeaderText } from \"./StockTickerHeaderText\";\nimport { StockTickerOrderList } from \"./StockTickerOrderList\";\nimport { StockTickerPositionText } from \"./StockTickerPositionText\";\nimport { StockTickerTxButton } from \"./StockTickerTxButton\";\nimport { PlaceOrderPopup } from \"./PlaceOrderPopup\";\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 { BBAccordion } from \"../../ui/React/BBAccordion\";\nimport { Money } from \"../../ui/React/Money\";\nimport { createPopup } from \"../../ui/React/createPopup\";\n\nimport { dialogBoxCreate } from \"../../../utils/DialogBox\";\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\ntype IState = {\n orderType: SelectorOrderType;\n position: PositionTypes;\n qty: string;\n};\n\nexport class StockTicker extends React.Component<IProps, IState> {\n constructor(props: IProps) {\n super(props);\n\n this.state = {\n orderType: SelectorOrderType.Market,\n position: PositionTypes.Long,\n qty: \"\",\n };\n\n this.getBuyTransactionCostContent = this.getBuyTransactionCostContent.bind(this);\n this.getSellTransactionCostContent = this.getSellTransactionCostContent.bind(this);\n this.handleBuyButtonClick = this.handleBuyButtonClick.bind(this);\n this.handleBuyMaxButtonClick = this.handleBuyMaxButtonClick.bind(this);\n this.handleHeaderClick = this.handleHeaderClick.bind(this);\n this.handleOrderTypeChange = this.handleOrderTypeChange.bind(this);\n this.handlePositionTypeChange = this.handlePositionTypeChange.bind(this);\n this.handleQuantityChange = this.handleQuantityChange.bind(this);\n this.handleSellButtonClick = this.handleSellButtonClick.bind(this);\n this.handleSellAllButtonClick = this.handleSellAllButtonClick.bind(this);\n }\n\n getBuyTransactionCostContent(): JSX.Element | null {\n const stock = this.props.stock;\n const qty: number = this.getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n const cost = getBuyTransactionCost(stock, qty, this.state.position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Purchasing {numeralWrapper.formatShares(qty)} shares (\n {this.state.position === PositionTypes.Long ? \"Long\" : \"Short\"}) will cost <Money money={cost} />.\n </>\n );\n }\n\n getQuantity(): number {\n return Math.round(parseFloat(this.state.qty));\n }\n\n getSellTransactionCostContent(): JSX.Element | null {\n const stock = this.props.stock;\n const qty: number = this.getQuantity();\n if (isNaN(qty)) {\n return null;\n }\n\n if (this.state.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, this.state.position);\n if (cost == null) {\n return null;\n }\n\n return (\n <>\n Selling {numeralWrapper.formatShares(qty)} shares (\n {this.state.position === PositionTypes.Long ? \"Long\" : \"Short\"}) will result in a gain of <Money money={cost} />\n .\n </>\n );\n }\n\n handleBuyButtonClick(): void {\n const shares = this.getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${this.state.qty}`);\n return;\n }\n\n switch (this.state.orderType) {\n case SelectorOrderType.Market: {\n if (this.state.position === PositionTypes.Short) {\n this.props.buyStockShort(this.props.stock, shares);\n } else {\n this.props.buyStockLong(this.props.stock, shares);\n }\n this.props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n const popupId = `place-order-popup`;\n createPopup(popupId, PlaceOrderPopup, {\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Buy Limit Order\",\n place: (price: number) =>\n this.props.placeOrder(this.props.stock, shares, price, OrderTypes.LimitBuy, this.state.position),\n popupId: popupId,\n });\n break;\n }\n case SelectorOrderType.Stop: {\n const popupId = `place-order-popup`;\n createPopup(popupId, PlaceOrderPopup, {\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Buy Stop Order\",\n place: (price: number) =>\n this.props.placeOrder(this.props.stock, shares, price, OrderTypes.StopBuy, this.state.position),\n popupId: popupId,\n });\n break;\n }\n default:\n break;\n }\n }\n\n handleBuyMaxButtonClick(): void {\n const playerMoney: number = this.props.p.money.toNumber();\n\n const stock = this.props.stock;\n let maxShares = calculateBuyMaxAmount(stock, this.state.position, playerMoney);\n maxShares = Math.min(maxShares, Math.round(stock.maxShares - stock.playerShares - stock.playerShortShares));\n\n switch (this.state.orderType) {\n case SelectorOrderType.Market: {\n if (this.state.position === PositionTypes.Short) {\n this.props.buyStockShort(stock, maxShares);\n } else {\n this.props.buyStockLong(stock, maxShares);\n }\n this.props.rerenderAllTickers();\n break;\n }\n default: {\n dialogBoxCreate(`ERROR: 'Buy Max' only works for Market Orders`);\n break;\n }\n }\n }\n\n handleHeaderClick(e: React.MouseEvent<HTMLButtonElement>): void {\n const elem = e.currentTarget;\n elem.classList.toggle(\"active\");\n\n const panel: HTMLElement = elem.nextElementSibling as HTMLElement;\n if (panel.style.display === \"block\") {\n panel.style.display = \"none\";\n } else {\n panel.style.display = \"block\";\n }\n }\n\n handleOrderTypeChange(e: React.ChangeEvent<HTMLSelectElement>): 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 this.setState({\n orderType: SelectorOrderType.Limit,\n });\n break;\n case SelectorOrderType.Stop:\n this.setState({\n orderType: SelectorOrderType.Stop,\n });\n break;\n case SelectorOrderType.Market:\n default:\n this.setState({\n orderType: SelectorOrderType.Market,\n });\n }\n }\n\n handlePositionTypeChange(e: React.ChangeEvent<HTMLSelectElement>): void {\n const val = e.target.value;\n\n if (val === PositionTypes.Short) {\n this.setState({\n position: PositionTypes.Short,\n });\n } else {\n this.setState({\n position: PositionTypes.Long,\n });\n }\n }\n\n handleQuantityChange(e: React.ChangeEvent<HTMLInputElement>): void {\n this.setState({\n qty: e.target.value,\n });\n }\n\n handleSellButtonClick(): void {\n const shares = this.getQuantity();\n if (isNaN(shares)) {\n dialogBoxCreate(`Invalid input for quantity (number of shares): ${this.state.qty}`);\n return;\n }\n\n switch (this.state.orderType) {\n case SelectorOrderType.Market: {\n if (this.state.position === PositionTypes.Short) {\n this.props.sellStockShort(this.props.stock, shares);\n } else {\n this.props.sellStockLong(this.props.stock, shares);\n }\n this.props.rerenderAllTickers();\n break;\n }\n case SelectorOrderType.Limit: {\n const popupId = `place-order-popup`;\n createPopup(popupId, PlaceOrderPopup, {\n text: \"Enter the price for your Limit Order\",\n placeText: \"Place Sell Limit Order\",\n place: (price: number) =>\n this.props.placeOrder(this.props.stock, shares, price, OrderTypes.LimitSell, this.state.position),\n popupId: popupId,\n });\n break;\n }\n case SelectorOrderType.Stop: {\n const popupId = `place-order-popup`;\n createPopup(popupId, PlaceOrderPopup, {\n text: \"Enter the price for your Stop Order\",\n placeText: \"Place Sell Stop Order\",\n place: (price: number) =>\n this.props.placeOrder(this.props.stock, shares, price, OrderTypes.StopSell, this.state.position),\n popupId: popupId,\n });\n break;\n }\n default:\n break;\n }\n }\n\n handleSellAllButtonClick(): void {\n const stock = this.props.stock;\n\n switch (this.state.orderType) {\n case SelectorOrderType.Market: {\n if (this.state.position === PositionTypes.Short) {\n this.props.sellStockShort(stock, stock.playerShortShares);\n } else {\n this.props.sellStockLong(stock, stock.playerShares);\n }\n this.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 hasOrderAccess(): boolean {\n return this.props.p.bitNodeN === 8 || SourceFileFlags[8] >= 3;\n }\n\n // Whether the player has access to shorting stocks\n hasShortAccess(): boolean {\n return this.props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2;\n }\n\n render(): React.ReactNode {\n return (\n <li>\n <BBAccordion\n headerContent={<StockTickerHeaderText p={this.props.p} stock={this.props.stock} />}\n panelContent={\n <div>\n <input\n className=\"stock-market-input\"\n onChange={this.handleQuantityChange}\n placeholder=\"Quantity (Shares)\"\n value={this.state.qty}\n />\n <select\n className=\"stock-market-input dropdown\"\n onChange={this.handlePositionTypeChange}\n value={this.state.position}\n >\n <option value={PositionTypes.Long}>Long</option>\n {this.hasShortAccess() && <option value={PositionTypes.Short}>Short</option>}\n </select>\n <select\n className=\"stock-market-input dropdown\"\n onChange={this.handleOrderTypeChange}\n value={this.state.orderType}\n >\n <option value={SelectorOrderType.Market}>{SelectorOrderType.Market}</option>\n {this.hasOrderAccess() && <option value={SelectorOrderType.Limit}>{SelectorOrderType.Limit}</option>}\n {this.hasOrderAccess() && <option value={SelectorOrderType.Stop}>{SelectorOrderType.Stop}</option>}\n </select>\n\n <StockTickerTxButton\n onClick={this.handleBuyButtonClick}\n text={\"Buy\"}\n tooltip={this.getBuyTransactionCostContent()}\n />\n <StockTickerTxButton\n onClick={this.handleSellButtonClick}\n text={\"Sell\"}\n tooltip={this.getSellTransactionCostContent()}\n />\n <StockTickerTxButton onClick={this.handleBuyMaxButtonClick} text={\"Buy MAX\"} />\n <StockTickerTxButton onClick={this.handleSellAllButtonClick} text={\"Sell ALL\"} />\n <StockTickerPositionText p={this.props.p} stock={this.props.stock} />\n <StockTickerOrderList\n cancelOrder={this.props.cancelOrder}\n orders={this.props.orders}\n p={this.props.p}\n stock={this.props.stock}\n />\n </div>\n }\n />\n </li>\n );\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\";\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 const styleMarkup = {\n color: \"#66ff33\",\n };\n if (stock.lastPrice === stock.price) {\n styleMarkup.color = \"white\";\n } else if (stock.lastPrice > stock.price) {\n styleMarkup.color = \"red\";\n }\n\n return <pre style={styleMarkup}>{hdrText}</pre>;\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 class StockTickerOrderList extends React.Component<IProps, any> {\n render(): React.ReactNode {\n const orders: React.ReactElement[] = [];\n for (let i = 0; i < this.props.orders.length; ++i) {\n const o = this.props.orders[i];\n orders.push(<StockTickerOrder cancelOrder={this.props.cancelOrder} order={o} key={i} />);\n }\n\n return <ul className={\"stock-market-order-list\"}>{orders}</ul>;\n }\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\";\n\ntype IProps = {\n cancelOrder: (params: any) => void;\n order: Order;\n};\n\nexport class StockTickerOrder extends React.Component<IProps, any> {\n constructor(props: IProps) {\n super(props);\n\n this.handleCancelOrderClick = this.handleCancelOrderClick.bind(this);\n }\n\n handleCancelOrderClick(): void {\n this.props.cancelOrder({ order: this.props.order });\n }\n\n render(): React.ReactNode {\n const order = this.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 <li>\n {txt}\n <button className={\"std-button stock-market-order-cancel-btn\"} onClick={this.handleCancelOrderClick}>\n Cancel Order\n </button>\n </li>\n );\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\";\n\ntype IProps = {\n p: IPlayer;\n stock: Stock;\n};\n\nconst blockStyleMarkup = {\n display: \"block\",\n};\n\nexport class StockTickerPositionText extends React.Component<IProps, any> {\n renderLongPosition(): React.ReactElement {\n const stock = this.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 <div>\n <h3 className={\"tooltip\"}>\n Long Position:\n <span className={\"tooltiptext\"}>\n Shares in the long position will increase in value if the price of the corresponding stock increases\n </span>\n </h3>\n <br />\n <p>Shares: {numeralWrapper.formatShares(stock.playerShares)}</p>\n <br />\n <p>\n Average Price: <Money money={stock.playerAvgPx} /> (Total Cost: <Money money={totalCost} />\n </p>\n <br />\n <p>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </p>\n <br />\n </div>\n );\n }\n\n renderShortPosition(): React.ReactElement | null {\n const stock = this.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 (this.props.p.bitNodeN === 8 || SourceFileFlags[8] >= 2) {\n return (\n <div>\n <h3 className={\"tooltip\"}>\n Short Position:\n <span className={\"tooltiptext\"}>\n Shares in the short position will increase in value if the price of the corresponding stock decreases\n </span>\n </h3>\n <br />\n <p>Shares: {numeralWrapper.formatShares(stock.playerShortShares)}</p>\n <br />\n <p>\n Average Price: <Money money={stock.playerAvgShortPx} /> (Total Cost: <Money money={totalCost} />)\n </p>\n <br />\n <p>\n Profit: <Money money={gains} /> ({numeralWrapper.formatPercentage(percentageGains)})\n </p>\n <br />\n </div>\n );\n } else {\n return null;\n }\n }\n\n render(): React.ReactNode {\n const stock = this.props.stock;\n\n return (\n <div className={\"stock-market-position-text\"}>\n <p style={blockStyleMarkup}>Max Shares: {numeralWrapper.formatShares(stock.maxShares)}</p>\n <p className={\"tooltip\"}>\n Ask Price: <Money money={stock.getAskPrice()} />\n <span className={\"tooltiptext\"}>See Investopedia for details on what this is</span>\n </p>\n <br />\n <p className={\"tooltip\"}>\n Bid Price: <Money money={stock.getBidPrice()} />\n <span className={\"tooltiptext\"}>See Investopedia for details on what this is</span>\n </p>\n {this.renderLongPosition()}\n {this.renderShortPosition()}\n </div>\n );\n }\n}\n","/**\n * React Component for a simple Error Boundary. The fallback UI for\n * this error boundary is simply a bordered text box\n */\nimport * as React from \"react\";\n\nimport { EventEmitter } from \"../../utils/EventEmitter\";\n\ntype IProps = {\n eventEmitterForReset?: EventEmitter<[]>;\n id?: string;\n};\n\ntype IState = {\n errorInfo: string;\n hasError: boolean;\n};\n\ntype IErrorInfo = {\n componentStack: string;\n};\n\n// TODO: Move this out to a css file\nconst styleMarkup = {\n border: \"1px solid red\",\n display: \"inline-block\",\n margin: \"4px\",\n padding: \"4px\",\n};\n\nexport class ErrorBoundary extends React.Component<IProps, IState> {\n unsubscribe: (() => void) | null = null;\n constructor(props: IProps) {\n super(props);\n this.state = {\n errorInfo: \"\",\n hasError: false,\n };\n }\n\n componentDidCatch(error: Error, info: IErrorInfo): void {\n console.error(`Caught error in React ErrorBoundary. Component stack:`);\n console.error(info.componentStack);\n }\n\n componentDidMount(): void {\n const cb = (): void => {\n this.setState({\n hasError: false,\n });\n };\n\n if (this.hasEventEmitter()) {\n this.unsubscribe = (this.props.eventEmitterForReset as EventEmitter<[]>).subscribe(cb);\n }\n }\n\n componentWillUnmount(): void {\n if (this.unsubscribe !== null) {\n this.unsubscribe();\n }\n }\n\n hasEventEmitter(): boolean {\n return (\n this.props.eventEmitterForReset != null &&\n this.props.eventEmitterForReset instanceof EventEmitter &&\n this.props.id != null &&\n typeof this.props.id === \"string\"\n );\n }\n\n render(): React.ReactNode {\n if (this.state.hasError) {\n return (\n <div style={styleMarkup}>\n <p>{`Error rendering UI. This is (probably) a bug. Please report to game developer.`}</p>\n <p>{`In the meantime, try refreshing the game WITHOUT saving.`}</p>\n <p>{`Error info: ${this.state.errorInfo}`}</p>\n </div>\n );\n }\n\n return this.props.children;\n }\n\n static getDerivedStateFromError(error: Error): IState {\n return {\n errorInfo: error.message,\n hasError: true,\n };\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 { PortalPopup } from \"./PortalPopup\";\nimport { createPopup } from \"../../ui/React/createPopup\";\nimport { CinematicText } from \"../../ui/React/CinematicText\";\nimport { use } from \"../../ui/Context\";\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 router = use.Router();\n const bitNode = BitNodes[`BitNode${props.n}`];\n if (bitNode == null) {\n return <>O</>;\n }\n\n let cssClass;\n if (props.n === 12 && props.level >= 2) {\n // Repeating BitNode\n cssClass = \"level-2\";\n } else {\n cssClass = `level-${props.level}`;\n }\n\n function openPortalPopup(): void {\n const popupId = \"bitverse-portal-popup\";\n createPopup(popupId, PortalPopup, {\n n: props.n,\n level: props.level,\n enter: props.enter,\n router: router,\n destroyedBitNode: props.destroyedBitNode,\n flume: props.flume,\n popupId: popupId,\n });\n }\n\n return (\n <button\n className={`bitnode ${cssClass} tooltip`}\n aria-label={`enter-bitnode-${bitNode.number.toString()}`}\n onClick={openPortalPopup}\n >\n <strong>O</strong>\n <span className=\"tooltiptext\">\n <strong>\n BitNode-{bitNode.number.toString()}\n <br />\n {bitNode.name}\n </strong>\n <br />\n {bitNode.desc}\n <br />\n </span>\n </button>\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 <div className=\"noselect\">\n <pre> O </pre>\n <pre> | O O | O O | </pre>\n <pre> O | | / __| \\ | | O </pre>\n <pre> O | O | | O / | O | | O | O </pre>\n <pre> | | | | |_/ |/ | \\_ \\_| | | | | </pre>\n <pre> O | | | O | | O__/ | / \\__ | | O | | | O </pre>\n <pre> | | | | | | | / /| O / \\| | | | | | | </pre>\n <pre>O | | | \\| | O / _/ | / O | |/ | | | O</pre>\n <pre>| | | |O / | | O / | O O | | \\ O| | | |</pre>\n <pre>| | |/ \\/ / __| | |/ \\ | \\ | |__ \\ \\/ \\| | |</pre>\n <pre> \\| O | |_/ |\\| \\ O \\__| \\_| | O |/ </pre>\n <pre> | | |_/ | | \\| / | \\_| | | </pre>\n <pre> \\| / \\| | / / \\ |/ </pre>\n <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} /> | </pre>\n <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} /> </pre>\n <pre> | | | / / \\ \\ | | | </pre>\n <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} /> \\ | |/ </pre>\n <pre> \\ | / / | | \\ \\ | / </pre>\n <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/ / </pre>\n <pre> \\|| | | | | | | | | ||/ </pre>\n <pre> \\| \\_ | | | | | | _/ |/ </pre>\n <pre> \\ \\| / \\ / \\ |/ / </pre>\n <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} /> </pre>\n <pre> | | | | | | | | </pre>\n <pre> \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ </pre>\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 </div>\n );\n\n return <></>;\n}\n","import React from \"react\";\n\nimport { BitNodes } from \"../BitNode\";\nimport { IRouter } from \"../../ui/Router\";\nimport { removePopup } from \"../../ui/React/createPopup\";\ninterface IProps {\n n: number;\n level: number;\n destroyedBitNode: number;\n flume: boolean;\n router: IRouter;\n enter: (router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number) => void;\n popupId: string;\n}\n\nexport function PortalPopup(props: IProps): React.ReactElement {\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 <>\n <h1>\n BitNode-{props.n}: {bitNode.name}\n </h1>\n <br />\n Source-File Level: {props.level} / {maxSourceFileLevel}\n <br />\n <br />\n Difficulty: {[\"easy\", \"normal\", \"hard\"][bitNode.difficulty]}\n <br />\n <br />\n {bitNode.info}\n <br />\n <br />\n <button\n className=\"std-button\"\n onClick={() => {\n props.enter(props.router, props.flume, props.destroyedBitNode, props.n);\n removePopup(props.popupId);\n }}\n >\n Enter BN{props.n}.{newLevel}\n </button>\n </>\n );\n}\n","import React, { useState, useEffect } from \"react\";\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 <pre>\n {props.text.slice(0, length)}\n {!done && <span>&#9608;</span>}\n </pre>\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&nbsp;</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&nbsp;in&nbsp;progress:</Typography>\n </TableCell>\n </TableRow>\n <TableRow>\n <TableCell component=\"th\" scope=\"row\" colSpan={2} classes={{ root: classes.cellNone }}>\n <Typography>+{Reputation(player.workRepGained)} rep</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&nbsp;</Typography>\n </TableCell>\n <TableCell align=\"right\" classes={{ root: classes.cellNone }}>\n <Typography classes={{ root: classes.hp }}>\n {numeralWrapper.formatHp(player.hp)}&nbsp;/&nbsp;{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&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</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&nbsp;</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 \"../../../utils/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 { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { removePopup } from \"../../ui/React/createPopup\";\n\ninterface IProps {\n player: IPlayer;\n faction: Faction;\n popupId: string;\n}\n\nexport function InvitationPopup(props: IProps): React.ReactElement {\n function join(): void {\n //Remove from invited factions\n const i = props.player.factionInvitations.findIndex((facName) => facName === props.faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(props.faction);\n removePopup(props.popupId);\n }\n\n return (\n <>\n <h1>You have received a faction invitation.</h1>\n <p>\n Would you like to join {props.faction.name}? <br />\n <br />\n Warning: Joining this faction may prevent you from joining other factions during this run!\n </p>\n <button className=\"std-button\" onClick={join}>\n Join!\n </button>\n <button className=\"std-button\" onClick={() => removePopup(props.popupId)}>\n Decide later\n </button>\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 // This has non-multiplier effects\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 { SpecialServerIps } from \"../../Server/SpecialServerIps\";\n\nexport function buy(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number)[],\n): void {\n if (!SpecialServerIps.hasOwnProperty(\"Darkweb Server\")) {\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 ip = 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.ip == ip || other.hostname == ip) {\n terminal.connectToServer(player, ip);\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 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().ip;\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\";\n\nexport function ifconfig(\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 ifconfig command. Usage: ifconfig\");\n return;\n }\n terminal.print(player.getCurrentServer().ip);\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.ip, 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.ip, 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 = `export 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 { logBoxCreate } from \"../../../utils/LogBox\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport * as libarg from \"arg\";\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 ramUsage +\n \"GB 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 logBoxCreate(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/ServerHelpers\";\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 { logBoxCreate } from \"../../../utils/LogBox\";\nimport { findRunningScriptByPid } from \"../../Script/ScriptHelpers\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { compareArrays } from \"../../../utils/helpers/compareArrays\";\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 logBoxCreate(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 logBoxCreate(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 logBoxCreate(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 { 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\nexport function startTampering(): void {\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","import { Player } from \"../Player\";\nimport { Exploit } from \"./Exploit\";\n\nexport function startUnclickable(): void {\n function clickTheUnclickable(event: MouseEvent): void {\n if (!event.target || !(event.target instanceof Element)) return;\n const display = window.getComputedStyle(event.target as Element).display;\n if (display === \"none\" && event.isTrusted) Player.giveExploit(Exploit.Unclickable);\n }\n\n function targetElement(): void {\n const elem = document.getElementById(\"unclickable\");\n if (elem == null) {\n console.error(\"Could not find the unclickable elem for the related exploit.\");\n return;\n }\n elem.addEventListener(\"click\", clickTheUnclickable);\n document.removeEventListener(\"DOMContentLoaded\", targetElement);\n }\n\n document.addEventListener(\"DOMContentLoaded\", targetElement);\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\";\nimport \"./engineStyle\";\n\nReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"mainmenu-container\"),\n);\n\nfunction rerender() {\n refreshTheme();\n ReactDOM.render(\n <Theme>\n <LoadingScreen />\n </Theme>,\n document.getElementById(\"mainmenu-container\"),\n );\n}\n\n(function () {\n ThemeEvents.subscribe(rerender);\n})();\n","// These should really be imported with the module that is presenting that UI, but because they very much depend on the\n// cascade order, we'll pull them all in here.\nimport \"normalize.css\";\nimport \"../css/styles.scss\";\nimport \"../css/tooltips.scss\";\nimport \"../css/buttons.scss\";\nimport \"../css/mainmenu.scss\";\nimport \"../css/characteroverview.scss\";\n\nimport \"../css/scripteditor.scss\";\nimport \"../css/hacknetnodes.scss\";\nimport \"../css/menupages.scss\";\nimport \"../css/augmentations.scss\";\nimport \"../css/redpill.scss\";\nimport \"../css/stockmarket.scss\";\nimport \"../css/workinprogress.scss\";\nimport \"../css/popupboxes.scss\";\nimport \"../css/gameoptions.scss\";\nimport \"../css/interactivetutorial.scss\";\nimport \"../css/loader.scss\";\nimport \"../css/missions.scss\";\nimport \"../css/companymanagement.scss\";\nimport \"../css/bladeburner.scss\";\nimport \"../css/gang.scss\";\nimport \"../css/sleeves.scss\";\nimport \"../css/resleeving.scss\";\nimport \"../css/treant.css\";\nimport \"../css/grid.min.css\";\nimport \"../css/dev-menu.css\";\nimport \"../css/casino.scss\";\nimport \"../css/milestones.scss\";\nimport \"../css/infiltration.scss\";\n"],"sourceRoot":""}