diff --git a/dist/bitburner.d.ts b/dist/bitburner.d.ts index a0e9948e8..703118331 100644 --- a/dist/bitburner.d.ts +++ b/dist/bitburner.d.ts @@ -4085,8 +4085,6 @@ export declare interface Singularity { * @remarks * RAM cost: 5 GB * - * Singularity - Level 3 - * * Returns an array of source files * * @returns Array containing an object with number and level of the source file. diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index f90cbc7ca..bc108d71e 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -63,7 +63,7 @@ import { NetscriptGang } from "./NetscriptFunctions/Gang"; import { NetscriptSleeve } from "./NetscriptFunctions/Sleeve"; import { NetscriptExtra } from "./NetscriptFunctions/Extra"; import { NetscriptHacknet } from "./NetscriptFunctions/Hacknet"; -import { NS as INS, Player as INetscriptPlayer } from "./ScriptEditor/NetscriptDefinitions"; +import { NS as INS, Player as INetscriptPlayer, SourceFileLvl } from "./ScriptEditor/NetscriptDefinitions"; import { NetscriptBladeburner } from "./NetscriptFunctions/Bladeburner"; import { NetscriptCodingContract } from "./NetscriptFunctions/CodingContract"; import { NetscriptCorporation } from "./NetscriptFunctions/Corporation"; @@ -2150,7 +2150,17 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { updateDynamicRam("getFavorToDonate", getRamCost("getFavorToDonate")); return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction); }, - + getOwnedSourceFiles: function (): SourceFileLvl[] { + helper.updateDynamicRam("getOwnedSourceFiles", getRamCost("getOwnedSourceFiles")); + const res: SourceFileLvl[] = []; + for (let i = 0; i < Player.sourceFiles.length; ++i) { + res.push({ + n: Player.sourceFiles[i].n, + lvl: Player.sourceFiles[i].lvl, + } as SourceFileLvl); + } + return res; + }, getPlayer: function (): INetscriptPlayer { helper.updateDynamicRam("getPlayer", getRamCost("getPlayer")); diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index 72b642126..270553867 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -105,18 +105,6 @@ export function NetscriptSingularity( } return res; }, - getOwnedSourceFiles: function (): any { - helper.updateDynamicRam("getOwnedSourceFiles", getRamCost("getOwnedSourceFiles")); - helper.checkSingularityAccess("getOwnedSourceFiles", 3); - const res = []; - for (let i = 0; i < player.sourceFiles.length; ++i) { - res.push({ - n: player.sourceFiles[i].n, - lvl: player.sourceFiles[i].lvl, - }); - } - return res; - }, getAugmentationsFromFaction: function (facname: any): any { helper.updateDynamicRam("getAugmentationsFromFaction", getRamCost("getAugmentationsFromFaction")); helper.checkSingularityAccess("getAugmentationsFromFaction", 3); diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 2cf2b6233..0ebec0244 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -1747,19 +1747,6 @@ export interface Singularity { */ getOwnedAugmentations(purchased?: boolean): string[]; - /** - * Get a list of acquired Source-Files. - * @remarks - * RAM cost: 5 GB - * - * Singularity - Level 3 - * - * Returns an array of source files - * - * @returns Array containing an object with number and level of the source file. - */ - getOwnedSourceFiles(): SourceFileLvl[]; - /** * Get a list of augmentation available from a faction. * @remarks @@ -4978,6 +4965,17 @@ export interface NS extends Singularity { */ getBitNodeMultipliers(): BitNodeMultipliers; + /** + * Get a list of acquired Source-Files. + * @remarks + * RAM cost: 5 GB + * + * Returns an array of source files + * + * @returns Array containing an object with number and level of the source file. + */ + getOwnedSourceFiles(): SourceFileLvl[]; + /** * Get information about the player. * @returns Player info