Skip to content

fix(parser): bind "those creatures" after "draw for each creature" to the count filter (#6065) - #6109

Merged
matthewevans merged 1 commit into
phase-rs:mainfrom
jaytbarimbao-collab:fix/inspiring-call-those-creatures-count-filter
Jul 17, 2026
Merged

fix(parser): bind "those creatures" after "draw for each creature" to the count filter (#6065)#6109
matthewevans merged 1 commit into
phase-rs:mainfrom
jaytbarimbao-collab:fix/inspiring-call-those-creatures-count-filter

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Fixes #6065

Problem

Inspiring Call — "Draw a card for each creature you control with a +1/+1 counter on it. Those creatures gain indestructible until end of turn." — drew the right number of cards but never granted indestructible.

"Those creatures" lowers to TargetFilter::ParentTarget. The chain assembler only rebinds that anaphor when a prior clause is a tracked-set publisher (publishes_tracked_set_from_resolution — exile/token/PutCounterAll/…). Effect::Draw is not a publisher (it publishes nothing at resolution; its target is the drawing player), so the rebind was skipped and ParentTarget survived — resolving at runtime to the Draw's target, the controller. The grant landed on a player, so no creatures gained indestructible.

Fix

Draw a card for each <filter> carries the counted creatures in its count: ObjectCount { filter }, not in a tracked set. So in the cross-clause pronoun block (assembly.rs), when there is no tracked-set publisher but the nearest prior clause is such a Draw, bind the following "those creatures" grant's ParentTarget directly to that count filter.

Scoping: the new branch is an else to the existing any_prior_publishes path, so the PutCounterAll → TrackedSet(0) behavior (Nalia de'Arnise) is untouched. It only fires for a Draw{count: ObjectCount{filter}} antecedent + an explicit "those creatures" pronoun. Only the grant surface (GenericEffect) is rewritten. This is a 1-card class today (Inspiring Call is the only "draw for each creature … those creatures gain" card).

The resulting continuous keyword grant to a Typed creature filter is the standard anthem-style path (Archangel Avacyn etc.) — no runtime change needed.

Tests

  • Parser (inspiring_call_those_creatures_bind_to_draw_count_filter): the grant binds to the counted Typed creature filter, not ParentTarget/TrackedSet. The existing Nalia test (PutCounterAll → TrackedSet(0)) is the regression guard and stays green.
  • Runtime (inspiring_call_indestructible_grant.rs): casts Inspiring Call (live-parsed) with one creature carrying a +1/+1 counter and one without — the countered creature gains indestructible, the other does not (the grant resolves to the counted set, not to all creatures or the controller).

CR: 603.7.

… the count filter (phase-rs#6065)

Inspiring Call — "Draw a card for each creature you control with a +1/+1 counter
on it. Those creatures gain indestructible until end of turn." — drew the right
number of cards but never granted indestructible.

"Those creatures" lowers to ParentTarget. The chain assembler only rebinds that
anaphor when a prior clause publishes a tracked set at resolution
(publishes_tracked_set_from_resolution — exile / token / PutCounterAll / ...).
Effect::Draw is not a publisher (it publishes nothing at resolution; its target
is the drawing player), so the rebind was skipped and ParentTarget survived,
resolving at runtime to the controller — the grant landed on a player, so no
creatures gained indestructible.

Add an else branch to the cross-clause pronoun block: when no prior clause
publishes a tracked set but the nearest prior clause is a
Draw{count: ObjectCount{filter}}, bind the following "those creatures" grant's
ParentTarget directly to that count filter. Scoped so the PutCounterAll ->
TrackedSet(0) path (Nalia de'Arnise) is untouched; only the GenericEffect grant
surface is rewritten. One-card class today (Inspiring Call).

Tests: a parser test (the grant binds to the Typed counted-creature filter, not
ParentTarget) with the Nalia test as the regression guard, and a runtime test
that casts Inspiring Call and asserts only the countered creature gains
indestructible.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR · 1 card(s), 1 signature(s) (baseline: main 34ef7ddd5c51)

🟡 Modified fields (1 signature)

  • 1 card · 🔄 ability/grant Indestructible · changed field affects: parent target1+ P1P1 counters you control creature
    • Affected (first 3): Inspiring Call

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

@matthewevans matthewevans self-assigned this Jul 17, 2026
@matthewevans matthewevans added the bug Bug fix label Jul 17, 2026

@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.

Approved — current-head review confirms the intended one-card Inspiring Call parse-diff, the count-filter rebind at the existing assembly seam, and a discriminating cast/resolve regression for countered versus plain creatures.

@matthewevans
matthewevans added this pull request to the merge queue Jul 17, 2026
@matthewevans matthewevans removed their assignment Jul 17, 2026
Merged via the queue into phase-rs:main with commit 7afcff9 Jul 17, 2026
13 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.

Inspiring Call does not grant indestructible to creatures with +1/+1 counters

2 participants