Initial v0.46.0 changes - Fixed BN9 bugs. Rebalanced BN11 and Corporations. Added memory to Dup sleeves. Various bug fixes

This commit is contained in:
danielyxie
2019-03-27 01:36:14 -07:00
parent 83fc4d81b2
commit c4cb7daac5
38 changed files with 579 additions and 209 deletions
+7 -15
View File
@@ -19,7 +19,8 @@ import { generateRandomContractOnHome } from "../CodingContractGenerator
import { iTutorialSteps, iTutorialNextStep,
ITutorial} from "../InteractiveTutorial";
import { Player } from "../Player";
import { AddToAllServers } from "../Server/AllServers";
import { AddToAllServers,
AllServers } from "../Server/AllServers";
import { GetServerByHostname } from "../Server/ServerHelpers";
import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
import { Page, routing } from "../ui/navigationTracking";
@@ -33,9 +34,10 @@ import { HacknetRoot } from "./ui/Root";
let hacknetNodesDiv;
function hacknetNodesInit() {
hacknetNodesDiv = document.getElementById("hacknet-nodes-container");
document.removeEventListener("DOMContentLoaded", hacknetNodesInit);
}
document.addEventListener("DOMContentLoaded", hacknetNodesInit, false);
document.addEventListener("DOMContentLoaded", hacknetNodesInit);
// Returns a boolean indicating whether the player has Hacknet Servers
// (the upgraded form of Hacknet Nodes)
@@ -73,7 +75,7 @@ export function purchaseHacknet() {
});
Player.loseMoney(cost);
Player.hacknetNodes.push(server);
Player.hacknetNodes.push(server.ip);
// Configure the HacknetServer to actually act as a Server
AddToAllServers(server);
@@ -308,7 +310,8 @@ function processAllHacknetServerEarnings(numCycles) {
let hashes = 0;
for (let i = 0; i < Player.hacknetNodes.length; ++i) {
hashes += Player.hacknetNodes[i].process(numCycles);
const hserver = AllServers[Player.hacknetNodes[i]]; // hacknetNodes array only contains the IP addresses
hashes += hserver.process(numCycles);
}
Player.hashManager.storeHashes(hashes);
@@ -316,16 +319,6 @@ function processAllHacknetServerEarnings(numCycles) {
return hashes;
}
export function getHacknetNode(name) {
for (var i = 0; i < Player.hacknetNodes.length; ++i) {
if (Player.hacknetNodes[i].name == name) {
return Player.hacknetNodes[i];
}
}
return null;
}
export function purchaseHashUpgrade(upgName, upgTarget) {
if (!(Player.hashManager instanceof HashManager)) {
console.error(`Player does not have a HashManager`);
@@ -423,7 +416,6 @@ export function purchaseHashUpgrade(upgName, upgTarget) {
return false;
}
console.log("Hash Upgrade successfully purchased");
return true;
}