Skip to content

Add optional AI opponent name to puzzles, with new Duelist #5 puzzle "Eeny Meeny Miney Moe" - #11620

Open
dennisfriedrichsen wants to merge 17 commits into
Card-Forge:masterfrom
dennisfriedrichsen:duelist-puzzles
Open

Add optional AI opponent name to puzzles, with new Duelist #5 puzzle "Eeny Meeny Miney Moe"#11620
dennisfriedrichsen wants to merge 17 commits into
Card-Forge:masterfrom
dennisfriedrichsen:duelist-puzzles

Conversation

@dennisfriedrichsen

@dennisfriedrichsen dennisfriedrichsen commented Aug 14, 2026

Copy link
Copy Markdown

Summary

  • Add support for an optional AIName metadata field in .pzl puzzle files, which is displayed to the player as "Opponent: " in the puzzle goal description.
  • Add a name field to GameState.PlayerState and wire it up in parseLine/setupPlayerState so that a humanName=/aiName= line in a puzzle's [state] section actually sets the player's display name in-game (this key already existed unused in some puzzle files).
  • Add a new puzzle, "Duelist 5 - Eeny Meeny Miney Moe," using this new functionality. This puzzle appeared in The Duelist magazine number 5 (June 1995). This puzzle has been tested as solvable under current rules in Forge.

Details

  • Puzzle.java: parses AIName from [metadata], exposes it via getAIName(), and includes it in getGoalDescription().
  • GameState.java: generic prefix/suffix key dispatch already handled human/ai prefixes; this adds a name suffix so <player>Name= in the [state] section calls Player.setName() during setup.
  • Duelist_Number_5.pzl: new puzzle file exercising both the new metadata field and per-card Set:3ED tagging.

Test plan

  • Load the new puzzle in-game and confirm the opponent's name displays correctly in the goal dialog and in-game
  • Confirm existing puzzles without AIName/Name state keys still load and behave unchanged

@dennisfriedrichsen
dennisfriedrichsen marked this pull request as ready for review August 14, 2026 23:39
@Agetian
Agetian requested review from Jetz72 and kevlahnota August 15, 2026 05:19
@Agetian

Agetian commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Looks alright to me, the HostedMatch modification needs additional review imo because I'm not sure if that implementation is sturdy enough (not my area of expertise), otherwise lgtm.

@Agetian
Agetian self-requested a review August 15, 2026 05:20
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.

2 participants