Add Valakut Fireboar: switch its power and toughness (pronoun form) - #4906
Conversation
Teach the effect parser the pronoun surface form "switch its power and
toughness" so Valakut Fireboar's attack trigger lowers to Effect::SwitchPT.
The prepositional ("switch the power and toughness of X") and possessive
("switch X's power and toughness") branches already existed; parse_target does
not treat a bare "its" as a target, so the pronoun form fell to
Effect::Unimplemented and the P/T swap never fired.
The new branch matches "switch its power and toughness" and resolves the "its"
anaphor via the shared resolve_it_pronoun helper (SelfRef for Valakut Fireboar's
self-attack trigger). CR 613.4d.
There was a problem hiding this comment.
Code Review
This pull request adds support for parsing the pronoun form "switch its power and toughness" (with optional "until end of turn" duration) in the MTG engine's imperative oracle effect parser, resolving "its" via the shared it-pronoun anaphor. It also introduces an integration test for Valakut Fireboar to verify this behavior during combat. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Parse changes introduced by this PR · 1 card(s), 2 signature(s) (baseline: main
|
matthewevans
left a comment
There was a problem hiding this comment.
Reviewed current head: scoped SwitchPT pronoun parser fix, matching parse-diff evidence for Valakut Fireboar only, green checks, and discriminating runtime coverage.
Summary
Adds engine support for Valakut Fireboar (ZEN) — "Whenever this creature attacks, switch its power and toughness until end of turn." — by teaching the effect parser the pronoun surface form "switch its power and toughness".
Effect::SwitchPTand its layer-7d runtime already exist (Invert, Inversion Behemoth are the supported siblings). The parser recognized two surface forms — prepositional "switch the power and toughness of<target>" and possessive "switch<target>'s power and toughness" — but not the bare pronoun "switch its power and toughness".parse_targetdoes not treat a bare "its" as a target, so both branches missed it and the trigger effect fell toEffect::Unimplemented; the P/T swap never fired.The fix adds a third branch that matches "switch its power and toughness" and resolves the "its" anaphor through the shared
resolve_it_pronoun(ctx)helper — the same anaphor resolution already used by the sacrifice/counter clauses. For Valakut Fireboar the trigger subject is this creature, so "its" resolves toSelfRef(the source switches its own P/T). The change is generic: any effect written as "switch its power and toughness" now lowers toEffect::SwitchPT.Files changed
crates/engine/src/parser/oracle_effect/imperative.rs— pronoun branch in the SwitchPT parsercrates/engine/src/parser/oracle_effect/tests.rs— parser unit testeffect_switch_pt_pronoun_itscrates/engine/tests/valakut_fireboar_switch_pt_on_attack.rs— integration testAnchored on
crates/engine/src/parser/oracle_effect/imperative.rs(~4516) — the existing prepositional and possessive SwitchPT branches; this adds the pronoun sibling immediately before the possessive one.crates/engine/src/parser/oracle_effect/mod.rs:172—resolve_it_pronounalready maps "it/its" toSelfReforTriggeringSourcefromctx.subject; reused verbatim.crates/engine/src/game/effects/switch_pt.rs—Effect::SwitchPTruntime (layer-7dSwitchPowerToughness); unchanged. Invert and Inversion Behemoth exercise this handler today.CR references
CR 613.4d— switching a creature's power and toughness is a single continuous effect applied in layer 7d.CR 608.2c— the triggered ability's instruction resolves as written; "its" refers to the object established by the trigger (here, the attacking creature).Track
Developer
LLM
Model: claude-opus-4-8
Thinking: high
Verification
cargo fmt --all— cleancargo clippy-strict— clean (0 warnings)./scripts/check-parser-combinators.sh— cleancargo test -p engine— full engine suite green, 0 failed across all binaries (addseffect_switch_pt_pronoun_its+valakut_fireboar_switches_power_and_toughness_when_it_attacks)./scripts/gen-card-data.sh— Valakut Fireboar: 0 Unimplemented entriesscripts/coverage-regression-check.sh --fail-on-engine): supported 31223 → 31224 (net +1). GAINED: Valakut Fireboar. REGRESSED (engine): 0. REGRESSED (coverage honesty): 0. ORACLE CHANGED: 0. (Invert / Inversion Behemoth unchanged.)cargo semantic-audit— Valakut Fireboar: 0 findings.The integration test drives the real declare-attackers → trigger → stack → resolution pipeline: Valakut Fireboar (printed 5/2) is declared as an attacker; after the trigger resolves, its effective power/toughness must be 2/5. It flips if the parser branch is reverted — the trigger effect becomes
Unimplementedand the P/T stays 5/2.Scope Expansion
None. (Mangled Soulrager's granted "twelve-time boon" also uses this phrasing, and its "switch its" orphan is now closed; but that card's boon-granting mechanic is a separate unsupported infra gap, so it stays
gap_count 1and is out of scope here.)Validation Failures
None.
CI Failures
None.