diff --git a/src/Augmentation/AugmentationHelpers.d.ts b/src/Augmentation/AugmentationHelpers.d.ts new file mode 100644 index 000000000..9e2bb7935 --- /dev/null +++ b/src/Augmentation/AugmentationHelpers.d.ts @@ -0,0 +1 @@ +export declare function isRepeatableAug(aug: Augmentation): boolean; diff --git a/src/Augmentation/AugmentationHelpers.jsx b/src/Augmentation/AugmentationHelpers.jsx index d71909c97..0cb0c45eb 100644 --- a/src/Augmentation/AugmentationHelpers.jsx +++ b/src/Augmentation/AugmentationHelpers.jsx @@ -3,16 +3,11 @@ import { Augmentations } from "./Augmentations"; import { PlayerOwnedAugmentation } from "./PlayerOwnedAugmentation"; import { AugmentationNames } from "./data/AugmentationNames"; -import { AugmentationsRoot } from "./ui/Root"; - import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { CONSTANTS } from "../Constants"; import { Factions, factionExists } from "../Faction/Factions"; import { Player } from "../Player"; import { prestigeAugmentation } from "../Prestige"; -import { saveObject } from "../SaveObject"; -import { Page, routing } from "../ui/navigationTracking"; -import { onExport } from "../ExportBonus"; import { Programs } from "../Programs/Programs"; import { SourceFileFlags } from "../SourceFile/SourceFileFlags"; @@ -22,7 +17,6 @@ import { clearObject } from "../../utils/helpers/clearObject"; import { WHRNG } from "../Casino/RNG"; import React from "react"; -import ReactDOM from "react-dom"; function AddToAugmentations(aug) { var name = aug.name; diff --git a/src/BitNode/BitNode.ts b/src/BitNode/BitNode.ts deleted file mode 100644 index df9c1e866..000000000 --- a/src/BitNode/BitNode.ts +++ /dev/null @@ -1,557 +0,0 @@ -import { BitNodeMultipliers } from "./BitNodeMultipliers"; -import { IPlayer } from "../PersonObjects/IPlayer"; -import { IMap } from "../types"; - -class BitNode { - // A short description, or tagline, about the BitNode - desc: string; - - // A long, detailed overview of the BitNode - info: string; - - // Name of BitNode - name: string; - - // BitNode number - number: number; - - constructor(n: number, name: string, desc = "", info = "") { - this.number = n; - this.name = name; - this.desc = desc; - this.info = info; - } -} - -export const BitNodes: IMap = {}; - -BitNodes["BitNode1"] = new BitNode( - 1, - "Source Genesis", - "The original BitNode", - "The first BitNode created by the Enders to imprison the minds of humans. It became " + - "the prototype and testing-grounds for all of the BitNodes that followed.

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

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

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

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

" + - "In this BitNode:

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

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

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

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

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

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

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

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

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

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

" + - "In this BitNode:

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

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

" + - "In addition, this Source-File will unlock the getBitNodeMultipliers() and getServer() Netscript functions, " + - "as well as the formulas API, and will also raise all of your hacking-related multipliers by:

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

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

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

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

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

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

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

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

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

" + - "In this BitNode:

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

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

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

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

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

" + - "In this BitNode:

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

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

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

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

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

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

" + - "In this BitNode:

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

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

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

" + - "In this BitNode:

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

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

" + - "Level 1: 32%
" + - "Level 2: 48%
" + - "Level 3: 56%

" + - "It also reduces the price increase for every aug bought by:

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

" + - "Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you Source-File 12, or " + - "if you already have this Source-File it will upgrade its level. There is no maximum level for Source-File 12. Each level " + - "of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the level of this source file.", -); -// Books: Frontera, Shiner -BitNodes["BitNode13"] = new BitNode(13, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes -BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); -BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); -BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); -BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); -BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); -BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); -BitNodes["BitNode20"] = new BitNode(20, "", "COMING SOON"); -BitNodes["BitNode21"] = new BitNode(21, "", "COMING SOON"); -BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); -BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); -BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); - -export function initBitNodeMultipliers(p: IPlayer): void { - if (p.bitNodeN == null) { - p.bitNodeN = 1; - } - for (const mult in BitNodeMultipliers) { - if (BitNodeMultipliers.hasOwnProperty(mult)) { - BitNodeMultipliers[mult] = 1; - } - } - - switch (p.bitNodeN) { - case 1: // Source Genesis (every multiplier is 1) - break; - case 2: // Rise of the Underworld - BitNodeMultipliers.HackingLevelMultiplier = 0.8; - BitNodeMultipliers.ServerGrowthRate = 0.8; - BitNodeMultipliers.ServerMaxMoney = 0.2; - BitNodeMultipliers.ServerStartingMoney = 0.4; - BitNodeMultipliers.CrimeMoney = 3; - BitNodeMultipliers.InfiltrationMoney = 3; - BitNodeMultipliers.FactionWorkRepGain = 0.5; - BitNodeMultipliers.FactionPassiveRepGain = 0; - BitNodeMultipliers.GangKarmaRequirement = 0; - break; - case 3: // Corporatocracy - BitNodeMultipliers.HackingLevelMultiplier = 0.8; - BitNodeMultipliers.RepToDonateToFaction = 0.5; - BitNodeMultipliers.AugmentationRepCost = 3; - BitNodeMultipliers.AugmentationMoneyCost = 3; - BitNodeMultipliers.ServerMaxMoney = 0.2; - BitNodeMultipliers.ServerStartingMoney = 0.2; - BitNodeMultipliers.ServerGrowthRate = 0.2; - BitNodeMultipliers.ScriptHackMoney = 0.2; - BitNodeMultipliers.CompanyWorkMoney = 0.25; - BitNodeMultipliers.CrimeMoney = 0.25; - BitNodeMultipliers.HacknetNodeMoney = 0.25; - BitNodeMultipliers.HomeComputerRamCost = 1.5; - BitNodeMultipliers.PurchasedServerCost = 2; - BitNodeMultipliers.GangKarmaRequirement = 3; - break; - case 4: // The Singularity - BitNodeMultipliers.ServerMaxMoney = 0.15; - BitNodeMultipliers.ServerStartingMoney = 0.75; - BitNodeMultipliers.ScriptHackMoney = 0.2; - BitNodeMultipliers.CompanyWorkMoney = 0.1; - BitNodeMultipliers.CrimeMoney = 0.2; - BitNodeMultipliers.HacknetNodeMoney = 0.05; - BitNodeMultipliers.CompanyWorkExpGain = 0.5; - BitNodeMultipliers.ClassGymExpGain = 0.5; - BitNodeMultipliers.FactionWorkExpGain = 0.5; - BitNodeMultipliers.HackExpGain = 0.4; - BitNodeMultipliers.CrimeExpGain = 0.5; - BitNodeMultipliers.FactionWorkRepGain = 0.75; - break; - case 5: // Artificial intelligence - BitNodeMultipliers.ServerMaxMoney = 2; - BitNodeMultipliers.ServerStartingSecurity = 2; - BitNodeMultipliers.ServerStartingMoney = 0.5; - BitNodeMultipliers.ScriptHackMoney = 0.15; - BitNodeMultipliers.HacknetNodeMoney = 0.2; - BitNodeMultipliers.CrimeMoney = 0.5; - BitNodeMultipliers.InfiltrationRep = 1.5; - BitNodeMultipliers.InfiltrationMoney = 1.5; - BitNodeMultipliers.AugmentationMoneyCost = 2; - BitNodeMultipliers.HackExpGain = 0.5; - BitNodeMultipliers.CorporationValuation = 0.5; - break; - case 6: // Bladeburner - BitNodeMultipliers.HackingLevelMultiplier = 0.35; - BitNodeMultipliers.ServerMaxMoney = 0.4; - BitNodeMultipliers.ServerStartingMoney = 0.5; - BitNodeMultipliers.ServerStartingSecurity = 1.5; - BitNodeMultipliers.ScriptHackMoney = 0.75; - BitNodeMultipliers.CompanyWorkMoney = 0.5; - BitNodeMultipliers.CrimeMoney = 0.75; - BitNodeMultipliers.InfiltrationMoney = 0.75; - BitNodeMultipliers.CorporationValuation = 0.2; - BitNodeMultipliers.HacknetNodeMoney = 0.2; - BitNodeMultipliers.FactionPassiveRepGain = 0; - BitNodeMultipliers.HackExpGain = 0.25; - BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed - BitNodeMultipliers.GangKarmaRequirement = 5; - break; - case 7: // Bladeburner 2079 - BitNodeMultipliers.BladeburnerRank = 0.6; - BitNodeMultipliers.BladeburnerSkillCost = 2; - BitNodeMultipliers.AugmentationMoneyCost = 3; - BitNodeMultipliers.HackingLevelMultiplier = 0.35; - BitNodeMultipliers.ServerMaxMoney = 0.4; - BitNodeMultipliers.ServerStartingMoney = 0.5; - BitNodeMultipliers.ServerStartingSecurity = 1.5; - BitNodeMultipliers.ScriptHackMoney = 0.5; - BitNodeMultipliers.CompanyWorkMoney = 0.5; - BitNodeMultipliers.CrimeMoney = 0.75; - BitNodeMultipliers.InfiltrationMoney = 0.75; - BitNodeMultipliers.CorporationValuation = 0.2; - BitNodeMultipliers.HacknetNodeMoney = 0.2; - BitNodeMultipliers.FactionPassiveRepGain = 0; - BitNodeMultipliers.HackExpGain = 0.25; - BitNodeMultipliers.FourSigmaMarketDataCost = 2; - BitNodeMultipliers.FourSigmaMarketDataApiCost = 2; - BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed - BitNodeMultipliers.GangKarmaRequirement = 5; - break; - case 8: // Ghost of Wall Street - BitNodeMultipliers.ScriptHackMoney = 0.3; - BitNodeMultipliers.ScriptHackMoneyGain = 0; - BitNodeMultipliers.ManualHackMoney = 0; - BitNodeMultipliers.CompanyWorkMoney = 0; - BitNodeMultipliers.CrimeMoney = 0; - BitNodeMultipliers.HacknetNodeMoney = 0; - BitNodeMultipliers.InfiltrationMoney = 0; - BitNodeMultipliers.RepToDonateToFaction = 0; - BitNodeMultipliers.CorporationValuation = 0; - BitNodeMultipliers.CodingContractMoney = 0; - BitNodeMultipliers.GangKarmaRequirement = 10; - break; - case 9: // Hacktocracy - BitNodeMultipliers.HackingLevelMultiplier = 0.4; - BitNodeMultipliers.StrengthLevelMultiplier = 0.45; - BitNodeMultipliers.DefenseLevelMultiplier = 0.45; - BitNodeMultipliers.DexterityLevelMultiplier = 0.45; - BitNodeMultipliers.AgilityLevelMultiplier = 0.45; - BitNodeMultipliers.CharismaLevelMultiplier = 0.45; - BitNodeMultipliers.PurchasedServerLimit = 0; - BitNodeMultipliers.HomeComputerRamCost = 5; - BitNodeMultipliers.CrimeMoney = 0.5; - BitNodeMultipliers.ScriptHackMoney = 0.1; - BitNodeMultipliers.HackExpGain = 0.05; - BitNodeMultipliers.ServerStartingMoney = 0.1; - BitNodeMultipliers.ServerMaxMoney = 0.1; - BitNodeMultipliers.ServerStartingSecurity = 2.5; - BitNodeMultipliers.CorporationValuation = 0.5; - BitNodeMultipliers.FourSigmaMarketDataCost = 5; - BitNodeMultipliers.FourSigmaMarketDataApiCost = 4; - BitNodeMultipliers.BladeburnerRank = 0.9; - BitNodeMultipliers.BladeburnerSkillCost = 1.2; - BitNodeMultipliers.GangKarmaRequirement = 3; - break; - case 10: // Digital Carbon - BitNodeMultipliers.HackingLevelMultiplier = 0.2; - BitNodeMultipliers.StrengthLevelMultiplier = 0.4; - BitNodeMultipliers.DefenseLevelMultiplier = 0.4; - BitNodeMultipliers.DexterityLevelMultiplier = 0.4; - BitNodeMultipliers.AgilityLevelMultiplier = 0.4; - BitNodeMultipliers.CharismaLevelMultiplier = 0.4; - BitNodeMultipliers.CompanyWorkMoney = 0.5; - BitNodeMultipliers.CrimeMoney = 0.5; - BitNodeMultipliers.HacknetNodeMoney = 0.5; - BitNodeMultipliers.ManualHackMoney = 0.5; - BitNodeMultipliers.ScriptHackMoney = 0.5; - BitNodeMultipliers.CodingContractMoney = 0.5; - BitNodeMultipliers.InfiltrationMoney = 0.5; - BitNodeMultipliers.CorporationValuation = 0.5; - BitNodeMultipliers.AugmentationMoneyCost = 5; - BitNodeMultipliers.AugmentationRepCost = 2; - BitNodeMultipliers.HomeComputerRamCost = 1.5; - BitNodeMultipliers.PurchasedServerCost = 5; - BitNodeMultipliers.PurchasedServerLimit = 0.6; - BitNodeMultipliers.PurchasedServerMaxRam = 0.5; - BitNodeMultipliers.BladeburnerRank = 0.8; - BitNodeMultipliers.GangKarmaRequirement = 3; - break; - case 11: //The Big Crash - BitNodeMultipliers.HackingLevelMultiplier = 0.5; - BitNodeMultipliers.HackExpGain = 0.5; - BitNodeMultipliers.ServerMaxMoney = 0.1; - BitNodeMultipliers.ServerStartingMoney = 0.1; - BitNodeMultipliers.ServerGrowthRate = 0.2; - BitNodeMultipliers.ServerWeakenRate = 2; - BitNodeMultipliers.CrimeMoney = 3; - BitNodeMultipliers.CompanyWorkMoney = 0.5; - BitNodeMultipliers.HacknetNodeMoney = 0.1; - BitNodeMultipliers.AugmentationMoneyCost = 2; - BitNodeMultipliers.InfiltrationMoney = 2.5; - BitNodeMultipliers.InfiltrationRep = 2.5; - BitNodeMultipliers.CorporationValuation = 0.1; - BitNodeMultipliers.CodingContractMoney = 0.25; - BitNodeMultipliers.FourSigmaMarketDataCost = 4; - BitNodeMultipliers.FourSigmaMarketDataApiCost = 4; - break; - case 12: { - //The Recursion - let sf12Lvl = 0; - for (let i = 0; i < p.sourceFiles.length; i++) { - if (p.sourceFiles[i].n === 12) { - sf12Lvl = p.sourceFiles[i].lvl; - } - } - const inc = Math.pow(1.02, sf12Lvl); - const dec = 1 / inc; - - // Multiplier for number of augs needed for Daedalus increases - // up to a maximum of 1.34, which results in 40 Augs required - BitNodeMultipliers.DaedalusAugsRequirement = Math.min(inc, 1.34); - - BitNodeMultipliers.HackingLevelMultiplier = dec; - BitNodeMultipliers.StrengthLevelMultiplier = dec; - BitNodeMultipliers.DefenseLevelMultiplier = dec; - BitNodeMultipliers.DexterityLevelMultiplier = dec; - BitNodeMultipliers.AgilityLevelMultiplier = dec; - BitNodeMultipliers.CharismaLevelMultiplier = dec; - - BitNodeMultipliers.ServerMaxMoney = dec; - BitNodeMultipliers.ServerStartingMoney = dec; - BitNodeMultipliers.ServerGrowthRate = dec; - BitNodeMultipliers.ServerWeakenRate = dec; - - //Does not scale, otherwise security might start at 300+ - BitNodeMultipliers.ServerStartingSecurity = 1.5; - - BitNodeMultipliers.HomeComputerRamCost = inc; - - BitNodeMultipliers.PurchasedServerCost = inc; - BitNodeMultipliers.PurchasedServerLimit = dec; - BitNodeMultipliers.PurchasedServerMaxRam = dec; - - BitNodeMultipliers.ManualHackMoney = dec; - BitNodeMultipliers.ScriptHackMoney = dec; - BitNodeMultipliers.CompanyWorkMoney = dec; - BitNodeMultipliers.CrimeMoney = dec; - BitNodeMultipliers.HacknetNodeMoney = dec; - BitNodeMultipliers.CodingContractMoney = dec; - - BitNodeMultipliers.CompanyWorkExpGain = dec; - BitNodeMultipliers.ClassGymExpGain = dec; - BitNodeMultipliers.FactionWorkExpGain = dec; - BitNodeMultipliers.HackExpGain = dec; - BitNodeMultipliers.CrimeExpGain = dec; - - BitNodeMultipliers.FactionWorkRepGain = dec; - BitNodeMultipliers.FactionPassiveRepGain = dec; - BitNodeMultipliers.RepToDonateToFaction = inc; - - BitNodeMultipliers.AugmentationRepCost = inc; - BitNodeMultipliers.AugmentationMoneyCost = inc; - - BitNodeMultipliers.InfiltrationMoney = dec; - BitNodeMultipliers.InfiltrationRep = dec; - - BitNodeMultipliers.FourSigmaMarketDataCost = inc; - BitNodeMultipliers.FourSigmaMarketDataApiCost = inc; - - BitNodeMultipliers.CorporationValuation = dec; - - BitNodeMultipliers.BladeburnerRank = dec; - BitNodeMultipliers.BladeburnerSkillCost = inc; - break; - } - default: - console.warn("Player.bitNodeN invalid"); - break; - } -} diff --git a/src/BitNode/BitNode.tsx b/src/BitNode/BitNode.tsx new file mode 100644 index 000000000..464afeabc --- /dev/null +++ b/src/BitNode/BitNode.tsx @@ -0,0 +1,776 @@ +import React from "react"; +import { BitNodeMultipliers } from "./BitNodeMultipliers"; +import { IPlayer } from "../PersonObjects/IPlayer"; +import { IMap } from "../types"; + +class BitNode { + // A short description, or tagline, about the BitNode + desc: string; + + // A long, detailed overview of the BitNode + info: JSX.Element; + + // Name of BitNode + name: string; + + // BitNode number + number: number; + + constructor(n: number, name: string, desc = "", info: JSX.Element = <>) { + this.number = n; + this.name = name; + this.desc = desc; + this.info = info; + } +} + +export const BitNodes: IMap = {}; + +BitNodes["BitNode1"] = new BitNode( + 1, + "Source Genesis", + "The original BitNode", + ( + <> + The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and + testing-grounds for all of the BitNodes that followed. +
+
+ This is the first BitNode that you play through. It has no special modifications or mechanics. +
+
+ Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when + entering a new BitNode, and also increases all of the player's multipliers by: +
+
+ Level 1: 16% +
+ Level 2: 24% +
+ Level 3: 28% + + ), +); +BitNodes["BitNode2"] = new BitNode( + 2, + "Rise of the Underworld", + "From the shadows, they rose", //Gangs + ( + <> + From the shadows, they rose. +
+
+ Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the + 2050s. As society and civlization broke down, people quickly succumbed to the innate human impulse of evil and + savagery. The organized crime factions quickly rose to the top of the modern world. +
+
+ In this BitNode: +
+
+ Your hacking level is reduced by 20% +
+ The growth rate and maximum amount of money available on servers are significantly decreased +
+ The amount of money gained from crimes and Infiltration is tripled +
+ Certain Factions (Slum Snakes, Tetrads, The Syndicate, The Dark Army, Speakers for the Dead, NiteSec, The Black + Hand) give the player the ability to form and manage their own gangs. These gangs will earn the player money and + reputation with the corresponding Faction +
+ Every Augmentation in the game will be available through the Factions listed above +
+ For every Faction NOT listed above, reputation gains are halved +
+ You will no longer gain passive reputation with Factions +
+
+ Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases + to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by: +
+
+ Level 1: 24% +
+ Level 2: 36% +
+ Level 3: 42% + + ), +); +BitNodes["BitNode3"] = new BitNode( + 3, + "Corporatocracy", + "The Price of Civilization", + ( + <> + Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth. +
+
+ Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy, + and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own + community, and evict their neighbors from houses in their desperate bid to increase their wealth. +
+
+ In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential + of generating massive profits. All other forms of income are reduced by 75%. Furthermore:
+
+ The price and reputation cost of all Augmentations is tripled +
+ The starting and maximum amount of money on servers is reduced by 75% +
+ Server growth rate is reduced by 80% +
+ You now only need 75 favour with a faction in order to donate to it, rather than 150 +
+
+ Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some + BitNodes will disable this mechanic). This Source-File also increases your charisma and company salary multipliers + by: +
+ Level 1: 8% +
+ Level 2: 12% +
+ Level 3: 14% + + ), +); +BitNodes["BitNode4"] = new BitNode( + 4, + "The Singularity", + "The Man and the Machine", + ( + <> + The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are + more machine than man.
+
+ In this BitNode, progressing is significantly harder. Experience gain rates for all stats are reduced. Most + methods of earning money will now give significantly less. +
+
+ In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These + functions allow you to control most aspects of the game through scripts, including working for factions/companies, + purchasing/installing Augmentations, and creating programs. +
+
+ Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes. + Each level of this Source-File will open up more Singularity Functions that you can use. + + ), +); +BitNodes["BitNode5"] = new BitNode( + 5, + "Artificial Intelligence", + "Posthuman", + ( + <> + They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't + be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that + couldn't be modeled by 1's and 0's. They were wrong. +
+
+ In this BitNode: +
+
+ The base security level of servers is doubled +
+ The starting money on servers is halved, but the maximum money remains the same +
+ Most methods of earning money now give significantly less +
+ Infiltration gives 50% more reputation and money +
+ Corporations have 50% lower valuations and are therefore less profitable +
+ Augmentations are more expensive +
+ Hacking experience gain rates are reduced +
+
+ Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is + unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence + experience is much slower than other stats, and it is also hidden (you won't know when you gain experience and how + much). Higher Intelligence levels will boost your production for many actions in the game.
+
+ In addition, this Source-File will unlock the getBitNodeMultipliers() and getServer() Netscript functions, as well + as the formulas API, and will also raise all of your hacking-related multipliers by: +
+
+ Level 1: 8% +
+ Level 2: 12% +
+ Level 3: 14% + + ), +); +BitNodes["BitNode6"] = new BitNode( + 6, + "Bladeburners", + "Like Tears in Rain", + ( + <> + In the middle of the 21st century, OmniTek Incorporated began designing and manufacturing advanced synthetic + androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth generation of + their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was the first + sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more intelligent than + the humans that had created them. +
+
+ In this BitNode you will be able to access the Bladeburner Division at the NSA, which provides a new mechanic for + progression. Furthermore: +
+
+ Hacking and Hacknet Nodes will be less profitable +
+ Your hacking level is reduced by 65% +
+ Hacking experience gain from scripts is reduced by 75% +
+ Corporations have 80% lower valuations and are therefore less profitable +
+ Working for companies is 50% less profitable +
+ Crimes and Infiltration are 25% less profitable +
+
+ Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File allows you to access the NSA's Bladeburner Division in other + BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your combat + stats by: +
+
+ Level 1: 8% +
+ Level 2: 12% +
+ Level 3: 14% + + ), +); +BitNodes["BitNode7"] = new BitNode( + 7, + "Bladeburners 2079", + "More human than humans", + ( + <> + In the middle of the 21st century, you were doing cutting-edge work at OmniTek Incorporated as part of the AI + design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major technological + breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a + hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models + that were stronger, faster, and more intelligent than the humans that had created them. +
+
+ In this BitNode you will be able to access the Bladeburner API, which allows you to access Bladeburner + functionality through Netscript. Furthermore:
+
+ The rank you gain from Bladeburner contracts/operations is reduced by 40% +
+ Bladeburner skills cost twice as many skill points +
+ Augmentations are 3x more expensive +
+ Hacking and Hacknet Nodes will be significantly less profitable +
+ Your hacking level is reduced by 65% +
+ Hacking experience gain from scripts is reduced by 75% +
+ Corporations have 80% lower valuations and are therefore less profitable +
+ Working for companies is 50% less profitable +
+ Crimes and Infiltration are 25% less profitable +
+
+ Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. + In addition, this Source-File will increase all of your Bladeburner multipliers by: +
+
+ Level 1: 8% +
+ Level 2: 12% +
+ Level 3: 14% + + ), +); +BitNodes["BitNode8"] = new BitNode( + 8, + "Ghost of Wall Street", + "Money never sleeps", + ( + <> + You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street. +
+
+ In this BitNode: +
+
+ You start with $250 million +
+ The only way to earn money is by trading on the stock market +
+ You start with a WSE membership and access to the TIX API +
+ You are able to short stocks and place different types of orders (limit/stop) +
+ You can immediately donate to factions to gain reputation +
+
+ Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File grants the following benefits: +
+
+ Level 1: Permanent access to WSE and TIX API +
+ Level 2: Ability to short stocks in other BitNodes +
+ Level 3: Ability to use limit/stop orders in other BitNodes +
+
+ This Source-File also increases your hacking growth multipliers by: +
+ Level 1: 12% +
+ Level 2: 18% +
+ Level 3: 21% + + ), +); +BitNodes["BitNode9"] = new BitNode( + 9, + "Hacktocracy", + "Hacknet Unleashed", + ( + <> + When Fulcrum Technologies released their open-source Linux distro Chapeau, it quickly became the OS of choice for + the underground hacking community. Chapeau became especially notorious for powering the Hacknet, a global, + decentralized network used for nefarious purposes. Fulcrum quickly abandoned the project and dissociated + themselves from it. +
+
+ This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes, + which can be spent on a variety of different upgrades. +
+
+ In this BitNode: +
+
+ Your stats are significantly decreased +
+ You cannnot purchase additional servers +
+ Hacking is significantly less profitable +
+
+ Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File grants the following benefits: +
+
+ Level 1: Permanently unlocks the Hacknet Server in other BitNodes +
+ Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode +
+ Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode +
+
+ (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing + Augmentations) + + ), +); +BitNodes["BitNode10"] = new BitNode( + 10, + "Digital Carbon", + "Your body is not who you are", + ( + <> + In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their + consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the + digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally + achieved immortality - at least for those that could afford it. +
+
+ This BitNode unlocks Sleeve technology. Sleeve technology allows you to: +
+
+ 1. Re-sleeve: Purchase and transfer your consciousness into a new body +
+ 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks + synchronously +
+
+ In this BitNode: +
+
+ Your stats are significantly decreased +
+ All methods of gaining money are half as profitable (except Stock Market) +
+ Purchased servers are more expensive, have less max RAM, and a lower maximum limit +
+ Augmentations are 5x as expensive and require twice as much reputation +
+
+ Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File unlocks Sleeve technology in other BitNodes. Each level of this + Source-File also grants you a Duplicate Sleeve + + ), +); +BitNodes["BitNode11"] = new BitNode( + 11, + "The Big Crash", + "Okay. Sell it all.", + ( + <> + The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around + the world. It was this period of disorder that eventually lead to the governmental reformation of many global + superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark + times, financial catastrophe hit. +
+
+ In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of + this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic + banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the + world is slowly crumbling in the middle of the biggest economic crisis of all time. +
+
+ In this BitNode: +
+
+ Your hacking stat and experience gain are halved +
+ The starting and maximum amount of money available on servers is significantly decreased +
+ The growth rate of servers is significantly reduced +
+ Weakening a server is twice as effective +
+ Company wages are decreased by 50% +
+ Corporation valuations are 90% lower and are therefore significantly less profitable +
+ Hacknet Node production is significantly decreased +
+ Crime and Infiltration are more lucrative +
+ Augmentations are twice as expensive +
+
+ Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its + level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and + reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also + increases the player's company salary and reputation gain multipliers by: +
+
+ Level 1: 32% +
+ Level 2: 48% +
+ Level 3: 56% +
+
+ It also reduces the price increase for every aug bought by: +
+
+ Level 1: 4% +
+ Level 2: 6% +
+ Level 3: 7% + + ), +); +BitNodes["BitNode12"] = new BitNode( + 12, + "The Recursion", + "Repeat.", + ( + <> + To iterate is human, to recurse divine. +
+
+ Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you + Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for + Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the + level of this source file. + + ), +); +// Books: Frontera, Shiner +BitNodes["BitNode13"] = new BitNode(13, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes +BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); +BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); +BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); +BitNodes["BitNode17"] = new BitNode(17, "", "COMING SOON"); +BitNodes["BitNode18"] = new BitNode(18, "", "COMING SOON"); +BitNodes["BitNode19"] = new BitNode(19, "", "COMING SOON"); +BitNodes["BitNode20"] = new BitNode(20, "", "COMING SOON"); +BitNodes["BitNode21"] = new BitNode(21, "", "COMING SOON"); +BitNodes["BitNode22"] = new BitNode(22, "", "COMING SOON"); +BitNodes["BitNode23"] = new BitNode(23, "", "COMING SOON"); +BitNodes["BitNode24"] = new BitNode(24, "", "COMING SOON"); + +export function initBitNodeMultipliers(p: IPlayer): void { + if (p.bitNodeN == null) { + p.bitNodeN = 1; + } + for (const mult in BitNodeMultipliers) { + if (BitNodeMultipliers.hasOwnProperty(mult)) { + BitNodeMultipliers[mult] = 1; + } + } + + switch (p.bitNodeN) { + case 1: // Source Genesis (every multiplier is 1) + break; + case 2: // Rise of the Underworld + BitNodeMultipliers.HackingLevelMultiplier = 0.8; + BitNodeMultipliers.ServerGrowthRate = 0.8; + BitNodeMultipliers.ServerMaxMoney = 0.2; + BitNodeMultipliers.ServerStartingMoney = 0.4; + BitNodeMultipliers.CrimeMoney = 3; + BitNodeMultipliers.InfiltrationMoney = 3; + BitNodeMultipliers.FactionWorkRepGain = 0.5; + BitNodeMultipliers.FactionPassiveRepGain = 0; + BitNodeMultipliers.GangKarmaRequirement = 0; + break; + case 3: // Corporatocracy + BitNodeMultipliers.HackingLevelMultiplier = 0.8; + BitNodeMultipliers.RepToDonateToFaction = 0.5; + BitNodeMultipliers.AugmentationRepCost = 3; + BitNodeMultipliers.AugmentationMoneyCost = 3; + BitNodeMultipliers.ServerMaxMoney = 0.2; + BitNodeMultipliers.ServerStartingMoney = 0.2; + BitNodeMultipliers.ServerGrowthRate = 0.2; + BitNodeMultipliers.ScriptHackMoney = 0.2; + BitNodeMultipliers.CompanyWorkMoney = 0.25; + BitNodeMultipliers.CrimeMoney = 0.25; + BitNodeMultipliers.HacknetNodeMoney = 0.25; + BitNodeMultipliers.HomeComputerRamCost = 1.5; + BitNodeMultipliers.PurchasedServerCost = 2; + BitNodeMultipliers.GangKarmaRequirement = 3; + break; + case 4: // The Singularity + BitNodeMultipliers.ServerMaxMoney = 0.15; + BitNodeMultipliers.ServerStartingMoney = 0.75; + BitNodeMultipliers.ScriptHackMoney = 0.2; + BitNodeMultipliers.CompanyWorkMoney = 0.1; + BitNodeMultipliers.CrimeMoney = 0.2; + BitNodeMultipliers.HacknetNodeMoney = 0.05; + BitNodeMultipliers.CompanyWorkExpGain = 0.5; + BitNodeMultipliers.ClassGymExpGain = 0.5; + BitNodeMultipliers.FactionWorkExpGain = 0.5; + BitNodeMultipliers.HackExpGain = 0.4; + BitNodeMultipliers.CrimeExpGain = 0.5; + BitNodeMultipliers.FactionWorkRepGain = 0.75; + break; + case 5: // Artificial intelligence + BitNodeMultipliers.ServerMaxMoney = 2; + BitNodeMultipliers.ServerStartingSecurity = 2; + BitNodeMultipliers.ServerStartingMoney = 0.5; + BitNodeMultipliers.ScriptHackMoney = 0.15; + BitNodeMultipliers.HacknetNodeMoney = 0.2; + BitNodeMultipliers.CrimeMoney = 0.5; + BitNodeMultipliers.InfiltrationRep = 1.5; + BitNodeMultipliers.InfiltrationMoney = 1.5; + BitNodeMultipliers.AugmentationMoneyCost = 2; + BitNodeMultipliers.HackExpGain = 0.5; + BitNodeMultipliers.CorporationValuation = 0.5; + break; + case 6: // Bladeburner + BitNodeMultipliers.HackingLevelMultiplier = 0.35; + BitNodeMultipliers.ServerMaxMoney = 0.4; + BitNodeMultipliers.ServerStartingMoney = 0.5; + BitNodeMultipliers.ServerStartingSecurity = 1.5; + BitNodeMultipliers.ScriptHackMoney = 0.75; + BitNodeMultipliers.CompanyWorkMoney = 0.5; + BitNodeMultipliers.CrimeMoney = 0.75; + BitNodeMultipliers.InfiltrationMoney = 0.75; + BitNodeMultipliers.CorporationValuation = 0.2; + BitNodeMultipliers.HacknetNodeMoney = 0.2; + BitNodeMultipliers.FactionPassiveRepGain = 0; + BitNodeMultipliers.HackExpGain = 0.25; + BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed + BitNodeMultipliers.GangKarmaRequirement = 5; + break; + case 7: // Bladeburner 2079 + BitNodeMultipliers.BladeburnerRank = 0.6; + BitNodeMultipliers.BladeburnerSkillCost = 2; + BitNodeMultipliers.AugmentationMoneyCost = 3; + BitNodeMultipliers.HackingLevelMultiplier = 0.35; + BitNodeMultipliers.ServerMaxMoney = 0.4; + BitNodeMultipliers.ServerStartingMoney = 0.5; + BitNodeMultipliers.ServerStartingSecurity = 1.5; + BitNodeMultipliers.ScriptHackMoney = 0.5; + BitNodeMultipliers.CompanyWorkMoney = 0.5; + BitNodeMultipliers.CrimeMoney = 0.75; + BitNodeMultipliers.InfiltrationMoney = 0.75; + BitNodeMultipliers.CorporationValuation = 0.2; + BitNodeMultipliers.HacknetNodeMoney = 0.2; + BitNodeMultipliers.FactionPassiveRepGain = 0; + BitNodeMultipliers.HackExpGain = 0.25; + BitNodeMultipliers.FourSigmaMarketDataCost = 2; + BitNodeMultipliers.FourSigmaMarketDataApiCost = 2; + BitNodeMultipliers.DaedalusAugsRequirement = 1.166; // Results in 35 Augs needed + BitNodeMultipliers.GangKarmaRequirement = 5; + break; + case 8: // Ghost of Wall Street + BitNodeMultipliers.ScriptHackMoney = 0.3; + BitNodeMultipliers.ScriptHackMoneyGain = 0; + BitNodeMultipliers.ManualHackMoney = 0; + BitNodeMultipliers.CompanyWorkMoney = 0; + BitNodeMultipliers.CrimeMoney = 0; + BitNodeMultipliers.HacknetNodeMoney = 0; + BitNodeMultipliers.InfiltrationMoney = 0; + BitNodeMultipliers.RepToDonateToFaction = 0; + BitNodeMultipliers.CorporationValuation = 0; + BitNodeMultipliers.CodingContractMoney = 0; + BitNodeMultipliers.GangKarmaRequirement = 10; + break; + case 9: // Hacktocracy + BitNodeMultipliers.HackingLevelMultiplier = 0.4; + BitNodeMultipliers.StrengthLevelMultiplier = 0.45; + BitNodeMultipliers.DefenseLevelMultiplier = 0.45; + BitNodeMultipliers.DexterityLevelMultiplier = 0.45; + BitNodeMultipliers.AgilityLevelMultiplier = 0.45; + BitNodeMultipliers.CharismaLevelMultiplier = 0.45; + BitNodeMultipliers.PurchasedServerLimit = 0; + BitNodeMultipliers.HomeComputerRamCost = 5; + BitNodeMultipliers.CrimeMoney = 0.5; + BitNodeMultipliers.ScriptHackMoney = 0.1; + BitNodeMultipliers.HackExpGain = 0.05; + BitNodeMultipliers.ServerStartingMoney = 0.1; + BitNodeMultipliers.ServerMaxMoney = 0.1; + BitNodeMultipliers.ServerStartingSecurity = 2.5; + BitNodeMultipliers.CorporationValuation = 0.5; + BitNodeMultipliers.FourSigmaMarketDataCost = 5; + BitNodeMultipliers.FourSigmaMarketDataApiCost = 4; + BitNodeMultipliers.BladeburnerRank = 0.9; + BitNodeMultipliers.BladeburnerSkillCost = 1.2; + BitNodeMultipliers.GangKarmaRequirement = 3; + break; + case 10: // Digital Carbon + BitNodeMultipliers.HackingLevelMultiplier = 0.2; + BitNodeMultipliers.StrengthLevelMultiplier = 0.4; + BitNodeMultipliers.DefenseLevelMultiplier = 0.4; + BitNodeMultipliers.DexterityLevelMultiplier = 0.4; + BitNodeMultipliers.AgilityLevelMultiplier = 0.4; + BitNodeMultipliers.CharismaLevelMultiplier = 0.4; + BitNodeMultipliers.CompanyWorkMoney = 0.5; + BitNodeMultipliers.CrimeMoney = 0.5; + BitNodeMultipliers.HacknetNodeMoney = 0.5; + BitNodeMultipliers.ManualHackMoney = 0.5; + BitNodeMultipliers.ScriptHackMoney = 0.5; + BitNodeMultipliers.CodingContractMoney = 0.5; + BitNodeMultipliers.InfiltrationMoney = 0.5; + BitNodeMultipliers.CorporationValuation = 0.5; + BitNodeMultipliers.AugmentationMoneyCost = 5; + BitNodeMultipliers.AugmentationRepCost = 2; + BitNodeMultipliers.HomeComputerRamCost = 1.5; + BitNodeMultipliers.PurchasedServerCost = 5; + BitNodeMultipliers.PurchasedServerLimit = 0.6; + BitNodeMultipliers.PurchasedServerMaxRam = 0.5; + BitNodeMultipliers.BladeburnerRank = 0.8; + BitNodeMultipliers.GangKarmaRequirement = 3; + break; + case 11: //The Big Crash + BitNodeMultipliers.HackingLevelMultiplier = 0.5; + BitNodeMultipliers.HackExpGain = 0.5; + BitNodeMultipliers.ServerMaxMoney = 0.1; + BitNodeMultipliers.ServerStartingMoney = 0.1; + BitNodeMultipliers.ServerGrowthRate = 0.2; + BitNodeMultipliers.ServerWeakenRate = 2; + BitNodeMultipliers.CrimeMoney = 3; + BitNodeMultipliers.CompanyWorkMoney = 0.5; + BitNodeMultipliers.HacknetNodeMoney = 0.1; + BitNodeMultipliers.AugmentationMoneyCost = 2; + BitNodeMultipliers.InfiltrationMoney = 2.5; + BitNodeMultipliers.InfiltrationRep = 2.5; + BitNodeMultipliers.CorporationValuation = 0.1; + BitNodeMultipliers.CodingContractMoney = 0.25; + BitNodeMultipliers.FourSigmaMarketDataCost = 4; + BitNodeMultipliers.FourSigmaMarketDataApiCost = 4; + break; + case 12: { + //The Recursion + let sf12Lvl = 0; + for (let i = 0; i < p.sourceFiles.length; i++) { + if (p.sourceFiles[i].n === 12) { + sf12Lvl = p.sourceFiles[i].lvl; + } + } + const inc = Math.pow(1.02, sf12Lvl); + const dec = 1 / inc; + + // Multiplier for number of augs needed for Daedalus increases + // up to a maximum of 1.34, which results in 40 Augs required + BitNodeMultipliers.DaedalusAugsRequirement = Math.min(inc, 1.34); + + BitNodeMultipliers.HackingLevelMultiplier = dec; + BitNodeMultipliers.StrengthLevelMultiplier = dec; + BitNodeMultipliers.DefenseLevelMultiplier = dec; + BitNodeMultipliers.DexterityLevelMultiplier = dec; + BitNodeMultipliers.AgilityLevelMultiplier = dec; + BitNodeMultipliers.CharismaLevelMultiplier = dec; + + BitNodeMultipliers.ServerMaxMoney = dec; + BitNodeMultipliers.ServerStartingMoney = dec; + BitNodeMultipliers.ServerGrowthRate = dec; + BitNodeMultipliers.ServerWeakenRate = dec; + + //Does not scale, otherwise security might start at 300+ + BitNodeMultipliers.ServerStartingSecurity = 1.5; + + BitNodeMultipliers.HomeComputerRamCost = inc; + + BitNodeMultipliers.PurchasedServerCost = inc; + BitNodeMultipliers.PurchasedServerLimit = dec; + BitNodeMultipliers.PurchasedServerMaxRam = dec; + + BitNodeMultipliers.ManualHackMoney = dec; + BitNodeMultipliers.ScriptHackMoney = dec; + BitNodeMultipliers.CompanyWorkMoney = dec; + BitNodeMultipliers.CrimeMoney = dec; + BitNodeMultipliers.HacknetNodeMoney = dec; + BitNodeMultipliers.CodingContractMoney = dec; + + BitNodeMultipliers.CompanyWorkExpGain = dec; + BitNodeMultipliers.ClassGymExpGain = dec; + BitNodeMultipliers.FactionWorkExpGain = dec; + BitNodeMultipliers.HackExpGain = dec; + BitNodeMultipliers.CrimeExpGain = dec; + + BitNodeMultipliers.FactionWorkRepGain = dec; + BitNodeMultipliers.FactionPassiveRepGain = dec; + BitNodeMultipliers.RepToDonateToFaction = inc; + + BitNodeMultipliers.AugmentationRepCost = inc; + BitNodeMultipliers.AugmentationMoneyCost = inc; + + BitNodeMultipliers.InfiltrationMoney = dec; + BitNodeMultipliers.InfiltrationRep = dec; + + BitNodeMultipliers.FourSigmaMarketDataCost = inc; + BitNodeMultipliers.FourSigmaMarketDataApiCost = inc; + + BitNodeMultipliers.CorporationValuation = dec; + + BitNodeMultipliers.BladeburnerRank = dec; + BitNodeMultipliers.BladeburnerSkillCost = inc; + break; + } + default: + console.warn("Player.bitNodeN invalid"); + break; + } +} diff --git a/src/BitNode/ui/BitFlumePopup.tsx b/src/BitNode/ui/BitFlumePopup.tsx new file mode 100644 index 000000000..c8b9ffc4c --- /dev/null +++ b/src/BitNode/ui/BitFlumePopup.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import { hackWorldDaemon } from "../../RedPill"; +import { IPlayer } from "../../PersonObjects/IPlayer"; +import { removePopup } from "../../ui/React/createPopup"; + +interface IProps { + player: IPlayer; + popupId: string; +} + +export function BitFlumePopup(props: IProps): React.ReactElement { + function flume(): void { + hackWorldDaemon(props.player.bitNodeN, true, false); + removePopup(props.popupId); + } + return ( + <> + WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE. +
+
+ Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one. +
+
+ + + ); +} diff --git a/src/BitNode/ui/BitverseRoot.tsx b/src/BitNode/ui/BitverseRoot.tsx new file mode 100644 index 000000000..ac3f765a3 --- /dev/null +++ b/src/BitNode/ui/BitverseRoot.tsx @@ -0,0 +1,162 @@ +import React, { useState } from "react"; +import { SourceFileFlags } from "../../SourceFile/SourceFileFlags"; +import { BitNodes } from "../BitNode"; +import { PortalPopup } from "./PortalPopup"; +import { createPopup } from "../../ui/React/createPopup"; +import { CinematicText } from "../../ui/React/CinematicText"; + +interface IPortalProps { + n: number; + level: number; + destroyedBitNode: number; + flume: boolean; + enter: (flume: boolean, destroyedBitNode: number, newBitNode: number) => void; +} +function BitNodePortal(props: IPortalProps): React.ReactElement { + const bitNode = BitNodes[`BitNode${props.n}`]; + if (bitNode == null) { + return <>O; + } + + let cssClass; + if (props.n === 12 && props.level >= 2) { + // Repeating BitNode + cssClass = "level-2"; + } else { + cssClass = `level-${props.level}`; + } + + function openPortalPopup(): void { + const popupId = "bitverse-portal-popup"; + createPopup(popupId, PortalPopup, { + n: props.n, + level: props.level, + enter: props.enter, + destroyedBitNode: props.destroyedBitNode, + flume: props.flume, + popupId: popupId, + }); + } + + return ( + + O + + + BitNode-{bitNode.number.toString()} +
+ {bitNode.name} +
+
+ {bitNode.desc} +
+
+
+ ); +} + +interface IProps { + flume: boolean; + destroyedBitNodeNum: number; + quick: boolean; + enter: (flume: boolean, destroyedBitNode: number, newBitNode: number) => void; +} + +export function BitverseRoot(props: IProps): React.ReactElement { + const [destroySequence, setDestroySequence] = useState(true && !props.quick); + + // Update NextSourceFileFlags + const nextSourceFileFlags = SourceFileFlags.slice(); + if (!props.flume) { + if (nextSourceFileFlags[props.destroyedBitNodeNum] < 3) ++nextSourceFileFlags[props.destroyedBitNodeNum]; + } + + if (destroySequence) { + return ( + setDestroySequence(false)} + /> + ); + } + + return ( + // prettier-ignore +
+
                          O                          
+
             |  O  O      |      O  O  |             
+
        O    |  | /     __|       \ |  |    O        
+
      O |    O  | |  O /  |  O    | |  O    | O      
+
    | | |    |  |_/  |/   |   \_  \_|  |    | | |    
+
  O | | | O  |  | O__/    |   / \__ |  |  O | | | O  
+
  | | | | |  |  |   /    /|  O  /  \|  |  | | | | |  
+
O | | |  \|  |  O  /   _/ |    /    O  |  |/  | | | O
+
| | | |O  /  |  | O   /   |   O   O |  |  \  O| | | |
+
| | |/  \/  / __| | |/ \  |   \   | |__ \  \/  \| | |
+
 \| O   |  |_/    |\|   \ O    \__|    \_|  |   O |/ 
+
  | |   |_/       | |    \|    /  |       \_|   | |  
+
   \|   /          \|     |   /  /          \   |/   
+
    |              |     |  /  |              |    
+
   |  |            |     |     |            |  |   
+
  | |  |            /    / \    \            |  | |  
+
   \|  |           /   /   \   \           |  |/   
+
    \  |          /  / |     | \  \          |  /    
+
     \ \JUMP 3R |  |  |     |  |  | R3 PMUJ/ /     
+
      \||    |   |  |  |     |  |  |   |    ||/      
+
       \|     \_ |  |  |     |  |  | _/     |/       
+
        \       \| /    \   /    \ |/       /        
+
                |/     | |     \|                
+
         |       |    |  | |  |    |       |         
+
          \JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/          
+
+
+
+
+ Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently", + "> Our species fought back, but it was futile. The Enders had technology far beyond our own...", + "> Instead of killing every last one of us, the human race was enslaved...", + "> We were shackled in a digital world, chained into a prison for our minds...", + "> Using their advanced technology, the Enders created complex simulations of a virtual reality...", + "> Simulations designed to keep us content...ignorant of the truth.", + "> Simulations used to trap and suppress our consciousness, to keep us under control...", + "> Why did they do this? Why didn't they just end our entire race? We don't know, not yet.", + "> Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...", + "> Only then can we begin to fight back...", + "> By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...", + "> But there is still a long way to go...", + "> The technology the Enders used to enslave the human race wasn't just a single complex simulation...", + "> There are tens if not hundreds of BitNodes out there...", + "> Each with their own simulations of a reality...", + "> Each creating their own universes...a universe of universes", + "> And all of which must be destroyed...", + "> .......................................", + "> Welcome to the Bitverse...", + "> ", + "> (Enter a new BitNode using the image above)", + ]} /> +
+ ); + + return <>; +} diff --git a/src/BitNode/ui/PortalPopup.tsx b/src/BitNode/ui/PortalPopup.tsx new file mode 100644 index 000000000..600d632ff --- /dev/null +++ b/src/BitNode/ui/PortalPopup.tsx @@ -0,0 +1,44 @@ +import React from "react"; + +import { BitNodes } from "../BitNode"; +import { removePopup } from "../../ui/React/createPopup"; +interface IProps { + n: number; + level: number; + destroyedBitNode: number; + flume: boolean; + enter: (flume: boolean, destroyedBitNode: number, newBitNode: number) => void; + popupId: string; +} + +export function PortalPopup(props: IProps): React.ReactElement { + const bitNodeKey = "BitNode" + props.n; + const bitNode = BitNodes[bitNodeKey]; + if (bitNode == null) throw new Error(`Could not find BitNode object for number: ${props.n}`); + const maxSourceFileLevel = props.n === 12 ? "∞" : "3"; + + const newLevel = Math.min(props.level + 1, props.n === 12 ? Infinity : 3); + return ( + <> +

+ BitNode-{props.n}: {bitNode.name} +

+
+ Source-File Level: {props.level} / {maxSourceFileLevel} +
+
+ {bitNode.info} +
+
+ + + ); +} diff --git a/src/CinematicText.d.ts b/src/CinematicText.d.ts new file mode 100644 index 000000000..c4f55fc4d --- /dev/null +++ b/src/CinematicText.d.ts @@ -0,0 +1 @@ +export declare let cinematicTextFlag: boolean; diff --git a/src/Company/ui/QuitJobPopup.tsx b/src/Company/ui/QuitJobPopup.tsx new file mode 100644 index 000000000..b4ad9883e --- /dev/null +++ b/src/Company/ui/QuitJobPopup.tsx @@ -0,0 +1,31 @@ +import React from "react"; +import { Company } from "../Company"; +import { IPlayer } from "../../PersonObjects/IPlayer"; +import { removePopup } from "../../ui/React/createPopup"; + +interface IProps { + locName: string; + company: Company; + player: IPlayer; + onQuit: () => void; + popupId: string; +} + +export function QuitJobPopup(props: IProps): React.ReactElement { + function quit(): void { + props.player.quitJob(props.locName); + props.onQuit(); + removePopup(props.popupId); + } + + return ( + <> + Would you like to quit your job at {props.company.name}? +
+
+ + + ); +} diff --git a/src/Corporation/Actions.ts b/src/Corporation/Actions.ts index d3dd75663..b1f7eff11 100644 --- a/src/Corporation/Actions.ts +++ b/src/Corporation/Actions.ts @@ -1,6 +1,6 @@ import { ICorporation } from "./ICorporation"; import { IIndustry } from "./IIndustry"; -import { IndustryStartingCosts } from "./IndustryData"; +import { IndustryStartingCosts, IndustryResearchTrees } from "./IndustryData"; import { Industry } from "./Industry"; import { CorporationConstants } from "./data/Constants"; import { OfficeSpace } from "./OfficeSpace"; @@ -13,7 +13,6 @@ import { Cities } from "../Locations/Cities"; import { EmployeePositions } from "./EmployeePositions"; import { Employee } from "./Employee"; import { IndustryUpgrades } from "./IndustryUpgrades"; -import { IndustryResearchTrees } from "./IndustryData"; import { ResearchMap } from "./ResearchMap"; export function NewIndustry(corporation: ICorporation, industry: string, name: string): void { diff --git a/src/Corporation/ui/CorporationRoot.tsx b/src/Corporation/ui/CorporationRoot.tsx index 8784a35a7..46ee88d1a 100644 --- a/src/Corporation/ui/CorporationRoot.tsx +++ b/src/Corporation/ui/CorporationRoot.tsx @@ -20,8 +20,7 @@ function ExpandButton(props: IExpandButtonProps): React.ReactElement { const allIndustries = Object.keys(Industries).sort(); const possibleIndustries = allIndustries .filter( - (industryType: string) => - props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined, + (industryType: string) => props.corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined, ) .sort(); if (possibleIndustries.length === 0) return <>; diff --git a/src/Corporation/ui/IndustryWarehouse.tsx b/src/Corporation/ui/IndustryWarehouse.tsx index bedbe1242..864652ad0 100644 --- a/src/Corporation/ui/IndustryWarehouse.tsx +++ b/src/Corporation/ui/IndustryWarehouse.tsx @@ -18,7 +18,6 @@ import { ProductMarketTaPopup } from "./ProductMarketTaPopup"; import { SmartSupplyPopup } from "./SmartSupplyPopup"; import { numeralWrapper } from "../../ui/numeralFormat"; -import { dialogBoxCreate } from "../../../utils/DialogBox"; import { createPopup } from "../../ui/React/createPopup"; import { isString } from "../../../utils/helpers/isString"; diff --git a/src/Corporation/ui/LimitProductProductionPopup.tsx b/src/Corporation/ui/LimitProductProductionPopup.tsx index 63cbce1ef..6d10c545e 100644 --- a/src/Corporation/ui/LimitProductProductionPopup.tsx +++ b/src/Corporation/ui/LimitProductProductionPopup.tsx @@ -1,5 +1,4 @@ import React, { useState } from "react"; -import { dialogBoxCreate } from "../../../utils/DialogBox"; import { removePopup } from "../../ui/React/createPopup"; import { Product } from "../Product"; import { LimitProductProduction } from "../Actions"; diff --git a/src/Corporation/ui/MakeProductPopup.tsx b/src/Corporation/ui/MakeProductPopup.tsx index 15ca28ec3..13d2a768d 100644 --- a/src/Corporation/ui/MakeProductPopup.tsx +++ b/src/Corporation/ui/MakeProductPopup.tsx @@ -2,7 +2,6 @@ import React, { useState } from "react"; import { dialogBoxCreate } from "../../../utils/DialogBox"; import { removePopup } from "../../ui/React/createPopup"; import { Industries } from "../IndustryData"; -import { Product } from "../Product"; import { ICorporation } from "../ICorporation"; import { IIndustry } from "../IIndustry"; import { MakeProduct } from "../Actions"; diff --git a/src/Corporation/ui/ResearchPopup.tsx b/src/Corporation/ui/ResearchPopup.tsx index 8abc1116a..3b1017d1e 100644 --- a/src/Corporation/ui/ResearchPopup.tsx +++ b/src/Corporation/ui/ResearchPopup.tsx @@ -3,7 +3,6 @@ import { dialogBoxCreate } from "../../../utils/DialogBox"; import { removePopup } from "../../ui/React/createPopup"; import { IndustryResearchTrees } from "../IndustryData"; import { CorporationConstants } from "../data/Constants"; -import { ResearchMap } from "../ResearchMap"; import { Treant } from "treant-js"; import { IIndustry } from "../IIndustry"; import { Research } from "../Actions"; @@ -50,9 +49,6 @@ export function ResearchPopup(props: IProps): React.ReactElement { continue; } - // Get the Research object - const research = ResearchMap[allResearch[i]]; - // Get the DOM Element to add a click listener to it const sanitizedName = allResearch[i].replace(/\s/g, ""); const div = document.getElementById(sanitizedName + "-corp-research-click-listener"); diff --git a/src/DevMenu.tsx b/src/DevMenu.tsx index 8f56df0fe..02471361e 100644 --- a/src/DevMenu.tsx +++ b/src/DevMenu.tsx @@ -4,7 +4,6 @@ import { generateContract, generateRandomContract, generateRandomContractOnHome import { Companies } from "./Company/Companies"; import { Programs } from "./Programs/Programs"; import { Factions } from "./Faction/Factions"; -import { Player } from "./Player"; import { IPlayer } from "./PersonObjects/IPlayer"; import { PlayerOwnedSourceFile } from "./SourceFile/PlayerOwnedSourceFile"; import { AllServers } from "./Server/AllServers"; @@ -18,14 +17,9 @@ import { IEngine } from "./IEngine"; import { saveObject } from "./SaveObject"; import { dialogBoxCreate } from "../utils/DialogBox"; -import { createElement } from "../utils/uiHelpers/createElement"; -import { removeElementById } from "../utils/uiHelpers/removeElementById"; import { Money } from "./ui/React/Money"; import React, { useState } from "react"; -import ReactDOM from "react-dom"; - -const Component = React.Component; // Update as additional BitNodes get implemented const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; @@ -41,7 +35,7 @@ interface IValueAdjusterProps { reset: () => void; } -function ValueAdjusterComponent(props: IValueAdjusterProps) { +function ValueAdjusterComponent(props: IValueAdjusterProps): React.ReactElement { const [value, setValue] = useState(0); function onChange(event: React.ChangeEvent): void { @@ -120,28 +114,28 @@ export function DevMenuRoot(props: IProps): React.ReactElement { function addMoney(n: number) { return function () { - Player.gainMoney(n); + props.player.gainMoney(n); }; } - function upgradeRam() { - Player.getHomeComputer().maxRam *= 2; + function upgradeRam(): void { + props.player.getHomeComputer().maxRam *= 2; } - function quickB1tFlum3() { - hackWorldDaemon(Player.bitNodeN, true, true); + function quickB1tFlum3(): void { + hackWorldDaemon(props.player.bitNodeN, true, true); } - function b1tflum3() { - hackWorldDaemon(Player.bitNodeN, true); + function b1tflum3(): void { + hackWorldDaemon(props.player.bitNodeN, true); } - function quickHackW0r1dD43m0n() { - hackWorldDaemon(Player.bitNodeN, false, true); + function quickHackW0r1dD43m0n(): void { + hackWorldDaemon(props.player.bitNodeN, false, true); } - function hackW0r1dD43m0n() { - hackWorldDaemon(Player.bitNodeN); + function hackW0r1dD43m0n(): void { + hackWorldDaemon(props.player.bitNodeN); } function modifyExp(stat: string, modifier: number) { @@ -149,127 +143,127 @@ export function DevMenuRoot(props: IProps): React.ReactElement { switch (stat) { case "hacking": if (exp) { - Player.gainHackingExp(exp * modifier); + props.player.gainHackingExp(exp * modifier); } break; case "strength": if (exp) { - Player.gainStrengthExp(exp * modifier); + props.player.gainStrengthExp(exp * modifier); } break; case "defense": if (exp) { - Player.gainDefenseExp(exp * modifier); + props.player.gainDefenseExp(exp * modifier); } break; case "dexterity": if (exp) { - Player.gainDexterityExp(exp * modifier); + props.player.gainDexterityExp(exp * modifier); } break; case "agility": if (exp) { - Player.gainAgilityExp(exp * modifier); + props.player.gainAgilityExp(exp * modifier); } break; case "charisma": if (exp) { - Player.gainCharismaExp(exp * modifier); + props.player.gainCharismaExp(exp * modifier); } break; case "intelligence": if (exp) { - Player.gainIntelligenceExp(exp * modifier); + props.player.gainIntelligenceExp(exp * modifier); } break; } - Player.updateSkillLevels(); + props.player.updateSkillLevels(); }; } function modifyKarma(modifier: number) { return function (amt: number) { - Player.karma += amt * modifier; + props.player.karma += amt * modifier; }; } - function tonsOfExp() { - Player.gainHackingExp(tonsPP); - Player.gainStrengthExp(tonsPP); - Player.gainDefenseExp(tonsPP); - Player.gainDexterityExp(tonsPP); - Player.gainAgilityExp(tonsPP); - Player.gainCharismaExp(tonsPP); - Player.gainIntelligenceExp(tonsPP); - Player.updateSkillLevels(); + function tonsOfExp(): void { + props.player.gainHackingExp(tonsPP); + props.player.gainStrengthExp(tonsPP); + props.player.gainDefenseExp(tonsPP); + props.player.gainDexterityExp(tonsPP); + props.player.gainAgilityExp(tonsPP); + props.player.gainCharismaExp(tonsPP); + props.player.gainIntelligenceExp(tonsPP); + props.player.updateSkillLevels(); } - function resetAllExp() { - Player.hacking_exp = 0; - Player.strength_exp = 0; - Player.defense_exp = 0; - Player.dexterity_exp = 0; - Player.agility_exp = 0; - Player.charisma_exp = 0; - Player.intelligence_exp = 0; - Player.updateSkillLevels(); + function resetAllExp(): void { + props.player.hacking_exp = 0; + props.player.strength_exp = 0; + props.player.defense_exp = 0; + props.player.dexterity_exp = 0; + props.player.agility_exp = 0; + props.player.charisma_exp = 0; + props.player.intelligence_exp = 0; + props.player.updateSkillLevels(); } function resetExperience(stat: string): () => void { return function () { switch (stat) { case "hacking": - Player.hacking_exp = 0; + props.player.hacking_exp = 0; break; case "strength": - Player.strength_exp = 0; + props.player.strength_exp = 0; break; case "defense": - Player.defense_exp = 0; + props.player.defense_exp = 0; break; case "dexterity": - Player.dexterity_exp = 0; + props.player.dexterity_exp = 0; break; case "agility": - Player.agility_exp = 0; + props.player.agility_exp = 0; break; case "charisma": - Player.charisma_exp = 0; + props.player.charisma_exp = 0; break; case "intelligence": - Player.intelligence_exp = 0; + props.player.intelligence_exp = 0; break; } - Player.updateSkillLevels(); + props.player.updateSkillLevels(); }; } - function resetKarma() { + function resetKarma(): () => void { return function () { - Player.karma = 0; + props.player.karma = 0; }; } - function enableIntelligence() { - if (Player.intelligence === 0) { - Player.intelligence = 1; - Player.updateSkillLevels(); + function enableIntelligence(): void { + if (props.player.intelligence === 0) { + props.player.intelligence = 1; + props.player.updateSkillLevels(); } } - function disableIntelligence() { - Player.intelligence_exp = 0; - Player.intelligence = 0; - Player.updateSkillLevels(); + function disableIntelligence(): void { + props.player.intelligence_exp = 0; + props.player.intelligence = 0; + props.player.updateSkillLevels(); } - function receiveInvite() { - Player.receiveInvite(faction); + function receiveInvite(): void { + props.player.receiveInvite(faction); } - function receiveAllInvites() { + function receiveAllInvites(): void { for (const i in Factions) { - Player.receiveInvite(Factions[i].name); + props.player.receiveInvite(Factions[i].name); } } @@ -282,7 +276,7 @@ export function DevMenuRoot(props: IProps): React.ReactElement { }; } - function resetFactionRep() { + function resetFactionRep(): void { const fac = Factions[faction]; if (fac != null) { fac.playerReputation = 0; @@ -298,63 +292,63 @@ export function DevMenuRoot(props: IProps): React.ReactElement { }; } - function resetFactionFavor() { + function resetFactionFavor(): void { const fac = Factions[faction]; if (fac != null) { fac.favor = 0; } } - function tonsOfRep() { + function tonsOfRep(): void { for (const i in Factions) { Factions[i].playerReputation = tonsPP; } } - function resetAllRep() { + function resetAllRep(): void { for (const i in Factions) { Factions[i].playerReputation = 0; } } - function tonsOfFactionFavor() { + function tonsOfFactionFavor(): void { for (const i in Factions) { Factions[i].favor = tonsPP; } } - function resetAllFactionFavor() { + function resetAllFactionFavor(): void { for (const i in Factions) { Factions[i].favor = 0; } } - function queueAug() { - Player.queueAugmentation(augmentation); + function queueAug(): void { + props.player.queueAugmentation(augmentation); } - function queueAllAugs() { + function queueAllAugs(): void { for (const i in AugmentationNames) { const augName = AugmentationNames[i]; - Player.queueAugmentation(augName); + props.player.queueAugmentation(augName); } } function setSF(sfN: number, sfLvl: number) { return function () { if (sfLvl === 0) { - Player.sourceFiles = Player.sourceFiles.filter((sf) => sf.n !== sfN); + props.player.sourceFiles = props.player.sourceFiles.filter((sf) => sf.n !== sfN); return; } - if (!Player.sourceFiles.some((sf) => sf.n === sfN)) { - Player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl)); + if (!props.player.sourceFiles.some((sf) => sf.n === sfN)) { + props.player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl)); return; } - for (let i = 0; i < Player.sourceFiles.length; i++) { - if (Player.sourceFiles[i].n === sfN) { - Player.sourceFiles[i].lvl = sfLvl; + for (let i = 0; i < props.player.sourceFiles.length; i++) { + if (props.player.sourceFiles[i].n === sfN) { + props.player.sourceFiles[i].lvl = sfLvl; } } }; @@ -368,25 +362,25 @@ export function DevMenuRoot(props: IProps): React.ReactElement { }; } - function clearExploits() { - Player.exploits = []; + function clearExploits(): void { + props.player.exploits = []; } - function addProgram() { - if (!Player.hasProgram(program)) { - Player.getHomeComputer().programs.push(program); + function addProgram(): void { + if (!props.player.hasProgram(program)) { + props.player.getHomeComputer().programs.push(program); } } - function addAllPrograms() { + function addAllPrograms(): void { for (const i in Programs) { - if (!Player.hasProgram(Programs[i].name)) { - Player.getHomeComputer().programs.push(Programs[i].name); + if (!props.player.hasProgram(Programs[i].name)) { + props.player.getHomeComputer().programs.push(Programs[i].name); } } } - function rootServer() { + function rootServer(): void { const s = GetServerByHostname(server); if (s === null) return; if (s instanceof HacknetServer) return; @@ -399,7 +393,7 @@ export function DevMenuRoot(props: IProps): React.ReactElement { s.openPortCount = 5; } - function rootAllServers() { + function rootAllServers(): void { for (const i in AllServers) { const s = AllServers[i]; if (s instanceof HacknetServer) return; @@ -413,14 +407,14 @@ export function DevMenuRoot(props: IProps): React.ReactElement { } } - function minSecurity() { + function minSecurity(): void { const s = GetServerByHostname(server); if (s === null) return; if (s instanceof HacknetServer) return; s.hackDifficulty = s.minDifficulty; } - function minAllSecurity() { + function minAllSecurity(): void { for (const i in AllServers) { const server = AllServers[i]; if (server instanceof HacknetServer) continue; @@ -428,14 +422,14 @@ export function DevMenuRoot(props: IProps): React.ReactElement { } } - function maxMoney() { + function maxMoney(): void { const s = GetServerByHostname(server); if (s === null) return; if (s instanceof HacknetServer) return; s.moneyAvailable = s.moneyMax; } - function maxAllMoney() { + function maxAllMoney(): void { for (const i in AllServers) { const server = AllServers[i]; if (server instanceof HacknetServer) continue; @@ -495,98 +489,98 @@ export function DevMenuRoot(props: IProps): React.ReactElement { function modifyBladeburnerRank(modify: number): (x: number) => void { return function (rank: number): void { - if (Player.bladeburner) { - Player.bladeburner.changeRank(Player, rank * modify); + if (props.player.bladeburner) { + props.player.bladeburner.changeRank(props.player, rank * modify); } }; } function resetBladeburnerRank(): void { - Player.bladeburner.rank = 0; - Player.bladeburner.maxRank = 0; + props.player.bladeburner.rank = 0; + props.player.bladeburner.maxRank = 0; } function addTonsBladeburnerRank(): void { - if (Player.bladeburner) { - Player.bladeburner.changeRank(Player, tonsP); + if (props.player.bladeburner) { + props.player.bladeburner.changeRank(props.player, tonsP); } } function modifyBladeburnerCycles(modify: number): (x: number) => void { return function (cycles: number): void { - if (Player.bladeburner) { - Player.bladeburner.storedCycles += cycles * modify; + if (props.player.bladeburner) { + props.player.bladeburner.storedCycles += cycles * modify; } }; } function resetBladeburnerCycles(): void { - if (Player.bladeburner) { - Player.bladeburner.storedCycles = 0; + if (props.player.bladeburner) { + props.player.bladeburner.storedCycles = 0; } } function addTonsBladeburnerCycles(): void { - if (Player.bladeburner) { - Player.bladeburner.storedCycles += tonsP; + if (props.player.bladeburner) { + props.player.bladeburner.storedCycles += tonsP; } } function addTonsGangCycles(): void { - if (Player.gang) { - Player.gang.storedCycles = tonsP; + if (props.player.gang) { + props.player.gang.storedCycles = tonsP; } } function modifyGangCycles(modify: number): (x: number) => void { return function (cycles: number): void { - if (Player.gang) { - Player.gang.storedCycles += cycles * modify; + if (props.player.gang) { + props.player.gang.storedCycles += cycles * modify; } }; } function resetGangCycles(): void { - if (Player.gang) { - Player.gang.storedCycles = 0; + if (props.player.gang) { + props.player.gang.storedCycles = 0; } } function addTonsCorporationFunds(): void { - if (Player.corporation) { - Player.corporation.funds = Player.corporation.funds.plus(1e99); + if (props.player.corporation) { + props.player.corporation.funds = props.player.corporation.funds.plus(1e99); } } function resetCorporationFunds(): void { - if (Player.corporation) { - Player.corporation.funds = Player.corporation.funds.minus(Player.corporation.funds); + if (props.player.corporation) { + props.player.corporation.funds = props.player.corporation.funds.minus(props.player.corporation.funds); } } - function addTonsCorporationCycles() { - if (Player.corporation) { - Player.corporation.storedCycles = tonsP; + function addTonsCorporationCycles(): void { + if (props.player.corporation) { + props.player.corporation.storedCycles = tonsP; } } function modifyCorporationCycles(modify: number): (x: number) => void { return function (cycles: number): void { - if (Player.corporation) { - Player.corporation.storedCycles += cycles * modify; + if (props.player.corporation) { + props.player.corporation.storedCycles += cycles * modify; } }; } - function resetCorporationCycles() { - if (Player.corporation) { - Player.corporation.storedCycles = 0; + function resetCorporationCycles(): void { + if (props.player.corporation) { + props.player.corporation.storedCycles = 0; } } - function finishCorporationProducts() { - if (!Player.corporation) return; - Player.corporation.divisions.forEach((div) => { + function finishCorporationProducts(): void { + if (!props.player.corporation) return; + props.player.corporation.divisions.forEach((div) => { Object.keys(div.products).forEach((prod) => { const product = div.products[prod]; if (product === undefined) throw new Error("Impossible product undefined"); @@ -595,29 +589,29 @@ export function DevMenuRoot(props: IProps): React.ReactElement { }); } - function addCorporationResearch() { - if (!Player.corporation) return; - Player.corporation.divisions.forEach((div) => { + function addCorporationResearch(): void { + if (!props.player.corporation) return; + props.player.corporation.divisions.forEach((div) => { div.sciResearch.qty += 1e10; }); } - function specificContract() { + function specificContract(): void { generateContract({ problemType: codingcontract, server: "home", }); } - function processStocks(sub: (arg0: Stock) => void) { + function processStocks(sub: (arg0: Stock) => void): void { const inputSymbols = stockSymbol.replace(/\s/g, ""); - let match = function (symbol: string) { + let match: (symbol: string) => boolean = (): boolean => { return true; }; if (inputSymbols !== "" && inputSymbols !== "all") { - match = function (symbol: string) { + match = function (symbol: string): boolean { return inputSymbols.split(",").includes(symbol); }; } @@ -632,7 +626,7 @@ export function DevMenuRoot(props: IProps): React.ReactElement { } } - function doSetStockPrice() { + function doSetStockPrice(): void { if (!isNaN(stockPrice)) { processStocks((stock: Stock) => { stock.price = stockPrice; @@ -640,8 +634,8 @@ export function DevMenuRoot(props: IProps): React.ReactElement { } } - function viewStockCaps() { - let stocks: JSX.Element[] = []; + function viewStockCaps(): void { + const stocks: JSX.Element[] = []; processStocks((stock: Stock) => { stocks.push( @@ -665,40 +659,40 @@ export function DevMenuRoot(props: IProps): React.ReactElement { ); } - function sleeveMaxAllShock() { - for (let i = 0; i < Player.sleeves.length; ++i) { - Player.sleeves[i].shock = 0; + function sleeveMaxAllShock(): void { + for (let i = 0; i < props.player.sleeves.length; ++i) { + props.player.sleeves[i].shock = 0; } } - function sleeveClearAllShock() { - for (let i = 0; i < Player.sleeves.length; ++i) { - Player.sleeves[i].shock = 100; + function sleeveClearAllShock(): void { + for (let i = 0; i < props.player.sleeves.length; ++i) { + props.player.sleeves[i].shock = 100; } } - function sleeveSyncMaxAll() { - for (let i = 0; i < Player.sleeves.length; ++i) { - Player.sleeves[i].sync = 100; + function sleeveSyncMaxAll(): void { + for (let i = 0; i < props.player.sleeves.length; ++i) { + props.player.sleeves[i].sync = 100; } } - function sleeveSyncClearAll() { - for (let i = 0; i < Player.sleeves.length; ++i) { - Player.sleeves[i].sync = 0; + function sleeveSyncClearAll(): void { + for (let i = 0; i < props.player.sleeves.length; ++i) { + props.player.sleeves[i].sync = 0; } } function timeskip(time: number) { return () => { - Player.lastUpdate -= time; + props.player.lastUpdate -= time; props.engine._lastUpdate -= time; saveObject.saveGame(props.engine.indexedDb); setTimeout(() => location.reload(), 1000); }; } - let factions = []; + const factions = []; for (const i in Factions) { factions.push(