mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
SINGULARITY: Adding getUnlockedAchievements function (#2156)
This commit is contained in:
committed by
GitHub
parent
eaf4014516
commit
552d13ad6d
23
markdown/bitburner.singularity.getunlockedachievements.md
Normal file
23
markdown/bitburner.singularity.getunlockedachievements.md
Normal file
@@ -0,0 +1,23 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Singularity](./bitburner.singularity.md) > [getUnlockedAchievements](./bitburner.singularity.getunlockedachievements.md)
|
||||
|
||||
## Singularity.getUnlockedAchievements() method
|
||||
|
||||
Get a list of all unlocked achievements.
|
||||
|
||||
**Signature:**
|
||||
|
||||
```typescript
|
||||
getUnlockedAchievements(): string[];
|
||||
```
|
||||
**Returns:**
|
||||
|
||||
string\[\]
|
||||
|
||||
- A list containing all of the IDs of achievements that the player has unlocked.
|
||||
|
||||
## Remarks
|
||||
|
||||
Ram cost: 5 GB \* 16/4/1
|
||||
|
||||
@@ -58,6 +58,7 @@ This API requires Source-File 4 to use. The RAM cost of all these functions is m
|
||||
| [getOwnedAugmentations(purchased)](./bitburner.singularity.getownedaugmentations.md) | Get a list of owned augmentation. |
|
||||
| [getOwnedSourceFiles()](./bitburner.singularity.getownedsourcefiles.md) | Get a list of acquired Source-Files. |
|
||||
| [getSaveData()](./bitburner.singularity.getsavedata.md) | This function returns the save data. |
|
||||
| [getUnlockedAchievements()](./bitburner.singularity.getunlockedachievements.md) | Get a list of all unlocked achievements. |
|
||||
| [getUpgradeHomeCoresCost()](./bitburner.singularity.getupgradehomecorescost.md) | Get the price of upgrading home cores. |
|
||||
| [getUpgradeHomeRamCost()](./bitburner.singularity.getupgradehomeramcost.md) | Get the price of upgrading home RAM. |
|
||||
| [goToLocation(locationName)](./bitburner.singularity.gotolocation.md) | Go to a location. |
|
||||
|
||||
@@ -222,6 +222,7 @@ const singularity = {
|
||||
b1tflum3: SF4Cost(16),
|
||||
destroyW0r1dD43m0n: SF4Cost(32),
|
||||
getCurrentWork: SF4Cost(0.5),
|
||||
getUnlockedAchievements: SF4Cost(RamCostConstants.SingularityFn3),
|
||||
} as const;
|
||||
|
||||
const format = {
|
||||
|
||||
@@ -1186,6 +1186,10 @@ export function NetscriptSingularity(): InternalAPI<ISingularity> {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
return canGetBonus();
|
||||
},
|
||||
getUnlockedAchievements: (ctx) => () => {
|
||||
helpers.checkSingularityAccess(ctx);
|
||||
return Object.values(Player.achievements).map((a) => a.ID);
|
||||
},
|
||||
};
|
||||
|
||||
// Removed functions
|
||||
|
||||
9
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
9
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -2805,6 +2805,15 @@ export interface Singularity {
|
||||
* @returns - An object representing the current work. Fields depend on the kind of work.
|
||||
*/
|
||||
getCurrentWork(): Task | null;
|
||||
|
||||
/**
|
||||
* Get a list of all unlocked achievements.
|
||||
* @remarks
|
||||
* Ram cost: 5 GB * 16/4/1
|
||||
*
|
||||
* @returns - A list containing all of the IDs of achievements that the player has unlocked.
|
||||
*/
|
||||
getUnlockedAchievements(): string[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user