MISC: Clarify conditions of activating Gang, Bladeburner, Stanek's Gift (#2053)

This commit is contained in:
catloversg
2025-04-01 03:37:35 +07:00
committed by GitHub
parent f6e7ef082c
commit b2093a2419
11 changed files with 87 additions and 25 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -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 ? (
<Typography>Unlocked when reaching {GangConstants.GangKarmaRequirement} karma</Typography>
) : (
""

View File

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

View File

@@ -308,15 +308,20 @@ export function NetscriptBladeburner(): InternalAPI<INetscriptBladeburner> {
},
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<INetscriptBladeburner> {
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;
},

View File

@@ -39,9 +39,26 @@ export function NetscriptGang(): InternalAPI<IGang> {
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);

View File

@@ -110,15 +110,19 @@ export function NetscriptStanek(): InternalAPI<IStanek> {
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);

View File

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

View File

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