mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
UI Improvements. Added two new Netscript functions to purchase Hacknet Nodes
This commit is contained in:
+13
-1
@@ -415,9 +415,11 @@ updateHacknetNodeDomElement = function(nodeObj) {
|
||||
}
|
||||
|
||||
processAllHacknetNodeEarnings = function(numCycles) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < Player.hacknetNodes.length; ++i) {
|
||||
processSingleHacknetNodeEarnings(numCycles, Player.hacknetNodes[i]);
|
||||
total += processSingleHacknetNodeEarnings(numCycles, Player.hacknetNodes[i]);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
processSingleHacknetNodeEarnings = function(numCycles, nodeObj) {
|
||||
@@ -428,4 +430,14 @@ processSingleHacknetNodeEarnings = function(numCycles, nodeObj) {
|
||||
nodeObj.totalMoneyGenerated += totalEarnings;
|
||||
nodeObj.onlineTimeSeconds += (numCycles * (Engine._idleSpeed / 1000));
|
||||
Player.gainMoney(totalEarnings);
|
||||
return totalEarnings;
|
||||
}
|
||||
|
||||
getHacknetNode = function(name) {
|
||||
for (var i = 0; i < Player.hacknetNodes.length; ++i) {
|
||||
if (Player.hacknetNodes[i].name == name) {
|
||||
return player.hacknetNodes[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user