Dauthi Voidwalker - correct code for #8141 and same cards (see comments in fd719ad287);

This commit is contained in:
Oleg Agafonov 2021-09-19 04:01:01 +04:00
parent affd33c23b
commit a3ca9fc03a
8 changed files with 142 additions and 88 deletions

View file

@ -0,0 +1,42 @@
package org.mage.test.cards.single.mh2;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class DauthiVoidwalkerTest extends CardTestPlayerBase {
@Test
public void test_Play() {
// If a card would be put into an opponent's graveyard from anywhere, instead exile it with a void counter on it.
// {T}, Sacrifice Dauthi Voidwalker: Choose an exiled card an opponent owns with a void counter on it. You may play it this turn without paying its mana cost.
addCard(Zone.BATTLEFIELD, playerA, "Dauthi Voidwalker", 1);
//
addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears", 1);
//
addCard(Zone.HAND, playerA, "Lightning Bolt");
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
// kill B's creature and exile with void counter
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Balduvian Bears");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkExileCount("after exile", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", 1);
// can play it for free
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}, Sacrifice");
setChoice(playerA, "Balduvian Bears");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPermanentCount("after play", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Balduvian Bears", 1);
setStrictChooseMode(true);
setStopAt(2, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
}
}