Skip to content

Fix Offspring regression with Zinnia when granting source is removed before ETB#14609

Draft
sneddigrolyat wants to merge 7 commits intomagefree:masterfrom
sneddigrolyat:fix/zinnia-offspring-regression
Draft

Fix Offspring regression with Zinnia when granting source is removed before ETB#14609
sneddigrolyat wants to merge 7 commits intomagefree:masterfrom
sneddigrolyat:fix/zinnia-offspring-regression

Conversation

@sneddigrolyat
Copy link
Copy Markdown

@sneddigrolyat sneddigrolyat commented Mar 8, 2026

Summary

This draft PR fixes a regression where a creature spell could still create an Offspring token even when the ability granting Offspring (for example, Zinnia) was removed before the creature entered the battlefield.

It also preserves correct behavior for multiple Offspring instances (printed + granted), including separate payments and separate triggers.

Problem

In live testing, this incorrect behavior reproduced:

  1. Cast a creature spell with granted Offspring from Zinnia.
  2. In response, remove Zinnia (for example, with Path to Exile).
  3. Creature resolves and enters.
  4. Offspring token was still created (incorrect).

Root Cause

The delayed-trigger fallback for granted Offspring could outlive the source-granted ability state and still fire from stale activation tag data.

Fix

Engine-level changes:

  • OffspringAbility: added per-instance activation tagging and explicit trigger gating.
  • Spell.resolve: before storing permanent cost tags, synchronize/remove stale Offspring activation tags based on the spell’s current abilities at resolution.
  • Delayed Offspring fallback now checks synchronized activation tags, so it does not fire if the granting ability is gone before ETB.

Files Changed

  • Mage/src/main/java/mage/abilities/keyword/OffspringAbility.java
  • Mage/src/main/java/mage/game/stack/Spell.java
  • Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/OffspringTest.java
  • Mage.Tests/src/test/java/org/mage/test/cards/single/blc/ZinniaValleysVoiceTest.java

Tests

Unit tests

OffspringTest now covers:

  • Offspring not paid -> no token.
  • Offspring paid -> token created.
  • Humility in response -> no token.
  • Printed + granted Offspring under Humility -> no token.
  • Granted source removed before ETB (Path to Exile on Zinnia) -> no token.
  • Printed + granted, one payment -> one token.
  • Printed + granted, two payments -> two tokens.
  • Humility with printed + granted where granted ability comes from a noncreature source -> no token (covers delayed-trigger skip branch).

ZinniaValleysVoiceTest covers granted Offspring behavior and regression scenarios.

Commands run

mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.abilities.keywords.OffspringTest" "-Dsurefire.failIfNoSpecifiedTests=false" test
mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.single.blc.ZinniaValleysVoiceTest" "-Dsurefire.failIfNoSpecifiedTests=false" test
Result: pass.

Optional quality pass (JaCoCo)
mvn -pl Mage.Tests -am "-Dtest=org.mage.test.cards.abilities.keywords.OffspringTest" "-Dsurefire.failIfNoSpecifiedTests=false" "-Djacoco.skip=false" test
mvn -pl Mage.Tests,Mage.Reports -am "-Djacoco.skip=false" "-DskipTests" verify
Result: touched OffspringAbility defensive skip branch is now covered (previously missed line at OffspringAbility.java:275).
Live gameplay testing

10/10 live gameplay scenarios passed, including the Path-before-ETB regression case.

Risk / Scope

This touches core Spell and OffspringAbility behavior. Review focus:
•cost-tag lifecycle during spell resolution,
•interactions with other optional additional costs,
•multi-instance Offspring payment/trigger behavior.

Request for Review

Opening as draft to get engine/rules validation before marking ready.
Please double-check:
•rules correctness for 702.175a / 702.175b edge cases,
•unintended side effects from Offspring tag synchronization in Spell.resolve

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
@sneddigrolyat
Copy link
Copy Markdown
Author

@DreamWaker @Grath @keloks @theelk801 can anyone please help me validate if this PR is ready for review?

@sneddigrolyat
Copy link
Copy Markdown
Author

Since this approach seems too specific to Zinnia, I'm trying to work on a more general approach in new PR #14625

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant