INFILTRATION: Update slash game wording / balance (#1243)

This commit is contained in:
catloversg
2024-05-07 01:07:27 +07:00
committed by GitHub
parent a79d7f9e45
commit bc71b8e18f
3 changed files with 21 additions and 16 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ type GameTimerProps = {
onExpire: () => void;
noPaper?: boolean;
ignoreAugment_WKSharmonizer?: boolean;
tick?: number;
};
export function GameTimer({
@@ -16,12 +17,12 @@ export function GameTimer({
onExpire,
noPaper,
ignoreAugment_WKSharmonizer,
tick = 100,
}: GameTimerProps): React.ReactElement {
const [v, setV] = useState(100);
const totalMillis =
(!ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.3 : 1) * millis;
const tick = 200;
useEffect(() => {
const intervalId = setInterval(() => {
setV((old) => {
@@ -33,7 +34,7 @@ export function GameTimer({
return () => {
clearInterval(intervalId);
};
}, [onExpire, totalMillis]);
}, [onExpire, tick, totalMillis]);
// https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation
// TODO(hydroflame): there's like a bug where it triggers the end before the
+13 -9
View File
@@ -19,10 +19,10 @@ const difficulties: {
Hard: Difficulty;
Impossible: Difficulty;
} = {
Trivial: { window: 600 },
Normal: { window: 325 },
Hard: { window: 250 },
Impossible: { window: 150 },
Trivial: { window: 800 },
Normal: { window: 500 },
Hard: { window: 350 },
Impossible: { window: 250 },
};
export function SlashGame({ difficulty, onSuccess, onFailure }: IMinigameProps): React.ReactElement {
@@ -70,17 +70,21 @@ export function SlashGame({ difficulty, onSuccess, onFailure }: IMinigameProps):
<>
<GameTimer millis={5000} onExpire={onFailure} ignoreAugment_WKSharmonizer />
<Paper sx={{ display: "grid", justifyItems: "center" }}>
<Typography variant="h4">Attack when his guard is down!</Typography>
<Typography variant="h4" textAlign="center">
Attack after the guard drops his guard and is distracted. Do not alert him!
</Typography>
<br></br>
{hasAugment && (
<Box sx={{ my: 1 }}>
<Typography variant="h5">Guard will drop in...</Typography>
<GameTimer millis={guardingTime} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper />
<Typography variant="h5">The guard will drop his guard and be distracted in ...</Typography>
<GameTimer millis={guardingTime} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper tick={20} />
<br></br>
</Box>
)}
{phase === 0 && <Typography variant="h4">Guarding ...</Typography>}
{phase === 1 && <Typography variant="h4">Preparing?</Typography>}
{phase === 2 && <Typography variant="h4">ATTACKING!</Typography>}
{phase === 1 && <Typography variant="h4">Distracted!</Typography>}
{phase === 2 && <Typography variant="h4">Alerted!</Typography>}
<KeyHandler onKeyDown={press} onFailure={onFailure} />
</Paper>
</>