add SigardasSplendorTest, other test improvements

This commit is contained in:
Steven Knipe 2025-06-01 13:27:33 -07:00 committed by Failure
parent bd996b2dac
commit f0ebf1c2ba
4 changed files with 145 additions and 40 deletions

View file

@ -15,48 +15,48 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
* @author alexander-novo, Alex-Vasile
*/
public class OminousRoostTest extends CardTestPlayerBase {
private static final String ominousRoost = "Ominous Roost";
private static final String ominousRoost = "Ominous Roost";
/**
* Reported bug: https://github.com/magefree/mage/issues/9078
* If Ominous Roost is in your library, it will trigger any time you cast a spell from your graveyard.
*/
@Test
public void doesNotTriggerFromOtherZones() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
/**
* Reported bug: https://github.com/magefree/mage/issues/9078
* If Ominous Roost is in your library, it will trigger any time you cast a spell from your graveyard.
*/
@Test
public void doesNotTriggerFromOtherZones() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
addCard(Zone.EXILED, playerA, ominousRoost);
addCard(Zone.LIBRARY, playerA, ominousRoost);
addCard(Zone.GRAVEYARD, playerA, ominousRoost);
addCard(Zone.HAND, playerA, ominousRoost);
addCard(Zone.EXILED, playerA, ominousRoost);
addCard(Zone.LIBRARY, playerA, ominousRoost);
addCard(Zone.GRAVEYARD, playerA, ominousRoost);
addCard(Zone.HAND, playerA, ominousRoost);
// Flashback {2}{R}
// Create a treasure token
addCard(Zone.GRAVEYARD, playerA, "Strike It Rich");
// Flashback {2}{R}
// Create a treasure token
addCard(Zone.GRAVEYARD, playerA, "Strike It Rich");
setStrictChooseMode(true);
setStrictChooseMode(true);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {2}{R}");
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback {2}{R}");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, ominousRoost, 0);
assertPermanentCount(playerA, "Bird Token", 0); // None of the cards are on the field, so it should not have triggered
}
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, ominousRoost, 0);
assertPermanentCount(playerA, "Bird Token", 0); // None of the cards are on the field, so it should not have triggered
}
/**
* Test that it triggers on ETB
*/
@Test
public void triggersOnOwnETB() {
addCard(Zone.HAND, playerA, ominousRoost);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
/**
* Test that it triggers on ETB
*/
@Test
public void triggersOnOwnETB() {
addCard(Zone.HAND, playerA, ominousRoost);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ominousRoost);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ominousRoost);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, ominousRoost, 1);
assertPermanentCount(playerA, "Bird Token", 1);
}
setStopAt(1, PhaseStep.END_TURN);
execute();
assertPermanentCount(playerA, ominousRoost, 1);
assertPermanentCount(playerA, "Bird Token", 1);
}
}

View file

@ -0,0 +1,76 @@
package org.mage.test.cards.single.mid;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* {@link mage.cards.s.SigardasSplendor Sigarda's Splendor}
* {2}{W}{W}
* Enchantment
* As Sigardas Splendor enters the battlefield, note your life total.
* At the beginning of your upkeep, draw a card if your life total is greater than or equal
* to the last noted life total for Sigardas Splendor. Then note your life total.
* Whenever you cast a white spell, you gain 1 life.
*
* @author notgreat
*/
public class SigardasSplendorTest extends CardTestPlayerBase {
private static final String sigardasSplendor = "Sigarda's Splendor";
//Original bug: [BUG] Sigarda's Splendor always draws you a card the turn after it came into play #9872
//Test added while changing abilities' zcc while entering the battlefield
@Test
public void sigardasSplendorTestBasic() {
addCard(Zone.HAND, playerA, sigardasSplendor, 2);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
setStrictChooseMode(true);
checkHandCount("Initial hand size", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 2);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, sigardasSplendor);
checkHandCount("Initial hand size (2)", 1, PhaseStep.END_TURN, playerA, 1); //-1 sigarda
checkLife("Initial life", 1, PhaseStep.END_TURN, playerA, 20);
checkHandCount("Did not draw on 1st upkeep", 3, PhaseStep.PRECOMBAT_MAIN, playerA, 3); //-1 sigarda, +1 natural draw, +1 trigger
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, sigardasSplendor);
checkHandCount("Did not draw on 1st upkeep (2)", 3, PhaseStep.END_TURN, playerA, 2); //-2 sigarda, +1 natural draw, +1 trigger
checkLife("Initial life", 3, PhaseStep.END_TURN, playerA, 21);
setChoice(playerA, "At the beginning of your upkeep"); //stack triggers
setStopAt(5, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, sigardasSplendor, 2);
assertHandCount(playerA, 5); //-2 sigardas, +2 natural draw, +3 trigger
}
@Test
public void sigardasSplendorTestDamaged() {
addCard(Zone.HAND, playerA, sigardasSplendor, 2);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.HAND, playerB, "Scorching Spear", 2);
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
setStrictChooseMode(true);
checkHandCount("Initial hand size", 1, PhaseStep.PRECOMBAT_MAIN, playerA, 2);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, sigardasSplendor);
checkHandCount("Initial hand size (2)", 1, PhaseStep.END_TURN, playerA, 1); //-1 sigarda
checkLife("Initial life", 1, PhaseStep.END_TURN, playerA, 20);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Scorching Spear", playerA);
checkLife("Post-spear 1", 2, PhaseStep.END_TURN, playerA, 19);
checkHandCount("Did not draw on 1st upkeep", 3, PhaseStep.PRECOMBAT_MAIN, playerA, 2); //-1 sigarda, +1 natural draw
castSpell(3, PhaseStep.POSTCOMBAT_MAIN, playerA, sigardasSplendor);
checkHandCount("Did not draw on 1st upkeep (2)", 3, PhaseStep.END_TURN, playerA, 1); //-2 sigarda, +1 natural draw
checkLife("Post-splendors", 3, PhaseStep.END_TURN, playerA, 20);
castSpell(4, PhaseStep.PRECOMBAT_MAIN, playerB, "Scorching Spear", playerA);
checkLife("Post-spear 2", 4, PhaseStep.END_TURN, playerA, 19);
setChoice(playerA, "At the beginning of your upkeep"); //stack triggers
setStopAt(5, PhaseStep.PRECOMBAT_MAIN);
execute();
assertPermanentCount(playerA, sigardasSplendor, 2);
assertHandCount(playerA, 3); //-2 sigardas, +2 natural draw, +1 trigger
}
}

View file

@ -97,10 +97,11 @@ public class Vault13DwellersJourneyTest extends CardTestPlayerBase {
addTarget(playerA, "Memnite");
addTarget(playerA, "Ornithopter");
// turn 2
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Sacrifice");
addTarget(playerB, vault);
//Turn 3
// turn 3
addTarget(playerA, "Squire");
addTarget(playerA, "Watchwolf");
@ -113,10 +114,10 @@ public class Vault13DwellersJourneyTest extends CardTestPlayerBase {
addTarget(playerA, "Mountain"); // for Scry 2
// turn 7
checkExileCount("before III: Memnite exiled", 5, PhaseStep.UPKEEP, playerB, "Memnite", 1);
checkExileCount("before III: Ornithopter exiled", 5, PhaseStep.UPKEEP, playerB, "Ornithopter", 1);
checkExileCount("before III: Squire exiled", 5, PhaseStep.UPKEEP, playerB, "Squire", 1);
checkExileCount("before III: Watchwolf exiled", 5, PhaseStep.UPKEEP, playerB, "Watchwolf", 1);
checkExileCount("before III: Memnite exiled", 7, PhaseStep.UPKEEP, playerB, "Memnite", 1);
checkExileCount("before III: Ornithopter exiled", 7, PhaseStep.UPKEEP, playerB, "Ornithopter", 1);
checkExileCount("before III: Squire exiled", 7, PhaseStep.UPKEEP, playerB, "Squire", 1);
checkExileCount("before III: Watchwolf exiled", 7, PhaseStep.UPKEEP, playerB, "Watchwolf", 1);
setChoice(playerA, "Memnite^Ornithopter");
setStrictChooseMode(true);

View file

@ -54,4 +54,32 @@ public class ThePrincessTakesFlightTest extends CardTestPlayerBase {
assertExileCount(playerB, "Memnite", 0);
assertPermanentCount(playerB, "Memnite", 1);
}
@Ignore // TODO: goal of #11619 is to fix this nicely
@Test
public void testFlicker() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
addCard(Zone.HAND, playerA, flight);
addCard(Zone.HAND, playerA, "Flicker of Fate");
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears");
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, flight);
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 1); //Saga resolves, Bear exile on stack
addTarget(playerA, "Grizzly Bears");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flicker of Fate", flight);
addTarget(playerA, "Memnite");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, 2); //Flicker resolves, Memnite exile resolves
checkExileCount("Memnite exiled first", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Memnite", 1);
checkExileCount("Bear not yet exiled", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", 0);
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); //Bear exile resolves
checkExileCount("Bear exiled", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Grizzly Bears", 1);
setStrictChooseMode(true);
setStopAt(5, PhaseStep.END_TURN);
execute();
assertExileCount(playerA, "Grizzly Bears", 1); //Bear stays exiled
assertPermanentCount(playerA, "Memnite", 1);
assertGraveyardCount(playerA, flight, 1);
}
}