[don't merge] Linked ability framework for Zinnia Valley's Voice#14625
[don't merge] Linked ability framework for Zinnia Valley's Voice#14625sneddigrolyat wants to merge 14 commits intomagefree:masterfrom
Conversation
OffspringAbility.java updated with new OffspringDelayedTriggeredAbility for implementation of ZinniaValleysVoice
Add Zinnia, Valley's Voice
Add ZinniaValleysVoice.java in conjunction with changes to OffspringAbility.java with new OffspringDelayedTriggeredAbility
|
@ssk97 Thanks, your comment was helpful. Replying here since you noted it belongs on the PR. I ended up changing the approach in a few important ways based on the concerns you raised.
Also backed away from the broader
I added coverage for the cases you called out:
Current local validation:
The main thing I’d like review on is whether this narrower linkage-preservation model for granted abilities plus copied permanent spells is the right way to go. |
|
It's hard to review code like this since I can't trust that the kind of mistakes made are human mistakes, and much of your "helpful" explanatory text here in the PR is either misleading or irrelevant. Why do you check that it's an In Several of your tests are weird. Why have a bunch of Zinnia tests inside the main |
|
Thanks @ssk97 for taking time to look at the code and provide feedback. I definitely need the help to get this implemented correctly. On the AbilityImpl checks: On copyFromToken and subabilities: On the test layout: On the custom grant-source fixture: I reran the targeted regressions after these changes: mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.abilities.keywords.MeldTest#testMeld_Urza_Eliminate_After_Rollback,org.mage.test.cards.planeswalker.JaceTest#rollbackDoesntUnflipJaceTest,org.mage.test.rollback.StateValuesTest#rollbackTokenCreationTest" "-Dsurefire.failIfNoSpecifiedTests=false" test Those targeted runs passed. |
This targets the engine bug in #12752, not just the Zinnia card implementation in #12568.
Problem
Offspring is an additional cost with a linked enters-the-battlefield ability. The bug was that XMage could lose or blur that linkage when the ability was granted by another object, reapplied through applyEffects, copied on the stack, or carried through spell-to-permanent transitions for copied permanent spells. In practice that showed up as the wrong Offspring payment state being remembered, copied, or rechecked.
This is why the issue is broader than Zinnia itself. Zinnia exposed the failure, but the underlying problem is generic linked-ability state management.
Why the previous attempts were not enough
PR #14595 and PR #14609 improved the immediate Zinnia behavior, but they still leaned on workaround-style handling around Offspring resolution. That did not fully solve the engine problem described in #12752, and it left the linkage model too specific to one mechanic path.
Rules claim
This change is meant to preserve linked-ability identity per instance across the relevant engine copy and reapplication paths:
What changed
Why the generic grant-source test helper still exists
I checked the current card pool in this branch. Zinnia is the only printed card here that grants Offspring to creature spells. Because of that, the generic helper remains for mechanic-level granted-Offspring tests that need to isolate the engine path or create multiple independent grant sources without mixing in Zinnia-specific creature, legend, or copy behavior. Actual Zinnia integration coverage stays in ZinniaValleysVoiceTest.
Validation rerun after the latest cleanup
mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.abilities.keywords.OffspringTest,org.mage.test.cards.single.blc.ZinniaValleysVoiceTest,org.mage.test.cards.abilities.keywords.SquadTest" "-Dsurefire.failIfNoSpecifiedTests=false" test
mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.abilities.keywords.MeldTest#testMeld_Urza_Eliminate_After_Rollback,org.mage.test.cards.planeswalker.JaceTest#rollbackDoesntUnflipJaceTest,org.mage.test.rollback.StateValuesTest#rollbackTokenCreationTest" "-Dsurefire.failIfNoSpecifiedTests=false" test
Targeted coverage now includes:
Main review question
Is preserving linkage across stack copies, spell copies, applyEffects reapplication, and spell-to-permanent transitions, while still giving each copied ability instance a fresh normal ability id, the right CR 607 model for XMage?