* Tawnos's Coffin - Fixed that it did not return the exiled targes if Tawnos's Coffin left the battlefield (fixes #5243).

This commit is contained in:
LevelX2 2018-09-14 14:52:21 +02:00
parent 68dc82342c
commit a365cee0f1
2 changed files with 33 additions and 3 deletions

View file

@ -1,4 +1,3 @@
package mage.cards.t; package mage.cards.t;
import java.util.HashSet; import java.util.HashSet;
@ -171,7 +170,7 @@ class TawnossCoffinReturnEffect extends OneShotEffect {
if (controller == null) { if (controller == null) {
return false; return false;
} }
UUID exileZoneId = CardUtil.getCardExileZoneId(game, source); UUID exileZoneId = CardUtil.getCardExileZoneId(game, source.getSourceId(), source.getSourcePermanentIfItStillExists(game) == null);
ExileZone exileZone = game.getExile().getExileZone(exileZoneId); ExileZone exileZone = game.getExile().getExileZone(exileZoneId);
if (exileZone == null) { if (exileZone == null) {
return true; return true;

View file

@ -1,4 +1,3 @@
package org.mage.test.cards.abilities.oneshot.exile; package org.mage.test.cards.abilities.oneshot.exile;
import mage.abilities.keyword.ReachAbility; import mage.abilities.keyword.ReachAbility;
@ -116,4 +115,36 @@ public class ExileAndReturnTest extends CardTestPlayerBase {
assertHandCount(playerB, 3); // 1 from Turn 2 and 2 from Frog Tongue assertHandCount(playerB, 3); // 1 from Turn 2 and 2 from Frog Tongue
} }
@Test
public void testExileAndReturnIfTawnosLeftBattlefield() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 7);
// You may choose not to untap Tawnos's Coffin during your untap step.
// {3}, {T}: Exile target creature and all Auras attached to it. Note the number and kind of counters that were on that creature.
// When Tawnos's Coffin leaves the battlefield or becomes untapped, return the exiled card to the battlefield under
// its owner's control tapped with the noted number and kind of counters on it, and if you do, return the exiled Aura
// cards to the battlefield under their owner's control attached to that permanent.
addCard(Zone.HAND, playerA, "Tawnos's Coffin"); // Artifact {4}
addCard(Zone.BATTLEFIELD, playerB, "Plains", 2);
addCard(Zone.HAND, playerB, "Disenchant");
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tawnos's Coffin");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}", "Silvercoat Lion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Disenchant", "Tawnos's Coffin");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerB, "Disenchant", 1);
assertPermanentCount(playerA, "Tawnos's Coffin", 0);
assertGraveyardCount(playerA, "Tawnos's Coffin", 1);
assertPermanentCount(playerB, "Silvercoat Lion", 1);
}
} }