diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index 045c436d8e4..d10e8b485ec 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -28,9 +28,12 @@ package org.mage.test.cards.abilities.keywords; import mage.cards.Card; +import mage.constants.CardType; import mage.constants.PhaseStep; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.Filter; +import mage.game.permanent.Permanent; import org.junit.Assert; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -894,4 +897,43 @@ public class MorphTest extends CardTestPlayerBase { assertPermanentCount(playerB, "Quicksilver Dragon", 1); } + + /** + * A creature with Morph/Megamorph cast normally will properly include its + * printed creature subtypes: for example Akroma, Angel of Fury is a + * Legendary Creature - Angel. However, if Akroma is cast face down and then + * turned face up via its morph ability, it has no subtypes: it's just a + * Legendary Creature and creature type-specific effects (Radiant Destiny, + * etc) don't apply to it. Haven't tested whether this also applies to + * external effects turning the creature face up, like Skirk Alarmist. + */ + @Test + public void testSubTypesAfterTurningFaceUp() { + /* + Akroma, Angel of Fury {5}{R}{R}{R} + Creature - Legendary Angel + 6/6 + // Akroma, Angel of Fury can't be countered. + // Flying + // Trample + // protection from white and from blue + // {R}: Akroma, Angel of Fury gets +1/+0 until end of turn. + // Morph {3}{R}{R}{R} + */ + addCard(Zone.HAND, playerA, "Akroma, Angel of Fury"); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Angel of Fury"); + setChoice(playerA, "Yes"); // cast it face down as 2/2 creature + + activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}{R}{R}{R}: Turn this face-down permanent face up."); + + setStopAt(3, PhaseStep.BEGIN_COMBAT); + execute(); + + assertPermanentCount(playerA, "Akroma, Angel of Fury", 1); + assertType("Akroma, Angel of Fury", CardType.CREATURE, SubType.ANGEL); + Permanent akroma = getPermanent("Akroma, Angel of Fury"); + Assert.assertTrue("Akroma has to be red", akroma.getColor(currentGame).isRed()); + } } diff --git a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java index 46714d92439..9415ed3c621 100644 --- a/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/MorphAbility.java @@ -230,7 +230,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost spellColor.setGreen(false); spellColor.setWhite(false); spellColor.setBlue(false); - spell.getSubtype(game).clear(); + game.getState().getCreateCardAttribute(spell.getCard(), game).getSubtype().clear(); } else { spell.setFaceDown(false, game); }