Skip to content

Add Unravel (counter spell; draw if mana value paid was less) - #3618

Merged
matthewevans merged 3 commits into
mainfrom
ship/unravel-counter-mana-value
Jun 17, 2026
Merged

Add Unravel (counter spell; draw if mana value paid was less)#3618
matthewevans merged 3 commits into
mainfrom
ship/unravel-counter-mana-value

Conversation

@matthewevans

Copy link
Copy Markdown
Member

Salvaged from #3573 (jaso0n0818, closed). The original parser work is sound and is cherry-picked here with authorship preserved; what the closed PR lacked — across multiple review cycles — was a runtime test that drives the engine through cast→resolve and fails on revert. This adds that test.

What it does

Unravel counters target spell; if the total mana spent to cast that spell was less than its mana value, you draw a card. jaso0n0818's parser change lowers the conditional draw rider to AbilityCondition comparing mana-spent vs mana value (conditions.rs).

Discriminating test

unravel_counter_mana_value.rs: P1 counters P0's spell with Unravel in two scenarios driven through the real payment path —

  • target paid below mana value (cost-reduced) → asserts target countered and P1 drew 1
  • target paid full mana value → asserts target countered and P1 drew 0

The mana-spent state is produced authentically by the engine (no hand-set fields). Verified discriminating: neutralizing the parser dispatch (so the rider parses unconditionally) makes the "full mana value" case fail left: 1, right: 0.

Co-authored parser work by jaso0n0818; maintainer-authored runtime test.

jason020818 and others added 2 commits June 17, 2026 11:54
Co-authored-by: Cursor <cursoragent@cursor.com>
Drive Unravel through the real cast->resolve pipeline: cast a {3} target
spell (paid below its mana value via a static cost reducer, or at full
cost), counter it with Unravel, and assert the conditional draw rider
fires only when mana spent to cast the target was less than its mana
value (CR 601.2f/601.2h + 608.2c). The mana-spent state is produced
authentically by the engine's payment path; the test fails on revert of
the parser's intervening-if lowering (the rider would draw unconditionally).

Parser by @jaso0n0818 (salvaged from #3573); runtime test added by maintainer.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@matthewevans matthewevans added the enhancement New feature or request label Jun 17, 2026
@matthewevans
matthewevans enabled auto-merge June 17, 2026 18:55
@matthewevans
matthewevans added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 307362a Jun 17, 2026
10 checks passed
@matthewevans
matthewevans deleted the ship/unravel-counter-mana-value branch June 17, 2026 19:29
@matthewevans matthewevans mentioned this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants