From b2093a24198c5f4251d048bf3a56413c83f02f54 Mon Sep 17 00:00:00 2001
From: catloversg <152669316+catloversg@users.noreply.github.com>
Date: Tue, 1 Apr 2025 03:37:35 +0700
Subject: [PATCH] MISC: Clarify conditions of activating Gang, Bladeburner,
Stanek's Gift (#2053)
---
...ner.bladeburner.joinbladeburnerdivision.md | 2 ++
markdown/bitburner.gang.creategang.md | 4 +++-
markdown/bitburner.stanek.acceptgift.md | 2 ++
src/CotMG/Helper.tsx | 19 +++++++++++----
src/Faction/ui/GangButton.tsx | 5 ++--
src/Locations/ui/SpecialLocation.tsx | 2 +-
src/NetscriptFunctions/Bladeburner.ts | 21 ++++++++++++-----
src/NetscriptFunctions/Gang.ts | 23 ++++++++++++++++---
src/NetscriptFunctions/Stanek.ts | 8 +++++--
.../Player/PlayerObjectGangMethods.ts | 17 ++++++++++----
src/ScriptEditor/NetscriptDefinitions.d.ts | 9 ++++++++
11 files changed, 87 insertions(+), 25 deletions(-)
diff --git a/markdown/bitburner.bladeburner.joinbladeburnerdivision.md b/markdown/bitburner.bladeburner.joinbladeburnerdivision.md
index 815522cc8..d850c77f3 100644
--- a/markdown/bitburner.bladeburner.joinbladeburnerdivision.md
+++ b/markdown/bitburner.bladeburner.joinbladeburnerdivision.md
@@ -23,6 +23,8 @@ RAM cost: 4 GB
Attempts to join the Bladeburner division.
+Requirements: All combat stats must be at least level 100.
+
If you have SF 7.3, you will immediately receive "The Blade's Simulacrum" augmentation and won't be able to accept Stanek's Gift after joining. If you want to accept Stanek's Gift, you must do that before calling this API.
Returns true if you successfully join the Bladeburner division, or if you are already a member.
diff --git a/markdown/bitburner.gang.creategang.md b/markdown/bitburner.gang.creategang.md
index 696bbd4d9..84d1701da 100644
--- a/markdown/bitburner.gang.creategang.md
+++ b/markdown/bitburner.gang.creategang.md
@@ -16,7 +16,7 @@ createGang(faction: string): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
-| faction | string | |
+| faction | string | Name of the faction that you want to create a gang with. This faction must allow this action, and you must be its member. |
**Returns:**
@@ -30,3 +30,5 @@ RAM cost: 1GB
Create a gang with the specified faction.
+Outside BitNode 2, your karma must be less than or equal to 54000.
+
diff --git a/markdown/bitburner.stanek.acceptgift.md b/markdown/bitburner.stanek.acceptgift.md
index 833186bf4..710ff1fb0 100644
--- a/markdown/bitburner.stanek.acceptgift.md
+++ b/markdown/bitburner.stanek.acceptgift.md
@@ -21,3 +21,5 @@ true if the player is a member of the church and has the gift installed, false o
RAM cost: 2 GB
+The church only accepts those who have not purchased or installed any augmentations. "NeuroFlux Governor" augmentation is the only exception.
+
diff --git a/src/CotMG/Helper.tsx b/src/CotMG/Helper.tsx
index cd3029947..632324046 100644
--- a/src/CotMG/Helper.tsx
+++ b/src/CotMG/Helper.tsx
@@ -5,6 +5,7 @@ import { Reviver } from "../utils/GenericReviver";
import { BaseGift } from "./BaseGift";
import { StaneksGift } from "./StaneksGift";
+import { Result } from "../types";
export let staneksGift = new StaneksGift();
@@ -52,11 +53,19 @@ export function calculateGrid(gift: BaseGift): number[][] {
return newGrid;
}
-export function canAcceptStaneksGift(): boolean {
- return (
- Player.canAccessCotMG() &&
+export function canAcceptStaneksGift(): Result {
+ if (!Player.canAccessCotMG()) {
+ return { success: false, message: "You do not have Source-File 13." };
+ }
+ if (
[...Player.augmentations, ...Player.queuedAugmentations].filter(
(a) => a.name !== AugmentationName.NeuroFluxGovernor,
- ).length === 0
- );
+ ).length !== 0
+ ) {
+ return {
+ success: false,
+ message: `You already purchased or installed augmentations that are not ${AugmentationName.NeuroFluxGovernor}.`,
+ };
+ }
+ return { success: true };
}
diff --git a/src/Faction/ui/GangButton.tsx b/src/Faction/ui/GangButton.tsx
index bba7bf974..0f08a5df8 100644
--- a/src/Faction/ui/GangButton.tsx
+++ b/src/Faction/ui/GangButton.tsx
@@ -37,10 +37,11 @@ export function GangButton({ faction }: IProps): React.ReactElement {
description: "Manage a gang for this Faction. Gangs will earn you money and faction reputation",
};
} else {
+ const checkResult = Player.canAccessGang();
data = {
- enabled: Player.canAccessGang(),
+ enabled: checkResult.success,
title: "Create Gang",
- tooltip: !Player.canAccessGang() ? (
+ tooltip: !checkResult.success ? (
Unlocked when reaching {GangConstants.GangKarmaRequirement} karma
) : (
""
diff --git a/src/Locations/ui/SpecialLocation.tsx b/src/Locations/ui/SpecialLocation.tsx
index cda69445f..7d37eb6b5 100644
--- a/src/Locations/ui/SpecialLocation.tsx
+++ b/src/Locations/ui/SpecialLocation.tsx
@@ -72,7 +72,7 @@ export function SpecialLocation(props: SpecialLocationProps): React.ReactElement
}
if (
Player.activeSourceFileLvl(7) >= 3 &&
- canAcceptStaneksGift() &&
+ canAcceptStaneksGift().success &&
!Player.hasAugmentation(AugmentationName.StaneksGift1)
) {
PromptEvent.emit({
diff --git a/src/NetscriptFunctions/Bladeburner.ts b/src/NetscriptFunctions/Bladeburner.ts
index 9e56a881c..1a83f7938 100644
--- a/src/NetscriptFunctions/Bladeburner.ts
+++ b/src/NetscriptFunctions/Bladeburner.ts
@@ -308,15 +308,20 @@ export function NetscriptBladeburner(): InternalAPI {
},
joinBladeburnerDivision: (ctx) => () => {
if (!canAccessBitNodeFeature(7) && !canAccessBitNodeFeature(6)) {
- return false; //Does not have bitnode 6 or 7
- } else if (Player.bitNodeOptions.disableBladeburner) {
+ helpers.log(ctx, () => "You do not have Source-File 6 or Source-File 7.");
+ return false;
+ }
+ if (Player.bitNodeOptions.disableBladeburner) {
+ helpers.log(ctx, () => "Bladeburner is disabled by advanced options.");
return false;
}
if (currentNodeMults.BladeburnerRank === 0) {
- return false; // Disabled in this bitnode
+ helpers.log(ctx, () => "Bladeburner is disabled in this BitNode.");
+ return false;
}
+ // Already member
if (Player.bladeburner) {
- return true; // Already member
+ return true;
}
if (
Player.skills.strength < 100 ||
@@ -324,11 +329,15 @@ export function NetscriptBladeburner(): InternalAPI {
Player.skills.dexterity < 100 ||
Player.skills.agility < 100
) {
- helpers.log(ctx, () => "You do not meet the requirements for joining the Bladeburner division");
+ helpers.log(
+ ctx,
+ () =>
+ "You do not meet the requirements for joining the Bladeburner division. All combat stats must be at least level 100.",
+ );
return false;
}
Player.startBladeburner();
- helpers.log(ctx, () => "You have been accepted into the Bladeburner division");
+ helpers.log(ctx, () => "You have been accepted into the Bladeburner division.");
return true;
},
diff --git a/src/NetscriptFunctions/Gang.ts b/src/NetscriptFunctions/Gang.ts
index 646a5a763..dd6d2f677 100644
--- a/src/NetscriptFunctions/Gang.ts
+++ b/src/NetscriptFunctions/Gang.ts
@@ -39,9 +39,26 @@ export function NetscriptGang(): InternalAPI {
return {
createGang: (ctx) => (_faction) => {
const faction = getEnumHelper("FactionName").nsGetMember(ctx, _faction);
- if (!Player.canAccessGang() || !GangConstants.Names.includes(faction)) return false;
- if (Player.gang) return false;
- if (!Player.factions.includes(faction)) return false;
+ if (Player.gang) {
+ return false;
+ }
+ const checkResult = Player.canAccessGang();
+ if (!checkResult.success) {
+ helpers.log(ctx, () => checkResult.message);
+ return false;
+ }
+ if (!GangConstants.Names.includes(faction)) {
+ helpers.log(
+ ctx,
+ () =>
+ `${faction} does not allow creating a gang. You can only do that with ${GangConstants.Names.join(", ")}.`,
+ );
+ return false;
+ }
+ if (!Player.factions.includes(faction)) {
+ helpers.log(ctx, () => `You are not a member of ${faction}.`);
+ return false;
+ }
const isHacking = faction === FactionName.NiteSec || faction === FactionName.TheBlackHand;
Player.startGang(faction, isHacking);
diff --git a/src/NetscriptFunctions/Stanek.ts b/src/NetscriptFunctions/Stanek.ts
index 13867295d..903f65978 100644
--- a/src/NetscriptFunctions/Stanek.ts
+++ b/src/NetscriptFunctions/Stanek.ts
@@ -110,15 +110,19 @@ export function NetscriptStanek(): InternalAPI {
acceptGift: (ctx) => () => {
const cotmgFaction = Factions[FactionName.ChurchOfTheMachineGod];
// Check if the player is eligible to join the church
- if (canAcceptStaneksGift()) {
+ const checkResult = canAcceptStaneksGift();
+ if (checkResult.success) {
// Join the CotMG factionn
joinFaction(cotmgFaction);
// Install the first Stanek aug
applyAugmentation({ name: AugmentationName.StaneksGift1, level: 1 });
helpers.log(
ctx,
- () => `'${FactionName.ChurchOfTheMachineGod}' joined and '${AugmentationName.StaneksGift1}' installed.`,
+ () =>
+ `You joined '${FactionName.ChurchOfTheMachineGod}' and have '${AugmentationName.StaneksGift1}' installed.`,
);
+ } else {
+ helpers.log(ctx, () => checkResult.message);
}
// Return true if the player is in CotMG and has the first Stanek aug installed
return cotmgFaction.isMember && Player.hasAugmentation(AugmentationName.StaneksGift1, true);
diff --git a/src/PersonObjects/Player/PlayerObjectGangMethods.ts b/src/PersonObjects/Player/PlayerObjectGangMethods.ts
index fbfc4e70f..0c02a2981 100644
--- a/src/PersonObjects/Player/PlayerObjectGangMethods.ts
+++ b/src/PersonObjects/Player/PlayerObjectGangMethods.ts
@@ -7,19 +7,26 @@ import { Gang } from "../../Gang/Gang";
import { GangConstants } from "../../Gang/data/Constants";
import { isFactionWork } from "../../Work/FactionWork";
import { canAccessBitNodeFeature } from "../../BitNode/BitNodeUtils";
+import { Result } from "../../types";
-export function canAccessGang(this: PlayerObject): boolean {
+export function canAccessGang(this: PlayerObject): Result {
if (this.bitNodeOptions.disableGang) {
- return false;
+ return { success: false, message: "Gang is disabled by advanced options." };
}
if (this.bitNodeN === 2) {
- return true;
+ return { success: true };
}
if (this.activeSourceFileLvl(2) === 0) {
- return false;
+ return { success: false, message: "You do not have Source-File 2." };
+ }
+ if (this.karma > GangConstants.GangKarmaRequirement) {
+ return {
+ success: false,
+ message: `Your karma must be less than or equal to ${GangConstants.GangKarmaRequirement}.`,
+ };
}
- return this.karma <= GangConstants.GangKarmaRequirement;
+ return { success: true };
}
export function isAwareOfGang(this: PlayerObject): boolean {
diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts
index 9480c63e9..6940b7d3c 100644
--- a/src/ScriptEditor/NetscriptDefinitions.d.ts
+++ b/src/ScriptEditor/NetscriptDefinitions.d.ts
@@ -3825,6 +3825,8 @@ export interface Bladeburner {
*
* Attempts to join the Bladeburner division.
*
+ * Requirements: All combat stats must be at least level 100.
+ *
* If you have SF 7.3, you will immediately receive "The Blade's Simulacrum" augmentation and won't be able to accept
* Stanek's Gift after joining. If you want to accept Stanek's Gift, you must do that before calling this API.
*
@@ -4028,6 +4030,10 @@ export interface Gang {
* RAM cost: 1GB
*
* Create a gang with the specified faction.
+ *
+ * Outside BitNode 2, your karma must be less than or equal to 54000.
+ *
+ * @param faction - Name of the faction that you want to create a gang with. This faction must allow this action, and you must be its member.
* @returns True if the gang was created, false otherwise.
*/
createGang(faction: string): boolean;
@@ -5745,6 +5751,9 @@ interface Stanek {
* @remarks
* RAM cost: 2 GB
*
+ * The church only accepts those who have not purchased or installed any augmentations. "NeuroFlux Governor"
+ * augmentation is the only exception.
+ *
* @returns true if the player is a member of the church and has the gift installed,
* false otherwise.
*/