mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-03-07 19:14:37 +01:00
Added University/study + taking class mechanics. Minor improvements to UI and some rebalancing
This commit is contained in:
90
index.html
90
index.html
@ -142,6 +142,9 @@
|
||||
<ul id="aevum-locations-list">
|
||||
<li id="aevum-travelagency-li">
|
||||
<a href="#" id="aevum-travelagency" class="a-link-button"> Travel Agency </a>
|
||||
</li>
|
||||
<li id="aevum-summituniversity-li">
|
||||
<a href="#" id="aevum-summituniversity" class="a-link-button"> Summit University </a>
|
||||
</li>
|
||||
<li id="aevum-ecorp-li">
|
||||
<a href="#" id="aevum-ecorp" class="a-link-button"> ECorp </a>
|
||||
@ -184,124 +187,130 @@
|
||||
<ul id="chongqing-locations-list">
|
||||
<li id="chongqing-travelagency-li">
|
||||
<a href="#" id="chongqing-travelagency" class="a-link-button"> Travel Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="chonqging-kuaigonginternational-li">
|
||||
<a href="#" id="chongqing-kuaigonginternational" class="a-link-button">KuaiGong International </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="chongqing-solarisspacesystems-li">
|
||||
<a href="#" id="chongqing-solarisspacesystems" class="a-link-button">Solaris Space Systems</a>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="sector12-locations-list">
|
||||
<li id="sector12-travelagency-li">
|
||||
<a href="#" id="sector12-travelagency" class="a-link-button">Travel Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-rothmanuniversity-li">
|
||||
<a href="#" id="sector12-rothmanuniversity" class="a-link-button"> Rothman University</a>
|
||||
</li>
|
||||
<li id="sector12-megacorp-li">
|
||||
<a href="#" id="sector12-megacorp" class="a-link-button">MegaCorp</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-bladeindustries-li">
|
||||
<a href="#" id="sector12-bladeindustries" class="a-link-button"> Blade Industries</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-foursigma-li">
|
||||
<a href="#" id="sector12-foursigma" class="a-link-button">Four Sigma</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-icarusmicrosystems-li">
|
||||
<a href="#" id="sector12-icarusmicrosystems" class="a-link-button"> Icarus Microsystems</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-universalenergy-li">
|
||||
<a href="#" id="sector12-universalenergy" class="a-link-button">Universal Energy </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-deltaone-li">
|
||||
<a href="#" id="sector12-deltaone" class="a-link-button">DeltaOne </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-cia-li">
|
||||
<a href="#" id="sector12-cia" class="a-link-button">Central Intelligence Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-nsa-li">
|
||||
<a href="#" id="sector12-nsa" class="a-link-button">National Security Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-alphaenterprises-li">
|
||||
<a href="#" id="sector12-alphaenterprises" class="a-link-button">Alpha Enterprises</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-carmichaelsecurity-li">
|
||||
<a href="#" id="sector12-carmichaelsecurity" class="a-link-button"> Carmichael Security</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-foodnstuff-li">
|
||||
<a href="#" id="sector12-foodnstuff" class="a-link-button">FoodNStuff</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-joesguns-li">
|
||||
<a href="#" id="sector12-joesguns" class="a-link-button"> Joe's Guns</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-irongym-li">
|
||||
<a href="#" id="sector12-irongym" class="a-link-button">Iron Gym </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="sector12-powerhousegym-li">
|
||||
<a href="#" id="sector12-powerhousegym" class="a-link-button">Powerhouse Gym</a>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="newtokyo-locations-list">
|
||||
<li id="newtokyo-travelagency-li">
|
||||
<a href="#" id="newtokyo-travelagency" class="a-link-button"> Travel Agency</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="newtokyo-defcomm-li">
|
||||
<a href="#" id="newtokyo-defcomm" class="a-link-button"> DefComm</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="newtokyo-vitalife-li">
|
||||
<a href="#" id="newtokyo-vitalife" class="a-link-button">VitaLife </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="newtokyo-globalpharmaceuticals-li">
|
||||
<a href="#" id="newtokyo-globalpharmaceuticals" class="a-link-button">Global Pharmaceuticals</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="newtokyo-noodlebar-li">
|
||||
<a href="#" id="newtokyo-noodlebar" class="a-link-button">Noodle Bar </a>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="ishima-locations-list">
|
||||
<li id="ishima-travelagency-li">
|
||||
<a href="#" id="ishima-travelagency" class="a-link-button">Travel Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="ishima-stormtechnologies-li">
|
||||
<a href="#" id="ishima-stormtechnologies" class="a-link-button">Storm Technologies</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="ishima-novamedical-li">
|
||||
<a href="#" id="ishima-novamedical" class="a-link-button">Nova Medical</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="ishima-omegasoftware-li">
|
||||
<a href="#" id="ishima-omegasoftware" class="a-link-button">Omega Software </a>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul id="volhaven-locations-list">
|
||||
<li id="volhaven-travelagency-li">
|
||||
<a href="#" id="volhaven-travelagency" class="a-link-button">Travel Agency </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-zbinstituteoftechnology-li">
|
||||
<a href="#" id="volhaven-zbinstituteoftechnology" class="a-link-button">ZB Insitute of Technology</a>
|
||||
</li>
|
||||
<li id="volhaven-omnitekincorporated-li">
|
||||
<a href="#" id="volhaven-omnitekincorporated" class="a-link-button">OmniTek Incorporated </a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-nwo-li">
|
||||
<a href="#" id="volhaven-nwo" class="a-link-button">NWO</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-helislabs-li">
|
||||
<a href="#" id="volhaven-helioslabs" class="a-link-button">Helios Labs</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-omniacybersystems-li">
|
||||
<a href="#" id="volhaven-omniacybersystems" class="a-link-button">Omnia Cybersystems</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-lexocorp-li">
|
||||
<a href="#" id="volhaven-lexocorp" class="a-link-button">LexoCorp</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-syscoresecurities-li">
|
||||
<a href="#" id="volhaven-syscoresecurities" class="a-link-button">SysCore Securities</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-computek-li">
|
||||
<a href="#" id="volhaven-computek" class="a-link-button">CompuTek</a>
|
||||
<li>
|
||||
</li>
|
||||
<li id="volhaven-milleniumfitnessgym-li">
|
||||
<a href="#" id="volhaven-milleniumfitnessgym" class="a-link-button">Millenium Fitness Gym</a>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -457,6 +466,12 @@
|
||||
<a href="#" id="location-gym-train-dex" class="a-link-button">Train Dexterity</a>
|
||||
<a href="#" id="location-gym-train-agi" class="a-link-button">Train Agility</a>
|
||||
|
||||
<!-- Study/Take classes at a university -->
|
||||
<a href="#" id="location-study-computer-science" class="a-link-button">Study Computer Science (free)</a>
|
||||
<a href="#" id="location-data-structures-class" class="a-link-button">Take Data Structures Class</a>
|
||||
<a href="#" id="location-networks-class" class="a-link-button">Take Networks Class</a>
|
||||
<a href="#" id="location-algorithms-class" class="a-link-button">Take Algorithms Class</a>
|
||||
|
||||
<!-- Purchase servers -->
|
||||
<a href="#" id="location-purchase-1gb" class="a-link-button"> Purchase 1GB Server - $50,000</a>
|
||||
<a href="#" id="location-purchase-2gb" class="a-link-button"> Purchase 2GB Server - $100,000</a>
|
||||
@ -488,8 +503,11 @@
|
||||
<div id="dialog-box-content">
|
||||
<span id="dialog-box-close-button">×</span>
|
||||
<p id="dialog-box-text-1" class="dialog-box-text"> </p>
|
||||
<br>
|
||||
<p id="dialog-box-text-2" class="dialog-box-text"> </p>
|
||||
<br>
|
||||
<p id="dialog-box-text-3" class="dialog-box-text"> </p>
|
||||
<br>
|
||||
<p id="dialog-box-text-4" class="dialog-box-text"> </p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -206,43 +206,43 @@ CompanyPositions = {
|
||||
SoftwareIntern: new CompanyPosition("Software Engineering Intern", 1, 0, 0, 0, 0, 0, 0, 1),
|
||||
JuniorDev: new CompanyPosition("Junior Software Engineer", 50, 0, 0, 0, 0, 25, 9000, 5),
|
||||
SeniorDev: new CompanyPosition("Senior Software Engineer", 250, 0, 0, 0, 0, 75, 36000, 12),
|
||||
LeadDev: new CompanyPosition("Lead Software Developer", 400, 0, 0, 0, 0, 150, 72000, 15),
|
||||
LeadDev: new CompanyPosition("Lead Software Developer", 400, 0, 0, 0, 0, 150, 144000, 15),
|
||||
|
||||
//IT
|
||||
ITIntern: new CompanyPosition("IT Intern", 1, 0, 0, 0, 0, 1, 0, .8),
|
||||
ITAnalyst: new CompanyPosition("IT Analyst", 25, 0, 0, 0, 0, 1, 9000, 2),
|
||||
ITManager: new CompanyPosition("IT Manager", 150, 0, 0, 0, 0, 50, 36000, 8),
|
||||
SysAdmin: new CompanyPosition("Systems Administrator", 250, 0, 0, 0, 0, 75, 72000, 13),
|
||||
SysAdmin: new CompanyPosition("Systems Administrator", 250, 0, 0, 0, 0, 75, 144000, 13),
|
||||
SecurityEngineer: new CompanyPosition("Security Engineer", 150, 0, 0, 0, 0, 25, 36000, 10),
|
||||
NetworkEngineer: new CompanyPosition("Network Engineer", 150, 0, 0, 0, 0, 25, 36000, 10),
|
||||
NetworkAdministrator: new CompanyPosition("Network Administrator", 250, 0, 0, 0, 0, 75, 72000, 12),
|
||||
NetworkAdministrator: new CompanyPosition("Network Administrator", 250, 0, 0, 0, 0, 75, 144000, 12),
|
||||
|
||||
//Technology management
|
||||
HeadOfSoftware: new CompanyPosition("Head of Software", 500, 0, 0, 0, 0, 250, 108000, 30),
|
||||
HeadOfEngineering: new CompanyPosition("Head of Engineering", 500, 0, 0, 0, 0, 250, 10800, 30),
|
||||
VicePresident: new CompanyPosition("Vice President of Technology", 600, 0, 0, 0, 0, 400, 144000, 40),
|
||||
CTO: new CompanyPosition("Chief Technology Officer", 750, 0, 0, 0, 0, 500, 216000, 50),
|
||||
HeadOfSoftware: new CompanyPosition("Head of Software", 500, 0, 0, 0, 0, 250, 288000, 30),
|
||||
HeadOfEngineering: new CompanyPosition("Head of Engineering", 500, 0, 0, 0, 0, 250, 576000, 35),
|
||||
VicePresident: new CompanyPosition("Vice President of Technology", 600, 0, 0, 0, 0, 400, 1152000, 40),
|
||||
CTO: new CompanyPosition("Chief Technology Officer", 750, 0, 0, 0, 0, 500, 4608000, 50),
|
||||
|
||||
//Business
|
||||
BusinessIntern: new CompanyPosition("Business Intern", 1, 0, 0, 0, 0, 1, 0, 1),
|
||||
BusinessAnalyst: new CompanyPosition("Business Analyst", 5, 0, 0, 0, 0, 50, 9000, 8),
|
||||
BusinessManager: new CompanyPosition("Business Manager", 50, 0, 0, 0, 0, 100, 36000, 15),
|
||||
OperationsManager: new CompanyPosition("Operations Manager", 50, 0, 0, 0, 0, 200, 72000, 20),
|
||||
CFO: new CompanyPosition("Chief Financial Officer", 75, 0, 0, 0, 0, 500, 108000, 50),
|
||||
CEO: new CompanyPosition("Chief Executive Officer", 100, 0, 0, 0, 0, 750, 216000, 100),
|
||||
OperationsManager: new CompanyPosition("Operations Manager", 50, 0, 0, 0, 0, 200, 144000, 20),
|
||||
CFO: new CompanyPosition("Chief Financial Officer", 75, 0, 0, 0, 0, 500, 576000, 50),
|
||||
CEO: new CompanyPosition("Chief Executive Officer", 100, 0, 0, 0, 0, 750, 4608000, 100),
|
||||
|
||||
//Non-tech/management jobs
|
||||
Waiter: new CompanyPosition("Waiter", 0, 0, 0, 0, 0, 0, 0, .5),
|
||||
Employee: new CompanyPosition("Employee", 0, 0, 0, 0, 0, 0, 0, .5),
|
||||
PoliceOfficer: new CompanyPosition("Police Officer", 10, 100, 100, 100, 100, 9000, 4),
|
||||
PoliceChief: new CompanyPosition("Police Chief", 100, 300, 300, 300, 300, 18000, 10),
|
||||
PoliceChief: new CompanyPosition("Police Chief", 100, 300, 300, 300, 300, 36000, 10),
|
||||
SecurityGuard: new CompanyPosition("Security Guard", 0, 50, 50, 50, 50, 0, 3),
|
||||
SecurityOfficer: new CompanyPosition("Security Officer", 25, 150, 150, 150, 150, 9000, 6),
|
||||
SecuritySupervisor: new CompanyPosition("Security Supervisor", 25, 250, 250, 250, 250, 36000, 12),
|
||||
HeadOfSecurity: new CompanyPosition("Head of Security", 50, 500, 500, 500, 500, 72000, 20),
|
||||
HeadOfSecurity: new CompanyPosition("Head of Security", 50, 500, 500, 500, 500, 144000, 20),
|
||||
FieldAgent: new CompanyPosition("Field Agent", 100, 100, 100, 100, 100, 9000, 4),
|
||||
SecretAgent: new CompanyPosition("Secret Agent", 200, 250, 250, 250, 250, 36000, 10),
|
||||
SpecialOperative: new CompanyPosition("Special Operative", 250, 500, 500, 500, 500, 108000, 20),
|
||||
SpecialOperative: new CompanyPosition("Special Operative", 250, 500, 500, 500, 500, 144000, 20),
|
||||
|
||||
init: function() {
|
||||
//Argument order: hack, str, def, dex, agi, cha
|
||||
|
@ -78,10 +78,10 @@ PlayerObject.prototype.applyForJob = function(entryPosType) {
|
||||
this.companyPosition = pos;
|
||||
|
||||
if (leaveCompany) {
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at ", this.companyName, " as a " + pos.positionName + "!",
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.positionName + "!",
|
||||
"You lost 1000 reputatation at your old company " + oldCompanyName + " because you left.");
|
||||
} else {
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at ", this.companyName, " as a " + pos.positionName + "!");
|
||||
dialogBoxCreate("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.positionName + "!");
|
||||
}
|
||||
|
||||
Engine.loadLocationContent();
|
||||
|
@ -1,4 +1,6 @@
|
||||
CONSTANTS = {
|
||||
Version: "0.1",
|
||||
|
||||
//Max level for any skill. Determined by max numerical value in javascript and the skill level
|
||||
//formula in Player.js
|
||||
MaxSkillLevel: 975,
|
||||
@ -41,6 +43,16 @@ CONSTANTS = {
|
||||
FactionWorkField: "Faction Field Work",
|
||||
FactionWorkSecurity: "Faction Security Work",
|
||||
|
||||
WorkTypeCompany: "Working for Company",
|
||||
WorkTypeFaction: "Working for Faction",
|
||||
WorkTypeCreateProgram: "Working on Create a Program",
|
||||
WorkTypeStudyClass: "Studying or Taking a class at university",
|
||||
|
||||
ClassStudyComputerScience: "studying Computer Science",
|
||||
ClassDataStructures: "taking a Data Structures course",
|
||||
ClassNetworks: "taking a Networks course",
|
||||
ClassAlgorithms: "taking an Algorithms course",
|
||||
|
||||
//Text that is displayed when the 'help' command is ran in Terminal
|
||||
HelpText: "analyze Get statistics and information about current machine <br>" +
|
||||
"clear Clear all text on the terminal <br>" +
|
||||
|
184
src/Location.js
184
src/Location.js
@ -13,6 +13,7 @@ Locations = {
|
||||
|
||||
//Aevum Locations
|
||||
AevumTravelAgency: "Aevum Travel Agency",
|
||||
AevumSummitUniversity: "Summit University",
|
||||
AevumECorp: "ECorp",
|
||||
AevumBachmanAndAssociates: "Bachman & Associates",
|
||||
AevumClarkeIncorporated: "Clarke Incorporated",
|
||||
@ -33,6 +34,7 @@ Locations = {
|
||||
|
||||
//Sector 12
|
||||
Sector12TravelAgency: "Sector-12 Travel Agency",
|
||||
Sector12RothmanUniversity: "Rothman University",
|
||||
Sector12MegaCorp: "MegaCorp",
|
||||
Sector12BladeIndustries: "Blade Industries",
|
||||
Sector12FourSigma: "Four Sigma",
|
||||
@ -62,15 +64,16 @@ Locations = {
|
||||
IshimaOmegaSoftware: "Omega Software",
|
||||
|
||||
//Volhaven
|
||||
VolhavenTravelAgency: "Volhaven Travel Agency",
|
||||
VolhavenOmniTekIncorporated: "OmniTek Incorporated",
|
||||
VolhavenNWO: "NWO",
|
||||
VolhavenHeliosLabs: "Helios Labs",
|
||||
VolhavenOmniaCybersystems: "Omnia Cybersystems",
|
||||
VolhavenLexoCorp: "LexoCorp",
|
||||
VolhavenSysCoreSecurities: "SysCore Securities",
|
||||
VolhavenCompuTek: "CompuTek",
|
||||
VolhavenMilleniumFitnessGym: "Millenium Fitness Gym",
|
||||
VolhavenTravelAgency: "Volhaven Travel Agency",
|
||||
VolhavenZBInstituteOfTechnology: "ZB Institute of Technology",
|
||||
VolhavenOmniTekIncorporated: "OmniTek Incorporated",
|
||||
VolhavenNWO: "NWO",
|
||||
VolhavenHeliosLabs: "Helios Labs",
|
||||
VolhavenOmniaCybersystems: "Omnia Cybersystems",
|
||||
VolhavenLexoCorp: "LexoCorp",
|
||||
VolhavenSysCoreSecurities: "SysCore Securities",
|
||||
VolhavenCompuTek: "CompuTek",
|
||||
VolhavenMilleniumFitnessGym: "Millenium Fitness Gym",
|
||||
}
|
||||
|
||||
displayLocationContent = function() {
|
||||
@ -103,6 +106,11 @@ displayLocationContent = function() {
|
||||
var gymTrainDef = document.getElementById("location-gym-train-def");
|
||||
var gymTrainDex = document.getElementById("location-gym-train-dex");
|
||||
var gymTrainAgi = document.getElementById("location-gym-train-agi");
|
||||
|
||||
var studyComputerScience= document.getElementById("location-study-computer-science");
|
||||
var classDataStructures = document.getElementById("location-data-structures-class");
|
||||
var classNetworks = document.getElementById("location-networks-class");
|
||||
var classAlgorithms = document.getElementById("location-algorithms-class");
|
||||
|
||||
var purchase1gb = document.getElementById("location-purchase-1gb");
|
||||
var purchase2gb = document.getElementById("location-purchase-2gb");
|
||||
@ -163,6 +171,11 @@ displayLocationContent = function() {
|
||||
gymTrainDex.style.display = "none";
|
||||
gymTrainAgi.style.display = "none";
|
||||
|
||||
studyComputerScience.style.display = "none";
|
||||
classDataStructures.style.display = "none";
|
||||
classNetworks.style.display = "none";
|
||||
classAlgorithms.style.display = "none";
|
||||
|
||||
purchase1gb.style.display = "none";
|
||||
purchase2gb.style.display = "none";
|
||||
purchase4gb.style.display = "none";
|
||||
@ -233,6 +246,41 @@ displayLocationContent = function() {
|
||||
travelToVolhaven.style.display = "block";
|
||||
break;
|
||||
|
||||
case Locations.AevumSummitUniveristy:
|
||||
var costMult = 2;
|
||||
var expMult = 1;
|
||||
displayUniversityLocationContent(costMult);
|
||||
|
||||
var newStudyCS = studyComputerScience.cloneNode(true);
|
||||
studyComputerScience.parentNode.replaceChild(newStudyCS, studyComputerScience)
|
||||
newStudyCS.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassStudyComputerScience);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassDataStructures = classDataStructures.cloneNode(true);
|
||||
classDataStructures.parentNode.replaceChild(newClassDataStructures, classDataStructures);
|
||||
newClassDataStructures.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassDataStructures);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassNetworks = classNetworks.cloneNode(true);
|
||||
classNetworks.parentNode.replaceChild(newClassNetworks, classNetworks);
|
||||
newClassNetworks.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassNetworks);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassAlgorithms = classAlgorithms.cloneNode(true);
|
||||
classAlgorithms.parentNode.replaceChild(newClassAlgorithms, classAlgorithms);
|
||||
newClassAlgorithms.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassAlgorithms);
|
||||
return false;
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
case Locations.AevumECorp:
|
||||
locationInfo.innerHTML = Companies[loc].info;
|
||||
|
||||
@ -403,6 +451,40 @@ displayLocationContent = function() {
|
||||
travelToIshima.style.display = "block";
|
||||
travelToVolhaven.style.display = "block";
|
||||
break;
|
||||
|
||||
case Locations.Sector12RothmanUniversity:
|
||||
var costMult = 1;
|
||||
var expMult = 0.5;
|
||||
displayUniversityLocationContent(costMult);
|
||||
|
||||
var newStudyCS = studyComputerScience.cloneNode(true);
|
||||
studyComputerScience.parentNode.replaceChild(newStudyCS, studyComputerScience)
|
||||
newStudyCS.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassStudyComputerScience);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassDataStructures = classDataStructures.cloneNode(true);
|
||||
classDataStructures.parentNode.replaceChild(newClassDataStructures, classDataStructures);
|
||||
newClassDataStructures.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassDataStructures);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassNetworks = classNetworks.cloneNode(true);
|
||||
classNetworks.parentNode.replaceChild(newClassNetworks, classNetworks);
|
||||
newClassNetworks.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassNetworks);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassAlgorithms = classAlgorithms.cloneNode(true);
|
||||
classAlgorithms.parentNode.replaceChild(newClassAlgorithms, classAlgorithms);
|
||||
newClassAlgorithms.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassAlgorithms);
|
||||
return false;
|
||||
});
|
||||
break;
|
||||
|
||||
case Locations.Sector12MegaCorp:
|
||||
locationInfo.innerHTML = Companies[loc].info;
|
||||
@ -637,7 +719,7 @@ displayLocationContent = function() {
|
||||
purchaseTor.style.display = "block";
|
||||
break;
|
||||
|
||||
case Locations.VolhavenTravelAgency:
|
||||
case Locations.VolhavenTravelAgency:
|
||||
travelAgencyText.style.display = "block";
|
||||
travelToAevum.style.display = "block";
|
||||
travelToChongqing.style.display = "block";
|
||||
@ -645,6 +727,40 @@ displayLocationContent = function() {
|
||||
travelToNewTokyo.style.display = "block";
|
||||
travelToIshima.style.display = "block";
|
||||
break;
|
||||
|
||||
case Locations.VolhavenZBInstituteOfTechnology:
|
||||
var costMult = 3;
|
||||
var expMult = 2;
|
||||
displayUniversityLocationContent(costMult);
|
||||
|
||||
var newStudyCS = studyComputerScience.cloneNode(true);
|
||||
studyComputerScience.parentNode.replaceChild(newStudyCS, studyComputerScience)
|
||||
newStudyCS.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassStudyComputerScience);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassDataStructures = classDataStructures.cloneNode(true);
|
||||
classDataStructures.parentNode.replaceChild(newClassDataStructures, classDataStructures);
|
||||
newClassDataStructures.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassDataStructures);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassNetworks = classNetworks.cloneNode(true);
|
||||
classNetworks.parentNode.replaceChild(newClassNetworks, classNetworks);
|
||||
newClassNetworks.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassNetworks);
|
||||
return false;
|
||||
});
|
||||
|
||||
var newClassAlgorithms = classAlgorithms.cloneNode(true);
|
||||
classAlgorithms.parentNode.replaceChild(newClassAlgorithms, classAlgorithms);
|
||||
newClassAlgorithms.addEventListener("click", function() {
|
||||
Player.startClass(costMult, expMult, CONSTANTS.ClassAlgorithms);
|
||||
return false;
|
||||
});
|
||||
break;
|
||||
|
||||
case Locations.VolhavenOmniTekIncorporated:
|
||||
locationInfo.innerHTML = Companies[loc].info;
|
||||
@ -765,6 +881,13 @@ initLocationButtons = function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
aevumSummitUniversity = document.getElementById("aevum-summituniversity");
|
||||
aevumSummitUniversity.addEventListener("click", function() {
|
||||
Player.location = Locations.AevumSummitUniversity;
|
||||
Engine.loadLocationContent();
|
||||
return false;
|
||||
});
|
||||
|
||||
aevumECorp = document.getElementById("aevum-ecorp");
|
||||
aevumECorp.addEventListener("click", function() {
|
||||
Player.location = Locations.AevumECorp;
|
||||
@ -877,6 +1000,13 @@ initLocationButtons = function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
sector12RothmanUniversity = document.getElementById("sector12-rothmanuniversity");
|
||||
sector12RothmanUniversity.addEventListener("click", function() {
|
||||
Player.location = Locations.Sector12RothmanUniversity;
|
||||
Engine.loadLocationContent();
|
||||
return false;
|
||||
});
|
||||
|
||||
sector12MegaCorp = document.getElementById("sector12-megacorp");
|
||||
sector12MegaCorp.addEventListener("click", function() {
|
||||
Player.location = Locations.Sector12MegaCorp;
|
||||
@ -1044,6 +1174,13 @@ initLocationButtons = function() {
|
||||
Engine.loadLocationContent();
|
||||
return false;
|
||||
});
|
||||
|
||||
volhavenZBInstituteOfTechnology = document.getElementById("volhaven-zbinstituteoftechnology");
|
||||
volhavenZBInstituteOfTechnology.addEventListener("click", function() {
|
||||
Player.location = Locations.VolhavenZBInstituteOfTechnology;
|
||||
Engine.loadLocationContent();
|
||||
return false;
|
||||
});
|
||||
|
||||
volhavenOmniTekIncorporated = document.getElementById("volhaven-omnitekincorporated");
|
||||
volhavenOmniTekIncorporated.addEventListener("click", function() {
|
||||
@ -1302,4 +1439,31 @@ purchaseTorRouter = function() {
|
||||
|
||||
Player.getHomeComputer().serversOnNetwork.push(darkweb.ip);
|
||||
dialogBoxCreate("You have purchased a Tor router!", "You now have access to the dark web from your home computer", "Use the scan/netstat commands to search for the dark web connect.", "");
|
||||
}
|
||||
|
||||
displayUniversityLocationContent = function(costMult) {
|
||||
var studyComputerScienceButton = document.getElementById("location-study-computer-science");
|
||||
var classDataStructuresButton = document.getElementById("location-data-structures-class");
|
||||
var classNetworksButton = document.getElementById("location-networks-class");
|
||||
var classAlgorithmsButton = document.getElementById("location-algorithms-class");
|
||||
studyComputerScienceButton.style.display = "block";
|
||||
classDataStructuresButton.style.display = "block";
|
||||
classNetworksButton.style.display = "block";
|
||||
classAlgorithmsButton.style.display = "block";
|
||||
|
||||
var gameCPS = 1 / Engine._idleSpeed;
|
||||
|
||||
//Costs (per second)
|
||||
var baseDataStructuresCost = 1;
|
||||
var baseNetworksCost = 5;
|
||||
var baseAlgorithmsCost = 20;
|
||||
|
||||
var dataStructuresCost = baseDataStructuresCost * costMult;
|
||||
var networksCost = baseNetworksCost * costMult;
|
||||
var algorithmsCost = baseAlgorithmsCost * costMult;
|
||||
|
||||
//Update button text to show cost
|
||||
classDataStructuresButton.innerHTML = "Take Data Structures Class ($" + dataStructuresCost + " / sec)";
|
||||
classNetworksButton.innerHTML = "Take Networks Class ($" + networksCost + " / second)";
|
||||
classAlgorithmsButton.innerHTML = "Take Algorithms Class ($" + algorithmsCost + " / second)";
|
||||
}
|
164
src/Player.js
164
src/Player.js
@ -99,8 +99,10 @@ function PlayerObject() {
|
||||
this.startAction = false;
|
||||
this.actionTime = 0;
|
||||
|
||||
//Flags/variables for working (Company, Faction, and Creating Programin)
|
||||
//Flags/variables for working (Company, Faction, Creating Program, Taking Class)
|
||||
this.isWorking = false;
|
||||
this.workType = "";
|
||||
|
||||
this.currentWorkFactionName = "";
|
||||
this.currentWorkFactionDescription = "";
|
||||
|
||||
@ -112,6 +114,7 @@ function PlayerObject() {
|
||||
this.workChaExpGainRate = 0;
|
||||
this.workRepGainRate = 0;
|
||||
this.workMoneyGainRate = 0;
|
||||
this.workMoneyLossRate = 0;
|
||||
|
||||
this.workHackExpGained = 0;
|
||||
this.workStrExpGained = 0;
|
||||
@ -124,6 +127,8 @@ function PlayerObject() {
|
||||
|
||||
this.createProgramName = "";
|
||||
|
||||
this.className = "";
|
||||
|
||||
this.timeWorked = 0; //in ms
|
||||
this.timeNeededToCompleteWork = 0;
|
||||
|
||||
@ -243,6 +248,13 @@ PlayerObject.prototype.gainMoney = function(money) {
|
||||
this.lifetime_money += money;
|
||||
}
|
||||
|
||||
PlayerObject.prototype.loseMoney = function(money) {
|
||||
if (isNaN(money)) {
|
||||
console.log("ERR: NaN passed into Player.loseMoney()"); return;
|
||||
}
|
||||
this.money -= money;
|
||||
}
|
||||
|
||||
PlayerObject.prototype.gainHackingExp = function(exp) {
|
||||
if (isNaN(exp)) {
|
||||
console.log("ERR: NaN passed into Player.gainHackingExp()"); return;
|
||||
@ -346,6 +358,7 @@ PlayerObject.prototype.finishWork = function(cancelled) {
|
||||
|
||||
PlayerObject.prototype.startWork = function() {
|
||||
this.isWorking = true;
|
||||
this.workType = CONSTANTS.WorkTypeCompany;
|
||||
this.currentWorkFactionName = "";
|
||||
this.currentWorkFactionDescription = "";
|
||||
this.createProgramName = "";
|
||||
@ -474,6 +487,7 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, faction) {
|
||||
|
||||
PlayerObject.prototype.startFactionWork = function(faction) {
|
||||
this.isWorking = true;
|
||||
this.workType = CONSTANTS.WorkTypeFaction;
|
||||
this.currentWorkFactionName = faction.name;
|
||||
this.createProgramName = "";
|
||||
|
||||
@ -688,6 +702,7 @@ PlayerObject.prototype.getFactionFieldWorkRepGain = function() {
|
||||
/* Creating a Program */
|
||||
PlayerObject.prototype.startCreateProgramWork = function(programName, time) {
|
||||
this.isWorking = true;
|
||||
this.workType = CONSTANTS.WorkTypeCreateProgram;
|
||||
|
||||
this.timeWorked = 0;
|
||||
this.timeNeededToCompleteWork = time;
|
||||
@ -742,7 +757,152 @@ PlayerObject.prototype.finishCreateProgramWork = function(cancelled, programName
|
||||
Engine.loadTerminalContent();
|
||||
}
|
||||
|
||||
//Functions for saving and loading the Player data
|
||||
/* Studying/Taking Classes */
|
||||
PlayerObject.prototype.startClass = function(costMult, expMult, className) {
|
||||
this.isWorking = true;
|
||||
this.workType = CONSTANTS.WorkTypeStudyClass;
|
||||
this.timeWorked = 0;
|
||||
|
||||
this.className = className;
|
||||
|
||||
this.workStrExpGainRate = 0;
|
||||
this.workDefExpGainRate = 0;
|
||||
this.workDexExpGainRate = 0;
|
||||
this.workAgiExpGainRate = 0;
|
||||
this.workChaExpGainRate = 0;
|
||||
this.workRepGainRate = 0;
|
||||
this.workMoneyGainRate = 0;
|
||||
|
||||
this.workHackExpGained = 0;
|
||||
this.workStrExpGained = 0;
|
||||
this.workDefExpGained = 0;
|
||||
this.workDexExpGained = 0;
|
||||
this.workAgiExpGained = 0;
|
||||
this.workChaExpGained = 0;
|
||||
this.workRepGained = 0;
|
||||
this.workMoneyGained = 0;
|
||||
|
||||
var gameCPS = 1000 / Engine._idleSpeed;
|
||||
//Base costs/exp (per second)
|
||||
var baseDataStructuresCost = 1;
|
||||
var baseNetworksCost = 5;
|
||||
var baseAlgorithmsCost = 20;
|
||||
|
||||
var baseStudyComputerScienceExp = 0.02;
|
||||
var baseDataStructuresExp = 0.1;
|
||||
var baseNetworksExp = 0.5;
|
||||
var baseAlgorithmsExp = 2.0;
|
||||
|
||||
//Find cost and exp gain per game cycle
|
||||
var cost = 0;
|
||||
var hackExp = 0;
|
||||
switch (className) {
|
||||
case CONSTANTS.ClassStudyComputerScience:
|
||||
hackExp = baseStudyComputerScienceExp * expMult / gameCPS;
|
||||
break;
|
||||
case CONSTANTS.ClassDataStructures:
|
||||
cost = baseDataStructuresCost * costMult / gameCPS;
|
||||
hackExp = baseDataStructuresExp * expMult / gameCPS;
|
||||
break;
|
||||
case CONSTANTS.ClassNetworks:
|
||||
cost = baseNetworksCost * costMult / gameCPS;
|
||||
hackExp = baseNetworksExp * expMult / gameCPS;
|
||||
break;
|
||||
case CONSTANTS.ClassAlgorithms:
|
||||
cost = baseAlgorithmsCost * costMult / gameCPS;
|
||||
hackExp = baseAlgorithmsExp * expMult / gameCPS;
|
||||
break;
|
||||
default:
|
||||
throw new Error("ERR: Invalid/unregocnized class name");
|
||||
return;
|
||||
}
|
||||
|
||||
this.workMoneyLossRate = cost;
|
||||
this.workHackExpGainRate = hackExp;
|
||||
|
||||
var cancelButton = document.getElementById("work-in-progress-cancel-button");
|
||||
|
||||
//Remove all old event listeners from Cancel button
|
||||
var newCancelButton = cancelButton.cloneNode(true);
|
||||
cancelButton.parentNode.replaceChild(newCancelButton, cancelButton);
|
||||
|
||||
newCancelButton.addEventListener("click", function() {
|
||||
Player.finishClass();
|
||||
return false;
|
||||
});
|
||||
|
||||
//Display Work In Progress Screen
|
||||
Engine.loadWorkInProgressContent();
|
||||
}
|
||||
|
||||
PlayerObject.prototype.takeClass = function(numCycles) {
|
||||
this.timeWorked += Engine._idleSpeed * numCycles;
|
||||
var className = this.className;
|
||||
|
||||
this.workHackExpGained += this.workHackExpGainRate * numCycles;
|
||||
this.workStrExpGained += this.workStrExpGainRate * numCycles;
|
||||
this.workDefExpGained += this.workDefExpGainRate * numCycles;
|
||||
this.workDexExpGained += this.workDexExpGainRate * numCycles;
|
||||
this.workAgiExpGained += this.workAgiExpGainRate * numCycles;
|
||||
this.workChaExpGained += this.workChaExpGainRate * numCycles;
|
||||
this.workRepGained += this.workRepGainRate * numCycles;
|
||||
this.workMoneyGained += this.workMoneyGainRate * numCycles;
|
||||
this.workMoneyGained -= this.workMoneyLossRate * numCycles;
|
||||
|
||||
var cyclesPerSec = 1000 / Engine._idleSpeed;
|
||||
|
||||
//TODO Account for running out of money when numCycles is very big
|
||||
|
||||
var txt = document.getElementById("work-in-progress-text");
|
||||
txt.innerHTML = "You have been " + className + " for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ".<br><br>" +
|
||||
"This has cost you: <br>" +
|
||||
"$" + this.workMoneyGained.toFixed(2) + " ($" + (this.workMoneyLossRate * cyclesPerSec).toFixed(2) + " / sec) <br><br>" +
|
||||
"You have gained: <br>" +
|
||||
this.workHackExpGained.toFixed(3) + " (" + (this.workHackExpGainRate * cyclesPerSec).toFixed(3) + " / sec) hacking exp <br>" +
|
||||
this.workStrExpGained.toFixed(3) + " (" + (this.workStrExpGainRate * cyclesPerSec).toFixed(3) + " / sec) strength exp <br>" +
|
||||
this.workDefExpGained.toFixed(3) + " (" + (this.workDefExpGainRate * cyclesPerSec).toFixed(3) + " / sec) defense exp <br>" +
|
||||
this.workDexExpGained.toFixed(3) + " (" + (this.workDexExpGainRate * cyclesPerSec).toFixed(3) + " / sec) dexterity exp <br>" +
|
||||
this.workAgiExpGained.toFixed(3) + " (" + (this.workAgiExpGainRate * cyclesPerSec).toFixed(3) + " / sec) agility exp <br>" +
|
||||
this.workChaExpGained.toFixed(3) + " (" + (this.workChaExpGainRate * cyclesPerSec).toFixed(3) + " / sec) charisma exp <br>" +
|
||||
"You may cancel at any time";
|
||||
|
||||
}
|
||||
|
||||
PlayerObject.prototype.finishClass = function() {
|
||||
this.gainHackingExp(this.workHackExpGained);
|
||||
this.gainStrengthExp(this.workStrExpGained);
|
||||
this.gainDefenseExp(this.workDefExpGained);
|
||||
this.gainDexterityExp(this.workDexExpGained);
|
||||
this.gainAgilityExp(this.workAgiExpGained);
|
||||
this.gainCharismaExp(this.workChaExpGained);
|
||||
|
||||
if (this.workMoneyGained > 0) {
|
||||
throw new Error("ERR: Somehow gained money while taking class");
|
||||
}
|
||||
this.loseMoney(this.workMoneyGained * -1);
|
||||
|
||||
this.updateSkillLevels();
|
||||
var txt = "After " + this.className + " for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ", <br>" +
|
||||
"you spent a total of " + this.workMoneyGained * -1 + ". <br><br>" +
|
||||
"You earned a total of: <br>" +
|
||||
(this.workHackExpGained).toFixed(3) + " hacking exp <br>" +
|
||||
(this.workStrExpGained).toFixed(3) + " strength exp <br>" +
|
||||
(this.workDefExpGained).toFixed(3) + " defense exp <br>" +
|
||||
(this.workDexExpGained).toFixed(3) + " dexterity exp <br>" +
|
||||
(this.workAgiExpGained).toFixed(3) + " agility exp <br>" +
|
||||
(this.workChaExpGained).toFixed(3) + " charisma exp<br>";
|
||||
|
||||
dialogBoxCreate(txt);
|
||||
|
||||
var mainMenu = document.getElementById("mainmenu-container");
|
||||
mainMenu.style.visibility = "visible";
|
||||
|
||||
this.isWorking = false;
|
||||
|
||||
Engine.loadTerminalContent();
|
||||
}
|
||||
|
||||
/* Functions for saving and loading the Player data */
|
||||
PlayerObject.prototype.toJSON = function() {
|
||||
return Generic_toJSON("PlayerObject", this);
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ function updateTerminalScroll() {
|
||||
}
|
||||
|
||||
var postNetburnerText = function() {
|
||||
post("Netburner v0.1");
|
||||
post("Bitburner v" + CONSTANTS.Version);
|
||||
}
|
||||
|
||||
//Defines key commands in terminal
|
||||
|
@ -561,11 +561,14 @@ var Engine = {
|
||||
Player.startAction = false;
|
||||
}
|
||||
|
||||
//Working
|
||||
if (Player.isWorking) {
|
||||
if (Player.currentWorkFactionName != "") {
|
||||
if (Player.workType == CONSTANTS.WorkTypeFaction) {
|
||||
Player.workForFaction(numCycles);
|
||||
} else if (Player.createProgramName != "") {
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {
|
||||
Player.createProgramWork(numCycles);
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
|
||||
Player.takeClass(numCycles);
|
||||
} else {
|
||||
Player.work(numCycles);
|
||||
}
|
||||
@ -868,10 +871,12 @@ var Engine = {
|
||||
processServerGrowth(numCyclesOffline); //Should be done before offline production for scripts
|
||||
loadAllRunningScripts(); //This also takes care of offline production for those scripts
|
||||
if (Player.isWorking) {
|
||||
if (Player.currentWorkFactionName != "") {
|
||||
if (Player.workType == CONSTANTS.WorkTypeFaction) {
|
||||
Player.workForFaction(numCyclesOffline);
|
||||
} else if (Player.createProgramName != "") {
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {
|
||||
Player.createProgramWork(numCyclesOffline);
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
|
||||
Player.takeClass(numCyclesOffline);
|
||||
} else {
|
||||
Player.work(numCyclesOffline);
|
||||
}
|
||||
@ -895,11 +900,13 @@ var Engine = {
|
||||
if (Player.isWorking) {
|
||||
var cancelButton = document.getElementById("work-in-progress-cancel-button");
|
||||
cancelButton.addEventListener("click", function() {
|
||||
if (Player.currentWorkFactionName != "") {
|
||||
if (Player.workType == CONSTANTS.WorkTypeFaction) {
|
||||
var fac = Factions[Player.currentWorkFactionName];
|
||||
Player.finishFactionWork(true, fac);
|
||||
} else if (Player.createProgramName != "") {
|
||||
} else if (Player.WorkType == CONSTANTS.WorkTypeCreateProgram) {
|
||||
Player.finishCreateProgramWork(true, Player.createProgramName);
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
|
||||
Player.finishClass();
|
||||
} else {
|
||||
Player.finishWork(true);
|
||||
}
|
||||
|
Reference in New Issue
Block a user