* Morph - Fixed that turning creatures face up didn't restore their subtypes (fixes #4566).

This commit is contained in:
LevelX2 2018-03-18 19:37:25 +01:00
parent b073ce1c42
commit d29707bdea
2 changed files with 43 additions and 1 deletions

View file

@ -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());
}
}

View file

@ -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);
}