-
-
Notifications
You must be signed in to change notification settings - Fork 153
Fix Dragon Man, Reformed Robot #7030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| use crate::types::ability::{ | ||
| is_variable_remove_counter_cost_count, AbilityCost, Comparator, CounterCostSelection, | ||
| FilterProp, QuantityExpr, QuantityRef, TapCreaturesAggregateStat, TapCreaturesRequirement, | ||
| TargetFilter, TypedFilter, | ||
| TargetFilter, TypedFilter, EXILE_COST_X, | ||
| }; | ||
| use crate::types::card_type::CoreType; | ||
| use crate::types::identifiers::ObjectId; | ||
|
|
@@ -406,6 +406,13 @@ impl AbilityCost { | |
| zone, | ||
| filter, | ||
| } => { | ||
| // CR 107.3a + CR 601.2b: X in this cost is chosen during | ||
| // announcement. X=0 is legal, so the pre-announcement | ||
| // affordability gate must not treat its compact sentinel as a | ||
| // literal count that can never be met. | ||
| if *count == EXILE_COST_X { | ||
| return true; | ||
| } | ||
| if matches!(filter, Some(TargetFilter::SelfRef)) { | ||
| // CR 118.3 + CR 602.1a: "Exile this <self>" as an | ||
| // activation cost needs the source available to pay that | ||
|
|
@@ -1246,6 +1253,28 @@ mod tests { | |
| ); | ||
| } | ||
|
|
||
| #[test] | ||
| fn variable_exile_cost_is_payable_at_x_zero() { | ||
| let mut scenario = GameScenario::new(); | ||
| let source = scenario.add_creature(P0, "Harvest Pyre", 0, 1).id(); | ||
| let cost = AbilityCost::Exile { | ||
| count: EXILE_COST_X, | ||
| zone: Some(Zone::Graveyard), | ||
| filter: Some(TargetFilter::Typed(TypedFilter::new(TypeFilter::Instant))), | ||
| }; | ||
|
|
||
| assert!( | ||
| cost.is_payable(&scenario.state, P0, source), | ||
| "X exile costs are payable at X=0 before any eligible card is selected" | ||
| ); | ||
|
|
||
| scenario.add_spell_to_graveyard(P0, "Lightning Bolt", true); | ||
| assert!( | ||
| cost.is_payable(&scenario.state, P0, source), | ||
| "X exile costs stay payable when eligible cards can set X above zero" | ||
| ); | ||
| } | ||
|
|
||
|
Comment on lines
+1256
to
+1277
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Exercise the real cast and payment path. Both assertions call Add an integration test under As per path instructions, “Tests belong under crates/engine/tests/integration/ and must be registered in integration/main.rs.” 🤖 Prompt for AI AgentsSource: Path instructions |
||
| #[test] | ||
| fn loyalty_positive_is_always_payable() { | ||
| let state = new_state(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.