* Fixed a problem of triggered effects that detect if a creature was exiled but the creature ended in a another zone (e.g. commander) (fixes #5905),

This commit is contained in:
LevelX2 2019-12-28 18:21:32 +01:00
parent 12639bce26
commit 554c5baf25
3 changed files with 71 additions and 13 deletions

View file

@ -82,6 +82,11 @@ public class CommanderReplaceEffectTest extends CardTestCommanderDuelBase {
}
// https://github.com/magefree/mage/issues/5905
/* From the rulings of Soulherder:
If a creature is exiled but ends up in another zone (most likely because
its a players commander in the Commander variant), Soulherders first ability triggers.
I exiled an opponents Commander, but Soulherder did not trigger.*/
@Test
public void soulherderAndExiledCommanders() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
@ -110,4 +115,50 @@ public class CommanderReplaceEffectTest extends CardTestCommanderDuelBase {
assertPowerToughness(playerA, "Soulherder", 2, 2);
}
@Test
public void soulherderAndDestroyedCommanders() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Whenever a creature is exiled from the battlefield, put a +1/+1 counter on Soulherder.
// At the beginning of your end step, you may exile another target creature you control,
// then return that card to the battlefield under its owner's control.
addCard(Zone.HAND, playerA, "Soulherder", 1); // Creature {1}{W}{U}
// Farm {2}{W} - Instant
// Destroy target attacking or blocking creature.
// Market {2}{U} - Sorcery
// Aftermath (Cast this spell only from your graveyard. Then exile it.)
// Draw two cards, then discard two cards.
addCard(Zone.HAND, playerB, "Farm // Market", 1);
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
// Daxos of Meletis can't be blocked by creatures with power 3 or greater.
// Whenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Soulherder");
setChoice(playerA, "No"); // Use Soulherder's triggered ability
attack(3, playerA, "Daxos of Meletis");
castSpell(3, PhaseStep.DECLARE_BLOCKERS, playerB, "Farm", "Daxos of Meletis");
setChoice(playerA, "Yes"); // Move Daxos to command Zone
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerB, 40);
assertPermanentCount(playerA, "Soulherder", 1);
assertHandCount(playerB, "Farm // Market", 0);
assertGraveyardCount(playerB, "Farm // Market", 1);
assertPermanentCount(playerA, "Daxos of Meletis", 0);
assertCommandZoneCount(playerA, "Daxos of Meletis", 1);
assertPowerToughness(playerA, "Soulherder", 1, 1);
}
}