From 04f8653ef51b9bc7748a28095e53a7203171c87d Mon Sep 17 00:00:00 2001 From: CatLover <152669316+catloversg@users.noreply.github.com> Date: Mon, 16 Dec 2024 22:37:18 +0700 Subject: [PATCH] DOCUMENTATION: Clarify getGraftableAugmentations API --- ...bitburner.grafting.getgraftableaugmentations.md | 10 +++++++--- markdown/bitburner.grafting.md | 2 +- src/NetscriptFunctions/Grafting.ts | 3 +-- src/ScriptEditor/NetscriptDefinitions.d.ts | 14 ++++++++++---- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/markdown/bitburner.grafting.getgraftableaugmentations.md b/markdown/bitburner.grafting.getgraftableaugmentations.md index b11713f133..d29e71f9bb 100644 --- a/markdown/bitburner.grafting.getgraftableaugmentations.md +++ b/markdown/bitburner.grafting.getgraftableaugmentations.md @@ -4,7 +4,7 @@ ## Grafting.getGraftableAugmentations() method -Retrieves a list of Augmentations that can be grafted. +Retrieves a list of augmentations that can be grafted. **Signature:** @@ -15,11 +15,15 @@ getGraftableAugmentations(): string[]; string\[\] -An array of graftable Augmentations. +An array of graftable augmentations. ## Remarks RAM cost: 5 GB -Note that this function returns a list of currently graftable Augmentations, based off of the Augmentations that you already own. +Note: + +- This function returns a list of currently graftable augmentations, based on the augmentations that you already own. + +- This function does not check your current money and prerequisite augmentations. For example, it returns "Augmented Targeting II" even when you don't have enough money to graft that augmentation or don't have the prerequisite augmentation ("Augmented Targeting I"). diff --git a/markdown/bitburner.grafting.md b/markdown/bitburner.grafting.md index 5761c52282..7f04703632 100644 --- a/markdown/bitburner.grafting.md +++ b/markdown/bitburner.grafting.md @@ -22,7 +22,7 @@ This API requires Source-File 10 to use. | --- | --- | | [getAugmentationGraftPrice(augName)](./bitburner.grafting.getaugmentationgraftprice.md) | Retrieve the grafting cost of an aug. | | [getAugmentationGraftTime(augName)](./bitburner.grafting.getaugmentationgrafttime.md) | Retrieves the time required to graft an aug. Do not use this value to determine when the ongoing grafting finishes. The ongoing grafting is affected by current intelligence level and focus bonus. You should use [waitForOngoingGrafting](./bitburner.grafting.waitforongoinggrafting.md) for that purpose. | -| [getGraftableAugmentations()](./bitburner.grafting.getgraftableaugmentations.md) | Retrieves a list of Augmentations that can be grafted. | +| [getGraftableAugmentations()](./bitburner.grafting.getgraftableaugmentations.md) | Retrieves a list of augmentations that can be grafted. | | [graftAugmentation(augName, focus)](./bitburner.grafting.graftaugmentation.md) | Begins grafting the named aug. You must be in New Tokyo to use this. When you call this API, the current work (grafting or other actions) will be canceled. | | [waitForOngoingGrafting()](./bitburner.grafting.waitforongoinggrafting.md) | Wait until the ongoing grafting finishes or is canceled. | diff --git a/src/NetscriptFunctions/Grafting.ts b/src/NetscriptFunctions/Grafting.ts index 616691bbba..6390225703 100644 --- a/src/NetscriptFunctions/Grafting.ts +++ b/src/NetscriptFunctions/Grafting.ts @@ -48,8 +48,7 @@ export function NetscriptGrafting(): InternalAPI { getGraftableAugmentations: (ctx) => () => { checkGraftingAPIAccess(ctx); - const graftableAugs = getGraftingAvailableAugs(); - return graftableAugs; + return getGraftingAvailableAugs(); }, graftAugmentation: diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 29d370a4da..0e80d8a302 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -5005,15 +5005,21 @@ export interface Grafting { getAugmentationGraftTime(augName: string): number; /** - * Retrieves a list of Augmentations that can be grafted. + * Retrieves a list of augmentations that can be grafted. * * @remarks * RAM cost: 5 GB * - * Note that this function returns a list of currently graftable Augmentations, - * based off of the Augmentations that you already own. + * Note: + * + * - This function returns a list of currently graftable augmentations, based on the augmentations that you already + * own. + * + * - This function does not check your current money and prerequisite augmentations. For example, it returns + * "Augmented Targeting II" even when you don't have enough money to graft that augmentation or don't have the + * prerequisite augmentation ("Augmented Targeting I"). * - * @returns An array of graftable Augmentations. + * @returns An array of graftable augmentations. */ getGraftableAugmentations(): string[];