NETSCRIPT: added ns.singularity.getAugmentationFactions (#706)

This commit is contained in:
myCatsName
2023-08-05 22:04:36 -06:00
committed by GitHub
parent 9e55d00b4f
commit aed01b0979
5 changed files with 55 additions and 0 deletions
+6
View File
@@ -95,6 +95,12 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
getOwnedSourceFiles: () => () => {
return [...Player.sourceFiles].map(([n, lvl]) => ({ n, lvl }));
},
getAugmentationFactions: (ctx) => (_augName) => {
helpers.checkSingularityAccess(ctx);
const augName = getEnumHelper("AugmentationName").nsGetMember(ctx, _augName);
const aug = Augmentations[augName];
return aug.factions.slice();
},
getAugmentationsFromFaction: (ctx) => (_facName) => {
helpers.checkSingularityAccess(ctx);
const facName = getEnumHelper("FactionName").nsGetMember(ctx, _facName);