Fix ReturnToHandAttachedEffect with MDFCs (#10452)

* Add tests for ReturnToHandAttachedEffect

* Temporary fix for returning attached MDFC to hand
This commit is contained in:
xenohedron 2023-06-16 22:43:34 -04:00 committed by GitHub
parent a6c19c4335
commit 045bbbf04f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 230 additions and 1 deletions

View file

@ -3,6 +3,7 @@ package mage.abilities.effects.common;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.ModalDoubleFacedCard;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
@ -36,7 +37,8 @@ public class ReturnToHandAttachedEffect extends OneShotEffect {
return false;
}
Card card = permanent.getMainCard();
if (permanent.getZoneChangeCounter(game) + 1 != card.getZoneChangeCounter(game)) {
// TODO: Once MDFC ZCC increments are fixed properly, can remove this special case. For now must allow so effect works.
if (permanent.getZoneChangeCounter(game) + 1 != card.getZoneChangeCounter(game) && !(card instanceof ModalDoubleFacedCard)) {
return false;
}
return player.moveCards(card, Zone.HAND, source, game);