refactor and test 'Scry X' effects

Fixes #13667
This commit is contained in:
Susucre 2025-05-25 17:50:07 +02:00
parent 04b5660d17
commit 0b6a2b2546
21 changed files with 505 additions and 407 deletions

View file

@ -0,0 +1,66 @@
package org.mage.test.cards.single.bro;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class SpotterThopterTest extends CardTestPlayerBase {
/**
* {@link mage.cards.s.SpotterThopter Spotter Thopter} {8}
* Artifact Creature Thopter
* Prototype {3}{U} 2/3 (You may cast this spell with different mana cost, color, and size. It keeps its abilities and types.)
* Flying
* When this creature enters, scry X, where X is its power.
* 4/5
*/
private static final String thopter = "Spotter Thopter";
@Test
public void test_prototype_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.LIBRARY, playerA, "Crucible of Worlds");
addCard(Zone.LIBRARY, playerA, "Desecration Demon");
addCard(Zone.HAND, playerA, thopter, 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, thopter + " using Prototype");
// Oath of Jace's upkeep trigger triggers
addTarget(playerA, "Desecration Demon"); // put on bottom with scry 2
setStrictChooseMode(true);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
}
@Test
public void test_normal_scry4() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.LIBRARY, playerA, "Crucible of Worlds");
addCard(Zone.LIBRARY, playerA, "Desecration Demon");
addCard(Zone.HAND, playerA, thopter, 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, thopter);
// Oath of Jace's upkeep trigger triggers
addTarget(playerA, "Desecration Demon^Crucible of Worlds"); // put on bottom with scry 2
setChoice(playerA, "Crucible of Worlds"); // order for bottom
setChoice(playerA, "Baleful Strix"); // order for top
setStrictChooseMode(true);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
}
}

View file

@ -0,0 +1,49 @@
package org.mage.test.cards.single.c21;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class AlibouAncientWitnessTest extends CardTestPlayerBase {
/**
* {@link mage.cards.a.AlibouAncientWitness Alibou, Ancient Witness {3}{R}{W}
* Legendary Artifact Creature Golem
* Other artifact creatures you control have haste.
* Whenever one or more artifact creatures you control attack, Alibou deals X damage to any target and you scry X, where X is the number of tapped artifacts you control.
* 4/5
*/
private static final String alibou = "Alibou, Ancient Witness";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.BATTLEFIELD, playerA, alibou);
addCard(Zone.BATTLEFIELD, playerA, "Memnite");
addCard(Zone.BATTLEFIELD, playerA, "Ornithopter");
addCard(Zone.BATTLEFIELD, playerA, "Goblin Piker");
addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard");
attack(1, playerA, alibou, playerB);
attack(1, playerA, "Memnite", playerB);
attack(1, playerA, "Goblin Piker", playerB);
attack(1, playerA, "Elite Vanguard", playerB);
addTarget(playerA, playerB); // Alibou's trigger
addTarget(playerA, "Baleful Strix^Ancient Amphitheater"); // put on bottom with Scry 2
setChoice(playerA, "Ancient Amphitheater"); // order for bottom
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerB, 20 - 4 - 1 - 2 - 2 - 2);
}
}

View file

@ -0,0 +1,49 @@
package org.mage.test.cards.single.cmr;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class SianiEyeOfTheStormTest extends CardTestPlayerBase {
/**
* {@link mage.cards.s.SianiEyeOfTheStorm Siani, Eye of the Storm} {3}{U}
* Legendary Creature Djinn Monk
* Flying
* Whenever Siani attacks, scry X, where X is the number of attacking creatures with flying.
* Partner (You can have two commanders if both have partner.)
* 3/2
*/
private static final String siani = "Siani, Eye of the Storm";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.BATTLEFIELD, playerA, siani);
addCard(Zone.BATTLEFIELD, playerA, "Air Elemental");
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin");
addCard(Zone.BATTLEFIELD, playerA, "Goblin Piker");
addCard(Zone.BATTLEFIELD, playerA, "Elite Vanguard");
attack(1, playerA, siani, playerB);
attack(1, playerA, "Air Elemental", playerB);
attack(1, playerA, "Goblin Piker", playerB);
attack(1, playerA, "Elite Vanguard", playerB);
addTarget(playerA, "Baleful Strix^Ancient Amphitheater"); // put on bottom with Scry 2
setChoice(playerA, "Ancient Amphitheater"); // order for bottom
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertLife(playerB, 20 - 3 - 4 - 2 - 2);
}
}

View file

@ -0,0 +1,41 @@
package org.mage.test.cards.single.hou;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class TheScarabGodTest extends CardTestPlayerBase {
/**
* {@link mage.cards.t.TheScarabGod The Scarab God} {3}{U}{B}
* Legendary Creature God
* At the beginning of your upkeep, each opponent loses X life and you scry X, where X is the number of Zombies you control.
* {2}{U}{B}: Exile target creature card from a graveyard. Create a token thats a copy of it, except its a 4/4 black Zombie.
* When The Scarab God dies, return it to its owners hand at the beginning of the next end step.
* 5/5
*/
private static final String god = "The Scarab God";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.BATTLEFIELD, playerA, god, 1);
addCard(Zone.BATTLEFIELD, playerA, "Legions of Lim-Dul", 2);
// The Scarab God's upkeep trigger triggers
addTarget(playerA, "Ancient Amphitheater"); // put on bottom with scry 2
setStrictChooseMode(true);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertLife(playerB, 20 - 2);
}
}

View file

@ -0,0 +1,40 @@
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 GravenLoreTest extends CardTestPlayerBase {
/**
* {@link mage.cards.g.GravenLore Graven Lore} {3}{U}{U}
* Snow Instant
* Scry X, where X is the amount of {S} spent to cast this spell, then draw three cards. ({S} is mana from a snow source.)
*/
private static final String lore = "Graven Lore";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.HAND, playerA, lore, 1);
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
addCard(Zone.BATTLEFIELD, playerA, "Snow-Covered Island", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lore);
addTarget(playerA, "Baleful Strix^Ancient Amphitheater"); // put on bottom with Scry 2
setChoice(playerA, "Ancient Amphitheater"); // order for bottom
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertHandCount(playerA, "Mountain", 3);
}
}

View file

@ -0,0 +1,42 @@
package org.mage.test.cards.single.ogw;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author Susucr
*/
public class OathOfJaceTest extends CardTestPlayerBase {
/**
* {@link mage.cards.o.OathOfJace Oath of Jace} {2}{U}
* Legendary Enchantment
* When Oath of Jace enters, draw three cards, then discard two cards.
* At the beginning of your upkeep, scry X, where X is the number of planeswalkers you control.
*/
private static final String oath = "Oath of Jace";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.BATTLEFIELD, playerA, oath, 1);
addCard(Zone.BATTLEFIELD, playerA, "Legions of Lim-Dul", 2); // not a planeswalker
addCard(Zone.BATTLEFIELD, playerA, "Chandra Nalaar");
addCard(Zone.BATTLEFIELD, playerA, "Jace Beleren");
addCard(Zone.BATTLEFIELD, playerB, "Ajani, Caller of the Pride"); // not in your control
// Oath of Jace's upkeep trigger triggers
addTarget(playerA, "Ancient Amphitheater^Baleful Strix"); // put on bottom with scry 2
setChoice(playerA, "Baleful Strix"); // ordering the bottom
setStrictChooseMode(true);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
}
}

View file

@ -0,0 +1,49 @@
package org.mage.test.cards.single.sir;
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 BrainInAJarTest extends CardTestPlayerBase {
/**
* {@link mage.cards.b.BrainInAJar Brain in a Jar} {2}
* Artifact
* {1}, {T}: Put a charge counter on this artifact, then you may cast an instant or sorcery spell with mana value equal to the number of charge counters on this artifact from your hand without paying its mana cost.
* {3}, {T}, Remove X charge counters from this artifact: Scry X.
*/
private static final String brain = "Brain in a Jar";
@Test
public void test_scry2() {
skipInitShuffling();
addCard(Zone.LIBRARY, playerA, "Ancient Amphitheater");
addCard(Zone.LIBRARY, playerA, "Baleful Strix");
addCard(Zone.BATTLEFIELD, playerA, brain, 1);
addCard(Zone.BATTLEFIELD, playerA, "Dragon Appeasement"); // enchantement for skip draw
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}");
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}");
activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}, {T}");
activateAbility(7, PhaseStep.PRECOMBAT_MAIN, playerA, "{3}, {T}");
setChoice(playerA, "X=2"); // how many counters to remove
addTarget(playerA, "Baleful Strix^Ancient Amphitheater"); // put on bottom with Scry 2
setChoice(playerA, "Ancient Amphitheater"); // order for bottom
setStrictChooseMode(true);
setStopAt(7, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertCounterCount(playerA, brain, CounterType.CHARGE, 1);
}
}