Small UI improvements, balancing crime money

This commit is contained in:
Daniel Xie 2017-05-06 14:12:45 -05:00
parent 2e55f1d472
commit 534f5c1dbe
12 changed files with 107 additions and 107 deletions

@ -189,6 +189,12 @@
width: 99%; width: 99%;
} }
#world-city-name,
#world-city-desc {
padding: 4px;
margin: 4px;
}
/* Create program */ /* Create program */
#create-program-container { #create-program-container {
position: fixed; position: fixed;
@ -248,16 +254,28 @@
margin: 6px; margin: 6px;
} }
#faction-hack-button-div, #faction-hack-text-div { #faction-hack-div,
display:inline-block; #faction-fieldwork-div,
#faction-securitywork-div {
overflow: hidden;
height: 100%;
} }
#faction-fieldwork-button-div, #faction-fieldwork-text-div { #faction-hack-div-wrapper,
display:inline-block; #faction-fieldwork-div-wrapper,
#faction-securitywork-div-wrapper {
float: left;
border: 2px solid #333;
padding: 14px 6px 4px 6px;
margin: 6px;
} }
#faction-securitywork-button-div, #faction-securitywork-text-div { #faction-hack-button {
display:inline-block; margin: 8px;
}
div.faction-clear {
clear: both;
} }
#faction-container p { #faction-container p {

@ -177,6 +177,8 @@
<!-- World --> <!-- World -->
<div id="world-container" class="world-container"> <div id="world-container" class="world-container">
<h2 id="world-city-name"> </h2>
<p id="world-city-desc"> </p>
<ul id="aevum-locations-list"> <ul id="aevum-locations-list">
<li id="aevum-travelagency-li"> <li id="aevum-travelagency-li">
<a href="#" id="aevum-travelagency" class="a-link-button"> Travel Agency </a> <a href="#" id="aevum-travelagency" class="a-link-button"> Travel Agency </a>
@ -373,30 +375,12 @@
<!-- Create a program(executable) --> <!-- Create a program(executable) -->
<div id="create-program-container"> <div id="create-program-container">
<ul id="create-program-list"> <ul id="create-program-list">
<a class="create-program-a-link-button" id="create-program-porthack" href="#"> <a class="create-program-a-link-button" id="create-program-porthack" href="#">PortHack.exe</a>
PortHack.exe <a class="create-program-a-link-button" id="create-program-brutessh" href="#">BruteSSH.exe</a>
</a> <a class="create-program-a-link-button" id="create-program-ftpcrack" href="#">FTPCrack.exe</a>
<a class="create-program-a-link-button" id="create-program-relaysmtp" href="#">relaySMTP.exe</a>
<a class="create-program-a-link-button" id="create-program-brutessh" href="#"> <a class="create-program-a-link-button" id="create-program-httpworm" href="#">HTTPWorm.exe</a>
BruteSSH.exe <a class="create-program-a-link-button" id="create-program-sqlinject" href="#">SQLInject.exe</a>
</a>
<a class="create-program-a-link-button" id="create-program-ftpcrack" href="#">
FTPCrack.exe
</a>
<a class="create-program-a-link-button" id="create-program-relaysmtp" href="#">
relaySMTP.exe
</a>
<a class="create-program-a-link-button" id="create-program-httpworm" href="#">
HTTPWorm.exe
</a>
<a class="create-program-a-link-button" id="create-program-sqlinject" href="#">
SQLInject.exe
</a>
</ul> </ul>
</div> </div>
@ -404,8 +388,7 @@
<div id="factions-container"> <div id="factions-container">
<h1> Factions </h1> <h1> Factions </h1>
<p> Lists all factions you have joined </p> <p> Lists all factions you have joined </p>
<ul class="factions-list" id="factions-list"> <ul class="factions-list" id="factions-list"></ul>
</ul>
</div> </div>
<!-- Single Faction info (when you select a faction from the Factions menu) --> <!-- Single Faction info (when you select a faction from the Factions menu) -->
@ -419,45 +402,50 @@
Perform work/carry out assignments for your faction to help further its cause! Each Perform work/carry out assignments for your faction to help further its cause! Each
task takes a certain amount of time to complete, which is dependent on your stats. Completing task takes a certain amount of time to complete, which is dependent on your stats. Completing
a task will earn you exp and increase your reputation with the faction. Note that you cannot a task will earn you exp and increase your reputation with the faction. Note that you cannot
use your terminal or create scripts when you are performing a task! use your terminal or create scripts when you are performing a task! <br><br><br><br>
</p> </p>
<div id="faction-hack-div"> <div id="faction-hack-div">
<div id="faction-hack-div-wrapper">
<a href="#" id="faction-hack-button" class="a-link-button">Hacking Contracts</a> <a href="#" id="faction-hack-button" class="a-link-button">Hacking Contracts</a>
<p id="faction-hack-text"> <p id="faction-hack-text">
Complete hacking contracts for your faction! <br> Complete hacking contracts for your faction! <br>
Your effectiveness, which determines how much reputation you gain for this faction, is based on your hacking skill. <br> Your effectiveness, which determines how much reputation you gain for this faction, is based on your hacking skill. <br>
Gain hacking exp. You will gain hacking exp.
</p> </p>
<div id="faction-hack-text-div">
</div> </div>
<div class="faction-clear"></div>
</div> </div>
<div id="faction-fieldwork-div"> <div id="faction-fieldwork-div">
<div id="faction-fieldwork-div-wrapper">
<a href="#" id="faction-fieldwork-button" class="a-link-button">Field Work</a> <a href="#" id="faction-fieldwork-button" class="a-link-button">Field Work</a>
<div id="faction-fieldwork-text-div">
<p id="faction-fieldwork-text"> <p id="faction-fieldwork-text">
Carry out field missions for your faction. <br> Carry out field missions for your faction. <br>
Your effectiveness, which determines how much reputation you gain for this faction, is based on all of your stats. <br> Your effectiveness, which determines how much reputation you gain for this faction, is based on all of your stats. <br>
Gains exp for all stats. You will gain exp for all stats.
</p> </p>
</div> </div>
<div class="faction-clear"></div>
</div> </div>
<div id="faction-securitywork-div"> <div id="faction-securitywork-div">
<div id="faction-securitywork-div-wrapper">
<a href="#" id="faction-securitywork-button" class="a-link-button">Security Work</a> <a href="#" id="faction-securitywork-button" class="a-link-button">Security Work</a>
<div id="faction-securitywork-text-div">
<p id="faction-securitywork-text"> <p id="faction-securitywork-text">
Serve in a security detail for your faction. <br> Serve in a security detail for your faction. <br>
Your effectiveness, which determines how much reputation you gain for this faction, is based on your combat stats. <br> Your effectiveness, which determines how much reputation you gain for this faction, is based on your combat stats. <br>
Gains exp for all combat stats. You will gain exp for all combat stats.
</p> </p>
</div> </div>
<div class="faction-clear"></div>
</div> </div>
<p> <p>
<br><br><br>
As your reputation with this faction rises, you will unlock Augmentations, which you As your reputation with this faction rises, you will unlock Augmentations, which you
can purchase to enhance your abilities. can purchase to enhance your abilities.
<br><br>
</p> </p>
<a href="#" id="faction-purchase-augmentations" class="a-link-button">Purchase Augmentations</a> <a href="#" id="faction-purchase-augmentations" class="a-link-button">Purchase Augmentations</a>
</div> </div>
@ -542,7 +530,7 @@
<a href="#" id="location-purchase-256gb" class="a-link-button"> Purchase 256GB Server - $100,000,000</a> <a href="#" id="location-purchase-256gb" class="a-link-button"> Purchase 256GB Server - $100,000,000</a>
<a href="#" id="location-purchase-512gb" class="a-link-button"> Purchase 512GB Server - $250,000,000</a> <a href="#" id="location-purchase-512gb" class="a-link-button"> Purchase 512GB Server - $250,000,000</a>
<a href="#" id="location-purchase-1tb" class="a-link-button"> Purchase 1TB Server - $750,000,000</a> <a href="#" id="location-purchase-1tb" class="a-link-button"> Purchase 1TB Server - $750,000,000</a>
<a href="#" id="location-purchase-tor" class="a-link-button"> Purchase TOR Router - $100,000</a> <a href="#" id="location-purchase-tor" class="a-link-button"> Purchase TOaR Router - $100,000</a>
<a href="#" id="location-purchase-home-ram" class="a-link-button"> Purchase RAM for Home computer </a> <a href="#" id="location-purchase-home-ram" class="a-link-button"> Purchase RAM for Home computer </a>
<!-- Travel agency --> <!-- Travel agency -->
@ -619,7 +607,7 @@
<!-- Purchase Augmentation Pop-up Box --> <!-- Purchase Augmentation Pop-up Box -->
<div id="purchase-augmentation-box-container"> <div id="purchase-augmentation-box-container">
<div id="purchase-augmentation-box-content"> <div id="purchase-augmentation-box-content">
<h2 id="purchase-augmentation-box-aug-name"> <h2> <h2 id="purchase-augmentation-box-aug-name"> </h2>
<p id="purchase-augmentation-box-aug-info"> </p> <p id="purchase-augmentation-box-aug-info"> </p>
<p id="purchase-augmentation-box-text"> </p> <p id="purchase-augmentation-box-text"> </p>
<p> <br> WARNING: Purchasing an Augmentation resets most of your progress, including: <br> <p> <br> WARNING: Purchasing an Augmentation resets most of your progress, including: <br>

@ -17,7 +17,7 @@ CONSTANTS = {
/* Hacknet Node constants */ /* Hacknet Node constants */
HacknetNodeMoneyGainPerLevel: 0.75, HacknetNodeMoneyGainPerLevel: 0.75,
HacknetNodePurchaseNextMult: 1.35, //Multiplier when purchasing an additional hacknet node HacknetNodePurchaseNextMult: 1.35, //Multiplier when purchasing an additional hacknet node
HacknetNodeUpgradeLevelMult: 1.08, //Multiplier for cost when upgrading level HacknetNodeUpgradeLevelMult: 1.07, //Multiplier for cost when upgrading level
HacknetNodeUpgradeRamMult: 1.2, //Multiplier for cost when upgrading RAM HacknetNodeUpgradeRamMult: 1.2, //Multiplier for cost when upgrading RAM
HacknetNodeUpgradeCoreMult: 1.5, //Multiplier for cost when buying another core HacknetNodeUpgradeCoreMult: 1.5, //Multiplier for cost when buying another core

@ -1,32 +1,32 @@
/* Crimes.js */ /* Crimes.js */
function commitShopliftCrime() { function commitShopliftCrime() {
Player.crimeType = CONSTANTS.CrimeShoplift; Player.crimeType = CONSTANTS.CrimeShoplift;
Player.startCrime(0, 0.5, 0.5, 0.5, 0.5, 0, 100, 3000); //$33.33/s, .167 exp/s Player.startCrime(0, 0.5, 0.5, 0.5, 0.5, 0, 500, 3000); //$166.66/s, .167 exp/s
} }
function commitMugCrime() { function commitMugCrime() {
Player.crimeType = CONSTANTS.CrimeMug; Player.crimeType = CONSTANTS.CrimeMug;
Player.startCrime(0, 1, 1, 1, 1, 0, 250, 5000); //$50/s, .2 exp/s Player.startCrime(0, 1, 1, 1, 1, 0, 1000, 5000); //$200/s, .2 exp/s
} }
function commitDealDrugsCrime() { function commitDealDrugsCrime() {
Player.crimeType = CONSTANTS.CrimeDrugs; Player.crimeType = CONSTANTS.CrimeDrugs;
Player.startCrime(0, 2, 2, 2, 2, 2, 1000, 10000); //$100/s, .2 exp/s Player.startCrime(0, 2, 2, 2, 2, 2, 2500, 10000); //$250/s, .2 exp/s
} }
function commitTraffickArmsCrime() { function commitTraffickArmsCrime() {
Player.crimeType = CONSTANTS.CrimeTraffickArms; Player.crimeType = CONSTANTS.CrimeTraffickArms;
Player.startCrime(0, 8, 8, 8, 8, 12, 5000, 40000); //$125/s, .2 combat exp/s, .3 cha exp/s Player.startCrime(0, 8, 8, 8, 8, 12, 15000, 40000); //$375/s, .2 combat exp/s, .3 cha exp/s
} }
function commitHomicideCrime() { function commitHomicideCrime() {
Player.crimeType = CONSTANTS.CrimeHomicide; Player.crimeType = CONSTANTS.CrimeHomicide;
Player.startCrime(0, 2, 2, 2, 2, 0, 300, 3000); //$100/s, 0.66 combat exp/s Player.startCrime(0, 2, 2, 2, 2, 0, 600, 3000); //$200/s, 0.66 combat exp/s
} }
function commitKidnapCrime() { function commitKidnapCrime() {
Player.crimeType = CONSTANTS.CrimeKidnap; Player.crimeType = CONSTANTS.CrimeKidnap;
Player.startCrime(0, 20, 20, 20, 20, 20, 20000, 120000); //$166.67/s. .167 exp/s Player.startCrime(0, 20, 20, 20, 20, 20, 50000, 120000); //$416.67/s. .167 exp/s
} }
function determineCrimeSuccess(crime, moneyGained) { function determineCrimeSuccess(crime, moneyGained) {

@ -41,7 +41,7 @@ executeDarkwebTerminalCommand = function(commandArray) {
listAllDarkwebItems = function() { listAllDarkwebItems = function() {
for (var item in DarkWebItems) { for (var item in DarkWebItems) {
if (DarkWebItems.hasOwnProperty(item)) { if (DarkWebItems.hasOwnProperty(item)) {
post(item); post(DarkWebItems[item]);
} }
} }
} }
@ -62,7 +62,7 @@ buyDarkwebItem = function(itemName) {
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.FTPCrackProgram); Player.getHomeComputer().programs.push(Programs.FTPCrackProgram);
post("You have purchased the BruteSSH.exe program. The new program " + post("You have purchased the FTPCrack.exe program. The new program " +
"can be found on your home computer."); "can be found on your home computer.");
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
@ -72,7 +72,7 @@ buyDarkwebItem = function(itemName) {
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.RelaySMTPProgram); Player.getHomeComputer().programs.push(Programs.RelaySMTPProgram);
post("You have purchased the BruteSSH.exe program. The new program " + post("You have purchased the relaySMTP.exe program. The new program " +
"can be found on your home computer."); "can be found on your home computer.");
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
@ -82,7 +82,7 @@ buyDarkwebItem = function(itemName) {
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.HTTPWormProgram); Player.getHomeComputer().programs.push(Programs.HTTPWormProgram);
post("You have purchased the BruteSSH.exe program. The new program " + post("You have purchased the HTTPWorm.exe program. The new program " +
"can be found on your home computer."); "can be found on your home computer.");
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
@ -92,7 +92,7 @@ buyDarkwebItem = function(itemName) {
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.SQLInjectProgram); Player.getHomeComputer().programs.push(Programs.SQLInjectProgram);
post("You have purchased the BruteSSH.exe program. The new program " + post("You have purchased the SQLInject.exe program. The new program " +
"can be found on your home computer."); "can be found on your home computer.");
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
@ -124,7 +124,7 @@ parseDarkwebItemPrice = function(itemDesc) {
} }
DarkWebItems = { DarkWebItems = {
BruteSSHProgram: Programs.BRUTESSHProgram + " - $50,000 - Opens up SSH Ports", BruteSSHProgram: Programs.BruteSSHProgram + " - $50,000 - Opens up SSH Ports",
FTPCrackProgram: Programs.FTPCrackProgram + " - $150,000 - Opens up FTP Ports", FTPCrackProgram: Programs.FTPCrackProgram + " - $150,000 - Opens up FTP Ports",
RelaySMTPProgram: Programs.RelaySMTPProgram + " - $500,000 - Opens up SMTP Ports", RelaySMTPProgram: Programs.RelaySMTPProgram + " - $500,000 - Opens up SMTP Ports",
HTTPWormProgram: Programs.HTTPWormProgram + " - $3,000,000 - Opens up HTTP Ports", HTTPWormProgram: Programs.HTTPWormProgram + " - $3,000,000 - Opens up HTTP Ports",

@ -527,26 +527,19 @@ leaveFaction = function(faction) {
displayFactionContent = function(factionName) { displayFactionContent = function(factionName) {
var faction = Factions[factionName]; var faction = Factions[factionName];
document.getElementById("faction-name").innerHTML = factionName; document.getElementById("faction-name").innerHTML = factionName;
document.getElementById("faction-info").innerHTML = faction.info; document.getElementById("faction-info").innerHTML = "<i>" + faction.info + "</i>";
document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4); document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4);
var hackDiv = document.getElementById("faction-hack-div"); var hackDiv = document.getElementById("faction-hack-div");
var fieldWorkDiv = document.getElementById("faction-fieldwork-div"); var fieldWorkDiv = document.getElementById("faction-fieldwork-div");
var securityWorkDiv = document.getElementById("faction-securitywork-div"); var securityWorkDiv = document.getElementById("faction-securitywork-div");
var hackButton = document.getElementById("faction-hack-button");
var fieldWorkButton = document.getElementById("faction-fieldwork-button");
var securityWorkButton = document.getElementById("faction-securitywork-button");
//Set new event listener for all of the work buttons //Set new event listener for all of the work buttons
//The old buttons need to be replaced to clear the old event listeners //The old buttons need to be replaced to clear the old event listeners
var newHackButton = hackButton.cloneNode(true); var newHackButton = clearEventListeners("faction-hack-button");
var newFieldWorkButton = fieldWorkButton.cloneNode(true); var newFieldWorkButton = clearEventListeners("faction-fieldwork-button");
var newSecurityWorkButton = securityWorkButton.cloneNode(true); var newSecurityWorkButton = clearEventListeners("faction-securitywork-button");
hackButton.parentNode.replaceChild(newHackButton, hackButton);
fieldWorkButton.parentNode.replaceChild(newFieldWorkButton, fieldWorkButton);
securityWorkButton.parentNode.replaceChild(newSecurityWorkButton, securityWorkButton);
newHackButton.addEventListener("click", function() { newHackButton.addEventListener("click", function() {
Player.startFactionHackWork(faction); Player.startFactionHackWork(faction);
@ -566,17 +559,13 @@ displayFactionContent = function(factionName) {
//Set new event listener for the purchase augmentation buttons //Set new event listener for the purchase augmentation buttons
//The old button needs to be replaced to clear the old event listeners //The old button needs to be replaced to clear the old event listeners
var purchaseAugmentations = document.getElementById("faction-purchase-augmentations"); var newPurchaseAugmentationsButton = clearEventListeners("faction-purchase-augmentations");
var newPurchaseAugmentationsButton = purchaseAugmentations.cloneNode(true);
purchaseAugmentations.parentNode.replaceChild(newPurchaseAugmentationsButton, purchaseAugmentations);
newPurchaseAugmentationsButton.addEventListener("click", function() { newPurchaseAugmentationsButton.addEventListener("click", function() {
Engine.hideAllContent(); Engine.hideAllContent();
Engine.Display.factionAugmentationsContent.style.visibility = "visible"; Engine.Display.factionAugmentationsContent.style.visibility = "visible";
var backButton = document.getElementById("faction-augmentations-back-button"); var newBackButton = clearEventListeners("faction-augmentations-back-button");
var newBackButton = backButton.cloneNode(true);
backButton.parentNode.replaceChild(newBackButton, backButton);
newBackButton.addEventListener("click", function() { newBackButton.addEventListener("click", function() {
Engine.loadFactionContent(); Engine.loadFactionContent();
displayFactionContent(factionName); displayFactionContent(factionName);

@ -333,7 +333,6 @@ function iTutorialEvaluateStep() {
//Go to the next step and evaluate it //Go to the next step and evaluate it
function iTutorialNextStep() { function iTutorialNextStep() {
console.log("iTutorialNextStep() called with current step: " + currITutorialStep);
switch(currITutorialStep) { switch(currITutorialStep) {
case iTutorialSteps.Start: case iTutorialSteps.Start:
currITutorialStep = iTutorialSteps.GoToCharacterPage; currITutorialStep = iTutorialSteps.GoToCharacterPage;

@ -4,6 +4,7 @@
Locations = { Locations = {
//Cities //Cities
Aevum: "Aevum", Aevum: "Aevum",
//AevumDesc: ""
Chongqing: "Chongqing", Chongqing: "Chongqing",
Sector12: "Sector-12", Sector12: "Sector-12",
NewTokyo: "New Tokyo", NewTokyo: "New Tokyo",
@ -1503,7 +1504,10 @@ purchaseTorRouter = function() {
AddToAllServers(darkweb); AddToAllServers(darkweb);
SpecialServerIps.addIp("Darkweb Server", darkweb.ip); SpecialServerIps.addIp("Darkweb Server", darkweb.ip);
document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button-inactive");
Player.getHomeComputer().serversOnNetwork.push(darkweb.ip); Player.getHomeComputer().serversOnNetwork.push(darkweb.ip);
darkweb.serversOnNetwork.push(Player.getHomeComputer().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 connection."); 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 connection.");
} }

@ -56,6 +56,14 @@ function Server() {
//Initialize the properties of a server //Initialize the properties of a server
Server.prototype.init = function(ip, hostname, organizationName, onlineStatus, isConnectedTo, adminRights, purchasedByPlayer, maxRam) { Server.prototype.init = function(ip, hostname, organizationName, onlineStatus, isConnectedTo, adminRights, purchasedByPlayer, maxRam) {
this.ip = ip; this.ip = ip;
//Check if hostname is unique
var i = 0;
while (GetServerByHostname(hostname) != null) {
//Server already exists
hostname = hostname + "-" + i;
++i;
}
this.hostname = hostname; this.hostname = hostname;
this.organizationName = organizationName; this.organizationName = organizationName;
this.isOnline = onlineStatus; this.isOnline = onlineStatus;

@ -525,7 +525,7 @@ var Terminal = {
post("Host not found"); post("Host not found");
break; break;
case "free": case "free":
executeFreeCommand(commandArray); Terminal.executeFreeCommand(commandArray);
break; break;
case "hack": case "hack":
if (commandArray.length != 1) { if (commandArray.length != 1) {

@ -290,7 +290,10 @@ var Engine = {
Engine.ishimaLocationsList.style.display = "none"; Engine.ishimaLocationsList.style.display = "none";
Engine.volhavenLocationsList.style.display = "none"; Engine.volhavenLocationsList.style.display = "none";
document.getElementById("world-city-name").innerHTML = Player.city;
var cityDesc = document.getElementById("world-city-desc"); //TODO
switch(Player.city) { switch(Player.city) {
case Locations.Aevum: case Locations.Aevum:
Engine.aevumLocationsList.style.display = "inline"; Engine.aevumLocationsList.style.display = "inline";
break; break;
@ -831,33 +834,34 @@ var Engine = {
Engine.Clickables.tutorialBackButton.addEventListener("click", function() { Engine.Clickables.tutorialBackButton.addEventListener("click", function() {
Engine.displayTutorialContent(); Engine.displayTutorialContent();
}); });
//If DarkWeb already purchased, disable the button
if (SpecialServerIps.hasOwnProperty("Darkweb Server")) {
document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button-inactive");
}
}, },
/* Initialization */ /* Initialization */
init: function() { init: function() {
//Main menu buttons and content //Main menu buttons and content
Engine.Clickables.terminalMainMenuButton = clearEventListeners("terminal-menu-link"); Engine.Clickables.terminalMainMenuButton = clearEventListeners("terminal-menu-link");
//Engine.Clickables.terminalMainMenuButton = document.getElementById("terminal-menu-link");
Engine.Clickables.terminalMainMenuButton.addEventListener("click", function() { Engine.Clickables.terminalMainMenuButton.addEventListener("click", function() {
Engine.loadTerminalContent(); Engine.loadTerminalContent();
return false; return false;
}); });
Engine.Clickables.characterMainMenuButton = clearEventListeners("character-menu-link"); Engine.Clickables.characterMainMenuButton = clearEventListeners("character-menu-link");
//Engine.Clickables.characterMainMenuButton = document.getElementById("character-menu-link");
Engine.Clickables.characterMainMenuButton.addEventListener("click", function() { Engine.Clickables.characterMainMenuButton.addEventListener("click", function() {
Engine.loadCharacterContent(); Engine.loadCharacterContent();
return false; return false;
}); });
Engine.Clickables.scriptEditorMainMenuButton = clearEventListeners("create-script-menu-link"); Engine.Clickables.scriptEditorMainMenuButton = clearEventListeners("create-script-menu-link");
//Engine.Clickables.scriptEditorMainMenuButton = document.getElementById("create-script-menu-link");
Engine.Clickables.scriptEditorMainMenuButton.addEventListener("click", function() { Engine.Clickables.scriptEditorMainMenuButton.addEventListener("click", function() {
Engine.loadScriptEditorContent(); Engine.loadScriptEditorContent();
return false; return false;
}); });
//Engine.Clickables.activeScriptsMainMenuButton = document.getElementById("active-scripts-menu-link");
Engine.Clickables.activeScriptsMainMenuButton = clearEventListeners("active-scripts-menu-link"); Engine.Clickables.activeScriptsMainMenuButton = clearEventListeners("active-scripts-menu-link");
Engine.Clickables.activeScriptsMainMenuButton.addEventListener("click", function() { Engine.Clickables.activeScriptsMainMenuButton.addEventListener("click", function() {
Engine.loadActiveScriptsContent(); Engine.loadActiveScriptsContent();
@ -865,42 +869,36 @@ var Engine = {
}); });
Engine.Clickables.hacknetNodesMainMenuButton = clearEventListeners("hacknet-nodes-menu-link"); Engine.Clickables.hacknetNodesMainMenuButton = clearEventListeners("hacknet-nodes-menu-link");
//Engine.Clickables.hacknetNodesMainMenuButton = document.getElementById("hacknet-nodes-menu-link");
Engine.Clickables.hacknetNodesMainMenuButton.addEventListener("click", function() { Engine.Clickables.hacknetNodesMainMenuButton.addEventListener("click", function() {
Engine.loadHacknetNodesContent(); Engine.loadHacknetNodesContent();
return false; return false;
}); });
Engine.Clickables.worldMainMenuButton = clearEventListeners("world-menu-link"); Engine.Clickables.worldMainMenuButton = clearEventListeners("world-menu-link");
//Engine.Clickables.worldMainMenuButton = document.getElementById("world-menu-link");
Engine.Clickables.worldMainMenuButton.addEventListener("click", function() { Engine.Clickables.worldMainMenuButton.addEventListener("click", function() {
Engine.loadWorldContent(); Engine.loadWorldContent();
return false; return false;
}); });
Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link"); Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link");
//Engine.Clickables.createProgramMainMenuButton = document.getElementById("create-program-menu-link");
Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() { Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() {
Engine.loadCreateProgramContent(); Engine.loadCreateProgramContent();
return false; return false;
}); });
Engine.Clickables.factionsMainMenuButton = clearEventListeners("factions-menu-link"); Engine.Clickables.factionsMainMenuButton = clearEventListeners("factions-menu-link");
//Engine.Clickables.factionsMainMenuButton = document.getElementById("factions-menu-link");
Engine.Clickables.factionsMainMenuButton.addEventListener("click", function() { Engine.Clickables.factionsMainMenuButton.addEventListener("click", function() {
Engine.loadFactionsContent(); Engine.loadFactionsContent();
return false; return false;
}); });
Engine.Clickables.augmentationsMainMenuButton = clearEventListeners("augmentations-menu-link"); Engine.Clickables.augmentationsMainMenuButton = clearEventListeners("augmentations-menu-link");
//Engine.Clickables.augmentationsMainMenuButton = document.getElementById("augmentations-menu-link");
Engine.Clickables.augmentationsMainMenuButton.addEventListener("click", function() { Engine.Clickables.augmentationsMainMenuButton.addEventListener("click", function() {
Engine.loadAugmentationsContent(); Engine.loadAugmentationsContent();
return false; return false;
}); });
Engine.Clickables.tutorialMainMenuButton = clearEventListeners("tutorial-menu-link"); Engine.Clickables.tutorialMainMenuButton = clearEventListeners("tutorial-menu-link");
//Engine.Clickables.tutorialMainMenuButton = document.getElementById("tutorial-menu-link");
Engine.Clickables.tutorialMainMenuButton.addEventListener("click", function() { Engine.Clickables.tutorialMainMenuButton.addEventListener("click", function() {
Engine.loadTutorialContent(); Engine.loadTutorialContent();
return false; return false;

@ -28,17 +28,13 @@ purchaseAugmentationBoxSetText = function(txt) {
//ram argument is in GB //ram argument is in GB
purchaseAugmentationBoxCreate = function(aug, fac) { purchaseAugmentationBoxCreate = function(aug, fac) {
console.log("here");
document.getElementById("purchase-augmentation-box-aug-name").innerHTML = aug.name; document.getElementById("purchase-augmentation-box-aug-name").innerHTML = aug.name;
document.getElementById("purchase-augmentation-box-aug-info").innerHTML = aug.info; document.getElementById("purchase-augmentation-box-aug-info").innerHTML = aug.info;
purchaseAugmentationBoxSetText("Would you like to purchase the " + aug.name + " Augmentation for $" + purchaseAugmentationBoxSetText("<br>Would you like to purchase the " + aug.name + " Augmentation for $" +
formatNumber(aug.baseCost * fac.augmentationPriceMult, 2) + "?"); formatNumber(aug.baseCost * fac.augmentationPriceMult, 2) + "?");
//Clear old event listeners from Confirm button //Clear old event listeners from Confirm button
var newConfirmButton = clearEventListeners("purchase-augmentation-box-confirm"); var newConfirmButton = clearEventListeners("purchase-augmentation-box-confirm");
//var confirmButton = document.getElementById("purchase-augmentation-box-confirm");
//var newConfirmButton = confirmButton.cloneNode(true);
//confirmButton.parentNode.replaceChild(newConfirmButton, confirmButton);
newConfirmButton.addEventListener("click", function() { newConfirmButton.addEventListener("click", function() {