Skip to content

fix(parser): "play a land or cast a spell" is a play-card trigger (Shadow of the Goblin #6387)#6591

Open
bitfathers94 wants to merge 1 commit into
phase-rs:mainfrom
bitfathers94:fix/issue-6387
Open

fix(parser): "play a land or cast a spell" is a play-card trigger (Shadow of the Goblin #6387)#6591
bitfathers94 wants to merge 1 commit into
phase-rs:mainfrom
bitfathers94:fix/issue-6387

Conversation

@bitfathers94

@bitfathers94 bitfathers94 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

fix(parser): "play a land or cast a spell" is a play-card trigger (Shadow of the Goblin #6387)

"Whenever you play a land or cast a spell from anywhere other than your hand"
was shadowed by the land-play trigger arm: parse_type_phrase consumed only
"a land", the trailing "or cast a spell from anywhere other than your hand"
was silently dropped, and the trigger fired on every land played from hand.

Per CR 601.1a + CR 701.18b a player plays a card by playing it as a land OR
casting it as a spell, so "play a land or cast a spell" is the same event pair
as "play a card". Route the spelled-out form to the unified PlayCard mode so
the shared origin tail gates both halves: Shadow of the Goblin parses as
NotEquals(Hand) (no fire on hand plays/casts), and the tail-less The Endstone /
Flubs / Infernal Sovereign class parses as Any.

Closes #6387

Summary by CodeRabbit

  • Bug Fixes

    • Improved trigger parsing so both “play a card” and “play a land or cast a spell” are recognized consistently.
    • Correctly handles origin restrictions such as cards played from anywhere other than the player’s hand.
  • Tests

    • Added regression coverage for unified play-card trigger behavior and zone-based restrictions.

…adow of the Goblin phase-rs#6387)

"Whenever you play a land or cast a spell from anywhere other than your hand"
was shadowed by the land-play trigger arm: parse_type_phrase consumed only
"a land", the trailing "or cast a spell from anywhere other than your hand"
was silently dropped, and the trigger fired on every land played from hand.

Per CR 601.1a + CR 701.18b a player plays a card by playing it as a land OR
casting it as a spell, so "play a land or cast a spell" is the same event pair
as "play a card". Route the spelled-out form to the unified PlayCard mode so
the shared origin tail gates both halves: Shadow of the Goblin parses as
NotEquals(Hand) (no fire on hand plays/casts), and the tail-less The Endstone /
Flubs / Infernal Sovereign class parses as Any.

Closes phase-rs#6387
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 65fb97db-62f1-4b3d-abd1-840a524771f3

📥 Commits

Reviewing files that changed from the base of the PR and between 7ed59c0 and 1960aff.

📒 Files selected for processing (2)
  • crates/engine/src/parser/oracle_trigger.rs
  • crates/engine/src/parser/oracle_trigger_tests.rs

📝 Walkthrough

Walkthrough

The Oracle trigger parser now treats “play a land or cast a spell” and “play a card” as the same PlayCard event, while preserving origin constraints. Regression tests cover unrestricted and non-hand origins.

Changes

Oracle trigger parsing

Layer / File(s) Summary
Unified play-card subject parsing
crates/engine/src/parser/oracle_trigger.rs, crates/engine/src/parser/oracle_trigger_tests.rs
The parser accepts both play-card phrasings, and tests verify PlayCard mode, origin constraints, unrestricted targets, and the absence of card-type narrowing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: bug

Suggested reviewers: matthewevans, andriypolanski, lgray, ntindle

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the parser fix for the Shadow of the Goblin play-card trigger.
Linked Issues check ✅ Passed The parser change and new tests address the issue by treating the wording as a play-card trigger with hand exclusion.
Out of Scope Changes check ✅ Passed The diff stays focused on the parser fix and regression tests, with no unrelated code changes apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shadow Of The Goblin — [[Shadow of the Goblin]], as currently implemented, deals damage whenever I play a land.

1 participant