-
Complete hacking contracts for your faction. @@ -538,8 +478,8 @@
Carry out field missions for your faction. @@ -550,8 +490,8 @@
Serve in a security detail for your faction. @@ -562,8 +502,8 @@
Donate money to your faction. You will gain reputation based on how much money you donate @@ -602,7 +542,7 @@
Faction Augmentations
Purchased Augmentations
Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to install them.
-
WARNING: Purchasing an Augmentation resets most of your progress, including:
+
WARNING: Installing your Augmentations resets most of your progress, including:
Stats/Skill levels and Experience
Money
Scripts on every computer but your home computer
@@ -610,8 +550,8 @@
Purchased Augmentations
Hacknet NodesFaction/Company reputation
Stocks
- Purchasing an Augmentation lets you start over with the perks and benefits granted by all - of the Augmentations you have ever purchased. Also, you will keep any scripts and RAM upgrades + Installing Augmentations lets you start over with the perks and benefits granted by all + of the Augmentations you have ever installed. Also, you will keep any scripts and RAM upgrades on your home computer (but you will lose all programs besides NUKE.exe).
@@ -620,14 +560,15 @@
Purchased Augmentations
Install AugmentationsInstalled Augmentations
-List of all augmentations that have been installed. You have gained the effects of these augmentations
+List of all augmentations (including Source Files) that have been installed. You have gained the effects of these augmentations
- Purchase - Cancel + +
+ Yes + No
- Yes - No + +
+ + Yes + No
Game Options
This augmentation increases all of the player's combat stats by 8%.") HemoRecirculator.setRequirements(4000, 9000000); HemoRecirculator.addToFactions(["Tetrads", "The Dark Army", "The Syndicate"]); @@ -169,11 +169,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.HemoRecirculator]; } AddToAugmentations(HemoRecirculator); - + var Targeting1 = new Augmentation(AugmentationNames.Targeting1); Targeting1.setRequirements(2000, 3000000); - Targeting1.setInfo("This cranial implant is embedded within the player's inner ear structure and optic nerves. It regulates and enhances the user's " + - "balance and hand-eye coordination. It is also capable of augmenting reality by projecting digital information " + + Targeting1.setInfo("This cranial implant is embedded within the player's inner ear structure and optic nerves. It regulates and enhances the user's " + + "balance and hand-eye coordination. It is also capable of augmenting reality by projecting digital information " + "directly onto the retina. These enhancements allow the player to better lock-on and keep track of enemies.
" + "This augmentation increases the player's dexterity by 10%."); Targeting1.addToFactions(["Slum Snakes", "The Dark Army", "The Syndicate", "Sector-12", "Volhaven", "Ishima", @@ -185,19 +185,19 @@ initAugmentations = function() { var Targeting2 = new Augmentation(AugmentationNames.Targeting2); Targeting2.setRequirements(3500, 8500000); - Targeting2.setInfo("This is an upgrade of the Augmented Targeting I cranial implant, which is capable of augmenting reality " + - "and enhances the user's balance and hand-eye coordination.
This upgrade increases the player's dexterity " + + Targeting2.setInfo("This is an upgrade of the Augmented Targeting I cranial implant, which is capable of augmenting reality " + + "and enhances the user's balance and hand-eye coordination.
This upgrade increases the player's dexterity " + "by an additional 20%."); Targeting2.addToFactions(["The Dark Army", "The Syndicate", "Sector-12", "Volhaven", "Ishima", "OmniTek Incorporated", "KuaiGong International", "Blade Industries"]); if (augmentationExists(AugmentationNames.Targeting2)) { delete Augmentations[AugmentationNames.Targeting2]; - } + } AddToAugmentations(Targeting2); - + var Targeting3 = new Augmentation(AugmentationNames.Targeting3); Targeting3.setRequirements(11000, 23000000); - Targeting3.setInfo("This is an upgrade of the Augmented Targeting II cranial implant, which is capable of augmenting reality " + + Targeting3.setInfo("This is an upgrade of the Augmented Targeting II cranial implant, which is capable of augmenting reality " + "and enhances the user's balance and hand-eye coordination.
This upgrade increases the player's dexterity " + "by an additional 30%."); Targeting3.addToFactions(["The Dark Army", "The Syndicate", "OmniTek Incorporated", @@ -206,10 +206,10 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Targeting3]; } AddToAugmentations(Targeting3); - + var SyntheticHeart = new Augmentation(AugmentationNames.SyntheticHeart); SyntheticHeart.setRequirements(300000, 575000000); - SyntheticHeart.setInfo("This advanced artificial heart, created from plasteel and graphene, is capable of pumping more blood " + + SyntheticHeart.setInfo("This advanced artificial heart, created from plasteel and graphene, is capable of pumping more blood " + "at much higher efficiencies than a normal human heart.
This augmentation increases the player's agility " + "and strength by 50%"); SyntheticHeart.addToFactions(["KuaiGong International", "Fulcrum Secret Technologies", "Speakers for the Dead", @@ -218,11 +218,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SyntheticHeart]; } AddToAugmentations(SyntheticHeart); - + var SynfibrilMuscle = new Augmentation(AugmentationNames.SynfibrilMuscle); SynfibrilMuscle.setRequirements(175000, 225000000); - SynfibrilMuscle.setInfo("The myofibrils in human muscles are injected with special chemicals that react with the proteins inside " + - "the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. " + + SynfibrilMuscle.setInfo("The myofibrils in human muscles are injected with special chemicals that react with the proteins inside " + + "the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. " + "Scientists have named these artificially enhanced units 'synfibrils'.
This augmentation increases the player's " + "strength and defense by 35%."); SynfibrilMuscle.addToFactions(["KuaiGong International", "Fulcrum Secret Technologies", "Speakers for the Dead", @@ -231,11 +231,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SynfibrilMuscle]; } AddToAugmentations(SynfibrilMuscle) - + var CombatRib1 = new Augmentation(AugmentationNames.CombatRib1); CombatRib1.setRequirements(3000, 4750000); - CombatRib1.setInfo("The human body's ribs are replaced with artificial ribs that automatically and continuously release cognitive " + - "and performance-enhancing drugs into the bloodstream, improving the user's abilities in combat.
" + + CombatRib1.setInfo("The human body's ribs are replaced with artificial ribs that automatically and continuously release cognitive " + + "and performance-enhancing drugs into the bloodstream, improving the user's abilities in combat.
" + "This augmentation increases the player's strength and defense by 10%."); CombatRib1.addToFactions(["Slum Snakes", "The Dark Army", "The Syndicate", "Sector-12", "Volhaven", "Ishima", "OmniTek Incorporated", "KuaiGong International", "Blade Industries"]); @@ -243,10 +243,10 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CombatRib1]; } AddToAugmentations(CombatRib1); - + var CombatRib2 = new Augmentation(AugmentationNames.CombatRib2); CombatRib2.setRequirements(7500, 13000000); - CombatRib2.setInfo("This is an upgrade to the Combat Rib I augmentation, and is capable of releasing even more potent combat-enhancing " + + CombatRib2.setInfo("This is an upgrade to the Combat Rib I augmentation, and is capable of releasing even more potent combat-enhancing " + "drugs into the bloodstream.
This upgrade increases the player's strength and defense by an additional 15%.") CombatRib2.addToFactions(["The Dark Army", "The Syndicate", "Sector-12", "Volhaven", "Ishima", "OmniTek Incorporated", "KuaiGong International", "Blade Industries"]); @@ -254,10 +254,10 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CombatRib2]; } AddToAugmentations(CombatRib2); - + var CombatRib3 = new Augmentation(AugmentationNames.CombatRib3); CombatRib3.setRequirements(14000, 24000000); - CombatRib3.setInfo("This is an upgrade to the Combat Rib II augmentation, and is capable of releasing even more potent combat-enhancing " + + CombatRib3.setInfo("This is an upgrade to the Combat Rib II augmentation, and is capable of releasing even more potent combat-enhancing " + "drugs into the bloodstream
. This upgrade increases the player's strength and defense by an additional 20%."); CombatRib3.addToFactions(["The Dark Army", "The Syndicate", "OmniTek Incorporated", "KuaiGong International", "Blade Industries", "The Covenant"]); @@ -265,26 +265,26 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CombatRib3]; } AddToAugmentations(CombatRib3); - + var NanofiberWeave = new Augmentation(AugmentationNames.NanofiberWeave); NanofiberWeave.setRequirements(15000, 25000000); - NanofiberWeave.setInfo("Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning. " + - "This improves the skin's ability to regenerate itself and protect the body from external stresses and forces.
" + + NanofiberWeave.setInfo("Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning. " + + "This improves the skin's ability to regenerate itself and protect the body from external stresses and forces.
" + "This augmentation increases the player's strength and defense by 25%."); NanofiberWeave.addToFactions(["Tian Di Hui", "The Syndicate", "The Dark Army", "Speakers for the Dead", "Blade Industries", "Fulcrum Secret Technologies", "OmniTek Incorporated"]); if (augmentationExists(AugmentationNames.NanofiberWeave)) { delete Augmentations[AugmentationNames.NanofiberWeave]; - } + } AddToAugmentations(NanofiberWeave); - + var SubdermalArmor = new Augmentation(AugmentationNames.SubdermalArmor); SubdermalArmor.setRequirements(350000, 650000000); SubdermalArmor.setInfo("The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. " + "The material is implanted underneath the skin, and is the most advanced form of defensive enhancement " + - "that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective " + + "that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective " + "at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to " + - "mitigate damage from any fire-related or electrical traumas.
" + + "mitigate damage from any fire-related or electrical traumas.
" + "This augmentation increases the player's defense by 125%."); SubdermalArmor.addToFactions(["The Syndicate", "Fulcrum Secret Technologies", "Illuminati", "Daedalus", "The Covenant"]); @@ -292,36 +292,36 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SubdermalArmor]; } AddToAugmentations(SubdermalArmor); - + var WiredReflexes = new Augmentation(AugmentationNames.WiredReflexes); WiredReflexes.setRequirements(500, 500000); - WiredReflexes.setInfo("Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, " + - "supercharging the body's ability to send signals through neurons. This results in increased reflex speed.
" + + WiredReflexes.setInfo("Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, " + + "supercharging the body's ability to send signals through neurons. This results in increased reflex speed.
" + "This augmentation increases the player's agility and dexterity by 5%."); - WiredReflexes.addToFactions(["Tian Di Hui", "Slum Snakes", "Sector-12", "Volhaven", "Aevum", "Ishima", + WiredReflexes.addToFactions(["Tian Di Hui", "Slum Snakes", "Sector-12", "Volhaven", "Aevum", "Ishima", "The Syndicate", "The Dark Army", "Speakers for the Dead"]); if (augmentationExists(AugmentationNames.WiredReflexes)) { delete Augmentations[AugmentationNames.WiredReflexes]; } AddToAugmentations(WiredReflexes); - + var GrapheneBoneLacings = new Augmentation(AugmentationNames.GrapheneBoneLacings); GrapheneBoneLacings.setRequirements(450000, 850000000); GrapheneBoneLacings.setInfo("A graphene-based material is grafted and fused into the user's bones, significantly increasing " + - "their density and tensile strength.
" + + "their density and tensile strength.
" + "This augmentation increases the player's strength and defense by 70%."); GrapheneBoneLacings.addToFactions(["Fulcrum Secret Technologies", "The Covenant"]); if (augmentationExists(AugmentationNames.GrapheneBoneLacings)) { delete Augmentations[AugmentationNames.GrapheneBoneLacings]; } AddToAugmentations(GrapheneBoneLacings); - + var BionicSpine = new Augmentation(AugmentationNames.BionicSpine); BionicSpine.setRequirements(18000, 25000000); - BionicSpine.setInfo("An artificial spine created from plasteel and carbon fibers that completely replaces the organic spine. " + - "Not only is the Bionic Spine physically stronger than a human spine, but it is also capable of digitally " + - "stimulating and regulating the neural signals that are sent and received by the spinal cord. This results in " + - "greatly improved senses and reaction speeds.
" + + BionicSpine.setInfo("An artificial spine created from plasteel and carbon fibers that completely replaces the organic spine. " + + "Not only is the Bionic Spine physically stronger than a human spine, but it is also capable of digitally " + + "stimulating and regulating the neural signals that are sent and received by the spinal cord. This results in " + + "greatly improved senses and reaction speeds.
" + "This augmentation increases all of the player's combat stats by 16%."); BionicSpine.addToFactions(["Speakers for the Dead", "The Syndicate", "KuaiGong International", "OmniTek Incorporated", "Blade Industries"]); @@ -329,21 +329,21 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.BionicSpine]; } AddToAugmentations(BionicSpine); - + var GrapheneBionicSpine = new Augmentation(AugmentationNames.GrapheneBionicSpine); GrapheneBionicSpine.setRequirements(650000, 1200000000); - GrapheneBionicSpine.setInfo("An upgrade to the Bionic Spine augmentation. It fuses the implant with an advanced graphene " + - "material to make it much stronger and lighter.
" + + GrapheneBionicSpine.setInfo("An upgrade to the Bionic Spine augmentation. It fuses the implant with an advanced graphene " + + "material to make it much stronger and lighter.
" + "This augmentation increases all of the player's combat stats by 60%."); GrapheneBionicSpine.addToFactions(["Fulcrum Secret Technologies", "ECorp"]); if (augmentationExists(AugmentationNames.GrapheneBionicSpine)) { delete Augmentations[AugmentationNames.GrapheneBionicSpine]; } AddToAugmentations(GrapheneBionicSpine); - + var BionicLegs = new Augmentation(AugmentationNames.BionicLegs); BionicLegs.setRequirements(60000, 75000000); - BionicLegs.setInfo("Cybernetic legs created from plasteel and carbon fibers that completely replace the user's organic legs.
" + + BionicLegs.setInfo("Cybernetic legs created from plasteel and carbon fibers that completely replace the user's organic legs.
" + "This augmentation increases the player's agility by 60%."); BionicLegs.addToFactions(["Speakers for the Dead", "The Syndicate", "KuaiGong International", "OmniTek Incorporated", "Blade Industries"]); @@ -351,24 +351,24 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.BionicLegs]; } AddToAugmentations(BionicLegs); - + var GrapheneBionicLegs = new Augmentation(AugmentationNames.GrapheneBionicLegs); GrapheneBionicLegs.setRequirements(300000, 900000000); - GrapheneBionicLegs.setInfo("An upgrade to the Bionic Legs augmentation. It fuses the implant with an advanced graphene " + - "material to make it much stronger and lighter.
" + + GrapheneBionicLegs.setInfo("An upgrade to the Bionic Legs augmentation. It fuses the implant with an advanced graphene " + + "material to make it much stronger and lighter.
" + "This augmentation increases the player's agility by an additional 175%."); GrapheneBionicLegs.addToFactions(["MegaCorp", "ECorp", "Fulcrum Secret Technologies"]); if (augmentationExists(AugmentationNames.GrapheneBionicLegs)) { delete Augmentations[AugmentationNames.GrapheneBionicLegs]; } AddToAugmentations(GrapheneBionicLegs); - + //Labor stat augmentations var SpeechProcessor = new Augmentation(AugmentationNames.SpeechProcessor); //Cochlear imlant? SpeechProcessor.setRequirements(3000, 10000000); SpeechProcessor.setInfo("A cochlear implant with an embedded computer that analyzes incoming speech. " + "The embedded computer processes characteristics of incoming speech, such as tone " + - "and inflection, to pick up on subtle cues and aid in social interactions.
" + + "and inflection, to pick up on subtle cues and aid in social interactions.
" + "This augmentation increases the player's charisma by 20%."); SpeechProcessor.addToFactions(["Tian Di Hui", "Chongqing", "Sector-12", "New Tokyo", "Aevum", "Ishima", "Volhaven", "Silhouette"]); @@ -376,26 +376,26 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SpeechProcessor]; } AddToAugmentations(SpeechProcessor); - + TITN41Injection = new Augmentation(AugmentationNames.TITN41Injection); TITN41Injection.setRequirements(10000, 38000000); - TITN41Injection.setInfo("TITN is a series of viruses that targets and alters the sequences of human DNA in genes that " + - "control personality. The TITN-41 strain alters these genes so that the subject becomes more " + - "outgoing and socialable.
" + + TITN41Injection.setInfo("TITN is a series of viruses that targets and alters the sequences of human DNA in genes that " + + "control personality. The TITN-41 strain alters these genes so that the subject becomes more " + + "outgoing and socialable.
" + "This augmentation increases the player's charisma and charisma experience gain rate by 15%"); - TITN41Injection.addToFactions(["Silhouette"]); + TITN41Injection.addToFactions(["Silhouette"]); if (augmentationExists(AugmentationNames.TITN41Injection)) { delete Augmentations[AugmentationNames.TITN41Injection]; } AddToAugmentations(TITN41Injection); - + var EnhancedSocialInteractionImplant = new Augmentation(AugmentationNames.EnhancedSocialInteractionImplant); EnhancedSocialInteractionImplant.setRequirements(150000, 275000000); - EnhancedSocialInteractionImplant.setInfo("A cranial implant that greatly assists in the user's ability to analyze social situations " + - "and interactions. The system uses a wide variety of factors such as facial expression, body " + - "language, and the voice's tone/inflection to determine the best course of action during social" + - "situations. The implant also uses deep learning software to continuously learn new behavior" + - "patterns and how to best respond.
" + + EnhancedSocialInteractionImplant.setInfo("A cranial implant that greatly assists in the user's ability to analyze social situations " + + "and interactions. The system uses a wide variety of factors such as facial expression, body " + + "language, and the voice's tone/inflection to determine the best course of action during social" + + "situations. The implant also uses deep learning software to continuously learn new behavior" + + "patterns and how to best respond.
" + "This augmentation increases the player's charisma and charisma experience gain rate by 60%."); EnhancedSocialInteractionImplant.addToFactions(["Bachman & Associates", "NWO", "Clarke Incorporated", "OmniTek Incorporated", "Four Sigma"]); @@ -403,142 +403,142 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.EnhancedSocialInteractionImplant]; } AddToAugmentations(EnhancedSocialInteractionImplant); - + //Hacking augmentations var BitWire = new Augmentation(AugmentationNames.BitWire); BitWire.setRequirements(1500, 2000000); - BitWire.setInfo("A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing " + + BitWire.setInfo("A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing " + "capabilities.
This augmentation increases the player's hacking skill by 5%"); BitWire.addToFactions(["CyberSec", "NiteSec"]); if (augmentationExists(AugmentationNames.BitWire)) { delete Augmentations[AugmentationNames.BitWire]; } AddToAugmentations(BitWire); - + var ArtificialBioNeuralNetwork = new Augmentation(AugmentationNames.ArtificialBioNeuralNetwork); ArtificialBioNeuralNetwork.setRequirements(110000, 600000000); ArtificialBioNeuralNetwork.setInfo("A network consisting of millions of nanoprocessors is embedded into the brain. " + - "The network is meant to mimick the way a biological brain solves a problem, which each " + - "nanoprocessor acting similar to the way a neuron would in a neural network. However, these " + - "nanoprocessors are programmed to perform computations much faster than organic neurons, " + - "allowing its user to solve much more complex problems at a much faster rate.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 3%
" + - "Increases the amount of money the player's gains from hacking by 15%
" + + "The network is meant to mimick the way a biological brain solves a problem, which each " + + "nanoprocessor acting similar to the way a neuron would in a neural network. However, these " + + "nanoprocessors are programmed to perform computations much faster than organic neurons, " + + "allowing its user to solve much more complex problems at a much faster rate.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 3%
" + + "Increases the amount of money the player's gains from hacking by 15%
" + "Inreases the player's hacking skill by 12%"); ArtificialBioNeuralNetwork.addToFactions(["BitRunners", "Fulcrum Secret Technologies"]); if (augmentationExists(AugmentationNames.ArtificialBioNeuralNetwork)) { delete Augmentations[AugmentationNames.ArtificialBioNeuralNetwork]; } AddToAugmentations(ArtificialBioNeuralNetwork); - + var ArtificialSynapticPotentiation = new Augmentation(AugmentationNames.ArtificialSynapticPotentiation); ArtificialSynapticPotentiation.setRequirements(2500, 16000000); - ArtificialSynapticPotentiation.setInfo("The body is injected with a chemical that artificially induces synaptic potentiation, " + - "otherwise known as the strengthening of synapses. This results in a enhanced cognitive abilities.
" + - "This augmentation:
" + + ArtificialSynapticPotentiation.setInfo("The body is injected with a chemical that artificially induces synaptic potentiation, " + + "otherwise known as the strengthening of synapses. This results in a enhanced cognitive abilities.
" + + "This augmentation:
" + "Increases the player's hacking speed by 2%
" + - "Increases the player's hacking chance by 5%
" + + "Increases the player's hacking chance by 5%
" + "Increases the player's hacking experience gain rate by 5%"); ArtificialSynapticPotentiation.addToFactions(["The Black Hand", "NiteSec"]); if (augmentationExists(AugmentationNames.ArtificialSynapticPotentiation)) { delete Augmentations[AugmentationNames.ArtificialSynapticPotentiation]; } AddToAugmentations(ArtificialSynapticPotentiation); - + var EnhancedMyelinSheathing = new Augmentation(AugmentationNames.EnhancedMyelinSheathing); EnhancedMyelinSheathing.setRequirements(40000, 275000000); - EnhancedMyelinSheathing.setInfo("Electrical signals are used to induce a new, artificial form of myelinogensis in the human body. " + - "This process results in the proliferation of new, synthetic myelin sheaths in the nervous " + - "system. These myelin sheaths can propogate neuro-signals much faster than their organic " + - "counterparts, leading to greater processing speeds and better brain function.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 3%
" + - "Increases the player's hacking skill by 8%
" + + EnhancedMyelinSheathing.setInfo("Electrical signals are used to induce a new, artificial form of myelinogensis in the human body. " + + "This process results in the proliferation of new, synthetic myelin sheaths in the nervous " + + "system. These myelin sheaths can propogate neuro-signals much faster than their organic " + + "counterparts, leading to greater processing speeds and better brain function.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 3%
" + + "Increases the player's hacking skill by 8%
" + "Increases the player's hacking experience gain rate by 10%"); EnhancedMyelinSheathing.addToFactions(["Fulcrum Secret Technologies", "BitRunners", "The Black Hand"]); if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) { delete Augmentations[AugmentationNames.EnhancedMyelinSheathing]; } AddToAugmentations(EnhancedMyelinSheathing); - + var SynapticEnhancement = new Augmentation(AugmentationNames.SynapticEnhancement); SynapticEnhancement.setRequirements(800, 1500000); SynapticEnhancement.setInfo("A small cranial implant that continuously uses weak electric signals to stimulate the brain and " + - "induce stronger synaptic activity. This improves the user's cognitive abilities.
" + + "induce stronger synaptic activity. This improves the user's cognitive abilities.
" + "This augmentation increases the player's hacking speed by 3%."); SynapticEnhancement.addToFactions(["CyberSec"]); if (augmentationExists(AugmentationNames.SynapticEnhancement)) { delete Augmentations[AugmentationNames.SynapticEnhancement]; } AddToAugmentations(SynapticEnhancement); - + var NeuralRetentionEnhancement = new Augmentation(AugmentationNames.NeuralRetentionEnhancement); NeuralRetentionEnhancement.setRequirements(8000, 50000000); NeuralRetentionEnhancement.setInfo("Chemical injections are used to permanently alter and strengthen the brain's neuronal " + - "circuits, strengthening its ability to retain information.
" + + "circuits, strengthening its ability to retain information.
" + "This augmentation increases the player's hacking experience gain rate by 25%."); NeuralRetentionEnhancement.addToFactions(["NiteSec"]); if (augmentationExists(AugmentationNames.NeuralRetentionEnhancement)) { delete Augmentations[AugmentationNames.NeuralRetentionEnhancement]; } AddToAugmentations(NeuralRetentionEnhancement); - + var DataJack = new Augmentation(AugmentationNames.DataJack); DataJack.setRequirements(45000, 90000000); - DataJack.setInfo("A brain implant that provides an interface for direct, wireless communication between a computer's main " + - "memory and the mind. This implant allows the user to not only access a computer's memory, but also alter " + - "and delete it.
" + + DataJack.setInfo("A brain implant that provides an interface for direct, wireless communication between a computer's main " + + "memory and the mind. This implant allows the user to not only access a computer's memory, but also alter " + + "and delete it.
" + "This augmentation increases the amount of money the player gains from hacking by 25%"); DataJack.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo"]); if (augmentationExists(AugmentationNames.DataJack)) { delete Augmentations[AugmentationNames.DataJack]; } AddToAugmentations(DataJack); - + var ENM = new Augmentation(AugmentationNames.ENM); ENM.setRequirements(6000, 50000000); - ENM.setInfo("A thin device embedded inside the arm containing a wireless module capable of connecting " + - "to nearby networks. Once connected, the Netburner Module is capable of capturing and " + - "processing all of the traffic on that network. By itself, the Embedded Netburner Module does " + + ENM.setInfo("A thin device embedded inside the arm containing a wireless module capable of connecting " + + "to nearby networks. Once connected, the Netburner Module is capable of capturing and " + + "processing all of the traffic on that network. By itself, the Embedded Netburner Module does " + "not do much, but a variety of very powerful upgrades can be installed that allow you to fully " + - "control the traffic on a network.
" + + "control the traffic on a network.
" + "This augmentation increases the player's hacking skill by 8%"); - ENM.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "ECorp", "MegaCorp", + ENM.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Blade Industries"]); if (augmentationExists(AugmentationNames.ENM)) { delete Augmentations[AugmentationNames.ENM]; } AddToAugmentations(ENM); - + var ENMCore = new Augmentation(AugmentationNames.ENMCore); ENMCore.setRequirements(100000, 500000000); - ENMCore.setInfo("The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. " + + ENMCore.setInfo("The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. " + "This upgrade allows the Embedded Netburner Module to generate its own data on a network.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 3%
" + - "Increases the amount of money the player gains from hacking by 10%
" + - "Increases the player's chance of successfully performing a hack by 3%
" + - "Increases the player's hacking experience gain rate by 7%
" + + "This augmentation:
" + + "Increases the player's hacking speed by 3%
" + + "Increases the amount of money the player gains from hacking by 10%
" + + "Increases the player's chance of successfully performing a hack by 3%
" + + "Increases the player's hacking experience gain rate by 7%
" + "Increases the player's hacking skill by 7%"); - ENMCore.addToFactions(["BitRunners", "The Black Hand", "ECorp", "MegaCorp", + ENMCore.addToFactions(["BitRunners", "The Black Hand", "ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Blade Industries"]); if (augmentationExists(AugmentationNames.ENMCore)) { delete Augmentations[AugmentationNames.ENMCore]; } AddToAugmentations(ENMCore); - + var ENMCoreV2 = new Augmentation(AugmentationNames.ENMCoreV2); ENMCoreV2.setRequirements(400000, 900000000); - ENMCoreV2.setInfo("The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. " + - "This upgraded firmware allows the Embedded Netburner Module to control the information on " + - "a network by re-routing traffic, spoofing IP addresses, or altering the data inside network " + - "packets.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 5%
" + - "Increases the amount of money the player gains from hacking by 30%
" + - "Increases the player's chance of successfully performing a hack by 5%
" + - "Increases the player's hacking experience gain rate by 15%
" + + ENMCoreV2.setInfo("The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. " + + "This upgraded firmware allows the Embedded Netburner Module to control the information on " + + "a network by re-routing traffic, spoofing IP addresses, or altering the data inside network " + + "packets.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 5%
" + + "Increases the amount of money the player gains from hacking by 30%
" + + "Increases the player's chance of successfully performing a hack by 5%
" + + "Increases the player's hacking experience gain rate by 15%
" + "Increases the player's hacking skill by 8%"); ENMCoreV2.addToFactions(["BitRunners", "ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Blade Industries", "OmniTek Incorporated", "KuaiGong International"]); @@ -546,17 +546,17 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.ENMCoreV2]; } AddToAugmentations(ENMCoreV2); - + var ENMCoreV3 = new Augmentation(AugmentationNames.ENMCoreV3); ENMCoreV3.setRequirements(700000, 1500000000); - ENMCoreV3.setInfo("The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. " + - "This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into " + - "any device on a network.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 5%
" + - "Increases the amount of money the player gains from hacking by 40%
" + - "Increases the player's chance of successfully performing a hack by 10%
" + - "Increases the player's hacking experience gain rate by 25%
" + + ENMCoreV3.setInfo("The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. " + + "This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into " + + "any device on a network.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 5%
" + + "Increases the amount of money the player gains from hacking by 40%
" + + "Increases the player's chance of successfully performing a hack by 10%
" + + "Increases the player's hacking experience gain rate by 25%
" + "Increases the player's hacking skill by 10%"); ENMCoreV3.addToFactions(["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"]); @@ -564,11 +564,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.ENMCoreV3]; } AddToAugmentations(ENMCoreV3); - + var ENMAnalyzeEngine = new Augmentation(AugmentationNames.ENMAnalyzeEngine); ENMAnalyzeEngine.setRequirements(250000, 1200000000); - ENMAnalyzeEngine.setInfo("Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster " + - "that vastly outperforms the Netburner Module's native single-core processor.
" + + ENMAnalyzeEngine.setInfo("Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster " + + "that vastly outperforms the Netburner Module's native single-core processor.
" + "This augmentation increases the player's hacking speed by 10%."); ENMAnalyzeEngine.addToFactions(["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"]); @@ -576,153 +576,153 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.ENMAnalyzeEngine]; } AddToAugmentations(ENMAnalyzeEngine); - + var ENMDMA = new Augmentation(AugmentationNames.ENMDMA); ENMDMA.setRequirements(400000, 1400000000); - ENMDMA.setInfo("This implant installs a Direct Memory Access (DMA) controller into the " + - "Embedded Netburner Module. This allows the Module to send and receive data " + - "directly to and from the main memory of devices on a network.
" + - "This augmentation:
" + + ENMDMA.setInfo("This implant installs a Direct Memory Access (DMA) controller into the " + + "Embedded Netburner Module. This allows the Module to send and receive data " + + "directly to and from the main memory of devices on a network.
" + + "This augmentation:
" + "Increases the amount of money the player gains from hacking by 40%
" + - "Increases the player's chance of successfully performing a hack by 20%"); + "Increases the player's chance of successfully performing a hack by 20%"); ENMDMA.addToFactions(["ECorp", "MegaCorp", "Fulcrum Secret Technologies", "NWO", "Daedalus", "The Covenant", "Illuminati"]); if (augmentationExists(AugmentationNames.ENMDMA)) { delete Augmentations[AugmentationNames.ENMDMA]; } AddToAugmentations(ENMDMA); - + var Neuralstimulator = new Augmentation(AugmentationNames.Neuralstimulator); Neuralstimulator.setRequirements(20000, 600000000); - Neuralstimulator.setInfo("A cranial implant that intelligently stimulates certain areas of the brain " + - "in order to improve cognitive functions
" + - "This augmentation:
" + - "Increases the player's hacking speed by 2%
" + - "Increases the player's chance of successfully performing a hack by 10%
" + + Neuralstimulator.setInfo("A cranial implant that intelligently stimulates certain areas of the brain " + + "in order to improve cognitive functions
" + + "This augmentation:
" + + "Increases the player's hacking speed by 2%
" + + "Increases the player's chance of successfully performing a hack by 10%
" + "Increases the player's hacking experience gain rate by 12%"); Neuralstimulator.addToFactions(["The Black Hand", "Chongqing", "Sector-12", "New Tokyo", "Aevum", - "Ishima", "Volhaven", "Bachman & Associates", "Clarke Incorporated", + "Ishima", "Volhaven", "Bachman & Associates", "Clarke Incorporated", "Four Sigma"]); if (augmentationExists(AugmentationNames.Neuralstimulator)) { delete Augmentations[AugmentationNames.Neuralstimulator]; } AddToAugmentations(Neuralstimulator); - + var NeuralAccelerator = new Augmentation(AugmentationNames.NeuralAccelerator); NeuralAccelerator.setRequirements(80000, 350000000); - NeuralAccelerator.setInfo("A microprocessor that accelerates the processing " + - "speed of biological neural networks. This is a cranial implant that is embedded inside the brain.
" + - "This augmentation:
" + - "Increases the player's hacking skill by 10%
" + - "Increases the player's hacking experience gain rate by 15%
" + + NeuralAccelerator.setInfo("A microprocessor that accelerates the processing " + + "speed of biological neural networks. This is a cranial implant that is embedded inside the brain.
" + + "This augmentation:
" + + "Increases the player's hacking skill by 10%
" + + "Increases the player's hacking experience gain rate by 15%
" + "Increases the amount of money the player gains from hacking by 20%"); NeuralAccelerator.addToFactions(["BitRunners"]); if (augmentationExists(AugmentationNames.NeuralAccelerator)) { delete Augmentations[AugmentationNames.NeuralAccelerator]; } AddToAugmentations(NeuralAccelerator); - + var CranialSignalProcessorsG1 = new Augmentation(AugmentationNames.CranialSignalProcessorsG1); CranialSignalProcessorsG1.setRequirements(4000, 14000000); - CranialSignalProcessorsG1.setInfo("The first generation of Cranial Signal Processors. Cranial Signal Processors " + - "are a set of specialized microprocessors that are attached to " + + CranialSignalProcessorsG1.setInfo("The first generation of Cranial Signal Processors. Cranial Signal Processors " + + "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + - "so that the brain doesn't have to.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 1%
" + + "so that the brain doesn't have to.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 1%
" + "Increases the player's hacking skill by 5%"); CranialSignalProcessorsG1.addToFactions(["CyberSec"]); if (augmentationExists(AugmentationNames.CranialSignalProcessorsG1)) { delete Augmentations[AugmentationNames.CranialSignalProcessorsG1]; } AddToAugmentations(CranialSignalProcessorsG1); - + var CranialSignalProcessorsG2 = new Augmentation(AugmentationNames.CranialSignalProcessorsG2); CranialSignalProcessorsG2.setRequirements(7500, 25000000); - CranialSignalProcessorsG2.setInfo("The second generation of Cranial Signal Processors. Cranial Signal Processors " + - "are a set of specialized microprocessors that are attached to " + + CranialSignalProcessorsG2.setInfo("The second generation of Cranial Signal Processors. Cranial Signal Processors " + + "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + - "so that the brain doesn't have to.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 2%
" + - "Increases the player's chance of successfully performing a hack by 5%
" + + "so that the brain doesn't have to.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 2%
" + + "Increases the player's chance of successfully performing a hack by 5%
" + "Increases the player's hacking skill by 7%"); CranialSignalProcessorsG2.addToFactions(["NiteSec"]); if (augmentationExists(AugmentationNames.CranialSignalProcessorsG2)) { delete Augmentations[AugmentationNames.CranialSignalProcessorsG2]; } AddToAugmentations(CranialSignalProcessorsG2); - + var CranialSignalProcessorsG3 = new Augmentation(AugmentationNames.CranialSignalProcessorsG3); CranialSignalProcessorsG3.setRequirements(20000, 110000000); - CranialSignalProcessorsG3.setInfo("The third generation of Cranial Signal Processors. Cranial Signal Processors " + - "are a set of specialized microprocessors that are attached to " + + CranialSignalProcessorsG3.setInfo("The third generation of Cranial Signal Processors. Cranial Signal Processors " + + "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + - "so that the brain doesn't have to.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 2%
" + - "Increases the amount of money the player gains from hacking by 15%
" + + "so that the brain doesn't have to.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 2%
" + + "Increases the amount of money the player gains from hacking by 15%
" + "Increases the player's hacking skill by 9%"); CranialSignalProcessorsG3.addToFactions(["NiteSec", "The Black Hand"]); if (augmentationExists(AugmentationNames.CranialSignalProcessorsG3)) { delete Augmentations[AugmentationNames.CranialSignalProcessorsG3]; } AddToAugmentations(CranialSignalProcessorsG3); - + var CranialSignalProcessorsG4 = new Augmentation(AugmentationNames.CranialSignalProcessorsG4); CranialSignalProcessorsG4.setRequirements(50000, 220000000); - CranialSignalProcessorsG4.setInfo("The fourth generation of Cranial Signal Processors. Cranial Signal Processors " + - "are a set of specialized microprocessors that are attached to " + + CranialSignalProcessorsG4.setInfo("The fourth generation of Cranial Signal Processors. Cranial Signal Processors " + + "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + - "so that the brain doesn't have to.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 2%
" + - "Increases the amount of money the player gains from hacking by 20%
" + + "so that the brain doesn't have to.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 2%
" + + "Increases the amount of money the player gains from hacking by 20%
" + "Increases the amount of money the player can inject into servers using grow() by 25%"); CranialSignalProcessorsG4.addToFactions(["The Black Hand"]); if (augmentationExists(AugmentationNames.CranialSignalProcessorsG4)) { delete Augmentations[AugmentationNames.CranialSignalProcessorsG4]; } AddToAugmentations(CranialSignalProcessorsG4); - + var CranialSignalProcessorsG5 = new Augmentation(AugmentationNames.CranialSignalProcessorsG5); CranialSignalProcessorsG5.setRequirements(100000, 450000000); - CranialSignalProcessorsG5.setInfo("The fifth generation of Cranial Signal Processors. Cranial Signal Processors " + - "are a set of specialized microprocessors that are attached to " + + CranialSignalProcessorsG5.setInfo("The fifth generation of Cranial Signal Processors. Cranial Signal Processors " + + "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + - "so that the brain doesn't have to.
" + - "This augmentation:
" + + "so that the brain doesn't have to.
" + + "This augmentation:
" + "Increases the player's hacking skill by 30%
" + - "Increases the amount of money the player gains from hacking by 25%
" + + "Increases the amount of money the player gains from hacking by 25%
" + "Increases the amount of money the player can inject into servers using grow() by 75%"); CranialSignalProcessorsG5.addToFactions(["BitRunners"]); if (augmentationExists(AugmentationNames.CranialSignalProcessorsG5)) { delete Augmentations[AugmentationNames.CranialSignalProcessorsG5]; } AddToAugmentations(CranialSignalProcessorsG5); - + var NeuronalDensification = new Augmentation(AugmentationNames.NeuronalDensification); NeuronalDensification.setRequirements(75000, 275000000); NeuronalDensification.setInfo("The brain is surgically re-engineered to have increased neuronal density " + - "by decreasing the neuron gap junction. Then, the body is genetically modified " + - "to enhance the production and capabilities of its neural stem cells.
" + - "This augmentation:
" + - "Increases the player's hacking skill by 15%
" + - "Increases the player's hacking experience gain rate by 10%
"+ + "by decreasing the neuron gap junction. Then, the body is genetically modified " + + "to enhance the production and capabilities of its neural stem cells.
" + + "This augmentation:
" + + "Increases the player's hacking skill by 15%
" + + "Increases the player's hacking experience gain rate by 10%
"+ "Increases the player's hacking speed by 3%"); NeuronalDensification.addToFactions(["Clarke Incorporated"]); if (augmentationExists(AugmentationNames.NeuronalDensification)) { delete Augmentations[AugmentationNames.NeuronalDensification]; } AddToAugmentations(NeuronalDensification); - + //Work Augmentations var NuoptimalInjectorImplant = new Augmentation(AugmentationNames.NuoptimalInjectorImplant); NuoptimalInjectorImplant.setRequirements(2000, 4000000); - NuoptimalInjectorImplant.setInfo("This torso implant automatically injects nootropic supplements into " + - "the bloodstream to improve memory, increase focus, and provide other " + - "cognitive enhancements.
" + - "This augmentation increases the amount of reputation the player gains " + + NuoptimalInjectorImplant.setInfo("This torso implant automatically injects nootropic supplements into " + + "the bloodstream to improve memory, increase focus, and provide other " + + "cognitive enhancements.
" + + "This augmentation increases the amount of reputation the player gains " + "when working for a company by 20%."); NuoptimalInjectorImplant.addToFactions(["Tian Di Hui", "Volhaven", "New Tokyo", "Chongqing", "Ishima", "Clarke Incorporated", "Four Sigma", "Bachman & Associates"]); @@ -730,12 +730,12 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.NuoptimalInjectorImplant]; } AddToAugmentations(NuoptimalInjectorImplant); - + var SpeechEnhancement = new Augmentation(AugmentationNames.SpeechEnhancement); SpeechEnhancement.setRequirements(1000, 2500000); - SpeechEnhancement.setInfo("An advanced neural implant that improves your speaking abilities, making " + + SpeechEnhancement.setInfo("An advanced neural implant that improves your speaking abilities, making " + "you more convincing and likable in conversations and overall improving your " + - "social interactions.
" + + "social interactions.
" + "This augmentation:
" + "Increases the player's charisma by 10%
" + "Increases the amount of reputation the player gains when working for a company by 10%"); @@ -745,146 +745,146 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SpeechEnhancement]; } AddToAugmentations(SpeechEnhancement); - + var FocusWire = new Augmentation(AugmentationNames.FocusWire); //Stops procrastination FocusWire.setRequirements(30000, 180000000); - FocusWire.setInfo("A cranial implant that stops procrastination by blocking specific neural pathways " + - "in the brain.
" + - "This augmentation:
" + + FocusWire.setInfo("A cranial implant that stops procrastination by blocking specific neural pathways " + + "in the brain.
" + + "This augmentation:
" + "Increases all experience gains by 5%
" + - "Increases the amount of money the player gains from working by 20%
" + + "Increases the amount of money the player gains from working by 20%
" + "Increases the amount of reputation the player gains when working for a company by 10%"); FocusWire.addToFactions(["Bachman & Associates", "Clarke Incorporated", "Four Sigma", "KuaiGong International"]); if (augmentationExists(AugmentationNames.FocusWire)) { delete Augmentations[AugmentationNames.FocusWire]; } AddToAugmentations(FocusWire) - + var PCDNI = new Augmentation(AugmentationNames.PCDNI); PCDNI.setRequirements(150000, 750000000); - PCDNI.setInfo("Installs a Direct-Neural Interface jack into your arm that is compatible with most " + + PCDNI.setInfo("Installs a Direct-Neural Interface jack into your arm that is compatible with most " + "computers. Connecting to a computer through this jack allows you to interface with " + - "it using the brain's electrochemical signals.
" + + "it using the brain's electrochemical signals.
" + "This augmentation:
" + - "Increases the amount of reputation the player gains when working for a company by 30%
" + + "Increases the amount of reputation the player gains when working for a company by 30%
" + "Increases the player's hacking skill by 8%"); PCDNI.addToFactions(["Four Sigma", "OmniTek Incorporated", "ECorp", "Blade Industries"]); if (augmentationExists(AugmentationNames.PCDNI)) { delete Augmentations[AugmentationNames.PCDNI]; } AddToAugmentations(PCDNI); - + var PCDNIOptimizer = new Augmentation(AugmentationNames.PCDNIOptimizer); PCDNIOptimizer.setRequirements(200000, 900000000); - PCDNIOptimizer.setInfo("This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It " + + PCDNIOptimizer.setInfo("This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It " + "improves the performance of the interface and gives the user more control options " + - "to the connected computer.
" + - "This augmentation:
" + - "Increases the amount of reputation the player gains when working for a company by 75%
" + + "to the connected computer.
" + + "This augmentation:
" + + "Increases the amount of reputation the player gains when working for a company by 75%
" + "Increases the player's hacking skill by 10%"); PCDNIOptimizer.addToFactions(["Fulcrum Secret Technologies", "ECorp", "Blade Industries"]); if (augmentationExists(AugmentationNames.PCDNIOptimizer)) { delete Augmentations[AugmentationNames.PCDNIOptimizer]; } AddToAugmentations(PCDNIOptimizer); - + var PCDNINeuralNetwork = new Augmentation(AugmentationNames.PCDNINeuralNetwork); PCDNINeuralNetwork.setRequirements(600000, 1500000000); - PCDNINeuralNetwork.setInfo("This is an additional installation that upgrades the functionality of the " + - "PC Direct-Neural Interface augmentation. When connected to a computer, " + - "The NeuroNet Injector upgrade allows the user to use his/her own brain's " + - "processing power to aid the computer in computational tasks.
" + - "This augmentation:
" + - "Increases the amount of reputation the player gains when working for a company by 100%
" + - "Increases the player's hacking skill by 10%
" + + PCDNINeuralNetwork.setInfo("This is an additional installation that upgrades the functionality of the " + + "PC Direct-Neural Interface augmentation. When connected to a computer, " + + "The NeuroNet Injector upgrade allows the user to use his/her own brain's " + + "processing power to aid the computer in computational tasks.
" + + "This augmentation:
" + + "Increases the amount of reputation the player gains when working for a company by 100%
" + + "Increases the player's hacking skill by 10%
" + "Increases the player's hacking speed by 5%"); PCDNINeuralNetwork.addToFactions(["Fulcrum Secret Technologies"]); if (augmentationExists(AugmentationNames.PCDNINeuralNetwork)) { delete Augmentations[AugmentationNames.PCDNINeuralNetwork]; } AddToAugmentations(PCDNINeuralNetwork); - + var ADRPheromone1 = new Augmentation(AugmentationNames.ADRPheromone1); ADRPheromone1.setRequirements(1500, 3500000); ADRPheromone1.setInfo("The body is genetically re-engineered so that it produces the ADR-V1 pheromone, " + - "an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, " + - "triggers feelings of admiration and approval in other people.
" + - "This augmentation:
" + - "Increases the amount of reputation the player gains when working for a company by 10%
" + + "an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, " + + "triggers feelings of admiration and approval in other people.
" + + "This augmentation:
" + + "Increases the amount of reputation the player gains when working for a company by 10%
" + "Increases the amount of reputation the player gains for a faction by 10%"); ADRPheromone1.addToFactions(["Tian Di Hui", "The Syndicate", "NWO", "MegaCorp", "Four Sigma"]); if (augmentationExists(AugmentationNames.ADRPheromone1)) { delete Augmentations[AugmentationNames.ADRPheromone1]; } AddToAugmentations(ADRPheromone1); - + //HacknetNode Augmentations var HacknetNodeCPUUpload = new Augmentation(AugmentationNames.HacknetNodeCPUUpload); HacknetNodeCPUUpload.setRequirements(1500, 2200000); - HacknetNodeCPUUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's CPU into " + + HacknetNodeCPUUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's CPU into " + "the brain. This allows the user to engineer custom hardware and software " + - "for the Hacknet Node that provides better performance.
" + - "This augmentation:
" + - "Increases the amount of money produced by Hacknet Nodes by 15%
" + + "for the Hacknet Node that provides better performance.
" + + "This augmentation:
" + + "Increases the amount of money produced by Hacknet Nodes by 15%
" + "Decreases the cost of purchasing a Hacknet Node by 15%"); HacknetNodeCPUUpload.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeCPUUpload)) { delete Augmentations[AugmentationNames.HacknetNodeCPUUpload]; } AddToAugmentations(HacknetNodeCPUUpload); - + var HacknetNodeCacheUpload = new Augmentation(AugmentationNames.HacknetNodeCacheUpload); HacknetNodeCacheUpload.setRequirements(1000, 1100000); - HacknetNodeCacheUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's main-memory cache " + - "into the brain. This allows the user to engineer custom cache hardware for the " + - "Hacknet Node that offers better performance.
" + - "This augmentation:
" + - "Increases the amount of money produced by Hacknet Nodes by 10%
" + + HacknetNodeCacheUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's main-memory cache " + + "into the brain. This allows the user to engineer custom cache hardware for the " + + "Hacknet Node that offers better performance.
" + + "This augmentation:
" + + "Increases the amount of money produced by Hacknet Nodes by 10%
" + "Decreases the cost of leveling up a Hacknet Node by 15%"); HacknetNodeCacheUpload.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeCacheUpload)) { delete Augmentations[AugmentationNames.HacknetNodeCacheUpload]; } AddToAugmentations(HacknetNodeCacheUpload); - + var HacknetNodeNICUpload = new Augmentation(AugmentationNames.HacknetNodeNICUpload); HacknetNodeNICUpload.setRequirements(750, 900000); - HacknetNodeNICUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) " + - "into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that " + - "offers better performance.
" + - "This augmentation:
" + - "Increases the amount of money produced by Hacknet Nodes by 10%
" + + HacknetNodeNICUpload.setInfo("Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) " + + "into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that " + + "offers better performance.
" + + "This augmentation:
" + + "Increases the amount of money produced by Hacknet Nodes by 10%
" + "Decreases the cost of purchasing a Hacknet Node by 10%"); HacknetNodeNICUpload.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeNICUpload)) { delete Augmentations[AugmentationNames.HacknetNodeNICUpload]; } AddToAugmentations(HacknetNodeNICUpload); - + var HacknetNodeKernelDNI = new Augmentation(AugmentationNames.HacknetNodeKernelDNI); HacknetNodeKernelDNI.setRequirements(3000, 8000000); - HacknetNodeKernelDNI.setInfo("Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a " + - "Hacknet Node. This lets the user access and manipulate the Node's kernel using the mind's " + - "electrochemical signals.
" + + HacknetNodeKernelDNI.setInfo("Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a " + + "Hacknet Node. This lets the user access and manipulate the Node's kernel using the mind's " + + "electrochemical signals.
" + "This augmentation increases the amount of money produced by Hacknet Nodes by 25%."); HacknetNodeKernelDNI.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeKernelDNI)) { delete Augmentations[AugmentationNames.HacknetNodeKernelDNI]; } AddToAugmentations(HacknetNodeKernelDNI); - + var HacknetNodeCoreDNI = new Augmentation(AugmentationNames.HacknetNodeCoreDNI); HacknetNodeCoreDNI.setRequirements(5000, 12000000); HacknetNodeCoreDNI.setInfo("Installs a Direct-Neural Interface jack into the arm that is capable of connecting " + - "to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using " + - "the mind's electrochemical signals.
" + + "to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using " + + "the mind's electrochemical signals.
" + "This augmentation increases the amount of money produced by Hacknet Nodes by 45%."); HacknetNodeCoreDNI.addToFactions(["Netburners"]); if (augmentationExists(AugmentationNames.HacknetNodeCoreDNI)) { delete Augmentations[AugmentationNames.HacknetNodeCoreDNI]; } AddToAugmentations(HacknetNodeCoreDNI); - + //Misc/Hybrid augmentations var NeuroFluxGovernor = new Augmentation(AugmentationNames.NeuroFluxGovernor); if (augmentationExists(AugmentationNames.NeuroFluxGovernor)) { @@ -899,59 +899,59 @@ initAugmentations = function() { mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, NeuroFluxGovernor.level); NeuroFluxGovernor.setRequirements(500 * mult, 750000 * mult); } - NeuroFluxGovernor.setInfo("A device that is embedded in the back of the neck. The NeuroFlux Governor " + + NeuroFluxGovernor.setInfo("A device that is embedded in the back of the neck. The NeuroFlux Governor " + "monitors and regulates nervous impulses coming to and from the spinal column, " + "essentially 'governing' the body. By doing so, it improves the functionality of the " + - "body's nervous system.
" + - "This is a special augmentation because it can be leveled up infinitely. Each level of this augmentation " + + "body's nervous system.
" + + "This is a special augmentation because it can be leveled up infinitely. Each level of this augmentation " + "increases ALL of the player's multipliers by 1%"); NeuroFluxGovernor.addToAllFactions(); AddToAugmentations(NeuroFluxGovernor); - + var Neurotrainer1 = new Augmentation(AugmentationNames.Neurotrainer1); Neurotrainer1.setRequirements(400, 800000); - Neurotrainer1.setInfo("A decentralized cranial implant that improves the brain's ability to learn. It is " + - "installed by releasing millions of nanobots into the human brain, each of which " + - "attaches to a different neural pathway to enhance the brain's ability to retain " + - "and retrieve information.
" + + Neurotrainer1.setInfo("A decentralized cranial implant that improves the brain's ability to learn. It is " + + "installed by releasing millions of nanobots into the human brain, each of which " + + "attaches to a different neural pathway to enhance the brain's ability to retain " + + "and retrieve information.
" + "This augmentation increases the player's experience gain rate for all stats by 10%"); Neurotrainer1.addToFactions(["CyberSec"]); if (augmentationExists(AugmentationNames.Neurotrainer1)) { delete Augmentations[AugmentationNames.Neurotrainer1]; } AddToAugmentations(Neurotrainer1); - + var Neurotrainer2 = new Augmentation(AugmentationNames.Neurotrainer2); Neurotrainer2.setRequirements(4000, 9000000); - Neurotrainer2.setInfo("A decentralized cranial implant that improves the brain's ability to learn. This " + - "is a more powerful version of the Neurotrainer I augmentation, but it does not " + - "require Neurotrainer I to be installed as a prerequisite.
" + + Neurotrainer2.setInfo("A decentralized cranial implant that improves the brain's ability to learn. This " + + "is a more powerful version of the Neurotrainer I augmentation, but it does not " + + "require Neurotrainer I to be installed as a prerequisite.
" + "This augmentation increases the player's experience gain rate for all stats by 15%"); Neurotrainer2.addToFactions(["BitRunners", "NiteSec"]); if (augmentationExists(AugmentationNames.Neurotrainer2)) { delete Augmentations[AugmentationNames.Neurotrainer2]; } AddToAugmentations(Neurotrainer2); - + var Neurotrainer3 = new Augmentation(AugmentationNames.Neurotrainer3); Neurotrainer3.setRequirements(10000, 26000000); Neurotrainer3.setInfo("A decentralized cranial implant that improves the brain's ability to learn. This " + - "is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, " + - "but it does not require either of them to be installed as a prerequisite.
" + + "is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, " + + "but it does not require either of them to be installed as a prerequisite.
" + "This augmentation increases the player's experience gain rate for all stats by 20%"); Neurotrainer3.addToFactions(["NWO", "Four Sigma"]); if (augmentationExists(AugmentationNames.Neurotrainer3)) { delete Augmentations[AugmentationNames.Neurotrainer3]; } AddToAugmentations(Neurotrainer3); - + var Hypersight = new Augmentation(AugmentationNames.Hypersight); Hypersight.setInfo("A bionic eye implant that grants sight capabilities far beyond those of a natural human. " + "Embedded circuitry within the implant provides the ability to detect heat and movement " + - "through solid objects such as wells, thus providing 'x-ray vision'-like capabilities.
" + - "This augmentation:
" + - "Increases the player's dexterity by 40%
" + - "Increases the player's hacking speed by 3%
" + + "through solid objects such as wells, thus providing 'x-ray vision'-like capabilities.
" + + "This augmentation:
" + + "Increases the player's dexterity by 40%
" + + "Increases the player's hacking speed by 3%
" + "Increases the amount of money the player gains from hacking by 10%"); Hypersight.setRequirements(60000, 550000000); Hypersight.addToFactions(["Blade Industries", "KuaiGong International"]); @@ -959,13 +959,13 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Hypersight]; } AddToAugmentations(Hypersight); - + var LuminCloaking1 = new Augmentation(AugmentationNames.LuminCloaking1); - LuminCloaking1.setInfo("A skin implant that reinforces the skin with highly-advanced synthetic cells. These " + - "cells, when powered, have a negative refractive index. As a result, they bend light " + - "around the skin, making the user much harder to see from the naked eye.
" + - "This augmentation:
" + - "Increases the player's agility by 5%
" + + LuminCloaking1.setInfo("A skin implant that reinforces the skin with highly-advanced synthetic cells. These " + + "cells, when powered, have a negative refractive index. As a result, they bend light " + + "around the skin, making the user much harder to see from the naked eye.
" + + "This augmentation:
" + + "Increases the player's agility by 5%
" + "Increases the amount of money the player gains from crimes by 10%"); LuminCloaking1.setRequirements(600, 1000000); LuminCloaking1.addToFactions(["Slum Snakes", "Tetrads"]); @@ -973,15 +973,15 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.LuminCloaking1]; } AddToAugmentations(LuminCloaking1); - + var LuminCloaking2 = new Augmentation(AugmentationNames.LuminCloaking2); - LuminCloaking2.setInfo("This is a more advanced version of the LuminCloaking-V2 augmentation. This skin implant " + - "reinforces the skin with highly-advanced synthetic cells. These " + - "cells, when powered, are capable of not only bending light but also of bending heat, " + - "making the user more resilient as well as stealthy.
" + - "This augmentation:
" + - "Increases the player's agility by 10%
" + - "Increases the player's defense by 10%
" + + LuminCloaking2.setInfo("This is a more advanced version of the LuminCloaking-V2 augmentation. This skin implant " + + "reinforces the skin with highly-advanced synthetic cells. These " + + "cells, when powered, are capable of not only bending light but also of bending heat, " + + "making the user more resilient as well as stealthy.
" + + "This augmentation:
" + + "Increases the player's agility by 10%
" + + "Increases the player's defense by 10%
" + "Increases the amount of money the player gains from crimes by 25%"); LuminCloaking2.setRequirements(2000, 6000000); LuminCloaking2.addToFactions(["Slum Snakes", "Tetrads"]); @@ -989,13 +989,13 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.LuminCloaking2]; } AddToAugmentations(LuminCloaking2); - + var SmartSonar = new Augmentation(AugmentationNames.SmartSonar); - SmartSonar.setInfo("A cochlear implant that helps the player detect and locate enemies " + - "using sound propagation.
" + - "This augmentation:
" + - "Increases the player's dexterity by 10%
" + - "Increases the player's dexterity experience gain rate by 15%
" + + SmartSonar.setInfo("A cochlear implant that helps the player detect and locate enemies " + + "using sound propagation.
" + + "This augmentation:
" + + "Increases the player's dexterity by 10%
" + + "Increases the player's dexterity experience gain rate by 15%
" + "Increases the amount of money the player gains from crimes by 25%"); SmartSonar.setRequirements(9000, 15000000); SmartSonar.addToFactions(["Slum Snakes"]); @@ -1003,13 +1003,13 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SmartSonar]; } AddToAugmentations(SmartSonar); - + var PowerRecirculator = new Augmentation(AugmentationNames.PowerRecirculator); - PowerRecirculator.setInfo("The body's nerves are attached with polypyrrole nanocircuits that " + - "are capable of capturing wasted energy (in the form of heat) " + - "and converting it back into usable power.
" + - "This augmentation:
" + - "Increases all of the player's stats by 5%
" + + PowerRecirculator.setInfo("The body's nerves are attached with polypyrrole nanocircuits that " + + "are capable of capturing wasted energy (in the form of heat) " + + "and converting it back into usable power.
" + + "This augmentation:
" + + "Increases all of the player's stats by 5%
" + "Increases the player's experience gain rate for all stats by 10%"); PowerRecirculator.setRequirements(10000, 36000000); PowerRecirculator.addToFactions(["Tetrads", "The Dark Army", "The Syndicate", "NWO"]); @@ -1017,20 +1017,20 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.PowerRecirculator]; } AddToAugmentations(PowerRecirculator); - + //Unique AUGS (Each Faction gets one unique augmentation) //Factions that already have unique augs up to this point: // Slum Snakes, CyberSec, Netburners, Fulcrum Secret Technologies, // Silhouette - + //Illuminati var QLink = new Augmentation(AugmentationNames.QLink); QLink.setInfo("A brain implant that wirelessly connects you to the Illuminati's " + "quantum supercomputer, allowing you to access and use its incredible " + - "computing power.
" + - "This augmentation:
" + - "Increases the player's hacking speed by 10%
" + - "Increases the player's chance of successfully performing a hack by 30%
" + + "computing power.
" + + "This augmentation:
" + + "Increases the player's hacking speed by 10%
" + + "Increases the player's chance of successfully performing a hack by 30%
" + "Increases the amount of money the player gains from hacking by 100%"); QLink.setRequirements(750000, 1300000000); QLink.addToFactions(["Illuminati"]); @@ -1038,7 +1038,7 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.QLink]; } AddToAugmentations(QLink); - + //Daedalus var RedPill = new Augmentation(AugmentationNames.TheRedPill); RedPill.setInfo("It's time to leave the cave"); @@ -1048,15 +1048,15 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.TheRedPill]; } AddToAugmentations(RedPill); - + //Covenant var SPTN97 = new Augmentation(AugmentationNames.SPTN97); - SPTN97.setInfo("The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an " + - "artificially-synthesized gene that was developed by DARPA to create " + + SPTN97.setInfo("The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an " + + "artificially-synthesized gene that was developed by DARPA to create " + "super-soldiers through genetic modification. The gene was outlawed in " + - "2056.
" + - "This augmentation:
" + - "Increases all of the player's combat stats by 75%
" + + "2056.
" + + "This augmentation:
" + + "Increases all of the player's combat stats by 75%
" + "Increases the player's hacking skill by 15%"); SPTN97.setRequirements(500000, 975000000); SPTN97.addToFactions(["The Covenant"]); @@ -1064,11 +1064,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SPTN97]; } AddToAugmentations(SPTN97); - + //ECorp var HiveMind = new Augmentation(AugmentationNames.HiveMind); - HiveMind.setInfo("A brain implant developed by ECorp. They do not reveal what " + - "exactly the implant does, but they promise that it will greatly " + + HiveMind.setInfo("A brain implant developed by ECorp. They do not reveal what " + + "exactly the implant does, but they promise that it will greatly " + "enhance your abilities."); HiveMind.setRequirements(600000, 1100000000); HiveMind.addToFactions(["ECorp"]); @@ -1076,15 +1076,15 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.HiveMind]; } AddToAugmentations(HiveMind); - + //MegaCorp var CordiARCReactor = new Augmentation(AugmentationNames.CordiARCReactor); CordiARCReactor.setInfo("The thoracic cavity is equipped with a small chamber designed " + - "to hold and sustain hydrogen plasma. The plasma is used to generate " + + "to hold and sustain hydrogen plasma. The plasma is used to generate " + "fusion power through nuclear fusion, providing limitless amount of clean " + - "energy for the body.
" + + "energy for the body.
" + "This augmentation:
" + - "Increases all of the player's combat stats by 35%
" + + "Increases all of the player's combat stats by 35%
" + "Increases all of the player's combat stat experience gain rate by 35%"); CordiARCReactor.setRequirements(450000, 1000000000); CordiARCReactor.addToFactions(["MegaCorp"]); @@ -1092,16 +1092,16 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CordiARCReactor]; } AddToAugmentations(CordiARCReactor); - + //BachmanAndAssociates var SmartJaw = new Augmentation(AugmentationNames.SmartJaw); - SmartJaw.setInfo("A bionic jaw that contains advanced hardware and software " + + SmartJaw.setInfo("A bionic jaw that contains advanced hardware and software " + "capable of psychoanalyzing and profiling the personality of " + - "others using optical imaging software.
" + - "This augmentation:
" + - "Increases the player's charisma by 50%.
" + - "Increases the player's charisma experience gain rate by 50%
" + - "Increases the amount of reputation the player gains for a company by 25%
" + + "others using optical imaging software.
" + + "This augmentation:
" + + "Increases the player's charisma by 50%.
" + + "Increases the player's charisma experience gain rate by 50%
" + + "Increases the amount of reputation the player gains for a company by 25%
" + "Increases the amount of reputation the player gains for a faction by 25%"); SmartJaw.setRequirements(150000, 550000000); SmartJaw.addToFactions(["Bachman & Associates"]); @@ -1109,13 +1109,13 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SmartJaw]; } AddToAugmentations(SmartJaw); - + //BladeIndustries var Neotra = new Augmentation(AugmentationNames.Neotra); - Neotra.setInfo("A highly-advanced techno-organic drug that is injected into the skeletal " + - "and integumentary system. The drug permanently modifies the DNA of the " + + Neotra.setInfo("A highly-advanced techno-organic drug that is injected into the skeletal " + + "and integumentary system. The drug permanently modifies the DNA of the " + "body's skin and bone cells, granting them the ability to repair " + - "and restructure themselves.
" + + "and restructure themselves.
" + "This augmentation increases the player's strength and defense by 55%"); Neotra.setRequirements(225000, 575000000); Neotra.addToFactions(["Blade Industries"]); @@ -1123,14 +1123,14 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Neotra]; } AddToAugmentations(Neotra); - - //NWO + + //NWO var Xanipher = new Augmentation(AugmentationNames.Xanipher); Xanipher.setInfo("A concoction of advanced nanobots that is orally ingested into the " + - "body. These nanobots induce physiological change and significantly " + - "improve the body's functionining in all aspects.
" + - "This augmentation:
" + - "Increases all of the player's stats by 20%
" + + "body. These nanobots induce physiological change and significantly " + + "improve the body's functionining in all aspects.
" + + "This augmentation:
" + + "Increases all of the player's stats by 20%
" + "Increases the player's experience gain rate for all stats by 15%"); Xanipher.setRequirements(350000, 850000000); Xanipher.addToFactions(["NWO"]); @@ -1138,27 +1138,27 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Xanipher]; } AddToAugmentations(Xanipher); - + //ClarkeIncorporated var nextSENS = new Augmentation(AugmentationNames.nextSENS); - nextSENS.setInfo("The body is genetically re-engineered to maintain a state " + - "of negligible senescence, preventing the body from " + - "deteriorating with age.
" + + nextSENS.setInfo("The body is genetically re-engineered to maintain a state " + + "of negligible senescence, preventing the body from " + + "deteriorating with age.
" + "This augmentation increases all of the player's stats by 20%"); - nextSENS.setRequirements(175000, 385000000); + nextSENS.setRequirements(175000, 385000000); nextSENS.addToFactions(["Clarke Incorporated"]); if (augmentationExists(AugmentationNames.nextSENS)) { delete Augmentations[AugmentationNames.nextSENS]; } - AddToAugmentations(nextSENS); - + AddToAugmentations(nextSENS); + //OmniTekIncorporated var OmniTekInfoLoad = new Augmentation(AugmentationNames.OmniTekInfoLoad); - OmniTekInfoLoad.setInfo("OmniTek's data and information repository is uploaded " + + OmniTekInfoLoad.setInfo("OmniTek's data and information repository is uploaded " + "into your brain, enhancing your programming and " + - "hacking abilities.
" + - "This augmentation:
" + - "Increases the player's hacking skill by 20%
" + + "hacking abilities.
" + + "This augmentation:
" + + "Increases the player's hacking skill by 20%
" + "Increases the player's hacking experience gain rate by 25%"); OmniTekInfoLoad.setRequirements(250000, 575000000) OmniTekInfoLoad.addToFactions(["OmniTek Incorporated"]); @@ -1166,16 +1166,16 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.OmniTekInfoLoad]; } AddToAugmentations(OmniTekInfoLoad); - + //FourSigma //TODO Later when Intelligence is added in . Some aug that greatly increases int - + //KuaiGongInternational var PhotosyntheticCells = new Augmentation(AugmentationNames.PhotosyntheticCells); - PhotosyntheticCells.setInfo("Chloroplasts are added to epidermal stem cells and are applied " + - "to the body using a skin graft. The result is photosynthetic " + - "skin cells, allowing users to generate their own energy " + - "and nutrition using solar power.
" + + PhotosyntheticCells.setInfo("Chloroplasts are added to epidermal stem cells and are applied " + + "to the body using a skin graft. The result is photosynthetic " + + "skin cells, allowing users to generate their own energy " + + "and nutrition using solar power.
" + "This augmentation increases the player's strength, defense, and agility by 40%"); PhotosyntheticCells.setRequirements(225000, 550000000); PhotosyntheticCells.addToFactions(["KuaiGong International"]); @@ -1183,17 +1183,17 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.PhotosyntheticCells]; } AddToAugmentations(PhotosyntheticCells); - + //BitRunners var Neurolink = new Augmentation(AugmentationNames.Neurolink); - Neurolink.setInfo("A brain implant that provides a high-bandwidth, direct neural link between your " + + Neurolink.setInfo("A brain implant that provides a high-bandwidth, direct neural link between your " + "mind and BitRunners' data servers, which reportedly contain " + - "the largest database of hacking tools and information in the world.
" + - "This augmentation:
" + - "Increases the player's hacking skill by 15%
" + - "Increases the player's hacking experience gain rate by 20%
" + + "the largest database of hacking tools and information in the world.
" + + "This augmentation:
" + + "Increases the player's hacking skill by 15%
" + + "Increases the player's hacking experience gain rate by 20%
" + "Increases the player's chance of successfully performing a hack by 10%
" + - "Increases the player's hacking speed by 5%
" + + "Increases the player's hacking speed by 5%
" + "Lets the player start with the FTPCrack.exe and relaySMTP.exe programs after a reset"); Neurolink.setRequirements(350000, 875000000); Neurolink.addToFactions(["BitRunners"]); @@ -1201,17 +1201,17 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Neurolink]; } AddToAugmentations(Neurolink); - + //BlackHand var TheBlackHand = new Augmentation(AugmentationNames.TheBlackHand); TheBlackHand.setInfo("A highly advanced bionic hand. This prosthetic not only " + - "enhances strength and dexterity but it is also embedded " + - "with hardware and firmware that lets the user connect to, access and hack " + - "devices and machines just by touching them.
" + - "This augmentation:
" + - "Increases the player's strength and dexterity by 15%
" + - "Increases the player's hacking skill by 10%
" + - "Increases the player's hacking speed by 2%
" + + "enhances strength and dexterity but it is also embedded " + + "with hardware and firmware that lets the user connect to, access and hack " + + "devices and machines just by touching them.
" + + "This augmentation:
" + + "Increases the player's strength and dexterity by 15%
" + + "Increases the player's hacking skill by 10%
" + + "Increases the player's hacking speed by 2%
" + "Increases the amount of money the player gains from hacking by 10%"); TheBlackHand.setRequirements(40000, 110000000); TheBlackHand.addToFactions(["The Black Hand"]); @@ -1219,14 +1219,14 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.TheBlackHand]; } AddToAugmentations(TheBlackHand); - + //NiteSec var CRTX42AA = new Augmentation(AugmentationNames.CRTX42AA); - CRTX42AA.setInfo("The CRTX42-AA gene is injected into the genome. " + + CRTX42AA.setInfo("The CRTX42-AA gene is injected into the genome. " + "The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal " + - "cortex and improves cognitive abilities.
" + - "This augmentation:
" + - "Improves the player's hacking skill by 8%
" + + "cortex and improves cognitive abilities.
" + + "This augmentation:
" + + "Improves the player's hacking skill by 8%
" + "Improves the player's hacking experience gain rate by 15%"); CRTX42AA.setRequirements(18000, 45000000); CRTX42AA.addToFactions(["NiteSec"]); @@ -1234,12 +1234,12 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CRTX42AA]; } AddToAugmentations(CRTX42AA); - + //Chongqing var Neuregen = new Augmentation(AugmentationNames.Neuregen); Neuregen.setInfo("A drug that genetically modifies the neurons in the brain. " + - "The result is that these neurons never die and continuously " + - "regenerate and strengthen themselves.
" + + "The result is that these neurons never die and continuously " + + "regenerate and strengthen themselves.
" + "This augmentation increases the player's hacking experience gain rate by 40%"); Neuregen.setRequirements(15000, 75000000); Neuregen.addToFactions(["Chongqing"]); @@ -1247,14 +1247,14 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.Neuregen]; } AddToAugmentations(Neuregen); - + //Sector12 var CashRoot = new Augmentation(AugmentationNames.CashRoot); - CashRoot.setInfo("A collection of digital assets saved on a small chip. The chip is implanted " + + CashRoot.setInfo("A collection of digital assets saved on a small chip. The chip is implanted " + "into your wrist. A small jack in the chip allows you to connect it to a computer " + - "and upload the assets.
" + - "This augmentation:
" + - "Lets the player start with $1,000,000 after a reset
" + + "and upload the assets.
" + + "This augmentation:
" + + "Lets the player start with $1,000,000 after a reset
" + "Lets the player start with the BruteSSH.exe program after a reset"); CashRoot.setRequirements(5000, 25000000); CashRoot.addToFactions(["Sector-12"]); @@ -1262,14 +1262,14 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.CashRoot]; } AddToAugmentations(CashRoot); - + //NewTokyo var NutriGen = new Augmentation(AugmentationNames.NutriGen); - NutriGen.setInfo("A thermo-powered artificial nutrition generator. Endogenously " + + NutriGen.setInfo("A thermo-powered artificial nutrition generator. Endogenously " + "synthesizes glucose, amino acids, and vitamins and redistributes them " + - "across the body. The device is powered by the body's naturally wasted " + - "energy in the form of heat.
" + - "This augmentation:
" + + "across the body. The device is powered by the body's naturally wasted " + + "energy in the form of heat.
" + + "This augmentation:
" + "Increases the player's experience gain rate for all combat stats by 20%"); NutriGen.setRequirements(2500, 500000); NutriGen.addToFactions(["New Tokyo"]); @@ -1277,18 +1277,18 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.NutriGen]; } AddToAugmentations(NutriGen); - + //Aevum //TODO Later Something that lets you learn advanced math...this increases int //and profits as a trader/from trading - + //Ishima var INFRARet = new Augmentation(AugmentationNames.INFRARet); - INFRARet.setInfo("A retina implant consisting of a tiny chip that sits behind the " + - "retina. This implant lets people visually detect infrared radiation.
" + + INFRARet.setInfo("A retina implant consisting of a tiny chip that sits behind the " + + "retina. This implant lets people visually detect infrared radiation.
" + "This augmentation:
" + "Increases the player's crime success rate by 25%
" + - "Increases the amount of money the player gains from crimes by 10%
" + + "Increases the amount of money the player gains from crimes by 10%
" + "Increases the player's dexterity by 10%"); INFRARet.setRequirements(3000, 6000000); INFRARet.addToFactions(["Ishima"]); @@ -1296,12 +1296,12 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.INFRARet]; } AddToAugmentations(INFRARet); - + //Volhaven var DermaForce = new Augmentation(AugmentationNames.DermaForce); DermaForce.setInfo("A synthetic skin is grafted onto the body. The skin consists of " + "millions of nanobots capable of projecting high-density muon beams, " + - "creating an energy barrier around the user.
" + + "creating an energy barrier around the user.
" + "This augmentation increases the player's defense by 50%"); DermaForce.setRequirements(6000, 10000000); DermaForce.addToFactions(["Volhaven"]); @@ -1309,15 +1309,15 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.DermaForce]; } AddToAugmentations(DermaForce); - + //SpeakersForTheDead var GrapheneBrachiBlades = new Augmentation(AugmentationNames.GrapheneBrachiBlades); - GrapheneBrachiBlades.setInfo("An upgrade to the BrachiBlades augmentation. It infuses " + - "the retractable blades with an advanced graphene material " + - "to make them much stronger and lighter.
" + - "This augmentation:
" + + GrapheneBrachiBlades.setInfo("An upgrade to the BrachiBlades augmentation. It infuses " + + "the retractable blades with an advanced graphene material " + + "to make them much stronger and lighter.
" + + "This augmentation:
" + "Increases the player's strength and defense by 40%
" + - "Increases the player's crime success rate by 10%
" + + "Increases the player's crime success rate by 10%
" + "Increases the amount of money the player gains from crimes by 30%"); GrapheneBrachiBlades.setRequirements(90000, 500000000); GrapheneBrachiBlades.addToFactions(["Speakers for the Dead"]); @@ -1325,12 +1325,12 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.GrapheneBrachiBlades]; } AddToAugmentations(GrapheneBrachiBlades); - + //DarkArmy var GrapheneBionicArms = new Augmentation(AugmentationNames.GrapheneBionicArms); - GrapheneBionicArms.setInfo("An upgrade to the Bionic Arms augmentation. It infuses the " + - "prosthetic arms with an advanced graphene material " + - "to make them much stronger and lighter.
" + + GrapheneBionicArms.setInfo("An upgrade to the Bionic Arms augmentation. It infuses the " + + "prosthetic arms with an advanced graphene material " + + "to make them much stronger and lighter.
" + "This augmentation increases the player's strength and dexterity by 85%"); GrapheneBionicArms.setRequirements(200000, 750000000); GrapheneBionicArms.addToFactions(["The Dark Army"]); @@ -1338,13 +1338,13 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.GrapheneBionicArms]; } AddToAugmentations(GrapheneBionicArms); - + //TheSyndicate var BrachiBlades = new Augmentation(AugmentationNames.BrachiBlades); BrachiBlades.setInfo("A set of retractable plasteel blades are implanted in the arm, underneath the skin. " + - "
This augmentation:
" + - "Increases the player's strength and defense by 15%
" + - "Increases the player's crime success rate by 10%
" + + "
This augmentation:
" + + "Increases the player's strength and defense by 15%
" + + "Increases the player's crime success rate by 10%
" + "Increases the amount of money the player gains from crimes by 15%"); BrachiBlades.setRequirements(5000, 18000000); BrachiBlades.addToFactions(["The Syndicate"]); @@ -1352,11 +1352,11 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.BrachiBlades]; } AddToAugmentations(BrachiBlades); - + //Tetrads var BionicArms = new Augmentation(AugmentationNames.BionicArms); - BionicArms.setInfo("Cybernetic arms created from plasteel and carbon fibers that completely replace " + - "the user's organic arms.
" + + BionicArms.setInfo("Cybernetic arms created from plasteel and carbon fibers that completely replace " + + "the user's organic arms.
" + "This augmentation increases the user's strength and dexterity by 30%"); BionicArms.setRequirements(25000, 55000000); BionicArms.addToFactions(["Tetrads"]); @@ -1364,14 +1364,14 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.BionicArms]; } AddToAugmentations(BionicArms); - + //TianDiHui var SNA = new Augmentation(AugmentationNames.SNA); SNA.setInfo("A cranial implant that affects the user's personality, making them better " + - "at negotiation in social situations.
" + - "This augmentation:
" + - "Increases the amount of money the player earns at a company by 10%
" + - "Increases the amount of reputation the player gains when working for a " + + "at negotiation in social situations.
" + + "This augmentation:
" + + "Increases the amount of money the player earns at a company by 10%
" + + "Increases the amount of reputation the player gains when working for a " + "company or faction by 15%"); SNA.setRequirements(2500, 6000000); SNA.addToFactions(["Tian Di Hui"]); @@ -1379,7 +1379,7 @@ initAugmentations = function() { delete Augmentations[AugmentationNames.SNA]; } AddToAugmentations(SNA); - + //Update costs based on how many have been purchased var mult = Math.pow(CONSTANTS.MultipleAugMultiplier, Player.queuedAugmentations.length); for (var name in Augmentations) { @@ -1387,11 +1387,23 @@ initAugmentations = function() { Augmentations[name].baseCost *= mult; } } - + Player.reapplyAllAugmentations(); + + //In BitNode-2, these crime/evil factions have all AugmentationsAvailable + if (Player.bitNodeN == 2) { + console.log("Adding all augmentations to crime factions for Bit node 2"); + Factions["Slum Snakes"].addAllAugmentations(); + Factions["Tetrads"].addAllAugmentations(); + Factions["The Syndicate"].addAllAugmentations(); + Factions["The Dark Army"].addAllAugmentations(); + Factions["Speakers for the Dead"].addAllAugmentations(); + Factions["NiteSec"].addAllAugmentations(); + Factions["The Black Hand"].addAllAugmentations(); + } } -applyAugmentation = function(aug, reapply=false) { +applyAugmentation = function(aug, reapply=false) { Augmentations[aug.name].owned = true; switch(aug.name) { //Combat stat augmentations @@ -1457,7 +1469,7 @@ applyAugmentation = function(aug, reapply=false) { case AugmentationNames.GrapheneBionicLegs: //High level Player.agility_mult *= 2.75; break; - + //Labor stats augmentations case AugmentationNames.EnhancedSocialInteractionImplant: //Med-high level Player.charisma_mult *= 1.6; @@ -1595,7 +1607,7 @@ applyAugmentation = function(aug, reapply=false) { case AugmentationNames.PCDNIOptimizer: //High level Player.company_rep_mult *= 1.75; Player.hacking_mult *= 1.1; - break; + break; case AugmentationNames.PCDNINeuralNetwork: //High level Player.company_rep_mult *= 2; Player.hacking_mult *= 1.1; @@ -1605,7 +1617,7 @@ applyAugmentation = function(aug, reapply=false) { Player.company_rep_mult *= 1.1; Player.faction_rep_mult *= 1.1; break; - + //Hacknet Node Augmentations case AugmentationNames.HacknetNodeCPUUpload: Player.hacknet_node_money_mult *= 1.15; @@ -1625,7 +1637,7 @@ applyAugmentation = function(aug, reapply=false) { case AugmentationNames.HacknetNodeCoreDNI: Player.hacknet_node_money_mult *= 1.45; break; - + //Misc augmentations case AugmentationNames.NeuroFluxGovernor: Player.hacking_chance_mult *= 1.01; @@ -1660,7 +1672,7 @@ applyAugmentation = function(aug, reapply=false) { Player.hacknet_node_level_cost_mult *= 0.99; Player.work_money_mult *= 1.01; - + if (!reapply) { Augmentations[aug.name].level = aug.level; for (var i = 0; i < Player.augmentations.length; ++i) { @@ -1670,7 +1682,7 @@ applyAugmentation = function(aug, reapply=false) { } } } - break; + break; case AugmentationNames.Neurotrainer1: //Low Level Player.hacking_exp_mult *= 1.1; Player.strength_exp_mult *= 1.1; @@ -1877,7 +1889,7 @@ applyAugmentation = function(aug, reapply=false) { } } } - + if (!reapply) { var ownedAug = new PlayerOwnedAugmentation(aug.name); Player.augmentations.push(ownedAug); @@ -1906,47 +1918,17 @@ function installAugmentations() { } Player.queuedAugmentations = []; dialogBoxCreate("You slowly drift to sleep as scientists put you under in order " + - "to install the following Augmentations:
" + augmentationList + + "to install the following Augmentations:
" + augmentationList + "
You wake up in your home...you feel different..."); prestigeAugmentation(); } -PlayerObject.prototype.reapplyAllAugmentations = function() { +PlayerObject.prototype.reapplyAllAugmentations = function(resetMultipliers=true) { console.log("Re-applying augmentations"); - //Reset multipliers - this.hacking_chance_mult = 1; //Increase through ascensions/augmentations - this.hacking_speed_mult = 1; //Decrease through ascensions/augmentations - this.hacking_money_mult = 1; //Increase through ascensions/augmentations. Can't go above 1 - this.hacking_grow_mult = 1; - - this.hacking_mult = 1; - this.strength_mult = 1; - this.defense_mult = 1; - this.dexterity_mult = 1; - this.agility_mult = 1; - this.charisma_mult = 1; - - this.hacking_exp_mult = 1; - this.strength_exp_mult = 1; - this.defense_exp_mult = 1; - this.dexterity_exp_mult = 1; - this.agility_exp_mult = 1; - this.charisma_exp_mult = 1; - - this.company_rep_mult = 1; - this.faction_rep_mult = 1; - - this.crime_money_mult = 1; - this.crime_success_mult = 1; - - this.hacknet_node_money_mult = 1; - this.hacknet_node_purchase_cost_mult = 1; - this.hacknet_node_ram_cost_mult = 1; - this.hacknet_node_core_cost_mult = 1; - this.hacknet_node_level_cost_mult = 1; - - this.work_money_mult = 1; - + if (resetMultipliers) { + this.resetMultipliers(); + } + for (i = 0; i < this.augmentations.length; ++i) { //Compatibility with new version if (typeof this.augmentations[i] === 'string' || this.augmentations[i] instanceof String) { @@ -1956,7 +1938,7 @@ PlayerObject.prototype.reapplyAllAugmentations = function() { } this.augmentations[i] = newOwnedAug; } - + var augName = this.augmentations[i].name; var aug = Augmentations[augName]; aug.owned = true; @@ -1987,4 +1969,4 @@ function giveAllAugmentations() { Player.augmentations.push(ownedAug); } Player.reapplyAllAugmentations(); -} \ No newline at end of file +} diff --git a/src/BitNode.js b/src/BitNode.js index a94a2284da..9dda228afc 100644 --- a/src/BitNode.js +++ b/src/BitNode.js @@ -1,8 +1,37 @@ /* BitNode.js */ BitNodes = { - BitNode1: new BitNode(1, "Source Genesis", "The original BitNode"), - BitNode2: new BitNode(2, "Rise of the Underworld", "COMING SOON"), //Gangs + 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%"), + 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 2050's. 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:
The maximum amount of money available on a server is significantly decreased
" + + "The amount of money gained from crimes is doubled
" + + "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 the 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 increases the player's crime success rate, " + + "crime money, and charisma multipliers by:
" + + "Level 1: 20%
" + + "Level 2: 30%
" + + "Level 3: 35%"), BitNode3: new BitNode(3, "The Price of Civilization", "COMING SOON"), //Corporate Warfare, Run own company BitNode4: new BitNode(4, "The Singularity", "COMING SOON"), //Everything automatable BitNode5: new BitNode(5, "2084", "COMING SOON"), //Big Brother @@ -20,4 +49,36 @@ function BitNode(n, name, desc="", info="") { this.name = name; this.desc = desc; this.info = info; -} \ No newline at end of file +} + +BitNodeMultipliers = { + ServerMaxMoney: 1, + CrimeMoney: 1, + FactionWorkRepGain: 1, + FactionPassiveRepGain: 1, +} + +function initBitNodeMultipliers() { + if (Player.bitNodeN == null) { + Player.bitNodeN = 1; + } + for (var mult in BitNodeMultipliers) { + if (BitNodeMultipliers.hasOwnProperty(mult)) { + BitNodeMultipliers[mult] = 1; + } + } + + switch (Player.bitNodeN) { + case 1: + break; + case 2: //Rise of the Underworld + BitNodeMultipliers.ServerMaxMoney = 0.2; + BitNodeMultipliers.CrimeMoney = 2; + BitNodeMultipliers.FactionWorkRepGain = 0.5; + BitNodeMultipliers.FactionPassiveRepGain = 0; + break; + default: + console.log("WARNING: Player.bitNodeN invalid"); + break; + } +} diff --git a/src/Company.js b/src/Company.js index 86ff4a9551..072b5bcd25 100644 --- a/src/Company.js +++ b/src/Company.js @@ -1,7 +1,7 @@ //Netburner Company class // Note: Company Positions can be loaded every time with init() but Company class needs // to be saved/loaded from localStorage -function Company(name, salaryMult, expMult, jobStatReqOffset) { +function Company(name="", salaryMult=0, expMult=0, jobStatReqOffset=0) { this.companyName = name; this.info = ""; this.companyPositions = []; //Names (only name, not object) of all company positions @@ -19,6 +19,7 @@ function Company(name, salaryMult, expMult, jobStatReqOffset) { this.playerPosition = ""; //Name (only name, not object) of the current position player holds this.playerReputation = 1; //"Reputation" within company, gain reputation by working for company this.favor = 0; + this.rolloverRep = 0; }; Company.prototype.setInfo = function(inf) { @@ -46,7 +47,32 @@ Company.prototype.hasPosition = function(pos) { Company.prototype.gainFavor = function() { if (this.favor == null || this.favor == undefined) {this.favor = 0;} - this.favor += Math.max(0, (this.playerReputation-1) / CONSTANTS.CompanyReputationToFavor); + if (this.rolloverRep == null || this.rolloverRep == undefined) {this.rolloverRep = 0;} + var res = this.getFavorGain(); + if (res.length != 2) { + console.log("Error: invalid result from getFavorGain() function"); + return; + } + this.favor += res[0]; + this.rolloverRep = res[1]; +} + +Company.prototype.getFavorGain = function() { + if (this.favor == null || this.favor == undefined) {this.favor = 0;} + if (this.rolloverRep == null || this.rolloverRep == undefined) {this.rolloverRep = 0;} + var favorGain = 0, rep = this.playerReputation + this.rolloverRep; + var reqdRep = CONSTANTS.CompanyReputationToFavorBase * + Math.pow(CONSTANTS.CompanyReputationToFavorMult, this.favor); + while(rep > 0) { + if (rep >= reqdRep) { + ++favorGain; + rep -= reqdRep; + } else { + break; + } + reqdRep *= CONSTANTS.FactionReputationToFavorMult; + } + return [favorGain, rep]; } Company.prototype.toJSON = function() { diff --git a/src/CompanyJobApplication.js b/src/CompanyJobApplication.js index 255148296c..a1be49b8c8 100644 --- a/src/CompanyJobApplication.js +++ b/src/CompanyJobApplication.js @@ -24,13 +24,7 @@ PlayerObject.prototype.applyForJob = function(entryPosType) { while (true) { if (Engine.Debug) {console.log("Determining qualification for next Company Position");} var newPos = getNextCompanyPosition(pos); - - if (newPos == null) { - if (Engine.Debug) { - console.log("Player already at highest position, cannot go any higher"); - } - break; - } + if (newPos == null) {break;} //Check if this company has this position if (company.hasPosition(newPos)) { @@ -42,7 +36,6 @@ PlayerObject.prototype.applyForJob = function(entryPosType) { } else { break; } - } //Check if the determined job is the same as the player's current job @@ -50,9 +43,14 @@ PlayerObject.prototype.applyForJob = function(entryPosType) { if (currCompany.companyName == company.companyName && pos.positionName == currPositionName) { var nextPos = getNextCompanyPosition(pos); - var reqText = getJobRequirementText(company, nextPos); - dialogBoxCreate("Unfortunately, you do not qualify for a promotion
" + reqText); - + if (nextPos == null) { + dialogBoxCreate("You are already at the highest position for your field! No promotion available"); + } else if (company.hasPosition(nextPos)) { + var reqText = getJobRequirementText(company, nextPos); + dialogBoxCreate("Unfortunately, you do not qualify for a promotion
" + reqText); + } else { + dialogBoxCreate("You are already at the highest position for your field! No promotion available"); + } return; //Same job, do nothing } } @@ -167,10 +165,7 @@ PlayerObject.prototype.applyForItJob = function() { PlayerObject.prototype.applyForSecurityEngineerJob = function() { var company = Companies[this.location]; //Company being applied to if (this.isQualified(company, CompanyPositions.SecurityEngineer)) { - this.companyName = company.companyName; - this.companyPosition = CompanyPositions.SecurityEngineer; - dialogBoxCreate("Congratulations, you were offered a position at " + this.companyName + " as a Security Engineer!"); - Engine.loadLocationContent(); + this.applyForJob(CompanyPositions.SecurityEngineer); } else { dialogBoxCreate("Unforunately, you do not qualify for this position"); } diff --git a/src/CompanyManagement.js b/src/CompanyManagement.js new file mode 100644 index 0000000000..2a61e54068 --- /dev/null +++ b/src/CompanyManagement.js @@ -0,0 +1,8 @@ +/* CompanyManagement.js */ + +/* +Company made up of + + + +*/ diff --git a/src/Constants.js b/src/Constants.js index 9059651606..5b3bebe63d 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -1,5 +1,5 @@ CONSTANTS = { - Version: "0.26.4", + Version: "0.27.0", //Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience //and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then @@ -29,8 +29,11 @@ CONSTANTS = { HacknetNodeMaxCores: 16, /* Faction and Company favor */ - FactionReputationToFavor: 6500, - CompanyReputationToFavor: 6000, + FactionReputationToFavorBase: 500, + FactionReputationToFavorMult: 1.02, + CompanyReputationToFavorBase: 500, + CompanyReputationToFavorMult: 1.02, + /* Augmentation */ //NeuroFlux Governor cost multiplier as you level up @@ -53,6 +56,7 @@ CONSTANTS = { ScriptRunRamCost: 0.8, ScriptExecRamCost: 1.1, ScriptScpRamCost: 0.5, + ScriptKillRamCost: 0.5, //Kill and killall ScriptHasRootAccessRamCost: 0.05, ScriptGetHostnameRamCost: 0.05, ScriptGetHackingLevelRamCost: 0.05, @@ -70,6 +74,8 @@ CONSTANTS = { ScriptPurchaseServerRamCost: 2.0, ScriptRoundRamCost: 0.05, ScriptReadWriteRamCost: 1.0, + ScriptArbScriptRamCost: 1.0, //Functions that apply to all scripts regardless of args + ScriptGetScriptCost: 0.1, MultithreadingRAMCost: 1, @@ -101,6 +107,12 @@ CONSTANTS = { //Hospital/Health HospitalCostPerHp: 100000, + //Gang constants + GangRespectToReputationRatio: 2, //Respect is divided by this to get rep gain + MaximumGangMembers: 20, + GangRecruitCostMultiplier: 2, + GangTerritoryUpdateTimer: 150, + MillisecondsPer20Hours: 72000000, GameCyclesPer20Hours: 72000000 / 200, @@ -170,8 +182,6 @@ CONSTANTS = { CrimeHeist: "pull off the ultimate heist", /* Tutorial related things */ - TutorialGettingStartedText: "Todo...", - TutorialNetworkingText: "Servers are a central part of the game. You start with a single personal server (your home computer) " + "and you can purchase additional servers as you progress through the game. Connecting to other servers " + "and hacking them can be a major source of income and experience. Servers can also be used to run " + @@ -325,7 +335,11 @@ CONSTANTS = { " <=
" + " >=
" + " ==
" + - " !=
" + + " !=
" + + " ++ (Note: This ONLY pre-increments. Post-increment does not work)
" + + " -- (Note: This ONLY pre-decrements. Post-decrement does not work)
" + + " - (Negation operator)
" + + " !
" + "
Arrays
" + "Netscript arrays have the same properties and functions as javascript arrays. For information see javascripts array documentation.
"+ "
Script Arguments
" + @@ -672,68 +686,19 @@ CONSTANTS = { "World Stock Exchange account and TIX API Access
", LatestUpdate: - "v0.26.4
" + - "-All of the 'low-level servers' in early game that have a required hacking level now have 8GB of RAM " + - "instead of 4GB
" + - "-Increased the amount of experience given at university
" + - "-Slightly increased the production of Hacknet Nodes and made them cheaper to upgrade
" + - "-Infiltration now gives slightly more EXP and faction reputation
" + - "-Added two new crimes. These crimes are viable to attempt early on in the game and are relatively passive (each take 60+ seconds to complete)
" + - "-Crimes give more exp and more money
" + - "-Max money available on a server decreased from 50x the server's starting money to 25x
" + - "-Significantly increased wages for all jobs
" + - "v0.26.3
" + - "-Added support for large numbers using Decimal.js. Right now it only applies for the player's money
" + - "-Purchasing servers with the Netscript function purchaseServer() is no longer 2x as expensive as doing manually, " + - "it now costs the same
" + - "-Early game servers have more starting money
" + - "v0.26.2
" + - "-Major rebalancing and randomization of the amount of money that servers start with
" + - "-Significantly lowered hacking exp gain from hacking servers. The exp gain for higher-level servers was lowered more than " + - "that of low level servers. (~16% for lower level servers, up to ~25% for higher-level servers)
" + - "-Added deleteServer() Netscript function
" + - "-You can now purchase a maximum of 25 servers each run (Deleting a server will allow you to purchase a new one)
" + - "-Added autocompletion for './' Terminal command
" + - "-Darkweb prices now displayed properly using toLocaleString()
" + - "-Added NOT operator (!) and negation operator(-), so negative numbers should be functional now
" + - "-Rejected faction invitations will now show up as 'Outstanding Faction Invites' in the Factions page. These " + - "can be accepted at any point in the future
" + - "-Added a few more configurable game settings for suppressing messages and faction invitations
" + - "-Added tooltips for company job requirements
" + - "v0.26.1
" + - "-Added autocompletion for aliases
" + - "-Added getServerRam() Netscript function()
" + - "-Added getLevelUpgradeCost(n), getRamUpgradeCost(), getCoreUpgradeCost() functions for Netscript Hacknet Node API
" + - "-Added some configurable settings (See Game Options menu)
" + - "v0.26.0
" + - "-Game now has a real ending, although it's not very interesting/satisfying right now. It sets up the framework for the secondary prestige system " + - "in the future
" + - "-Forgot to mention that since last update, comments now work in Netscript. Use // for single line comments or /* and */ for multiline comments " + - "just like in Javascript
" + - "-Added ports to Netscript. These ports are essentially serialized queues. You can use the write() Netscript function to write a value " + - "to a queue, and then you can use the read() Netscript function to read the value from the queue. Once you read a value from the queue it will be " + - "removed. There are only 10 queues (1-10), and each has a maximum capacity of 50 entries. If you try to write to a queue that is full, the " + - "the first value is removed. See wiki/Netscript documentation for more details
" + - "-You can now use the 'help' Terminal command for specific commands
" + - "-You can now use './' to run a script/program (./NUKE.exe). However, tab completion currently doesn't work for it (I'm working on it)
" + - "-Decreased the base growth rate of servers by ~25%
" + - "-Both the effect of weaken() and its time to execute were halved. In other words, calling weaken() on a server only lowers its security by 0.05 (was 0.1 before) " + - "but the time to execute the function is half of what it was before. Therefore, the effective rate of weaken() should be about the same
" + - "-Increased all Infiltration rewards by ~10%, and increased infiltration rep gains by an additional 20% (~32% total for rep gains)
" + - "-The rate at which the security level of a facility increases during Infiltration was decreased significantly (~33%)
" + - "-Getting treated at the Hospital is now 33% more expensive
" + - "-Slightly increased the amount of time it takes to hack a server
" + - "-Slightly decreased the amount of money gained when hacking a server (~6%)
" + - "-Slightly decreased the base cost for RAM on home computer, but increased the cost multiplier. This means " + - "that upgrading RAM on the home computer should be slightly cheaper at the start, but slightly more expensive " + - "later on
" + - "-Increased the required hacking level for many late game servers
" + - "-The sleep() Netscript function now takes an optional 'log' argument that specifies whether or " + - "not the 'Sleeping for N milliseconds' will be logged for the script
" + - "-Added clearLog() Netscript function
" + - "-Deleted a few stocks. Didn't see a reason for having so many, and it just affects performance. Won't take " + - "effect until you reset by installing Augmentations
" + - "-There was a typo with Zeus Medical's server hostname. It is now 'zeus-med' rather than 'zeud-med'
" + - "-Added keyboard shortcuts to quickly navigate between different menus. See wiki link here
" + - "-Changed the Navigation Menu UI", + "v0.27.0
" + + "-Added secondary 'prestige' system - featuring Source Files and BitNodes
" + + "-MILD SPOILERS HERE: Installing 'The Red Pill' Augmentation from Daedalus will unlock a special server called " + + "w0r1d_d43m0n. Finding and manually hacking this server through Terminal will destroy the Player's current BitNode, and allow the player " + + "to enter a new one. When destroying a BitNode, the player loses everything except the scripts on his/her " + + "home computer. The player will then gain a powerful second-tier persistent upgrade called a Source File. The player can then " + + "enter a new BitNode to start the game over. Each BitNode has different characteristics, and many will have new content/mechanics " + + "as well. Right now there are only 2 BitNodes. Each BitNode grants its own unique Source File. Restarting and destroying a BitNode you already " + + "have a Source File for will upgrade your Source File up to a maximum level of 3.
" + + "-Reputation gain with factions and companies is no longer a linear conversion, but an exponential one. It " + + "will be much easier to gain faction favor at first, but much harder later on.
" + + "-Significantly increased Infiltration exp gains
" + + "-Fixed a bug with company job requirement tooltips
" + + "-Added scriptRunning(), scriptKill(), and getScriptRam() Netscript functions. See documentation for details
" + + "-Fixed a bug with deleteServer() Netscript function
" } diff --git a/src/Faction.js b/src/Faction.js index 45a7e0c9aa..d94b1a5ffa 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -16,7 +16,7 @@ function factionInit() { } document.addEventListener("DOMContentLoaded", factionInit, false); -function Faction(name) { +function Faction(name="") { this.name = name; this.augmentations = []; //Name of augmentation only this.info = ""; //Introductory/informational text about the faction @@ -33,6 +33,7 @@ function Faction(name) { //Faction favor this.favor = 0; + this.rolloverRep = 0; }; Faction.prototype.setAugmentationMultipliers = function(price, rep) { @@ -46,8 +47,43 @@ Faction.prototype.setInfo = function(inf) { Faction.prototype.gainFavor = function() { if (this.favor == null || this.favor == undefined) {this.favor = 0;} - var gain = (this.playerReputation / CONSTANTS.FactionReputationToFavor); - this.favor += gain; + if (this.rolloverRep == null || this.rolloverRep == undefined) {this.rolloverRep = 0;} + var res = this.getFavorGain(); + if (res.length != 2) { + console.log("Error: invalid result from getFavorGain() function"); + return; + } + this.favor += res[0]; + this.rolloverRep = res[1]; +} + +//Returns an array with [How much favor would be gained, how much favor would be left over] +Faction.prototype.getFavorGain = function() { + if (this.favor == null || this.favor == undefined) {this.favor = 0;} + if (this.rolloverRep == null || this.rolloverRep == undefined) {this.rolloverRep = 0;} + var favorGain = 0, rep = this.playerReputation + this.rolloverRep; + var reqdRep = CONSTANTS.FactionReputationToFavorBase * + Math.pow(CONSTANTS.FactionReputationToFavorMult, this.favor); + while(rep > 0) { + if (rep >= reqdRep) { + ++favorGain; + rep -= reqdRep; + } else { + break; + } + reqdRep *= CONSTANTS.FactionReputationToFavorMult; + } + return [favorGain, rep]; +} + +//Adds all Augmentations to this faction. +Faction.prototype.addAllAugmentations = function() { + this.augmentations.length = 0; + for (var name in Augmentations) { + if (Augmentations.hasOwnProperty(name)) { + this.augmentations.push(name); + } + } } Faction.prototype.toJSON = function() { @@ -537,8 +573,8 @@ PlayerObject.prototype.checkForFactionInvitations = function() { var speakersforthedeadFac = Factions["Speakers for the Dead"]; if (!speakersforthedeadFac.isBanned && !speakersforthedeadFac.isMember && !speakersforthedeadFac.alreadyInvited && this.hacking_skill >= 100 && this.strength >= 300 && this.defense >= 300 && - this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 10 && - this.numPeopleKilledTotal >= 100 && this.karma <= -45 && this.companyName != Locations.Sector12CIA && + this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 30 && + this.karma <= -45 && this.companyName != Locations.Sector12CIA && this.companyName != Locations.Sector12NSA) { invitedFactions.push(speakersforthedeadFac); } @@ -718,9 +754,12 @@ displayFactionContent = function(factionName) { var faction = Factions[factionName]; document.getElementById("faction-name").innerHTML = factionName; document.getElementById("faction-info").innerHTML = "" + faction.info + ""; + var repGain = faction.getFavorGain(); + if (repGain.length != 2) {repGain = 0;} + repGain = repGain[0]; document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4) + "You will earn " + - formatNumber(faction.playerReputation / CONSTANTS.FactionReputationToFavor, 4) + + formatNumber(repGain, 4) + " faction favor upon resetting after installing an Augmentation"; document.getElementById("faction-favor").innerHTML = "Faction Favor: " + formatNumber(faction.favor, 4) + "Faction favor increases the rate at which " + @@ -732,14 +771,12 @@ displayFactionContent = function(factionName) { var fieldWorkDiv = document.getElementById("faction-fieldwork-div"); var securityWorkDiv = document.getElementById("faction-securitywork-div"); var donateDiv = document.getElementById("faction-donate-div"); + var gangDiv = document.getElementById("faction-gang-div"); - //Set new event listener for all of the work buttons - //The old buttons need to be replaced to clear the old event listeners var newHackButton = clearEventListeners("faction-hack-button"); var newFieldWorkButton = clearEventListeners("faction-fieldwork-button"); var newSecurityWorkButton = clearEventListeners("faction-securitywork-button"); var newDonateWorkButton = clearEventListeners("faction-donate-button"); - newHackButton.addEventListener("click", function() { Player.startFactionHackWork(faction); return false; @@ -775,10 +812,8 @@ displayFactionContent = function(factionName) { return false; }); - //Set new event listener for the purchase augmentation buttons - //The old button needs to be replaced to clear the old event listeners - var newPurchaseAugmentationsButton = clearEventListeners("faction-purchase-augmentations"); + var newPurchaseAugmentationsButton = clearEventListeners("faction-purchase-augmentations"); newPurchaseAugmentationsButton.addEventListener("click", function() { Engine.hideAllContent(); Engine.Display.factionAugmentationsContent.style.visibility = "visible"; @@ -793,6 +828,81 @@ displayFactionContent = function(factionName) { return false; }); + if (Player.bitNodeN == 2 && (factionName == "Slum Snakes" || factionName == "Tetrads" || + factionName == "The Syndicate" || factionName == "The Dark Army" || factionName == "Speakers for the Dead" || + factionName == "NiteSec" || factionName == "The Black Hand")) { + //Set everything else to invisible + hackDiv.style.display = "none"; + fieldWorkDiv.style.display = "none"; + securityWorkDiv.style.display = "none"; + donateDiv.style.display = "none"; + + if (Player.gang && Player.gang.facName != factionName) { + //If the player has a gang but its not for this faction + gangDiv.style.display = "none"; + return; + } + + var gangDiv = document.getElementById("faction-gang-div"); + //Create the "manage gang" button if it doesn't exist + if (gangDiv == null) { + gangDiv = document.createElement("div"); + gangDiv.setAttribute("id", "faction-gang-div"); + gangDiv.setAttribute("class", "faction-work-div"); + gangDiv.style.display = "inline"; + + gangDiv.innerHTML = + '
' + + 'Create and manage a gang for this Faction. ' + + 'Gangs will earn you money and faction reputation.' + + '
' + + '" + + "Note that this will prevent you from creating a Gang with any other Faction until " + + "this BitNode is destroyed. There are NO differences between the Factions you can " + + "create a Gang with and each of these Factions have all Augmentations available"); + } else { + Engine.loadGangContent(); + } + + }); + + return; + } else { + if (gangDiv) {gangDiv.style.display = "none";} + } + if (faction.isMember) { if (faction.favor >= 150) { donateDiv.style.display = "inline"; @@ -1047,7 +1157,7 @@ function processPassiveFactionRepGain(numCycles) { //TODO Get hard value of 1 rep per "rep gain cycle"" for now.. //maybe later make this based on //a player's 'status' like how powerful they are and how much money they have - if (faction.isMember) {faction.playerReputation += numTimesGain;} + if (faction.isMember) {faction.playerReputation += (numTimesGain * BitNodeMultipliers.FactionPassiveRepGain);} } } } diff --git a/src/Gang.js b/src/Gang.js new file mode 100644 index 0000000000..94f12ab09f --- /dev/null +++ b/src/Gang.js @@ -0,0 +1,1033 @@ +/* Gang.js */ +$(document).keydown(function(event) { + if (Engine.currentPage == Engine.Page.Gang && !yesNoBoxOpen) { + if (event.keyCode === 49) { + if(document.getElementById("gang-territory-subpage").style.display === "block") { + document.getElementById("gang-management-subpage-button").click(); + } + } else if (event.keyCode === 50) { + if (document.getElementById("gang-management-subpage").style.display === "block") { + document.getElementById("gang-territory-subpage-button").click(); + } + } + } +}); + +GangNames = ["Slum Snakes", "Tetrads", "The Syndicate", "The Dark Army", "Speakers for the Dead", + "NiteSec", "The Black Hand"]; +GangLocations = [Locations.Aevum, Locations.Chongqing, Locations.Sector12, Locations.NewTokyo, + Locations.Ishima, Locations.Volhaven]; +AllGangs = { + "Slum Snakes" : { + power: 1, + territory: 1/7, + }, + "Tetrads" : { + power: 1, + territory: 1/7, + }, + "The Syndicate" : { + power: 1, + territory: 1/7, + }, + "The Dark Army" : { + power: 1, + territory: 1/7, + }, + "Speakers for the Dead" : { + power: 1, + territory: 1/7, + }, + "NiteSec" : { + power: 1, + territory: 1/7, + }, + "The Black Hand" : { + power: 1, + territory: 1/7, + }, +} + +//Power is an estimate of a gang's ability to gain/defend territory +gangStoredPowerCycles = 0; +function processAllGangPowerGains(numCycles=1) { + if (!Player.inGang()) {return;} + gangStoredPowerCycles += numCycles; + if (gangStoredPowerCycles < 150) {return;} + var playerGangName = Player.gang.facName; + for (var name in AllGangs) { + if (AllGangs.hasOwnProperty(name)) { + if (name == playerGangName) { + AllGangs[name].power = Player.gang.calculatePower(); + } else { + var gain = Math.random() * 0.005; //TODO Adjust as necessary + AllGangs[name].power += (gain * numCycles); + } + } + } + + gangStoredPowerCycles -= 150; +} + +gangStoredTerritoryCycles = 0; +function processAllGangTerritory(numCycles=1) { + if (!Player.inGang()) {return;} + gangStoredTerritoryCycles += numCycles; + if (gangStoredTerritoryCycles < CONSTANTS.GangTerritoryUpdateTimer) {return;} + + for (var i = 0; i < GangNames.length; ++i) { + var other = getRandomInt(0, GangNames.length-1); + while(other == i) { + other = getRandomInt(0, GangNames.length-1); + } + var thisPwr = AllGangs[GangNames[i]].power; + var otherPwr = AllGangs[GangNames[other]].power; + var thisChance = thisPwr / (thisPwr + otherPwr); + if (Math.random() < thisChance) { + AllGangs[GangNames[i]].territory += 0.0001; + AllGangs[GangNames[other]].territory-= 0.0001; + } else { + AllGangs[GangNames[i]].territory -= 0.0001; + AllGangs[GangNames[other]].territory += 0.0001; + } + } + + gangStoredTerritoryCycles -= CONSTANTS.GangTerritoryUpdateTimer; +} + +//Returns true if Player is in a gang and false otherwise +PlayerObject.prototype.inGang = function() { + if (this.gang == null || this.gang == undefined) {return false;} + return (this.gang instanceof Gang); +} + +/* faction - Name of corresponding faction + hacking - Boolean indicating whether its a hacking gang or not + */ +function Gang(facName, hacking=false) { + this.facName = facName; + this.members = []; //Array of GangMembers + this.wanted = 1; + this.respect = 1; + + this.isHackingGang = hacking; + + this.respectGainRate = 0; + this.wantedGainRate = 0; + this.moneyGainRate = 0; + + //When processing gains, this stores the number of cycles until some + //limit is reached, and then calculates and applies the gains only at that limit + this.storedCycles = 0; +} + +Gang.prototype.process = function(numCycles=1) { + this.processGains(numCycles); + this.processExperienceGains(numCycles); + processAllGangPowerGains(numCycles); + processAllGangTerritory(numCycles); +} + +Gang.prototype.processGains = function(numCycles=1) { + this.storedCycles += numCycles; + if (isNaN(this.storedCycles)) { + console.log("ERROR: Gang's storedCylces is NaN"); + this.storedCycles = 0; + } + if (this.storedCycles < 25) {return;} //Only process every 5 seconds at least + + //Get gains per cycle + var moneyGains = 0, respectGains = 0, wantedLevelGains = 0; + for (var i = 0; i < this.members.length; ++i) { + respectGains += (this.members[i].calculateRespectGain()); + wantedLevelGains += (this.members[i].calculateWantedLevelGain()); + moneyGains += (this.members[i].calculateMoneyGain()); + } + this.respectGainRate = respectGains; + this.wantedGainRate = wantedLevelGains; + this.moneyGainRate = moneyGains; + + if (!isNaN(respectGains)) { + var gain = respectGains * this.storedCycles; + this.respect += (gain); + //Faction reputation gains is respect gain divided by some constant + var fac = Factions[this.facName]; + if (!(fac instanceof Faction)) { + dialogBoxCreate("ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev"); + } else { + var favorMult = 1 + (fac.favor / 100); + fac.playerReputation += ((Player.faction_rep_mult * gain * favorMult) / CONSTANTS.GangRespectToReputationRatio); + } + + } else { + console.log("ERROR: respectGains is NaN"); + } + if (!isNaN(wantedLevelGains)) { + this.wanted += (wantedLevelGains * this.storedCycles); + if (this.wanted < 1) {this.wanted = 1;} + } else { + console.log("ERROR: wantedLevelGains is NaN"); + } + if (!isNaN(moneyGains)) { + Player.gainMoney(moneyGains * this.storedCycles); + } else { + console.log("ERROR: respectGains is NaN"); + } + + this.storedCycles = 0; +} + +Gang.prototype.processExperienceGains = function(numCycles=1) { + for (var i = 0; i < this.members.length; ++i) { + this.members[i].gainExperience(numCycles); + this.members[i].updateSkillLevels(); + } +} + +Gang.prototype.calculatePower = function() { + var memberTotal = 0; + for (var i = 0; i < this.members.length; ++i) { + if (this.members[i].task instanceof GangMemberTask && + this.members[i].task.name == "Territory Warfare") { + memberTotal += this.members[i].calculatePower(); + } + } + return (memberTotal); +} + +Gang.prototype.toJSON = function() { + return Generic_toJSON("Gang", this); +} + +Gang.fromJSON = function(value) { + return Generic_fromJSON(Gang, value.data); +} + +Reviver.constructors.Gang = Gang; + + +/*** Gang Member object ***/ +function GangMember(name) { + this.name = name; + this.task = null; //GangMemberTask object + this.city = Player.city; + + //Name of upgrade only + this.weaponUpgrade = null; + this.armorUpgrade = null; + this.vehicleUpgrade = null; + this.hackingUpgrade = null; + + this.hack = 1; + this.str = 1; + this.def = 1; + this.dex = 1; + this.agi = 1; + this.cha = 1; + + this.hack_exp = 0; + this.str_exp = 0; + this.def_exp = 0; + this.dex_exp = 0; + this.agi_exp = 0; + this.cha_exp = 0; + + this.hack_mult = 1; + this.str_mult = 1; + this.def_mult = 1; + this.dex_mult = 1; + this.agi_mult = 1; + this.cha_mult = 1; +} + +//Same formula for Player +GangMember.prototype.calculateSkill = function(exp) { + return Math.max(Math.floor(32 * Math.log(exp + 534.5) - 200), 1); +} + +GangMember.prototype.updateSkillLevels = function() { + this.hack = Math.floor(this.calculateSkill(this.hack_exp) * this.hack_mult); + this.str = Math.floor(this.calculateSkill(this.str_exp) * this.str_mult); + this.def = Math.floor(this.calculateSkill(this.def_exp) * this.def_mult); + this.dex = Math.floor(this.calculateSkill(this.dex_exp) * this.dex_mult); + this.agi = Math.floor(this.calculateSkill(this.agi_exp) * this.agi_mult); + this.cha = Math.floor(this.calculateSkill(this.cha_exp) * this.cha_mult); +} + +GangMember.prototype.calculatePower = function() { + return (this.hack + this.str + this.def + + this.dex + this.agi + this.cha) / 100; +} + +GangMember.prototype.assignToTask = function(taskName) { + if (GangMemberTasks.hasOwnProperty(taskName)) { + this.task = GangMemberTasks[taskName]; + } else { + console.log("ERROR: Invalid task " + taskName); + this.task = null; + } +} + +//Gains are per cycle +GangMember.prototype.calculateRespectGain = function() { + var task = this.task; + if (task === null || !(task instanceof GangMemberTask) || task.baseRespect === 0) {return 0;} + var statWeight = (task.hackWeight/100) * this.hack + + (task.strWeight/100) * this.str + + (task.defWeight/100) * this.def + + (task.dexWeight/100) * this.dex + + (task.agiWeight/100) * this.agi + + (task.chaWeight/100) * this.cha; + statWeight -= (3.5 * task.difficulty); + if (statWeight <= 0) {return 0;} + var territoryMult = AllGangs[Player.gang.facName].territory; + var respectMult = (Player.gang.respect) / (Player.gang.respect + Player.gang.wanted); + return 12 * task.baseRespect * statWeight * territoryMult * respectMult; +} + +GangMember.prototype.calculateWantedLevelGain = function() { + var task = this.task; + if (task === null || !(task instanceof GangMemberTask) || task.baseWanted === 0) {return 0;} + var statWeight = (task.hackWeight/100) * this.hack + + (task.strWeight/100) * this.str + + (task.defWeight/100) * this.def + + (task.dexWeight/100) * this.dex + + (task.agiWeight/100) * this.agi + + (task.chaWeight/100) * this.cha; + statWeight -= (3.5 * task.difficulty); + if (statWeight <= 0) {return 0;} + var territoryMult = AllGangs[Player.gang.facName].territory; + if (task.baseWanted < 0) { + return task.baseWanted * statWeight * territoryMult; + } else { + return 5 * task.baseWanted / (3 * statWeight * territoryMult); + } +} + +GangMember.prototype.calculateMoneyGain = function() { + var task = this.task; + if (task === null || !(task instanceof GangMemberTask) || task.baseMoney === 0) {return 0;} + var statWeight = (task.hackWeight/100) * this.hack + + (task.strWeight/100) * this.str + + (task.defWeight/100) * this.def + + (task.dexWeight/100) * this.dex + + (task.agiWeight/100) * this.agi + + (task.chaWeight/100) * this.cha; + statWeight -= (3.5 * task.difficulty); + if (statWeight <= 0) {return 0;} + var territoryMult = AllGangs[Player.gang.facName].territory; + var respectMult = (Player.gang.respect) / (Player.gang.respect + Player.gang.wanted); + return 5 * task.baseMoney * statWeight * territoryMult * respectMult; +} + +GangMember.prototype.gainExperience = function(numCycles=1) { + var task = this.task; + if (task === null || !(task instanceof GangMemberTask)) {return;} + this.hack_exp += (task.hackWeight / 1500) * task.difficulty * numCycles; + this.str_exp += (task.strWeight / 1500) * task.difficulty * numCycles; + this.def_exp += (task.defWeight / 1500) * task.difficulty * numCycles; + this.dex_exp += (task.dexWeight / 1500) * task.difficulty * numCycles; + this.agi_exp += (task.agiWeight / 1500) * task.difficulty * numCycles; + this.cha_exp += (task.chaWeight / 1500) * task.difficulty * numCycles; +} + +GangMember.prototype.toJSON = function() { + return Generic_toJSON("GangMember", this); +} + +GangMember.fromJSON = function(value) { + return Generic_fromJSON(GangMember, value.data); +} + +Reviver.constructors.GangMember = GangMember; + +//Defines tasks that Gang Members can work on +function GangMemberTask(name="", desc="", + params={baseRespect: 0, baseWanted: 0, baseMoney: 0, + hackWeight: 0, strWeight: 0, defWeight: 0, + dexWeight: 0, agiWeight: 0, chaWeight: 0, + difficulty: 0}) { + this.name = name; + this.desc = desc; + + this.baseRespect = params.baseRespect ? params.baseRespect : 0; + this.baseWanted = params.baseWanted ? params.baseWanted : 0; + this.baseMoney = params.baseMoney ? params.baseMoney : 0; + + //Weights must add up to 100 + this.hackWeight = params.hackWeight ? params.hackWeight : 0; + this.strWeight = params.strWeight ? params.strWeight : 0; + this.defWeight = params.defWeight ? params.defWeight : 0; + this.dexWeight = params.dexWeight ? params.dexWeight : 0; + this.agiWeight = params.agiWeight ? params.agiWeight : 0; + this.chaWeight = params.chaWeight ? params.chaWeight : 0; + + //1 - 100 + this.difficulty = params.difficulty ? params.difficulty : 1; +} + +GangMemberTask.prototype.toJSON = function() { + return Generic_toJSON("GangMemberTask", this); +} + +GangMemberTask.fromJSON = function(value) { + return Generic_fromJSON(GangMemberTask, value.data); +} + +Reviver.constructors.GangMemberTask = GangMemberTask; + +//TODO Human trafficking and an equivalent hacking crime +GangMemberTasks = { + "Ransomware" : new GangMemberTask( + "Ransomware", + "Assign this gang member to create and distribute ransomware
" + + "Earns money - Slightly increases respect - Slightly increases wanted level", + {baseRespect: 0.00008, baseWanted: 0.00001, baseMoney: 1, + hackWeight: 100, difficulty: 1}), + "Phishing" : new GangMemberTask( + "Phishing", + "Assign this gang member to attempt phishing scams and attacks
" + + "Earns money - Slightly increases respect - Slightly increases wanted level", + {baseRespect: 0.0001, baseWanted: 0.001, baseMoney: 2.5, + hackWeight: 85, chaWeight: 15, difficulty: 3}), + "Identity Theft" : new GangMemberTask( + "Identity Theft", + "Assign this gang member to attempt identity theft
" + + "Earns money - Increases respect - Increases wanted level", + {baseRespect: 0.0003, baseWanted: 0.01, baseMoney: 6, + hackWeight: 80, chaWeight: 20, difficulty: 4}), + "DDoS Attacks" : new GangMemberTask( + "DDoS Attacks", + "Assign this gang member to carry out DDoS attacks
" + + "Increases respect - Increases wanted level", + {baseRespect: 0.0007, baseWanted: 0.05, + hackWeight: 100, difficulty: 7}), + "Plant Virus" : new GangMemberTask( + "Plant Virus", + "Assign this gang member to create and distribute malicious viruses
" + + "Increases respect - Increases wanted level", + {baseRespect: 0.001, baseWanted: 0.05, + hackWeight: 100, difficulty: 10}), + "Fraud & Counterfeiting" : new GangMemberTask( + "Fraud & Counterfeiting", + "Assign this gang member to commit financial fraud and digital counterfeiting
" + + "Earns money - Slightly increases respect - Slightly increases wanted level", + {baseRespect: 0.0005, baseWanted: 0.1, baseMoney: 15, + hackWeight: 80, chaWeight: 20, difficulty: 17}), + "Money Laundering" : new GangMemberTask( + "Money Laundering", + "Assign this gang member to launder money
" + + "Earns money - Increases respect - Increases wanted level", + {baseRespect: 0.002, baseWanted:0.2, baseMoney: 40, + hackWeight: 75, chaWeight: 25, difficulty: 20}), + "Cyberterrorism" : new GangMemberTask( + "Cyberterrorism", + "Assign this gang member to commit acts of cyberterrorism
" + + "Greatly increases respect - Greatly increases wanted level", + {baseRespect: 0.01, baseWanted: 0.5, + hackWeight: 80, chaWeight: 20, difficulty: 33}), + "Ethical Hacking" : new GangMemberTask( + "Ethical Hacking", + "Assign this gang member to be an ethical hacker for corporations
" + + "Earns money - Lowers wanted level", + {baseWanted: -0.001, baseMoney: 1, + hackWeight: 90, chaWeight: 10, difficulty: 1}), + "Mug People" : new GangMemberTask( + "Mug People", + "Assign this gang member to mug random people on the streets
" + + "Earns money - Slightly increases respect - Very slightly increases wanted level", + {baseRespect: 0.00005, baseWanted: 0.00001, baseMoney: 1, + strWeight: 25, defWeight: 25, dexWeight: 25, agiWeight: 10, chaWeight: 15, difficulty: 1}), + "Deal Drugs" : new GangMemberTask( + "Deal Drugs", + "Assign this gang member to sell drugs.
" + + "Earns money - Slightly increases respect - Slightly increases wanted level", + {baseRespect: 0.0001, baseWanted: 0.001, baseMoney: 4, + agiWeight: 20, dexWeight: 20, chaWeight: 60, difficulty: 3}), + "Run a Con" : new GangMemberTask( + "Run a Con", + "Assign this gang member to run cons
" + + "Earns money - Increases respect - Increases wanted level", + {baseRespect: 0.0005, baseWanted: 0.01, baseMoney: 10, + strWeight: 5, defWeight: 5, agiWeight: 25, dexWeight: 25, chaWeight: 40, difficulty: 10}), + "Armed Robbery" : new GangMemberTask( + "Armed Robbery", + "Assign this gang member to commit armed robbery on stores, banks and armored cars
" + + "Earns money - Increases respect - Increases wanted level", + {baseRespect: 0.0003, baseWanted: 0.05, baseMoney: 25, + hackWeight: 20, strWeight: 15, defWeight: 15, agiWeight: 10, dexWeight: 20, chaWeight: 20, + difficulty: 17}), + "Traffick Illegal Arms" : new GangMemberTask( + "Traffick Illegal Arms", + "Assign this gang member to traffick illegal arms
" + + "Earns money - Increases respect - Increases wanted level", + {baseRespect: 0.001, baseWanted: 0.1, baseMoney: 40, + hackWeight: 15, strWeight: 20, defWeight: 20, dexWeight: 20, chaWeight: 75, + difficulty: 25}), + "Threaten & Blackmail" : new GangMemberTask( + "Threaten & Blackmail", + "Assign this gang member to threaten and black mail high-profile targets
" + + "Earns money - Slightly increases respect - Slightly increases wanted level", + {baseRespect: 0.0001, baseWanted: 0.05, baseMoney: 15, + hackWeight: 25, strWeight: 25, dexWeight: 25, chaWeight: 25, difficulty: 28}), + "Terrorism" : new GangMemberTask( + "Terrorism", + "Assign this gang member to commit acts of terrorism
" + + "Greatly increases respect - Greatly increases wanted level", + {baseRespect: 0.01, baseWanted: 1, + hackWeight: 20, strWeight: 20, defWeight: 20,dexWeight: 20, chaWeight: 20, + difficulty: 33}), + "Vigilante Justice" : new GangMemberTask( + "Vigilante Justice", + "Assign this gang member to be a vigilante and protect the city from criminals
" + + "Decreases wanted level", + {baseWanted: -0.001, + hackWeight: 20, strWeight: 20, defWeight: 20, dexWeight: 20, agiWeight:20, + difficulty: 1}), + "Train Combat" : new GangMemberTask( + "Train Combat", + "Assign this gang member to increase their combat stats (str, def, dex, agi)", + {strWeight: 25, defWeight: 25, dexWeight: 25, agiWeight: 25, difficulty: 5}), + "Train Hacking" : new GangMemberTask( + "Train Hacking", + "Assign this gang member to train their hacking skills", + {hackWeight: 100, difficulty: 8}), + "Territory Warfare" : new GangMemberTask( + "Territory Warfare", + "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.", + {hackWeight: 15, strWeight: 20, defWeight: 20, dexWeight: 20, agiWeight: 20, + chaWeight: 5, difficulty: 3}), +} + + +function GangMemberUpgrade(name, desc) { + this.name = name; + this.desc = desc; +} + +//Passes in a GangMember object +GangMemberUpgrade.prototype.apply = function(member) { + switch(this.name) { + case "Baseball Bat": + member.str *= 1.1; + member.def *= 1.1; + break; + case "Katana": + member.str *= 1.15; + member.def *= 1.15; + member.dex *= 1.15; + break; + case "Glock 18C": + member.str *= 1.2; + member.def *= 1.2; + member.dex *= 1.2; + member.agi *= 1.2; + break; + case "P90": + member.str *= 1.4; + member.def *= 1.4; + member.agi *= 1.2; + break; + case "Steyr AUG": + member.str *= 1.6; + member.def *= 1.6; + break; + case "AK-47": + member.str *= 1.8; + member.def *= 1.8; + break; + case "M15A10 Assault Rifle": + member.str *= 1.9; + member.def *= 1.9; + break; + case "AWM Sniper Rifle": + member.str *= 1.8; + member.dex *= 1.8; + member.agi *= 1.8; + break; + case "Bulletproof Vest": + member.def *= 1.15; + break; + case "Full Body Armor": + member.def *= 1.3; + break; + case "Liquid Body Armor": + member.def *= 1.5; + member.agi *= 1.5; + break; + case "Graphene Plating Armor": + member.def *= 2; + break; + case "Ford Flex V20": + member.agi *= 1.2; + member.cha *= 1.2; + break; + case "ATX1070 Superbike": + member.agi *= 1.4; + member.cha *+ 1.4; + break; + case "Mercedes-Benz S9001": + member.agi *= 1.6; + member.cha *= 1.6; + break; + case "White Ferrari": + member.agi *= 1.8; + member.cha *= 1.8; + break; + case "NUKE Rootkit": + member.hack *= 1.2; + break; + case "Soulstealer Rootkit": + member.hack *= 1.3; + break; + case "Demon Rootkit": + member.hack *= 1.3; + break; + default: + console.log("ERROR: Could not find this upgrade: " + this.name); + break; + } +} + +GangMemberUpgrades = { + "Baseball Bat" : new GangMemberUpgrade("Baseball Bat", + "Increases strength and defense by 10%"), + "Katana" : new GangMemberUpgrade("Katana", + "Increases strength, defense, and dexterity by 15%"), + "Glock 18C" : new GangMemberUpgrade("Glock 18C", + "Increases strength, defense, dexterity, and agility by 20%"), + "P90" : new GangMemberUpgrade("P90C", + "Increases strength and defense by 40%. Increases agility by 20%"), + "Steyr AUG" : new GangMemberUpgrade("Steyr AUG", + "Increases strength and defense by 60%"), + "AK-47" : new GangMemberUpgrade("AK-47", + "Increases strength and defense by 80%"), + "M15A10 Assault Rifle" : new GangMemberUpgrade("M15A10 Assault Rifle", + "Increases strength and defense by 90%"), + "AWM Sniper Rifle" : new GangMemberUpgrade("AWM Sniper Rifle", + "Increases strength, dexterity, and agility by 80%"), + "Bulletproof Vest" : new GangMemberUpgrade("Bulletproof Vest", + "Increases defense by 15%"), + "Full Body Armor" : new GangMemberUpgrade("Full Body Armor", + "Increases defense by 30%"), + "Liquid Body Armor" : new GangMemberUpgrade("Liquid Body Armor", + "Increases defense and agility by 50%"), + "Graphene Plating Armor" : new GangMemberUpgrade("Graphene Plating Armor", + "Increases defense by 100%"), + "Ford Flex V20" : new GangMemberUpgrade("Ford Flex V20", + "Increases agility and charisma by 20%"), + "ATX1070 Superbike" : new GangMemberUpgrade("ATX1070 Superbike", + "Increases agility and charisma by 40%"), + "Mercedes-Benz S9001" : new GangMemberUpgrade("Mercedes-Benz S9001", + "Increases agility and charisma by 60%"), + "White Ferrari" : new GangMemberUpgrade("White Ferrari", + "Increases agility and charisma by 80%"), + "NUKE Rootkit" : new GangMemberUpgrade("NUKE Rootkit", + "Increases hacking by 20%"), + "Soulstealer Rootkit" : new GangMemberUpgrade("Soulstealer Rootkit", + "Increases hacking by 30%"), + "Demon Rootkit" : new GangMemberUpgrade("Demon Rootkit", + "Increases hacking by 50%"), +} + +var gangContentCreated = false; +function displayGangContent() { + if (!gangContentCreated) { + gangContentCreated = true; + + //Create gang container + var container = document.createElement("div"); + document.getElementById("entire-game-container").appendChild(container); + container.setAttribute("id", "gang-container"); + container.setAttribute("class", "generic-menupage-container"); + + //Get variables + var facName = Player.gang.facName; + var members = Player.gang.members; + var wanted = Player.gang.wanted; + var respect = Player.gang.respect; + + //Buttons to switch between panels + var managementButton = document.createElement("a"); + managementButton.setAttribute("id", "gang-management-subpage-button"); + managementButton.innerHTML = "Gang Management (1)"; + managementButton.setAttribute("class", "a-link-button-inactive"); + managementButton.style.display = "inline-block"; + var territoryButton = document.createElement("a"); + territoryButton.setAttribute("id", "gang-territory-subpage-button"); + territoryButton.innerHTML = "Gang Territory (2)"; + territoryButton.setAttribute("class", "a-link-button"); + territoryButton.style.display = "inline-block"; + + managementButton.addEventListener("click", function() { + document.getElementById("gang-management-subpage").style.display = "block"; + document.getElementById("gang-territory-subpage").style.display = "none"; + managementButton.classList.toggle("a-link-button-inactive"); + managementButton.classList.toggle("a-link-button"); + territoryButton.classList.toggle("a-link-button-inactive"); + territoryButton.classList.toggle("a-link-button"); + updateGangContent(); + return false; + }); + + territoryButton.addEventListener("click", function() { + document.getElementById("gang-management-subpage").style.display = "none"; + document.getElementById("gang-territory-subpage").style.display = "block"; + managementButton.classList.toggle("a-link-button-inactive"); + managementButton.classList.toggle("a-link-button"); + territoryButton.classList.toggle("a-link-button-inactive"); + territoryButton.classList.toggle("a-link-button"); + updateGangContent(); + return false; + }); + + container.appendChild(managementButton); + container.appendChild(territoryButton); + + //Subpage for managing gang members + var managementSubpage = document.createElement("div"); + container.appendChild(managementSubpage); + managementSubpage.style.display = "block"; + managementSubpage.setAttribute("id", "gang-management-subpage"); + var infoText = document.createElement("p"); + managementSubpage.appendChild(infoText); + infoText.setAttribute("id", "gang-info"); + infoText.style.width = "70%"; + + var recruitGangMemberBtn = document.createElement("a"); + managementSubpage.appendChild(recruitGangMemberBtn); + recruitGangMemberBtn.setAttribute("id", "gang-management-recruit-member-btn"); + recruitGangMemberBtn.setAttribute("class", "a-link-button-inactive"); + recruitGangMemberBtn.innerHTML = "Recruit Gang Member"; + recruitGangMemberBtn.style.display = "inline-block"; + recruitGangMemberBtn.style.margin = "10px"; + recruitGangMemberBtn.addEventListener("click", () => { + var yesBtn = yesNoTxtInpBoxGetYesButton(), noBtn = yesNoTxtInpBoxGetNoButton(); + yesBtn.innerHTML = "Recruit Gang Member"; + noBtn.innerHTML = "Cancel"; + yesBtn.addEventListener("click", ()=>{ + var name = yesNoTxtInpBoxGetInput(); + if (name == "") { + dialogBoxCreate("You must enter a name for your Gang member!"); + } else { + for (var i = 0; i < Player.gang.members.length; ++i) { + if (name == Player.gang.members[i].name) { + dialogBoxCreate("You already have a gang member with this name!"); + return false; + } + } + var member = new GangMember(name); + Player.gang.members.push(member); + createGangMemberDisplayElement(member); + updateGangContent(); + } + yesNoTxtInpBoxClose(); + }); + noBtn.addEventListener("click", ()=>{ + yesNoTxtInpBoxClose(); + }); + yesNoTxtInpBoxCreate("Please enter a name for your new Gang member:"); + return false; + }); + + //Text for how much reputation is required for recruiting next memberList + var recruitRequirementText = document.createElement("p"); + managementSubpage.appendChild(recruitRequirementText); + recruitRequirementText.setAttribute("id", "gang-recruit-requirement-text"); + recruitRequirementText.style.color = "red"; + + var memberList = document.createElement("ul"); + managementSubpage.appendChild(memberList); + memberList.setAttribute("id", "gang-member-list"); + for (var i = 0; i < members.length; ++i) { + createGangMemberDisplayElement(members[i]); + } + setGangMemberClickHandlers(); //Set buttons to toggle the gang member info panels + + //Subpage for seeing gang territory information + var territorySubpage = document.createElement("div"); + container.appendChild(territorySubpage); + territorySubpage.setAttribute("id", "gang-territory-subpage"); + territorySubpage.style.display = "none"; + + //Info text for territory page + var territoryInfoText = document.createElement("p"); + territorySubpage.appendChild(territoryInfoText); + territoryInfoText.innerHTML = + "This page shows how much territory your Gang controls. This statistic is listed as a percentage, " + + "which represents how much of the total territory you control.
" + + "Territory gain and loss is processed automatically and is updated every ~30 seconds. Your chances " + + "to gain and lose territory depend on your Gang's power, which is listed in the display below. " + + "Your gang's power is determined by the stats of all Gang members you have assigned to the " + + "'Territory Warfare' task. Gang members that are not assigned to this task do not contribute to " + + "your Gang's power.
" + + "The amount of territory you have affects all aspects of your Gang members' production, including " + + "money, respect, and wanted level. It is very beneficial to have high territory control.
" + territoryInfoText.style.width = "70%"; + + + var territoryBorder = document.createElement("fieldset"); + territoryBorder.style.width = "50%"; + territoryBorder.style.display = "inline-block"; + + var territoryP = document.createElement("p"); + territoryP.setAttribute("id", "gang-territory-info"); + + territoryBorder.appendChild(territoryP); + + + territorySubpage.appendChild(territoryBorder); + } + document.getElementById("gang-container").style.visibility = "visible"; + updateGangContent(); +} + +function updateGangContent() { + if (!gangContentCreated || !Player.inGang()) {return;} + + if(document.getElementById("gang-territory-subpage").style.display === "block") { + //Update territory information + var elem = document.getElementById("gang-territory-info"); + elem.innerHTML = ""; + for (var gangname in AllGangs) { + if (AllGangs.hasOwnProperty(gangname)) { + var gangInfo = AllGangs[gangname]; + if (gangname == Player.gang.facName) { + elem.innerHTML += ("" + gangname + "
(Power: " + formatNumber(gangInfo.power, 6) + "): " + + formatNumber(100*gangInfo.territory, 2) + "%
"); + } else { + elem.innerHTML += (gangname + "
(Power: " + formatNumber(gangInfo.power, 6) + "): " + + formatNumber(100*gangInfo.territory, 2) + "%
"); + } + } + } + } else { + //Update information for overall gang + var gangInfo = document.getElementById("gang-info"); + if (gangInfo) { + var faction = Factions[Player.gang.facName]; + var rep; + if (!(faction instanceof Faction)) { + rep = "ERROR"; + } else { + rep = faction.playerReputation; + } + gangInfo.innerHTML = + "
This page is used to manage your gang members and get an overview of your gang's stats.
" +
+ "If a gang member is not earning much money or respect, the task that you have assigned to that member " +
+ "might be too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the " +
+ "top of the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the " +
+ "fact that your wanted level is too high. Consider assigning a few members to the 'Vigilante Justice' or 'Ethical Hacking' " +
+ "tasks to lower your wanted level.
" +
+ "Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing Augmentations, you will " +
+ "automatically be a member of whatever Faction you created your gain with.
" +
+ "
Respect: Represents the amount of respect " + + "your gang has from other gangs and criminal organizations. Your respect affects the amount of money " + + "your gang members will earn, and also determines how much reputation you are earning with your gang's " + + "correpsonding Faction.
" + formatNumber(Player.gang.respect, 6) + " (" + formatNumber(5*Player.gang.respectGainRate, 6) + " / sec)
" + + "
Wanted Level: Represents how much the gang is wanted by law " + + "enforcement. The higher your gang's wanted level, the harder it will be for your gang members to make " + + "money and earn respect. Note that the minimum respect value is 1." + + "
" + formatNumber(Player.gang.wanted, 6) + " (" + formatNumber(5*Player.gang.wantedGainRate, 6) + " / sec)
" +
+ "Money gain rate: $" + formatNumber(5*Player.gang.moneyGainRate, 2) + " / sec
" +
+ "Faction reputation: " + formatNumber(rep, 3) + "
" + + "Strength: " + formatNumber(memberObj.str, 0) + " (" + formatNumber(memberObj.str_exp, 3) + " exp)
" + + "Defense: " + formatNumber(memberObj.def, 0) + " (" + formatNumber(memberObj.def_exp, 3) + " exp)
" + + "Dexterity: " + formatNumber(memberObj.dex, 0) + " (" + formatNumber(memberObj.dex_exp, 3) + " exp)
" + + "Agility: " + formatNumber(memberObj.agi, 0) + " (" + formatNumber(memberObj.agi_exp, 3) + " exp)
" + + "Charisma: " + formatNumber(memberObj.cha, 0) + " (" + formatNumber(memberObj.cha_exp, 3) + " exp)
"; + } + + var gainInfo = document.getElementById(name + "gang-member-gain-info"); + if (gainInfo) { + gainInfo.innerHTML = + "Money: $" + formatNumber(5*memberObj.calculateMoneyGain(), 2) + " / sec
" + + "Respect: " + formatNumber(5*memberObj.calculateRespectGain(), 6) + " / sec
" + + "Wanted Level: " + formatNumber(5*memberObj.calculateWantedLevelGain(), 6) + " / sec
"; + } +} + +function setGangMemberTaskDescription(memberObj, taskName) { + var name = memberObj.name; + var taskDesc = document.getElementById(name + "gang-member-task-description"); + if (taskDesc) { + var task = GangMemberTasks[taskName]; + if (task == null) {return;} + var desc = task.desc; + taskDesc.innerHTML = desc; + } +} diff --git a/src/Infiltration.js b/src/Infiltration.js index ee463e167a..ae67deeeac 100644 --- a/src/Infiltration.js +++ b/src/Infiltration.js @@ -198,6 +198,7 @@ function nextInfiltrationLevel(inst) { "rest of the facility's security. The facility's security " + "level has increased by " + formatNumber((res[1]*100)-100, 2).toString() + "%"); Player.karma -= 3; + ++Player.numPeopleKilled; endInfiltrationLevel(inst); return false; } else { @@ -221,6 +222,7 @@ function nextInfiltrationLevel(inst) { if (res[0]) { writeInfiltrationStatusText("You SUCCESSFULLY assassinated the security guard without being detected!"); Player.karma -= 3; + ++Player.numPeopleKilled; endInfiltrationLevel(inst); return false; } else { @@ -574,10 +576,10 @@ function updateInfiltrationButtons(inst, scenario) { //Success: 5%, Failure 10%, -Karma function attemptInfiltrationKill(inst) { var chance = getInfiltrationKillChance(inst); - inst.gainStrengthExp(inst.securityLevel / 500) * Player.strength_exp_mult; - inst.gainDefenseExp(inst.securityLevel / 500) * Player.defense_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 500) * Player.dexterity_exp_mult; - inst.gainAgilityExp(inst.securityLevel / 500) * Player.agility_exp_mult; + inst.gainStrengthExp(inst.securityLevel / 100) * Player.strength_exp_mult; + inst.gainDefenseExp(inst.securityLevel / 100) * Player.defense_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 100) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 100) * Player.agility_exp_mult; if (Math.random() <= chance) { inst.securityLevel *= 1.05; return [true, 1.05]; @@ -600,10 +602,10 @@ function getInfiltrationKillChance(inst) { //Success: 3%, Failure: 10% function attemptInfiltrationKnockout(inst) { var chance = getInfiltrationKnockoutChance(inst); - inst.gainStrengthExp(inst.securityLevel / 500) * Player.strength_exp_mult; - inst.gainDefenseExp(inst.securityLevel / 500) * Player.defense_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 500) * Player.dexterity_exp_mult; - inst.gainAgilityExp(inst.securityLevel / 500) * Player.agility_exp_mult; + inst.gainStrengthExp(inst.securityLevel / 100) * Player.strength_exp_mult; + inst.gainDefenseExp(inst.securityLevel / 100) * Player.defense_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 100) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 100) * Player.agility_exp_mult; if (Math.random() <= chance) { inst.securityLevel *= 1.03; return [true, 1.03]; @@ -625,9 +627,9 @@ function getInfiltrationKnockoutChance(inst) { //Success: 0%, Failure: 10% function attemptInfiltrationStealthKnockout(inst) { var chance = getInfiltrationStealthKnockoutChance(inst); - inst.gainStrengthExp(inst.securityLevel / 500) * Player.strength_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 300) * Player.dexterity_exp_mult; - inst.gainAgilityExp(inst.securityLevel / 300) * Player.agility_exp_mult; + inst.gainStrengthExp(inst.securityLevel / 100) * Player.strength_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 75) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 75) * Player.agility_exp_mult; if (Math.random() <= chance) { return [true, 1]; } else { @@ -648,9 +650,9 @@ function getInfiltrationStealthKnockoutChance(inst) { //Success: 0%, Failure: 5%, -Karma function attemptInfiltrationAssassinate(inst) { var chance = getInfiltrationAssassinateChance(inst); - inst.gainStrengthExp(inst.securityLevel / 500) * Player.strength_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 300) * Player.dexterity_exp_mult; - inst.gainAgilityExp(inst.securityLevel / 300) * Player.agility_exp_mult; + inst.gainStrengthExp(inst.securityLevel / 100) * Player.strength_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 75) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 75) * Player.agility_exp_mult; if (Math.random() <= chance) { return [true, 1]; } else { @@ -671,10 +673,10 @@ function getInfiltrationAssassinateChance(inst) { //Success: 5%, Failure: 10% function attemptInfiltrationDestroySecurity(inst) { var chance = getInfiltrationDestroySecurityChance(inst); - inst.gainStrengthExp(inst.securityLevel / 500) * Player.strength_exp_mult; - inst.gainDefenseExp(inst.securityLevel / 500) * Player.defense_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 500) * Player.dexterity_exp_mult; - inst.gainAgilityExp(inst.securityLevel / 500) * Player.agility_exp_mult; + inst.gainStrengthExp(inst.securityLevel / 100) * Player.strength_exp_mult; + inst.gainDefenseExp(inst.securityLevel / 100) * Player.defense_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 100) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 100) * Player.agility_exp_mult; if (Math.random() <= chance) { inst.securityLevel *= 1.05; return [true, 1.05]; @@ -698,7 +700,7 @@ function getInfiltrationDestroySecurityChance(inst) { //Success: 1%, Failure: 5% function attemptInfiltrationHack(inst) { var chance = getInfiltrationHackChance(inst); - inst.gainHackingExp(inst.securityLevel / 200) * Player.hacking_exp_mult; + inst.gainHackingExp(inst.securityLevel / 75) * Player.hacking_exp_mult; if (Math.random() <= chance) { inst.securityLevel *= 1.03; return [true, 1.03]; @@ -719,7 +721,7 @@ function getInfiltrationHackChance(inst) { //Success: 0%, Failure: 8% function attemptInfiltrationSneak(inst) { var chance = getInfiltrationSneakChance(inst); - inst.gainAgilityExp(inst.securityLevel / 200) * Player.agility_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 75) * Player.agility_exp_mult; if (Math.random() <= chance) { return [true, 1]; } else { @@ -739,7 +741,7 @@ function getInfiltrationSneakChance(inst) { //Success: 1%, Failure: 3% function attemptInfiltrationPickLockedDoor(inst) { var chance = getInfiltrationPickLockedDoorChance(inst); - inst.gainDexterityExp(inst.securityLevel / 200) * Player.dexterity_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 75) * Player.dexterity_exp_mult; if (Math.random() <= chance) { inst.securityLevel *= 1.01; return [true, 1.01]; @@ -759,7 +761,7 @@ function getInfiltrationPickLockedDoorChance(inst) { //Success: 0%, Failure: 15%, function attemptInfiltrationBribe(inst) { var chance = getInfiltrationBribeChance(inst); - inst.gainCharismaExp(inst.securityLevel / 200) * Player.charisma_exp_mult; + inst.gainCharismaExp(inst.securityLevel / 50) * Player.charisma_exp_mult; if (Math.random() <= chance) { return [true, 1]; } else { @@ -778,8 +780,8 @@ function getInfiltrationBribeChance(inst) { //Failure: 5% function attemptInfiltrationEscape(inst) { var chance = getInfiltrationEscapeChance(inst); - inst.gainAgilityExp(inst.securityLevel / 400) * Player.agility_exp_mult; - inst.gainDexterityExp(inst.securityLevel / 400) * Player.dexterity_exp_mult; + inst.gainAgilityExp(inst.securityLevel / 50) * Player.agility_exp_mult; + inst.gainDexterityExp(inst.securityLevel / 50) * Player.dexterity_exp_mult; if (Math.random() <= chance) { return [true, 1]; } else { diff --git a/src/Literature.js b/src/Literature.js new file mode 100644 index 0000000000..088a97d57c --- /dev/null +++ b/src/Literature.js @@ -0,0 +1,62 @@ +/* Literature.js + * Lore / world building literature that can be found on servers + */ +function Literature(title, filename, txt) { + this.title = title; + this.fn = filename; + this.txt = txt; +} + +Literature.prototype.display = function() { + var txt = this.title + "
" + + "" + this.txt + ""; + dialogBoxCreate(txt); +} + +Literature.prototype.addToserver = function(server) { + if (server == null) { + console.log("WARNING: Could not locate server"); + return; + } + server.messages.push(this); +} + +Literature.prototype.toJSON = function() { + return Generic_toJSON("Literature", this); +} + +Literature.fromJSON = function(value) { + return Generic_fromJSON(Literature, value.data); +} + +Reviver.constructors.Literature = Literature; + +Literatures = {} + +function initLiterature() { + var title, fn, txt; + title = "A Green Tomorrow"; //Tomorrow is Green + fn = "A-Green-Tomorrow.lit"; + txt = "In the past few decades, there has been a massive global movement towards the generation of renewable energy in an effort to" + + "combat global warming and climate change. The shift towards renewable energy was a big success"; + Literatures[fn] = new Literature(title, fn); + title = "Alpha and Omega"; //Cryptic article about BitNodes + title = "Are we living in a simulated reality?"; //lol + title = "Beyond Man"; //Better than nature? + title = "Brighter than the Sun"; // Article about TaiYang Digital + title = "Democracy is Dead: The Fall of an Empire"; //Government is a powerless figurehead, megacorporation rule + title = "Fall of an Empire"; + title = "Figures show rising crime rates in Sector-12"; //Article about the Syndicate + title = "Man and the Machine"; //Blurring the Boundaries between Man and the Machine + title = "Secret Societies"; //Talks about how hacking factions have replaced typical secret societies like Illuminati + title = "Space: The Failed Frontier"; //A Frontier too far? + title = "Coded Intelligence: Myth or Reality?"; //Discusses whether true intelligence can be implemented in software. Foreshadows intelligence stat in later BItnodes + title = "Synthetic Muscles"; //Artificial muscles + title = "Tensions rise in global tech race"; //Article about competition+conflict between tech mega corps (OmniTek, ECorp..Taiyang? etc.) + title = "The Cost of Immortality"; //Grey Skies + title = "The Hidden World"; //The Sleepwalking World + title = "The New God"; //Singularity Church of the MachineGod + title = "The New Triads"; //About tetrads, Dragon Heads: The Triads of the 21st Century + title = "The Secret War"; //War between those who wanted Augmentations widely available and those who wanted to keep it secret + title = "An uncertain future for Defense Contractors"; //Less war and globalism = less profit for defense contractors +} diff --git a/src/Location.js b/src/Location.js index 38cf97873b..b24509b037 100644 --- a/src/Location.js +++ b/src/Location.js @@ -285,9 +285,12 @@ displayLocationContent = function() { locationTxtDiv2.style.display = "block"; locationTxtDiv3.style.display = "block"; jobTitle.innerHTML = "Job Title: " + Player.companyPosition.positionName; + var repGain = company.getFavorGain(); + if (repGain.length != 2) {repGain = 0;} + repGain = repGain[0]; jobReputation.innerHTML = "Company reputation: " + formatNumber(company.playerReputation, 4) + "You will earn " + - formatNumber(company.playerReputation / CONSTANTS.CompanyReputationToFavor, 4) + + formatNumber(repGain, 4) + " faction favor upon resetting after installing an Augmentation"; companyFavor.innerHTML = "Company Favor: " + formatNumber(company.favor, 4) + "Company favor increases the rate at which " + @@ -784,7 +787,7 @@ displayLocationContent = function() { locationInfo.innerHTML = Companies[loc].info; waiterJob.style.display = "block"; - waitPartTimeJob.style.display = "block"; + waiterPartTimeJob.style.display = "block"; break; case Locations.IshimaTravelAgency: @@ -1686,8 +1689,29 @@ initLocationButtons = function() { }); purchaseHomeRam.addEventListener("click", function() { - purchaseRamForHomeBoxCreate(); - return false; + //Calculate how many times ram has been upgraded (doubled) + var currentRam = Player.getHomeComputer().maxRam; + var newRam = currentRam * 2; + var numUpgrades = Math.log2(currentRam); + + //Calculate cost + //Have cost increase by some percentage each time RAM has been upgraded + var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome; + var mult = Math.pow(1.55, numUpgrades); + cost = cost * mult; + + var yesBtn = yesNoBoxGetYesButton(), noBtn = yesNoBoxGetNoButton(); + yesBtn.innerHTML = "Purchase"; noBtn.innerHTML = "Cancel"; + yesBtn.addEventListener("click", ()=>{ + purchaseRamForHomeComputer(cost); + yesNoBoxClose(); + }); + noBtn.addEventListener("click", ()=>{ + yesNoBoxClose(); + }); + yesNoBoxCreate("Would you like to purchase additional RAM for your home computer?
" + + "This will upgrade your RAM from " + currentRam + "GB to " + newRam + "GB.
" + + "This will cost $" + formatNumber(cost, 2)); }); travelToAevum.addEventListener("click", function() { @@ -1806,8 +1830,7 @@ purchaseTorRouter = function() { } Player.loseMoney(CONSTANTS.TorRouterCost); - var darkweb = new Server(); - darkweb.init(createRandomIp(), "darkweb", "", true, false, false, false, 1); + var darkweb = new Server(createRandomIp(), "darkweb", "", false, false, false, 1); AddToAllServers(darkweb); SpecialServerIps.addIp("Darkweb Server", darkweb.ip); @@ -1947,6 +1970,23 @@ function setJobRequirementTooltip(loc, entryPosType, btn) { if (company == null) {return;} var pos = Player.getNextCompanyPosition(company, entryPosType); if (pos == null) {return}; + if (!company.hasPosition(pos)) {return;} var reqText = getJobRequirementText(company, pos, true); btn.innerHTML += "" + reqText + ""; } + +function travelBoxCreate(destCityName, cost) { + var yesBtn = yesNoBoxGetYesButton(), noBtn = yesNoBoxGetNoButton(); + yesBtn.innerHTML = "Yes"; + noBtn.innerHTML = "No"; + noBtn.addEventListener("click", () => { + yesNoBoxClose(); + return false; + }); + yesBtn.addEventListener("click", () => { + yesNoBoxClose(); + travelToCity(destCityName, cost); + return false; + }); + yesNoBoxCreate("Would you like to travel to " + destCityName + "? The trip will cost $" + formatNumber(cost, 2) + "."); +} diff --git a/src/Message.js b/src/Message.js index 14732845d9..80f92b7477 100644 --- a/src/Message.js +++ b/src/Message.js @@ -1,5 +1,5 @@ /* Message.js */ -function Message(filename, msg) { +function Message(filename="", msg="") { this.filename = filename; this.msg = msg; this.recvd = false; diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index ee2ebf60d6..de990413fc 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -334,7 +334,7 @@ function NetscriptFunctions(workerScript) { } var server = getServer(ip); if (server == null) { - throw makeRuntimeRejectMsg(workerScript, "Invalid hostname/ip passed into exec() command: " + args[1]); + throw makeRuntimeRejectMsg(workerScript, "Invalid hostname/ip passed into exec() command: " + ip); } return runScriptFromScript(server, scriptname, argsForNewScript, workerScript, threads); }, @@ -671,8 +671,7 @@ function NetscriptFunctions(workerScript) { workerScript.scriptRef.log("Error: Not enough money to purchase server. Need $" + formatNumber(cost, 2)); return ""; } - var newServ = new Server(); - newServ.init(createRandomIp(), hostnameStr, "", true, false, true, true, ram); + var newServ = new Server(createRandomIp(), hostnameStr, "", false, true, true, ram); AddToAllServers(newServ); Player.purchasedServers.push(newServ.ip); @@ -692,15 +691,25 @@ function NetscriptFunctions(workerScript) { return false; } - if (!server.purchasedByPlayer) { + if (!server.purchasedByPlayer || server.hostname == "home") { workerScript.scriptRef.log("Error: Server " + server.hostname + " is not a purchased server. " + - "Cannot be deleted. deleteSErver failed"); + "Cannot be deleted. deleteServer failed"); return false; } + var ip = server.ip; - //Delete from all servers - delete AllServers[ip]; + //A server cannot delete itself + if (ip == workerScript.serverIp) { + workerScript.scriptRef.log("Error: Cannot call deleteServer() on self. Function failed"); + return false; + } + + //Delete all scripts running on server + if (server.runningScripts.length > 0) { + workerScript.scriptRef.log("Error: Cannot delete server " + server.hostname + " because it still has scripts running."); + return false; + } //Delete from player's purchasedServers array var found = false; @@ -718,6 +727,9 @@ function NetscriptFunctions(workerScript) { return false; } + //Delete from all servers + delete AllServers[ip]; + //Delete from home computer found = false; var homeComputer = Player.getHomeComputer(); @@ -740,7 +752,7 @@ function NetscriptFunctions(workerScript) { write : function(port, data="") { if (!isNaN(port)) { //Port 1-10 - if (port < 1 && port > 10) { + if (port < 1 || port > 10) { throw makeRuntimeRejectMsg(workerScript, "Trying to write to invalid port: " + port + ". Only ports 1-10 are valid."); } var portName = "Port" + String(port); @@ -761,7 +773,7 @@ function NetscriptFunctions(workerScript) { read : function(port) { if (!isNaN(port)) { //Port 1-10 - if (port < 1 && port > 10) { + if (port < 1 || port > 10) { throw makeRuntimeRejectMsg(workerScript, "Trying to write to invalid port: " + port + ". Only ports 1-10 are valid."); } var portName = "Port" + String(port); @@ -777,7 +789,48 @@ function NetscriptFunctions(workerScript) { } else { throw makeRuntimeRejectMsg(workerScript, "Invalid argument passed in for port: " + port + ". Must be a number between 1 and 10"); } - } - + }, + scriptRunning : function(scriptname, ip) { + var server = getServer(ip); + if (server == null) { + workerScript.scriptRef.log("scriptRunning() failed. Invalid IP or hostname passed in: " + ip); + throw makeRuntimeRejectMsg(workerScript, "scriptRunning() failed. Invalid IP or hostname passed in: " + ip); + } + for (var i = 0; i < server.runningScripts.length; ++i) { + if (server.runningScripts[i].filename == scriptname) { + return true; + } + } + return false; + }, + scriptKill : function(scriptname, ip) { + var server = getServer(ip); + if (server == null) { + workerScript.scriptRef.log("scriptKill() failed. Invalid IP or hostname passed in: " + ip); + throw makeRuntimeRejectMsg(workerScript, "scriptKill() failed. Invalid IP or hostname passed in: " + ip); + } + var suc = false; + for (var i = 0; i < server.runningScripts.length; ++i) { + if (server.runningScripts[i].filename == scriptname) { + killWorkerScript(server.runningScripts[i], server.ip); + suc = true; + } + } + return suc; + }, + getScriptRam : function (scriptname, ip) { + var server = getServer(ip); + if (server == null) { + workerScript.scriptRef.log("getScriptRam() failed. Invalid IP or hostname passed in: " + ip); + throw makeRuntimeRejectMsg(workerScript, "getScriptRam() failed. Invalid IP or hostname passed in: " + ip); + } + for (var i = 0; i < server.runningScripts.length; ++i) { + if (server.runningScripts[i].filename == scriptname) { + return server.runningScripts[i].scriptRef.ramUsage; + } + } + return 0; + }, + } } diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index f90703b0d9..9746760a21 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -109,6 +109,7 @@ function runScriptsLoop() { //Delete script from the runningScripts array on its host serverIp var ip = workerScripts[i].serverIp; var name = workerScripts[i].name; + for (var j = 0; j < AllServers[ip].runningScripts.length; j++) { if (AllServers[ip].runningScripts[j].filename == name && compareArrays(AllServers[ip].runningScripts[j].args, workerScripts[i].args)) { diff --git a/src/Player.js b/src/Player.js index 6a9e63236d..6e1d1b4e85 100644 --- a/src/Player.js +++ b/src/Player.js @@ -21,21 +21,6 @@ function PlayerObject() { this.hacking_money_mult = 1; //Increase through ascensions/augmentations. Can't go above 1 this.hacking_grow_mult = 1; - //Note: "Lifetime" refers to current ascension, "total" refers to the entire game history - //Accumulative stats and skills - this.total_hacking = 1; - this.total_strength = 1; - this.total_defense = 1; - this.total_dexterity = 1; - this.total_agility = 1; - this.total_charisma = 1; - this.lifetime_hacking = 1; - this.lifetime_strength = 1; - this.lifetime_defense = 1; - this.lifetime_dexterity = 1; - this.lifetime_agility = 1; - this.lifetime_charisma = 1; - //Experience and multipliers this.hacking_exp = 0; this.strength_exp = 0; @@ -89,35 +74,21 @@ function PlayerObject() { this.factionInvitations = []; //Outstanding faction invitations //Augmentations - this.queuedAugmentations = []; //Purchased but not installed, names only - this.augmentations = []; //Names of all installed augmentations + this.queuedAugmentations = []; + this.augmentations = []; + + this.sourceFiles = []; - //Crime statistics (Total refers to this 'simulation'. Lifetime is forever) + //Crime statistics this.karma = 0; this.numTimesShoplifted = 0; - this.numTimesShopliftedTotal = 0; - this.numTimesShopliftedLifetime = 0; this.numPeopleMugged = 0; - this.numPeopleMuggedTotal = 0; - this.numPeopleMuggedLifetime = 0; this.numTimesDealtDrugs = 0; - this.numTimesDealtDrugsTotal = 0; - this.numTimesDealtDrugsLifetime = 0; this.numTimesTraffickArms = 0; - this.numTimesTraffickArmsTotal = 0; - this.numTimesTraffickArmsLifetime = 0; this.numPeopleKilled = 0; - this.numPeopleKilledTotal = 0; - this.numPeopleKilledLifetime = 0; this.numTimesGrandTheftAuto = 0; - this.numTimesGrandTheftAutoTotal = 0; - this.numTimesGrandTheftAutoLifetime = 0; this.numTimesKidnapped = 0; - this.numTimesKidnappedTotal = 0; - this.numTimesKidnappedLifetime = 0; this.numTimesHeist = 0; - this.numTimesHeistTotal = 0; - this.numTimesHeistLifetime = 0; this.crime_money_mult = 1; this.crime_success_mult = 1; @@ -175,6 +146,12 @@ function PlayerObject() { this.hasWseAccount = false; this.hasTixApiAccess = false; + //Gang + this.gang = null; + + //bitnode + this.bitNodeN = 1; + //Used to store the last update time. this.lastUpdate = 0; this.totalPlaytime = 0; @@ -183,8 +160,7 @@ function PlayerObject() { PlayerObject.prototype.init = function() { /* Initialize Player's home computer */ - var t_homeComp = new Server(); - t_homeComp.init(createRandomIp(), "home", "Home PC", true, true, true, true, 8); + var t_homeComp = new Server(createRandomIp(), "home", "Home PC", true, true, true, 8); this.homeComputer = t_homeComp.ip; this.currentServer = t_homeComp.ip; AddToAllServers(t_homeComp); @@ -220,6 +196,41 @@ PlayerObject.prototype.updateSkillLevels = function() { Player.hp = Math.round(this.max_hp * ratio); } +PlayerObject.prototype.resetMultipliers = function() { + this.hacking_chance_mult = 1; + this.hacking_speed_mult = 1; + this.hacking_money_mult = 1; + this.hacking_grow_mult = 1; + + this.hacking_mult = 1; + this.strength_mult = 1; + this.defense_mult = 1; + this.dexterity_mult = 1; + this.agility_mult = 1; + this.charisma_mult = 1; + + this.hacking_exp_mult = 1; + this.strength_exp_mult = 1; + this.defense_exp_mult = 1; + this.dexterity_exp_mult = 1; + this.agility_exp_mult = 1; + this.charisma_exp_mult = 1; + + this.company_rep_mult = 1; + this.faction_rep_mult = 1; + + this.crime_money_mult = 1; + this.crime_success_mult = 1; + + this.hacknet_node_money_mult = 1; + this.hacknet_node_purchase_cost_mult = 1; + this.hacknet_node_ram_cost_mult = 1; + this.hacknet_node_core_cost_mult = 1; + this.hacknet_node_level_cost_mult = 1; + + this.work_money_mult = 1; +} + //Calculates the chance of hacking a server //The formula is: // (2 * hacking_chance_multiplier * hacking_skill - requiredLevel) 100 - difficulty @@ -649,6 +660,7 @@ PlayerObject.prototype.startFactionWork = function(faction) { var favorMult = 1 + (faction.favor / 100); if (isNaN(favorMult)) {favorMult = 1;} this.workRepGainRate *= favorMult; + this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain; this.isWorking = true; this.workType = CONSTANTS.WorkTypeFaction; @@ -735,6 +747,7 @@ PlayerObject.prototype.workForFaction = function(numCycles) { var favorMult = 1 + (faction.favor / 100); if (isNaN(favorMult)) {favorMult = 1;} this.workRepGainRate *= favorMult; + this.workRepGainRate *= BitNodeMultipliers.FactionWorkRepGain; this.workHackExpGained += this.workHackExpGainRate * numCycles; this.workStrExpGained += this.workStrExpGainRate * numCycles; @@ -1092,7 +1105,7 @@ PlayerObject.prototype.startCrime = function(hackExp, strExp, defExp, dexExp, ag this.workDexExpGained = dexExp * this.dexterity_exp_mult; this.workAgiExpGained = agiExp * this.agility_exp_mult; this.workChaExpGained = chaExp * this.charisma_exp_mult; - this.workMoneyGained = money * this.crime_money_mult; + this.workMoneyGained = money * this.crime_money_mult * BitNodeMultipliers.CrimeMoney; this.timeNeededToCompleteWork = time; @@ -1137,13 +1150,14 @@ PlayerObject.prototype.finishCrime = function(cancelled) { ++this.numTimesShoplifted; break; case CONSTANTS.CrimeRobStore: - + this.karma -= 0.5; break; case CONSTANTS.CrimeMug: this.karma -= 0.25; ++this.numPeopleMugged; break; case CONSTANTS.CrimeLarceny: + this.karma -= 1.5; break; case CONSTANTS.CrimeDrugs: ++this.numTimesDealtDrugs; diff --git a/src/Prestige.js b/src/Prestige.js index e4684f027c..539b6e96e5 100644 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -2,44 +2,16 @@ //Prestige by purchasing augmentation function prestigeAugmentation() { - //Sum up lifetime/total statistics - Player.total_hacking += Player.hacking_skill; - Player.lifetime_hacking += Player.hacking_skill; - Player.total_strength += Player.strength; - Player.lifetime_strength += Player.strength; - Player.total_defense += Player.defense; - Player.lifetime_defense += Player.defense; - Player.total_dexterity += Player.dexterity; - Player.lifetime_dexterity += Player.dexterity; - Player.total_agility += Player.agility; - Player.lifetime_agility += Player.agility; - Player.total_charisma += Player.charisma; - Player.lifetime_charisma += Player.charisma; + initBitNodeMultipliers(); //Crime statistics - Player.numTimesShopliftedTotal += Player.numTimesShoplifted; - Player.numTimesShopliftedLifetime += Player.numTimesShoplifted; Player.numTimesShoplifted = 0; - Player.numPeopleMuggedTotal += Player.numPeopleMugged; - Player.numPeopleMuggedLifetime += Player.numPeopleMugged; Player.numPeopleMugged = 0; - Player.numTimesDealtDrugsTotal += Player.numTimesDealtDrugs; - Player.numTimesDealtDrugsLifetime += Player.numTimesDealtDrugs; Player.numTimesDealtDrugs = 0; - Player.numTimesTraffickArmsTotal += Player.numTimesTraffickArms; - Player.numTimesTraffickArmsLifetime += Player.numTimesTraffickArms; Player.numTimesTraffickArms = 0; - Player.numPeopleKilledTotal += Player.numPeopleKilled; - Player.numPeopleKilledLifetime += Player.numPeopleKilled; Player.numPeopleKilled = 0; - Player.numTimesGrandTheftAutoTotal += Player.numTimesGrandTheftAuto; - Player.numTimesGrandTheftAutoLifetime += Player.numTimesGrandTheftAuto; Player.numTimesGrandTheftAuto = 0; - Player.numTimesKidnappedTotal += Player.numTimesKidnapped; - Player.numTimesKidnappedLifetime += Player.numTimesKidnapped; Player.numTimesKidnapped = 0; - Player.numTimesHeistTotal += Player.numTimesHeist; - Player.numTimesHeistLifetime += Player.numTimesHeist; Player.numTimesHeist = 0; Player.karma = 0; @@ -134,7 +106,6 @@ function prestigeAugmentation() { homeComp.runningScripts = []; homeComp.serversOnNetwork = []; homeComp.isConnectedTo = true; - homeComp.isOnline = true; homeComp.ramUsed = 0; homeComp.programs.push(Programs.NukeProgram); if (augmentationExists(AugmentationNames.Neurolink) && @@ -191,7 +162,8 @@ function prestigeAugmentation() { //Re-initialize things - This will update any changes initFactions(); //Factions must be initialized before augmentations - initAugmentations(); + initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers + Player.reapplyAllSourceFiles(); initCompanies(); //Clear terminal @@ -212,6 +184,14 @@ function prestigeAugmentation() { } } + //Gang, in BitNode 2 + if (Player.bitNodeN == 2 && Player.inGang()) { + var faction = Factions[Player.gang.facName]; + if (faction instanceof Faction) { + joinFaction(faction); + } + } + Player.playtimeSinceLastAug = 0; var mainMenu = document.getElementById("mainmenu-container"); @@ -229,3 +209,192 @@ function prestigeAugmentation() { } } } + + +//Prestige by destroying Bit Node and gaining a Source File +function prestigeSourceFile() { + initBitNodeMultipliers(); + + //Crime statistics + Player.numTimesShoplifted = 0; + Player.numPeopleMugged = 0; + Player.numTimesDealtDrugs = 0; + Player.numTimesTraffickArms = 0; + Player.numPeopleKilled = 0; + Player.numTimesGrandTheftAuto = 0; + Player.numTimesKidnapped = 0; + Player.numTimesHeist = 0; + + Player.karma = 0; + + //Reset stats + Player.hacking_skill = 1; + + Player.strength = 1; + Player.defense = 1; + Player.dexterity = 1; + Player.agility = 1; + + Player.charisma = 1; + + 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.money = new Decimal(1000); + + Player.city = Locations.Sector12; + Player.location = ""; + + Player.companyName = ""; + Player.companyPosition = ""; + + Player.currentServer = ""; + Player.discoveredServers = []; + Player.purchasedServers = []; + + Player.factions = []; + Player.factionInvitations = []; + + Player.queuedAugmentations = []; + Player.augmentations = []; + + Player.startAction = false; + Player.actionTime = 0; + + Player.isWorking = false; + Player.currentWorkFactionName = ""; + Player.currentWorkFactionDescription = ""; + this.createProgramName = ""; + this.className = ""; + this.crimeType = ""; + + Player.workHackExpGainRate = 0; + Player.workStrExpGainRate = 0; + Player.workDefExpGainRate = 0; + Player.workDexExpGainRate = 0; + Player.workAgiExpGainRate = 0; + Player.workChaExpGainRate = 0; + Player.workRepGainRate = 0; + Player.workMoneyGainRate = 0; + + Player.workHackExpGained = 0; + Player.workStrExpGained = 0; + Player.workDefExpGained = 0; + Player.workDexExpGained = 0; + Player.workAgiExpGained = 0; + Player.workChaExpGained = 0; + Player.workRepGained = 0; + Player.workMoneyGained = 0; + + Player.timeWorked = 0; + + Player.lastUpdate = new Date().getTime(); + + //Delete all Worker Scripts objects + for (var i = 0; i < workerScripts.length; ++i) { + deleteActiveScriptsItem(workerScripts[i]); + workerScripts[i].env.stopFlag = true; + } + workerScripts.length = 0; + + var homeComp = Player.getHomeComputer(); + //Delete all servers except home computer + for (var member in AllServers) { + delete AllServers[member]; + } + AllServers = {}; + //Delete Special Server IPs + for (var member in SpecialServerIps) { + delete SpecialServerIps[member]; + } + SpecialServersIps = null; + + //Reset home computer (only the programs) and add to AllServers + homeComp.programs.length = 0; + homeComp.runningScripts = []; + homeComp.serversOnNetwork = []; + homeComp.isConnectedTo = true; + homeComp.ramUsed = 0; + homeComp.programs.push(Programs.NukeProgram); + var srcFile1Owned = false; + for (var i = 0; i < Player.sourceFiles.length; ++i) { + if (Player.sourceFiles[i].n == 1) { + srcFile1Owned = true; + } + } + if (srcFile1Owned) { + homeComp.maxRam = 32; + } else { + homeComp.maxRam = 8; + } + Player.currentServer = homeComp.ip; + Player.homeComputer = homeComp.ip; + AddToAllServers(homeComp); + + //Re-create foreign servers + SpecialServerIps = new SpecialServerIpsMap(); //Must be done before initForeignServers() + initForeignServers(); + + //Darkweb is purchase-able + document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button"); + + //Reset statistics of all scripts on home computer + for (var i = 0; i < homeComp.scripts.length; ++i) { + var s = homeComp.scripts[i]; + } + //Delete messages on home computer + homeComp.messages.length = 0; + + //Delete Hacknet Nodes + Player.hacknetNodes.length = 0; + Player.totalHacknetNodeProduction = 0; + + //Reset favor for Companies + for (var member in Companies) { + if (Companies.hasOwnProperty(member)) { + Companies[member].favor = 0; + } + } + + //Reset favor for factions + for (var member in Factions) { + if (Factions.hasOwnProperty(member)) { + Factions[member].favor = 0; + } + } + + //Stop a Terminal action if there is one + if (Engine._actionInProgress) { + Engine._actionInProgress = false; + Terminal.finishAction(true); + } + + //Re-initialize things - This will update any changes + initFactions(); //Factions must be initialized before augmentations + initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers + Player.reapplyAllSourceFiles(); + initCompanies(); + + //Clear terminal + $("#terminal tr:not(:last)").remove(); + postNetburnerText(); + + //Messages + initMessages(); + + //Gang + Player.gang = null; + + //Reset Stock market + Player.hasWseAccount = false; + + Player.playtimeSinceLastAug = 0; + + var mainMenu = document.getElementById("mainmenu-container"); + mainMenu.style.visibility = "visible"; + Engine.loadTerminalContent(); +} diff --git a/src/RedPill.js b/src/RedPill.js index 9aaf5717b3..2145eb65db 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -1,14 +1,14 @@ -/* RedPill.js +/* RedPill.js * Implements what happens when you have Red Pill augmentation and then hack the world daemon */ - + //Returns promise function writeRedPillLine(line) { return new Promise(function(resolve, reject) { - + var container = document.getElementById("red-pill-container"); var pElem = document.createElement("p"); container.appendChild(pElem); - + var promise = writeRedPillLetter(pElem, line, 0); promise.then(function(res) { resolve(res); @@ -39,7 +39,7 @@ function writeRedPillLetter(pElem, line, i=0) { } redPillFlag = false; -function hackWorldDaemon(currentNode="BitNode-1") { +function hackWorldDaemon(currentNodeNumber) { redPillFlag = true; Engine.loadRedPillContent(); return writeRedPillLine("[ERROR] SEMPOOL INVALID").then(function() { @@ -59,7 +59,7 @@ function hackWorldDaemon(currentNode="BitNode-1") { }).then(function() { return writeRedPillLine("Failsafe initiated..."); }).then(function() { - return writeRedPillLine("Restarting " + currentNode + "..."); + return writeRedPillLine("Restarting BitNode-" + currentNodeNumber + "..."); }).then(function() { return writeRedPillLine("..........."); }).then(function() { @@ -71,27 +71,65 @@ function hackWorldDaemon(currentNode="BitNode-1") { }).then(function() { return writeRedPillLine("..............................................") }).then(function() { - return loadBitVerse(); + return loadBitVerse(currentNodeNumber); }).catch(function(e){ console.log("ERROR: " + e.toString()); }); } -function loadBitVerse() { +//The bitNode name passed in will have a hyphen between number (e.g. BitNode-1) +//This needs to be removed +function giveSourceFile(bitNodeNumber) { + var sourceFileKey = "SourceFile"+ bitNodeNumber.toString(); + var sourceFile = SourceFiles[sourceFileKey]; + if (sourceFile == null) { + console.log("ERROR: could not find source file for Bit node: " + bitNodeNumber); + return; + } + + //Check if player already has this source file + var alreadyOwned = false; + var ownedSourceFile = null; + for (var i = 0; i < Player.sourceFiles; ++i) { + if (Player.sourceFiles[i].n == bitNodeNumber) { + alreadyOwned = true; + ownedSourceFile = Player.sourceFiles[i]; + break; + } + } + + if (alreadyOwned && ownedSourceFile) { + if (ownedSourceFile.lvl >= 3) { + dialogBoxCreate("The Source-File for the BitNode you just destroyed, " + sourceFile.name + ", " + + "is already at max level!"); + } else { + ++ownedSourceFile.lvl; + dialogBoxCreate(sourceFile.name + " was upgraded to level " + ownedSourceFile.lvl + " for " + + "destroying its corresponding BitNode!"); + } + } else { + var playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1); + Player.sourceFiles.push(playerSrcFile); + dialogBoxCreate("You received a Source-File for destroying a Bit Node!
" + + sourceFile.name + "
" + sourceFile.info); + } +} + +function loadBitVerse(destroyedBitNodeNum) { //Clear the screen var container = document.getElementById("red-pill-container"); while (container.firstChild) { container.removeChild(container.firstChild); } - + //Create the Bit Verse var bitVerseImage = document.createElement("pre"); var bitNodes = []; for (var i = 1; i <= 12; ++i) { bitNodes.push(createBitNode(i)); } - - bitVerseImage.innerHTML = + + bitVerseImage.innerHTML = " O
" + " | O O | O O |
" + " O | | / __| \\ | | O
" + @@ -116,9 +154,9 @@ function loadBitVerse() { " \\ \\| / \\ / \\ |/ /
" + " "+bitNodes[0]+" |/ "+bitNodes[1]+" | | "+bitNodes[2]+" \\| "+bitNodes[3]+"
" + " | | | | | | | |
" + - " \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/
"; - - + " \\JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/
"; + + /* " O
" + " | O O | O O |
" + @@ -144,47 +182,37 @@ function loadBitVerse() { " \ \| / \ / \ |/ /
" + " O |/ O | | O \| O
" + " | | | | | | | |
" + - " \JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/
"; + " \JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/
"; */ - + container.appendChild(bitVerseImage); - + //Bit node event listeners for (var i = 1; i <= 12; ++i) { - (function() { + (function(i) { var elemId = "bitnode-" + i.toString(); var elem = clearEventListeners(elemId); if (elem == null) {return;} - if (i == 1) { + if (i == 1 || i == 2) { elem.addEventListener("click", function() { - prestigeAugmentation(); - dialogBoxCreate("Congrats! You've reached the current end of the game. Eventually the " + - "BitNode/Bitverse will be fully implemented with cool new features, so check " + - "it out again in the future! You have now been returned " + - "to the original BitNode (BitNode-1) and you can continue playing if you wish. "); - redPillFlag = false; - var container = document.getElementById("red-pill-container"); - while (container.firstChild) { - container.removeChild(container.firstChild); + var bitNodeKey = "BitNode" + i; + var bitNode = BitNodes[bitNodeKey]; + if (bitNode == null) { + console.log("ERROR: Could not find BitNode object for number: " + i); + return; } - - //Reenable terminal - $("#hack-progress-bar").attr('id', "old-hack-progress-bar"); - $("#hack-progress").attr('id', "old-hack-progress"); - document.getElementById("terminal-input-td").innerHTML = '$ '; - $('input[class=terminal-input]').prop('disabled', false); - - Terminal.hackFlag = false; + yesNoBoxCreate("BitNode-" + i + ": " + bitNode.name + "
" + bitNode.info); + createBitNodeYesNoEventListeners(i, destroyedBitNodeNum); }); } else { elem.addEventListener("click", function() { dialogBoxCreate("Not yet implemented! Coming soon!") }); } - }()); //Immediate invocation closure + }(i)); //Immediate invocation closure } - - //Create lore text + + //Create lore text return writeRedPillLine("Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently").then(function() { return writeRedPillLine("Our species fought back, but it was futile. The Enders had technology far beyond our own..."); }).then(function() { @@ -234,10 +262,43 @@ function createBitNode(n) { var bitNodeStr = "BitNode" + n.toString(); var bitNode = BitNodes[bitNodeStr]; if (bitNode == null) {return "O";} - return "O" + - "" + - "BitNode-" + bitNode.number.toString() + "
" + bitNode.name+ "
" + - bitNode.desc + "
" + + return "O" + + "" + + "BitNode-" + bitNode.number.toString() + "
" + bitNode.name+ "
" + + bitNode.desc + "
" + ""; } +function createBitNodeYesNoEventListeners(newBitNode, destroyedBitNode) { + var yesBtn = yesNoBoxGetYesButton(); + yesBtn.innerHTML = "Enter BitNode-" + newBitNode; + yesBtn.addEventListener("click", function() { + giveSourceFile(destroyedBitNode); + redPillFlag = false; + var container = document.getElementById("red-pill-container"); + while (container.firstChild) { + container.removeChild(container.firstChild); + } + + //Set new Bit Node + Player.bitNodeN = newBitNode; + + //Reenable terminal + $("#hack-progress-bar").attr('id', "old-hack-progress-bar"); + $("#hack-progress").attr('id', "old-hack-progress"); + document.getElementById("terminal-input-td").innerHTML = '$ '; + $('input[class=terminal-input]').prop('disabled', false); + + Terminal.hackFlag = false; + + prestigeSourceFile(); + yesNoBoxClose(); + //TODO Dialog box for going ot new Bit node + }); + var noBtn = yesNoBoxGetNoButton(); + noBtn.innerHTML = "Back"; + noBtn.addEventListener("click", function() { + yesNoBoxClose(); + }); + +} diff --git a/src/SaveObject.js b/src/SaveObject.js index f065ea82f7..9124f5b6b4 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -43,6 +43,9 @@ BitburnerSaveObject.prototype.saveGame = function() { this.StockMarketSave = JSON.stringify(StockMarket); this.SettingsSave = JSON.stringify(Settings); this.VersionSave = JSON.stringify(CONSTANTS.Version); + if (Player.bitNodeN == 2 && Player.inGang()) { + this.AllGangsSave = JSON.stringify(AllGangs); + } var saveString = btoa(unescape(encodeURIComponent(JSON.stringify(this)))); window.localStorage.setItem("bitburnerSave", saveString); @@ -118,6 +121,14 @@ loadGame = function(saveObj) { if (saveObj.hasOwnProperty("VersionSave")) { try { var ver = JSON.parse(saveObj.VersionSave, Reviver); + if (ver == "0.27.0") { + if (Player.bitNodeN == null || Player.bitNodeN == 0) { + Player.bitNodeN = 1; + } + if (Player.sourceFiles == null) { + Player.sourceFiles = []; + } + } if (ver != CONSTANTS.Version) { createNewUpdateText(); } @@ -127,6 +138,13 @@ loadGame = function(saveObj) { } else { createNewUpdateText(); } + if (Player.bitNodeN == 2 && Player.inGang() && saveObj.hasOwnProperty("AllGangsSave")) { + try { + AllGangs = JSON.parse(saveObj.AllGangsSave, Reviver); + } catch(e) { + console.log("ERROR: Failed to parse AllGangsSave: " + e); + } + } return true; } @@ -199,10 +217,13 @@ loadImportedGame = function(saveObj, saveString) { if (tempSaveObj.hasOwnProperty("VersionSave")) { try { var ver = JSON.parse(tempSaveObj.VersionSave, Reviver); - if (CONSTANTS.Version == "0.26.3") { - tempPlayer.money = new Decimal(tempPlayer.money); - tempPlayer.total_money = new Decimal(tempPlayer.total_money); - tempPlayer.lifetime_money = new Decimal(tempPlayer.lifetime_money); + if (ver == "0.27.0") { + if (tempPlayer.bitNodeN == null || tempPlayer.bitNodeN == 0) { + tempPlayer.bitNodeN = 1; + } + if (tempPlayer.sourceFiles == null) { + tempPlayer.sourceFiles = []; + } } if (ver != CONSTANTS.Version) { createNewUpdateText(); @@ -213,6 +234,13 @@ loadImportedGame = function(saveObj, saveString) { } else { createNewUpdateText(); } + if (tempPlayer.bitNodeN == 2 && tempPlayer.inGang() && saveObj.hasOwnProperty("AllGangsSave")) { + try { + AllGangs = JSON.parse(saveObj.AllGangsSave, Reviver); + } catch(e) { + console.log("ERROR: Failed to parse AllGangsSave: " + e); + } + } } catch(e) { dialogBoxCreate("Error importing game"); return false; @@ -241,7 +269,8 @@ loadImportedGame = function(saveObj, saveString) { StockMarket = tempStockMarket; } - dialogBoxCreate("Imported game"); + dialogBoxCreate("Imported game! I would suggest saving the game and then reloading the page " + + "to make sure everything runs smoothly"); gameOptionsBoxClose(); //Re-start game diff --git a/src/Script.js b/src/Script.js index 7a8fcacbc3..684dee5dd9 100644 --- a/src/Script.js +++ b/src/Script.js @@ -164,6 +164,7 @@ function calculateRamUsage(codeCopy) { var sqlinjectCount = numOccurrences(codeCopy, "sqlinject("); var runCount = numOccurrences(codeCopy, "run("); var execCount = numOccurrences(codeCopy, "exec("); + var killCount = numOccurrences(codeCopy, "kill(") + numOccurrences(codeCopy, "killall("); var scpCount = numOccurrences(codeCopy, "scp("); var hasRootAccessCount = numOccurrences(codeCopy, "hasRootAccess("); var getHostnameCount = numOccurrences(codeCopy, "getHostname("); @@ -187,11 +188,14 @@ function calculateRamUsage(codeCopy) { numOccurrences(codeCopy, "getStockPosition("); var scriptBuySellStockCount = numOccurrences(codeCopy, "buyStock(") + numOccurrences(codeCopy, "sellStock("); - var scriptPurchaseServerCount = numOccurrences(codeCopy, "purchaseServer(") + + var scriptPurchaseServerCount = numOccurrences(codeCopy, "purchaseServer(") + numOccurrences(codeCopy, "deleteServer("); var scriptRoundCount = numOccurrences(codeCopy, "round("); var scriptWriteCount = numOccurrences(codeCopy, "write("); var scriptReadCount = numOccurrences(codeCopy, "read("); + var arbScriptCount = numOccurrences(codeCopy, "scriptRunning(") + + numOccurrences(codeCopy, "scriptKill("); + var getScriptCount = numOccurrences(codeCopy, "getScriptRam("); return baseRam + ((whileCount * CONSTANTS.ScriptWhileRamCost) + @@ -209,6 +213,7 @@ function calculateRamUsage(codeCopy) { (sqlinjectCount * CONSTANTS.ScriptSqlinjectRamCost) + (runCount * CONSTANTS.ScriptRunRamCost) + (execCount * CONSTANTS.ScriptExecRamCost) + + (killCount * CONSTANTS.ScriptKillRamCost) + (scpCount * CONSTANTS.ScriptScpRamCost) + (hasRootAccessCount * CONSTANTS.ScriptHasRootAccessRamCost) + (getHostnameCount * CONSTANTS.ScriptGetHostnameRamCost) + @@ -233,7 +238,9 @@ function calculateRamUsage(codeCopy) { (scriptPurchaseServerCount * CONSTANTS.ScriptPurchaseServerRamCost) + (scriptRoundCount * CONSTANTS.ScriptRoundRamCost) + (scriptWriteCount * CONSTANTS.ScriptReadWriteRamCost) + - (scriptReadCount * CONSTANTS.ScriptReadWriteRamCost)); + (scriptReadCount * CONSTANTS.ScriptReadWriteRamCost) + + (arbScriptCount * CONSTANTS.ScriptArbScriptRamCost) + + (getScriptCount * CONSTANTS.ScriptGetScriptCost)); } Script.prototype.toJSON = function() { diff --git a/src/Server.js b/src/Server.js index b91be3a8e7..952efa9631 100644 --- a/src/Server.js +++ b/src/Server.js @@ -1,22 +1,28 @@ //Netburner Server class //TODO Make a map of all IPS in the game so far so that we don't accidentally // get duplicate IPs..however unlikely it is -function Server() { +function Server(ip=createRandomIp(), hostname="", organizationName="", + isConnectedTo=false, adminRights=false, purchasedByPlayer=false, maxRam=0) { /* Properties */ //Connection information - this.ip = "0.0.0.0"; - this.hostname = ""; - this.organizationName = ""; - this.isOnline = true; - this.isConnectedTo = false; //Whether the player is connected to this server + this.ip = ip; + var i = 0; + while (GetServerByHostname(hostname) != null) { + //Server already exists + hostname = hostname + "-" + i; + ++i; + } + this.hostname = hostname; + this.organizationName = organizationName; + this.isConnectedTo = isConnectedTo; //Whether the player is connected to this server //Access information - this.hasAdminRights = false; //Whether player has admin rights - this.purchasedByPlayer = false; + this.hasAdminRights = adminRights; //Whether player has admin rights + this.purchasedByPlayer = purchasedByPlayer; this.manuallyHacked = false; //Flag that tracks whether or not the server has been hacked at least once //RAM, CPU speed and Scripts - this.maxRam = 1; //GB + this.maxRam = maxRam; //GB this.ramUsed = 0; this.cpuSpeed = 1; //MHz @@ -26,7 +32,6 @@ function Server() { this.messages = []; /* Hacking information (only valid for "foreign" aka non-purchased servers) */ - //Skill required to attempt a hack. Whether a hack is successful will be determined //by a separate formula this.requiredHackingSkill = 1; @@ -56,26 +61,6 @@ function Server() { this.openPortCount = 0; }; -//Initialize the properties of a server -Server.prototype.init = function(ip, hostname, organizationName, onlineStatus, isConnectedTo, adminRights, purchasedByPlayer, maxRam) { - this.ip = ip; - - //Check if hostname is unique - var i = 0; - while (GetServerByHostname(hostname) != null) { - //Server already exists - hostname = hostname + "-" + i; - ++i; - } - this.hostname = hostname; - this.organizationName = organizationName; - this.isOnline = onlineStatus; - this.isConnectedTo = isConnectedTo; - this.hasAdminRights = adminRights; - this.purchasedByPlayer = purchasedByPlayer; - this.maxRam = maxRam; -} - //Set the hacking properties of a server Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvailable, hackDifficulty, serverGrowth) { this.requiredHackingSkill = requiredHackingSkill; @@ -84,7 +69,7 @@ Server.prototype.setHackingParameters = function(requiredHackingSkill, moneyAvai } else { this.moneyAvailable = moneyAvailable; } - this.moneyMax = 25 * moneyAvailable; + this.moneyMax = 25 * moneyAvailable * BitNodeMultipliers.ServerMaxMoney; this.hackDifficulty = hackDifficulty; this.baseDifficulty = hackDifficulty; this.minDifficulty = Math.max(1, Math.round(hackDifficulty / 3)); @@ -143,432 +128,363 @@ Reviver.constructors.Server = Server; initForeignServers = function() { //MegaCorporations - var ECorpServer = new Server(); - ECorpServer.init(createRandomIp(), "ecorp", "ECorp", true, false, false, false, 0); + var ECorpServer = new Server(createRandomIp(), "ecorp", "ECorp", false, false, false, 0); ECorpServer.setHackingParameters(getRandomInt(1150, 1300), getRandomInt(30000000000, 70000000000), 99, 99); ECorpServer.setPortProperties(5); AddToAllServers(ECorpServer); - var MegaCorpServer = new Server(); - MegaCorpServer.init(createRandomIp(), "megacorp", "MegaCorp", true, false, false, false, 0); + var MegaCorpServer = new Server(createRandomIp(), "megacorp", "MegaCorp", false, false, false, 0); MegaCorpServer.setHackingParameters(getRandomInt(1150, 1300), getRandomInt(40000000000, 60000000000), 99, 99); MegaCorpServer.setPortProperties(5); AddToAllServers(MegaCorpServer); - var BachmanAndAssociatesServer = new Server(); - BachmanAndAssociatesServer.init(createRandomIp(), "b-and-a", "Bachman & Associates", true, false, false, false, 0); + var BachmanAndAssociatesServer = new Server(createRandomIp(), "b-and-a", "Bachman & Associates", false, false, false, 0); BachmanAndAssociatesServer.setHackingParameters(getRandomInt(1000, 1050), getRandomInt(20000000000, 25000000000), getRandomInt(75, 85), getRandomInt(65, 75)); BachmanAndAssociatesServer.setPortProperties(5); AddToAllServers(BachmanAndAssociatesServer); - var BladeIndustriesServer = new Server(); - BladeIndustriesServer.init(createRandomIp(), "blade", "Blade Industries", true, false, false, false, 0); + var BladeIndustriesServer = new Server(createRandomIp(), "blade", "Blade Industries", false, false, false, 0); BladeIndustriesServer.setHackingParameters(getRandomInt(1000, 1100), getRandomInt(12000000000, 20000000000), getRandomInt(90, 95), getRandomInt(60, 75)); BladeIndustriesServer.setPortProperties(5); AddToAllServers(BladeIndustriesServer); - var NWOServer = new Server(); - NWOServer.init(createRandomIp(), "nwo", "New World Order", true, false, false, false, 0); + var NWOServer = new Server(createRandomIp(), "nwo", "New World Order", false, false, false, 0); NWOServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(25000000000, 35000000000), 99, getRandomInt(75, 85)); NWOServer.setPortProperties(5); AddToAllServers(NWOServer); - var ClarkeIncorporatedServer = new Server(); - ClarkeIncorporatedServer.init(createRandomIp(), "clarkeinc", "Clarke Incorporated", true, false, false, false, 0); + var ClarkeIncorporatedServer = new Server(createRandomIp(), "clarkeinc", "Clarke Incorporated", false, false, false, 0); ClarkeIncorporatedServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(15000000000, 25000000000), getRandomInt(50, 60), getRandomInt(50, 70)); ClarkeIncorporatedServer.setPortProperties(5); AddToAllServers(ClarkeIncorporatedServer); - var OmniTekIncorporatedServer = new Server(); - OmniTekIncorporatedServer.init(createRandomIp(), "omnitek", "OmniTek Incorporated", true, false, false, false, 0); + var OmniTekIncorporatedServer = new Server(createRandomIp(), "omnitek", "OmniTek Incorporated", false, false, false, 0); OmniTekIncorporatedServer.setHackingParameters(getRandomInt(900, 1100), getRandomInt(15000000000, 20000000000), getRandomInt(90, 99), getRandomInt(95, 99)); OmniTekIncorporatedServer.setPortProperties(5); AddToAllServers(OmniTekIncorporatedServer); - var FourSigmaServer = new Server(); - FourSigmaServer.init(createRandomIp(), "4sigma", "FourSigma", true, false, false, false, 0); + var FourSigmaServer = new Server(createRandomIp(), "4sigma", "FourSigma", false, false, false, 0); FourSigmaServer.setHackingParameters(getRandomInt(950, 1200), getRandomInt(15000000000, 25000000000), getRandomInt(60, 70), getRandomInt(75, 99)); FourSigmaServer.setPortProperties(5); AddToAllServers(FourSigmaServer); - var KuaiGongInternationalServer = new Server(); - KuaiGongInternationalServer.init(createRandomIp(), "kuai-gong", "KuaiGong International", true, false, false, false, 0); + var KuaiGongInternationalServer = new Server(createRandomIp(), "kuai-gong", "KuaiGong International", false, false, false, 0); KuaiGongInternationalServer.setHackingParameters(getRandomInt(1000, 1250), getRandomInt(20000000000, 30000000000), getRandomInt(95, 99), getRandomInt(90, 99)); KuaiGongInternationalServer.setPortProperties(5); AddToAllServers(KuaiGongInternationalServer); //Technology and communications companies (large targets) - var FulcrumTechnologiesServer = new Server(); - FulcrumTechnologiesServer.init(createRandomIp(), "fulcrumtech", "Fulcrum Technologies", true, false, false, false, 64); + var FulcrumTechnologiesServer = new Server(createRandomIp(), "fulcrumtech", "Fulcrum Technologies", false, false, false, 64); FulcrumTechnologiesServer.setHackingParameters(getRandomInt(1000, 1200), getRandomInt(1400000000, 1800000000), getRandomInt(85, 95), getRandomInt(80, 99)); FulcrumTechnologiesServer.setPortProperties(5); AddToAllServers(FulcrumTechnologiesServer); - var FulcrumSecretTechnologiesServer = new Server(); - FulcrumSecretTechnologiesServer.init(createRandomIp(), "fulcrumassets", "Fulcrum Technologies Assets", true, false, false, false, 0); + var FulcrumSecretTechnologiesServer = new Server(createRandomIp(), "fulcrumassets", "Fulcrum Technologies Assets", false, false, false, 0); FulcrumSecretTechnologiesServer.setHackingParameters(getRandomInt(1200, 1500), 1000000, 99, 1); FulcrumSecretTechnologiesServer.setPortProperties(5); AddToAllServers(FulcrumSecretTechnologiesServer); SpecialServerIps.addIp(SpecialServerNames.FulcrumSecretTechnologies, FulcrumSecretTechnologiesServer.ip); - var StormTechnologiesServer = new Server(); - StormTechnologiesServer.init(createRandomIp(), "stormtech", "Storm Technologies", true, false, false, false, 0); + var StormTechnologiesServer = new Server(createRandomIp(), "stormtech", "Storm Technologies", false, false, false, 0); StormTechnologiesServer.setHackingParameters(getRandomInt(900, 1050), getRandomInt(1000000000, 1200000000), getRandomInt(80, 90), getRandomInt(70, 90)); StormTechnologiesServer.setPortProperties(5); AddToAllServers(StormTechnologiesServer); - var DefCommServer = new Server(); - DefCommServer.init(createRandomIp(), "defcomm", "DefComm", true, false, false, false, 0); + var DefCommServer = new Server(createRandomIp(), "defcomm", "DefComm", false, false, false, 0); DefCommServer.setHackingParameters(getRandomInt(900, 1000), getRandomInt(800000000, 950000000), getRandomInt(85, 95), getRandomInt(50, 70)); DefCommServer.setPortProperties(5); AddToAllServers(DefCommServer); - var InfoCommServer = new Server(); - InfoCommServer.init(createRandomIp(), "infocomm", "InfoComm", true, false, false, false, 0); + var InfoCommServer = new Server(createRandomIp(), "infocomm", "InfoComm", false, false, false, 0); InfoCommServer.setHackingParameters(getRandomInt(875, 950), getRandomInt(600000000, 900000000), getRandomInt(70, 90), getRandomInt(35, 75)); InfoCommServer.setPortProperties(5); AddToAllServers(InfoCommServer); - var HeliosLabsServer = new Server(); - HeliosLabsServer.init(createRandomIp(), "helios", "Helios Labs", true, false, false, false, 0); + var HeliosLabsServer = new Server(createRandomIp(), "helios", "Helios Labs", false, false, false, 0); HeliosLabsServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(550000000, 750000000), getRandomInt(85, 95), getRandomInt(70, 80)); HeliosLabsServer.setPortProperties(5); AddToAllServers(HeliosLabsServer); - var VitaLifeServer = new Server(); - VitaLifeServer.init(createRandomIp(), "vitalife", "VitaLife", true, false, false, false, 32); + var VitaLifeServer = new Server(createRandomIp(), "vitalife", "VitaLife", false, false, false, 32); VitaLifeServer.setHackingParameters(getRandomInt(775, 900), getRandomInt(700000000, 800000000), getRandomInt(80, 90), getRandomInt(60, 80)); VitaLifeServer.setPortProperties(5); AddToAllServers(VitaLifeServer); - var IcarusMicrosystemsServer = new Server(); - IcarusMicrosystemsServer.init(createRandomIp(), "icarus", "Icarus Microsystems", true, false, false, false, 0); + var IcarusMicrosystemsServer = new Server(createRandomIp(), "icarus", "Icarus Microsystems", false, false, false, 0); IcarusMicrosystemsServer.setHackingParameters(getRandomInt(850, 925), getRandomInt(900000000, 1000000000), getRandomInt(85, 95), getRandomInt(85, 95)); IcarusMicrosystemsServer.setPortProperties(5); AddToAllServers(IcarusMicrosystemsServer); - var UniversalEnergyServer = new Server(); - UniversalEnergyServer.init(createRandomIp(), "univ-energy", "Universal Energy", true, false, false, false, 32); + var UniversalEnergyServer = new Server(createRandomIp(), "univ-energy", "Universal Energy", false, false, false, 32); UniversalEnergyServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(1100000000, 1200000000), getRandomInt(80, 90), getRandomInt(80, 90)); UniversalEnergyServer.setPortProperties(4); AddToAllServers(UniversalEnergyServer); - var TitanLabsServer = new Server(); - TitanLabsServer.init(createRandomIp(), "titan-labs", "Titan Laboratories", true, false, false, false, 32); + var TitanLabsServer = new Server(createRandomIp(), "titan-labs", "Titan Laboratories", false, false, false, 32); TitanLabsServer.setHackingParameters(getRandomInt(800, 875), getRandomInt(750000000, 900000000), getRandomInt(70, 80), getRandomInt(60, 80)); TitanLabsServer.setPortProperties(5); AddToAllServers(TitanLabsServer); - var MicrodyneTechnologiesServer = new Server(); - MicrodyneTechnologiesServer.init(createRandomIp(), "microdyne", "Microdyne Technologies", true, false, false, false, 16); + var MicrodyneTechnologiesServer = new Server(createRandomIp(), "microdyne", "Microdyne Technologies", false, false, false, 16); MicrodyneTechnologiesServer.setHackingParameters(getRandomInt(800, 875), getRandomInt(500000000, 700000000), getRandomInt(65, 75), getRandomInt(70, 90)); MicrodyneTechnologiesServer.setPortProperties(5); AddToAllServers(MicrodyneTechnologiesServer); - var TaiYangDigitalServer = new Server(); - TaiYangDigitalServer.init(createRandomIp(), "taiyang-digital", "Taiyang Digital", true, false, false, false, 0); + var TaiYangDigitalServer = new Server(createRandomIp(), "taiyang-digital", "Taiyang Digital", false, false, false, 0); TaiYangDigitalServer.setHackingParameters(getRandomInt(850, 950), getRandomInt(800000000, 900000000), getRandomInt(70, 80), getRandomInt(70, 80)); TaiYangDigitalServer.setPortProperties(5); AddToAllServers(TaiYangDigitalServer); - var GalacticCyberSystemsServer = new Server(); - GalacticCyberSystemsServer.init(createRandomIp(), "galactic-cyber", "Galactic Cybersystems", true, false, false, false, 0); + var GalacticCyberSystemsServer = new Server(createRandomIp(), "galactic-cyber", "Galactic Cybersystems", false, false, false, 0); GalacticCyberSystemsServer.setHackingParameters(getRandomInt(825, 875), getRandomInt(750000000, 850000000), getRandomInt(55, 65), getRandomInt(70, 90)); GalacticCyberSystemsServer.setPortProperties(5); AddToAllServers(GalacticCyberSystemsServer); //Defense Companies ("Large" Companies) - var AeroCorpServer = new Server(); - AeroCorpServer.init(createRandomIp(), "aerocorp", "AeroCorp", true, false, false, false, 0); + var AeroCorpServer = new Server(createRandomIp(), "aerocorp", "AeroCorp", false, false, false, 0); AeroCorpServer.setHackingParameters(getRandomInt(850, 925), getRandomInt(1000000000, 1200000000), getRandomInt(80, 90), getRandomInt(55, 65)); AeroCorpServer.setPortProperties(5); AddToAllServers(AeroCorpServer); - var OmniaCybersystemsServer = new Server(); - OmniaCybersystemsServer.init(createRandomIp(), "omnia", "Omnia Cybersystems", true, false, false, false, 0); + var OmniaCybersystemsServer = new Server(createRandomIp(), "omnia", "Omnia Cybersystems", false, false, false, 0); OmniaCybersystemsServer.setHackingParameters(getRandomInt(850, 950), getRandomInt(900000000, 1000000000), getRandomInt(85, 95), getRandomInt(60, 70)); OmniaCybersystemsServer.setPortProperties(5); AddToAllServers(OmniaCybersystemsServer); - var ZBDefenseServer = new Server(); - ZBDefenseServer.init(createRandomIp(), "zb-def", "ZB Defense Industries", true, false, false, false, 0); + var ZBDefenseServer = new Server(createRandomIp(), "zb-def", "ZB Defense Industries", false, false, false, 0); ZBDefenseServer.setHackingParameters(getRandomInt(775, 825), getRandomInt(900000000, 1100000000), getRandomInt(55, 65), getRandomInt(65, 75)); ZBDefenseServer.setPortProperties(4); AddToAllServers(ZBDefenseServer); - var AppliedEnergeticsServer = new Server(); - AppliedEnergeticsServer.init(createRandomIp(), "applied-energetics", "Applied Energetics", true, false, false, false, 0); + var AppliedEnergeticsServer = new Server(createRandomIp(), "applied-energetics", "Applied Energetics", false, false, false, 0); AppliedEnergeticsServer.setHackingParameters(getRandomInt(775, 850), getRandomInt(700000000, 1000000000), getRandomInt(60, 80), getRandomInt(70, 75)); AppliedEnergeticsServer.setPortProperties(4); AddToAllServers(AppliedEnergeticsServer); - var SolarisSpaceSystemsServer = new Server(); - SolarisSpaceSystemsServer.init(createRandomIp(), "solaris", "Solaris Space Systems", true, false, false, false, 0); + var SolarisSpaceSystemsServer = new Server(createRandomIp(), "solaris", "Solaris Space Systems", false, false, false, 0); SolarisSpaceSystemsServer.setHackingParameters(getRandomInt(750, 850), getRandomInt(700000000, 900000000), getRandomInt(70, 80), getRandomInt(70, 80)); SolarisSpaceSystemsServer.setPortProperties(5); AddToAllServers(SolarisSpaceSystemsServer); - var DeltaOneServer = new Server(); - DeltaOneServer.init(createRandomIp(), "deltaone", "Delta One", true, false, false, false, 0); + var DeltaOneServer = new Server(createRandomIp(), "deltaone", "Delta One", false, false, false, 0); DeltaOneServer.setHackingParameters(getRandomInt(800, 900), getRandomInt(1300000000, 1700000000), getRandomInt(75, 85), getRandomInt(50, 70)); DeltaOneServer.setPortProperties(5); AddToAllServers(DeltaOneServer); //Health, medicine, pharmaceutical companies ("Large" targets) - var GlobalPharmaceuticalsServer = new Server(); - GlobalPharmaceuticalsServer.init(createRandomIp(), "global-pharm", "Global Pharmaceuticals", true, false, false, false, 16); + var GlobalPharmaceuticalsServer = new Server(createRandomIp(), "global-pharm", "Global Pharmaceuticals", false, false, false, 16); GlobalPharmaceuticalsServer.setHackingParameters(getRandomInt(750, 850), getRandomInt(1500000000, 1750000000), getRandomInt(75, 85), getRandomInt(80, 90)); GlobalPharmaceuticalsServer.setPortProperties(4); AddToAllServers(GlobalPharmaceuticalsServer); - var NovaMedicalServer = new Server(); - NovaMedicalServer.init(createRandomIp(), "nova-med", "Nova Medical", true, false, false, false, 0); + var NovaMedicalServer = new Server(createRandomIp(), "nova-med", "Nova Medical", false, false, false, 0); NovaMedicalServer.setHackingParameters(getRandomInt(775, 850), getRandomInt(1100000000, 1250000000), getRandomInt(60, 80), getRandomInt(65, 85)); NovaMedicalServer.setPortProperties(4); AddToAllServers(NovaMedicalServer); - var ZeusMedicalServer = new Server(); - ZeusMedicalServer.init(createRandomIp(), "zeus-med", "Zeus Medical", true, false, false, false, 0); + var ZeusMedicalServer = new Server(createRandomIp(), "zeus-med", "Zeus Medical", false, false, false, 0); ZeusMedicalServer.setHackingParameters(getRandomInt(800, 850), getRandomInt(1300000000, 1500000000), getRandomInt(70, 90), getRandomInt(70, 80)); ZeusMedicalServer.setPortProperties(5); AddToAllServers(ZeusMedicalServer); - var UnitaLifeGroupServer = new Server(); - UnitaLifeGroupServer.init(createRandomIp(), "unitalife", "UnitaLife Group", true, false, false, false, 32); + var UnitaLifeGroupServer = new Server(createRandomIp(), "unitalife", "UnitaLife Group", false, false, false, 32); UnitaLifeGroupServer.setHackingParameters(getRandomInt(775, 825), getRandomInt(1000000000, 1100000000), getRandomInt(70, 80), getRandomInt(70, 80)); UnitaLifeGroupServer.setPortProperties(4); AddToAllServers(UnitaLifeGroupServer); //"Medium level" targets - var LexoCorpServer = new Server(); - LexoCorpServer.init(createRandomIp(), "lexo-corp", "Lexo Corporation", true, false, false, false, 16); + var LexoCorpServer = new Server(createRandomIp(), "lexo-corp", "Lexo Corporation", false, false, false, 16); LexoCorpServer.setHackingParameters(getRandomInt(650, 750), getRandomInt(700000000, 800000000), getRandomInt(60, 80), getRandomInt(55, 65)); LexoCorpServer.setPortProperties(4); AddToAllServers(LexoCorpServer); - var RhoConstructionServer = new Server(); - RhoConstructionServer.init(createRandomIp(), "rho-construction", "Rho Construction", true, false, false, false, 0); + var RhoConstructionServer = new Server(createRandomIp(), "rho-construction", "Rho Construction", false, false, false, 0); RhoConstructionServer.setHackingParameters(getRandomInt(475, 525), getRandomInt(500000000, 700000000), getRandomInt(40, 60), getRandomInt(40, 60)); RhoConstructionServer.setPortProperties(3); AddToAllServers(RhoConstructionServer); - var AlphaEnterprisesServer = new Server(); - AlphaEnterprisesServer.init(createRandomIp(), "alpha-ent", "Alpha Enterprises", true, false, false, false, 0); + var AlphaEnterprisesServer = new Server(createRandomIp(), "alpha-ent", "Alpha Enterprises", false, false, false, 0); AlphaEnterprisesServer.setHackingParameters(getRandomInt(500, 600), getRandomInt(600000000, 750000000), getRandomInt(50, 70), getRandomInt(50, 60)); AlphaEnterprisesServer.setPortProperties(4); AddToAllServers(AlphaEnterprisesServer); - var AevumPoliceServer = new Server(); - AevumPoliceServer.init(createRandomIp(), "aevum-police", "Aevum Police Network", true, false, false, false, 0); + var AevumPoliceServer = new Server(createRandomIp(), "aevum-police", "Aevum Police Network", false, false, false, 0); AevumPoliceServer.setHackingParameters(getRandomInt(400, 450), getRandomInt(200000000, 400000000), getRandomInt(70, 80), getRandomInt(30, 50)); AevumPoliceServer.setPortProperties(4); AddToAllServers(AevumPoliceServer); - var RothmanUniversityServer = new Server(); - RothmanUniversityServer.init(createRandomIp(), "rothman-uni", "Rothman University Network", true, false, false, false, 4); + var RothmanUniversityServer = new Server(createRandomIp(), "rothman-uni", "Rothman University Network", false, false, false, 4); RothmanUniversityServer.setHackingParameters(getRandomInt(370, 430), getRandomInt(175000000, 250000000), getRandomInt(45, 55), getRandomInt(35, 45)); RothmanUniversityServer.setPortProperties(3); AddToAllServers(RothmanUniversityServer); - var ZBInstituteOfTechnologyServer = new Server(); - ZBInstituteOfTechnologyServer.init(createRandomIp(), "zb-institute", "ZB Institute of Technology Network", true, false, false, false, 4); + var ZBInstituteOfTechnologyServer = new Server(createRandomIp(), "zb-institute", "ZB Institute of Technology Network", false, false, false, 4); ZBInstituteOfTechnologyServer.setHackingParameters(getRandomInt(725, 775), getRandomInt(800000000, 1100000000), getRandomInt(65, 85), getRandomInt(75, 85)); ZBInstituteOfTechnologyServer.setPortProperties(5); AddToAllServers(ZBInstituteOfTechnologyServer); - var SummitUniversityServer = new Server(); - SummitUniversityServer.init(createRandomIp(), "summit-uni", "Summit University Network", true, false, false, false, 4); + var SummitUniversityServer = new Server(createRandomIp(), "summit-uni", "Summit University Network", false, false, false, 4); SummitUniversityServer.setHackingParameters(getRandomInt(425, 475), getRandomInt(200000000, 350000000), getRandomInt(45, 65), getRandomInt(40, 60)); SummitUniversityServer.setPortProperties(3); AddToAllServers(SummitUniversityServer); - var SysCoreSecuritiesServer = new Server(); - SysCoreSecuritiesServer.init(createRandomIp(), "syscore", "SysCore Securities", true, false, false, false, 0); + var SysCoreSecuritiesServer = new Server(createRandomIp(), "syscore", "SysCore Securities", false, false, false, 0); SysCoreSecuritiesServer.setHackingParameters(getRandomInt(550, 650), getRandomInt(400000000, 600000000), getRandomInt(60, 80), getRandomInt(60, 70)); SysCoreSecuritiesServer.setPortProperties(4); AddToAllServers(SysCoreSecuritiesServer); - var CatalystVenturesServer = new Server(); - CatalystVenturesServer.init(createRandomIp(), "catalyst", "Catalyst Ventures", true, false, false, false, 0); + var CatalystVenturesServer = new Server(createRandomIp(), "catalyst", "Catalyst Ventures", false, false, false, 0); CatalystVenturesServer.setHackingParameters(getRandomInt(400, 450), getRandomInt(300000000, 550000000), getRandomInt(60, 70), getRandomInt(25, 55)); CatalystVenturesServer.setPortProperties(3); AddToAllServers(CatalystVenturesServer); - var TheHubServer = new Server(); - TheHubServer.init(createRandomIp(), "the-hub", "The Hub", true, false, false, false, 0); + var TheHubServer = new Server(createRandomIp(), "the-hub", "The Hub", false, false, false, 0); TheHubServer.setHackingParameters(getRandomInt(275, 325), getRandomInt(150000000, 200000000), getRandomInt(35, 45), getRandomInt(45, 55)); TheHubServer.setPortProperties(2); AddToAllServers(TheHubServer); - var CompuTekServer = new Server(); - CompuTekServer.init(createRandomIp(), "comptek", "CompuTek", true, false, false, false, 8); + var CompuTekServer = new Server(createRandomIp(), "comptek", "CompuTek", false, false, false, 8); CompuTekServer.setHackingParameters(getRandomInt(300, 400), getRandomInt(220000000, 250000000), getRandomInt(55, 65), getRandomInt(45, 65)); CompuTekServer.setPortProperties(3); AddToAllServers(CompuTekServer); - var NetLinkTechnologiesServer = new Server(); - NetLinkTechnologiesServer.init(createRandomIp(), "netlink", "NetLink Technologies", true, false, false, false, 0); + var NetLinkTechnologiesServer = new Server(createRandomIp(), "netlink", "NetLink Technologies", false, false, false, 0); NetLinkTechnologiesServer.setHackingParameters(getRandomInt(375, 425), 275000000, getRandomInt(60, 80), getRandomInt(45, 75)); NetLinkTechnologiesServer.setPortProperties(3); AddToAllServers(NetLinkTechnologiesServer); - var JohnsonOrthopedicsServer = new Server(); - JohnsonOrthopedicsServer.init(createRandomIp(), "johnson-ortho", "Johnson Orthopedics", true, false, false, false, 4); + var JohnsonOrthopedicsServer = new Server(createRandomIp(), "johnson-ortho", "Johnson Orthopedics", false, false, false, 4); JohnsonOrthopedicsServer.setHackingParameters(getRandomInt(250, 300), getRandomInt(70000000, 85000000), getRandomInt(35, 65), getRandomInt(35, 65)); JohnsonOrthopedicsServer.setPortProperties(2); AddToAllServers(JohnsonOrthopedicsServer); //"Low level" targets - var FoodNStuffServer = new Server(); - FoodNStuffServer.init(createRandomIp(), "foodnstuff", "Food N Stuff Supermarket", true, false, false, false, 8); + var FoodNStuffServer = new Server(createRandomIp(), "foodnstuff", "Food N Stuff Supermarket", false, false, false, 8); FoodNStuffServer.setHackingParameters(1, 2000000, 10, 5); FoodNStuffServer.setPortProperties(0); AddToAllServers(FoodNStuffServer); - var SigmaCosmeticsServer = new Server(); - SigmaCosmeticsServer.init(createRandomIp(), "sigma-cosmetics", "Sigma Cosmetics", true, false, false, false, 8); + var SigmaCosmeticsServer = new Server(createRandomIp(), "sigma-cosmetics", "Sigma Cosmetics", false, false, false, 8); SigmaCosmeticsServer.setHackingParameters(5, 2300000, 10, 10); SigmaCosmeticsServer.setPortProperties(0); AddToAllServers(SigmaCosmeticsServer); - var JoesGunsServer = new Server(); - JoesGunsServer.init(createRandomIp(), "joesguns", "Joe's Guns", true, false, false, false, 8); + var JoesGunsServer = new Server(createRandomIp(), "joesguns", "Joe's Guns", false, false, false, 8); JoesGunsServer.setHackingParameters(10, 2500000, 15, 20); JoesGunsServer.setPortProperties(0); AddToAllServers(JoesGunsServer); - var Zer0NightclubServer = new Server(); - Zer0NightclubServer.init(createRandomIp(), "zer0", "ZER0 Nightclub", true, false, false, false, 4); + var Zer0NightclubServer = new Server(createRandomIp(), "zer0", "ZER0 Nightclub", false, false, false, 4); Zer0NightclubServer.setHackingParameters(75, 7500000, 25, 40); Zer0NightclubServer.setPortProperties(1); AddToAllServers(Zer0NightclubServer); - var NectarNightclubServer = new Server(); - NectarNightclubServer.init(createRandomIp(), "nectar-net", "Nectar Nightclub Network", true, false, false, false, 8); + var NectarNightclubServer = new Server(createRandomIp(), "nectar-net", "Nectar Nightclub Network", false, false, false, 8); NectarNightclubServer.setHackingParameters(20, 2750000, 20, 25); NectarNightclubServer.setPortProperties(0); AddToAllServers(NectarNightclubServer); - var NeoNightclubServer = new Server(); - NeoNightclubServer.init(createRandomIp(), "neo-net", "Neo Nightclub Network", true, false, false, false, 4); + var NeoNightclubServer = new Server(createRandomIp(), "neo-net", "Neo Nightclub Network", false, false, false, 4); NeoNightclubServer.setHackingParameters(50, 5000000, 25, 25); NeoNightclubServer.setPortProperties(1); AddToAllServers(NeoNightclubServer); - var SilverHelixServer = new Server(); - SilverHelixServer.init(createRandomIp(), "silver-helix", "Silver Helix", true, false, false, false, 2); + var SilverHelixServer = new Server(createRandomIp(), "silver-helix", "Silver Helix", false, false, false, 2); SilverHelixServer.setHackingParameters(150, 45000000, 30, 30); SilverHelixServer.setPortProperties(2); AddToAllServers(SilverHelixServer); - var HongFangTeaHouseServer = new Server(); - HongFangTeaHouseServer.init(createRandomIp(), "hong-fang-tea", "HongFang Teahouse", true, false, false, false, 8); + var HongFangTeaHouseServer = new Server(createRandomIp(), "hong-fang-tea", "HongFang Teahouse", false, false, false, 8); HongFangTeaHouseServer.setHackingParameters(30, 3000000, 15, 20); HongFangTeaHouseServer.setPortProperties(0); AddToAllServers(HongFangTeaHouseServer); - var HaraKiriSushiBarServer = new Server(); - HaraKiriSushiBarServer.init(createRandomIp(), "harakiri-sushi", "HaraKiri Sushi Bar Network", true, false, false, false, 8); + var HaraKiriSushiBarServer = new Server(createRandomIp(), "harakiri-sushi", "HaraKiri Sushi Bar Network", false, false, false, 8); HaraKiriSushiBarServer.setHackingParameters(40, 4000000, 15, 40); HaraKiriSushiBarServer.setPortProperties(0); AddToAllServers(HaraKiriSushiBarServer); - var PhantasyServer = new Server(); - PhantasyServer.init(createRandomIp(), "phantasy", "Phantasy Club", true, false, false, false, 0); + var PhantasyServer = new Server(createRandomIp(), "phantasy", "Phantasy Club", false, false, false, 0); PhantasyServer.setHackingParameters(100, 24000000, 20, 35); PhantasyServer.setPortProperties(2); AddToAllServers(PhantasyServer); - var MaxHardwareServer = new Server(); - MaxHardwareServer.init(createRandomIp(), "max-hardware", "Max Hardware Store", true, false, false, false, 4); - MaxHardwareServer.setHackingParameters(80, 10000000, 15, 25); + var MaxHardwareServer = new Server(createRandomIp(), "max-hardware", "Max Hardware Store", false, false, false, 4); + MaxHardwareServer.setHackingParameters(80, 10000000, 15, 30); MaxHardwareServer.setPortProperties(1); AddToAllServers(MaxHardwareServer); - var OmegaSoftwareServer = new Server(); - OmegaSoftwareServer.init(createRandomIp(), "omega-net", "Omega Software", true, false, false, false, 8); + var OmegaSoftwareServer = new Server(createRandomIp(), "omega-net", "Omega Software", false, false, false, 8); OmegaSoftwareServer.setHackingParameters(getRandomInt(180, 220), getRandomInt(60000000, 70000000), getRandomInt(25, 35), getRandomInt(30, 40)); OmegaSoftwareServer.setPortProperties(2); AddToAllServers(OmegaSoftwareServer); //Gyms - var CrushFitnessGymServer = new Server(); - CrushFitnessGymServer.init(createRandomIp(), "crush-fitness", "Crush Fitness", true, false, false, false, 0); + var CrushFitnessGymServer = new Server(createRandomIp(), "crush-fitness", "Crush Fitness", false, false, false, 0); CrushFitnessGymServer.setHackingParameters(getRandomInt(225, 275), getRandomInt(40000000, 60000000), getRandomInt(35, 45), getRandomInt(27, 33)); CrushFitnessGymServer.setPortProperties(2); AddToAllServers(CrushFitnessGymServer); - var IronGymServer = new Server(); - IronGymServer.init(createRandomIp(), "iron-gym", "Iron Gym Network", true, false, false, false, 4); + var IronGymServer = new Server(createRandomIp(), "iron-gym", "Iron Gym Network", false, false, false, 4); IronGymServer.setHackingParameters(100, 20000000, 30, 20); IronGymServer.setPortProperties(1); AddToAllServers(IronGymServer); - var MilleniumFitnessGymServer = new Server(); - MilleniumFitnessGymServer.init(createRandomIp(), "millenium-fitness", "Millenium Fitness Network", true, false, false, false, 0); + var MilleniumFitnessGymServer = new Server(createRandomIp(), "millenium-fitness", "Millenium Fitness Network", false, false, false, 0); MilleniumFitnessGymServer.setHackingParameters(getRandomInt(475, 525), 250000000, getRandomInt(45, 55), getRandomInt(25, 45)); MilleniumFitnessGymServer.setPortProperties(3); AddToAllServers(MilleniumFitnessGymServer); - var PowerhouseGymServer = new Server(); - PowerhouseGymServer.init(createRandomIp(), "powerhouse-fitness", "Powerhouse Fitness", true, false, false, false, 0); + var PowerhouseGymServer = new Server(createRandomIp(), "powerhouse-fitness", "Powerhouse Fitness", false, false, false, 0); PowerhouseGymServer.setHackingParameters(getRandomInt(950, 1100), 900000000, getRandomInt(55, 65), getRandomInt(50, 60)); PowerhouseGymServer.setPortProperties(5); AddToAllServers(PowerhouseGymServer); - var SnapFitnessGymServer = new Server(); - SnapFitnessGymServer.init(createRandomIp(), "snap-fitness", "Snap Fitness", true, false, false, false, 0); + var SnapFitnessGymServer = new Server(createRandomIp(), "snap-fitness", "Snap Fitness", false, false, false, 0); SnapFitnessGymServer.setHackingParameters(getRandomInt(675, 800), 450000000, getRandomInt(40, 60), getRandomInt(40, 60)); SnapFitnessGymServer.setPortProperties(4); AddToAllServers(SnapFitnessGymServer); //Faction servers, cannot hack money from these - var BitRunnersServer = new Server(); - BitRunnersServer.init(createRandomIp(), "run4theh111z", "The Runners", true, false, false, false, 0); + var BitRunnersServer = new Server(createRandomIp(), "run4theh111z", "The Runners", false, false, false, 0); BitRunnersServer.setHackingParameters(getRandomInt(505, 550), 0, 0, 0); BitRunnersServer.setPortProperties(4); AddToAllServers(BitRunnersServer); SpecialServerIps.addIp(SpecialServerNames.BitRunnersServer, BitRunnersServer.ip); - var TheBlackHandServer = new Server(); - TheBlackHandServer.init(createRandomIp(), "I.I.I.I", "I.I.I.I", true, false, false, false, 0); + var TheBlackHandServer = new Server(createRandomIp(), "I.I.I.I", "I.I.I.I", false, false, false, 0); TheBlackHandServer.setHackingParameters(getRandomInt(340, 365), 0, 0, 0); TheBlackHandServer.setPortProperties(3); AddToAllServers(TheBlackHandServer); SpecialServerIps.addIp(SpecialServerNames.TheBlackHandServer, TheBlackHandServer.ip); - var NiteSecServer = new Server(); - NiteSecServer.init(createRandomIp(), "avmnite-02h", "NiteSec", true, false, false, false, 0); + var NiteSecServer = new Server(createRandomIp(), "avmnite-02h", "NiteSec", false, false, false, 0); NiteSecServer.setHackingParameters(getRandomInt(202, 220), 0, 0, 0); NiteSecServer.setPortProperties(2); AddToAllServers(NiteSecServer); SpecialServerIps.addIp(SpecialServerNames.NiteSecServer, NiteSecServer.ip); - var DarkArmyServer = new Server(); - DarkArmyServer.init(createRandomIp(), ".", ".", true, false, false, false, 0); + var DarkArmyServer = new Server(createRandomIp(), ".", ".", false, false, false, 0); DarkArmyServer.setHackingParameters(getRandomInt(505, 550), 0, 0, 0); DarkArmyServer.setPortProperties(4); AddToAllServers(DarkArmyServer); SpecialServerIps.addIp(SpecialServerNames.TheDarkArmyServer, DarkArmyServer.ip); - var CyberSecServer = new Server(); - CyberSecServer.init(createRandomIp(), "CSEC", "CyberSec", true, false, false, false, 0); + var CyberSecServer = new Server(createRandomIp(), "CSEC", "CyberSec", false, false, false, 0); CyberSecServer.setHackingParameters(getRandomInt(51, 60), 0, 0, 0); CyberSecServer.setPortProperties(1); AddToAllServers(CyberSecServer); SpecialServerIps.addIp(SpecialServerNames.CyberSecServer, CyberSecServer.ip); - var DaedalusServer = new Server(); - DaedalusServer.init(createRandomIp(), "The-Cave", "Helios", true, false, false, false, 0); + var DaedalusServer = new Server(createRandomIp(), "The-Cave", "Helios", false, false, false, 0); DaedalusServer.setHackingParameters(925, 0, 0, 0); DaedalusServer.setPortProperties(5); AddToAllServers(DaedalusServer); SpecialServerIps.addIp(SpecialServerNames.DaedalusServer, DaedalusServer.ip); //Super special Servers - var WorldDaemon = new Server(); - WorldDaemon.init(createRandomIp(), SpecialServerNames.WorldDaemon, SpecialServerNames.WorldDaemon, true, false, false, false, 0); + var WorldDaemon = new Server(createRandomIp(), SpecialServerNames.WorldDaemon, SpecialServerNames.WorldDaemon, false, false, false, 0); WorldDaemon.setHackingParameters(3000, 0, 0, 0); WorldDaemon.setPortProperties(5); AddToAllServers(WorldDaemon); diff --git a/src/ServerPurchases.js b/src/ServerPurchases.js index 51c9eef14f..c75cb7a020 100644 --- a/src/ServerPurchases.js +++ b/src/ServerPurchases.js @@ -17,7 +17,7 @@ purchaseServer = function(ram, cost) { return; } - var newServ = new Server(); + var hostname = document.getElementById("purchase-server-box-input").value; hostname = hostname.replace(/\s\s+/g, ''); if (hostname == "") { @@ -26,7 +26,7 @@ purchaseServer = function(ram, cost) { } //Create server - newServ.init(createRandomIp(), hostname, "", true, false, true, true, ram); + var newServ = new Server(createRandomIp(), hostname, "", false, true, true, ram); AddToAllServers(newServ); //Add to Player's purchasedServers array diff --git a/src/SourceFile.js b/src/SourceFile.js new file mode 100644 index 0000000000..28119efdf4 --- /dev/null +++ b/src/SourceFile.js @@ -0,0 +1,122 @@ +/* SourceFile.js */ + +//Each SourceFile corresponds to a BitNode with the same number +function SourceFile(number, info="") { + var bitnodeKey = "BitNode" + number; + var bitnode = BitNodes[bitnodeKey]; + if (bitnode == null) { + throw new Error("Invalid Bit Node for this Source File"); + } + + this.n = number; + this.name = "Source-File " + number + ": " + bitnode.name; + this.lvl = 1; + this.info = info; + this.owned = false; +} + +SourceFiles = { + SourceFile1: new SourceFile(1, "This Source-File lets the player start with 32GB of RAM on his/her " + + "home computer. It also increases all of the player's multipliers by:
" + + "Level 1: 16%
" + + "Level 2: 24%
" + + "Level 3: 28%"), + SourceFile2: new SourceFile(2, "This Source-File increases the player's crime success rate, crime money, and charisma " + + "multipliers by:
" + + "Level 1: 20%
" + + "Level 2: 30%
" + + "Level 3: 35%"), + SourceFile3: new SourceFile(3), + SourceFile4: new SourceFile(4), + SourceFile5: new SourceFile(5), + SourceFile6: new SourceFile(6), + SourceFile7: new SourceFile(7), + SourceFile8: new SourceFile(8), + SourceFile9: new SourceFile(9), + SourceFile10: new SourceFile(10), + SourceFile11: new SourceFile(11), + SourceFile12: new SourceFile(12), +} + +function PlayerOwnedSourceFile(number, level) { + this.n = number; + this.lvl = level; +} + +//Takes in a PlayerOwnedSourceFile as the "srcFile" argument +function applySourceFile(srcFile) { + var srcFileKey = "SourceFile" + srcFile.n; + var sourceFileObject = SourceFiles[srcFileKey]; + if (sourceFileObject == null) { + console.log("ERROR: Invalid source file number: " + srcFile.n); + return; + } + + switch(srcFile.n) { + case 1: // The Source Genesis + var mult = 0; + for (var i = 0; i < srcFile.lvl; ++i) { + mult += (16 / (Math.pow(2, i))); + } + var incMult = 1 + (mult / 100); + var decMult = 1 - (mult / 100); + Player.hacking_chance_mult *= incMult; + Player.hacking_speed_mult *= incMult; + Player.hacking_money_mult *= incMult; + Player.hacking_grow_mult *= incMult; + Player.hacking_mult *= incMult; + Player.strength_mult *= incMult; + Player.defense_mult *= incMult; + Player.dexterity_mult *= incMult; + Player.agility_mult *= incMult; + Player.charisma_mult *= incMult; + Player.hacking_exp_mult *= incMult; + Player.strength_exp_mult *= incMult; + Player.defense_exp_mult *= incMult; + Player.dexterity_exp_mult *= incMult; + Player.agility_exp_mult *= incMult; + Player.charisma_exp_mult *= incMult; + Player.company_rep_mult *= incMult; + Player.faction_rep_mult *= incMult; + Player.crime_money_mult *= incMult; + Player.crime_success_mult *= incMult; + Player.hacknet_node_money_mult *= incMult; + Player.hacknet_node_purchase_cost_mult *= decMult; + Player.hacknet_node_ram_cost_mult *= decMult; + Player.hacknet_node_core_cost_mult *= decMult; + Player.hacknet_node_level_cost_mult *= decMult; + Player.work_money_mult *= incMult; + break; + case 2: //Rise of the Underworld + var mult = 0; + for (var i = 0; i < srcFile.lvl; ++i) { + mult += (20 / (Math.pow(2, i))); + } + var incMult = 1 + (mult / 100); + Player.crime_money_mult *= incMult; + Player.crime_success_mult *= incMult; + Player.charisma_mult *= incMult; + break; + default: + console.log("ERROR: Invalid source file number: " + srcFile.n); + break; + } + + sourceFileObject.owned = true; +} + +PlayerObject.prototype.reapplyAllSourceFiles = function() { + console.log("Re-applying source files"); + //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset + //this.resetMultipliers(); + + for (i = 0; i < this.sourceFiles.length; ++i) { + var srcFileKey = "SourceFile" + this.sourceFiles[i].n; + var sourceFileObject = SourceFiles[srcFileKey]; + if (sourceFileObject == null) { + console.log("ERROR: Invalid source file number: " + this.sourceFiles[i].n); + continue; + } + applySourceFile(this.sourceFiles[i]); + } +} diff --git a/src/Terminal.js b/src/Terminal.js index c27fa0ac4c..1f9694d316 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -360,7 +360,10 @@ var Terminal = { if (rand < hackChance) { //Success! if (SpecialServerIps[SpecialServerNames.WorldDaemon] && SpecialServerIps[SpecialServerNames.WorldDaemon] == server.ip) { - hackWorldDaemon(); + if (Player.bitNodeN == null) { + Player.bitNodeN = 1; + } + hackWorldDaemon(Player.bitNodeN); return; } server.manuallyHacked = true; diff --git a/src/engine.js b/src/engine.js index f0f716660d..8546ddbcca 100644 --- a/src/engine.js +++ b/src/engine.js @@ -83,7 +83,6 @@ var Engine = { deleteMainMenuButton: null, //Tutorial buttons - tutorialGettingStartedButton: null, tutorialNetworkingButton: null, tutorialHackingButton: null, tutorialScriptsButton: null, @@ -149,6 +148,7 @@ var Engine = { RedPill: "RedPill", Infiltration: "Infiltration", StockMarket: "StockMarket", + Gang: "Gang", }, currentPage: null, @@ -322,6 +322,18 @@ var Engine = { Engine.currentPage = Engine.Page.StockMarket; }, + loadGangContent: function() { + Engine.hideAllContent(); + if (document.getElementById("gang-container") || Player.gang) { + displayGangContent(); + Engine.currentPage = Engine.Page.Gang; + } else { + Engine.loadTerminalContent(); + Engine.currentPage = Engine.Page.Terminal; + } + + }, + //Helper function that hides all content hideAllContent: function() { Engine.Display.terminalContent.style.visibility = "hidden"; @@ -341,6 +353,9 @@ var Engine = { Engine.Display.redPillContent.style.visibility = "hidden"; Engine.Display.infiltrationContent.style.visibility = "hidden"; Engine.Display.stockMarketContent.style.visibility = "hidden"; + if (document.getElementById("gang-container")) { + document.getElementById("gang-container").style.visibility = "hidden"; + } //Location lists Engine.aevumLocationsList.style.display = "none"; @@ -600,6 +615,29 @@ var Engine = { augmentationsList.removeChild(augmentationsList.firstChild); } + //Source Files - Temporary...Will probably put in a separate pane Later + for (var i = 0; i < Player.sourceFiles.length; ++i) { + var srcFileKey = "SourceFile" + Player.sourceFiles[i].n; + var sourceFileObject = SourceFiles[srcFileKey]; + if (sourceFileObject == null) { + console.log("ERROR: Invalid source file number: " + Player.sourceFiles[i].n); + continue; + } + var item = document.createElement("li"); + var hElem = document.createElement("h2"); + var pElem = document.createElement("p"); + + item.setAttribute("class", "installed-augmentation"); + hElem.innerHTML = sourceFileObject.name + "
"; + hElem.innerHTML += "Level " + (Player.sourceFiles[i].lvl) + " / 3"; + pElem.innerHTML = sourceFileObject.info; + + item.appendChild(hElem); + item.appendChild(pElem); + + augmentationsList.appendChild(item); + } + for (var i = 0; i < Player.augmentations.length; ++i) { var augName = Player.augmentations[i].name; var aug = Augmentations[augName]; @@ -623,7 +661,7 @@ var Engine = { }, displayTutorialContent: function() { - Engine.Clickables.tutorialGettingStartedButton.style.display = "block"; + document.getElementById("tutorial-getting-started-link").style.display = "block"; Engine.Clickables.tutorialNetworkingButton.style.display = "block"; Engine.Clickables.tutorialHackingButton.style.display = "block"; Engine.Clickables.tutorialScriptsButton.style.display = "block"; @@ -640,7 +678,6 @@ var Engine = { //Displays the text when a section of the Tutorial is opened displayTutorialPage: function(text) { - Engine.Clickables.tutorialGettingStartedButton.style.display = "none"; Engine.Clickables.tutorialNetworkingButton.style.display = "none"; Engine.Clickables.tutorialHackingButton.style.display = "none"; Engine.Clickables.tutorialScriptsButton.style.display = "none"; @@ -712,6 +749,11 @@ var Engine = { } } + //Gang, if applicable + if (Player.bitNodeN == 2 && Player.inGang()) { + Player.gang.process(numCycles); + } + //Counters Engine.decrementAllCounters(numCycles); Engine.checkCounters(); @@ -734,6 +776,7 @@ var Engine = { autoSaveCounter: 300, //Autosave every minute updateSkillLevelsCounter: 10, //Only update skill levels every 2 seconds. Might improve performance updateDisplays: 3, //Update displays such as Active Scripts display and character display + updateDisplaysLong: 15, createProgramNotifications: 10, //Checks whether any programs can be created and notifies checkFactionInvitations: 100, //Check whether you qualify for any faction invitations passiveFactionGrowth: 600, @@ -783,6 +826,13 @@ var Engine = { Engine.Counters.updateDisplays = 3; } + if (Engine.Counters.updateDisplaysLong <= 0) { + if (Engine.currentPage === Engine.Page.Gang) { + updateGangContent(); + } + Engine.Counters.updateDisplaysLong = 15; + } + if (Engine.Counters.createProgramNotifications <= 0) { var num = getNumAvailableCreateProgram(); var elem = document.getElementById("create-program-notification"); @@ -891,10 +941,6 @@ var Engine = { }, 3000); }, - displayLoadingScreen: function() { - - }, - removeLoadingScreen: function() { var loader = document.getElementById("loader"); if (!loader) {return;} @@ -921,14 +967,15 @@ var Engine = { var tutorial = document.getElementById("tutorial-tab"); var options = document.getElementById("options-tab"); - //Load game from save or create new game if (loadGame(saveObject)) { console.log("Loaded game from save"); + initBitNodeMultipliers(); Engine.setDisplayElements(); //Sets variables for important DOM elements Engine.init(); //Initialize buttons, work, etc. CompanyPositions.init(); initAugmentations(); //Also calls Player.reapplyAllAugmentations() + Player.reapplyAllSourceFiles(); initStockSymbols(); if (Player.hasWseAccount) { initSymbolToStockMap(); @@ -964,6 +1011,11 @@ var Engine = { //Passive faction rep gain offline processPassiveFactionRepGain(numCyclesOffline); + //Gang progress for BitNode 2 + if (Player.bitNodeN != null && Player.bitNodeN == 2 && Player.inGang()) { + Player.gang.process(numCyclesOffline); + } + //Update total playtime var time = numCyclesOffline * Engine._idleSpeed; if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;} @@ -1020,6 +1072,7 @@ var Engine = { } else { //No save found, start new game console.log("Initializing new game"); + initBitNodeMultipliers(); SpecialServerIps = new SpecialServerIpsMap(); Engine.setDisplayElements(); //Sets variables for important DOM elements Engine.start(); //Run main game loop and Scripts loop @@ -1153,11 +1206,6 @@ var Engine = { Engine.Display.scriptEditorText = document.getElementById("script-editor-text"); //Tutorial buttons - Engine.Clickables.tutorialGettingStartedButton = document.getElementById("tutorial-getting-started-link"); - Engine.Clickables.tutorialGettingStartedButton.addEventListener("click", function() { - Engine.displayTutorialPage(CONSTANTS.TutorialGettingStartedText); - }); - Engine.Clickables.tutorialNetworkingButton = document.getElementById("tutorial-networking-link"); Engine.Clickables.tutorialNetworkingButton.addEventListener("click", function() { Engine.displayTutorialPage(CONSTANTS.TutorialNetworkingText); @@ -1601,6 +1649,5 @@ var Engine = { }; window.onload = function() { - Engine.displayLoadingScreen(); Engine.load(); }; diff --git a/utils/PurchaseRamForHomeBox.js b/utils/PurchaseRamForHomeBox.js deleted file mode 100644 index ae08dba566..0000000000 --- a/utils/PurchaseRamForHomeBox.js +++ /dev/null @@ -1,55 +0,0 @@ -/* Pop up Purchase Ram for Home Computer Pop-up Box */ -function purchaseRamForHomeBoxInit() { - var cancelButton = document.getElementById("purchase-ram-for-home-box-cancel"); - - //Close Dialog box - cancelButton.addEventListener("click", function() { - purchaseRamForHomeBoxClose(); - return false; - }); -}; - -document.addEventListener("DOMContentLoaded", purchaseRamForHomeBoxInit, false); - -purchaseRamForHomeBoxClose = function() { - var purchaseRamForHomeBox = document.getElementById("purchase-ram-for-home-box-container"); - purchaseRamForHomeBox.style.display = "none"; -} - -purchaseRamForHomeBoxOpen = function() { - var purchaseRamForHomeBox = document.getElementById("purchase-ram-for-home-box-container"); - purchaseRamForHomeBox.style.display = "block"; -} - -purchaseRamForHomeBoxSetText = function(txt) { - var textElem = document.getElementById("purchase-ram-for-home-box-text"); - textElem.innerHTML = txt; -} - -//ram argument is in GB -purchaseRamForHomeBoxCreate = function() { - //Calculate how many times ram has been upgraded (doubled) - var currentRam = Player.getHomeComputer().maxRam; - var newRam = currentRam * 2; - var numUpgrades = Math.log2(currentRam); - - //Calculate cost - //Have cost increase by some percentage each time RAM has been upgraded - var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome; - var mult = Math.pow(1.55, numUpgrades); - cost = cost * mult; - - purchaseRamForHomeBoxSetText("Would you like to purchase additional RAM for your home computer?
" + - "This will upgrade your RAM from " + currentRam + "GB to " + newRam + "GB.
" + - "This will cost $" + formatNumber(cost, 2)); - - purchaseRamForHomeBoxOpen(); - - //Clear old event listeners from Confirm button - var newConfirmButton = clearEventListeners("purchase-ram-for-home-box-confirm"); - newConfirmButton.addEventListener("click", function() { - purchaseRamForHomeBoxClose(); - purchaseRamForHomeComputer(cost); - return false; - }); -} \ No newline at end of file diff --git a/utils/TravelBox.js b/utils/TravelBox.js deleted file mode 100644 index 5fefbb2dab..0000000000 --- a/utils/TravelBox.js +++ /dev/null @@ -1,41 +0,0 @@ -/* Pop up Purchase Server Box */ -function travelBoxInit() { - var cancelButton = document.getElementById("travel-box-cancel"); - - //Close Dialog box - cancelButton.addEventListener("click", function() { - travelBoxClose(); - return false; - }); -}; - -document.addEventListener("DOMContentLoaded", travelBoxInit, false); - -travelBoxClose = function() { - var travelBox = document.getElementById("travel-box-container"); - travelBox.style.display = "none"; -} - -travelBoxOpen = function() { - var travelBox = document.getElementById("travel-box-container"); - travelBox.style.display = "block"; -} - -travelBoxSetText = function(txt) { - var travelBoxText = document.getElementById("travel-box-text"); - travelBoxText.innerHTML = txt; -} - -travelBoxCreate = function(destCityName, cost) { - travelBoxSetText("Would you like to travel to " + destCityName + "? The trip will cost $" + formatNumber(cost, 2) + "."); - - //Clear old event listeners from Confirm button - var newConfirmButton = clearEventListeners("travel-box-confirm"); - newConfirmButton.addEventListener("click", function() { - travelBoxClose(); - travelToCity(destCityName, cost); - return false; - }); - - travelBoxOpen(); -} \ No newline at end of file diff --git a/utils/YesNoBox.js b/utils/YesNoBox.js new file mode 100644 index 0000000000..c681e0f32f --- /dev/null +++ b/utils/YesNoBox.js @@ -0,0 +1,76 @@ +/* Generic Yes-No Pop-up box + * Can be used to create pop-up boxes that require a yes/no response from player + */ +var yesNoBoxOpen = false; +function yesNoBoxClose() { + var container = document.getElementById("yes-no-box-container"); + if (container) { + container.style.display = "none"; + } else { + console.log("ERROR: Container not found for YesNoBox"); + } + yesNoBoxOpen = false; +} + +function yesNoBoxGetYesButton() { + return clearEventListeners("yes-no-box-yes"); +} + +function yesNoBoxGetNoButton() { + return clearEventListeners("yes-no-box-no"); +} + +function yesNoBoxCreate(txt) { + yesNoBoxOpen = true; + var textElement = document.getElementById("yes-no-box-text"); + if (textElement) { + textElement.innerHTML = txt; + } + + var c = document.getElementById("yes-no-box-container"); + if (c) { + c.style.display = "block"; + } else { + console.log("ERROR: Container not found for YesNoBox"); + } +} + +/* Generic Yes-No POp-up Box with Text input */ +function yesNoTxtInpBoxClose() { + var c = document.getElementById("yes-no-text-input-box-container"); + if (c) { + c.style.display = "none"; + } else { + console.log("ERROR: Container not found for YesNoTextInputBox"); + } + yesNoBoxOpen = false; +} + +function yesNoTxtInpBoxGetYesButton() { + return clearEventListeners("yes-no-text-input-box-yes"); +} + +function yesNoTxtInpBoxGetNoButton() { + return clearEventListeners("yes-no-text-input-box-no"); +} + +function yesNoTxtInpBoxGetInput() { + var val = document.getElementById("yes-no-text-input-box-input").value; + val = val.replace(/\s+/g, ''); + return val; +} + +function yesNoTxtInpBoxCreate(txt) { + yesNoBoxOpen = true; + var txtE = document.getElementById("yes-no-text-input-box-text"); + if (txtE) { + txtE.innerHTML = txt; + } + + var c = document.getElementById("yes-no-text-input-box-container"); + if (c) { + c.style.display = "block"; + } else { + console.log("ERROR: Container not found for YesNoTextInputBox"); + } +}