INFILTRATION: Rename variables in slash game (#1253)

This PR renames variables in the slash game to match the new description/wording in #1243.
This commit is contained in:
catloversg 2024-05-10 15:39:20 +07:00 committed by GitHub
parent 2414949c2c
commit e55387df4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -34,14 +34,14 @@ export function SlashGame({ difficulty, onSuccess, onFailure }: IMinigameProps):
// Determine timeframes for game phase changes
const newDifficulty: Difficulty = { window: 0 };
interpolate(difficulties, difficulty, newDifficulty);
const timePreparing =
const distractedTime =
newDifficulty.window * (Player.hasAugmentation(AugmentationName.WKSharmonizer, true) ? 1.3 : 1);
const timeAttacking = 250;
const timeGuarding = Math.random() * 3250 + 1500 - (timeAttacking + timePreparing);
const alertedTime = 250;
const guardingTime = Math.random() * 3250 + 1500 - (distractedTime + alertedTime);
// Set initial game state
setPhase(0);
setGuardingTime(timeGuarding);
setGuardingTime(guardingTime);
setHasAugment(Player.hasAugmentation(AugmentationName.MightOfAres, true));
// Setup timer for game phases
@ -49,9 +49,9 @@ export function SlashGame({ difficulty, onSuccess, onFailure }: IMinigameProps):
setPhase(1);
id = setTimeout(() => {
setPhase(2);
id = setTimeout(() => onFailure(), timeAttacking);
}, timePreparing);
}, timeGuarding);
id = setTimeout(() => onFailure(), alertedTime);
}, distractedTime);
}, guardingTime);
return () => clearTimeout(id);
}, [difficulty, onSuccess, onFailure]);