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 { use } from "../../../ui/Context";
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();
const player = use.Player();
let data: (string | JSX.Element)[][] = [];
if (isSleeveCrimeWork(props.sleeve.currentWork)) {
const gains = props.sleeve.currentWork.getExp();
data = [
[`Money:`, ],
[`Hacking Exp:`, `${numeralWrapper.formatExp(5 * gains.hackExp * BitNodeMultipliers.CrimeExpGain)}`],
[`Strength Exp:`, `${numeralWrapper.formatExp(5 * gains.strExp * BitNodeMultipliers.CrimeExpGain)}`],
[`Defense Exp:`, `${numeralWrapper.formatExp(5 * gains.defExp * BitNodeMultipliers.CrimeExpGain)}`],
[`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * gains.dexExp * BitNodeMultipliers.CrimeExpGain)}`],
[`Agility Exp:`, `${numeralWrapper.formatExp(5 * gains.agiExp * BitNodeMultipliers.CrimeExpGain)}`],
[`Charisma Exp:`, `${numeralWrapper.formatExp(5 * gains.chaExp * BitNodeMultipliers.CrimeExpGain)}`],
];
}
if (isSleeveClassWork(props.sleeve.currentWork)) {
const rates = props.sleeve.currentWork.calculateRates(player, props.sleeve);
data = [
[`Money:`, ],
[`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp * BitNodeMultipliers.ClassGymExpGain)} / sec`],
[`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp * BitNodeMultipliers.ClassGymExpGain)} / sec`],
[`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp * BitNodeMultipliers.ClassGymExpGain)} / sec`],
[`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp * BitNodeMultipliers.ClassGymExpGain)} / sec`],
[`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp * BitNodeMultipliers.ClassGymExpGain)} / sec`],
[`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp * BitNodeMultipliers.ClassGymExpGain)} / 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 * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp * BitNodeMultipliers.FactionWorkExpGain)} / sec`],
[`Reputation:`, ],
];
}
if (isSleeveCompanyWork(props.sleeve.currentWork)) {
const rates = props.sleeve.currentWork.getGainRates(player, props.sleeve);
data = [
[`Money:`, ],
[`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp * BitNodeMultipliers.CompanyWorkExpGain)} / sec`],
[`Reputation:`, ],
];
}
return (
Earnings {props.sleeve.storedCycles > 50 ? "(overclock)" : ""}
{data.map(([a, b]) => (
{a}
{b}
))}
);
}