mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +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,
|
||||
};
|
||||
|
||||
function getFunctionNames(obj: NS): string[] {
|
||||
function getFunctionNames(obj: NS, prefix: string): string[] {
|
||||
const functionNames: string[] = [];
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (typeof value == "function") {
|
||||
functionNames.push(key);
|
||||
functionNames.push(prefix + key);
|
||||
} else if (typeof value == "object") {
|
||||
functionNames.push(...getFunctionNames(value));
|
||||
functionNames.push(...getFunctionNames(value, key + "."));
|
||||
}
|
||||
}
|
||||
return functionNames;
|
||||
}
|
||||
|
||||
const possibleLogs = Object.fromEntries([...getFunctionNames(functions)].map((a) => [a, true]));
|
||||
const possibleLogs = Object.fromEntries([...getFunctionNames(functions, "")].map((a) => [a, true]));
|
||||
|
||||
return functions;
|
||||
} // End NetscriptFunction()
|
||||
|
@ -453,6 +453,8 @@ export function gainIntelligenceExp(this: IPlayer, exp: number): void {
|
||||
if (SourceFileFlags[5] > 0 || this.intelligence > 0) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user