Skip to content

Implementing tracking for seen action cards by Yssaril - #4763

Open
wholton with Copilot wants to merge 10 commits into
masterfrom
copilot/track-yssaril-seen-cards
Open

Implementing tracking for seen action cards by Yssaril#4763
wholton with Copilot wants to merge 10 commits into
masterfrom
copilot/track-yssaril-seen-cards

Conversation

Copilot AI commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

Copilot AI and others added 9 commits April 19, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds persistence-backed tracking of action cards a player has seen in other players’ hands (primarily via Yssaril/Mageon-style reveals) and a cards-info UI to display that tracked knowledge.

Changes:

  • Introduces KnownActionCardsService to remember revealed/seen action cards per viewer, forget them when cards leave a target’s hand, and render a “known cards” summary.
  • Hooks tracking into existing reveal flows (ActionCardHelper.showAll, /show_ac, /show_to_all) and into Player.removeActionCard(...) so knowledge is updated as hands change.
  • Adds a Cards Info button + handler to display known action cards; includes a new JUnit test suite for the service.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/ti4/service/actioncard/KnownActionCardsService.java Core logic for storing/removing/rendering “known action cards” per viewer/target.
src/main/java/ti4/helpers/ActionCardHelper.java Remembers full-hand knowledge after showAll(...) reveals.
src/main/java/ti4/game/Player.java Forgets known cards across viewers when an action card is removed from a player’s hand.
src/main/java/ti4/discord/interactions/commands/cardsac/ShowACToAll.java Tracks publicly revealed cards for all other players.
src/main/java/ti4/discord/interactions/commands/cardsac/ShowAC.java Tracks a single-player reveal (but currently still mutates hand; see PR comment).
src/main/java/ti4/service/info/CardsInfoService.java Adds “Show Known Action Cards” button when applicable.
src/main/java/ti4/discord/interactions/buttons/handlers/info/CardsInfoButtonHandler.java Button handler sends known-action-card summary to the player’s cards info thread.
src/test/java/ti4/service/actioncard/KnownActionCardsServiceTest.java Unit tests for tracking, forgetting, display text, and button visibility.

Comment on lines 58 to 62
return;
}

ActionCardHelper.sendActionCardInfo(game, player);
KnownActionCardsService.rememberShownActionCard(playerToShowTo, player, acID);
MessageHelper.sendMessageToPlayerCardsInfoThread(playerToShowTo, sb);

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command still mutates the source player’s hand by calling player.setActionCard(acID) earlier in execute(). setActionCard adds a new copy of the card (new identifier), so using /show_ac will duplicate the shown card instead of just revealing it. Remove that setActionCard call (and any other hand mutation) so the command is read-only aside from tracking via KnownActionCardsService.

Copilot uses AI. Check for mistakes.
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

🔬 Test Results

✅ JSON Validation

No JSON files changed.


✅ Formatting Checks Passed

All files pass Spotless formatting.


✅ JUnit Tests Passed

All tests passed successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants