add another test batch for Saga zcc-related

This commit is contained in:
Susucre 2025-05-31 14:50:34 +02:00
parent 7cdf068dc5
commit 5c25beebbf
5 changed files with 352 additions and 0 deletions

View file

@ -0,0 +1,56 @@
package org.mage.test.cards.single._40k;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TheHorusHeresyTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TheHorusHeresy The Horus Heresy} {3}{U}{B}{R}
* Enchantment Saga
* I For each opponent, gain control of up to one target nonlegendary creature that player controls for as long as this Saga remains on the battlefield.
* II Draw a card for each creature you control but dont own.
* III Starting with you, each player chooses a creature. Destroy each creature chosen this way.
*/
private static final String heresy = "The Horus Heresy";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, heresy, 1);
addCard(Zone.BATTLEFIELD, playerA, "Volcanic Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerB, "Ornithopter");
addCard(Zone.BATTLEFIELD, playerB, "Goblin Piker");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, heresy);
addTarget(playerA, "Goblin Piker");
checkPermanentCount("after I, A control of Goblin Piker", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Goblin Piker", 1);
// turn 3
// draw 1 with II
// turn 5
checkPermanentCount("before III, A control of Goblin Piker", 5, PhaseStep.UPKEEP, playerA, "Goblin Piker", 1);
setChoice(playerA, "Ornithopter");
setChoice(playerB, "Memnite");
setStrictChooseMode(true);
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerB, "Goblin Piker", 1);
assertGraveyardCount(playerB, "Ornithopter", 1);
assertGraveyardCount(playerA, "Memnite", 1);
assertHandCount(playerA, 3);
}
}

View file

@ -0,0 +1,53 @@
package org.mage.test.cards.single.ltr;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class ThereAndBackAgainTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.ThereAndBackAgain There and Back Again} {3}{R}{R}
* Enchantment Saga
* I Up to one target creature cant block for as long as you control this Saga. The Ring tempts you.
* II Search your library for a Mountain card, put it onto the battlefield, then shuffle.
* III Create Smaug, a legendary 6/6 red Dragon creature token with flying, haste, and When Smaug dies, create fourteen Treasure tokens.
*/
private static final String again = "There and Back Again";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, again, 1);
addCard(Zone.BATTLEFIELD, playerA, "Volcanic Island", 5);
addCard(Zone.BATTLEFIELD, playerA, "Gaea's Protector"); // 4/2 Must be blocked if able
addCard(Zone.BATTLEFIELD, playerB, "Amaranthine Wall"); // 0/6
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, again);
addTarget(playerA, "Amaranthine Wall");
attack(1, playerA, "Gaea's Protector");
// Wall can't block.
// turn 3
addTarget(playerA, "Mountain");
attack(3, playerA, "Gaea's Protector");
// Wall can't block.
// turn 5
attack(5, playerA, "Gaea's Protector");
// Wall must block
setStrictChooseMode(true);
setStopAt(5, PhaseStep.END_TURN);
execute();
assertLife(playerB, 20 - 4 * 2);
assertDamageReceived(playerB, "Amaranthine Wall", 4);
assertPermanentCount(playerA, "Smaug", 1);
}
}

View file

@ -0,0 +1,84 @@
package org.mage.test.cards.single.pip;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class Vault13DwellersJourneyTest extends CardTestPlayerBase {
/**
* {@link mage.cards.v.Vault13DwellersJourney Vault 13: Dweller's Journey} {3}{W}
* Enchantment Saga
* I For each player, exile up to one other target enchantment or creature that player controls until this Saga leaves the battlefield.
* II You gain 2 life and scry 2.
* III Return two cards exiled with this Saga to the battlefield under their owners control and put the rest on the bottom of their owners libraries.
*/
private static final String vault = "Vault 13: Dweller's Journey";
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void test_SimplePlay_Return() {
addCard(Zone.HAND, playerA, vault, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerB, "Ornithopter");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, vault);
addTarget(playerA, "Memnite");
addTarget(playerA, "Ornithopter");
checkExileCount("after I: Memnite exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Memnite", 1);
checkExileCount("after I: Ornithopter exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Ornithopter", 1);
// turn 3
setChoice(playerA, "Mountain"); // for Scry 2
// turn 5
checkExileCount("before III: Memnite exiled", 5, PhaseStep.UPKEEP, playerA, "Memnite", 1);
checkExileCount("before III: Ornithopter exiled", 5, PhaseStep.UPKEEP, playerB, "Ornithopter", 1);
setChoice(playerA, "Memnite^Ornithopter");
setStrictChooseMode(true);
setStopAt(8, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Memnite", 1);
assertPermanentCount(playerB, "Ornithopter", 1);
assertLife(playerA, 20 + 2);
}
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void test_SimplePlay_NoReturn() {
addCard(Zone.HAND, playerA, vault, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerB, "Ornithopter");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, vault);
addTarget(playerA, "Ornithopter");
checkExileCount("after I: Ornithopter exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Ornithopter", 1);
// turn
setChoice(playerA, "Mountain"); // for Scry 2
// turn 5
checkExileCount("before III: Ornithopter exiled", 5, PhaseStep.UPKEEP, playerB, "Ornithopter", 1);
setStrictChooseMode(true);
setStopAt(8, PhaseStep.END_TURN);
execute();
assertLibraryCount(playerB, "Ornithopter", 1);
assertLife(playerA, 20 + 2);
}
}

View file

@ -0,0 +1,52 @@
package org.mage.test.cards.single.pip;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class Vault87ForcedEvolutionTest extends CardTestPlayerBase {
/**
* {@link mage.cards.v.Vault87ForcedEvolution Vault 87: Forced Evolution} {3}{G}{U}
* Enchantment Saga
* I Gain control of target non-Mutant creature for as long as you control this Saga.
* II Put a +1/+1 counter on target creature you control. It becomes a Mutant in addition to its other types.
* III Draw cards equal to the greatest power among Mutants you control.
*/
private static final String vault = "Vault 87: Forced Evolution";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, vault, 1);
addCard(Zone.BATTLEFIELD, playerA, "Tropical Island", 5);
addCard(Zone.BATTLEFIELD, playerB, "Memnite");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, vault);
addTarget(playerA, "Memnite");
checkPermanentCount("after I: Memnite control by A", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Memnite", 1);
// turn 3
addTarget(playerA, "Memnite");
// turn 5
checkPermanentCount("before III: Memnite control by A", 5, PhaseStep.UPKEEP, playerA, "Memnite", 1);
setStrictChooseMode(true);
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerB, "Memnite", 1);
assertCounterCount(playerB, "Memnite", CounterType.P1P1, 1);
assertSubtype("Memnite", SubType.MUTANT);
assertSubtype("Memnite", SubType.CONSTRUCT);
assertHandCount(playerA, 4);
}
}

View file

@ -0,0 +1,107 @@
package org.mage.test.cards.single.who;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TheWarGamesTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TheWarGames The War Games} {2}{W}{W}
* Enchantment Saga
* I Each player creates three tapped 1/1 white Warrior creature tokens. The tokens are goaded for as long as this Saga remains on the battlefield.
* II, III Put a +1/+1 counter on each Warrior creature.
* IV You may exile a nontoken creature you control. When you do, exile all Warriors.
*/
private static final String war = "The War Games";
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void test_SimplePlay_NoExile() {
addCard(Zone.HAND, playerA, war, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, war);
// no attack
// turn 2
// 3 1/1 must attack A
// turn 3
// 3 2/2 must attack B
// turn 4
// 3 2/2 must attack A
// turn 5
// 3 3/3 must attack B
// turn 6
// 3 3/3 must attack A
// turn 7
setChoice(playerA, false);
// no mandatory attack
// turn 8
// no mandatory attack
setStrictChooseMode(true);
setStopAt(8, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Warrior Token", 3);
assertPermanentCount(playerB, "Warrior Token", 3);
assertLife(playerA, 20 - 3 - 6 - 9);
assertLife(playerB, 20 - 6 - 9);
}
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void test_SimplePlay_Exile() {
addCard(Zone.HAND, playerA, war, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, war);
// no attack
// turn 2
// 3 1/1 must attack A
// turn 3
// 3 2/2 must attack B
// turn 4
// 3 2/2 must attack A
// turn 5
// 3 3/3 must attack B
// turn 6
// 3 3/3 must attack A
// turn 7
setChoice(playerA, true);
setChoice(playerA, "Memnite"); // exiling all Warriors
setStrictChooseMode(true);
setStopAt(7, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, "Warrior Token", 0);
assertPermanentCount(playerB, "Warrior Token", 0);
assertExileCount(playerA, "Memnite", 1);
assertLife(playerA, 20 - 3 - 6 - 9);
assertLife(playerB, 20 - 6 - 9);
}
}