2021-09-27 02:55:38 +02:00
|
|
|
import React from "react";
|
2022-03-11 06:02:32 +01:00
|
|
|
|
2022-04-07 01:30:08 +02:00
|
|
|
import { Typography, Table, TableBody, TableCell, TableRow } from "@mui/material";
|
2021-09-27 02:55:38 +02:00
|
|
|
|
2022-03-11 06:02:32 +01:00
|
|
|
import { numeralWrapper } from "../../../ui/numeralFormat";
|
2022-03-08 03:03:23 +01:00
|
|
|
import { Settings } from "../../../Settings/Settings";
|
2022-03-12 22:49:07 +01:00
|
|
|
import { StatsRow } from "../../../ui/React/StatsRow";
|
2022-03-08 03:03:23 +01:00
|
|
|
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";
|
|
|
|
|
2022-03-11 06:02:32 +01:00
|
|
|
import { Sleeve } from "../Sleeve";
|
|
|
|
import { SleeveTaskType } from "../SleeveTaskTypesEnum";
|
|
|
|
|
2021-09-10 03:38:05 +02:00
|
|
|
interface IProps {
|
|
|
|
sleeve: Sleeve;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function StatsElement(props: IProps): React.ReactElement {
|
2022-03-08 03:03:23 +01:00
|
|
|
const classes = useStyles();
|
|
|
|
|
|
|
|
return (
|
2022-04-07 01:30:08 +02:00
|
|
|
<Table sx={{ display: "table", mb: 1, width: "100%" }}>
|
2022-03-08 03:03:23 +01:00
|
|
|
<TableBody>
|
2022-03-12 22:49:07 +01:00
|
|
|
<StatsRow name="City" color={Settings.theme.primary} data={{ content: props.sleeve.city }} />
|
2022-04-07 01:30:08 +02:00
|
|
|
<StatsRow
|
|
|
|
name="HP"
|
|
|
|
color={Settings.theme.hp}
|
|
|
|
data={{
|
|
|
|
content: `${numeralWrapper.formatHp(props.sleeve.hp)} / ${numeralWrapper.formatHp(props.sleeve.max_hp)}`,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Hacking"
|
|
|
|
color={Settings.theme.hack}
|
|
|
|
data={{ level: props.sleeve.hacking, exp: props.sleeve.hacking_exp }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Strength"
|
|
|
|
color={Settings.theme.combat}
|
|
|
|
data={{ level: props.sleeve.strength, exp: props.sleeve.strength_exp }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Defense"
|
|
|
|
color={Settings.theme.combat}
|
|
|
|
data={{ level: props.sleeve.defense, exp: props.sleeve.defense_exp }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Dexterity"
|
|
|
|
color={Settings.theme.combat}
|
|
|
|
data={{ level: props.sleeve.dexterity, exp: props.sleeve.dexterity_exp }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Agility"
|
|
|
|
color={Settings.theme.combat}
|
|
|
|
data={{ level: props.sleeve.agility, exp: props.sleeve.agility_exp }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Charisma"
|
|
|
|
color={Settings.theme.cha}
|
|
|
|
data={{ level: props.sleeve.charisma, exp: props.sleeve.charisma_exp }}
|
2022-03-11 05:47:18 +01:00
|
|
|
/>
|
2022-03-08 03:03:23 +01:00
|
|
|
<TableRow>
|
|
|
|
<TableCell classes={{ root: classes.cellNone }}>
|
|
|
|
<br />
|
|
|
|
</TableCell>
|
|
|
|
</TableRow>
|
2022-04-07 01:30:08 +02:00
|
|
|
<StatsRow
|
|
|
|
name="Shock"
|
|
|
|
color={Settings.theme.primary}
|
|
|
|
data={{ content: numeralWrapper.formatSleeveShock(100 - props.sleeve.shock) }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Sync"
|
|
|
|
color={Settings.theme.primary}
|
|
|
|
data={{ content: numeralWrapper.formatSleeveSynchro(props.sleeve.sync) }}
|
|
|
|
/>
|
|
|
|
<StatsRow
|
|
|
|
name="Memory"
|
|
|
|
color={Settings.theme.primary}
|
|
|
|
data={{ content: numeralWrapper.formatSleeveMemory(props.sleeve.memory) }}
|
|
|
|
/>
|
2022-03-08 03:03:23 +01:00
|
|
|
</TableBody>
|
|
|
|
</Table>
|
2022-04-07 01:30:08 +02:00
|
|
|
);
|
2021-03-16 04:40:28 +01:00
|
|
|
}
|
2022-03-08 03:03:23 +01:00
|
|
|
|
|
|
|
export function EarningsElement(props: IProps): React.ReactElement {
|
|
|
|
const classes = useStyles();
|
|
|
|
const player = use.Player();
|
|
|
|
|
|
|
|
let data: any[][] = [];
|
|
|
|
if (props.sleeve.currentTask === SleeveTaskType.Crime) {
|
|
|
|
data = [
|
2022-04-07 01:30:08 +02:00
|
|
|
[
|
|
|
|
`Money`,
|
|
|
|
<>
|
|
|
|
<Money money={parseFloat(props.sleeve.currentTaskLocation)} /> (on success)
|
|
|
|
</>,
|
|
|
|
],
|
2022-03-08 03:03:23 +01:00
|
|
|
[`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:`, <MoneyRate money={5 * props.sleeve.gainRatesForTask.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:`, <ReputationRate reputation={5 * repGain} />]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2022-04-07 01:30:08 +02:00
|
|
|
<Table sx={{ display: "table", mb: 1, width: "100%", lineHeight: 0 }}>
|
2022-03-08 03:03:23 +01:00
|
|
|
<TableBody>
|
|
|
|
<TableRow>
|
|
|
|
<TableCell classes={{ root: classes.cellNone }}>
|
2022-04-07 01:30:08 +02:00
|
|
|
<Typography variant="h6">Earnings</Typography>
|
2022-03-08 03:03:23 +01:00
|
|
|
</TableCell>
|
|
|
|
</TableRow>
|
|
|
|
{data.map(([a, b]) => (
|
|
|
|
<TableRow key={a.toString() + b.toString()}>
|
|
|
|
<TableCell classes={{ root: classes.cellNone }}>
|
|
|
|
<Typography>{a}</Typography>
|
|
|
|
</TableCell>
|
|
|
|
<TableCell align="right" classes={{ root: classes.cellNone }}>
|
|
|
|
<Typography>{b}</Typography>
|
|
|
|
</TableCell>
|
|
|
|
</TableRow>
|
|
|
|
))}
|
|
|
|
</TableBody>
|
|
|
|
</Table>
|
2022-04-07 01:30:08 +02:00
|
|
|
);
|
2022-03-11 05:21:02 +01:00
|
|
|
}
|