Added ability to purchase Tor router to access the dark web. Still need to implement functionality for this dark web

This commit is contained in:
Daniel Xie 2017-04-13 15:21:03 -05:00
parent 685103c5d4
commit 0d6890a565
6 changed files with 57 additions and 2 deletions

@ -55,6 +55,8 @@ TESTING TODO:
Augmentations Augmentations
rm command seems to work
Make it so that a script cannot be edited if it is running Make it so that a script cannot be edited if it is running
+ Traveling + Traveling
@ -65,12 +67,14 @@ TESTING TODO:
Seems to work fine Seems to work fine
Tasks TODO: Tasks TODO:
Augmentations that decrease time to make programs
New server hostname in Purchase Server Pop-up Box needs limits..don't think the ones set in HTML work New server hostname in Purchase Server Pop-up Box needs limits..don't think the ones set in HTML work
Tutorial and help - INTERACTIVE TUTORIAL Tutorial and help - INTERACTIVE TUTORIAL
Secret Servers Secret Servers
Hack time formula needs rebalancing I think, so does hack exp Hack time formula needs rebalancing I think, so does hack exp formula
Create new menu page for purchased servers Create new menu page for purchased servers

@ -466,6 +466,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 - $600,000,000</a> <a href="#" id="location-purchase-1tb" class="a-link-button"> Purchase 1TB Server - $600,000,000</a>
<a href="#" id="location-purchase-tor" class="a-link-button"> Purchase TOR Router - $2,000,000</a>
<!-- Travel agency --> <!-- Travel agency -->
<p id="location-travel-agency-text"> <p id="location-travel-agency-text">

@ -16,6 +16,9 @@ CONSTANTS = {
//Maximum number of log entries for a script //Maximum number of log entries for a script
MaxLogCapacity: 20, MaxLogCapacity: 20,
//How much a TOR router costs
TorRouterCost: 2000000,
//Text that is displayed when the 'help' command is ran in Terminal //Text that is displayed when the 'help' command is ran in Terminal
HelpText: "analyze Get statistics and information about current machine <br>" + HelpText: "analyze Get statistics and information about current machine <br>" +
"clear Clear all text on the terminal <br>" + "clear Clear all text on the terminal <br>" +

@ -115,6 +115,7 @@ displayLocationContent = function() {
var purchase256gb = document.getElementById("location-purchase-256gb"); var purchase256gb = document.getElementById("location-purchase-256gb");
var purchase512gb = document.getElementById("location-purchase-512gb"); var purchase512gb = document.getElementById("location-purchase-512gb");
var purchase1tb = document.getElementById("location-purchase-1tb"); var purchase1tb = document.getElementById("location-purchase-1tb");
var purchaseTor = document.getElementById("location-purchase-tor");
var travelAgencyText = document.getElementById("location-travel-agency-text"); var travelAgencyText = document.getElementById("location-travel-agency-text");
var travelToAevum = document.getElementById("location-travel-to-aevum"); var travelToAevum = document.getElementById("location-travel-to-aevum");
@ -173,6 +174,7 @@ displayLocationContent = function() {
purchase256gb.style.display = "none"; purchase256gb.style.display = "none";
purchase512gb.style.display = "none"; purchase512gb.style.display = "none";
purchase1tb.style.display = "none"; purchase1tb.style.display = "none";
purchaseTor.style.display = "none";
travelAgencyText.style.display = "none"; travelAgencyText.style.display = "none";
travelToAevum.style.display = "none"; travelToAevum.style.display = "none";
@ -245,6 +247,7 @@ displayLocationContent = function() {
purchase256gb.style.display = "block"; purchase256gb.style.display = "block";
purchase512gb.style.display = "block"; purchase512gb.style.display = "block";
purchase1tb.style.display = "block"; purchase1tb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
case Locations.AevumBachmanAndAssociates: case Locations.AevumBachmanAndAssociates:
@ -282,6 +285,7 @@ displayLocationContent = function() {
purchase256gb.style.display = "block"; purchase256gb.style.display = "block";
purchase512gb.style.display = "block"; purchase512gb.style.display = "block";
purchase1tb.style.display = "block"; purchase1tb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
case Locations.AevumAeroCorp: case Locations.AevumAeroCorp:
@ -342,6 +346,7 @@ displayLocationContent = function() {
purchase2gb.style.display = "block"; purchase2gb.style.display = "block";
purchase4gb.style.display = "block"; purchase4gb.style.display = "block";
purchase8gb.style.display = "block"; purchase8gb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
case Locations.AevumCrushFitnessGym: case Locations.AevumCrushFitnessGym:
@ -493,6 +498,7 @@ displayLocationContent = function() {
purchase1gb.style.display = "block"; purchase1gb.style.display = "block";
purchase2gb.style.display = "block"; purchase2gb.style.display = "block";
purchase4gb.style.display = "block"; purchase4gb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
case Locations.Sector12CarmichaelSecurity: case Locations.Sector12CarmichaelSecurity:
@ -628,6 +634,7 @@ displayLocationContent = function() {
purchase8gb.style.display = "block"; purchase8gb.style.display = "block";
purchase16gb.style.display = "block"; purchase16gb.style.display = "block";
purchase32gb.style.display = "block"; purchase32gb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
case Locations.VolhavenTravelAgency: case Locations.VolhavenTravelAgency:
@ -721,6 +728,7 @@ displayLocationContent = function() {
purchase64gb.style.display = "block"; purchase64gb.style.display = "block";
purchase128gb.style.display = "block"; purchase128gb.style.display = "block";
purchase256gb.style.display = "block"; purchase256gb.style.display = "block";
purchaseTor.style.display = "block";
break; break;
@ -1123,6 +1131,7 @@ initLocationButtons = function() {
var purchase256gb = document.getElementById("location-purchase-256gb"); var purchase256gb = document.getElementById("location-purchase-256gb");
var purchase512gb = document.getElementById("location-purchase-512gb"); var purchase512gb = document.getElementById("location-purchase-512gb");
var purchase1tb = document.getElementById("location-purchase-1tb"); var purchase1tb = document.getElementById("location-purchase-1tb");
var purchaseTor = document.getElementById("location-purchase-tor");
var travelToAevum = document.getElementById("location-travel-to-aevum"); var travelToAevum = document.getElementById("location-travel-to-aevum");
var travelToChongqing = document.getElementById("location-travel-to-chongqing"); var travelToChongqing = document.getElementById("location-travel-to-chongqing");
@ -1231,28 +1240,39 @@ initLocationButtons = function() {
return false; return false;
}); });
purchaseTor.addEventListener("click", function() {
purchaseTor();
return false;
}
travelToAevum.addEventListener("click", function() { travelToAevum.addEventListener("click", function() {
travelBoxCreate(Locations.Aevum, 1000000); travelBoxCreate(Locations.Aevum, 1000000);
return false;
}); });
travelToChongqing.addEventListener("click", function() { travelToChongqing.addEventListener("click", function() {
travelBoxCreate(Locations.Chongqing, 1000000); travelBoxCreate(Locations.Chongqing, 1000000);
return false;
}); });
travelToSector12.addEventListener("click", function() { travelToSector12.addEventListener("click", function() {
travelBoxCreate(Locations.Sector12, 1000000); travelBoxCreate(Locations.Sector12, 1000000);
return false;
}); });
travelToNewTokyo.addEventListener("click", function() { travelToNewTokyo.addEventListener("click", function() {
travelBoxCreate(Locations.NewTokyo, 1000000); travelBoxCreate(Locations.NewTokyo, 1000000);
return false;
}); });
travelToIshima.addEventListener("click", function() { travelToIshima.addEventListener("click", function() {
travelBoxCreate(Locations.Ishima, 1000000); travelBoxCreate(Locations.Ishima, 1000000);
return false;
}); });
travelToVolhaven.addEventListener("click", function() { travelToVolhaven.addEventListener("click", function() {
travelBoxCreate(Locations.Volhaven, 1000000); travelBoxCreate(Locations.Volhaven, 1000000);
return false;
}); });
} }
@ -1268,3 +1288,18 @@ travelToCity = function(destCityName, cost) {
dialogBoxCreate("You are now in " + destCityName + "!"); dialogBoxCreate("You are now in " + destCityName + "!");
Engine.loadWorldContent(); Engine.loadWorldContent();
} }
purchaseTor = function() {
if (CONSTANTS.TorRouterCost > Player.money) {
dialogBoxCreate("You cannot afford to purchase the Tor router");
return;
}
Player.money -= CONSTANTS.TorRouterCost;
var darkweb = new Server();
darkweb.init(createRandomIp(), "darkweb", "", true, false, false, false, 1);
AddToAllServers(darkweb);
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.", "");
}

@ -297,6 +297,9 @@ PlayerObject.prototype.finishWork = function(cancelled) {
PlayerObject.prototype.startWork = function() { PlayerObject.prototype.startWork = function() {
this.isWorking = true; this.isWorking = true;
this.currentWorkFactionName = "";
this.currentWorkFactionDescription = "";
this.createProgramName = "";
this.workHackExpGainRate = this.getWorkHackExpGain(); this.workHackExpGainRate = this.getWorkHackExpGain();
this.workStrExpGainRate = this.getWorkStrExpGain(); this.workStrExpGainRate = this.getWorkStrExpGain();
@ -420,6 +423,7 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, faction) {
PlayerObject.prototype.startFactionWork = function(faction) { PlayerObject.prototype.startFactionWork = function(faction) {
this.isWorking = true; this.isWorking = true;
this.currentWorkFactionName = faction.name; this.currentWorkFactionName = faction.name;
this.createProgramName = "";
this.workHackExpGained = 0; this.workHackExpGained = 0;
this.workStrExpGained = 0; this.workStrExpGained = 0;
@ -616,6 +620,8 @@ PlayerObject.prototype.startCreateProgramWork = function(programName) {
this.timeWorked = 0; this.timeWorked = 0;
this.currentWorkFactionName = "";
this.currentWorkFactionDescription = "";
this.createProgramName = programName; this.createProgramName = programName;
var cancelButton = document.getElementById("work-in-progress-cancel-button"); var cancelButton = document.getElementById("work-in-progress-cancel-button");

@ -556,7 +556,13 @@ var Engine = {
} }
if (Player.isWorking) { if (Player.isWorking) {
Player.work(numCycles); if (Player.currentWorkFactionName != "") {
Player.workForFaction(numCycles);
} else if (Player.createProgramName != "") {
Player.createProgramWork(numCycles);
} else {
Player.work(numCycles);
}
} }
//Counters //Counters