mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-18 05:33:18 +02:00
DARKNET: Darkweb Expansion Project & Bitnode (#2139)
This is BN15. It is a really big change; see the PR for all the details.
This commit is contained in:
committed by
GitHub
parent
a674633f6c
commit
6073964768
@@ -18,6 +18,7 @@ export enum LocationName {
|
||||
ChongqingKuaiGongInternational = "KuaiGong International",
|
||||
ChongqingSolarisSpaceSystems = "Solaris Space Systems",
|
||||
ChongqingChurchOfTheMachineGod = "Church of the Machine God",
|
||||
ChongqingShadowedWalkway = "Shadowed Walkway",
|
||||
|
||||
Sector12AlphaEnterprises = "Alpha Enterprises",
|
||||
Sector12BladeIndustries = "Blade Industries",
|
||||
|
||||
@@ -68,7 +68,7 @@ Cities[CityName.Chongqing].asciiArt = `
|
||||
|
|
||||
75 o
|
||||
\\
|
||||
o 76
|
||||
H [shadowed walkway]
|
||||
7 | |
|
||||
| + 77
|
||||
[world stock exchange] F |
|
||||
|
||||
@@ -453,4 +453,9 @@ export const LocationsMetadata: IConstructorParams[] = [
|
||||
name: LocationName.IshimaGlitch,
|
||||
types: [LocationType.Special],
|
||||
},
|
||||
{
|
||||
city: CityName.Chongqing,
|
||||
name: LocationName.ChongqingShadowedWalkway,
|
||||
types: [LocationType.Special],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -16,7 +16,7 @@ import Button from "@mui/material/Button";
|
||||
|
||||
import { Location } from "../Location";
|
||||
import { CreateCorporationModal } from "../../Corporation/ui/modals/CreateCorporationModal";
|
||||
import { AugmentationName, FactionName, LocationName, ToastVariant } from "@enums";
|
||||
import { AugmentationName, CompletedProgramName, FactionName, LocationName, ToastVariant } from "@enums";
|
||||
import { Factions } from "../../Faction/Factions";
|
||||
import { joinFaction } from "../../Faction/FactionHelpers";
|
||||
|
||||
@@ -39,6 +39,10 @@ import { canAccessBitNodeFeature, knowAboutBitverse } from "../../BitNode/BitNod
|
||||
import { useRerender } from "../../ui/React/hooks";
|
||||
import { PromptEvent } from "../../ui/React/PromptManager";
|
||||
import { canAcceptStaneksGift } from "../../CotMG/Helper";
|
||||
import { getDarkscapeNavigator } from "../../DarkNet/effects/effects";
|
||||
import { hasDarknetAccess } from "../../DarkNet/utils/darknetAuthUtils";
|
||||
import { DarknetConstants } from "../../DarkNet/Constants";
|
||||
import { formatMoney } from "../../ui/formatNumber";
|
||||
|
||||
interface SpecialLocationProps {
|
||||
loc: Location;
|
||||
@@ -335,6 +339,57 @@ export function SpecialLocation(props: SpecialLocationProps): React.ReactElement
|
||||
);
|
||||
}
|
||||
|
||||
function renderShadowedWalkway(): React.ReactElement {
|
||||
function handleDarknetNavigator(): void {
|
||||
if (Player.money < DarknetConstants.DarkscapeNavigatorDiscountedPrice) {
|
||||
dialogBoxCreate(`You don't have enough money to buy ${CompletedProgramName.darkscape}`);
|
||||
return;
|
||||
}
|
||||
Player.loseMoney(DarknetConstants.DarkscapeNavigatorDiscountedPrice, "other");
|
||||
getDarkscapeNavigator();
|
||||
dialogBoxCreate(
|
||||
`You bought ${CompletedProgramName.darkscape} for ${formatMoney(
|
||||
DarknetConstants.DarkscapeNavigatorDiscountedPrice,
|
||||
)}.`,
|
||||
);
|
||||
rerender();
|
||||
}
|
||||
const canBuyDarknetNavigator =
|
||||
Player.money >= DarknetConstants.DarkscapeNavigatorDiscountedPrice && !hasDarknetAccess();
|
||||
return (
|
||||
<>
|
||||
<Typography>
|
||||
<br />
|
||||
<br />
|
||||
The city is dark and quiet. It stretches out below this decrepit walkway, a seemingly endless expanse of
|
||||
decaying concrete and rusted metal.
|
||||
<br />
|
||||
<br />
|
||||
Nearby, an ancient automat sits askew, its screen flickering with static, still covered with ads for the
|
||||
compact disks it sells for credits.
|
||||
<br />
|
||||
<br />
|
||||
On it, a faded sign reads:
|
||||
<br />
|
||||
<br />
|
||||
<i>
|
||||
Resistance, change, & freedom: powered by privacy. Darkscape Navigator is the only way to escape the
|
||||
oppression of the Great Firewall.
|
||||
</i>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<Button onClick={handleDarknetNavigator} disabled={!canBuyDarknetNavigator}>
|
||||
Buy {CompletedProgramName.darkscape}{" "}
|
||||
{hasDarknetAccess()
|
||||
? " - Purchased"
|
||||
: `(${formatMoney(DarknetConstants.DarkscapeNavigatorDiscountedPrice)})`}
|
||||
</Button>
|
||||
</Typography>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
switch (props.loc.name) {
|
||||
case LocationName.NewTokyoVitaLife: {
|
||||
return renderGrafting();
|
||||
@@ -368,6 +423,9 @@ export function SpecialLocation(props: SpecialLocationProps): React.ReactElement
|
||||
</>
|
||||
);
|
||||
}
|
||||
case LocationName.ChongqingShadowedWalkway: {
|
||||
return renderShadowedWalkway();
|
||||
}
|
||||
default:
|
||||
console.error(`Location ${props.loc.name} doesn't have any special properties`);
|
||||
return <></>;
|
||||
|
||||
@@ -2,13 +2,12 @@ import React from "react";
|
||||
import Button from "@mui/material/Button";
|
||||
|
||||
import { dialogBoxCreate } from "../../ui/React/DialogBox";
|
||||
import { GetServer } from "../../Server/AllServers";
|
||||
import { SpecialServers } from "../../Server/data/SpecialServers";
|
||||
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
import { Player } from "@player";
|
||||
|
||||
import { Money } from "../../ui/React/Money";
|
||||
import { getTorRouter } from "../../Server/ServerHelpers";
|
||||
|
||||
/** Attempt to purchase a TOR router using the button. */
|
||||
export function purchaseTorRouter(): void {
|
||||
@@ -22,13 +21,7 @@ export function purchaseTorRouter(): void {
|
||||
}
|
||||
Player.loseMoney(CONSTANTS.TorRouterCost, "other");
|
||||
|
||||
const darkweb = GetServer(SpecialServers.DarkWeb);
|
||||
if (!darkweb) {
|
||||
throw new Error("Dark web is not a server.");
|
||||
}
|
||||
|
||||
Player.getHomeComputer().serversOnNetwork.push(darkweb.hostname);
|
||||
darkweb.serversOnNetwork.push(Player.getHomeComputer().hostname);
|
||||
getTorRouter();
|
||||
dialogBoxCreate(
|
||||
"You have purchased a TOR router!\n" +
|
||||
"You now have access to the dark web from your home computer.\n" +
|
||||
|
||||
Reference in New Issue
Block a user