diff --git a/css/menupages.css b/css/menupages.css index e0dd53848..dc8217e8f 100644 --- a/css/menupages.css +++ b/css/menupages.css @@ -191,6 +191,14 @@ color: #66ff33; } +#faction-augmentations-container p, +#faction-augmentations-container a, +#faction-augmentations-container ul, +#faction-augmentations-container h1{ + margin: 8px; + padding: 4px; +} + /* World */ #world-container li { margin: 0 0 15px 0; diff --git a/css/styles.css b/css/styles.css index 6e23405e4..2ef8cfaee 100644 --- a/css/styles.css +++ b/css/styles.css @@ -73,8 +73,8 @@ li { text-decoration: none; background-color: #555; color: #FFFFFF; - padding: 4px; - margin: 4px; + padding: 6px; + margin: 6px; border-top: 1px solid #333333; border-right: 1px solid #333333; border-bottom: 1px solid #333333; @@ -86,8 +86,8 @@ li { text-decoration: none; background-color: #555; color: #FFFFFF; - padding: 4px; - margin: 4px; + padding: 6px; + margin: 6px; border-top: 1px solid #333333; border-right: 1px solid #333333; border-bottom: 1px solid #333333; diff --git a/index.html b/index.html index 779c636ad..21248b30b 100644 --- a/index.html +++ b/index.html @@ -397,9 +397,10 @@
diff --git a/src/Constants.js b/src/Constants.js index 7a906c932..a6213e4f9 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -28,6 +28,9 @@ CONSTANTS = { MillisecondsPer8Hours: 28800000, GameCyclesPer8Hours: 28800000 / 200, + MillisecondsPer4Hours: 14400000, + GameCyclesPer4Hours: 14400000 / 200, + MillisecondsPerHour: 3600000, GameCyclesPerHour: 3600000 / 200, diff --git a/src/CreateProgram.js b/src/CreateProgram.js index 6d28ab69c..f8fa6295f 100644 --- a/src/CreateProgram.js +++ b/src/CreateProgram.js @@ -8,6 +8,8 @@ Programs = { SQLInjectProgram: "SQLInject.exe", } +//TODO Right now the times needed to complete work are hard-coded... +//maybe later make this dependent on hacking level or something function displayCreateProgramContent() { var portHackALink = document.getElementById("create-program-porthack"); var bruteSshALink = document.getElementById("create-program-brutessh"); @@ -38,7 +40,7 @@ function displayCreateProgramContent() { Player.hacking_skill >= 50) { bruteSshALink.style.display = "block"; bruteSshALink.addEventListener("click", function() { - createProgram(Programs.BruteSSHProgram); + Player.startCreateProgramWork(Programs.BruteSSHProgram, CONSTANTS.MillisecondsPerHour); }); } @@ -47,7 +49,7 @@ function displayCreateProgramContent() { Player.hacking_skill >= 125) { ftpCrackALink.style.display = "block"; ftpCrackALink.addEventListener("click", function() { - createProgram(Programs.FTPCrackProgram); + Player.startCreateProgramWork(Programs.FTPCrackProgram, CONSTANTS.MillisecondsPer4Hours); }); } @@ -56,7 +58,7 @@ function displayCreateProgramContent() { Player.hacking_skill >= 300) { relaySmtpALink.style.display = "block"; relaySmtpAlink.addEventListener("click", function() { - createProgram(Programs.RelaySMTPProgram); + Player.startCreateProgramWork(Programs.RelaySMTPProgram. CONSTANTS.MillisecondsPer8Hours); }); } @@ -65,7 +67,7 @@ function displayCreateProgramContent() { Player.hacking_skill >= 500) { httpWormALink.style.display = "block"; httpWormALink.addEventListener("click", function() { - createProgram(Programs.HTTPWormProgram); + Player.startCreateProgramWork(Programs.HTTPWormProgram, CONSTANTS.MillisecondsPer10Hours); }); } @@ -74,11 +76,7 @@ function displayCreateProgramContent() { Player.hacking_skill >= 750) { sqlInjectALink.style.display = "block"; sqlInjectALink.addEventListener("click", function() { - createProgram(Programs.SQLInjectProgram); + Player.startCreateProgramWork(Programs.SQLInjectProgram, CONSTANTS.MillisecondsPer10Hours); }); } -} - -function createProgram(programName) { - Player.startCreateProgramWork(programName); } \ No newline at end of file diff --git a/src/Faction.js b/src/Faction.js index 37dd59a6c..4f29bd851 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -445,7 +445,7 @@ displayFactionContent = function(factionName) { var faction = Factions[factionName]; document.getElementById("faction-name").innerHTML = factionName; document.getElementById("faction-info").innerHTML = faction.info; - document.getElementById("faction-reputation").innerHTML = "Reputation: " + faction.playerReputation; + document.getElementById("faction-reputation").innerHTML = "Reputation: " + faction.playerReputation.toFixed(3); var hackDiv = document.getElementById("faction-hack-div"); var fieldWorkDiv = document.getElementById("faction-fieldwork-div"); @@ -649,6 +649,9 @@ displayFactionAugmentations = function(factionName) { var faction = Factions[factionName]; var augmentationsList = document.getElementById("faction-augmentations-list"); + while (augmentationsList.firstChild) { + augmentationsList.removeChild(augmentationsList.firstChild); + } for (var i = 0; i < faction.augmentations.length; ++i) { var aug = Augmentations[faction.augmentations[i]]; @@ -660,13 +663,14 @@ displayFactionAugmentations = function(factionName) { if (faction.playerReputation >= (aug.baseRepRequirement * faction.augmentationRepRequirementMult)) { aElem.setAttribute("class", "a-link-button"); pElem.innerHTML = "UNLOCKED"; - //Might need to set color? Should be the green by default though... //TODO Event listener for button to purchase augmentation } else { aElem.setAttribute("class", "a-link-button-inactive"); pElem.innerHTML = "LOCKED"; - pElem.style.color = red; + pElem.style.color = "red"; } + aElem.style.display = "inline-block"; + pElem.style.display = "inline-block"; aElem.innerHTML = aug.name; span.appendChild(aElem); diff --git a/src/Player.js b/src/Player.js index 0e7a17206..d46339b18 100644 --- a/src/Player.js +++ b/src/Player.js @@ -125,6 +125,7 @@ function PlayerObject() { this.createProgramName = ""; this.timeWorked = 0; //in ms + this.timeNeededToCompleteWork = 0; this.work_money_mult = 1; @@ -368,6 +369,7 @@ PlayerObject.prototype.startWork = function() { this.workMoneyGained = 0; this.timeWorked = 0; + this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer8Hours; var cancelButton = document.getElementById("work-in-progress-cancel-button"); @@ -400,7 +402,7 @@ PlayerObject.prototype.work = function(numCycles) { //If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money if (this.timeWorked >= CONSTANTS.MillisecondsPer8Hours) { - var maxCycles = CONSTANTS.GameCyclesPer8Hours; //Number of cycles in 8 hours + var maxCycles = CONSTANTS.GameCyclesPer8Hours; this.workHackExpGained = this.workHackExpGainRate * maxCycles; this.workStrExpGained = this.workStrExpGainRate * maxCycles; this.workDefExpGained = this.workDefExpGainRate * maxCycles; @@ -483,6 +485,7 @@ PlayerObject.prototype.startFactionWork = function(faction) { this.workMoneyGained = 0; this.timeWorked = 0; + this.timeNeededToCompleteWork = CONSTANTS.MillisecondsPer20Hours; var cancelButton = document.getElementById("work-in-progress-cancel-button"); @@ -562,7 +565,7 @@ PlayerObject.prototype.workForFaction = function(numCycles) { //If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours if (this.timeWorked >= CONSTANTS.MillisecondsPer20Hours) { - var maxCycles = CONSTANTS.GameCyclesPer20Hours; //Number of cycles in 20 hours + var maxCycles = CONSTANTS.GameCyclesPer20Hours; this.workHackExpGained = this.workHackExpGainRate * maxCycles; this.workStrExpGained = this.workStrExpGainRate * maxCycles; this.workDefExpGained = this.workDefExpGainRate * maxCycles; @@ -579,7 +582,7 @@ PlayerObject.prototype.workForFaction = function(numCycles) { "You have been doing this for " + convertTimeMsToTimeElapsedString(this.timeWorked) + "