mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +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);
|
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;
|
package mage.abilities.keyword;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import mage.MageObject;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.StaticAbility;
|
import mage.abilities.StaticAbility;
|
||||||
|
@ -292,19 +293,21 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
||||||
return alternateCosts;
|
return alternateCosts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setPermanentToFaceDownCreature(Permanent permanent) {
|
public static void setPermanentToFaceDownCreature(MageObject mageObject) {
|
||||||
permanent.getPower().initValue(2);
|
mageObject.getPower().initValue(2);
|
||||||
permanent.getToughness().initValue(2);
|
mageObject.getToughness().initValue(2);
|
||||||
permanent.getAbilities().clear();
|
mageObject.getAbilities().clear();
|
||||||
permanent.getColor().setColor(new ObjectColor());
|
mageObject.getColor().setColor(new ObjectColor());
|
||||||
permanent.setName("");
|
mageObject.setName("");
|
||||||
permanent.getCardType().clear();
|
mageObject.getCardType().clear();
|
||||||
permanent.getCardType().add(CardType.CREATURE);
|
mageObject.getCardType().add(CardType.CREATURE);
|
||||||
permanent.getSubtype().clear();
|
mageObject.getSubtype().clear();
|
||||||
permanent.getSupertype().clear();
|
mageObject.getSupertype().clear();
|
||||||
permanent.getManaCost().clear();
|
mageObject.getManaCost().clear();
|
||||||
// permanent.setExpansionSetCode("KTK");
|
if (mageObject instanceof Permanent) {
|
||||||
permanent.setRarity(Rarity.NA);
|
((Permanent)mageObject).setExpansionSetCode("");
|
||||||
|
((Permanent)mageObject).setRarity(Rarity.NA);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ package mage.util.functions;
|
||||||
|
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.keyword.MorphAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.permanent.PermanentCard;
|
import mage.game.permanent.PermanentCard;
|
||||||
|
@ -64,10 +65,15 @@ public class CopyTokenFunction implements Function<Token, Card> {
|
||||||
target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber());
|
target.setOriginalCardNumber(((Token)sourceObj).getOriginalCardNumber());
|
||||||
target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard());
|
target.setCopySourceCard(((PermanentToken)source).getToken().getCopySourceCard());
|
||||||
} else if (source instanceof PermanentCard) {
|
} else if (source instanceof PermanentCard) {
|
||||||
|
if (((PermanentCard)source).isMorphed() || ((PermanentCard)source).isManifested()) {
|
||||||
|
MorphAbility.setPermanentToFaceDownCreature(target);
|
||||||
|
return target;
|
||||||
|
} else {
|
||||||
sourceObj = ((PermanentCard) source).getCard();
|
sourceObj = ((PermanentCard) source).getCard();
|
||||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||||
target.setOriginalCardNumber(source.getCardNumber());
|
target.setOriginalCardNumber(source.getCardNumber());
|
||||||
target.setCopySourceCard((Card)sourceObj);
|
target.setCopySourceCard((Card)sourceObj);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
target.setOriginalExpansionSetCode(source.getExpansionSetCode());
|
||||||
target.setOriginalCardNumber(source.getCardNumber());
|
target.setOriginalCardNumber(source.getCardNumber());
|
||||||
|
|
Loading…
Reference in a new issue