Added Locations. Need to add buttons to make everything connect together properly, and also getting/working for josb

This commit is contained in:
Daniel Xie 2017-01-30 21:41:42 -06:00
parent bf893926b7
commit 007d4436c9
9 changed files with 707 additions and 532 deletions

@ -100,6 +100,21 @@
width: 99%;
}
/* Purchase servers */
#purchase-servers-container {
position: fixed;
padding-top: 10px;
padding-left: 10px;
height: 100%;
margin-left: 10%;
width: 99%;
}
#purchase-servers-input, #purchase-servers-gb-text {
display:inline-block;
color: #66ff33;
}
/* Create program */
#create-program-container {
position: fixed;
@ -118,6 +133,7 @@
height: 100%;
margin-left: 10%;
width: 99%;
color: #66ff33;
}
#faction-container {
@ -141,6 +157,12 @@
display:inline-block;
}
/* World */
#world-container li {
margin: 0 0 15px 0;
list-style-type: none;
}
/* Augmentations */
#augmentations-container {

@ -13,7 +13,11 @@ p {
color: #66ff33;
}
h1 {
}
/* Main menu */
.mainmenu {
list-style-type: none;
margin: 0;
@ -51,6 +55,14 @@ p {
color: white;
}
h1 {
padding: 8px;
/* Make html links ("a" elements) nice looking buttons with this class */
.a-link-button {
text-decoration: none;
background-color: #555;
color: #FFFFFF;
padding: 4px 4px 4px 4px;
border-top: 1px solid #333333;
border-right: 1px solid #333333;
border-bottom: 1px solid #333333;
border-left: 1px solid #333333;
}

@ -27,6 +27,7 @@
<!-- Main game files -->
<script src="src/Constants.js"></script>
<script src="src/Location.js"></script>
<script src="src/Script.js"></script>
<script src="src/Server.js"></script>
<script src="src/Player.js"></script>
@ -125,43 +126,43 @@
<div id="world-container" class="world-container">
<ul id="aevum-locations-list">
<li id="aevum-travelagency-li">
<a href="#" id="aevum-travelagency"> Travel Agency </a>
<a href="#" id="aevum-travelagency" class="a-link-button"> Travel Agency </a>
</li>
<li id="aevum-ecorp-li">
<a href="#" id="aevum-ecorp"> ECorp </a>
<a href="#" id="aevum-ecorp" class="a-link-button"> ECorp </a>
</li>
<li id="aevum-bachmanandassociates-li">
<a href="#" id="aevum-bachmanandassociates"> Bachman & Associates</a>
<a href="#" id="aevum-bachmanandassociates" class="a-link-button"> Bachman & Associates</a>
</li>
<li id="aevum-clarkeincorporated-li">
<a href="#" id="aevum-clarkeincorporated"> Clarke Incorporated </a>
<a href="#" id="aevum-clarkeincorporated" class="a-link-button"> Clarke Incorporated </a>
</li>
<li id="aevum-fulcrumtechnologies-li">
<a href="#" id="aevum-fulcrumtechnologies"> Fulcrum Technologies </a>
<a href="#" id="aevum-fulcrumtechnologies" class="a-link-button"> Fulcrum Technologies </a>
</li>
<li id="aevum-aerocorp-li">
<a href="#" id="aevum-aerocorp"> AeroCorp </a>
<a href="#" id="aevum-aerocorp" class="a-link-button"> AeroCorp </a>
</li>
<li id="aevum-galacticcybersystems-li">
<a href="#" id="aevum-galacticcybersystems"> Galactic Cybersystems </a>
<a href="#" id="aevum-galacticcybersystems" class="a-link-button"> Galactic Cybersystems </a>
</li>
<li id="aevum-watchdogsecurity-li">
<a href="#" id="aevum-watchdogsecurity">Watchdog Security </a>
<a href="#" id="aevum-watchdogsecurity" class="a-link-button">Watchdog Security </a>
</li>
<li id="aevum-rhoconstruction-li">
<a href="#" id="aevum-rhoconstruction">Rho Construction </a>
<a href="#" id="aevum-rhoconstruction" class="a-link-button">Rho Construction </a>
</li>
<li id="aevum-aevumpolice-li">
<a href="#" id="aevum-aevumpolice">Aevum Police</a>
<a href="#" id="aevum-aevumpolice" class="a-link-button">Aevum Police</a>
</li>
<li id="aevum-netlinktechnologies-li">
<a href="#" id="aevum-netlinktechnologies">NetLink Technologies</a>
<a href="#" id="aevum-netlinktechnologies" class="a-link-button">NetLink Technologies</a>
</li>
<li id="aevum-crushfitnessgym-li">
<a href="#" id="aevum-crushfitnessgym">Crush Fitness Gym </a>
<a href="#" id="aevum-crushfitnessgym" class="a-link-button">Crush Fitness Gym </a>
</li>
<li id="aevum-snapfitnessgym-li">
<a href="#" id="aevum-snapfitnessgym">Snap Fitness Gym</a>
<a href="#" id="aevum-snapfitnessgym" class="a-link-button">Snap Fitness Gym</a>
</li>
</ul>
@ -341,7 +342,54 @@
<!-- Tutorial content -->
<div id="tutorial-container">
</div>-
</div>
<!-- Location (visiting a location in World) -->
<div id="location-container">
<h1 id="location-name"></h1>
<p id="location-info"> </p>
<p id="location-job-title> </p>
<!-- Jobs/Work at a company -->
<a href="#" id="location-software-job" class="a-link-button"> Apply for Software Job</a>
<a href="#" id="location-it-job" class="a-link-button"> Apply for IT Job </a>
<a href="#" id="location-security-engineer-job" class="a-link-button"> Apply for Security Engineer Job</a>
<a href="#" id="location-network-engineer-job" class="a-link-button"> Apply for Network Engineer Job</a>
<a href="#" id="location-business-job" class="a-link-button"> Apply for Business Job</a>
<a href="#" id="location-security-job" class="a-link-button"> Apply for Security Job</a>
<a href="#" id="location-agent-job" class="a-link-button"> Apply to be an Agent</a>
<a href="#" id="location-employee-job" class="a-link-button"> Apply to be an Employee </a>
<a href="#" id="location-waiter-job" class="a-link-button"> Apply to be a Waiter</a>
<a href="#" id="location-work" class="a-link-button"> Work </a>
<!-- Gym -->
<a href="#" id="location-gym-train-str" class="a-link-button"> Train Strength</a>
<a href="#" id="location-gym-train-def" class="a-link-button"> Train Defense </a>
<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>
<!-- Purchase servers -->
<a href="#" id="location-purchase-1gb" class="a-link-button"> Purchase 1GB Server</a>
<a href="#" id="location-purchase-2gb" class="a-link-button"> Purchase 2GB Server</a>
<a href="#" id="location-purchase-4gb" class="a-link-button"> Purchase 4GB Server</a>
<a href="#" id="location-purchase-8gb" class="a-link-button"> Purchase 8GB Server</a>
<a href="#" id="location-purchase-16gb" class="a-link-button"> Purchase 16GB Server</a>
<a href="#" id="location-purchase-32gb" class="a-link-button"> Purchase 32GB Server</a>
<a href="#" id="location-purchase-64gb" class="a-link-button"> Purchase 64GB Server</a>
<a href="#" id="location-purchase-128gb" class="a-link-button"> Purchase 128GB Server</a>
<a href="#" id="location-purchase-256gb" class="a-link-button"> Purchase 256GB Server</a>
<a href="#" id="location-purchase-512gb" class="a-link-button"> Purchase 512GB Server</a>
<a href="#" id="location-purchase-1tb" class="a-link-button"> Purchase 1TB Server</a>
<!-- Travel agency -->
<a href="#" id="location-travel-to-aevum" class="a-link-button"> Travel to Aevum </a>
<a href="#" id="location-travel-to-chongqing" class="a-link-button"> Travel to Chongqing</a>
<a href="#" id="location-travel-to-sector12" class="a-link-button"> Travel to Sector-12</a>
<a href="#" id="location-travel-to-newtokyo" class="a-link-button"> Travel to New Tokyo</a>
<a href="#" id="location-travel-to-ishima" class="a-link-button"> Travel to Ishima</a>
<a href="#" id="location-travel-to-volhaven" class="a-link-button"> Travel to Volhaven</a>
</div>
</body>
</html>

@ -3,6 +3,7 @@
// to be saved/loaded from localStorage
function Company() {
this.companyName = "";
this.info = "";
this.companyPositions = []; //Names (only name, not object) of all company positions
this.salaryMultiplier = 1; //Multiplier for base salary
this.expMultiplier = 1; //Multiplier for base exp gain
@ -20,6 +21,10 @@ Company.prototype.init = function(name, salaryMult, expMult) {
this.expMultiplier = expMult;
}
Company.prototype.setInfo = function(inf) {
this.info = inf;
}
Company.prototype.addPosition = function(pos) {
this.companyPositions.push(pos.positionName); //Company object holds only name of positions
}
@ -30,6 +35,15 @@ Company.prototype.addPositions = function(positions) {
}
}
Company.prototype.hasPosition = function(pos) {
for (var i = 0; i < this.companyPositions.length; ++i) {
if (pos.name == this.companyPositions[i]) {
return true;
}
}
return false;
}
Company.prototype.toJSON = function() {
return Generic_toJSON("Company", this);
}
@ -99,6 +113,76 @@ CompanyPosition.prototype.calculateJobPerformance = function(hacking, str, def,
return (hackRatio + strRatio + defRatio + dexRatio + agiRatio + chaRatio) / 100;
}
CompanyPosition.prototype.isSoftwareJob = function() {
if (this.positionName == "Software Engineering Intern" ||
this.positionName == "Junior Software Engineer" ||
this.positionName == "Senior Software Engineer" ||
this.positionName == "Lead Software Developer" ||
this.positionName == "Head of Software" ||
this.positionName == "Head of Engineering" ||
this.positionName == "Vice President of Technology" ||
this.positionName == "Chief Technology Officer") {
return true;
}
return false;
}
CompanyPosition.prototype.isITJob = function() {
if (this.positionName == "IT Intern" ||
this.positionName == "IT Analyst" ||
this.positionName == "IT Manager" ||
this.positionName == "Systems Administrator") {
return true;
}
return false;
}
CompanyPosition.prototype.isSecurityEngineerJob = function() {
if (this.positionName == "Security Engineer") {
return true;
}
return false;
}
CompanyPosition.prototype.isNetworkEngineerJob = function() {
if (this.positionName == "Network Engineer" || this.positionName == "Network Administrator") {
return true;
}
return false;
}
CompanyPosition.prototype.isBusinessJob = function() {
if (this.positionName == "Business Intern" ||
this.positionName == "Business Analyst" ||
this.positionName == "Business Manager" ||
this.positionName == "Operations Manager" ||
this.positionName == "Chief Financial Officer" ||
this.positionName == "Chief Executive Officer") {
return true;
}
return true;
}
CompanyPosition.prototype.isSecurityJob = function() {
if (this.positionName == "Security Guard" ||
this.positionName == "Police Officer" ||
this.positionName == "Security Officer" ||
this.positionName == "Security Supervisor" ||
this.positionName == "Head of Security") {
return true;
}
return false;
}
CompanyPosition.prototype.isAgentJob = function() {
if (this.positionName == "Field Agent" ||
this.positionName == "Secret Agent" ||
this.positionName == "Special Operative") {
return true;
}
return false;
}
CompanyPositions = {
//Constructor: CompanyPosition(name, reqHack, reqStr, reqDef, reqDex, reqAgi, reqCha, reqRep, salary)
@ -108,7 +192,7 @@ CompanyPositions = {
SeniorDev: new CompanyPosition("Senior Software Engineer", 250, 1, 1, 1, 1, 50, 36000, 12),
LeadDev: new CompanyPosition("Lead Software Developer", 400, 1, 1, 1, 1, 100, 72000, 15),
//Security
//IT
ITIntern: new CompanyPosition("IT Intern", 1, 1, 1, 1, 1, 1, 0, .8),
ITAnalyst: new CompanyPosition("IT Analyst", 25, 1, 1, 1, 1, 1, 9000, 2),
ITManager: new CompanyPosition("IT Manager", 150, 1, 1, 1, 1, 50, 36000, 8),

@ -38,13 +38,7 @@ CONSTANTS = {
//Location Definitions
Aevum: "Aevum",
ChongQing: "ChongQing",
Sector12: "Sector-12",
NewTokyo: "New Tokyo",
Ishima: "Ishima",
Volhaven: "Volhaven",
}

@ -1,11 +1,12 @@
//Netburner Faction class
function Faction(name) {
this.name = name;
this.augmentations = []; //Name of faction only
this.augmentations = []; //Name of augmentation only
this.information = ""; //Introductory/informational text about the faction
//Player-related properties for faction
this.isMember = false; //Whether player is member
this.isBanned = false; //Whether or not player is banned from joining this faction
this.playerReputation = 0; //"Reputation" within faction
};

@ -96,29 +96,29 @@ FactionInfo = {
NiteSecInfo:
" __..__ "
" _.sMSMMMMMMb. "
" .-"TMMMMSMMMMMMMb. "
" .' TMMMMSMMMMMMMMb "
" / TMMMSMMMMMMSSS; "
" : :MMMMSMMMSSMMMM; "
" ; @ MMMMSMMSMMMMMMS "
" : _, ,P"TMSMSMMMMMMSM "
" : .+""`, : `TMMMMMSSMM "
" ) c), `-,-=,TSSSSMMMM "
" / ` ,-;|MMMMMMMM; "
" / _.'(o) '-';SMSSSSSS "
" ( , o ,-"'`^MMMM' "
" _.nITESECNIt. "
" .-'NITESECNITESEc. "
" .' NITESECNITESECn "
" / NITESECNITESEC; "
" : :NITESECNITESEC; "
" ; @ NITESECNITESECN "
" : _, ,N'ITESECNITESEC "
" : .+''`, : `NITESECNIT "
" ) /), `-,-=,NITESECNI "
" / ` ,-;|NITESECN; "
" / _.'(o) '-';NITESECN "
" ( , o ,-''`^NITE' "
" )` :`. .' "
" )-. ; `- / "
" \ _.-' : "
" ( _.-" \. \ "
" ( _.-' \. \ "
" \------. \ \ "
" \. \ \ "
" bug \ _.sSb "
" \ _.sSSSSSSSb "
" dSSSSSSSSP^" \ "
" SSSP^" ___ \ "
" / .gP""""Tp. \ "
" bug \ _.nIt "
" \ _.nITESECNi "
" nITESECNIT^' \ "
" NITE^' ___ \ "
" / .gP''''Tp. \ "
" : d' . `b \ "
" ; d' o `b ; "
" / d; `b| "

@ -59,10 +59,14 @@ function PlayerObject() {
//IP Address of Starting (home) computer
this.homeComputer = "";
//Cities: Aevum, ChongQing, Sector12, New Tokyo, Ishima, Volhaven
this.city = CONSTANTS.Aevum;
//Location information
this.city = Locations.Aevum;
this.location = "";
//Company Information
this.companyName = "";
this.companyJob = "";
//Servers
this.currentServer = ""; //IP address of Server currently being accessed through terminal
this.discoveredServers = []; //IP addresses of secret servers not in the network that you have discovered
@ -70,7 +74,6 @@ function PlayerObject() {
//Achievements and achievement progress
//Flag to let the engine know the player is starting a hack
this.startAction = false;
this.actionTime = 0;

File diff suppressed because it is too large Load Diff