From 8fe0ea16154412998aa6868bbce0e76acf25db09 Mon Sep 17 00:00:00 2001
From: catloversg <152669316+catloversg@users.noreply.github.com>
Date: Sat, 8 Mar 2025 06:14:15 +0700
Subject: [PATCH] MISC: Warn player that they cannot accept Stanek's Gift after
joining Bladeburner with SF7.3 (#2005)
---
...ner.bladeburner.joinbladeburnerdivision.md | 2 +
src/BitNode/BitNode.tsx | 11 +++-
src/CotMG/Helper.tsx | 11 ++++
src/Documentation/doc/advanced/bitnodes.md | 4 +-
src/Locations/ui/SpecialLocation.tsx | 59 +++++++++++++------
src/NetscriptFunctions/Stanek.ts | 25 ++++----
src/ScriptEditor/NetscriptDefinitions.d.ts | 3 +
7 files changed, 79 insertions(+), 36 deletions(-)
diff --git a/markdown/bitburner.bladeburner.joinbladeburnerdivision.md b/markdown/bitburner.bladeburner.joinbladeburnerdivision.md
index 7374cf79eb..815522cc8c 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.
+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.
Returns false otherwise.
diff --git a/src/BitNode/BitNode.tsx b/src/BitNode/BitNode.tsx
index 25fd79fc91..f9c6c3650b 100644
--- a/src/BitNode/BitNode.tsx
+++ b/src/BitNode/BitNode.tsx
@@ -1,6 +1,6 @@
import React from "react";
import { Player } from "@player";
-import { CityName, FactionName } from "@enums";
+import { AugmentationName, CityName, FactionName } from "@enums";
import { BitNodeMultipliers, replaceCurrentNodeMults } from "./BitNodeMultipliers";
class BitNode {
@@ -236,7 +236,10 @@ export function initBitNodes() {
- Level 1: 8%
- Level 2: 12%
- - Level 3: 14% and begin with The Blade's Simulacrum
+ -
+ Level 3: 14% and immediately receive "{AugmentationName.BladesSimulacrum}" augmentation after joining the
+ Bladeburner division
+
>
),
@@ -415,6 +418,10 @@ export function initBitNodes() {
Each level of this Source-File increases the size of Stanek's Gift.
+
+
+ Due to the effect of Source-File 7.3, you must accept Stanek's Gift before joining the Bladeburner division if
+ you have that Source-File.
>
),
);
diff --git a/src/CotMG/Helper.tsx b/src/CotMG/Helper.tsx
index 6d37aba999..cd30299477 100644
--- a/src/CotMG/Helper.tsx
+++ b/src/CotMG/Helper.tsx
@@ -1,3 +1,5 @@
+import { Player } from "@player";
+import { AugmentationName } from "@enums";
import { dialogBoxCreate } from "../ui/React/DialogBox";
import { Reviver } from "../utils/GenericReviver";
import { BaseGift } from "./BaseGift";
@@ -49,3 +51,12 @@ export function calculateGrid(gift: BaseGift): number[][] {
return newGrid;
}
+
+export function canAcceptStaneksGift(): boolean {
+ return (
+ Player.canAccessCotMG() &&
+ [...Player.augmentations, ...Player.queuedAugmentations].filter(
+ (a) => a.name !== AugmentationName.NeuroFluxGovernor,
+ ).length === 0
+ );
+}
diff --git a/src/Documentation/doc/advanced/bitnodes.md b/src/Documentation/doc/advanced/bitnodes.md
index ee436d4898..f944b38553 100644
--- a/src/Documentation/doc/advanced/bitnodes.md
+++ b/src/Documentation/doc/advanced/bitnodes.md
@@ -138,7 +138,7 @@ Destroying this BitNode will give you Source-File 7, or if you already have this
- Level 1: 8%
- Level 2: 12%
-- Level 3: 14%
+- Level 3: Level 3: 14% and immediately receive "The Blade's Simulacrum" augmentation after joining the Bladeburner division
### BitNode 8: Ghost of Wall Street
@@ -228,6 +228,8 @@ Destroying this BitNode will give you Source-File 13, or if you already have thi
Each level of this Source-File increases the size of Stanek's Gift.
+Due to the effect of Source-File 7.3, you must accept Stanek's Gift before joining the Bladeburner division if you have that Source-File.
+
### BitNode 14: IPvGO Subnet Takeover
In late 2070, the .org bubble burst, and most of the newly-implemented IPvGO 'net collapsed overnight. Since then, various factions have been fighting over small subnets to control their computational power. These subnets are very valuable in the right hands, if you can wrest them from their current owners. You will be opposed by the other factions, but you can overcome them with careful choices. Prevent their attempts to destroy your networks by controlling the open space in the 'net!
diff --git a/src/Locations/ui/SpecialLocation.tsx b/src/Locations/ui/SpecialLocation.tsx
index dd72e18a4b..cb6f789fa7 100644
--- a/src/Locations/ui/SpecialLocation.tsx
+++ b/src/Locations/ui/SpecialLocation.tsx
@@ -10,7 +10,7 @@
* This subcomponent creates all of the buttons for interacting with those special
* properties
*/
-import React, { useState } from "react";
+import React, { useCallback, useState } from "react";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
@@ -36,38 +36,61 @@ import { GetServer } from "../../Server/AllServers";
import { ArcadeRoot } from "../../Arcade/ui/ArcadeRoot";
import { currentNodeMults } from "../../BitNode/BitNodeMultipliers";
import { canAccessBitNodeFeature, knowAboutBitverse } from "../../BitNode/BitNodeUtils";
+import { useRerender } from "../../ui/React/hooks";
+import { PromptEvent } from "../../ui/React/PromptManager";
+import { canAcceptStaneksGift } from "../../CotMG/Helper";
interface SpecialLocationProps {
loc: Location;
}
export function SpecialLocation(props: SpecialLocationProps): React.ReactElement {
- const setRerender = useState(false)[1];
+ const rerender = useRerender();
+
+ // Apply for Bladeburner division
+ const joinBladeburnerDivision = useCallback(() => {
+ Player.startBladeburner();
+ dialogBoxCreate("You have been accepted into the Bladeburner division!");
+ rerender();
+ }, [rerender]);
/** Click handler for Bladeburner button at Sector-12 NSA */
function handleBladeburner(): void {
if (Player.bladeburner) {
// Enter Bladeburner division
Router.toPage(Page.Bladeburner);
- } else if (
- Player.skills.strength >= 100 &&
- Player.skills.defense >= 100 &&
- Player.skills.dexterity >= 100 &&
- Player.skills.agility >= 100
+ return;
+ }
+ if (
+ Player.skills.strength < 100 ||
+ Player.skills.defense < 100 ||
+ Player.skills.dexterity < 100 ||
+ Player.skills.agility < 100
) {
- // Apply for Bladeburner division
- Player.startBladeburner();
- dialogBoxCreate("You have been accepted into the Bladeburner division!");
- setRerender((old) => !old);
-
- const worldHeader = document.getElementById("world-menu-header");
- if (worldHeader instanceof HTMLElement) {
- worldHeader.click();
- worldHeader.click();
- }
- } else {
dialogBoxCreate("Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)");
+ return;
+ }
+ if (
+ Player.sourceFileLvl(7) >= 3 &&
+ canAcceptStaneksGift() &&
+ !Player.hasAugmentation(AugmentationName.StaneksGift1)
+ ) {
+ PromptEvent.emit({
+ txt:
+ `After joining the Bladeburner division, you will immediately receive "${AugmentationName.BladesSimulacrum}"\n` +
+ `augmentation and won't be able to accept Stanek's Gift. If you want to accept Stanek's Gift,\n` +
+ `you must do that before joining the Bladeburner division.\n\n` +
+ "Do you really want to join the Bladeburner division now?",
+ resolve: (value: string | boolean) => {
+ if (value !== true) {
+ return;
+ }
+ joinBladeburnerDivision();
+ },
+ });
+ return;
}
+ joinBladeburnerDivision();
}
/** Click handler for Secret lab button at New Tokyo VitaLife */
diff --git a/src/NetscriptFunctions/Stanek.ts b/src/NetscriptFunctions/Stanek.ts
index 0e260901ac..13867295d9 100644
--- a/src/NetscriptFunctions/Stanek.ts
+++ b/src/NetscriptFunctions/Stanek.ts
@@ -1,7 +1,7 @@
import { Player } from "@player";
import { AugmentationName, FactionName } from "@enums";
-import { staneksGift } from "../CotMG/Helper";
+import { canAcceptStaneksGift, staneksGift } from "../CotMG/Helper";
import { Fragments, FragmentById } from "../CotMG/Fragment";
import { FragmentType } from "../CotMG/FragmentType";
@@ -110,22 +110,17 @@ export function NetscriptStanek(): InternalAPI {
acceptGift: (ctx) => () => {
const cotmgFaction = Factions[FactionName.ChurchOfTheMachineGod];
// Check if the player is eligible to join the church
- if (Player.canAccessCotMG()) {
- const augs = [...Player.augmentations, ...Player.queuedAugmentations].filter(
- (a) => a.name !== AugmentationName.NeuroFluxGovernor,
+ if (canAcceptStaneksGift()) {
+ // 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.`,
);
- if (augs.length == 0) {
- // 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.`,
- );
- }
}
- // Return true iff the player is in CotMG and has the first Stanek aug installed
+ // 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/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts
index edbbe140c7..90dc4938e7 100644
--- a/src/ScriptEditor/NetscriptDefinitions.d.ts
+++ b/src/ScriptEditor/NetscriptDefinitions.d.ts
@@ -3816,6 +3816,9 @@ export interface Bladeburner {
*
* Attempts to join the Bladeburner division.
*
+ * 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.
*
* Returns false otherwise.