Allow every aug in gangs in BN2

This commit is contained in:
nickofolas
2022-03-23 11:17:03 -05:00
parent 5416038fd7
commit 6a8426abd2
2 changed files with 15 additions and 24 deletions

View File

@ -48,12 +48,13 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
const aug = Augmentations[augName];
if (
augName === AugmentationNames.NeuroFluxGovernor ||
augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2 ||
(augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2) ||
// Special augs (i.e. Bladeburner augs)
aug.isSpecial ||
// Exclusive augs (i.e. QLink)
(aug.factions.length <= 1 && !props.faction.augmentations.includes(augName))
) continue;
(aug.factions.length <= 1 && !props.faction.augmentations.includes(augName) && player.bitNodeN !== 2)
)
continue;
augs.push(augName);
}

View File

@ -1,14 +1,6 @@
import React, { useEffect, useState } from "react";
import {
Box,
Button,
Container,
Paper,
TableBody,
TableRow,
Typography
} from "@mui/material";
import { Box, Button, Container, Paper, TableBody, TableRow, Typography } from "@mui/material";
import { Augmentations } from "../../Augmentation/Augmentations";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
@ -68,27 +60,25 @@ export function FactionsRoot(props: IProps): React.ReactElement {
const aug = Augmentations[augName];
if (
augName === AugmentationNames.NeuroFluxGovernor ||
augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2 ||
(augName === AugmentationNames.TheRedPill && player.bitNodeN !== 2) ||
// Special augs (i.e. Bladeburner augs)
aug.isSpecial ||
// Exclusive augs (i.e. QLink)
(aug.factions.length <= 1 && !faction.augmentations.includes(augName))
) continue;
augs.push(augName)
(aug.factions.length <= 1 && !faction.augmentations.includes(augName) && player.bitNodeN !== 2)
)
continue;
augs.push(augName);
}
} else {
augs = faction.augmentations.slice();
}
return augs.filter(
(augmentation: string) => !player.hasAugmentation(augmentation)
).length;
}
return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation)).length;
};
const allFactions = Object.values(FactionNames).map(faction => faction as string)
const allFactions = Object.values(FactionNames).map((faction) => faction as string);
const allJoinedFactions = props.player.factions.slice(0);
allJoinedFactions.sort((a, b) =>
allFactions.indexOf(a) - allFactions.indexOf(b));
allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));
return (
<Container disableGutters maxWidth="md" sx={{ mx: 0, mb: 10 }}>
@ -120,7 +110,7 @@ export function FactionsRoot(props: IProps): React.ReactElement {
</TableCell>
<TableCell align="right">
<Box ml={1} mb={1}>
<Button sx={{ width: '100%' }} onClick={() => openFactionAugPage(Factions[faction])}>
<Button sx={{ width: "100%" }} onClick={() => openFactionAugPage(Factions[faction])}>
Augmentations Left: {getAugsLeft(Factions[faction], props.player)}
</Button>
</Box>