* Undying - Fixed that the creature with undying returnd under the control of the previous controller instead of the card owner.

This commit is contained in:
LevelX2 2015-02-25 22:21:17 +01:00
parent a8f8697a25
commit 329165555b
2 changed files with 38 additions and 1 deletions

View file

@ -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);
}
}

View file

@ -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) {