Trigger: "When a spell or ability an opponent controls causes you to discard this card, [effect]"
Summary
A triggered ability that fires when an opponent's spell or ability causes you to
discard the card — "When a spell or ability an opponent controls causes you to
discard this card, [effect]" — is unparsed and drops the card to a gap.
15 single-gap cards: Guerrilla Tactics, Gorilla Tactics, Sand Golem, Quagnoth,
Mangara's Blessing, Pure Intentions, Ajani's Last Stand, Spiritual Focus
(whenever / "a card"), and more.
Verified non-duplicate
- Issues/PRs: "Guerrilla Tactics" → 0; the "causes you to discard this card" hits
are all the unrelated Library of Leng discard-replacement ("put it on top
instead"), not this trigger.
- Code: no trigger condition for "discarded by an opponent's spell/ability" in
types/triggers.rs / oracle_trigger*.
Existing infrastructure
The replacement form of this exact event is already recognized —
oracle_replacement.rs:603 parses "If a spell or ability an opponent controls causes
you to discard this card, put it onto the battlefield instead …". So the engine
already has the notion of "an opponent's spell/ability caused this discard"; this issue
adds the triggered-ability counterpart ("When … , [effect]").
Proposed approach
- Trigger condition (run
add-engine-variant gate): add a TriggerCondition
for "you discard this card because of a spell/ability an opponent controls" (CR
603.2 + CR 701.8 discard). Mirror the predicate the replacement form already uses
to identify the opponent-caused discard of the source card.
- Trigger matcher: fire when the discard event's cause is an opponent-controlled
spell/ability and the discarded object is the source (self). The discard event must
carry (or be matchable to) the cause's controller.
- Parser: recognize "When/Whenever a spell or ability an opponent controls causes
you to discard [this card | a card], [effect]" → a TriggerDefinition with the new
condition; parse the effect via the standard chain. Reject-and-gap unparseable
effect bodies.
Scope
- First pass: the self-discard form ("…causes you to discard this card,
[effect]") with controller-/source-scoped effects — Guerrilla Tactics (deals 4
damage), Sand Golem / Quagnoth / Pure Intentions (return this card to hand),
Mangara's Blessing (gain 2 life). Establishes the trigger end to end.
- Follow-ups: the "a card" form (Spiritual Focus — triggers on any discard this
way, not just self) and intervening-if variants (Ajani's Last Stand "if you
control…").
Why this is valuable
- 15 cards, one coherent trigger, genuinely non-duplicate, building on the
existing opponent-caused-discard recognition (the replacement form).
Acceptance criteria
- An opponent's spell/ability discarding the card fires the ability (e.g. Guerrilla
Tactics deals 4 damage); a self-caused discard (your own spell, or cycling) does
not.
- Unsupported effect bodies stay a loud gap.
add-engine-variant gate passed; CR verified; exhaustive matches updated.
- coverage-honesty / clippy / fmt / parser-combinator / engine-authorities green;
regen + cargo test --test integration before pushing.
Trigger: "When a spell or ability an opponent controls causes you to discard this card, [effect]"
Summary
A triggered ability that fires when an opponent's spell or ability causes you to
discard the card — "When a spell or ability an opponent controls causes you to
discard this card, [effect]" — is unparsed and drops the card to a gap.
15 single-gap cards: Guerrilla Tactics, Gorilla Tactics, Sand Golem, Quagnoth,
Mangara's Blessing, Pure Intentions, Ajani's Last Stand, Spiritual Focus
(whenever / "a card"), and more.
Verified non-duplicate
are all the unrelated Library of Leng discard-replacement ("put it on top
instead"), not this trigger.
types/triggers.rs/oracle_trigger*.Existing infrastructure
The replacement form of this exact event is already recognized —
oracle_replacement.rs:603parses "If a spell or ability an opponent controls causesyou to discard this card, put it onto the battlefield instead …". So the engine
already has the notion of "an opponent's spell/ability caused this discard"; this issue
adds the triggered-ability counterpart ("When … , [effect]").
Proposed approach
add-engine-variantgate): add aTriggerConditionfor "you discard this card because of a spell/ability an opponent controls" (CR
603.2 + CR 701.8 discard). Mirror the predicate the replacement form already uses
to identify the opponent-caused discard of the source card.
spell/ability and the discarded object is the source (self). The discard event must
carry (or be matchable to) the cause's controller.
you to discard [this card | a card], [effect]" → a
TriggerDefinitionwith the newcondition; parse the effect via the standard chain. Reject-and-gap unparseable
effect bodies.
Scope
[effect]") with controller-/source-scoped effects — Guerrilla Tactics (deals 4
damage), Sand Golem / Quagnoth / Pure Intentions (return this card to hand),
Mangara's Blessing (gain 2 life). Establishes the trigger end to end.
way, not just self) and intervening-if variants (Ajani's Last Stand "if you
control…").
Why this is valuable
existing opponent-caused-discard recognition (the replacement form).
Acceptance criteria
Tactics deals 4 damage); a self-caused discard (your own spell, or cycling) does
not.
add-engine-variantgate passed; CR verified; exhaustive matches updated.regen +
cargo test --test integrationbefore pushing.