mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-23 16:13:49 +01:00
commit
0cf1c86d3e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -4610,19 +4610,19 @@ function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
...extra,
|
...extra,
|
||||||
};
|
};
|
||||||
|
|
||||||
function getFunctionNames(obj: NS): string[] {
|
function getFunctionNames(obj: NS, prefix: string): string[] {
|
||||||
const functionNames: string[] = [];
|
const functionNames: string[] = [];
|
||||||
for (const [key, value] of Object.entries(obj)) {
|
for (const [key, value] of Object.entries(obj)) {
|
||||||
if (typeof value == "function") {
|
if (typeof value == "function") {
|
||||||
functionNames.push(key);
|
functionNames.push(prefix + key);
|
||||||
} else if (typeof value == "object") {
|
} else if (typeof value == "object") {
|
||||||
functionNames.push(...getFunctionNames(value));
|
functionNames.push(...getFunctionNames(value, key + "."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return functionNames;
|
return functionNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
const possibleLogs = Object.fromEntries([...getFunctionNames(functions)].map((a) => [a, true]));
|
const possibleLogs = Object.fromEntries([...getFunctionNames(functions, "")].map((a) => [a, true]));
|
||||||
|
|
||||||
return functions;
|
return functions;
|
||||||
} // End NetscriptFunction()
|
} // End NetscriptFunction()
|
||||||
|
@ -453,6 +453,8 @@ export function gainIntelligenceExp(this: IPlayer, exp: number): void {
|
|||||||
if (SourceFileFlags[5] > 0 || this.intelligence > 0) {
|
if (SourceFileFlags[5] > 0 || this.intelligence > 0) {
|
||||||
this.intelligence_exp += exp;
|
this.intelligence_exp += exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Given a string expression like "str" or "strength", returns the given stat
|
//Given a string expression like "str" or "strength", returns the given stat
|
||||||
|
Loading…
Reference in New Issue
Block a user