diff --git a/src/Infiltration/ui/WireCuttingGame.tsx b/src/Infiltration/ui/WireCuttingGame.tsx index f70d82175..425773ea6 100644 --- a/src/Infiltration/ui/WireCuttingGame.tsx +++ b/src/Infiltration/ui/WireCuttingGame.tsx @@ -4,7 +4,6 @@ import { Box, Paper, Typography } from "@mui/material"; import { AugmentationName } from "@enums"; import { Player } from "@player"; import { Settings } from "../../Settings/Settings"; -import { KEY } from "../../utils/helpers/keyCodes"; import { random } from "../utils"; import { interpolate } from "./Difficulty"; import { GameTimer } from "./GameTimer"; @@ -32,19 +31,17 @@ const difficulties: { Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 }, }; -const types = [KEY.PIPE, KEY.DOT, KEY.FORWARD_SLASH, KEY.HYPHEN, "█", KEY.HASH]; - const colors = ["red", "#FFC107", "blue", "white"]; const colorNames: Record = { - red: "red", - "#FFC107": "yellow", - blue: "blue", - white: "white", + red: "RED", + "#FFC107": "YELLOW", + blue: "BLUE", + white: "WHITE", }; interface Wire { - wireType: string; + wireType: string[]; colors: string[]; } @@ -142,7 +139,7 @@ export function WireCuttingGame({ onSuccess, onFailure, difficulty }: IMinigameP ); })} - {new Array(8).fill(0).map((_, i) => ( + {new Array(11).fill(0).map((_, i) => ( {wires.map((wire, j) => { if ((i === 3 || i === 4) && cutWires[j]) { @@ -153,7 +150,7 @@ export function WireCuttingGame({ onSuccess, onFailure, difficulty }: IMinigameP hasAugment && !isCorrectWire ? Settings.theme.disabled : wire.colors[i % wire.colors.length]; return ( - |{wire.wireType}| + |{wire.wireType[i % wire.wireType.length]}| ); })} @@ -172,7 +169,7 @@ function randomPositionQuestion(wires: Wire[]): Question { toString: (): string => { return `Cut wires number ${index + 1}.`; }, - shouldCut: (wire: Wire, i: number): boolean => { + shouldCut: (_wire: Wire, i: number): boolean => { return index === i; }, }; @@ -209,8 +206,9 @@ function generateWires(difficulty: Difficulty): Wire[] { if (Math.random() < 0.15) { wireColors.push(colors[Math.floor(Math.random() * colors.length)]); } + const wireType = [...wireColors.map((color) => colorNames[color]).join("")]; wires.push({ - wireType: types[Math.floor(Math.random() * types.length)], + wireType, colors: wireColors, }); }