Skip to content

fix(parser): set-base-P/T toughness-only axis ("change ~'s base toughness to <value>")#4692

Merged
matthewevans merged 1 commit into
phase-rs:mainfrom
minion1227:minion_base_toughness
Jul 1, 2026
Merged

fix(parser): set-base-P/T toughness-only axis ("change ~'s base toughness to <value>")#4692
matthewevans merged 1 commit into
phase-rs:mainfrom
minion1227:minion_base_toughness

Conversation

@minion1227

Copy link
Copy Markdown
Contributor

The base-P/T set-clause parser handled the power-only and both-axes forms ("~'s base power [and toughness] …") but not the toughness-only axis, so "change ~'s base toughness to " fell to Effect::Unimplemented.

Two symmetric adjustments in try_parse_subject_base_pt_set_clause_ast:

  • parse_base_pt_axes now accepts a leading "base toughness" (set_power:false, set_toughness:true), mirroring the existing power-only axis. Tried first; it cannot shadow the both-axes form, which always opens with "base power".
  • the possessive subject capture anchors on "'s base " instead of "'s base power" so the toughness-only characteristic word reaches parse_base_pt_axes for classification.

The per-axis emission (SetToughnessDynamic only, base power untouched) and every value form (fixed / single-axis dynamic / paired referent) are reused verbatim — no new variant. Unlocks Wall of Tombstones ("change this creature's base toughness to 1 plus the number of creature cards in your graveyard") and completes the axis symmetry for the class.

Sentinel additionally needs the "blocking or blocked by ~" combat-relation target filter in its value referent — a separate gap, left for its own change.

Tests: toughness-only change-form test (asserts SetToughnessDynamic and that base power is not touched). cargo fmt + clippy + the parser combinator gate are clean; 2307 oracle_effect + 118 subject-module tests green (power/both-axes regression intact).

🤖 Generated with Claude Code

…ness to <value>")

The base-P/T set-clause parser handled the power-only and both-axes forms
("~'s base power [and toughness] …") but not the toughness-only axis, so
"change ~'s base toughness to <value>" fell to Effect::Unimplemented.

Two symmetric adjustments in `try_parse_subject_base_pt_set_clause_ast`:
- `parse_base_pt_axes` now accepts a leading "base toughness" (set_power:false,
  set_toughness:true), mirroring the existing power-only axis. It is tried first
  and cannot shadow the both-axes form, which always opens with "base power".
- the possessive subject capture anchors on "'s base " instead of "'s base power"
  so the toughness-only characteristic word reaches `parse_base_pt_axes` for
  classification.

The per-axis emission (`SetToughnessDynamic` only, base power untouched) and every
value form (fixed / single-axis dynamic / paired referent) are reused verbatim —
no new variant. Unlocks Wall of Tombstones ("change this creature's base
toughness to 1 plus the number of creature cards in your graveyard") and completes
the axis symmetry for the class. (Sentinel additionally needs the "blocking or
blocked by ~" combat-relation target filter in its value referent — a separate
gap, left for its own change.)

Tests: toughness-only change-form test (asserts SetToughnessDynamic and that base
power is not touched). fmt + clippy + parser combinator gate clean; 2307
oracle_effect + 118 subject-module tests green (power/both-axes regression intact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@minion1227 minion1227 requested a review from matthewevans as a code owner July 1, 2026 05:46
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Parse changes introduced by this PR · 1 card(s), 2 signature(s) (baseline: main 8e3e928c310e)

1 card(s) · ability/change · removed: change

Examples: Wall of Tombstones

1 card(s) · ability/set base toughness dynamic · added: set base toughness dynamic (affects=self, grants=set base toughness dynamic)

Examples: Wall of Tombstones

2 card(s) had Oracle-text changes (errata/reprint) — excluded as non-parser.

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maintainer review: passes the authorized review bar at head 7d8f10fc760363c86b9535d480f22caa559ac129.

@matthewevans matthewevans added the bug Bug fix label Jul 1, 2026
@matthewevans matthewevans added this pull request to the merge queue Jul 1, 2026
Merged via the queue into phase-rs:main with commit c5c1c81 Jul 1, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants