Skip to content

Parser drops "for each <type> you control with a <counter> counter on it" counts (High Sentinels of Arashin, Armorcraft Judge) #5023

Description

@luciferlive112116

Summary

The "for each" quantity grammar cannot parse a controller-scoped population count that is gated on a counter predicatefor each <type> you control with a <kind> counter on it. The clause fails to fully consume, so the entire for each quantity is dropped along with the effect that depends on it (a dynamic P/T pump, a card-draw amount, or a cost reduction).

Affected cards (class, not one card)

Card Oracle text Effect that breaks
High Sentinels of Arashin "This creature gets +1/+1 for each other creature you control with a +1/+1 counter on it." dynamic P/T pump
Armorcraft Judge "When this creature enters, draw a card for each creature you control with a +1/+1 counter on it." card-draw amount
Inspiring Call "Draw a card for each creature you control with a +1/+1 counter on it." card-draw amount
Avatar of the Resolute "This creature enters with a +1/+1 counter on it for each other creature you control with a +1/+1 counter on it." ETB counter amount
Hamza, Guardian of Arashin "This spell costs {1} less to cast for each creature you control with a +1/+1 counter on it." cost reduction

Root cause

The for each dispatch (crates/engine/src/parser/oracle_nom/quantity.rs) counts controlled permanents via parse_for_each_controlled_type, which matches <type> you control and stops. It has no arm for a trailing with a <kind> counter on it predicate, so the counter clause is left as an unconsumed remainder and the whole for each quantity fails.

The counter predicate itself is already parsed elsewhere — oracle_target::parse_counter_suffix turns with a +1/+1 counter on it into a typed FilterProp::Counters (this is what backs "target creature with a +1/+1 counter on it") — but the quantity-count path never delegates to it for the "you control" scope.

Expected

for each <type> you control with a <kind> counter on it should parse to a controller-scoped population count (QuantityRef::ObjectCount with controller: Some(You), CR 109.4) of permanents of that type carrying the named counter (CR 122.1), with the optional other/another self-exclusion.

Environment

  • Repo: phase-rs/phase, branch main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions