Update Victory

This commit is contained in:
nickofolas 2022-04-24 18:49:46 -05:00
parent b772d5157e
commit ae8b6d088e
3 changed files with 36 additions and 38 deletions

@ -152,6 +152,7 @@ const positive = [
"patient", "patient",
"dynamic", "dynamic",
"loyal", "loyal",
"based",
]; ];
const negative = [ const negative = [
@ -175,4 +176,5 @@ const negative = [
"picky", "picky",
"tactless", "tactless",
"thoughtless", "thoughtless",
"cringe",
]; ];

@ -1,5 +1,6 @@
import { Button, Container, Paper, Typography } from "@mui/material"; import { Button, Container, Paper, Typography } from "@mui/material";
import React, { useState } from "react"; import React, { useState } from "react";
import { Location } from "../../Locations/Location";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { BackwardGame } from "./BackwardGame"; import { BackwardGame } from "./BackwardGame";
@ -139,9 +140,11 @@ export function Game(props: IProps): React.ReactElement {
return ( return (
<Container> <Container>
<Paper sx={{ p: 1, mb: 1, display: "grid", justifyItems: "center", gap: 1 }}> <Paper sx={{ p: 1, mb: 1, display: "grid", justifyItems: "center", gap: 1 }}>
<Button sx={{ width: "100%" }} onClick={cancel}> {stage !== Stage.Sell && (
Cancel <Button sx={{ width: "100%" }} onClick={cancel}>
</Button> Cancel Infiltration
</Button>
)}
<Typography variant="h5"> <Typography variant="h5">
Level {level} / {props.MaxLevel} Level {level} / {props.MaxLevel}
</Typography> </Typography>

@ -1,13 +1,8 @@
import { Factions } from "../../Faction/Factions"; import { Factions } from "../../Faction/Factions";
import React, { useState } from "react"; import React, { useState } from "react";
import Grid from "@mui/material/Grid";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { Reputation } from "../../ui/React/Reputation"; import { Reputation } from "../../ui/React/Reputation";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import MenuItem from "@mui/material/MenuItem";
import Select, { SelectChangeEvent } from "@mui/material/Select";
import { FactionNames } from "../../Faction/data/FactionNames"; import { FactionNames } from "../../Faction/data/FactionNames";
import { formatNumber } from "../../utils/StringHelperFunctions"; import { formatNumber } from "../../utils/StringHelperFunctions";
import { import {
@ -16,6 +11,8 @@ import {
calculateTradeInformationRepReward, calculateTradeInformationRepReward,
} from "../formulas/victory"; } from "../formulas/victory";
import { inviteToFaction } from "../../Faction/FactionHelpers"; import { inviteToFaction } from "../../Faction/FactionHelpers";
import { Button, MenuItem, Select, SelectChangeEvent, Paper, Typography, Box } from "@mui/material";
import { Location } from "../../Locations/Location";
interface IProps { interface IProps {
StartingDifficulty: number; StartingDifficulty: number;
@ -66,24 +63,22 @@ export function Victory(props: IProps): React.ReactElement {
} }
return ( return (
<> <Paper sx={{ p: 1, textAlign: "center", display: "flex", alignItems: "center", flexDirection: "column" }}>
<Grid container spacing={3}> <Typography variant="h4">Infiltration successful!</Typography>
<Grid item xs={10}> <Typography variant="h5" color="primary" width="75%">
<Typography variant="h4">Infiltration successful!</Typography> You{" "}
</Grid> {isMemberOfInfiltrators ? (
<Grid item xs={10}> <>
<Typography variant="h5" color="primary"> have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{" "}
You{" "} </>
{isMemberOfInfiltrators ? ( ) : (
<> <></>
have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{" "} )}
</> can trade the confidential information you found for money or reputation.
) : ( </Typography>
<></> <Box sx={{ width: "fit-content" }}>
)} <Box sx={{ width: "100%" }}>
can trade the confidential information you found for money or reputation. <Select value={faction} onChange={changeDropdown} sx={{ mr: 1 }}>
</Typography>
<Select value={faction} onChange={changeDropdown}>
<MenuItem key={"none"} value={"none"}> <MenuItem key={"none"} value={"none"}>
{"none"} {"none"}
</MenuItem> </MenuItem>
@ -98,17 +93,15 @@ export function Victory(props: IProps): React.ReactElement {
<Button onClick={trade}> <Button onClick={trade}>
Trade for <Reputation reputation={repGain} /> reputation Trade for <Reputation reputation={repGain} /> reputation
</Button> </Button>
</Grid> </Box>
<Grid item xs={3}> <Button onClick={sell} sx={{ width: "100%" }}>
<Button onClick={sell}> Sell for&nbsp;
Sell for&nbsp; <Money money={moneyGain} />
<Money money={moneyGain} /> </Button>
</Button> </Box>
</Grid> <Button onClick={quitInfiltration} sx={{ width: "100%", mt: 1 }}>
<Grid item xs={3}> Quit
<Button onClick={quitInfiltration}>Quit</Button> </Button>
</Grid> </Paper>
</Grid>
</>
); );
} }