import { Sleeve } from "../Sleeve"; import { numeralWrapper } from "../../../ui/numeralFormat"; import React from "react"; import Typography from "@mui/material/Typography"; import { Table, TableBody, TableCell, TableRow, } from "@mui/material"; import { Settings } from "../../../Settings/Settings"; import { formatNumber } from "../../../utils/StringHelperFunctions"; 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 { SleeveTaskType } from "../SleeveTaskTypesEnum"; import { use } from "../../../ui/Context"; interface ITableRowData { content?: string; level?: number; exp?: number; } interface IStatsRowProps { name: string; color: string; classes: any; data: ITableRowData; } export const SleeveStatsRow = ({ name, color, classes, data }: IStatsRowProps): React.ReactElement => { let content; if (data.content !== undefined) { content = data.content; } else if (data.level !== undefined && data.exp !== undefined) { content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`; } else if (data.level !== undefined && data.exp === undefined) { content = `${formatNumber(data.level, 0)}`; } return ( {name} {content} ) } 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: any[][] = []; if (props.sleeve.currentTask === SleeveTaskType.Crime) { data = [ [`Money`, <> (on success)], [`Hacking Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.hack)} (2x on success)`], [`Strength Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.str)} (2x on success)`], [`Defense Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.def)} (2x on success)`], [`Dexterity Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.dex)} (2x on success)`], [`Agility Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.agi)} (2x on success)`], [`Charisma Exp`, `${numeralWrapper.formatExp(props.sleeve.gainRatesForTask.cha)} (2x on success)`], ]; } else { data = [ [`Money:`, ], [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.hack)} / sec`], [`Strength Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.str)} / sec`], [`Defense Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.def)} / sec`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.dex)} / sec`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.agi)} / sec`], [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * props.sleeve.gainRatesForTask.cha)} / sec`], ]; if (props.sleeve.currentTask === SleeveTaskType.Company || props.sleeve.currentTask === SleeveTaskType.Faction) { const repGain: number = props.sleeve.getRepGain(player); data.push([`Reputation:`, ]); } } return ( Earnings {data.map(([a, b]) => ( {a} {b} ))}
) }