Refactor CharacterStats a bit

This commit is contained in:
nickofolas 2022-05-07 14:48:26 -05:00
parent ef29baf563
commit b1f945ff8e

@ -84,14 +84,12 @@ function CurrentBitNode(): React.ReactElement {
const index = "BitNode" + player.bitNodeN; const index = "BitNode" + player.bitNodeN;
const lvl = player.sourceFileLvl(player.bitNodeN) + 1; const lvl = player.sourceFileLvl(player.bitNodeN) + 1;
return ( return (
<Box> <Paper sx={{ mb: 1, p: 1 }}>
<Paper sx={{ p: 1 }}>
<Typography variant="h5"> <Typography variant="h5">
BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl}) BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {lvl})
</Typography> </Typography>
<Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography> <Typography sx={{ whiteSpace: "pre-wrap", overflowWrap: "break-word" }}>{BitNodes[index].info}</Typography>
</Paper> </Paper>
</Box>
); );
} }
@ -332,8 +330,8 @@ export function CharacterStats(): React.ReactElement {
</Table> </Table>
</Paper> </Paper>
</Box> </Box>
<Box sx={{ mb: 1 }}>
<Paper sx={{ p: 1 }}> <Paper sx={{ p: 1, mb: 1 }}>
<Typography variant="h5" color="primary" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}> <Typography variant="h5" color="primary" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}>
Multipliers Multipliers
{player.sourceFileLvl(5) > 0 && ( {player.sourceFileLvl(5) > 0 && (
@ -347,8 +345,8 @@ export function CharacterStats(): React.ReactElement {
affected by BitNode multipliers. affected by BitNode multipliers.
<br /> <br />
<br /> <br />
The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as The dim number is the raw multiplier, and the undimmed number is the effective multiplier, as dictated
dictated by the BitNode. by the BitNode.
</Typography> </Typography>
} }
> >
@ -377,11 +375,7 @@ export function CharacterStats(): React.ReactElement {
/> />
<MultiplierTable <MultiplierTable
rows={[ rows={[
[ ["Hacking Level", player.hacking_mult, player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier],
"Hacking Level",
player.hacking_mult,
player.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier,
],
[ [
"Hacking Experience", "Hacking Experience",
player.hacking_exp_mult, player.hacking_exp_mult,
@ -403,11 +397,7 @@ export function CharacterStats(): React.ReactElement {
/> />
<MultiplierTable <MultiplierTable
rows={[ rows={[
[ ["Defense Level", player.defense_mult, player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier],
"Defense Level",
player.defense_mult,
player.defense_mult * BitNodeMultipliers.DefenseLevelMultiplier,
],
["Defense Experience", player.defense_exp_mult], ["Defense Experience", player.defense_exp_mult],
]} ]}
color={Settings.theme.combat} color={Settings.theme.combat}
@ -425,11 +415,7 @@ export function CharacterStats(): React.ReactElement {
/> />
<MultiplierTable <MultiplierTable
rows={[ rows={[
[ ["Agility Level", player.agility_mult, player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier],
"Agility Level",
player.agility_mult,
player.agility_mult * BitNodeMultipliers.AgilityLevelMultiplier,
],
["Agility Experience", player.agility_exp_mult], ["Agility Experience", player.agility_exp_mult],
]} ]}
color={Settings.theme.combat} color={Settings.theme.combat}
@ -497,10 +483,8 @@ export function CharacterStats(): React.ReactElement {
</Box> </Box>
</Box> </Box>
</Paper> </Paper>
</Box>
<Box sx={{ mb: 1 }}> <Paper sx={{ p: 1, mb: 1 }}>
<Paper sx={{ p: 1 }}>
<Typography variant="h5">Time Played</Typography> <Typography variant="h5">Time Played</Typography>
<Table> <Table>
<TableBody> <TableBody>
@ -510,7 +494,7 @@ export function CharacterStats(): React.ReactElement {
</TableBody> </TableBody>
</Table> </Table>
</Paper> </Paper>
</Box>
<CurrentBitNode /> <CurrentBitNode />
<MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} /> <MoneyModal open={moneyOpen} onClose={() => setMoneyOpen(false)} />
<EmployersModal open={employersOpen} onClose={() => setEmployersOpen(false)} /> <EmployersModal open={employersOpen} onClose={() => setEmployersOpen(false)} />