Can now do things such as ctrl+c in Terminal without it auto focusing on the input. Implemented offline exp gain

This commit is contained in:
Daniel Xie
2016-12-19 14:59:13 -06:00
parent 962b057ff8
commit e2316e4a1d
7 changed files with 106 additions and 86 deletions
+9
View File
@@ -69,6 +69,9 @@ function PlayerObject() {
//Flag to let the engine know the player is starting a hack
this.startAction = false;
this.actionTime = 0;
//Used to store the last update time.
this.lastUpdate = new Date().getTime();
};
PlayerObject.prototype.init = function() {
@@ -167,6 +170,12 @@ PlayerObject.prototype.analyze = function() {
this.startAction = true;
}
PlayerObject.prototype.gainMoney = function(money) {
this.money += money;
this.total_money += money;
this.lifetime_money += money;
}
//Functions for saving and loading the Player data
PlayerObject.prototype.toJSON = function() {
return Generic_toJSON("PlayerObject", this);