make batchs for milling cards (per player, all)

Rework and test the couple of existing cards triggering on mill.
This commit is contained in:
Susucre 2024-05-01 20:55:50 +02:00
parent 4edb9ce270
commit 7c3bbed8f3
17 changed files with 452 additions and 107 deletions

View file

@ -0,0 +1,86 @@
package org.mage.test.cards.single.clb;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class ZellixSanityFlayerTest extends CardTestPlayerBase {
/**
* {@link mage.cards.z.ZellixSanityFlayer Zellix, Sanity Flayer} {2}{U}
* Legendary Creature Horror
* Hive Mind Whenever a player mills one or more creature cards, you create a 1/1 black Horror creature token.
* {1}, {T}: Target player mills three cards.
* Choose a Background (You can have a Background as a second commander.)
* 2/3
*/
private static final String zellix = "Zellix, Sanity Flayer";
@Test
public void test_Trigger_2Player_Milling() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, zellix);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards.
addCard(Zone.LIBRARY, playerA, "Memnite", 2);
addCard(Zone.LIBRARY, playerB, "Memnite", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}");
setChoice(playerA, "<i>Hive Mind</i>"); // stacking triggers
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, 2);
assertGraveyardCount(playerA, 2);
assertPermanentCount(playerA, "Horror Token", 2);
}
@Test
public void test_Trigger_1Player_MillingCreature() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, zellix);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards.
addCard(Zone.LIBRARY, playerA, "Memnite", 2);
addCard(Zone.LIBRARY, playerB, "Taiga", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, 2);
assertGraveyardCount(playerA, 2);
assertPermanentCount(playerA, "Horror Token", 1);
}
@Test
public void test_NoTrigger_0CreatureMilled() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, zellix);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards.
addCard(Zone.LIBRARY, playerA, "Taiga", 2);
addCard(Zone.LIBRARY, playerB, "Taiga", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, 2);
assertGraveyardCount(playerA, 2);
assertPermanentCount(playerA, "Horror Token", 0);
}
}

View file

@ -0,0 +1,73 @@
package org.mage.test.cards.single.pip;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TheWiseMothmanTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TheWiseMothman The Wise Mothman} {1}{B}{G}{U}
* Legendary Creature Insect Mutant
* Flying
* Whenever The Wise Mothman enters the battlefield or attacks, each player gets a rad counter.
* Whenever one or more nonland cards are milled, put a +1/+1 counter on each of up to X target creatures, where X is the number of nonland cards milled this way.
* 3/3
*/
private static final String mothman = "The Wise Mothman";
@Test
public void test_Trigger_3NonLand_1Land() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, mothman);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard");
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards.
addCard(Zone.LIBRARY, playerA, "Taiga", 1);
addCard(Zone.LIBRARY, playerA, "Baneslayer Angel", 1);
addCard(Zone.LIBRARY, playerB, "Memnite", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}");
addTarget(playerA, mothman + "^Grizzly Bears"); // up to three targets => choosing 2
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Taiga", 1);
assertGraveyardCount(playerA, "Baneslayer Angel", 1);
assertGraveyardCount(playerB, "Memnite", 2);
assertCounterCount(playerA, mothman, CounterType.P1P1, 1);
assertCounterCount(playerA, "Grizzly Bears", CounterType.P1P1, 1);
assertCounterCount(playerA, "Elite Vanguard", CounterType.P1P1, 0);
}
@Test
public void test_NoTrigger_AllLands() {
setStrictChooseMode(true);
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, mothman);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Whetstone"); // {3}: Each player mills two cards.
addCard(Zone.LIBRARY, playerA, "Taiga", 2);
addCard(Zone.LIBRARY, playerA, "Taiga", 2);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}");
// no trigger
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, 2);
assertGraveyardCount(playerB, 2);
assertCounterCount(playerA, mothman, CounterType.P1P1, 0);
}
}