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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 0 deletions

@ -0,0 +1,32 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [getAugmentationFactions](./bitburner.singularity.getaugmentationfactions.md)
## Singularity.getAugmentationFactions() method
Get a list of faction(s) that have a specific Augmentation.
**Signature:**
```typescript
getAugmentationFactions(augName: string): string[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| augName | string | Name of Augmentation. |
**Returns:**
string\[\]
Array containing the names of all factions.
## Remarks
RAM cost: 5 GB \* 16/4/1
Returns an array containing the names (as strings) of all factions that offer the specified Augmentation. If no factions offer the Augmentation, a blank array is returned.

@ -31,6 +31,7 @@ This API requires Source-File 4 to use. The RAM cost of all these functions is m
| [exportGame()](./bitburner.singularity.exportgame.md) | Backup game save. |
| [exportGameBonus()](./bitburner.singularity.exportgamebonus.md) | Returns Backup save bonus availability. |
| [getAugmentationBasePrice(augName)](./bitburner.singularity.getaugmentationbaseprice.md) | Get base price of an augmentation. |
| [getAugmentationFactions(augName)](./bitburner.singularity.getaugmentationfactions.md) | Get a list of faction(s) that have a specific Augmentation. |
| [getAugmentationPrereq(augName)](./bitburner.singularity.getaugmentationprereq.md) | Get the pre-requisite of an augmentation. |
| [getAugmentationPrice(augName)](./bitburner.singularity.getaugmentationprice.md) | Get price of an augmentation. |
| [getAugmentationRepReq(augName)](./bitburner.singularity.getaugmentationrepreq.md) | Get reputation requirement of an augmentation. |

@ -189,6 +189,7 @@ const singularity = {
getCrimeStats: SF4Cost(RamCostConstants.SingularityFn3),
getOwnedAugmentations: SF4Cost(RamCostConstants.SingularityFn3),
getOwnedSourceFiles: SF4Cost(RamCostConstants.SingularityFn3),
getAugmentationFactions: SF4Cost(RamCostConstants.SingularityFn3),
getAugmentationsFromFaction: SF4Cost(RamCostConstants.SingularityFn3),
getAugmentationPrereq: SF4Cost(RamCostConstants.SingularityFn3),
getAugmentationPrice: SF4Cost(RamCostConstants.SingularityFn3 / 2),

@ -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);

@ -2103,6 +2103,21 @@ export interface Singularity {
*/
getOwnedSourceFiles(): SourceFileLvl[];
/**
* Get a list of faction(s) that have a specific Augmentation.
* @remarks
* RAM cost: 5 GB * 16/4/1
*
*
* Returns an array containing the names (as strings) of all factions
* that offer the specified Augmentation.
* If no factions offer the Augmentation, a blank array is returned.
*
* @param augName - Name of Augmentation.
* @returns Array containing the names of all factions.
*/
getAugmentationFactions(augName: string): string[];
/**
* Get a list of augmentation available from a faction.
* @remarks