Skip to content

Battle simulator: turn timing and the end of a game follow the APR and Tournament Rules - #359

Merged
cheyras merged 1 commit into
mainfrom
sim/rules-timing
Oct 20, 2026
Merged

cheyras merged 1 commit into
mainfrom
sim/rules-timing

Conversation

@cheyras

@cheyras cheyras commented Oct 20, 2026

Copy link
Copy Markdown
Owner

This follows up #357. Everything that pass left on purpose was checked against the Advanced Player's Rulebook v3.4 (2025) and the Play! Pokémon Tournament Rules Handbook. The five items that break the rules now follow them. Decision: decisions/2026/2026-10-19-battle-simulator-turn-timing-and-the-end-of-a-game-follow-the-advanced-player-s.md.

  • Tiebreaker game with 6 Prize cards, won by the first player to have fewer Prize cards left (APR "Games can result in a tie"; Tournament Rules 5.8.3.1). This corrects Battle simulator: rules checked against PTCG Live's engine and the official rulings #357's 1-Prize sudden death, which followed older wording.
  • "During this turn / your next turn / your opponent's next turn" effects end before Pokémon Checkup, because Checkup is in neither player's turn (APR E-02). "Until the end of your next turn" still applies in it (E-22, E-23).
  • Knock Outs from end-of-turn effects are resolved before Checkup. A Knock Out is checked whenever HP becomes zero (APR D), so Checkup healing can no longer save a Pokémon already at 0.
  • Setup is face down. Both players' Active and Bench choices stay hidden in hand and go into play together when the game starts (APR G, steps 5–8).
  • The turn cap is time being called. The turn is finished, 3 more are played, then the player with fewer Prize cards left wins (reason time). Level, play goes on until one player is ahead (Tournament Rules 5.8.3). Only a long stalemate stays a turn limit draw.

Not changed, because they break no rule: the CPU choosing to go first, and Energy/damage-counter moves written per card.

Verification

  • @deckpal/sim: 3,242 tests pass. New rule tests in rules-timing and rules-checklist; each new behavioural test fails with its fix disabled.
  • All 36 real PTCG Live games (26 of the owner's logs, which are not committed, plus the 10 fixtures) still replay to the end with matching winners.
  • Fuzz: 4,000 random games, 0 failures. The 90 former turn-limit draws now end by time (40) or a tiebreaker game (6).
  • deckpal-api test:deck 261, @deckpal/agent-tools 398, and tsc --noEmit across workspaces are clean.
  • determinism.test.ts re-pinned: 18 of 40 seeded games change, mostly because setup events are now ordered by the face-down reveal.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MKj6CMZ1kKCNaVjKSHgJpx

…ed Player's Rulebook and the Tournament Rules

Tiebreaker game with 6 Prize cards, won by the first player with fewer left
(APR; Tournament Rules 5.8.3.1). "During ..." effects end before Pokemon
Checkup, "until the end of ..." ones last through it (APR E-02, E-22, E-23).
Knock Outs from end-of-turn effects are resolved before Checkup (APR D).
Setup is face down and revealed when the game starts (APR G). The turn cap is
time being called: +3 turns, then fewer Prize cards left wins (5.8.3).

On-Behalf-Of: @cheyras
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MKj6CMZ1kKCNaVjKSHgJpx
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
deckpal Ready Ready Preview Oct 20, 2026 1:39am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approved automatically: authored by the repository owner, from a branch in this repo. GitHub forbids self-approval, so this stands in for it (AGENTS.md B12). Required status checks still apply — this does not merge anything.

@cheyras
cheyras merged commit 5621950 into main Oct 20, 2026
23 of 25 checks passed
@cheyras
cheyras deleted the sim/rules-timing branch October 20, 2026 02:00

This branch was successfully deployed

1 active deployment
Preview — 9d933caa Deployed Oct 20, 2026 by vercel[bot]
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.

1 participant