BUGFIX: BitVerse does not show all BN multipliers in some cases (#2045)

This commit is contained in:
catloversg
2025-05-11 12:40:28 +07:00
committed by GitHub
parent 3a6f85d684
commit b1b560b6c6
7 changed files with 43 additions and 24 deletions

View File

@@ -4,7 +4,7 @@
## BitNodeMultipliers.ManualHackMoney property ## BitNodeMultipliers.ManualHackMoney property
Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount. Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hacks a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount.
**Signature:** **Signature:**

View File

@@ -51,7 +51,7 @@ interface BitNodeMultipliers
| [HomeComputerRamCost](./bitburner.bitnodemultipliers.homecomputerramcost.md) | | number | Influences how much money it costs to upgrade your home computer's RAM | | [HomeComputerRamCost](./bitburner.bitnodemultipliers.homecomputerramcost.md) | | number | Influences how much money it costs to upgrade your home computer's RAM |
| [InfiltrationMoney](./bitburner.bitnodemultipliers.infiltrationmoney.md) | | number | Influences how much money is gained when the player infiltrates a company. | | [InfiltrationMoney](./bitburner.bitnodemultipliers.infiltrationmoney.md) | | number | Influences how much money is gained when the player infiltrates a company. |
| [InfiltrationRep](./bitburner.bitnodemultipliers.infiltrationrep.md) | | number | Influences how much rep the player can gain from factions when selling stolen documents and secrets | | [InfiltrationRep](./bitburner.bitnodemultipliers.infiltrationrep.md) | | number | Influences how much rep the player can gain from factions when selling stolen documents and secrets |
| [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount. | | [ManualHackMoney](./bitburner.bitnodemultipliers.manualhackmoney.md) | | number | Influences how much money the player actually gains when they hack a server via the terminal. This is different from ScriptHackMoney. When the player hacks a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount. |
| [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | | number | Influence how much it costs to purchase a server | | [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | | number | Influence how much it costs to purchase a server |
| [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | | number | Influences the maximum number of purchased servers you can have | | [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | | number | Influences the maximum number of purchased servers you can have |
| [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | | number | Influences the maximum allowed RAM for a purchased server | | [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | | number | Influences the maximum allowed RAM for a purchased server |

View File

@@ -116,7 +116,7 @@ export class BitNodeMultipliers {
/** /**
* Influences how much money the player actually gains when they hack a server via the terminal. This is different * Influences how much money the player actually gains when they hack a server via the terminal. This is different
* from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is * from ScriptHackMoney. When the player hacks a server via the terminal, the amount of money in that server is
* reduced, but they do not gain that same amount. * reduced, but they do not gain that same amount.
*/ */
ManualHackMoney = 1; ManualHackMoney = 1;

View File

@@ -25,11 +25,14 @@ import { canAccessBitNodeFeature } from "../BitNodeUtils";
interface IProps { interface IProps {
n: number; n: number;
level?: number; level?: number;
hideMultsIfCannotAccessFeature: boolean;
} }
export function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement { export function BitNodeMultiplierDescription({ n, level, hideMultsIfCannotAccessFeature }: IProps): React.ReactElement {
const [open, setOpen] = React.useState(false); const [open, setOpen] = React.useState(false);
if (n === 1) return <></>; if (n === 1) {
return <></>;
}
return ( return (
<Box component={Paper} sx={{ mt: 1, p: 1 }}> <Box component={Paper} sx={{ mt: 1, p: 1 }}>
@@ -38,13 +41,17 @@ export function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactE
{open ? <ExpandLess color="primary" /> : <ExpandMore color="primary" />} {open ? <ExpandLess color="primary" /> : <ExpandMore color="primary" />}
</ListItemButton> </ListItemButton>
<Collapse in={open}> <Collapse in={open}>
<BitNodeMultipliersDisplay n={n} level={level} /> <BitNodeMultipliersDisplay
n={n}
level={level}
hideMultsIfCannotAccessFeature={hideMultsIfCannotAccessFeature}
/>
</Collapse> </Collapse>
</Box> </Box>
); );
} }
export const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => { export const BitNodeMultipliersDisplay = ({ n, level, hideMultsIfCannotAccessFeature }: IProps): React.ReactElement => {
// If a level argument has been provided, use that as the multiplier level // If a level argument has been provided, use that as the multiplier level
// If not, then we have to assume that we want the next level up from the // If not, then we have to assume that we want the next level up from the
// current node's source file, so we get the min of that, the SF's max level, // current node's source file, so we get the min of that, the SF's max level,
@@ -64,10 +71,10 @@ export const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElem
<CrimeMults n={n} mults={mults} /> <CrimeMults n={n} mults={mults} />
<InfiltrationMults n={n} mults={mults} /> <InfiltrationMults n={n} mults={mults} />
<CompanyMults n={n} mults={mults} /> <CompanyMults n={n} mults={mults} />
<GangMults n={n} mults={mults} /> <GangMults n={n} mults={mults} hideMultsIfCannotAccessFeature={hideMultsIfCannotAccessFeature} />
<CorporationMults n={n} mults={mults} /> <CorporationMults n={n} mults={mults} hideMultsIfCannotAccessFeature={hideMultsIfCannotAccessFeature} />
<BladeburnerMults n={n} mults={mults} /> <BladeburnerMults n={n} mults={mults} hideMultsIfCannotAccessFeature={hideMultsIfCannotAccessFeature} />
<StanekMults n={n} mults={mults} /> <StanekMults n={n} mults={mults} hideMultsIfCannotAccessFeature={hideMultsIfCannotAccessFeature} />
<GoMults n={n} mults={mults} /> <GoMults n={n} mults={mults} />
</Box> </Box>
); );
@@ -130,6 +137,10 @@ interface IMultsProps {
mults: BitNodeMultipliers; mults: BitNodeMultipliers;
} }
interface IEndGameMultsProps extends IMultsProps {
hideMultsIfCannotAccessFeature: boolean;
}
function GeneralMults({ mults }: IMultsProps): React.ReactElement { function GeneralMults({ mults }: IMultsProps): React.ReactElement {
const rows: IBNMultRows = { const rows: IBNMultRows = {
WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` }, WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` },
@@ -265,7 +276,7 @@ function HackingMults({ mults }: IMultsProps): React.ReactElement {
ManualHackMoney: { ManualHackMoney: {
name: "Money Gained From Manual Hack", name: "Money Gained From Manual Hack",
color: Settings.theme.money, color: Settings.theme.money,
tooltipText: `Influences how much money the player actually gains when they hack a server via the terminal. This is different from "Stolen Money From Hack". When the player hack a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount.`, tooltipText: `Influences how much money the player actually gains when they hack a server via the terminal. This is different from "Stolen Money From Hack". When the player hacks a server via the terminal, the amount of money in that server is reduced, but they do not gain that same amount.`,
}, },
ScriptHackMoney: { ScriptHackMoney: {
name: "Stolen Money From Hack", name: "Stolen Money From Hack",
@@ -315,8 +326,10 @@ function InfiltrationMults({ mults }: IMultsProps): React.ReactElement {
return <BNMultTable sectionName="Infiltration" rowData={rows} mults={mults} />; return <BNMultTable sectionName="Infiltration" rowData={rows} mults={mults} />;
} }
function BladeburnerMults({ mults }: IMultsProps): React.ReactElement { function BladeburnerMults({ mults, hideMultsIfCannotAccessFeature }: IEndGameMultsProps): React.ReactElement {
if (!Player.canAccessBladeburner()) return <></>; if (!Player.canAccessBladeburner() && hideMultsIfCannotAccessFeature) {
return <></>;
}
if (mults.BladeburnerRank === 0) { if (mults.BladeburnerRank === 0) {
const rows: IBNMultRows = { const rows: IBNMultRows = {
@@ -334,8 +347,10 @@ function BladeburnerMults({ mults }: IMultsProps): React.ReactElement {
return <BNMultTable sectionName="Bladeburner" rowData={rows} mults={mults} />; return <BNMultTable sectionName="Bladeburner" rowData={rows} mults={mults} />;
} }
function StanekMults({ mults }: IMultsProps): React.ReactElement { function StanekMults({ mults, hideMultsIfCannotAccessFeature }: IEndGameMultsProps): React.ReactElement {
if (!Player.canAccessCotMG()) return <></>; if (!Player.canAccessCotMG() && hideMultsIfCannotAccessFeature) {
return <></>;
}
const extraSize = mults.StaneksGiftExtraSize.toFixed(5); const extraSize = mults.StaneksGiftExtraSize.toFixed(5);
const rows: IBNMultRows = { const rows: IBNMultRows = {
@@ -349,8 +364,10 @@ function StanekMults({ mults }: IMultsProps): React.ReactElement {
return <BNMultTable sectionName="Stanek's Gift" rowData={rows} mults={mults} />; return <BNMultTable sectionName="Stanek's Gift" rowData={rows} mults={mults} />;
} }
function GangMults({ mults }: IMultsProps): React.ReactElement { function GangMults({ mults, hideMultsIfCannotAccessFeature }: IEndGameMultsProps): React.ReactElement {
if (!canAccessBitNodeFeature(2)) return <></>; if (!canAccessBitNodeFeature(2) && hideMultsIfCannotAccessFeature) {
return <></>;
}
const rows: IBNMultRows = { const rows: IBNMultRows = {
GangSoftcap: { GangSoftcap: {
@@ -363,8 +380,10 @@ function GangMults({ mults }: IMultsProps): React.ReactElement {
return <BNMultTable sectionName="Gang" rowData={rows} mults={mults} />; return <BNMultTable sectionName="Gang" rowData={rows} mults={mults} />;
} }
function CorporationMults({ mults }: IMultsProps): React.ReactElement { function CorporationMults({ mults, hideMultsIfCannotAccessFeature }: IEndGameMultsProps): React.ReactElement {
if (!Player.canAccessCorporation()) return <></>; if (!Player.canAccessCorporation() && hideMultsIfCannotAccessFeature) {
return <></>;
}
if (mults.CorporationSoftcap < 0.15) { if (mults.CorporationSoftcap < 0.15) {
const rows: IBNMultRows = { const rows: IBNMultRows = {

View File

@@ -7,7 +7,7 @@ import { BitNodes } from "../BitNode";
import { Modal } from "../../ui/React/Modal"; import { Modal } from "../../ui/React/Modal";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { BitnodeMultiplierDescription } from "./BitnodeMultipliersDescription"; import { BitNodeMultiplierDescription } from "./BitnodeMultipliersDescription";
import { BitNodeAdvancedOptions } from "./BitNodeAdvancedOptions"; import { BitNodeAdvancedOptions } from "./BitNodeAdvancedOptions";
import { JSONMap } from "../../Types/Jsonable"; import { JSONMap } from "../../Types/Jsonable";
@@ -105,7 +105,7 @@ export function PortalModal(props: IProps): React.ReactElement {
<br /> <br />
<br /> <br />
<Typography component="div">{bitNode.info}</Typography> <Typography component="div">{bitNode.info}</Typography>
<BitnodeMultiplierDescription n={props.n} level={newLevel} /> <BitNodeMultiplierDescription n={props.n} level={newLevel} hideMultsIfCannotAccessFeature={false} />
<BitNodeAdvancedOptions <BitNodeAdvancedOptions
targetBitNode={props.n} targetBitNode={props.n}
currentSourceFiles={currentSourceFiles} currentSourceFiles={currentSourceFiles}

View File

@@ -744,7 +744,7 @@ interface BitNodeMultipliers {
InfiltrationRep: number; InfiltrationRep: number;
/** /**
* Influences how much money the player actually gains when they hack a server via the terminal. This is different * Influences how much money the player actually gains when they hack a server via the terminal. This is different
* from ScriptHackMoney. When the player hack a server via the terminal, the amount of money in that server is * from ScriptHackMoney. When the player hacks a server via the terminal, the amount of money in that server is
* reduced, but they do not gain that same amount. * reduced, but they do not gain that same amount.
*/ */
ManualHackMoney: number; ManualHackMoney: number;

View File

@@ -594,7 +594,7 @@ export function CharacterStats(): React.ReactElement {
{canAccessBitNodeFeature(5) && ( {canAccessBitNodeFeature(5) && (
<Paper sx={{ p: 1, mb: 1 }}> <Paper sx={{ p: 1, mb: 1 }}>
<Typography variant="h5">BitNode Multipliers</Typography> <Typography variant="h5">BitNode Multipliers</Typography>
<BitNodeMultipliersDisplay n={Player.bitNodeN} /> <BitNodeMultipliersDisplay n={Player.bitNodeN} hideMultsIfCannotAccessFeature={true} />
</Paper> </Paper>
)} )}