fix(parser): bind "those creatures" after "draw for each creature" to the count filter (#6065) - #6109
Merged
matthewevans merged 1 commit intoJul 17, 2026
Conversation
… 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.
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Parse changes introduced by this PR · 1 card(s), 1 signature(s) (baseline: main
|
matthewevans
approved these changes
Jul 17, 2026
matthewevans
left a comment
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::Drawis not a publisher (it publishes nothing at resolution; itstargetis the drawing player), so the rebind was skipped andParentTargetsurvived — 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 itscount: 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 aDraw, bind the following "those creatures" grant'sParentTargetdirectly to that countfilter.Scoping: the new branch is an
elseto the existingany_prior_publishespath, so thePutCounterAll → TrackedSet(0)behavior (Nalia de'Arnise) is untouched. It only fires for aDraw{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
inspiring_call_those_creatures_bind_to_draw_count_filter): the grant binds to the counted Typed creature filter, notParentTarget/TrackedSet. The existing Nalia test (PutCounterAll → TrackedSet(0)) is the regression guard and stays green.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.