bitburner-src/src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx

96 lines
4.2 KiB
TypeScript
Raw Normal View History

2021-09-27 02:55:38 +02:00
import { Sleeve } from "../Sleeve";
import { numeralWrapper } from "../../../ui/numeralFormat";
import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions";
import { CONSTANTS } from "../../../Constants";
import { Typography } from "@mui/material";
2021-09-27 02:55:38 +02:00
import { StatsTable } from "../../../ui/React/StatsTable";
import { Modal } from "../../../ui/React/Modal";
import React from "react";
interface IProps {
open: boolean;
onClose: () => void;
sleeve: Sleeve;
}
export function MoreStatsModal(props: IProps): React.ReactElement {
return (
<Modal open={props.open} onClose={props.onClose}>
<StatsTable
rows={[
[
<>Hacking:&nbsp;</>,
2021-11-05 22:12:52 +01:00
props.sleeve.hacking,
2021-09-27 02:55:38 +02:00
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp)</>,
],
[
<>Strength:&nbsp;</>,
props.sleeve.strength,
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.strength_exp)} exp)</>,
],
[
<>Defense:&nbsp;</>,
props.sleeve.defense,
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.defense_exp)} exp)</>,
],
[
<>Dexterity:&nbsp;</>,
props.sleeve.dexterity,
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.dexterity_exp)} exp)</>,
],
[
<>Agility:&nbsp;</>,
props.sleeve.agility,
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.agility_exp)} exp)</>,
],
[
<>Charisma:&nbsp;</>,
props.sleeve.charisma,
<>&nbsp;({numeralWrapper.formatExp(props.sleeve.charisma_exp)} exp)</>,
],
]}
title="Stats:"
/>
<br />
<StatsTable
rows={[
[<>Hacking Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.hacking_mult)],
[<>Hacking Experience multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.hacking_exp_mult)],
[<>Strength Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.strength_mult)],
[<>Strength Experience multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.strength_exp_mult)],
[<>Defense Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.defense_mult)],
[<>Defense Experience multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.defense_exp_mult)],
[<>Dexterity Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.dexterity_mult)],
[
<>Dexterity Experience multiplier:&nbsp;</>,
numeralWrapper.formatPercentage(props.sleeve.dexterity_exp_mult),
],
[<>Agility Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.agility_mult)],
[<>Agility Experience multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.agility_exp_mult)],
[<>Charisma Level multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.charisma_mult)],
[<>Charisma Experience multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.charisma_exp_mult)],
[
<>Faction Reputation Gain multiplier:&nbsp;</>,
numeralWrapper.formatPercentage(props.sleeve.faction_rep_mult),
],
[
<>Company Reputation Gain multiplier:&nbsp;</>,
numeralWrapper.formatPercentage(props.sleeve.company_rep_mult),
],
[<>Salary multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.work_money_mult)],
[<>Crime Money multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.crime_money_mult)],
[<>Crime Success multiplier:&nbsp;</>, numeralWrapper.formatPercentage(props.sleeve.crime_success_mult)],
]}
title="Multipliers:"
/>
{/* Check for storedCycles to be a bit over 0 to prevent jittering */}
{props.sleeve.storedCycles > 10 && (
<Typography sx={{ py: 2 }}>
Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}
</Typography>
)}
2021-09-27 02:55:38 +02:00
</Modal>
);
}