- Fixed #8913. MDFC can be a permanent. Split cards are never permanents.

This commit is contained in:
Jeff Wadsworth 2022-05-04 11:10:40 -05:00
parent 751a9f8afc
commit 16bd5374a6

View file

@ -1,4 +1,3 @@
package mage.cards.d; package mage.cards.d;
import java.util.UUID; import java.util.UUID;
@ -63,18 +62,25 @@ class DeceiverOfFormEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Card copyFromCard = null;
MageObject sourceObject = source.getSourceObject(game); MageObject sourceObject = source.getSourceObject(game);
if (controller != null if (controller != null
&& sourceObject != null) { && sourceObject != null) {
Card copyFromCard = controller.getLibrary().getFromTop(game); Card cardFromTop = controller.getLibrary().getFromTop(game);
if (copyFromCard != null) { if (cardFromTop != null) {
Cards cards = new CardsImpl(copyFromCard); Cards cards = new CardsImpl(cardFromTop);
controller.revealCards(sourceObject.getIdName(), cards, game); controller.revealCards(sourceObject.getIdName(), cards, game);
if (copyFromCard.isCreature(game)) { if (cardFromTop.isCreature(game)) {
if (controller.chooseUse(outcome, "Let creatures you control other than " if (controller.chooseUse(outcome, "Let creatures you control other than "
+ sourceObject.getLogName() + " becomes copies of " + copyFromCard.getLogName() + " until end of turn?", source, game)) { + sourceObject.getLogName() + " becomes copies of " + cardFromTop.getLogName() + " until end of turn?", source, game)) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, controller.getId(), game)) {
if (!permanent.getId().equals(sourceObject.getId())) { if (!permanent.getId().equals(sourceObject.getId())) {
copyFromCard = cardFromTop;
// handle MDFC
if (cardFromTop instanceof ModalDoubleFacesCard
&& ((ModalDoubleFacesCard) cardFromTop).getLeftHalfCard().isCreature(game)) {
copyFromCard = ((ModalDoubleFacesCard) cardFromTop).getLeftHalfCard();
}
Permanent newBluePrint = null; Permanent newBluePrint = null;
newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game); newBluePrint = new PermanentCard(copyFromCard, source.getControllerId(), game);
newBluePrint.assignNewId(); newBluePrint.assignNewId();