mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 13:15:48 +01:00
Fix computation of BN level
This commit is contained in:
parent
1f8c5164d7
commit
d43ec1d501
@ -12,10 +12,10 @@ import { IBitNodeMultipliers } from "../BitNodeMultipliers";
|
||||
|
||||
interface IProps {
|
||||
n: number;
|
||||
showNext?: boolean;
|
||||
level?: number;
|
||||
}
|
||||
|
||||
export function BitnodeMultiplierDescription({ n, showNext = false }: IProps): React.ReactElement {
|
||||
export function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement {
|
||||
const [open, setOpen] = React.useState(false);
|
||||
if (n === 1) return <></>;
|
||||
|
||||
@ -26,15 +26,15 @@ export function BitnodeMultiplierDescription({ n, showNext = false }: IProps): R
|
||||
{open ? <ExpandLess color="primary" /> : <ExpandMore color="primary" />}
|
||||
</ListItemButton>
|
||||
<Collapse in={open}>
|
||||
<BitNodeMultipliersDisplay n={n} showNext={showNext} />
|
||||
<BitNodeMultipliersDisplay n={n} level={level} />
|
||||
</Collapse>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export const BitNodeMultipliersDisplay = ({ n, showNext = false }: IProps): React.ReactElement => {
|
||||
export const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {
|
||||
const player = use.Player();
|
||||
const mults = getBitNodeMultipliers(n, player.sourceFileLvl(n) + +!!showNext);
|
||||
const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, n === 12 ? Infinity : 3));
|
||||
|
||||
return (
|
||||
<Box sx={{ columnCount: 2, columnGap: 1, mb: -2 }}>
|
||||
|
@ -41,7 +41,7 @@ export function PortalModal(props: IProps): React.ReactElement {
|
||||
<br />
|
||||
<br />
|
||||
<Typography>{bitNode.info}</Typography>
|
||||
<BitnodeMultiplierDescription n={props.n} showNext={!props.flume} />
|
||||
<BitnodeMultiplierDescription n={props.n} level={newLevel} />
|
||||
<br />
|
||||
<br />
|
||||
<Button
|
||||
|
Loading…
Reference in New Issue
Block a user