mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
NETSCRIPT: added ns.singularity.getAugmentationFactions (#706)
This commit is contained in:
parent
9e55d00b4f
commit
aed01b0979
32
markdown/bitburner.singularity.getaugmentationfactions.md
Normal file
32
markdown/bitburner.singularity.getaugmentationfactions.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Singularity](./bitburner.singularity.md) > [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. |
|
| [exportGame()](./bitburner.singularity.exportgame.md) | Backup game save. |
|
||||||
| [exportGameBonus()](./bitburner.singularity.exportgamebonus.md) | Returns Backup save bonus availability. |
|
| [exportGameBonus()](./bitburner.singularity.exportgamebonus.md) | Returns Backup save bonus availability. |
|
||||||
| [getAugmentationBasePrice(augName)](./bitburner.singularity.getaugmentationbaseprice.md) | Get base price of an augmentation. |
|
| [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. |
|
| [getAugmentationPrereq(augName)](./bitburner.singularity.getaugmentationprereq.md) | Get the pre-requisite of an augmentation. |
|
||||||
| [getAugmentationPrice(augName)](./bitburner.singularity.getaugmentationprice.md) | Get price 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. |
|
| [getAugmentationRepReq(augName)](./bitburner.singularity.getaugmentationrepreq.md) | Get reputation requirement of an augmentation. |
|
||||||
|
@ -189,6 +189,7 @@ const singularity = {
|
|||||||
getCrimeStats: SF4Cost(RamCostConstants.SingularityFn3),
|
getCrimeStats: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
getOwnedAugmentations: SF4Cost(RamCostConstants.SingularityFn3),
|
getOwnedAugmentations: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
getOwnedSourceFiles: SF4Cost(RamCostConstants.SingularityFn3),
|
getOwnedSourceFiles: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
|
getAugmentationFactions: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
getAugmentationsFromFaction: SF4Cost(RamCostConstants.SingularityFn3),
|
getAugmentationsFromFaction: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
getAugmentationPrereq: SF4Cost(RamCostConstants.SingularityFn3),
|
getAugmentationPrereq: SF4Cost(RamCostConstants.SingularityFn3),
|
||||||
getAugmentationPrice: SF4Cost(RamCostConstants.SingularityFn3 / 2),
|
getAugmentationPrice: SF4Cost(RamCostConstants.SingularityFn3 / 2),
|
||||||
|
@ -95,6 +95,12 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
|||||||
getOwnedSourceFiles: () => () => {
|
getOwnedSourceFiles: () => () => {
|
||||||
return [...Player.sourceFiles].map(([n, lvl]) => ({ n, lvl }));
|
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) => {
|
getAugmentationsFromFaction: (ctx) => (_facName) => {
|
||||||
helpers.checkSingularityAccess(ctx);
|
helpers.checkSingularityAccess(ctx);
|
||||||
const facName = getEnumHelper("FactionName").nsGetMember(ctx, _facName);
|
const facName = getEnumHelper("FactionName").nsGetMember(ctx, _facName);
|
||||||
|
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -2103,6 +2103,21 @@ export interface Singularity {
|
|||||||
*/
|
*/
|
||||||
getOwnedSourceFiles(): SourceFileLvl[];
|
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.
|
* Get a list of augmentation available from a faction.
|
||||||
* @remarks
|
* @remarks
|
||||||
|
Loading…
Reference in New Issue
Block a user