import React from "react"; import { Typography, Table, TableBody, TableCell, TableRow } from "@mui/material"; import { numeralWrapper } from "../../../ui/numeralFormat"; import { Settings } from "../../../Settings/Settings"; import { StatsRow } from "../../../ui/React/StatsRow"; import { characterOverviewStyles as useStyles } from "../../../ui/React/CharacterOverview"; import { Money } from "../../../ui/React/Money"; import { MoneyRate } from "../../../ui/React/MoneyRate"; import { ReputationRate } from "../../../ui/React/ReputationRate"; import { Sleeve } from "../Sleeve"; import { isSleeveClassWork } from "../Work/SleeveClassWork"; import { isSleeveFactionWork } from "../Work/SleeveFactionWork"; import { isSleeveCompanyWork } from "../Work/SleeveCompanyWork"; import { isSleeveCrimeWork } from "../Work/SleeveCrimeWork"; import { BitNodeMultipliers } from "../../../BitNode/BitNodeMultipliers"; interface IProps { sleeve: Sleeve; } export function StatsElement(props: IProps): React.ReactElement { const classes = useStyles(); return (
); } export function EarningsElement(props: IProps): React.ReactElement { const classes = useStyles(); let data: (string | JSX.Element)[][] = []; if (isSleeveCrimeWork(props.sleeve.currentWork)) { const gains = props.sleeve.currentWork.getExp(props.sleeve); data = [ [`Money:`, ], [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * gains.hackExp)}`], [`Strength Exp:`, `${numeralWrapper.formatExp(5 * gains.strExp)}`], [`Defense Exp:`, `${numeralWrapper.formatExp(5 * gains.defExp)}`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * gains.dexExp)}`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * gains.agiExp)}`], [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * gains.chaExp)}`], ]; } if (isSleeveClassWork(props.sleeve.currentWork)) { const rates = props.sleeve.currentWork.calculateRates(props.sleeve); data = [ [`Money:`, ], [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`], [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`], [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`], [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`], ]; } if (isSleeveFactionWork(props.sleeve.currentWork)) { const rates = props.sleeve.currentWork.getExpRates(props.sleeve); const repGain = props.sleeve.currentWork.getReputationRate(props.sleeve); data = [ [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`], [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`], [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`], [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`], [`Reputation:`, ], ]; } if (isSleeveCompanyWork(props.sleeve.currentWork)) { const rates = props.sleeve.currentWork.getGainRates(props.sleeve); data = [ [`Money:`, ], [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`], [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`], [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`], [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`], [`Reputation:`, ], ]; } return ( Earnings {props.sleeve.storedCycles > 50 ? "(overclock)" : ""} {data.map(([a, b]) => ( {a} {b} ))}
); }