SINGULARITY: Adding getUnlockedAchievements function (#2156)

This commit is contained in:
Chris Farfan de los Godos
2025-05-24 23:47:34 +03:00
committed by GitHub
parent eaf4014516
commit 552d13ad6d
5 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<!-- 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; [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

View File

@@ -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. |

View File

@@ -222,6 +222,7 @@ const singularity = {
b1tflum3: SF4Cost(16),
destroyW0r1dD43m0n: SF4Cost(32),
getCurrentWork: SF4Cost(0.5),
getUnlockedAchievements: SF4Cost(RamCostConstants.SingularityFn3),
} as const;
const format = {

View File

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

View File

@@ -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[];
}
/**