mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
MISC: Clarify conditions of activating Gang, Bladeburner, Stanek's Gift (#2053)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
) : (
|
||||
""
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
9
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
9
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user