mirror of
https://github.com/correl/mage.git
synced 2025-03-29 17:00:07 -09:00
* Desecrated Tomb - fixed that it did not produce bat tokens if a Zombie cards was cast from graveyard (fixes #5318).
This commit is contained in:
parent
8df97aa6f6
commit
226019be89
2 changed files with 52 additions and 5 deletions
Mage.Tests/src/test/java/org/mage/test/cards/planeswalker
Mage/src/main/java/mage/game
|
@ -19,8 +19,8 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
/*
|
||||
Binding Mummy {1}{W}
|
||||
Creature - Zombie 2/2
|
||||
Whenever another Zombie enters the battlefield under your control, you may tap target artifact or creature.
|
||||
*/
|
||||
Whenever another Zombie enters the battlefield under your control, you may tap target artifact or creature.
|
||||
*/
|
||||
String bMummy = "Binding Mummy";
|
||||
|
||||
/*
|
||||
|
@ -29,7 +29,7 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
[+1] : Create a 2/2 black Zombie creature token. Put the top two cards of your library into your graveyard.
|
||||
[-3] : Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types.
|
||||
[-7] : Destroy all non-Zombie creatures.
|
||||
*/
|
||||
*/
|
||||
String liliannaDM = "Liliana, Death's Majesty";
|
||||
|
||||
/*
|
||||
|
@ -37,7 +37,7 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
Creature - Angel 3/3
|
||||
Flying, vigilance
|
||||
Cycling {W}
|
||||
*/
|
||||
*/
|
||||
String wShepherd = "Winged Shepherd";
|
||||
|
||||
String yOx = "Yoked Ox"; // {W} 0/4
|
||||
|
@ -56,7 +56,7 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
|
||||
assertPermanentCount(playerA, bMummy, 1);
|
||||
assertPermanentCount(playerA, liliannaDM, 1);
|
||||
assertPermanentCount(playerA, wShepherd, 1);
|
||||
|
@ -66,4 +66,44 @@ public class LilianaTest extends CardTestPlayerBase {
|
|||
assertType(wShepherd, CardType.CREATURE, SubType.ANGEL);
|
||||
assertTapped(yOx, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCastingCreaturesFromGraveTriggerDesecratedTomb() {
|
||||
|
||||
/*
|
||||
Liliana, Untouched by Death {2}{B}{B}
|
||||
Legendary Planeswalker — Liliana
|
||||
+1: Put the top three cards of your library into your graveyard. If at least one of them is a Zombie card, each opponent loses 2 life and you gain 2 life.
|
||||
−2: Target creature gets -X/-X until end of turn, where X is the number of Zombies you control.
|
||||
−3: You may cast Zombie cards from your graveyard this turn.
|
||||
*/
|
||||
String liliannaUbD = "Liliana, Untouched by Death";
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
|
||||
addCard(Zone.HAND, playerA, liliannaUbD);
|
||||
/*
|
||||
* Carrion Feeder {B}
|
||||
* Creature — Zombie
|
||||
* Carrion Feeder can’t block.
|
||||
* Sacrifice a creature: Put a +1/+1 counter on Carrion Feeder.
|
||||
*/
|
||||
addCard(Zone.GRAVEYARD, playerA, "Carrion Feeder");
|
||||
|
||||
// Whenever one or more creature cards leave your graveyard, create a 1/1 black Bat creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Desecrated Tomb", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, liliannaUbD);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "-3:"); // Liliana -3
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Carrion Feeder");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, liliannaUbD, 1);
|
||||
assertCounterCount(playerA, liliannaUbD, CounterType.LOYALTY, 1);
|
||||
assertPermanentCount(playerA, "Carrion Feeder", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Bat", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import mage.constants.Zone;
|
|||
import mage.filter.FilterCard;
|
||||
import mage.game.command.Commander;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.events.ZoneChangeGroupEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
import mage.game.permanent.PermanentMeld;
|
||||
|
@ -25,6 +26,12 @@ public final class ZonesHandler {
|
|||
public static boolean cast(ZoneChangeInfo info, Game game) {
|
||||
if (maybeRemoveFromSourceZone(info, game)) {
|
||||
placeInDestinationZone(info, game);
|
||||
// create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx))
|
||||
Set<Card> cards = new HashSet<>();
|
||||
Card targetCard = getTargetCard(game, info.event.getTargetId());
|
||||
cards.add(targetCard);
|
||||
game.fireEvent(new ZoneChangeGroupEvent(cards, info.event.getSourceId(), info.event.getPlayerId(), info.event.getFromZone(), info.event.getToZone()));
|
||||
// normal movement
|
||||
game.fireEvent(info.event);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue