add more tests for zcc-related Sagas

This commit is contained in:
Susucre 2025-05-31 14:12:13 +02:00
parent 2e7e78d1e5
commit 7cdf068dc5
7 changed files with 342 additions and 1 deletions

View file

@ -126,7 +126,7 @@ class TheDayOfTheDoctorChooseEffect extends OneShotEffect {
game.getBattlefield()
.getActivePermanents(
StaticFilters.FILTER_PERMANENT_CREATURE,
source.getSourceId(), source, game
source.getControllerId(), source, game
)
.stream()
.filter(permanent -> !target.getTargets()

View file

@ -0,0 +1,59 @@
package org.mage.test.cards.single.fic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.player.TestPlayer;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class SummonIxionTest extends CardTestPlayerBase {
/**
* {@link mage.cards.s.SummonIxion Summon: Ixion} {2}{W}
* Enchantment Creature Saga Unicorn
* I - Aerospark Exile target creature an opponent controls until this Saga leaves the battlefield.
* II, III - Put a +1/+1 counter on each of up to two target creatures you control. You gain 2 life.
* First strike
* 3/3
*/
private static final String ixion = "Summon: Ixion";
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, ixion, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Memnite", 1);
addCard(Zone.BATTLEFIELD, playerB, "Elite Vanguard", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ixion);
addTarget(playerA, "Elite Vanguard");
checkExileCount("after I, Vanguard exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Elite Vanguard", 1);
// turn 3
addTarget(playerA, "Memnite");
addTarget(playerA, TestPlayer.TARGET_SKIP);
// turn 5
checkExileCount("before III, Vanguard exiled", 5, PhaseStep.UPKEEP, playerB, "Elite Vanguard", 1);
addTarget(playerA, "Grizzly Bears");
addTarget(playerA, "Memnite");
setStrictChooseMode(true);
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerA, 20 + 2 * 2);
assertCounterCount(playerA, "Grizzly Bears", CounterType.P1P1, 1);
assertCounterCount(playerA, "Memnite", CounterType.P1P1, 2);
assertPermanentCount(playerB, "Elite Vanguard", 1);
}
}

View file

@ -0,0 +1,55 @@
package org.mage.test.cards.single.khm;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class KingNarfisBetrayalTest extends CardTestPlayerBase {
/**
* {@link mage.cards.k.KingNarfisBetrayal King Narfi's Betrayal} {1}{U}{B}
* Enchantment Saga
* I Each player mills four cards. Then you may exile a creature or planeswalker card from each graveyard.
* II, III Until end of turn, you may cast spells from among cards exiled with this Saga, and you may spend mana as though it were mana of any color to cast those spells.
*/
private static final String betrayal = "King Narfi's Betrayal";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, betrayal, 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
addCard(Zone.GRAVEYARD, playerA, "Grizzly Bears", 1);
addCard(Zone.GRAVEYARD, playerB, "Elite Vanguard", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, betrayal);
setChoice(playerA, true);
addTarget(playerA, "Grizzly Bears");
setChoice(playerA, true);
addTarget(playerA, "Elite Vanguard");
checkExileCount("after I, Bears exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears", 1);
checkExileCount("after I, Vanguard exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Elite Vanguard", 1);
// turn 3
// do nothing there.
// turn 5
waitStackResolved(5, PhaseStep.PRECOMBAT_MAIN, playerA);
castSpell(5, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", true);
castSpell(5, PhaseStep.PRECOMBAT_MAIN, playerA, "Elite Vanguard");
setStrictChooseMode(true);
setStopAt(5, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerA, 5);
assertGraveyardCount(playerB, 4);
assertPermanentCount(playerA, "Grizzly Bears", 1);
assertPermanentCount(playerA, "Elite Vanguard", 1);
}
}

View file

@ -0,0 +1,56 @@
package org.mage.test.cards.single.ltr;
import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TaleOfTinuvielTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TaleOfTinuviel Tale of Tinuviel} {3}{W}{W}
* Enchantment Saga
* I Target creature you control gains indestructible for as long as you control this Saga.
* II Return target creature card from your graveyard to the battlefield.
* III Up to two target creatures you control each gain lifelink until end of turn.
*/
private static final String tale = "Tale of Tinuviel";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, tale, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 1);
addCard(Zone.GRAVEYARD, playerA, "Memnite", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, tale);
addTarget(playerA, "Grizzly Bears");
checkAbility("after I, Grizzly Bears indestructible", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears", IndestructibleAbility.class, true);
// turn 3
addTarget(playerA, "Memnite");
// turn 5
checkAbility("before III, Grizzly Bears indestructible", 5, PhaseStep.UPKEEP, playerA, "Grizzly Bears", IndestructibleAbility.class, true);
addTarget(playerA, "Grizzly Bears");
addTarget(playerA, "Memnite");
checkAbility("after III, Grizzly Bears not indestructible", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears", IndestructibleAbility.class, false);
checkAbility("after III, Grizzly Bears lifelink", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grizzly Bears", LifelinkAbility.class, true);
checkAbility("after III, Memnite lifelink", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Memnite", LifelinkAbility.class, true);
setStrictChooseMode(true);
setStopAt(6, PhaseStep.PRECOMBAT_MAIN);
execute();
assertAbility(playerA, "Grizzly Bears", LifelinkAbility.getInstance(), false);
assertAbility(playerA, "Memnite", LifelinkAbility.getInstance(), false);
}
}

View file

@ -0,0 +1,53 @@
package org.mage.test.cards.single.mom;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class JinGitaxiasTest extends CardTestPlayerBase {
/**
* {@link mage.cards.j.JinGitaxias Jin-Gitaxias // The Great Synthesis}
* Jin-Gitaxias {3}{U}{U}
* Legendary Creature Phyrexian Praetor
* Ward {2}
* Whenever you cast a noncreature spell with mana value 3 or greater, draw a card.
* {3}{U}: Exile Jin-Gitaxias, then return it to the battlefield transformed under its owners control. Activate only as a sorcery and only if you have seven or more cards in hand.
* 5/5
* The Great Synthesis
* Enchantment Saga
* I Draw cards equal to the number of cards in your hand. You have no maximum hand size for as long as you control this Saga.
* II Return all non-Phyrexian creatures to their owners hands.
* III You may cast any number of spells from your hand without paying their mana costs. Exile this Saga, then return it to the battlefield (front face up).
*/
private static final String jin = "Jin-Gitaxias";
@Test
public void test_SimplePlay() {
addCard(Zone.BATTLEFIELD, playerA, jin, 1);
addCard(Zone.HAND, playerA, "Mountain", 7);
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
addCard(Zone.BATTLEFIELD, playerB, "Memnite", 4);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}{U}: Exile ");
checkHandCount("after I", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, 14);
// turn 3
checkHandCount("after III", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, 15);
checkHandCardCount("after III", 3, PhaseStep.POSTCOMBAT_MAIN, playerB, "Memnite", 4);
// turn 5
checkHandCount("after III", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, 16);
setStrictChooseMode(true);
setStopAt(6, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerB, 7);
}
}

View file

@ -0,0 +1,46 @@
package org.mage.test.cards.single.who;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class GenesisOfTheDaleksTest extends CardTestPlayerBase {
/**
* {@link mage.cards.g.GenesisOfTheDaleks Genesis of the Daleks} {4}{B}{B}
* Enchantment Saga
* I, II, III Create a 3/3 black Dalek artifact creature token with menace for each lore counter on Genesis of the Daleks.
* IV Target opponent faces a villainous choice Destroy all Dalek creatures and each of your opponents loses life equal to the total power of Daleks that died this turn, or destroy all non-Dalek creatures.
*/
private static final String genesis = "Genesis of the Daleks";
@Test
public void test_SimplePlay() {
addCard(Zone.HAND, playerA, genesis, 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 6);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, genesis);
checkPermanentCount("T1: after I", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Dalek Token", 1);
// turn 3
checkPermanentCount("T3: after II", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Dalek Token", 3);
// turn 5
checkPermanentCount("T5: after III", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Dalek Token", 6);
// turn 7
setChoice(playerB, true); // choose Destroy all Dalek creatures and each of your opponents loses life equal to the total power of Daleks that died this turn
setStrictChooseMode(true);
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertPermanentCount(playerA, 6);
assertLife(playerB, 20 - 18);
}
}

View file

@ -0,0 +1,72 @@
package org.mage.test.cards.single.who;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TheDayOfTheDoctorTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TheDayOfTheDoctor The Day of the Doctor} {3}{R}{W}
* Enchantment Saga
* I, II, III Exile cards from the top of your library until you exile a legendary card. You may play that card for as long as this Saga remains on the battlefield. Put the rest of those exiled cards on the bottom of your library in a random order.
* IV Choose up to three Doctors. You may exile all other creatures. If you do, this Saga deals 13 damage to you.
*/
private static final String day = "The Day of the Doctor";
@Test
public void test_SimplePlay() {
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerA, "Yawgmoth's Bargain"); // skip draw step
addCard(Zone.LIBRARY, playerA, "Academy Ruins");
addCard(Zone.LIBRARY, playerA, "Arcade Gannon");
addCard(Zone.LIBRARY, playerA, "Memnite", 4);
addCard(Zone.LIBRARY, playerA, "Thalia, Guardian of Thraben");
addCard(Zone.BATTLEFIELD, playerA, "The Ninth Doctor"); // is a doctor
addCard(Zone.HAND, playerA, day, 1);
addCard(Zone.BATTLEFIELD, playerA, "Plateau", 3);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, day);
checkExileCount("after I, Thalia exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Thalia, Guardian of Thraben", 1);
checkExileCount("after I, Arcade Gannon not exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Arcade Gannon", 0);
checkExileCount("after I, Academy Ruins not exiled", 1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Academy Ruins", 0);
// turn 3
checkExileCount("after II, Thalia exiled", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Thalia, Guardian of Thraben", 1);
checkExileCount("after II, Arcade Gannon exiled", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Arcade Gannon", 1);
checkExileCount("after II, Academy Ruins not exiled", 3, PhaseStep.POSTCOMBAT_MAIN, playerA, "Academy Ruins", 0);
// turn 5
waitStackResolved(5, PhaseStep.PRECOMBAT_MAIN);
checkExileCount("after III, Thalia exiled", 5, PhaseStep.PRECOMBAT_MAIN, playerA, "Thalia, Guardian of Thraben", 1);
checkExileCount("after III, Arcade Gannon exiled", 5, PhaseStep.PRECOMBAT_MAIN, playerA, "Arcade Gannon", 1);
checkExileCount("after III, Academy Ruins not exiled", 5, PhaseStep.PRECOMBAT_MAIN, playerA, "Academy Ruins", 1);
playLand(5, PhaseStep.PRECOMBAT_MAIN, playerA, "Academy Ruins");
castSpell(5, PhaseStep.PRECOMBAT_MAIN, playerA, "Thalia, Guardian of Thraben");
checkPlayableAbility("after III: can play Arcade Gannon", 5, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cast Arcade Gannon", true);
// turn 7
setChoice(playerA, "The Ninth Doctor");
setChoice(playerA, true); // choose to exile others
checkPlayableAbility("after IV: can not play Arcade Gannon", 7, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cast Arcade Gannon", false);
setStrictChooseMode(true);
setStopAt(7, PhaseStep.END_TURN);
execute();
assertExileCount(playerA, "Thalia, Guardian of Thraben", 1);
assertPermanentCount(playerA, "The Ninth Doctor", 1);
assertPermanentCount(playerA, "Academy Ruins", 1);
assertExileCount(playerA, "Arcade Gannon", 1);
assertLife(playerA, 20 - 13);
}
}