Wild Pair - fixed condition handling.

This commit is contained in:
LevelX2 2016-03-04 12:21:47 +01:00
parent db0674a94d
commit 080a1b883c
19 changed files with 120 additions and 60 deletions

View file

@ -130,72 +130,73 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase {
assertLife(playerA, 15);
assertLife(playerB, 20);
}
/**
* Dread Cacodemon's abilities should only trigger when cast from hand.
*
* Testing when cast from hand abilities take effect.
* Cast from hand destroys opponents creatures and taps all other creatures owner controls.
*
* Testing when cast from hand abilities take effect. Cast from hand
* destroys opponents creatures and taps all other creatures owner controls.
*/
@Test
public void testDreadCacodemonConditionTrue() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
// When Dread Cacodemon enters the battlefield, if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control.
addCard(Zone.HAND, playerA, "Dread Cacodemon", 1); // 8/8 - {7}{B}{B}{B}
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
// Protection from white, first strike
addCard(Zone.BATTLEFIELD, playerA, "Black Knight", 2); // {B}{B}
// Deathtouch
addCard(Zone.BATTLEFIELD, playerB, "Typhoid Rats", 2); // {B}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dread Cacodemon");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerB, "Typhoid Rats", 0);
assertPermanentCount(playerA, "Dread Cacodemon", 1);
assertPermanentCount(playerA, "Black Knight", 2);
assertPermanentCount(playerA, "Black Knight", 2);
assertTappedCount("Black Knight", true, 2);
assertTapped("Dread Cacodemon", false);
}
/**
/**
* Dread Cacodemon's abilities should only trigger when cast from hand.
*
*
* Testing when card is not cast from hand, abilities do not take effect.
* All opponents creatures remain alive and owner's creatures are not tapped.
* All opponents creatures remain alive and owner's creatures are not
* tapped.
*/
@Test
public void testDreadCacodemonConditionFalse() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
// When Dread Cacodemon enters the battlefield, if you cast it from your hand, destroy all creatures your opponents control, then tap all other creatures you control.
addCard(Zone.GRAVEYARD, playerA, "Dread Cacodemon", 1); // 8/8 - {7}{B}{B}{B}
// Put target creature card from a graveyard onto the battlefield under your control. You lose life equal to its converted mana cost.
addCard(Zone.HAND, playerA, "Reanimate", 1); // {B}
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
// Protection from white, first strike
addCard(Zone.BATTLEFIELD, playerA, "Black Knight", 2); // {B}{B}
// Deathtouch
addCard(Zone.BATTLEFIELD, playerB, "Typhoid Rats", 2); // {B}
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reanimate", "Dread Cacodemon");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerB, "Typhoid Rats", 2);
assertGraveyardCount(playerA, "Reanimate", 1);
assertPermanentCount(playerA, "Dread Cacodemon", 1);
assertPermanentCount(playerA, "Black Knight", 2);
assertPermanentCount(playerA, "Black Knight", 2);
assertTappedCount("Black Knight", false, 2);
assertTapped("Dread Cacodemon", false);
@ -203,4 +204,27 @@ public class EntersTheBattlefieldTriggerTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
/**
* Test that the cast from hand condition works for target permanent
*
*/
@Test
public void testWildPair() {
// Whenever a creature enters the battlefield, if you cast it from your hand, you may search your library for a creature card with the same total power and toughness and put it onto the battlefield. If you do, shuffle your library.
addCard(Zone.BATTLEFIELD, playerA, "Wild Pair");
addCard(Zone.HAND, playerA, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
setChoice(playerA, "Silvercoat Lion");
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Silvercoat Lion", 2);
}
}