Cards Against Humanity: Judging Improvements, Multiple Scoring Systems, Game Tests#242
Cards Against Humanity: Judging Improvements, Multiple Scoring Systems, Game Tests#242jage9 wants to merge 14 commits intoXGDevGroup:mainfrom
Conversation
Replace raw user.speak() with localized speak_l("hc-score-line") in
both _action_view_scores and _action_check_scores. Wire up the existing
but unused hc-you-are-judge FTL key so each judge hears a personal
announcement alongside the table broadcast.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers: metadata, startup, judge selection (rotating/random/winner), deck reshuffle, card toggling, submission validation, judging phase, win condition, score display (speak_l fix), judge personal announcement (hc-you-are-judge fix), round transitions, and bot game completion. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted custom view_scores action, its keybind, and handler — inherited check_scores from the base game does the same thing. Renamed the shared enabled-check to _is_playing_enabled. Updated tests to use check_scores. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…aned FTL keys
_action_check_scores_detailed was using a hardcoded English f-string;
replaced with Localization.get("hc-score-line"). Restored the enabled
callbacks (_is_check_scores_enabled, _is_check_scores_detailed_enabled)
to bypass the base class team_manager check — CAH uses player.score
directly. Removed orphaned FTL keys: hc-view-scores, hc-no-scores,
hc-waiting-for-submissions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…udge voting - Remove parametrized tuple from _is_submit_enabled — framework doesn't support it; action handler already validates and speaks hc-wrong-card-count - Remove hc-submission-progress broadcast — sound-only feedback sufficient - Rewrite _judge_pick for multi-judge: record each judge's vote in judge_picks, wait for all judges, then tally votes (most wins, tiebreak by earliest submission_order position). Judges can no longer re-vote. - Add hc-judge-voted FTL key for intermediate broadcast when waiting - Add 8 new tests covering multi-judge flow and fixed bugs (60 total) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Independent: each judge's vote awards 1 point to their chosen submission; all vote-getters score, announced highest-first with "gets N points for X". Jury: majority wins; tied submissions each receive 1 point. Random: method resolved randomly at judging start each round. Enforces Independent when num_judges <= 1 per spec. active_judging_method stored on game state so Random resolves consistently mid-round. Refactored _judge_pick resolution into _resolve_independent, _resolve_jury, _announce_and_score_winners, _announce_losing_submissions, _finish_round. Updated hc-winner-announcement FTL to include points and submission text. Adds 10 new tests (66 total). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…uction - Remove hc-judge-voted broadcast (keep sound only) - Wrap hc-all-submissions heading in guard — only shown when losers exist - Allow num_judges == num_players (all-judge mode): everyone submits AND judges - Self-voting blocked in _judge_pick, _is_judge_pick_enabled, _is_judge_pick_hidden - Update all judge-check guards in submit/toggle/view actions for all-judge bypass - _start_judging, submit completion check, _start_round use _get_submitters() - Bot submission and judging logic handle all-judge mode correctly - Add 8 new tests covering all-judge mode, self-vote prevention, no-losers heading Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…turn - hc-judge-is now uses $names (pre-formatted list) instead of $player/$others - _format_names helper: proper Oxford comma for 3+ names, "A and B" for 2 - Skip czar broadcast and personal "you are judge" messages in all-judge mode - _action_whose_turn during judging: list pending judges, not submission state - Add hc-waiting-for-judges FTL key for judging phase whose_turn response - 4 new tests: grammar (2-judge, 3-judge), all-judge silence, judging whose_turn Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eriod Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yeights - New bot.py: bot_think, _think_submitting, _think_judging - game.py: bot_think delegates to _bot_think(self, player) - _process_judging_bots now uses BotHelper.process_bot_action (same as submission) - Removed inline duplicate of judging selection logic Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- setup_teams("individual") in on_start — one team per player
- add_to_team_score when awarding points in _announce_and_score_winners
- Remove custom _is_check_scores_enabled, _is_check_scores_detailed_enabled,
_action_check_scores, _action_check_scores_detailed — base class handles all
- Update score display tests to match base class output format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove: options defaults, duplicate utility tests, sound-only tests, absence-of-removed-feature tests, redundant score display tests, duplicate judge announcement checks, internal callback tests, tests fully covered by bot game. Collapse related single-case tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test results
What's good
Issues1. Hardcoded English in user-visible label
return f"Choose the best card that matches: {prompt_text}"
return "Choose the best card"This is the prompt header rendered at the top of the judging menu — confirmed in CLI output: Per 2. Orphan FTL keys still in
|
This PR is a complete overhaul of the Humanity Cards implementation. It fixes a range of bugs found during code
review, brings the game into line with conventions used across the rest of the codebase, adds the judging method
option from the design spec, and ships a clean test suite.
Bug Fixes
from _is_submit_enabled (the framework only accepts str | None)
feedback
tracks each judge's vote independently
appended
replaced the $player/$others FTL variables with a single $names
Multi-Judge & All-Judge Mode
guards updated accordingly
Judging Methods (cah_options.md Part 4)
┌─────────────┬──────────────────────────────────────────────────────────────────────────────────┐
│ Method │ Behaviour │
├─────────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ Independent │ Each judge's vote awards 1 point; multiple players can score the same round │
├─────────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ Jury │ Majority wins 1 point; tied players each receive 1 point │
├─────────────┼──────────────────────────────────────────────────────────────────────────────────┤
│ Random │ Resolved once at judging start so the method stays consistent for the full round │
└─────────────┴──────────────────────────────────────────────────────────────────────────────────┘
Single-judge games always use Independent regardless of the setting.
whose_turn Fixes
Codebase Consistency
team_manager.setup_teams("individual") + add_to_team_score, exactly as Farkle, Crazy Eights, and every other scoring
game in the repo. S and Shift+S now go through the standard base class path.
Farkle and Crazy Eights. _process_judging_bots now uses BotHelper.process_bot_action instead of manual
tick/pending-action management.
Tests
52 outcome-focused tests covering: startup, judge selection (all 3 czar modes), deck reshuffle, card toggling,
submission validation, judging resolution, win condition, score display, round transitions, multi-judge voting, all
three judging methods, all-judge mode, self-vote prevention, grammar formatting, and two full bot game runs.