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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 16 deletions

@ -25,15 +25,15 @@ If you are reduced to `0` hp or below, the infiltration will immediately end.
- Some use WASD or arrows interchangeably. - Some use WASD or arrows interchangeably.
- A few others use the rest of the keyboard. - A few others use the rest of the keyboard.
### Slash when his guard is down! ### Attack the distracted guard
Press space when the guard is preparing to attack you. Press space bar to attack when the guard drops his guard and is distracted. Do not alert him!
There are 3 phases: There are 3 phases:
1. guarding - attacking back will result in failure. 1. Guarding - The guard is guarding. Attacking will result in a failure.
2. preparing - attacking will result in a victory. 2. Distracted - The guard is distracted. Attacking will result in a victory.
3. attacking - the guard will attack you resulting in failure. 3. Alerted - The guard is alerted. Attacking will result in a failure.
### Close the brackets ### Close the brackets

@ -9,6 +9,7 @@ type GameTimerProps = {
onExpire: () => void; onExpire: () => void;
noPaper?: boolean; noPaper?: boolean;
ignoreAugment_WKSharmonizer?: boolean; ignoreAugment_WKSharmonizer?: boolean;
tick?: number;
}; };
export function GameTimer({ export function GameTimer({
@ -16,12 +17,12 @@ export function GameTimer({
onExpire, onExpire,
noPaper, noPaper,
ignoreAugment_WKSharmonizer, ignoreAugment_WKSharmonizer,
tick = 100,
}: GameTimerProps): React.ReactElement { }: GameTimerProps): React.ReactElement {
const [v, setV] = useState(100); const [v, setV] = useState(100);
const totalMillis = const totalMillis =
(!ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.3 : 1) * millis; (!ignoreAugment_WKSharmonizer && Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.3 : 1) * millis;
const tick = 200;
useEffect(() => { useEffect(() => {
const intervalId = setInterval(() => { const intervalId = setInterval(() => {
setV((old) => { setV((old) => {
@ -33,7 +34,7 @@ export function GameTimer({
return () => { return () => {
clearInterval(intervalId); clearInterval(intervalId);
}; };
}, [onExpire, totalMillis]); }, [onExpire, tick, totalMillis]);
// https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation // https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation
// TODO(hydroflame): there's like a bug where it triggers the end before the // TODO(hydroflame): there's like a bug where it triggers the end before the

@ -19,10 +19,10 @@ const difficulties: {
Hard: Difficulty; Hard: Difficulty;
Impossible: Difficulty; Impossible: Difficulty;
} = { } = {
Trivial: { window: 600 }, Trivial: { window: 800 },
Normal: { window: 325 }, Normal: { window: 500 },
Hard: { window: 250 }, Hard: { window: 350 },
Impossible: { window: 150 }, Impossible: { window: 250 },
}; };
export function SlashGame({ difficulty, onSuccess, onFailure }: IMinigameProps): React.ReactElement { 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 /> <GameTimer millis={5000} onExpire={onFailure} ignoreAugment_WKSharmonizer />
<Paper sx={{ display: "grid", justifyItems: "center" }}> <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 && ( {hasAugment && (
<Box sx={{ my: 1 }}> <Box sx={{ my: 1 }}>
<Typography variant="h5">Guard will drop in...</Typography> <Typography variant="h5">The guard will drop his guard and be distracted in ...</Typography>
<GameTimer millis={guardingTime} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper /> <GameTimer millis={guardingTime} onExpire={() => null} ignoreAugment_WKSharmonizer noPaper tick={20} />
<br></br>
</Box> </Box>
)} )}
{phase === 0 && <Typography variant="h4">Guarding ...</Typography>} {phase === 0 && <Typography variant="h4">Guarding ...</Typography>}
{phase === 1 && <Typography variant="h4">Preparing?</Typography>} {phase === 1 && <Typography variant="h4">Distracted!</Typography>}
{phase === 2 && <Typography variant="h4">ATTACKING!</Typography>} {phase === 2 && <Typography variant="h4">Alerted!</Typography>}
<KeyHandler onKeyDown={press} onFailure={onFailure} /> <KeyHandler onKeyDown={press} onFailure={onFailure} />
</Paper> </Paper>
</> </>