Added playtime since last augmentation. Fixed bug with Fulcrum faction display page

This commit is contained in:
Daniel Xie 2017-06-17 12:47:04 -05:00
parent 316aa8ad2d
commit 4b96bca03f
4 changed files with 13 additions and 0 deletions

@ -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";

@ -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() {

@ -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();

@ -289,6 +289,7 @@ var Engine = {
'<b>Misc</b><br><br>' +
'Servers owned: ' + Player.purchasedServers.length + '<br>' +
'Hacknet Nodes owned: ' + Player.hacknetNodes.length + '<br>' +
'Time played since last Augmentation: ' + convertTimeMsToTimeElapsedString(Player.playtimeSinceLastAug) + '<br>' +
'Time played: ' + convertTimeMsToTimeElapsedString(Player.totalPlaytime) + '<br><br><br>').replace( / /g, "&nbsp;" );
},
@ -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();