From 4b96bca03f3bfc19bf98492d1a6c6159bf1cb901 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Sat, 17 Jun 2017 12:47:04 -0500 Subject: [PATCH] Added playtime since last augmentation. Fixed bug with Fulcrum faction display page --- src/Faction.js | 5 +++++ src/Player.js | 1 + src/SaveObject.js | 2 ++ src/engine.js | 5 +++++ 4 files changed, 13 insertions(+) diff --git a/src/Faction.js b/src/Faction.js index b7688bd8d..c7cbbafdb 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -688,6 +688,11 @@ displayFactionContent = function(factionName) { fieldWorkDiv.style.display = "inline"; securityWorkDiv.style.display = "inline"; break; + case "Fulcrum Secret Technologies": + hackDiv.style.display = "inline"; + fieldWorkDiv.style.display = "none"; + securityWorkDiv.style.display = "inline"; + break; case "BitRunners": hackDiv.style.display = "inline"; fieldWorkDiv.style.display = "none"; diff --git a/src/Player.js b/src/Player.js index 97a7eb545..407daa5ef 100644 --- a/src/Player.js +++ b/src/Player.js @@ -171,6 +171,7 @@ function PlayerObject() { //Used to store the last update time. this.lastUpdate = 0; this.totalPlaytime = 0; + this.playtimeSinceLastAug = 0; }; PlayerObject.prototype.init = function() { diff --git a/src/SaveObject.js b/src/SaveObject.js index ef666c865..9f094e233 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -221,7 +221,9 @@ loadImportedGame = function(saveObj, saveString) { //Update total playtime var time = numCyclesOffline * Engine._idleSpeed; if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;} + if (Player.playtimeSinceLastAug == null) {Player.playtimeSinceLastAug = 0;} Player.totalPlaytime += time; + Player.playtimeSinceLastAug += time; //Re-apply augmentations Player.reapplyAllAugmentations(); diff --git a/src/engine.js b/src/engine.js index 0de7031fe..5e9d5e323 100644 --- a/src/engine.js +++ b/src/engine.js @@ -289,6 +289,7 @@ var Engine = { 'Misc

' + 'Servers owned: ' + Player.purchasedServers.length + '
' + 'Hacknet Nodes owned: ' + Player.hacknetNodes.length + '
' + + 'Time played since last Augmentation: ' + convertTimeMsToTimeElapsedString(Player.playtimeSinceLastAug) + '
' + 'Time played: ' + convertTimeMsToTimeElapsedString(Player.totalPlaytime) + '


').replace( / /g, " " ); }, @@ -454,7 +455,9 @@ var Engine = { //Update total playtime var time = numCycles * Engine._idleSpeed; if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;} + if (Player.playtimeSinceLastAug == null) {Player.playtimeSinceLastAug = 0;} Player.totalPlaytime += time; + Player.playtimeSinceLastAug += time; //Start Manual hack if (Player.startAction == true) { @@ -679,7 +682,9 @@ var Engine = { //Update total playtime var time = numCyclesOffline * Engine._idleSpeed; if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;} + if (Player.playtimeSinceLastAug == null) {Player.playtimeSinceLastAug = 0;} Player.totalPlaytime += time; + Player.playtimeSinceLastAug += time; //Re-apply augmentations Player.reapplyAllAugmentations();