diff --git a/css/menupages.css b/css/menupages.css index 4d9bde93a..400d7a875 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -417,6 +417,10 @@ background-color: #555; margin: 6px; } +#faction-favor, #faction-reputation { + display: inline; +} + #faction-hack-div, #faction-fieldwork-div, #faction-securitywork-div, @@ -473,6 +477,7 @@ div.faction-clear { margin-left: 10%; width: 99%; color: var(--my-font-color); + overflow-y: auto; } #faction-augmentations-container p, @@ -566,3 +571,7 @@ div.faction-clear { margin: 10px 5px 10px 5px; } +#location-job-reputation, #location-company-favor { + display: inline; +} + diff --git a/index.html b/index.html index 0af867fcf..b3a41bd94 100644 --- a/index.html +++ b/index.html @@ -457,9 +457,11 @@

- -

- +

---------------

+

+

---------------

+

+

---------------

Perform work/carry out assignments for your faction to help further its cause! By doing so you will gain reputation for your faction. You will also gain reputation passively over time, @@ -569,7 +571,11 @@

-

+

---------------

+

+

---------------

+

+

---------------

Apply for Software Job diff --git a/src/Company.js b/src/Company.js index 4b296f87e..3dee532c0 100644 --- a/src/Company.js +++ b/src/Company.js @@ -1,32 +1,26 @@ //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() { - this.companyName = ""; +function Company(name, salaryMult, expMult, jobStatReqOffset) { + this.companyName = name; this.info = ""; this.companyPositions = []; //Names (only name, not object) of all company positions this.perks = []; //Available Perks - this.salaryMultiplier = 1; //Multiplier for base salary - this.expMultiplier = 1; //Multiplier for base exp gain + this.salaryMultiplier = salaryMult; //Multiplier for base salary + this.expMultiplier = expMult; //Multiplier for base exp gain //The additional levels you need in the relevant stat to qualify for a job. //E.g the offset for a megacorporation will be high, let's say 200, so the //stat level you'd need to get an intern job would be 200 instead of 1. - this.jobStatReqOffset = 1; + this.jobStatReqOffset = jobStatReqOffset; //Player-related properties for company this.isPlayerEmployed = false; - 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.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; }; -Company.prototype.init = function(name, salaryMult, expMult, jobStatReqOffset) { - this.companyName = name; - this.salaryMultiplier = salaryMult; - this.expMultiplier = expMult; - this.jobStatReqOffset = jobStatReqOffset; -} - Company.prototype.setInfo = function(inf) { this.info = inf; } @@ -50,6 +44,11 @@ Company.prototype.hasPosition = function(pos) { return false; } +Company.prototype.gainFavor = function() { + if (this.favor == null || this.favor == undefined) {this.favor = 0;} + this.favor += (this.playerReputation / CONSTANTS.CompanyReputationToFavor); +} + Company.prototype.toJSON = function() { return Generic_toJSON("Company", this); } @@ -481,8 +480,7 @@ getNextCompanyPosition = function(currPos) { initCompanies = function() { /* Companies that also have servers */ //Megacorporations - var ECorp = new Company(); - ECorp.init(Locations.AevumECorp, 3.0, 3.0, 249); + var ECorp = new Company(Locations.AevumECorp, 3.0, 3.0, 249); ECorp.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -493,10 +491,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.AevumECorp)) { + ECorp.favor = Companies[Locations.AevumECorp].favor; + delete Companies[Locations.AevumECorp]; + } AddToCompanies(ECorp); - var MegaCorp = new Company(); - MegaCorp.init(Locations.Sector12MegaCorp, 3.0, 3.0, 249); + var MegaCorp = new Company(Locations.Sector12MegaCorp, 3.0, 3.0, 249); MegaCorp.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -507,10 +508,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.Sector12MegaCorp)) { + MegaCorp.favor = Companies[Locations.Sector12MegaCorp].favor; + delete Companies[Locations.Sector12MegaCorp]; + } AddToCompanies(MegaCorp); - var BachmanAndAssociates = new Company(); - BachmanAndAssociates.init(Locations.AevumBachmanAndAssociates, 2.6, 2.6, 224); + var BachmanAndAssociates = new Company(Locations.AevumBachmanAndAssociates, 2.6, 2.6, 224); BachmanAndAssociates.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -521,10 +525,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.AevumBachmanAndAssociates)) { + BachmanAndAssociates.favor = Companies[Locations.AevumBachmanAndAssociates].favor; + delete Companies[Locations.AevumBachmanAndAssociates]; + } AddToCompanies(BachmanAndAssociates); - var BladeIndustries = new Company(); - BladeIndustries.init(Locations.Sector12BladeIndustries, 2.75, 2.75, 224); + var BladeIndustries = new Company(Locations.Sector12BladeIndustries, 2.75, 2.75, 224); BladeIndustries.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -535,10 +542,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.Sector12BladeIndustries)) { + BladeIndustries.favor = Companies[Locations.Sector12BladeIndustries].favor; + delete Companies[Locations.Sector12BladeIndustries]; + } AddToCompanies(BladeIndustries); - var NWO = new Company(); - NWO.init(Locations.VolhavenNWO, 2.75, 2.75, 249); + var NWO = new Company(Locations.VolhavenNWO, 2.75, 2.75, 249); NWO.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -549,10 +559,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.VolhavenNWO)) { + NWO.favor = Companies[Locations.VolhavenNWO].favor; + delete Companies[Locations.VolhavenNWO]; + } AddToCompanies(NWO); - var ClarkeIncorporated = new Company(); - ClarkeIncorporated.init(Locations.AevumClarkeIncorporated, 2.25, 2.25, 224); + var ClarkeIncorporated = new Company(Locations.AevumClarkeIncorporated, 2.25, 2.25, 224); ClarkeIncorporated.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -563,10 +576,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.AevumClarkeIncorporated)) { + ClarkeIncorporated.favor = Companies[Locations.AevumClarkeIncorporated].favor; + delete Companies[Locations.AevumClarkeIncorporated]; + } AddToCompanies(ClarkeIncorporated); - var OmniTekIncorporated = new Company(); - OmniTekIncorporated.init(Locations.VolhavenOmniTekIncorporated, 2.25, 2.25, 224); + var OmniTekIncorporated = new Company(Locations.VolhavenOmniTekIncorporated, 2.25, 2.25, 224); OmniTekIncorporated.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -577,10 +593,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.VolhavenOmniTekIncorporated)) { + OmniTekIncorporated.favor = Companies[Locations.VolhavenOmniTekIncorporated].favor; + delete Companies[Locations.VolhavenOmniTekIncorporated]; + } AddToCompanies(OmniTekIncorporated); - var FourSigma = new Company(); - FourSigma.init(Locations.Sector12FourSigma, 2.5, 2.5, 224); + var FourSigma = new Company(Locations.Sector12FourSigma, 2.5, 2.5, 224); FourSigma.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -591,10 +610,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.Sector12FourSigma)) { + FourSigma.favor = Companies[Locations.Sector12FourSigma].favor; + delete Companies[Locations.Sector12FourSigma]; + } AddToCompanies(FourSigma); - var KuaiGongInternational = new Company(); - KuaiGongInternational.init(Locations.ChongqingKuaiGongInternational, 2.2, 2.2, 224); + var KuaiGongInternational = new Company(Locations.ChongqingKuaiGongInternational, 2.2, 2.2, 224); KuaiGongInternational.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -605,11 +627,14 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.ChongqingKuaiGongInternational)) { + KuaiGongInternational.favor = Companies[Locations.ChongqingKuaiGongInternational].favor; + delete Companies[Locations.ChongqingKuaiGongInternational]; + } AddToCompanies(KuaiGongInternational); //Technology and communication companies ("Large" servers) - var FulcrumTechnologies = new Company(); - FulcrumTechnologies.init(Locations.AevumFulcrumTechnologies, 2.0, 2.0, 224); + var FulcrumTechnologies = new Company(Locations.AevumFulcrumTechnologies, 2.0, 2.0, 224); FulcrumTechnologies.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -619,10 +644,13 @@ initCompanies = function() { CompanyPositions.VicePresident, CompanyPositions.CTO, CompanyPositions.BusinessAnalyst, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.AevumFulcrumTechnologies)) { + FulcrumTechnologies.favor = Companies[Locations.AevumFulcrumTechnologies].favor; + delete Companies[Locations.AevumFulcrumTechnologies]; + } AddToCompanies(FulcrumTechnologies); - var StormTechnologies = new Company(); - StormTechnologies.init(Locations.IshimaStormTechnologies, 1.8, 1.8, 199); + var StormTechnologies = new Company(Locations.IshimaStormTechnologies, 1.8, 1.8, 199); StormTechnologies.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -633,10 +661,13 @@ initCompanies = function() { CompanyPositions.VicePresident, CompanyPositions.CTO, CompanyPositions.BusinessAnalyst, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.IshimaStormTechnologies)) { + StormTechnologies.favor = Companies[Locations.IshimaStormTechnologies].favor; + delete Companies[Locations.IshimaStormTechnologies]; + } AddToCompanies(StormTechnologies); - var DefComm = new Company(); - DefComm.init(Locations.NewTokyoDefComm, 1.75, 1.75, 199); + var DefComm = new Company(Locations.NewTokyoDefComm, 1.75, 1.75, 199); DefComm.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -644,10 +675,13 @@ initCompanies = function() { CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.NewTokyoDefComm)) { + DefComm.favor = Companies[Locations.NewTokyoDefComm].favor; + delete Companies[Locations.NewTokyoDefComm]; + } AddToCompanies(DefComm); - var HeliosLabs = new Company(); - HeliosLabs.init(Locations.VolhavenHeliosLabs, 1.8, 1.8, 199); + var HeliosLabs = new Company(Locations.VolhavenHeliosLabs, 1.8, 1.8, 199); HeliosLabs.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -655,10 +689,13 @@ initCompanies = function() { CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.VolhavenHeliosLabs)) { + HeliosLabs.favor = Companies[Locations.VolhavenHeliosLabs].favor; + delete Companies[Locations.VolhavenHeliosLabs]; + } AddToCompanies(HeliosLabs); - var VitaLife = new Company(); - VitaLife.init(Locations.NewTokyoVitaLife, 1.8, 1.8, 199); + var VitaLife = new Company(Locations.NewTokyoVitaLife, 1.8, 1.8, 199); VitaLife.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -667,10 +704,13 @@ initCompanies = function() { CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.NewTokyoVitaLife)) { + VitaLife.favor = Companies[Locations.NewTokyoVitaLife].favor; + delete Companies[Locations.NewTokyoVitaLife]; + } AddToCompanies(VitaLife); - var IcarusMicrosystems = new Company(); - IcarusMicrosystems.init(Locations.Sector12IcarusMicrosystems, 1.9, 1.9, 199); + var IcarusMicrosystems = new Company(Locations.Sector12IcarusMicrosystems, 1.9, 1.9, 199); IcarusMicrosystems.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -679,10 +719,13 @@ initCompanies = function() { CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.Sector12IcarusMicrosystems)) { + IcarusMicrosystems.favor = Companies[Locations.Sector12IcarusMicrosystems].favor; + delete Companies[Locations.Sector12IcarusMicrosystems]; + } AddToCompanies(IcarusMicrosystems); - var UniversalEnergy = new Company(); - UniversalEnergy.init(Locations.Sector12UniversalEnergy, 2.0, 2.0, 199); + var UniversalEnergy = new Company(Locations.Sector12UniversalEnergy, 2.0, 2.0, 199); UniversalEnergy.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -691,10 +734,13 @@ initCompanies = function() { CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.Sector12UniversalEnergy)) { + UniversalEnergy.favor = Companies[Locations.Sector12UniversalEnergy].favor; + delete Companies[Locations.Sector12UniversalEnergy]; + } AddToCompanies(UniversalEnergy); - var GalacticCybersystems = new Company(); - GalacticCybersystems.init(Locations.AevumGalacticCybersystems, 1.9, 1.9, 199); + var GalacticCybersystems = new Company(Locations.AevumGalacticCybersystems, 1.9, 1.9, 199); GalacticCybersystems.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -703,11 +749,14 @@ initCompanies = function() { CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.HeadOfEngineering, CompanyPositions.CTO, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO]); + if (companyExists(Locations.AevumGalacticCybersystems)) { + GalacticCybersystems.favor = Companies[Locations.AevumGalacticCybersystems].favor; + delete Companies[Locations.AevumGalacticCybersystems]; + } AddToCompanies(GalacticCybersystems); //Defense Companies ("Large" Companies) - var AeroCorp = new Company(); - AeroCorp.init(Locations.AevumAeroCorp, 1.7, 1.7, 199); + var AeroCorp = new Company(Locations.AevumAeroCorp, 1.7, 1.7, 199); AeroCorp.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -717,10 +766,13 @@ initCompanies = function() { CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.AevumAeroCorp)) { + AeroCorp.favor = Companies[Locations.AevumAeroCorp].favor; + delete Companies[Locations.AevumAeroCorp]; + } AddToCompanies(AeroCorp); - var OmniaCybersystems = new Company(); - OmniaCybersystems.init(Locations.VolhavenOmniaCybersystems, 1.7, 1.7, 199); + var OmniaCybersystems = new Company(Locations.VolhavenOmniaCybersystems, 1.7, 1.7, 199); OmniaCybersystems.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -730,10 +782,13 @@ initCompanies = function() { CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.VolhavenOmniaCybersystems)) { + OmniaCybersystems.favor = Companies[Locations.VolhavenOmniaCybersystems].favor; + delete Companies[Locations.VolhavenOmniaCybersystems]; + } AddToCompanies(OmniaCybersystems); - var SolarisSpaceSystems = new Company(); - SolarisSpaceSystems.init(Locations.ChongqingSolarisSpaceSystems, 1.7, 1.7, 199); + var SolarisSpaceSystems = new Company(Locations.ChongqingSolarisSpaceSystems, 1.7, 1.7, 199); SolarisSpaceSystems.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -743,10 +798,13 @@ initCompanies = function() { CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.ChongqingSolarisSpaceSystems)) { + SolarisSpaceSystems.favor = Companies[Locations.ChongqingSolarisSpaceSystems].favor; + delete Companies[Locations.ChongqingSolarisSpaceSystems]; + } AddToCompanies(SolarisSpaceSystems); - var DeltaOne = new Company(); - DeltaOne.init(Locations.Sector12DeltaOne, 1.6, 1.6, 199); + var DeltaOne = new Company(Locations.Sector12DeltaOne, 1.6, 1.6, 199); DeltaOne.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -756,11 +814,14 @@ initCompanies = function() { CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.Sector12DeltaOne)) { + DeltaOne.favor = Companies[Locations.Sector12DeltaOne].favor; + delete Companies[Locations.Sector12DeltaOne]; + } AddToCompanies(DeltaOne); //Health, medicine, pharmaceutical companies ("Large" servers) - var GlobalPharmaceuticals = new Company(); - GlobalPharmaceuticals.init(Locations.NewTokyoGlobalPharmaceuticals, 1.8, 1.8, 224); + var GlobalPharmaceuticals = new Company(Locations.NewTokyoGlobalPharmaceuticals, 1.8, 1.8, 224); GlobalPharmaceuticals.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -771,10 +832,13 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.NewTokyoGlobalPharmaceuticals)) { + GlobalPharmaceuticals.favor = Companies[Locations.NewTokyoGlobalPharmaceuticals].favor; + delete Companies[Locations.NewTokyoGlobalPharmaceuticals]; + } AddToCompanies(GlobalPharmaceuticals); - var NovaMedical = new Company(); - NovaMedical.init(Locations.IshimaNovaMedical, 1.75, 1.75, 199); + var NovaMedical = new Company(Locations.IshimaNovaMedical, 1.75, 1.75, 199); NovaMedical.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.ITIntern, CompanyPositions.BusinessIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, @@ -785,11 +849,14 @@ initCompanies = function() { CompanyPositions.BusinessManager, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.IshimaNovaMedical)) { + NovaMedical.favor = Companies[Locations.IshimaNovaMedical].favor; + delete Companies[Locations.IshimaNovaMedical]; + } AddToCompanies(NovaMedical); //Other large companies - var CIA = new Company(); - CIA.init(Locations.Sector12CIA, 2.0, 2.0, 149); + var CIA = new Company(Locations.Sector12CIA, 2.0, 2.0, 149); CIA.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -798,10 +865,13 @@ initCompanies = function() { CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); + if (companyExists(Locations.Sector12CIA)) { + CIA.favor = Companies[Locations.Sector12CIA].favor; + delete Companies[Locations.Sector12CIA]; + } AddToCompanies(CIA); - var NSA = new Company(); - NSA.init(Locations.Sector12NSA, 2.0, 2.0, 149); + var NSA = new Company(Locations.Sector12NSA, 2.0, 2.0, 149); NSA.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, @@ -810,10 +880,13 @@ initCompanies = function() { CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); + if (companyExists(Locations.Sector12NSA)) { + NSA.favor = Companies[Locations.Sector12NSA].favor; + delete Companies[Locations.Sector12NSA]; + } AddToCompanies(NSA); - var WatchdogSecurity = new Company(); - WatchdogSecurity.init(Locations.AevumWatchdogSecurity, 1.5, 1.5, 124); + var WatchdogSecurity = new Company(Locations.AevumWatchdogSecurity, 1.5, 1.5, 124); WatchdogSecurity.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -823,11 +896,14 @@ initCompanies = function() { CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); + if (companyExists(Locations.AevumWatchdogSecurity)) { + WatchdogSecurity.favor = Companies[Locations.AevumWatchdogSecurity].favor; + delete Companies[Locations.AevumWatchdogSecurity]; + } AddToCompanies(WatchdogSecurity); //"Medium level" companies - var LexoCorp = new Company(); - LexoCorp.init(Locations.VolhavenLexoCorp, 1.4, 1.4, 99); + var LexoCorp = new Company(Locations.VolhavenLexoCorp, 1.4, 1.4, 99); LexoCorp.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -837,44 +913,59 @@ initCompanies = function() { CompanyPositions.BusinessIntern, CompanyPositions.BusinessAnalyst, CompanyPositions.OperationsManager, CompanyPositions.CFO, CompanyPositions.CEO, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.HeadOfSecurity]); + if (companyExists(Locations.VolhavenLexoCorp)) { + LexoCorp.favor = Companies[Locations.VolhavenLexoCorp].favor; + delete Companies[Locations.VolhavenLexoCorp]; + } AddToCompanies(LexoCorp); - var RhoConstruction = new Company(); - RhoConstruction.init(Locations.AevumRhoConstruction, 1.3, 1.3, 49); + var RhoConstruction = new Company(Locations.AevumRhoConstruction, 1.3, 1.3, 49); RhoConstruction.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.BusinessIntern, CompanyPositions.BusinessAnalyst, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager]); + if (companyExists(Locations.AevumRhoConstruction)) { + RhoConstruction.favor = Companies[Locations.AevumRhoConstruction].favor; + delete Companies[Locations.AevumRhoConstruction]; + } AddToCompanies(RhoConstruction); - var AlphaEnterprises = new Company(); - AlphaEnterprises.init(Locations.Sector12AlphaEnterprises, 1.5, 1.5, 99); + var AlphaEnterprises = new Company(Locations.Sector12AlphaEnterprises, 1.5, 1.5, 99); AlphaEnterprises.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, CompanyPositions.BusinessIntern, CompanyPositions.BusinessAnalyst, CompanyPositions.BusinessManager, CompanyPositions.OperationsManager]); + if (companyExists(Locations.Sector12AlphaEnterprises)) { + AlphaEnterprises.favor = Companies[Locations.Sector12AlphaEnterprises].favor; + delete Companies[Locations.Sector12AlphaEnterprises]; + } AddToCompanies(AlphaEnterprises); - var AevumPolice = new Company(); - AevumPolice.init(Locations.AevumPolice, 1.3, 1.3, 99); + var AevumPolice = new Company(Locations.AevumPolice, 1.3, 1.3, 99); AevumPolice.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SecurityGuard, CompanyPositions.PoliceOfficer]); + if (companyExists(Locations.AevumPolice)) { + AevumPolice.favor = Companies[Locations.AevumPolice].favor; + delete Companies[Locations.AevumPolice]; + } AddToCompanies(AevumPolice); - var SysCoreSecurities = new Company(); - SysCoreSecurities.init(Locations.VolhavenSysCoreSecurities, 1.3, 1.3, 124); + var SysCoreSecurities = new Company(Locations.VolhavenSysCoreSecurities, 1.3, 1.3, 124); SysCoreSecurities.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.CTO]); + if (companyExists(Locations.VolhavenSysCoreSecurities)) { + SysCoreSecurities.favor = Companies[Locations.VolhavenSysCoreSecurities].favor; + delete Companies[Locations.VolhavenSysCoreSecurities]; + } AddToCompanies(SysCoreSecurities); - var CompuTek = new Company(); - CompuTek.init(Locations.VolhavenCompuTek, 1.2, 1.2, 74); + var CompuTek = new Company(Locations.VolhavenCompuTek, 1.2, 1.2, 74); CompuTek.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -882,10 +973,13 @@ initCompanies = function() { CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.CTO]); + if (companyExists(Locations.VolhavenCompuTek)) { + CompuTek.favor = Companies[Locations.VolhavenCompuTek].favor; + delete Companies[Locations.VolhavenCompuTek]; + } AddToCompanies(CompuTek); - var NetLinkTechnologies = new Company(); - NetLinkTechnologies.init(Locations.AevumNetLinkTechnologies, 1.2, 1.2, 99); + var NetLinkTechnologies = new Company(Locations.AevumNetLinkTechnologies, 1.2, 1.2, 99); NetLinkTechnologies.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -893,10 +987,13 @@ initCompanies = function() { CompanyPositions.ITManager, CompanyPositions.SysAdmin, CompanyPositions.SecurityEngineer, CompanyPositions.NetworkEngineer, CompanyPositions.NetworkAdministrator, CompanyPositions.HeadOfSoftware, CompanyPositions.CTO]); + if (companyExists(Locations.AevumNetLinkTechnologies)) { + NetLinkTechnologies.favor = Companies[Locations.AevumNetLinkTechnologies].favor; + delete Companies[Locations.AevumNetLinkTechnologies]; + } AddToCompanies(NetLinkTechnologies); - var CarmichaelSecurity = new Company(); - CarmichaelSecurity.init(Locations.Sector12CarmichaelSecurity, 1.2, 1.2, 74); + var CarmichaelSecurity = new Company(Locations.Sector12CarmichaelSecurity, 1.2, 1.2, 74); CarmichaelSecurity.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, @@ -906,32 +1003,48 @@ initCompanies = function() { CompanyPositions.HeadOfEngineering, CompanyPositions.SecurityGuard, CompanyPositions.SecurityOfficer, CompanyPositions.SecuritySupervisor, CompanyPositions.HeadOfSecurity, CompanyPositions.FieldAgent, CompanyPositions.SecretAgent, CompanyPositions.SpecialOperative]); + if (companyExists(Locations.Sector12CarmichaelSecurity)) { + CarmichaelSecurity.favor = Companies[Locations.Sector12CarmichaelSecurity].favor; + delete Companies[Locations.Sector12CarmichaelSecurity]; + } AddToCompanies(CarmichaelSecurity); //"Low level" companies - var FoodNStuff = new Company(); - FoodNStuff.init(Locations.Sector12FoodNStuff, 1, 1, 0); + var FoodNStuff = new Company(Locations.Sector12FoodNStuff, 1, 1, 0); FoodNStuff.addPositions([CompanyPositions.Employee, CompanyPositions.PartTimeEmployee]); + if (companyExists(Locations.Sector12FoodNStuff)) { + FoodNStuff.favor = Companies[Locations.Sector12FoodNStuff].favor; + delete Companies[Locations.Sector12FoodNStuff]; + } AddToCompanies(FoodNStuff); - var JoesGuns = new Company(); - JoesGuns.init(Locations.Sector12JoesGuns, 1, 1, 0); + var JoesGuns = new Company(Locations.Sector12JoesGuns, 1, 1, 0); JoesGuns.addPositions([CompanyPositions.Employee, CompanyPositions.PartTimeEmployee]); + if (companyExists(Locations.Sector12JoesGuns)) { + JoesGuns.favor = Companies[Locations.Sector12JoesGuns].favor; + delete Companies[Locations.Sector12JoesGuns]; + } AddToCompanies(JoesGuns); - var OmegaSoftware = new Company(); - OmegaSoftware.init(Locations.IshimaOmegaSoftware, 1.1, 1.1, 49); + var OmegaSoftware = new Company(Locations.IshimaOmegaSoftware, 1.1, 1.1, 49); OmegaSoftware.addPositions([ CompanyPositions.SoftwareIntern, CompanyPositions.JuniorDev, CompanyPositions.SeniorDev, CompanyPositions.LeadDev, CompanyPositions.SoftwareConsultant, CompanyPositions.SeniorSoftwareConsultant, CompanyPositions.ITIntern, CompanyPositions.ITAnalyst, CompanyPositions.ITManager, CompanyPositions.CTO, CompanyPositions.CEO]); + if (companyExists(Locations.IshimaOmegaSoftware)) { + OmegaSoftware.favor = Companies[Locations.IshimaOmegaSoftware].favor; + delete Companies[Locations.IshimaOmegaSoftware]; + } AddToCompanies(OmegaSoftware); /* Companies that do not have servers */ - var NoodleBar = new Company(); - NoodleBar.init(Locations.NewTokyoNoodleBar, 1, 1, 0); + var NoodleBar = new Company(Locations.NewTokyoNoodleBar, 1, 1, 0); NoodleBar.addPositions([CompanyPositions.Waiter, CompanyPositions.PartTimeWaiter]); + if (companyExists(Locations.NewTokyoNoodleBar)) { + NoodleBar.favor = Companies[Locations.NewTokyoNoodleBar].favor; + delete Companies[Locations.NewTokyoNoodleBar]; + } AddToCompanies(NoodleBar); } @@ -942,4 +1055,8 @@ Companies = {} AddToCompanies = function (company) { var name = company.companyName; Companies[name] = company; +} + +function companyExists(name) { + return Companies.hasOwnProperty(name); } \ No newline at end of file diff --git a/src/Constants.js b/src/Constants.js index 44e610c14..99963145e 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -28,6 +28,10 @@ CONSTANTS = { HacknetNodeMaxRam: 64, HacknetNodeMaxCores: 16, + /* Faction and Company favor */ + FactionReputationToFavor: 7500, + CompanyReputationToFavor: 5000, + /* Augmentation */ //NeuroFlux Governor cost multiplier as you level up NeuroFluxGovernorLevelMult: 1.13, @@ -67,6 +71,8 @@ CONSTANTS = { ScriptHNUpgRamRamCost: 0.6, ScriptHNUpgCoreRamCost: 0.8, + MultithreadingRAMCost: 1.002, + //Server constants ServerBaseGrowthRate: 1.03, //Unadjusted Growth rate ServerMaxGrowthRate: 1.0045, //Maximum possible growth rate (max rate accounting for server security) @@ -281,7 +287,7 @@ CONSTANTS = { "yield $50,000.

" + "Each additional thread to a script will slightly increase the RAM usage for that thread. The total cost of running a script with " + "n threads can be calculated with:
" + - "base cost * n * (1.01 ^ n)
" + + "base cost * n * (1.005 ^ n)
" + "where the base cost is the amount of RAM required to run the script with a single thread. In the terminal, you can run the " + "'mem [scriptname] -t n' command to see how much RAM a script requires with n threads.

" + "Every method for running a script has an option for making it multihreaded. To run a script with " + @@ -471,6 +477,11 @@ CONSTANTS = { "hostname or IP of the target server. Does NOT work while offline
Example: getServerMoneyAvailable('foodnstuff');

" + "getServerSecurityLevel(hostname/ip)
Returns the security level of a server. The argument passed in must be a string with either the " + "hostname or IP of the target server. A server's security is denoted by a number between 1 and 100. Does NOT work while offline.

" + + "getServerBaseSecurityLevel(hostname/ip)
Returns the base security level of a server. This is the security level that the server starts out with. " + + "This is different than getServerSecurityLevel() because getServerSecurityLevel() returns the current security level of a server, which can constantly change " + + "due to hack(), grow(), and weaken() calls on that server. The base security level will stay the same until you reset by installing an Augmentation.

" + + "The argument passed in must be a string with either the hostname or IP of the target server. A server's base security is denoted by a number between 1 and 100. " + + "Does NOT work while offline.

" + "getServerRequiredHackingLevel(hostname/ip)
Returns the required hacking level of a server. The argument passed in must be a string with either the " + "hostname or IP or the target server. Does NOT work while offline

" + "fileExists(filename, [hostname/ip])
Returns a boolean (true or false) indicating whether the specified file exists on a server. " + @@ -643,21 +654,26 @@ CONSTANTS = { "RAM Upgrades on your home computer", Changelog: - "v0.21.2
" + + "v0.22.0 - Major rebalancing, optimization, and favor system
" + "-Significantly nerfed most augmentations
" + "-Almost every server with a required hacking level of 200 or more now has slightly randomized server parameters. This means that after every Augmentation " + "purchase, the required hacking level, base security level, and growth factor of these servers will all be slightly different
" + - "-The hacking speed multiplier now increases rather than decreases. The hacking time is divided by your hacking speed " + - "multiplier rather than multiplied. In other words, a higher hacking speed multiplier is better now
" + - "-Servers now have a minimum server security, which is approximately one third of their starting server security
" + + "-The hacking speed multiplier now increases rather than decreases. The hacking time is now divided by your hacking speed " + + "multiplier rather than multiplied. In other words, a higher hacking speed multiplier is better
" + + "-Servers now have a minimum server security, which is approximately one third of their starting ('base') server security
" + "-If you do not steal any money from a server, then you gain hacking experience equal to the amount you would have gained " + "had you failed the hack
" + - "-The effects of grow() increased by 50%
" + + "-The effects of grow() were increased by 50%
" + "-grow() and weaken() now give hacking experience based on the server's base security level, rather than a flat exp amount
" + "-Slightly reduced amount of exp gained from hack(), weaken(), and grow()
" + "-Rebalanced formulas that determine crime success
" + - "-Reduced RAM cost for multithreading a script. The RAM multiplier for each thread was reduced from 1.02 to 1.01
" + + "-Reduced RAM cost for multithreading a script. The RAM multiplier for each thread was reduced from 1.02 to 1.005
" + "-Optimized Script objects so they take less space in the save file
" + + "-Added getServerBaseSecurityLevel() Netscript function
" + + "-New favor system for companies and factions. Earning reputation at a company/faction will give you favor for that entity when you " + + "reset after installing an Augmentation. This favor persists through the rest of the game. The more favor you have, the faster you will earn " + + "reputation with that faction
" + + "-You can no longer donate to a faction for reputation until you have 150 favor with that faction

" + "v0.21.1
" + "-IF YOUR GAME BREAKS, DO THE FOLLOWING: Options -> Soft Reset -> Save Game -> Reload Page. Sorry about that!
" + "-Autocompletion for aliases - courtesy of Github user LTCNugget

" + diff --git a/src/Faction.js b/src/Faction.js index a6c1433a2..71929e8c4 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -30,6 +30,9 @@ function Faction(name) { //Multipliers for unlocking and purchasing augmentations this.augmentationPriceMult = 1; this.augmentationRepRequirementMult = 1; + + //Faction favor + this.favor = 0; }; Faction.prototype.setAugmentationMultipliers = function(price, rep) { @@ -41,6 +44,12 @@ Faction.prototype.setInfo = function(inf) { this.info = inf; } +Faction.prototype.gainFavor = function() { + if (this.favor == null || this.favor == undefined) {this.favor = 0;} + var gain = (this.playerReputation / CONSTANTS.FactionReputationToFavor); + this.favor += gain; +} + Faction.prototype.toJSON = function() { return Generic_toJSON("Faction", this); } @@ -59,115 +68,267 @@ AddToFactions = function(faction) { Factions[name] = faction; } +function factionExists(name) { + return Factions.hasOwnProperty(name); +} + //TODO Augmentation price and rep requirement mult are 1 for everything right now, // This might change in the future for balance initFactions = function() { //Endgame var Illuminati = new Faction("Illuminati"); Illuminati.setInfo(FactionInfo.IlluminatiInfo); + if (factionExists("Illuminati")) { + Illuminati.favor = Factions["Illuminati"].favor; + delete Factions["Illuminati"]; + } AddToFactions(Illuminati); + var Daedalus = new Faction("Daedalus"); Daedalus.setInfo(FactionInfo.DaedalusInfo); + if (factionExists("Daedalus")) { + Daedalus.favor = Factions["Daedalus"].favor; + delete Factions["Daedalus"]; + } AddToFactions(Daedalus); + var Covenant = new Faction("The Covenant"); Covenant.setInfo(FactionInfo.CovenantInfo); + if (factionExists("The Covenant")) { + Covenant.favor = Factions["The Covenant"].favor; + delete Factions["The Covenant"]; + } AddToFactions(Covenant); //Megacorporations, each forms its own faction var ECorp = new Faction("ECorp"); ECorp.setInfo(FactionInfo.ECorpInfo); + if (factionExists("ECorp")) { + ECorp.favor = Factions["ECorp"].favor; + delete Factions["ECorp"]; + } AddToFactions(ECorp); + var MegaCorp = new Faction("MegaCorp"); MegaCorp.setInfo(FactionInfo.MegaCorpInfo); + if (factionExists("MegaCorp")) { + MegaCorp.favor = Factions["MegaCorp"].favor; + delete Factions["MegaCorp"]; + } AddToFactions(MegaCorp); + var BachmanAndAssociates = new Faction("Bachman & Associates"); BachmanAndAssociates.setInfo(FactionInfo.BachmanAndAssociatesInfo); + if (factionExists("Bachman & Associates")) { + BachmanAndAssociates.favor = Factions["Bachman & Associates"].favor; + delete Factions["Bachman & Associates"]; + } AddToFactions(BachmanAndAssociates); + var BladeIndustries = new Faction("Blade Industries"); BladeIndustries.setInfo(FactionInfo.BladeIndustriesInfo); + if (factionExists("Blade Industries")) { + BladeIndustries.favor = Factions["Blade Industries"].favor; + delete Factions["Blade Industries"]; + } AddToFactions(BladeIndustries); + var NWO = new Faction("NWO"); NWO.setInfo(FactionInfo.NWOInfo); + if (factionExists("NWO")) { + NWO.favor = Factions["NWO"].favor; + delete Factions["NWO"]; + } AddToFactions(NWO); + var ClarkeIncorporated = new Faction("Clarke Incorporated"); ClarkeIncorporated.setInfo(FactionInfo.ClarkeIncorporatedInfo); + if (factionExists("Clarke Incorporated")) { + ClarkeIncorporated.favor = Factions["Clarke Incorporated"].favor; + delete Factions["Clarke Incorporated"]; + } AddToFactions(ClarkeIncorporated); + var OmniTekIncorporated = new Faction("OmniTek Incorporated"); OmniTekIncorporated.setInfo(FactionInfo.OmniTekIncorporatedInfo); + if (factionExists("OmniTek Incorporated")) { + OmniTekIncorporated.favor = Factions["OmniTek Incorporated"].favor; + delete Factions["OmniTek Incorporated"]; + } AddToFactions(OmniTekIncorporated); + var FourSigma = new Faction("Four Sigma"); FourSigma.setInfo(FactionInfo.FourSigmaInfo); + if (factionExists("Four Sigma")) { + FourSigma.favor = Factions["Four Sigma"].favor; + delete Factions["Four Sigma"]; + } AddToFactions(FourSigma); + var KuaiGongInternational = new Faction("KuaiGong International"); KuaiGongInternational.setInfo(FactionInfo.KuaiGongInternationalInfo); + if (factionExists("KuaiGong International")) { + KuaiGongInternational.favor = Factions["KuaiGong International"].favor; + delete Factions["KuaiGong International"]; + } AddToFactions(KuaiGongInternational); //Other corporations var FulcrumTechnologies = new Faction("Fulcrum Secret Technologies"); FulcrumTechnologies.setInfo(FactionInfo.FulcrumSecretTechnologiesInfo); + if (factionExists("Fulcrum Secret Technologies")) { + FulcrumTechnologies.favor = Factions["Fulcrum Secret Technologies"].favor; + delete Factions["Fulcrum Secret Technologies"]; + } AddToFactions(FulcrumTechnologies); //Hacker groups var BitRunners = new Faction("BitRunners"); BitRunners.setInfo(FactionInfo.BitRunnersInfo); + if (factionExists("BitRunners")) { + BitRunners.favor = Factions["BitRunners"].favor; + delete Factions["BitRunners"]; + } AddToFactions(BitRunners); + var BlackHand = new Faction("The Black Hand"); BlackHand.setInfo(FactionInfo.BlackHandInfo); + if (factionExists("The Black Hand")) { + BlackHand.favor = Factions["The Black Hand"].favor; + delete Factions["The Black Hand"]; + } AddToFactions(BlackHand); + var NiteSec = new Faction("NiteSec"); NiteSec.setInfo(FactionInfo.NiteSecInfo); + if (factionExists("NiteSec")) { + NiteSec.favor = Factions["NiteSec"].favor; + delete Factions["NiteSec"]; + } AddToFactions(NiteSec); //City factions, essentially governments var Chongqing = new Faction("Chongqing"); Chongqing.setInfo(FactionInfo.ChongqingInfo); + if (factionExists("Chongqing")) { + Chongqing.favor = Factions["Chongqing"].favor; + delete Factions["Chongqing"]; + } AddToFactions(Chongqing); + var Sector12 = new Faction("Sector-12"); Sector12.setInfo(FactionInfo.Sector12Info); + if (factionExists("Sector-12")) { + Sector12.favor = Factions["Sector-12"].favor; + delete Factions["Sector-12"]; + } AddToFactions(Sector12); + var NewTokyo = new Faction("New Tokyo"); NewTokyo.setInfo(FactionInfo.NewTokyoInfo); + if (factionExists("New Tokyo")) { + NewTokyo.favor = Factions["New Tokyo"].favor; + delete Factions["New Tokyo"]; + } AddToFactions(NewTokyo); + var Aevum = new Faction("Aevum"); Aevum.setInfo(FactionInfo.AevumInfo); + if (factionExists("Aevum")) { + Aevum.favor = Factions["Aevum"].favor; + delete Factions["Aevum"]; + } AddToFactions(Aevum); + var Ishima = new Faction("Ishima"); - Ishima.setInfo(FactionInfo.IshimaInfo); - AddToFactions(Ishima); + Ishima.setInfo var Volhaven = new Faction("Volhaven"); Volhaven.setInfo(FactionInfo.VolhavenInfo); - AddToFactions(Volhaven); + if (factionExists("Volhaven")) { + Volhaven.favor = Factions["Volhaven"].favor; + delete Factions["Volhaven"]; + } + AddToFactions(Volhaven);(FactionInfo.IshimaInfo); + if (factionExists("Ishima")) { + Ishima.favor = Factions["Ishima"].favor; + delete Factions["Ishima"]; + } + AddToFactions(Ishima); + //Criminal Organizations/Gangs var SpeakersForTheDead = new Faction("Speakers for the Dead"); SpeakersForTheDead.setInfo(FactionInfo.SpeakersForTheDeadInfo); + if (factionExists("Speakers for the Dead")) { + SpeakersForTheDead.favor = Factions["Speakers for the Dead"].favor; + delete Factions["Speakers for the Dead"]; + } AddToFactions(SpeakersForTheDead); + var DarkArmy = new Faction("The Dark Army"); DarkArmy.setInfo(FactionInfo.DarkArmyInfo); + if (factionExists("The Dark Army")) { + DarkArmy.favor = Factions["The Dark Army"].favor; + delete Factions["The Dark Army"]; + } AddToFactions(DarkArmy); + var TheSyndicate = new Faction("The Syndicate"); TheSyndicate.setInfo(FactionInfo.TheSyndicateInfo); + if (factionExists("The Syndicate")) { + TheSyndicate.favor = Factions["The Syndicate"].favor; + delete Factions["The Syndicate"]; + } AddToFactions(TheSyndicate); + var Silhouette = new Faction("Silhouette"); Silhouette.setInfo(FactionInfo.SilhouetteInfo); + if (factionExists("Silhouette")) { + Silhouette.favor = Factions["Silhouette"].favor; + delete Factions["Silhouette"]; + } AddToFactions(Silhouette); + var Tetrads = new Faction("Tetrads"); //Low-medium level asian crime gang Tetrads.setInfo(FactionInfo.TetradsInfo); + if (factionExists("Tetrads")) { + Tetrads.favor = Factions["Tetrads"].favor; + delete Factions["Tetrads"]; + } AddToFactions(Tetrads); + var SlumSnakes = new Faction("Slum Snakes"); //Low level crime gang SlumSnakes.setInfo(FactionInfo.SlumSnakesInfo); + if (factionExists("Slum Snakes")) { + SlumSnakes.favor = Factions["Slum Snakes"].favor; + delete Factions["Slum Snakes"]; + } AddToFactions(SlumSnakes); //Earlygame factions - factions the player will prestige with early on that don't //belong in other categories var Netburners = new Faction("Netburners"); Netburners.setInfo(FactionInfo.NetburnersInfo); + if (factionExists("Netburners")) { + Netburners.favor = Factions["Netburners"].favor; + delete Factions["Netburners"]; + } AddToFactions(Netburners); + var TianDiHui = new Faction("Tian Di Hui"); //Society of the Heaven and Earth TianDiHui.setInfo(FactionInfo.TianDiHuiInfo); + if (factionExists("Tian Di Hui")) { + TianDiHui.favor = Factions["Tian Di Hui"].favor; + delete Factions["Tian Di Hui"]; + } AddToFactions(TianDiHui); + var CyberSec = new Faction("CyberSec"); CyberSec.setInfo(FactionInfo.CyberSecInfo); + if (factionExists("CyberSec")) { + CyberSec.favor = Factions["CyberSec"].favor; + delete Factions["CyberSec"]; + } AddToFactions(CyberSec); } @@ -550,7 +711,15 @@ displayFactionContent = function(factionName) { var faction = Factions[factionName]; document.getElementById("faction-name").innerHTML = factionName; document.getElementById("faction-info").innerHTML = "" + faction.info + ""; - document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4); + document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4) + + "You will earn " + + formatNumber(faction.playerReputation / CONSTANTS.FactionReputationToFavor, 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 " + + "you earn reputation for this faction by 1% per favor. Faction favor " + + "is gained whenever you reset after installing an Augmentation. The amount of " + + "favor you gain depends on how much reputation you have with the faction"; var hackDiv = document.getElementById("faction-hack-div"); var fieldWorkDiv = document.getElementById("faction-fieldwork-div"); @@ -618,7 +787,12 @@ displayFactionContent = function(factionName) { }); if (faction.isMember) { - donateDiv.style.display = "inline"; + if (faction.favor >= 150) { + donateDiv.style.display = "inline"; + } else { + donateDiv.style.display = "none"; + } + switch(faction.name) { case "Illuminati": hackDiv.style.display = "inline"; diff --git a/src/Location.js b/src/Location.js index b2d94318a..b1c324d21 100644 --- a/src/Location.js +++ b/src/Location.js @@ -111,6 +111,10 @@ displayLocationContent = function() { var jobTitle = document.getElementById("location-job-title"); var jobReputation = document.getElementById("location-job-reputation"); + var companyFavor = document.getElementById("location-company-favor"); + var locationTxtDiv1 = document.getElementById("location-text-divider-1"); + var locationTxtDiv2 = document.getElementById("location-text-divider-2"); + var locationTxtDiv3 = document.getElementById("location-text-divider-3"); var gymTrainStr = document.getElementById("location-gym-train-str"); var gymTrainDef = document.getElementById("location-gym-train-def"); @@ -259,9 +263,21 @@ displayLocationContent = function() { var company = Companies[loc]; jobTitle.style.display = "block"; - jobReputation.style.display = "block"; + jobReputation.style.display = "inline"; + companyFavor.style.display = "inline"; + locationTxtDiv1.style.display = "block"; + locationTxtDiv2.style.display = "block"; + locationTxtDiv3.style.display = "block"; jobTitle.innerHTML = "Job Title: " + Player.companyPosition.positionName; - jobReputation.innerHTML = "Company reputation: " + (company.playerReputation.toFixed(4)).toLocaleString(); + jobReputation.innerHTML = "Company reputation: " + formatNumber(company.playerReputation, 4) + + "You will earn " + + formatNumber(company.playerReputation / CONSTANTS.CompanyReputationToFavor, 4) + + " faction favor upon resetting after installing an Augmentation"; + companyFavor.innerHTML = "Company Favor: " + formatNumber(company.favor, 4) + + "Company favor increases the rate at which " + + "you earn reputation for this company by 1% per favor. Company favor " + + "is gained whenever you reset after installing an Augmentation. The amount of " + + "favor you gain depends on how much reputation you have with the company"; work.style.display = "block"; var currPos = Player.companyPosition; @@ -298,6 +314,10 @@ displayLocationContent = function() { } else { jobTitle.style.display = "none"; jobReputation.style.display = "none"; + companyFavor.style.display = "none"; + locationTxtDiv1.style.display = "none"; + locationTxtDiv2.style.display = "none"; + locationTxtDiv3.style.display = "none"; } switch (loc) { diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index 3d3403661..3a87ca249 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -498,6 +498,22 @@ function evaluate(exp, workerScript) { }, function(e) { reject(e); }); + } else if (exp.func.value == "getServerBaseSecurityLevel") { + if (exp.args.length != 1) { + return reject(makeRuntimeRejectMsg(workerScript, "getServerBaseSecurityLevel() call has incorrect number of arguments. Takes 1 arguments")); + } + var ipPromise = evaluate(exp.args[0], workerScript); + ipPromise.then(function(ip) { + var server = getServer(ip); + if (server == null) { + workerScript.scriptRef.log("getServerBaseSecurityLevel() failed. Invalid IP or hostname passed in: " + ip); + return reject(makeRuntimeRejectMsg(workerScript, "Invalid IP or hostname passed into getServerBaseSecurityLevel() command"));; + } + workerScript.scriptRef.log("getServerBaseSecurityLevel() returned " + formatNumber(server.baseDifficulty, 3) + " for " + server.hostname); + resolve(server.baseDifficulty); + }, function(e) { + reject(e); + }); } else if (exp.func.value == "getServerRequiredHackingLevel") { if (exp.args.length != 1) { return reject(makeRuntimeRejectMsg(workerScript, "getServerRequiredHackingLevel() call has incorrect number of arguments. Takes 1 argument")); @@ -971,7 +987,7 @@ function runScriptFromScript(server, scriptname, args, workerScript, threads=1) //Check for admin rights and that there is enough RAM availble to run var script = server.scripts[i]; var ramUsage = script.ramUsage; - ramUsage = ramUsage * threads * Math.pow(1.01, threads-1); + ramUsage = ramUsage * threads * Math.pow(CONSTANTS.MultithreadingRAMCost, threads-1); var ramAvailable = server.maxRam - server.ramUsed; if (server.hasAdminRights == false) { @@ -1032,7 +1048,7 @@ function scriptCalculateExpGain(server) { if (server.baseDifficulty == null) { server.baseDifficulty = server.hackDifficulty; } - return (server.baseDifficulty * Player.hacking_exp_mult * 0.5 + 3); + return (server.baseDifficulty * Player.hacking_exp_mult * 0.5 + 1); } //The same as Player's calculatePercentMoneyHacked() function but takes in the server as an argument diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index 31b876c29..17459a422 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -142,7 +142,8 @@ function addWorkerScript(runningScriptObj, server) { } else { runningScriptObj.threads = 1; } - var ramUsage = runningScriptObj.scriptRef.ramUsage * threads * Math.pow(1.01, threads-1); + var ramUsage = runningScriptObj.scriptRef.ramUsage * threads + * Math.pow(CONSTANTS.MultithreadingRAMCost, threads-1); server.ramUsed += ramUsage; //Create the WorkerScript diff --git a/src/Player.js b/src/Player.js index 217db6769..5223668c9 100644 --- a/src/Player.js +++ b/src/Player.js @@ -259,7 +259,7 @@ PlayerObject.prototype.calculateExpGain = function() { if (s.baseDifficulty == null) { s.baseDifficulty = s.hackDifficulty; } - return (s.baseDifficulty * this.hacking_exp_mult * 0.5 + 3); + return (s.baseDifficulty * this.hacking_exp_mult * 0.5 + 1); } //Hack/Analyze a server. Return the amount of time the hack will take. This lets the Terminal object know how long to disable itself for @@ -635,6 +635,11 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, faction) { } PlayerObject.prototype.startFactionWork = function(faction) { + //Update reputation gain rate to account for faction favor + var favorMult = 1 + (faction.favor / 100); + if (isNaN(favorMult)) {favorMult = 1;} + this.workRepGainRate *= favorMult; + this.isWorking = true; this.workType = CONSTANTS.WorkTypeFaction; this.currentWorkFactionName = faction.name; @@ -655,8 +660,8 @@ PlayerObject.prototype.startFactionWork = function(faction) { PlayerObject.prototype.startFactionHackWork = function(faction) { this.resetWorkStatus(); - this.workHackExpGainRate = .175 * this.hacking_exp_mult; - this.workRepGainRate = this.hacking_skill / CONSTANTS.MaxSkillLevel * this.faction_rep_mult; + this.workHackExpGainRate = .15 * this.hacking_exp_mult; + this.workRepGainRate = 0.9 * this.hacking_skill / CONSTANTS.MaxSkillLevel * this.faction_rep_mult; this.factionWorkType = CONSTANTS.FactionWorkHacking; this.currentWorkFactionDescription = "carrying out hacking contracts"; @@ -716,6 +721,11 @@ PlayerObject.prototype.workForFaction = function(numCycles) { break; } + //Update reputation gain rate to account for faction favor + var favorMult = 1 + (faction.favor / 100); + if (isNaN(favorMult)) {favorMult = 1;} + this.workRepGainRate *= favorMult; + this.workHackExpGained += this.workHackExpGainRate * numCycles; this.workStrExpGained += this.workStrExpGainRate * numCycles; this.workDefExpGained += this.workDefExpGainRate * numCycles; @@ -805,29 +815,32 @@ PlayerObject.prototype.getWorkChaExpGain = function() { //Reputation gained per game cycle PlayerObject.prototype.getWorkRepGain = function() { - + var company = Companies[this.companyName]; var jobPerformance = this.companyPosition.calculateJobPerformance(this.hacking_skill, this.strength, this.defense, this.dexterity, - this.agility, this.charisma); - return jobPerformance * this.company_rep_mult; + this.agility, this.charisma); + //Update reputation gain rate to account for company favor + var favorMult = 1 + (company.favor / 100); + if (isNaN(favorMult)) {favorMult = 1;} + return jobPerformance * this.company_rep_mult * favorMult; } PlayerObject.prototype.getFactionSecurityWorkRepGain = function() { - var t = (this.hacking_skill / CONSTANTS.MaxSkillLevel + - this.strength / CONSTANTS.MaxSkillLevel + - this.defense / CONSTANTS.MaxSkillLevel + - this.dexterity / CONSTANTS.MaxSkillLevel + - this.agility / CONSTANTS.MaxSkillLevel) / 5; + var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel + + this.strength / CONSTANTS.MaxSkillLevel + + this.defense / CONSTANTS.MaxSkillLevel + + this.dexterity / CONSTANTS.MaxSkillLevel + + this.agility / CONSTANTS.MaxSkillLevel) / 5; return t * this.faction_rep_mult; } PlayerObject.prototype.getFactionFieldWorkRepGain = function() { - var t = (this.hacking_skill / CONSTANTS.MaxSkillLevel + - this.strength / CONSTANTS.MaxSkillLevel + - this.defense / CONSTANTS.MaxSkillLevel + - this.dexterity / CONSTANTS.MaxSkillLevel + - this.agility / CONSTANTS.MaxSkillLevel + - this.charisma / CONSTANTS.MaxSkillLevel) / 6; + var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel + + this.strength / CONSTANTS.MaxSkillLevel + + this.defense / CONSTANTS.MaxSkillLevel + + this.dexterity / CONSTANTS.MaxSkillLevel + + this.agility / CONSTANTS.MaxSkillLevel + + this.charisma / CONSTANTS.MaxSkillLevel) / 6; return t * this.faction_rep_mult; } diff --git a/src/Prestige.js b/src/Prestige.js index ff8a91178..ff33f2524 100644 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -166,21 +166,19 @@ function prestigeAugmentation() { Player.hacknetNodes.length = 0; Player.totalHacknetNodeProduction = 0; - //Delete Companies + //Gain favor for Companies for (var member in Companies) { if (Companies.hasOwnProperty(member)) { - delete Companies[member]; + Companies[member].gainFavor(); } } - Companies = {}; - //Reset Factions + //Gain favor for factions for (var member in Factions) { if (Factions.hasOwnProperty(member)) { - delete Factions[member]; + Factions[member].gainFavor(); } } - Factions = {}; //Stop a Terminal action if there is onerror if (Engine._actionInProgress) { diff --git a/src/Script.js b/src/Script.js index ba4dc109a..6bd22cef3 100644 --- a/src/Script.js +++ b/src/Script.js @@ -278,6 +278,7 @@ scriptCalculateOfflineProduction = function(runningScriptObj) { runningScriptObj.log(runningScriptObj.filename + " generated $" + production + " while offline by hacking " + serv.hostname); serv.moneyAvailable -= production; if (serv.moneyAvailable < 0) {serv.moneyAvailable = 0;} + if (isNaN(serv.moneyAvailable)) {serv.moneyAvailable = 0;} } } diff --git a/src/Terminal.js b/src/Terminal.js index 5a2d318f1..6d1c56dc4 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -790,7 +790,7 @@ var Terminal = { for (var i = 0; i < currServ.scripts.length; ++i) { if (scriptName == currServ.scripts[i].filename) { var scriptBaseRamUsage = currServ.scripts[i].ramUsage; - var ramUsage = scriptBaseRamUsage * numThreads * Math.pow(1.01, numThreads-1); + var ramUsage = scriptBaseRamUsage * numThreads * Math.pow(CONSTANTS.MultithreadingRAMCost, numThreads-1); post("This script requires " + formatNumber(ramUsage, 2) + "GB of RAM to run for " + numThreads + " thread(s)"); return; @@ -1304,7 +1304,7 @@ var Terminal = { if (server.scripts[i].filename == scriptName) { //Check for admin rights and that there is enough RAM availble to run var script = server.scripts[i]; - var ramUsage = script.ramUsage * numThreads * Math.pow(1.01, numThreads-1); + var ramUsage = script.ramUsage * numThreads * Math.pow(CONSTANTS.MultithreadingRAMCost, numThreads-1); var ramAvailable = server.maxRam - server.ramUsed; if (server.hasAdminRights == false) { diff --git a/utils/PurchaseRamForHomeBox.js b/utils/PurchaseRamForHomeBox.js index 096451382..a59ed0bf9 100644 --- a/utils/PurchaseRamForHomeBox.js +++ b/utils/PurchaseRamForHomeBox.js @@ -36,7 +36,7 @@ purchaseRamForHomeBoxCreate = function() { //Calculate cost //Have cost increase by some percentage each time RAM has been upgraded var cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome; - var mult = Math.pow(1.43, numUpgrades); + var mult = Math.pow(1.45, numUpgrades); cost = cost * mult; purchaseRamForHomeBoxSetText("Would you like to purchase additional RAM for your home computer?

" +