mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
* Morph - Fixed that token copies of morphed creatures (e.g. by Supplant Form) came into play like the morphed creature face up instead of a 2/2 nameless creatures.
This commit is contained in:
parent
96a23d42cc
commit
a845340e0d
3 changed files with 55 additions and 13 deletions
|
@ -552,4 +552,37 @@ public class MorphTest extends CardTestPlayerBase {
|
|||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
/**
|
||||
* Supplant Form does not work correctly with morph creatures. If you bounce and copy
|
||||
* a face-down morph, the created token should be a colorless 2/2, but the token created
|
||||
* is instead the face-up of what the morph creature was.
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testSupplantFormWithMorphedCreature() {
|
||||
addCard(Zone.HAND, playerA, "Akroma, Angel of Fury", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// Return target creature to its owner's hand. You put a token onto the battlefield that's a copy of that creature
|
||||
addCard(Zone.HAND, playerB, "Supplant Form", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 6);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Akroma, Angel of Fury");
|
||||
setChoice(playerA, "Yes"); // cast it face down as 2/2 creature
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Supplant Form", "face down creature");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 20);
|
||||
|
||||
assertGraveyardCount(playerB, "Supplant Form", 1);
|
||||
assertHandCount(playerA, "Akroma, Angel of Fury", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Akroma, Angel of Fury", 0);
|
||||
assertPermanentCount(playerB, "a creature without name", 1);
|
||||
assertPowerToughness(playerB, "a creature without name", 2, 2);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
package mage.abilities.keyword;
|
||||
|
||||
import java.util.Iterator;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.StaticAbility;
|
||||
|
@ -292,19 +293,21 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
return alternateCosts;
|
||||
}
|
||||
|
||||
public static void setPermanentToFaceDownCreature(Permanent permanent) {
|
||||
permanent.getPower().initValue(2);
|
||||
permanent.getToughness().initValue(2);
|
||||
permanent.getAbilities().clear();
|
||||
permanent.getColor().setColor(new ObjectColor());
|
||||
permanent.setName("");
|
||||
permanent.getCardType().clear();
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.getSubtype().clear();
|
||||
permanent.getSupertype().clear();
|
||||
permanent.getManaCost().clear();
|
||||
// permanent.setExpansionSetCode("KTK");
|
||||
permanent.setRarity(Rarity.NA);
|
||||
public static void setPermanentToFaceDownCreature(MageObject mageObject) {
|
||||
mageObject.getPower().initValue(2);
|
||||
mageObject.getToughness().initValue(2);
|
||||
mageObject.getAbilities().clear();
|
||||
mageObject.getColor().setColor(new ObjectColor());
|
||||
mageObject.setName("");
|
||||
mageObject.getCardType().clear();
|
||||
mageObject.getCardType().add(CardType.CREATURE);
|
||||
mageObject.getSubtype().clear();
|
||||
mageObject.getSupertype().clear();
|
||||
mageObject.getManaCost().clear();
|
||||
if (mageObject instanceof Permanent) {
|
||||
((Permanent)mageObject).setExpansionSetCode("");
|
||||
((Permanent)mageObject).setRarity(Rarity.NA);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ package mage.util.functions;
|
|||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
|
@ -64,10 +65,15 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
|||
target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber());
|
||||
target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard());
|
||||
} else if (source instanceof PermanentCard) {
|
||||
if (((PermanentCard)source).isMorphed() || ((PermanentCard)source).isManifested()) {
|
||||
MorphAbility.setPermanentToFaceDownCreature(target);
|
||||
return target;
|
||||
} else {
|
||||
sourceObj = ((PermanentCard) source).getCard();
|
||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||
target.setOriginalCardNumber(source.getCardNumber());
|
||||
target.setCopySourceCard((Card)sourceObj);
|
||||
}
|
||||
} else {
|
||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||
target.setOriginalCardNumber(source.getCardNumber());
|
||||
|
|
Loading…
Reference in a new issue