From 329165555b7703713333ee97d9656e2b78241a2f Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 25 Feb 2015 22:21:17 +0100 Subject: [PATCH] * Undying - Fixed that the creature with undying returnd under the control of the previous controller instead of the card owner. --- .../cards/abilities/keywords/UndyingTest.java | 37 +++++++++++++++++++ .../abilities/keyword/UndyingAbility.java | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java index e4e861283c..2545cc81a7 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/UndyingTest.java @@ -76,4 +76,41 @@ public class UndyingTest extends CardTestPlayerBase { assertPowerToughness(playerA, "Elite Vanguard", 3, 2); } + + /** + * Tests "Threads of Disloyalty enchanting Strangleroot Geist: after geist died it returns to the bf under opponent's control." + */ + @Test + public void testUndyingControlledReturnsToOwner() { + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); + // Strangleroot Geist 2/1 + // Haste + // Undying + // (When it dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.) + addCard(Zone.HAND, playerA, "Strangleroot Geist"); + addCard(Zone.HAND, playerA, "Lightning Bolt"); + + addCard(Zone.BATTLEFIELD, playerB, "Island", 3); + // Threads of Disloyalty {1}{U}{U} + // Enchant creature with converted mana cost 2 or less + // You control enchanted creature. + addCard(Zone.HAND, playerB, "Threads of Disloyalty"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Strangleroot Geist"); + + castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Threads of Disloyalty", "Strangleroot Geist"); + + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", "Strangleroot Geist"); + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertGraveyardCount(playerB, "Threads of Disloyalty", 1); + assertGraveyardCount(playerA, "Lightning Bolt",1); + assertPermanentCount(playerB, "Strangleroot Geist", 0); + assertPermanentCount(playerA, "Strangleroot Geist", 1); + assertPowerToughness(playerA, "Strangleroot Geist", 3, 2); + } + + } diff --git a/Mage/src/mage/abilities/keyword/UndyingAbility.java b/Mage/src/mage/abilities/keyword/UndyingAbility.java index e5aad5a8e7..f77fbd1870 100644 --- a/Mage/src/mage/abilities/keyword/UndyingAbility.java +++ b/Mage/src/mage/abilities/keyword/UndyingAbility.java @@ -23,7 +23,7 @@ public class UndyingAbility extends DiesTriggeredAbility { public UndyingAbility() { super(new UndyingEffect()); - this.addEffect(new ReturnSourceFromGraveyardToBattlefieldEffect()); + this.addEffect(new ReturnSourceFromGraveyardToBattlefieldEffect(false, true)); } public UndyingAbility(final UndyingAbility ability) {