diff --git a/css/menupages.css b/css/menupages.css index 294cf28ba..b6c71bf34 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -189,6 +189,12 @@ width: 99%; } +#world-city-name, +#world-city-desc { + padding: 4px; + margin: 4px; +} + /* Create program */ #create-program-container { position: fixed; @@ -248,16 +254,28 @@ margin: 6px; } -#faction-hack-button-div, #faction-hack-text-div { - display:inline-block; +#faction-hack-div, +#faction-fieldwork-div, +#faction-securitywork-div { + overflow: hidden; + height: 100%; } -#faction-fieldwork-button-div, #faction-fieldwork-text-div { - display:inline-block; +#faction-hack-div-wrapper, +#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 { - display:inline-block; +#faction-hack-button { + margin: 8px; +} + +div.faction-clear { + clear: both; } #faction-container p { diff --git a/index.html b/index.html index 4f4148bae..d0c4e71ed 100644 --- a/index.html +++ b/index.html @@ -177,6 +177,8 @@
+

+

@@ -542,7 +530,7 @@ Purchase 256GB Server - $100,000,000 Purchase 512GB Server - $250,000,000 Purchase 1TB Server - $750,000,000 - Purchase TOR Router - $100,000 + Purchase TOaR Router - $100,000 Purchase RAM for Home computer @@ -619,7 +607,7 @@
-

+


WARNING: Purchasing an Augmentation resets most of your progress, including:
diff --git a/src/Constants.js b/src/Constants.js index 5bcbce514..54c7da397 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -17,7 +17,7 @@ CONSTANTS = { /* Hacknet Node constants */ HacknetNodeMoneyGainPerLevel: 0.75, 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 HacknetNodeUpgradeCoreMult: 1.5, //Multiplier for cost when buying another core diff --git a/src/Crimes.js b/src/Crimes.js index 53d3c81fb..412fa6d02 100644 --- a/src/Crimes.js +++ b/src/Crimes.js @@ -1,32 +1,32 @@ /* Crimes.js */ function commitShopliftCrime() { 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() { 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() { 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() { 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() { 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() { 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) { diff --git a/src/DarkWeb.js b/src/DarkWeb.js index 7ce2a1c63..c4b66efb4 100644 --- a/src/DarkWeb.js +++ b/src/DarkWeb.js @@ -41,7 +41,7 @@ executeDarkwebTerminalCommand = function(commandArray) { listAllDarkwebItems = function() { for (var item in DarkWebItems) { if (DarkWebItems.hasOwnProperty(item)) { - post(item); + post(DarkWebItems[item]); } } } @@ -62,7 +62,7 @@ buyDarkwebItem = function(itemName) { if (price > 0 && Player.money >= price) { Player.loseMoney(price); 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."); } else { post("Not enough money to purchase " + itemName); @@ -72,7 +72,7 @@ buyDarkwebItem = function(itemName) { if (price > 0 && Player.money >= price) { Player.loseMoney(price); 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."); } else { post("Not enough money to purchase " + itemName); @@ -82,7 +82,7 @@ buyDarkwebItem = function(itemName) { if (price > 0 && Player.money >= price) { Player.loseMoney(price); 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."); } else { post("Not enough money to purchase " + itemName); @@ -92,7 +92,7 @@ buyDarkwebItem = function(itemName) { if (price > 0 && Player.money >= price) { Player.loseMoney(price); 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."); } else { post("Not enough money to purchase " + itemName); @@ -124,7 +124,7 @@ parseDarkwebItemPrice = function(itemDesc) { } 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", RelaySMTPProgram: Programs.RelaySMTPProgram + " - $500,000 - Opens up SMTP Ports", HTTPWormProgram: Programs.HTTPWormProgram + " - $3,000,000 - Opens up HTTP Ports", diff --git a/src/Faction.js b/src/Faction.js index 86e781680..156c176af 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -527,26 +527,19 @@ leaveFaction = function(faction) { displayFactionContent = function(factionName) { var faction = Factions[factionName]; document.getElementById("faction-name").innerHTML = factionName; - document.getElementById("faction-info").innerHTML = faction.info; + document.getElementById("faction-info").innerHTML = "" + faction.info + ""; document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4); var hackDiv = document.getElementById("faction-hack-div"); var fieldWorkDiv = document.getElementById("faction-fieldwork-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 //The old buttons need to be replaced to clear the old event listeners - var newHackButton = hackButton.cloneNode(true); - var newFieldWorkButton = fieldWorkButton.cloneNode(true); - var newSecurityWorkButton = securityWorkButton.cloneNode(true); - - hackButton.parentNode.replaceChild(newHackButton, hackButton); - fieldWorkButton.parentNode.replaceChild(newFieldWorkButton, fieldWorkButton); - securityWorkButton.parentNode.replaceChild(newSecurityWorkButton, securityWorkButton); + var newHackButton = clearEventListeners("faction-hack-button"); + var newFieldWorkButton = clearEventListeners("faction-fieldwork-button"); + var newSecurityWorkButton = clearEventListeners("faction-securitywork-button"); + newHackButton.addEventListener("click", function() { Player.startFactionHackWork(faction); @@ -566,17 +559,13 @@ displayFactionContent = function(factionName) { //Set new event listener for the purchase augmentation buttons //The old button needs to be replaced to clear the old event listeners - var purchaseAugmentations = document.getElementById("faction-purchase-augmentations"); - var newPurchaseAugmentationsButton = purchaseAugmentations.cloneNode(true); - purchaseAugmentations.parentNode.replaceChild(newPurchaseAugmentationsButton, purchaseAugmentations); + var newPurchaseAugmentationsButton = clearEventListeners("faction-purchase-augmentations"); newPurchaseAugmentationsButton.addEventListener("click", function() { Engine.hideAllContent(); Engine.Display.factionAugmentationsContent.style.visibility = "visible"; - var backButton = document.getElementById("faction-augmentations-back-button"); - var newBackButton = backButton.cloneNode(true); - backButton.parentNode.replaceChild(newBackButton, backButton); + var newBackButton = clearEventListeners("faction-augmentations-back-button"); newBackButton.addEventListener("click", function() { Engine.loadFactionContent(); displayFactionContent(factionName); diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index 7c3817262..60dbe8ee9 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -333,7 +333,6 @@ function iTutorialEvaluateStep() { //Go to the next step and evaluate it function iTutorialNextStep() { - console.log("iTutorialNextStep() called with current step: " + currITutorialStep); switch(currITutorialStep) { case iTutorialSteps.Start: currITutorialStep = iTutorialSteps.GoToCharacterPage; diff --git a/src/Location.js b/src/Location.js index 2275dd629..01c3217c8 100644 --- a/src/Location.js +++ b/src/Location.js @@ -4,6 +4,7 @@ Locations = { //Cities Aevum: "Aevum", + //AevumDesc: "" Chongqing: "Chongqing", Sector12: "Sector-12", NewTokyo: "New Tokyo", @@ -1503,7 +1504,10 @@ purchaseTorRouter = function() { AddToAllServers(darkweb); SpecialServerIps.addIp("Darkweb Server", darkweb.ip); + document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button-inactive"); + 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."); } diff --git a/src/Server.js b/src/Server.js index 3708ba628..07af69dfa 100644 --- a/src/Server.js +++ b/src/Server.js @@ -56,6 +56,14 @@ function Server() { //Initialize the properties of a server Server.prototype.init = function(ip, hostname, organizationName, onlineStatus, isConnectedTo, adminRights, purchasedByPlayer, maxRam) { 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.organizationName = organizationName; this.isOnline = onlineStatus; diff --git a/src/Terminal.js b/src/Terminal.js index 6e504a125..fe76f7139 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -525,7 +525,7 @@ var Terminal = { post("Host not found"); break; case "free": - executeFreeCommand(commandArray); + Terminal.executeFreeCommand(commandArray); break; case "hack": if (commandArray.length != 1) { diff --git a/src/engine.js b/src/engine.js index 8b45e3a42..796e89ebe 100644 --- a/src/engine.js +++ b/src/engine.js @@ -290,7 +290,10 @@ var Engine = { Engine.ishimaLocationsList.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) { + case Locations.Aevum: Engine.aevumLocationsList.style.display = "inline"; break; @@ -831,33 +834,34 @@ var Engine = { Engine.Clickables.tutorialBackButton.addEventListener("click", function() { 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 */ init: function() { //Main menu buttons and content Engine.Clickables.terminalMainMenuButton = clearEventListeners("terminal-menu-link"); - //Engine.Clickables.terminalMainMenuButton = document.getElementById("terminal-menu-link"); Engine.Clickables.terminalMainMenuButton.addEventListener("click", function() { Engine.loadTerminalContent(); return false; }); Engine.Clickables.characterMainMenuButton = clearEventListeners("character-menu-link"); - //Engine.Clickables.characterMainMenuButton = document.getElementById("character-menu-link"); Engine.Clickables.characterMainMenuButton.addEventListener("click", function() { Engine.loadCharacterContent(); return false; }); Engine.Clickables.scriptEditorMainMenuButton = clearEventListeners("create-script-menu-link"); - //Engine.Clickables.scriptEditorMainMenuButton = document.getElementById("create-script-menu-link"); Engine.Clickables.scriptEditorMainMenuButton.addEventListener("click", function() { Engine.loadScriptEditorContent(); return false; }); - //Engine.Clickables.activeScriptsMainMenuButton = document.getElementById("active-scripts-menu-link"); Engine.Clickables.activeScriptsMainMenuButton = clearEventListeners("active-scripts-menu-link"); Engine.Clickables.activeScriptsMainMenuButton.addEventListener("click", function() { Engine.loadActiveScriptsContent(); @@ -865,42 +869,36 @@ var Engine = { }); Engine.Clickables.hacknetNodesMainMenuButton = clearEventListeners("hacknet-nodes-menu-link"); - //Engine.Clickables.hacknetNodesMainMenuButton = document.getElementById("hacknet-nodes-menu-link"); Engine.Clickables.hacknetNodesMainMenuButton.addEventListener("click", function() { Engine.loadHacknetNodesContent(); return false; }); Engine.Clickables.worldMainMenuButton = clearEventListeners("world-menu-link"); - //Engine.Clickables.worldMainMenuButton = document.getElementById("world-menu-link"); Engine.Clickables.worldMainMenuButton.addEventListener("click", function() { Engine.loadWorldContent(); return false; }); Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link"); - //Engine.Clickables.createProgramMainMenuButton = document.getElementById("create-program-menu-link"); Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() { Engine.loadCreateProgramContent(); return false; }); Engine.Clickables.factionsMainMenuButton = clearEventListeners("factions-menu-link"); - //Engine.Clickables.factionsMainMenuButton = document.getElementById("factions-menu-link"); Engine.Clickables.factionsMainMenuButton.addEventListener("click", function() { Engine.loadFactionsContent(); return false; }); Engine.Clickables.augmentationsMainMenuButton = clearEventListeners("augmentations-menu-link"); - //Engine.Clickables.augmentationsMainMenuButton = document.getElementById("augmentations-menu-link"); Engine.Clickables.augmentationsMainMenuButton.addEventListener("click", function() { Engine.loadAugmentationsContent(); return false; }); Engine.Clickables.tutorialMainMenuButton = clearEventListeners("tutorial-menu-link"); - //Engine.Clickables.tutorialMainMenuButton = document.getElementById("tutorial-menu-link"); Engine.Clickables.tutorialMainMenuButton.addEventListener("click", function() { Engine.loadTutorialContent(); return false; diff --git a/utils/PurchaseAugmentationBox.js b/utils/PurchaseAugmentationBox.js index ec77c3f2b..dce8b7300 100644 --- a/utils/PurchaseAugmentationBox.js +++ b/utils/PurchaseAugmentationBox.js @@ -28,17 +28,13 @@ purchaseAugmentationBoxSetText = function(txt) { //ram argument is in GB purchaseAugmentationBoxCreate = function(aug, fac) { - console.log("here"); document.getElementById("purchase-augmentation-box-aug-name").innerHTML = aug.name; document.getElementById("purchase-augmentation-box-aug-info").innerHTML = aug.info; - purchaseAugmentationBoxSetText("Would you like to purchase the " + aug.name + " Augmentation for $" + + purchaseAugmentationBoxSetText("
Would you like to purchase the " + aug.name + " Augmentation for $" + formatNumber(aug.baseCost * fac.augmentationPriceMult, 2) + "?"); //Clear old event listeners from Confirm button 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() {