Fix: Prevent bonus round reappearance on reload and enable autoplay after wrong guess
This commit is contained in:
@@ -257,5 +257,18 @@ export function useGameState(genre: string | null = null, maxAttempts: number =
|
||||
saveState(newState);
|
||||
};
|
||||
|
||||
return { gameState, statistics, addGuess, giveUp, addReplay, addYearBonus };
|
||||
const skipYearBonus = () => {
|
||||
if (!gameState) return;
|
||||
|
||||
const newBreakdown = [...gameState.scoreBreakdown, { value: 0, reason: 'Bonus: Skipped' }];
|
||||
|
||||
const newState = {
|
||||
...gameState,
|
||||
scoreBreakdown: newBreakdown,
|
||||
yearGuessed: true
|
||||
};
|
||||
saveState(newState);
|
||||
};
|
||||
|
||||
return { gameState, statistics, addGuess, giveUp, addReplay, addYearBonus, skipYearBonus };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user