mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
* Lazav, Dimir Mastermind - Fixed that it came back from non battlefield zone to battlefield copying previous copied card.
This commit is contained in:
parent
ad0982618c
commit
7bb2bbe1fa
2 changed files with 46 additions and 0 deletions
|
@ -110,6 +110,7 @@ class LazavDimirEffect extends ContinuousEffectImpl {
|
|||
Card card = game.getCard(getTargetPointer().getFirst(game, source));
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (card == null || permanent == null) {
|
||||
discard();
|
||||
return false;
|
||||
}
|
||||
if (IdOfCopiedCard == null || !IdOfCopiedCard.equals(card.getId())) {
|
||||
|
|
|
@ -149,5 +149,50 @@ public class LazavDimirMastermindTest extends CardTestPlayerBase {
|
|||
Assert.assertTrue(lazav.getSubtype().contains("Cat"));
|
||||
Assert.assertTrue(lazav.getSupertype().contains("Legendary"));
|
||||
|
||||
}
|
||||
/**
|
||||
* Tests old copy is discarded after reanmiation of Lazav
|
||||
*/
|
||||
@Test
|
||||
public void testCopyAfterReanimation() {
|
||||
addCard(Zone.BATTLEFIELD, playerA ,"Swamp");
|
||||
// Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost.
|
||||
addCard(Zone.HAND, playerA ,"Reanimate");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Lazav, Dimir Mastermind", 1);
|
||||
// Codex Shredder - Artifact
|
||||
// {T}: Target player puts the top card of his or her library into his or her graveyard.
|
||||
// {5}, {T}, Sacrifice Codex Shredder: Return target card from your graveyard to your hand.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Codex Shredder", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB ,"Swamp", 3);
|
||||
// Flying 3/2
|
||||
addCard(Zone.LIBRARY, playerB, "Assault Griffin",1);
|
||||
// Target opponent sacrifices a creature. You gain life equal to that creature's toughness.
|
||||
addCard(Zone.HAND, playerB ,"Tribute to Hunger");
|
||||
|
||||
skipInitShuffling();
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Target player puts the top card of his or her library into his or her graveyard.", playerB);
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Tribute to Hunger");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Reanimate", "Lazav, Dimir Mastermind");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerB, "Tribute to Hunger", 1);
|
||||
assertGraveyardCount(playerA, "Reanimate", 1);
|
||||
|
||||
assertLife(playerA, 16); // -4 from Reanmiate
|
||||
assertLife(playerB, 22); // +3 from Tribute to Hunger because Lazav is 3/2
|
||||
|
||||
assertPermanentCount(playerA, "Lazav, Dimir Mastermind", 1);
|
||||
assertPowerToughness(playerA, "Lazav, Dimir Mastermind", 3, 3);
|
||||
Permanent lazav = getPermanent("Lazav, Dimir Mastermind", playerA.getId());
|
||||
Assert.assertFalse(lazav.getSubtype().contains("Griffin")); // no Griffin type
|
||||
Assert.assertFalse("Lazav, Dimir Mastermind must have flying",lazav.getAbilities().contains(FlyingAbility.getInstance()));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue