Gang-rework bugfixes and rebalancing. Started adding Gang API

This commit is contained in:
danielyxie
2018-10-19 19:30:02 -05:00
parent a0ebcff0aa
commit e73ebe843f
7 changed files with 471 additions and 103 deletions
+4 -1
View File
@@ -219,7 +219,8 @@ function scriptEditorInit() {
});
//Get functions from namespaces
if (name === "bladeburner" || name === "hacknet") {
const namespaces = ["bladeburner", "hacknet", "codingcontract", "gang"];
if (namespaces.includes(name)) {
let namespace = fns[name];
if (typeof namespace !== "object") {continue;}
let namespaceFns = Object.keys(namespace);
@@ -557,6 +558,8 @@ async function parseOnlyRamCalculate(server, code, workerScript) {
func = workerScript.env.vars.bladeburner[ref];
} else if (ref in workerScript.env.vars.codingcontract) {
func = workerScript.env.vars.codingcontract[ref];
} else if (ref in workerScript.env.vars.gang) {
func = workerScript.env.vars.gang[ref];
} else {
func = workerScript.env.get(ref);
}