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
+4 -1
View File
@@ -226,15 +226,18 @@ function evaluate(exp, workerScript) {
if (moneyGained <= 0) {moneyGained = 0;}
server.moneyAvailable -= moneyGained;
Player.money += moneyGained;
Player.gainMoney(moneyGained);
workerScript.scriptRef.onlineMoneyMade += moneyGained;
Player.hacking_exp += expGainedOnSuccess;
workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;
console.log("Script successfully hacked " + server.hostname + " for $" + moneyGained + " and " + expGainedOnSuccess + " exp");
resolve("Hack success");
} else {
//Player only gains 25% exp for failure? TODO Can change this later to balance
Player.hacking_exp += expGainedOnFailure;
workerScript.scriptRef.onlineExpGained += expGainedOnFailure;
console.log("Script unsuccessful to hack " + server.hostname + ". Gained " + expGainedOnFailure + "exp");
resolve("Hack failure");
}