feat: label crazy-mode high scores instead of hiding them

Previously a game that used crazy mode kept its local high score but
skipped the online submission entirely. The requirement changed: crazy
scores should count like any other score, but be recognisable as crazy.

Changes:
- Crazy-mode use is now tracked per player (Player::crazy_mode_used)
  rather than per game. Balls dropped during one player's turn cannot
  outlive that turn, so only the player who pressed the key is marked;
  the other players' scores stay normal.
- Event::HighScoreCandidate carries { score, crazy } so the app knows
  which kind of score the name-entry dialog is about to record.
- HighScore gains `crazy: bool` with #[serde(default)]. Save files and
  server responses from before this change load as normal scores.
- The high-score table draws a small red "CRAZY" tag in the empty
  column right of the score. That column is free regardless of name or
  score length, so the tag never overlaps text.
- The browser build submits every score again, flag included. The
  companion server change stores it; an older server ignores the field.

Test Plan:
- cargo test
  - crazy_scores_are_flagged_on_the_high_score_candidate
  - high_scores_without_a_crazy_flag_load_as_normal_scores
- Manual: use crazy mode, finish with a qualifying score, and check the
  table (F9) shows the entry with the red CRAZY tag; a normal game's
  entry has none.
This commit is contained in:
ddidderr committed 2026-10-10 11:14:40 +02:00
1 parent 1a216dc795
commit 3a00be5661
6 files changed
+89 -30

No files matched your search

+3 -2
View File
@@ -11,8 +11,9 @@ and this project adheres to
### Added
- Crazy mode: Ctrl+Shift+0 drops ten extra balls onto the playfield. They bounce
and score off walls, bumpers, and flippers, replace the main ball when it
drains, and keep the game's scores off the online high-score table.
and score off walls, bumpers, and flippers and replace the main ball when it
drains. High-score entries of players who used it show a red `CRAZY` label in
the table and are shared like any other score.
- The high-score service stores a crazy-mode flag per entry; it adds the column
to existing databases on startup and treats submissions from older clients as
normal scores.