Move getOwnedSourceFiles to NetscriptFunctions

This commit is contained in:
theit8514 2021-12-02 12:17:33 -05:00
parent 9b009b980c
commit cb1aa452a1
4 changed files with 22 additions and 28 deletions

2
dist/bitburner.d.ts vendored

@ -4085,8 +4085,6 @@ export declare interface Singularity {
* @remarks * @remarks
* RAM cost: 5 GB * RAM cost: 5 GB
* *
* Singularity - Level 3
*
* Returns an array of source files * Returns an array of source files
* *
* @returns Array containing an object with number and level of the source file. * @returns Array containing an object with number and level of the source file.

@ -2150,7 +2150,17 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
updateDynamicRam("getFavorToDonate", getRamCost("getFavorToDonate")); updateDynamicRam("getFavorToDonate", getRamCost("getFavorToDonate"));
return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction); return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);
}, },
getOwnedSourceFiles: function (): any {
helper.updateDynamicRam("getOwnedSourceFiles", getRamCost("getOwnedSourceFiles"));
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;
},
getPlayer: function (): INetscriptPlayer { getPlayer: function (): INetscriptPlayer {
helper.updateDynamicRam("getPlayer", getRamCost("getPlayer")); helper.updateDynamicRam("getPlayer", getRamCost("getPlayer"));

@ -105,18 +105,6 @@ export function NetscriptSingularity(
} }
return res; 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 { getAugmentationsFromFaction: function (facname: any): any {
helper.updateDynamicRam("getAugmentationsFromFaction", getRamCost("getAugmentationsFromFaction")); helper.updateDynamicRam("getAugmentationsFromFaction", getRamCost("getAugmentationsFromFaction"));
helper.checkSingularityAccess("getAugmentationsFromFaction", 3); helper.checkSingularityAccess("getAugmentationsFromFaction", 3);

@ -1747,19 +1747,6 @@ export interface Singularity {
*/ */
getOwnedAugmentations(purchased?: boolean): string[]; 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. * Get a list of augmentation available from a faction.
* @remarks * @remarks
@ -4978,6 +4965,17 @@ export interface NS extends Singularity {
*/ */
getBitNodeMultipliers(): BitNodeMultipliers; 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. * Get information about the player.
* @returns Player info * @returns Player info