* Brutal Expulsion - Fixed that also spell targets were handled correctly.

This commit is contained in:
LevelX2 2015-09-20 10:31:14 +02:00
parent 24d555f41c
commit 391d247e7c
4 changed files with 71 additions and 81 deletions

View file

@ -36,7 +36,6 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
public class ReturnToHandTest extends CardTestPlayerBase {
/**
@ -47,23 +46,23 @@ public class ReturnToHandTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Pillarfield Ox");
// Bloodthirst 3
// Flying
// {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn.
// {R}{R}{R}: Return Skarrgan Firebird from your graveyard to your hand. Activate this ability only if an opponent was dealt damage this turn.
addCard(Zone.BATTLEFIELD, playerB, "Skarrgan Firebird");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 3);
addCard(Zone.HAND, playerB, "Bone Splinters");
// As an additional cost to cast Bone Splinters, sacrifice a creature.
// Destroy target creature.
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Bone Splinters", "Pillarfield Ox");
setChoice(playerB, "Skarrgan Firebird");
attack(2, playerB, "Silvercoat Lion");
activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{R}{R}{R}: Return");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Skarrgan Firebird", 0);
@ -79,40 +78,71 @@ public class ReturnToHandTest extends CardTestPlayerBase {
@Test
public void VeilbornGhoulTest1() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Swamp");
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Swamp", 1);
assertPermanentCount(playerA, "Swamp", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
/**
* Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play
* Return from graveyard to hand if you play a non swamp land but Urborg,
* Tomb of Yawgmoth is in play
*/
@Test
public void VeilbornGhoulTest2() {
// Veilborn Ghoul can't block.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
// Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
addCard(Zone.HAND, playerA, "Flood Plain");
// Each land is a Swamp in addition to its other land types.
addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1);
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Flood Plain", 1);
assertPermanentCount(playerA, "Flood Plain", 1);
assertHandCount(playerA, "Veilborn Ghoul", 1);
}
}
/**
* Return a spell from stack to Hand
*/
@Test
public void BrutalExpulsionTest() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
// Devoid
// Choose one or both
// - Return target spell or creature to its owner's hand;
// or Brutal Expulsion deals 2 damage to target creature or planeswalker. If that permanent would be put into a graveyard this turn, exile it instead.
addCard(Zone.HAND, playerA, "Brutal Expulsion"); // {2}{U}{R}
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
addCard(Zone.HAND, playerB, "Pillarfield Ox", 1);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Pillarfield Ox");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerA, "Brutal Expulsion", "mode=1Pillarfield Ox^mode=2Silvercoat Lion", "Pillarfield Ox");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Brutal Expulsion", 1);
assertExileCount("Silvercoat Lion", 1);
assertPermanentCount(playerB, "Pillarfield Ox", 0);
assertHandCount(playerB, "Pillarfield Ox", 1);
}
}

View file

@ -935,7 +935,8 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
* @param step
* @param player
* @param cardName
* @param targetName
* @param targetName for modal spells add the mode to the name e.g.
* "mode=2SilvercoatLion^mode3=PillarfieldOx"
* @param spellOnStack
*/
public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, String targetName, String spellOnStack) {