mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user