mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
various files converted from CRLF to LF
This commit is contained in:
parent
ea561892f5
commit
3a3e3fda48
36 changed files with 8696 additions and 8696 deletions
|
|
@ -1,110 +1,110 @@
|
|||
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CumulativeUpkeepTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void basicTest() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
// Flying; fear
|
||||
// Cumulative upkeep {B}
|
||||
addCard(Zone.HAND, playerA, "Phobian Phantasm"); // Creature {1}{B}{B} 3/3
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm");
|
||||
|
||||
// Phobian Phantasm - CumulativeUpkeepAbility: Cumulative upkeep {B}
|
||||
setChoice(playerA, true); // Pay {B}?
|
||||
attack(3, playerA, "Phobian Phantasm");
|
||||
checkPermanentCounters("Age counters", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm", CounterType.AGE, 1);
|
||||
|
||||
setChoice(playerA, true); // Pay {B}{B}?
|
||||
attack(5, playerA, "Phobian Phantasm");
|
||||
checkPermanentCounters("Age counters", 5, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm", CounterType.AGE, 2);
|
||||
|
||||
setChoice(playerA, false); // Pay {B}{B}{B}?
|
||||
|
||||
setStopAt(7, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Phobian Phantasm", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
I changed control of a Illusions of Grandeur to an AI after cumulative upkeep had triggered but before it resolved.
|
||||
I chose not to pay the upkeep cost and then either the AI sacrificed it or I sacrificed it, neither of which should happen.
|
||||
I can't sacrifice it because it's not under my control. The AI can't sacrifice it because they are not instructed to do so.
|
||||
|
||||
Here is the reminder text for cumulative upkeep:
|
||||
At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.
|
||||
*/
|
||||
@Test
|
||||
public void controlChangeTest() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Whenever Kor Celebrant or another creature enters the battlefield under your control, you gain 1 life.
|
||||
addCard(Zone.HAND, playerB, "Kor Celebrant", 1); // Creature {2}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
|
||||
// Cumulative upkeep {2}
|
||||
// When Illusions of Grandeur enters the battlefield, you gain 20 life.
|
||||
// When Illusions of Grandeur leaves the battlefield, you lose 20 life.
|
||||
addCard(Zone.HAND, playerA, "Illusions of Grandeur"); // Enchantment {3}{U}
|
||||
|
||||
// At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost.
|
||||
addCard(Zone.HAND, playerA, "Puca's Mischief"); // Enchantment {3}{U}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Illusions of Grandeur");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Kor Celebrant");
|
||||
|
||||
// Illusions of Grandeur - CumulativeUpkeepAbility: Cumulative upkeep {2}
|
||||
setChoice(playerA, true); // Pay {2}?
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Puca's Mischief");
|
||||
|
||||
setChoice(playerA, "Cumulative upkeep"); // Triggered list (total 2) which trigger goes first on the stack
|
||||
addTarget(playerA, "Illusions of Grandeur"); // Own target permanent of Puca's Mischief
|
||||
addTarget(playerA, "Kor Celebrant"); // Opponent's target permanent of Puca's Mischief
|
||||
|
||||
setChoice(playerA, true); // At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost.
|
||||
setChoice(playerA, false); // Pay {2}{2}?
|
||||
|
||||
checkPermanentCounters("Age counters", 5, PhaseStep.PRECOMBAT_MAIN, playerB, "Illusions of Grandeur", CounterType.AGE, 2);
|
||||
|
||||
setStopAt(5, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 40);
|
||||
assertLife(playerB, 21);
|
||||
|
||||
assertPermanentCount(playerA, "Kor Celebrant", 1);
|
||||
assertPermanentCount(playerB, "Illusions of Grandeur", 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CumulativeUpkeepTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void basicTest() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
// Flying; fear
|
||||
// Cumulative upkeep {B}
|
||||
addCard(Zone.HAND, playerA, "Phobian Phantasm"); // Creature {1}{B}{B} 3/3
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm");
|
||||
|
||||
// Phobian Phantasm - CumulativeUpkeepAbility: Cumulative upkeep {B}
|
||||
setChoice(playerA, true); // Pay {B}?
|
||||
attack(3, playerA, "Phobian Phantasm");
|
||||
checkPermanentCounters("Age counters", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm", CounterType.AGE, 1);
|
||||
|
||||
setChoice(playerA, true); // Pay {B}{B}?
|
||||
attack(5, playerA, "Phobian Phantasm");
|
||||
checkPermanentCounters("Age counters", 5, PhaseStep.PRECOMBAT_MAIN, playerA, "Phobian Phantasm", CounterType.AGE, 2);
|
||||
|
||||
setChoice(playerA, false); // Pay {B}{B}{B}?
|
||||
|
||||
setStopAt(7, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Phobian Phantasm", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 14);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
I changed control of a Illusions of Grandeur to an AI after cumulative upkeep had triggered but before it resolved.
|
||||
I chose not to pay the upkeep cost and then either the AI sacrificed it or I sacrificed it, neither of which should happen.
|
||||
I can't sacrifice it because it's not under my control. The AI can't sacrifice it because they are not instructed to do so.
|
||||
|
||||
Here is the reminder text for cumulative upkeep:
|
||||
At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.
|
||||
*/
|
||||
@Test
|
||||
public void controlChangeTest() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Whenever Kor Celebrant or another creature enters the battlefield under your control, you gain 1 life.
|
||||
addCard(Zone.HAND, playerB, "Kor Celebrant", 1); // Creature {2}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 6);
|
||||
// Cumulative upkeep {2}
|
||||
// When Illusions of Grandeur enters the battlefield, you gain 20 life.
|
||||
// When Illusions of Grandeur leaves the battlefield, you lose 20 life.
|
||||
addCard(Zone.HAND, playerA, "Illusions of Grandeur"); // Enchantment {3}{U}
|
||||
|
||||
// At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost.
|
||||
addCard(Zone.HAND, playerA, "Puca's Mischief"); // Enchantment {3}{U}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Illusions of Grandeur");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Kor Celebrant");
|
||||
|
||||
// Illusions of Grandeur - CumulativeUpkeepAbility: Cumulative upkeep {2}
|
||||
setChoice(playerA, true); // Pay {2}?
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Puca's Mischief");
|
||||
|
||||
setChoice(playerA, "Cumulative upkeep"); // Triggered list (total 2) which trigger goes first on the stack
|
||||
addTarget(playerA, "Illusions of Grandeur"); // Own target permanent of Puca's Mischief
|
||||
addTarget(playerA, "Kor Celebrant"); // Opponent's target permanent of Puca's Mischief
|
||||
|
||||
setChoice(playerA, true); // At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost.
|
||||
setChoice(playerA, false); // Pay {2}{2}?
|
||||
|
||||
checkPermanentCounters("Age counters", 5, PhaseStep.PRECOMBAT_MAIN, playerB, "Illusions of Grandeur", CounterType.AGE, 2);
|
||||
|
||||
setStopAt(5, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 40);
|
||||
assertLife(playerB, 21);
|
||||
|
||||
assertPermanentCount(playerA, "Kor Celebrant", 1);
|
||||
assertPermanentCount(playerB, "Illusions of Grandeur", 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,179 +1,179 @@
|
|||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2, JayDi85
|
||||
*/
|
||||
|
||||
public class EntwineTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_CastWithoutEntwine() {
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, false); // not use Entwine
|
||||
setModeChoice(playerA, "1"); // target creature
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_Normal() {
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3 + 2);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_CostReduction() {
|
||||
addCustomEffect_SpellCostModification(playerA, -4);
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); // -4 as cost reduction
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_CostIncreasing() {
|
||||
addCustomEffect_SpellCostModification(playerA, 5);
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3 + 2 + 5);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3 + 2 + 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_FreeFromHand() {
|
||||
// You may cast nonland cards from your hand without paying their mana costs.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Omniscience");
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); // only Entwine pay need
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // cast for free
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Plains", true, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_ToothAndNail() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.LIBRARY, playerA, "Pillarfield Ox", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 9);
|
||||
// Choose one -
|
||||
// Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library;
|
||||
// or put up to two creature cards from your hand onto the battlefield.
|
||||
// Entwine {2}
|
||||
addCard(Zone.HAND, playerA, "Tooth and Nail"); // Sorcery {5}{G}{G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tooth and Nail");
|
||||
setChoice(playerA, true); // Message: Pay Entwine {2} ?
|
||||
addTarget(playerA, "Silvercoat Lion^Pillarfield Ox");
|
||||
setChoice(playerA, "Silvercoat Lion^Pillarfield Ox");
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Pillarfield Ox", 1);
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.abilities.keywords;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2, JayDi85
|
||||
*/
|
||||
|
||||
public class EntwineTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_CastWithoutEntwine() {
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, false); // not use Entwine
|
||||
setModeChoice(playerA, "1"); // target creature
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_Normal() {
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3 + 2);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3 + 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_CostReduction() {
|
||||
addCustomEffect_SpellCostModification(playerA, -4);
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); // -4 as cost reduction
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_CostIncreasing() {
|
||||
addCustomEffect_SpellCostModification(playerA, 5);
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3 + 2 + 5);
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Mountain", true, 3 + 2 + 5);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastEntwine_FreeFromHand() {
|
||||
// You may cast nonland cards from your hand without paying their mana costs.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Omniscience");
|
||||
|
||||
// Choose one —
|
||||
//• Barbed Lightning deals 3 damage to target creature.
|
||||
//• Barbed Lightning deals 3 damage to target player or planeswalker.
|
||||
// Entwine {2} (Choose both if you pay the entwine cost.)
|
||||
addCard(Zone.HAND, playerA, "Barbed Lightning", 1); // {2}{R}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2); // only Entwine pay need
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1); // 2/2
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Barbed Lightning");
|
||||
setChoice(playerA, true); // cast for free
|
||||
setChoice(playerA, true); // use Entwine
|
||||
addTarget(playerA, "Balduvian Bears");
|
||||
addTarget(playerA, playerA);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
assertPermanentCount(playerA, "Balduvian Bears", 0);
|
||||
assertTappedCount("Plains", true, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_ToothAndNail() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.LIBRARY, playerA, "Pillarfield Ox", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 9);
|
||||
// Choose one -
|
||||
// Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library;
|
||||
// or put up to two creature cards from your hand onto the battlefield.
|
||||
// Entwine {2}
|
||||
addCard(Zone.HAND, playerA, "Tooth and Nail"); // Sorcery {5}{G}{G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tooth and Nail");
|
||||
setChoice(playerA, true); // Message: Pay Entwine {2} ?
|
||||
addTarget(playerA, "Silvercoat Lion^Pillarfield Ox");
|
||||
setChoice(playerA, "Silvercoat Lion^Pillarfield Ox");
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Pillarfield Ox", 1);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,39 +1,39 @@
|
|||
package org.mage.test.cards.cost.modification;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class FerventChampionTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testFerventChampion() {
|
||||
setStrictChooseMode(true);
|
||||
// First strike, Haste
|
||||
// Whenever Fervent Champion attacks, another target attacking Knight you control gets +1/+0 until end of turn.
|
||||
// Equip abilities you activate that target Fervent Champion cost {3} less to activate.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Fervent Champion");
|
||||
|
||||
// Equipped creature gets +2/+2 and has protection from red and from blue.
|
||||
// Whenever equipped creature deals combat damage to a player, Sword of Fire
|
||||
// and Ice deals 2 damage to any target and you draw a card.
|
||||
// Equip {2}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Sword of Fire and Ice", 1);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip");
|
||||
addTarget(playerA, "Fervent Champion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, "Fervent Champion", 3,3);
|
||||
}
|
||||
package org.mage.test.cards.cost.modification;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class FerventChampionTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testFerventChampion() {
|
||||
setStrictChooseMode(true);
|
||||
// First strike, Haste
|
||||
// Whenever Fervent Champion attacks, another target attacking Knight you control gets +1/+0 until end of turn.
|
||||
// Equip abilities you activate that target Fervent Champion cost {3} less to activate.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Fervent Champion");
|
||||
|
||||
// Equipped creature gets +2/+2 and has protection from red and from blue.
|
||||
// Whenever equipped creature deals combat damage to a player, Sword of Fire
|
||||
// and Ice deals 2 damage to any target and you draw a card.
|
||||
// Equip {2}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Sword of Fire and Ice", 1);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip");
|
||||
addTarget(playerA, "Fervent Champion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, "Fervent Champion", 3,3);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +1,56 @@
|
|||
package org.mage.test.cards.facedown;
|
||||
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PrimordialMistTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* I have Brine Elemental played face down as a morph, an artifact which has
|
||||
* been manifested and Kadena which has been turned face by Ixidron. I can't
|
||||
* seem to activate Primordial Mist's second ability for any of these kinds
|
||||
* of face down creatures:
|
||||
*/
|
||||
@Test
|
||||
public void test_ExileAndCastMorphFaceDownCard() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// At the beginning of your end step, you may manifest the top card of your library.
|
||||
// Exile a face-down permanent you control face-up: You may play that card this turn
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Primordial Mist");
|
||||
// Morph {5}{U}{U}
|
||||
// When Brine Elemental is turned face up, each opponent skips their next untap step.
|
||||
addCard(Zone.HAND, playerA, "Brine Elemental"); // Creature {5}{U}{U} (5/4)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 9);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brine Elemental");
|
||||
setChoice(playerA, true); // cast it face down as 2/2 creature
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exile a face-down permanent you control");
|
||||
setChoice(playerA, EmptyNames.FACE_DOWN_CREATURE.toString());
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Brine Elemental");
|
||||
setChoice(playerA, false); // cast it face down as 2/2 creature
|
||||
|
||||
setChoice(playerA, true);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertExileCount(playerA, 0);
|
||||
|
||||
assertPowerToughness(playerA, "Brine Elemental", 5, 4);
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.facedown;
|
||||
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PrimordialMistTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* I have Brine Elemental played face down as a morph, an artifact which has
|
||||
* been manifested and Kadena which has been turned face by Ixidron. I can't
|
||||
* seem to activate Primordial Mist's second ability for any of these kinds
|
||||
* of face down creatures:
|
||||
*/
|
||||
@Test
|
||||
public void test_ExileAndCastMorphFaceDownCard() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// At the beginning of your end step, you may manifest the top card of your library.
|
||||
// Exile a face-down permanent you control face-up: You may play that card this turn
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Primordial Mist");
|
||||
// Morph {5}{U}{U}
|
||||
// When Brine Elemental is turned face up, each opponent skips their next untap step.
|
||||
addCard(Zone.HAND, playerA, "Brine Elemental"); // Creature {5}{U}{U} (5/4)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 9);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Brine Elemental");
|
||||
setChoice(playerA, true); // cast it face down as 2/2 creature
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Exile a face-down permanent you control");
|
||||
setChoice(playerA, EmptyNames.FACE_DOWN_CREATURE.toString());
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Brine Elemental");
|
||||
setChoice(playerA, false); // cast it face down as 2/2 creature
|
||||
|
||||
setChoice(playerA, true);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertExileCount(playerA, 0);
|
||||
|
||||
assertPowerToughness(playerA, "Brine Elemental", 5, 4);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,62 +1,62 @@
|
|||
|
||||
package org.mage.test.cards.facedown;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public class TriggerTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Midnight Reaper triggers when dies face down #7063
|
||||
* Ixidron has turned Midnight Reaper and Balduvian Bears face down:
|
||||
*
|
||||
*/
|
||||
|
||||
// test that cards imprinted using Summoner's Egg are face down
|
||||
@Test
|
||||
public void testReaperDoesNotTriggerDiesTriggerFaceDown() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||
// As Ixidron enters the battlefield, turn all other nontoken creatures face down.
|
||||
// Ixidron's power and toughness are each equal to the number of face-down creatures on the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Ixidron"); // Creature {3}{U}{U} (*/*)
|
||||
// Whenever a nontoken creature you control dies, Midnight Reaper deals 1 damage to you and you draw a card.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Midnight Reaper"); // Creature {2}{B}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt"); // Instant 3 damage
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ixidron");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", EmptyNames.FACE_DOWN_CREATURE.toString());
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
||||
assertGraveyardCount(playerA, "Midnight Reaper", 1);
|
||||
assertGraveyardCount(playerA, "Ixidron", 1);
|
||||
|
||||
assertHandCount(playerA, 0);
|
||||
assertLife(playerA, 20);
|
||||
|
||||
}
|
||||
|
||||
package org.mage.test.cards.facedown;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
|
||||
|
||||
public class TriggerTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Midnight Reaper triggers when dies face down #7063
|
||||
* Ixidron has turned Midnight Reaper and Balduvian Bears face down:
|
||||
*
|
||||
*/
|
||||
|
||||
// test that cards imprinted using Summoner's Egg are face down
|
||||
@Test
|
||||
public void testReaperDoesNotTriggerDiesTriggerFaceDown() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 5);
|
||||
// As Ixidron enters the battlefield, turn all other nontoken creatures face down.
|
||||
// Ixidron's power and toughness are each equal to the number of face-down creatures on the battlefield.
|
||||
addCard(Zone.HAND, playerA, "Ixidron"); // Creature {3}{U}{U} (*/*)
|
||||
// Whenever a nontoken creature you control dies, Midnight Reaper deals 1 damage to you and you draw a card.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Midnight Reaper"); // Creature {2}{B}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt"); // Instant 3 damage
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ixidron");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", EmptyNames.FACE_DOWN_CREATURE.toString());
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
||||
assertGraveyardCount(playerA, "Midnight Reaper", 1);
|
||||
assertGraveyardCount(playerA, "Ixidron", 1);
|
||||
|
||||
assertHandCount(playerA, 0);
|
||||
assertLife(playerA, 20);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,45 +1,45 @@
|
|||
package org.mage.test.cards.mana;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MultipleTimesUsableActivatedManaAbilitiesTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Seton, Krosan Protector - only seems to get counted as if it were one
|
||||
* mana for determining if a spell can be cast, regardless of how many
|
||||
* druids you have in playF
|
||||
*/
|
||||
@Test
|
||||
public void testCanBeCastWithSetonKrosanProtector() {
|
||||
// Tap an untapped Druid you control: Add {G}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Seton, Krosan Protector", 1); // Creature {G}{G}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Citanul Druid", 3);
|
||||
|
||||
addCard(Zone.HAND, playerA, "Leatherback Baloth", 1); // Creature 4/5
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Leatherback Baloth");
|
||||
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertTappedCount("Citanul Druid", true, 3);
|
||||
assertPermanentCount(playerA, "Leatherback Baloth", 1);
|
||||
}
|
||||
|
||||
}
|
||||
package org.mage.test.cards.mana;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MultipleTimesUsableActivatedManaAbilitiesTest extends CardTestPlayerBase {
|
||||
|
||||
/**
|
||||
* Seton, Krosan Protector - only seems to get counted as if it were one
|
||||
* mana for determining if a spell can be cast, regardless of how many
|
||||
* druids you have in playF
|
||||
*/
|
||||
@Test
|
||||
public void testCanBeCastWithSetonKrosanProtector() {
|
||||
// Tap an untapped Druid you control: Add {G}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Seton, Krosan Protector", 1); // Creature {G}{G}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Citanul Druid", 3);
|
||||
|
||||
addCard(Zone.HAND, playerA, "Leatherback Baloth", 1); // Creature 4/5
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Leatherback Baloth");
|
||||
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
setChoice(playerA, "Citanul Druid");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
|
||||
setStrictChooseMode(true);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertTappedCount("Citanul Druid", true, 3);
|
||||
assertPermanentCount(playerA, "Leatherback Baloth", 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,112 +1,112 @@
|
|||
package org.mage.test.cards.mana.conditional;
|
||||
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CrypticTrilobiteTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testAvailableManaCalculation(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}[{CrypticTrilobiteManaCondition}]", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUse(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
// Flying
|
||||
// {2}: Deathknell Kami gets +1/+1 until end of turn. Sacrifice it at the beginning of the next end step.
|
||||
// Soulshift 1 (When this creature dies, you may return target Spirit card with converted mana cost 1 or less from your graveyard to your hand.)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Deathknell Kami"); // Creature (0/1)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
assertCounterCount(playerA, "Cryptic Trilobite", CounterType.P1P1, 3);
|
||||
|
||||
assertPowerToughness(playerA, "Deathknell Kami", 2, 3);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}{C}{C}{C}{C}[{CrypticTrilobiteManaCondition}]", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCantUse(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
|
||||
// {4}{W}: Return another target creature you control to its owner's hand.
|
||||
addCard(Zone.HAND, playerA, "Aegis Automaton"); // Creature {2} (0/2)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
checkPlayableAbility("can't play", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Aegis Automaton", false);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
assertCounterCount(playerA, "Cryptic Trilobite", CounterType.P1P1, 5);
|
||||
}
|
||||
|
||||
|
||||
package org.mage.test.cards.mana.conditional;
|
||||
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CrypticTrilobiteTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testAvailableManaCalculation(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}[{CrypticTrilobiteManaCondition}]", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUse(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
// Flying
|
||||
// {2}: Deathknell Kami gets +1/+1 until end of turn. Sacrifice it at the beginning of the next end step.
|
||||
// Soulshift 1 (When this creature dies, you may return target Spirit card with converted mana cost 1 or less from your graveyard to your hand.)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Deathknell Kami"); // Creature (0/1)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
assertCounterCount(playerA, "Cryptic Trilobite", CounterType.P1P1, 3);
|
||||
|
||||
assertPowerToughness(playerA, "Deathknell Kami", 2, 3);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}{C}{C}{C}{C}[{CrypticTrilobiteManaCondition}]", manaOptions);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCantUse(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
|
||||
// Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
|
||||
// {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
|
||||
addCard(Zone.HAND, playerA, "Cryptic Trilobite"); // Creature {X}{X}
|
||||
|
||||
// {4}{W}: Return another target creature you control to its owner's hand.
|
||||
addCard(Zone.HAND, playerA, "Aegis Automaton"); // Creature {2} (0/2)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
|
||||
setChoice(playerA, "X=5");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
|
||||
|
||||
checkPlayableAbility("can't play", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Aegis Automaton", false);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cryptic Trilobite", 1);
|
||||
assertCounterCount(playerA, "Cryptic Trilobite", CounterType.P1P1, 5);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,44 +1,44 @@
|
|||
|
||||
package org.mage.test.cards.mana.conditional;
|
||||
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TitansNestTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testTitansNest(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// At the beginning of your upkeep, look at the top card of your library. You may put that card into your graveyard.
|
||||
// Exile a card from your graveyard: Add {C}. Spend this mana only to cast a colored spell without {X} in its mana cost.
|
||||
addCard(Zone.HAND, playerA, "Titans' Nest"); // Enchantment {1}{B}{G}{U}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, "Grizzly Bears", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Titans' Nest");
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Titans' Nest", 1);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}[{TitansNestManaCondition}]", manaOptions);
|
||||
}
|
||||
|
||||
package org.mage.test.cards.mana.conditional;
|
||||
|
||||
import mage.abilities.mana.ManaOptions;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TitansNestTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testTitansNest(){
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// At the beginning of your upkeep, look at the top card of your library. You may put that card into your graveyard.
|
||||
// Exile a card from your graveyard: Add {C}. Spend this mana only to cast a colored spell without {X} in its mana cost.
|
||||
addCard(Zone.HAND, playerA, "Titans' Nest"); // Enchantment {1}{B}{G}{U}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
|
||||
|
||||
addCard(Zone.GRAVEYARD, playerA, "Grizzly Bears", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Titans' Nest");
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Titans' Nest", 1);
|
||||
|
||||
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
|
||||
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
|
||||
assertManaOptions("{C}{C}[{TitansNestManaCondition}]", manaOptions);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,145 +1,145 @@
|
|||
package org.mage.test.cards.prevention;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PreventAllDamageTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_SafePassage() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
// Prevent all damage that would be dealt to you and creatures you control this turn.
|
||||
addCard(Zone.HAND, playerA, "Safe Passage"); // Instant {2}{W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 2); // (2/4)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instnat {R}
|
||||
|
||||
castSpell(2, PhaseStep.UPKEEP, playerA, "Safe Passage");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
|
||||
|
||||
attack(2, playerB, "Pillarfield Ox");
|
||||
attack(2, playerB, "Pillarfield Ox");
|
||||
|
||||
block(2, playerA, "Silvercoat Lion", "Pillarfield Ox");
|
||||
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Safe Passage", 1);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_EtherealHaze() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||
// Prevent all damage that would be dealt by creatures this turn.
|
||||
addCard(Zone.HAND, playerA, "Ethereal Haze"); // Instant {W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // (2/4)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1); // Instant {R}
|
||||
|
||||
castSpell(2, PhaseStep.UPKEEP, playerA, "Ethereal Haze");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
|
||||
block(2, playerA, "Silvercoat Lion", "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Ethereal Haze", 1);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 2);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_EnergyStorm() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Cumulative upkeep {1}
|
||||
// Prevent all damage that would be dealt by instant and sorcery spells.
|
||||
// Creatures with flying don't untap during their controllers' untap steps.
|
||||
addCard(Zone.HAND, playerA, "Energy Storm"); // ENCHANTMENT {1}{W}
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 4);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instant {R}
|
||||
// Fire Ambush deals 3 damage to any target.
|
||||
addCard(Zone.HAND, playerB, "Fire Ambush", 2); // Sorcery {1}{R}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Energy Storm");
|
||||
|
||||
attack(1, playerA, "Abbey Griffin");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Abbey Griffin");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", playerA);
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", "Abbey Griffin");
|
||||
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerA, false); // Pay {1}? Energy Storm - CumulativeUpkeepAbility: Cumulative upkeep {1}
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Energy Storm", 1);
|
||||
assertPermanentCount(playerA, "Abbey Griffin", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 2);
|
||||
assertGraveyardCount(playerB, "Fire Ambush", 2);
|
||||
|
||||
assertLife(playerA, 18);
|
||||
assertLife(playerB, 18);
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.prevention;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PreventAllDamageTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_SafePassage() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
// Prevent all damage that would be dealt to you and creatures you control this turn.
|
||||
addCard(Zone.HAND, playerA, "Safe Passage"); // Instant {2}{W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 2); // (2/4)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instnat {R}
|
||||
|
||||
castSpell(2, PhaseStep.UPKEEP, playerA, "Safe Passage");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
|
||||
|
||||
attack(2, playerB, "Pillarfield Ox");
|
||||
attack(2, playerB, "Pillarfield Ox");
|
||||
|
||||
block(2, playerA, "Silvercoat Lion", "Pillarfield Ox");
|
||||
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Safe Passage", 1);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_EtherealHaze() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||
// Prevent all damage that would be dealt by creatures this turn.
|
||||
addCard(Zone.HAND, playerA, "Ethereal Haze"); // Instant {W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // (2/4)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 2);
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1); // Instant {R}
|
||||
|
||||
castSpell(2, PhaseStep.UPKEEP, playerA, "Ethereal Haze");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
|
||||
block(2, playerA, "Silvercoat Lion", "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Ethereal Haze", 1);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 2);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
|
||||
assertLife(playerA, 17);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_EnergyStorm() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Cumulative upkeep {1}
|
||||
// Prevent all damage that would be dealt by instant and sorcery spells.
|
||||
// Creatures with flying don't untap during their controllers' untap steps.
|
||||
addCard(Zone.HAND, playerA, "Energy Storm"); // ENCHANTMENT {1}{W}
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); // (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 4);
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 2); // Instant {R}
|
||||
// Fire Ambush deals 3 damage to any target.
|
||||
addCard(Zone.HAND, playerB, "Fire Ambush", 2); // Sorcery {1}{R}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Energy Storm");
|
||||
|
||||
attack(1, playerA, "Abbey Griffin");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Abbey Griffin");
|
||||
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", playerA);
|
||||
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Fire Ambush", "Abbey Griffin");
|
||||
|
||||
attack(2, playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerA, false); // Pay {1}? Energy Storm - CumulativeUpkeepAbility: Cumulative upkeep {1}
|
||||
|
||||
setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Energy Storm", 1);
|
||||
assertPermanentCount(playerA, "Abbey Griffin", 1);
|
||||
|
||||
assertPermanentCount(playerB, "Silvercoat Lion", 1);
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 2);
|
||||
assertGraveyardCount(playerB, "Fire Ambush", 2);
|
||||
|
||||
assertLife(playerA, 18);
|
||||
assertLife(playerB, 18);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,48 @@
|
|||
package org.mage.test.cards.protection;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class EightAndAHalfTailsTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testProtectingPlaneswalker() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
|
||||
// Activated abilities of artifacts your opponents control can't be activated.
|
||||
// +1: Until your next turn, up to one target noncreature artifact becomes an artifact creature with power and toughness equal to its converted mana cost.
|
||||
// -2: You may choose an artifact card you own from outside the game or in exile, reveal that card, and put it into your hand.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Karn, the Great Creator"); // Planeswalker (5)
|
||||
|
||||
// {1}{W}: Target permanent you control gains protection from white until end of turn.
|
||||
// {1}: Target spell or permanent becomes white until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Eight-and-a-Half-Tails"); // Creature
|
||||
|
||||
// Flying, double strike
|
||||
// Whenever a creature you control deals combat damage to a player, you and that player each gain that much life.
|
||||
// At the beginning of your end step, if you have at least 15 life more than your starting life total, each player Angel of Destiny attacked this turn loses the game.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Angel of Destiny"); // Creature
|
||||
|
||||
attack(2, playerB, "Angel of Destiny", "Karn, the Great Creator");
|
||||
activateAbility(2, PhaseStep.DECLARE_ATTACKERS, playerA, "{1}{W}: Target permanent you control gains protection from white until end of turn.");
|
||||
addTarget(playerA, "Karn, the Great Creator");
|
||||
|
||||
setStopAt(2, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Karn, the Great Creator", 1);
|
||||
assertCounterCount("Karn, the Great Creator", CounterType.LOYALTY, 5);
|
||||
|
||||
}
|
||||
|
||||
package org.mage.test.cards.protection;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class EightAndAHalfTailsTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testProtectingPlaneswalker() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
|
||||
// Activated abilities of artifacts your opponents control can't be activated.
|
||||
// +1: Until your next turn, up to one target noncreature artifact becomes an artifact creature with power and toughness equal to its converted mana cost.
|
||||
// -2: You may choose an artifact card you own from outside the game or in exile, reveal that card, and put it into your hand.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Karn, the Great Creator"); // Planeswalker (5)
|
||||
|
||||
// {1}{W}: Target permanent you control gains protection from white until end of turn.
|
||||
// {1}: Target spell or permanent becomes white until end of turn.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Eight-and-a-Half-Tails"); // Creature
|
||||
|
||||
// Flying, double strike
|
||||
// Whenever a creature you control deals combat damage to a player, you and that player each gain that much life.
|
||||
// At the beginning of your end step, if you have at least 15 life more than your starting life total, each player Angel of Destiny attacked this turn loses the game.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Angel of Destiny"); // Creature
|
||||
|
||||
attack(2, playerB, "Angel of Destiny", "Karn, the Great Creator");
|
||||
activateAbility(2, PhaseStep.DECLARE_ATTACKERS, playerA, "{1}{W}: Target permanent you control gains protection from white until end of turn.");
|
||||
addTarget(playerA, "Karn, the Great Creator");
|
||||
|
||||
setStopAt(2, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Karn, the Great Creator", 1);
|
||||
assertCounterCount("Karn, the Great Creator", CounterType.LOYALTY, 5);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,51 +1,51 @@
|
|||
package org.mage.test.cards.single.bfz;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ConduitOfRuinTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCast() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Emrakul, the Aeons Torn can't be countered.
|
||||
// When you cast Emrakul, take an extra turn after this one.
|
||||
// Flying, protection from colored spells, annihilator 6
|
||||
// When Emrakul is put into a graveyard from anywhere, its owner shuffles their graveyard into their library.
|
||||
addCard(Zone.LIBRARY, playerA, "Emrakul, the Aeons Torn"); // Creature {15} 15/15
|
||||
|
||||
// When you cast Conduit of Ruin, you may search your library for a colorless creature card with converted mana cost 7 or greater, then shuffle your library and put that card on top of it.
|
||||
// The first creature spell you cast each turn costs {2} less to cast.
|
||||
addCard(Zone.HAND, playerA, "Conduit of Ruin"); // Creature {6} 5/5
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 13);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Conduit of Ruin");
|
||||
setChoice(playerA, true); // When you cast this spell, you may search...
|
||||
addTarget(playerA, "Emrakul, the Aeons Torn");
|
||||
|
||||
setStopAt(3, PhaseStep.DRAW);
|
||||
|
||||
execute();
|
||||
|
||||
assertLibraryCount(playerA, "Emrakul, the Aeons Torn", 0);
|
||||
assertHandCount(playerA, "Emrakul, the Aeons Torn", 1);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Emrakul, the Aeons Torn");
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Conduit of Ruin", 1);
|
||||
assertPermanentCount(playerA, "Emrakul, the Aeons Torn", 1);
|
||||
}
|
||||
package org.mage.test.cards.single.bfz;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ConduitOfRuinTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCast() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Emrakul, the Aeons Torn can't be countered.
|
||||
// When you cast Emrakul, take an extra turn after this one.
|
||||
// Flying, protection from colored spells, annihilator 6
|
||||
// When Emrakul is put into a graveyard from anywhere, its owner shuffles their graveyard into their library.
|
||||
addCard(Zone.LIBRARY, playerA, "Emrakul, the Aeons Torn"); // Creature {15} 15/15
|
||||
|
||||
// When you cast Conduit of Ruin, you may search your library for a colorless creature card with converted mana cost 7 or greater, then shuffle your library and put that card on top of it.
|
||||
// The first creature spell you cast each turn costs {2} less to cast.
|
||||
addCard(Zone.HAND, playerA, "Conduit of Ruin"); // Creature {6} 5/5
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 13);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Conduit of Ruin");
|
||||
setChoice(playerA, true); // When you cast this spell, you may search...
|
||||
addTarget(playerA, "Emrakul, the Aeons Torn");
|
||||
|
||||
setStopAt(3, PhaseStep.DRAW);
|
||||
|
||||
execute();
|
||||
|
||||
assertLibraryCount(playerA, "Emrakul, the Aeons Torn", 0);
|
||||
assertHandCount(playerA, "Emrakul, the Aeons Torn", 1);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Emrakul, the Aeons Torn");
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Conduit of Ruin", 1);
|
||||
assertPermanentCount(playerA, "Emrakul, the Aeons Torn", 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,49 +1,49 @@
|
|||
package org.mage.test.cards.single.c17;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TheUrDragonTest extends CardTestPlayerBase {
|
||||
|
||||
|
||||
@Test
|
||||
public void test_basic() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
skipInitShuffling();
|
||||
// Eminence — As long as The Ur-Dragon is in the command zone or on the battlefield, other Dragon spells you cast cost 1 less to cast.
|
||||
// Flying
|
||||
// Whenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "The Ur-Dragon", 1); // Creature (10/10)
|
||||
// Flying
|
||||
// {R}: Dragon Hatchling gets +1/+0 until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Dragon Hatchling", 2); // Creature Dragon {1}{R} (0/1)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling");
|
||||
|
||||
attack(3, playerA, "The Ur-Dragon");
|
||||
attack(3, playerA, "Dragon Hatchling");
|
||||
attack(3, playerA, "Dragon Hatchling");
|
||||
setChoice(playerA, true); // Put a permanent card from your hand onto the battlefield?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(3, PhaseStep.END_COMBAT);
|
||||
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Hatchling", 2);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1 );
|
||||
assertHandCount(playerA, 3);
|
||||
|
||||
}
|
||||
package org.mage.test.cards.single.c17;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TheUrDragonTest extends CardTestPlayerBase {
|
||||
|
||||
|
||||
@Test
|
||||
public void test_basic() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
skipInitShuffling();
|
||||
// Eminence — As long as The Ur-Dragon is in the command zone or on the battlefield, other Dragon spells you cast cost 1 less to cast.
|
||||
// Flying
|
||||
// Whenever one or more Dragons you control attack, draw that many cards, then you may put a permanent card from your hand onto the battlefield.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "The Ur-Dragon", 1); // Creature (10/10)
|
||||
// Flying
|
||||
// {R}: Dragon Hatchling gets +1/+0 until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Dragon Hatchling", 2); // Creature Dragon {1}{R} (0/1)
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Dragon Hatchling");
|
||||
|
||||
attack(3, playerA, "The Ur-Dragon");
|
||||
attack(3, playerA, "Dragon Hatchling");
|
||||
attack(3, playerA, "Dragon Hatchling");
|
||||
setChoice(playerA, true); // Put a permanent card from your hand onto the battlefield?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(3, PhaseStep.END_COMBAT);
|
||||
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Dragon Hatchling", 2);
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1 );
|
||||
assertHandCount(playerA, 3);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,75 +1,75 @@
|
|||
|
||||
package org.mage.test.cards.single.c18;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AminatousAuguryTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCastMultiple() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Pillarfield Ox"); // Creature (2/4)
|
||||
// As an additional cost to cast this spell, discard a card.
|
||||
// Draw two cards.
|
||||
addCard(Zone.LIBRARY, playerA, "Tormenting Voice"); // Sorcery
|
||||
// {1}: Adarkar Sentinel gets +0/+1 until end of turn.
|
||||
addCard(Zone.LIBRARY, playerA, "Adarkar Sentinel"); // Artifact Creature {5} (3/3)
|
||||
addCard(Zone.LIBRARY, playerA, "Storm Crow");
|
||||
// You have hexproof. (You can't be the target of spells or abilities your opponents control.)
|
||||
addCard(Zone.LIBRARY, playerA, "Aegis of the Gods"); // Enchantment Creature {1}{W} (2/1)
|
||||
addCard(Zone.LIBRARY, playerA, "Lightning Bolt"); // Instant
|
||||
addCard(Zone.LIBRARY, playerA, "Badlands");
|
||||
skipInitShuffling();
|
||||
// Exile the top eight cards of your library. You may put a land card from among them onto the battlefield.
|
||||
// Until end of turn, for each nonland card type, you may cast a card of that type from among the exiled cards
|
||||
// without paying its mana cost.
|
||||
addCard(Zone.HAND, playerA, "Aminatou's Augury"); // SORCERY {6}{U}{U}
|
||||
addCard(Zone.HAND, playerA, "Mountain");
|
||||
addCard(Zone.HAND, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aminatou's Augury");
|
||||
setChoice(playerA, true); // Put a land from among the exiled cards into play?
|
||||
setChoice(playerA, "Badlands"); // Select a land card
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adarkar Sentinel");
|
||||
setChoice(playerA, "Artifact"); // Which card type do you want to consume?
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aegis of the Gods");
|
||||
setChoice(playerA, "Enchantment"); // Which card type do you want to consume?
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Storm Crow");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tormenting Voice");
|
||||
setChoice(playerA, "Silvercoat Lion"); // Select a card (discard cost)
|
||||
|
||||
checkPlayableAbility("Cannot cast second creature from exile", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Pillarfield Ox", Boolean.FALSE); // Type Creature type is already consumed
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Aminatou's Augury", 1);
|
||||
assertPermanentCount(playerA, "Mountain", 1);
|
||||
assertPermanentCount(playerA, "Badlands", 1);
|
||||
assertPermanentCount(playerA, "Adarkar Sentinel", 1);
|
||||
assertPermanentCount(playerA, "Aegis of the Gods", 1);
|
||||
assertPermanentCount(playerA, "Storm Crow", 1);
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
assertHandCount(playerA, 2);
|
||||
assertGraveyardCount(playerA, "Silvercoat Lion",1);
|
||||
assertExileCount(playerA, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package org.mage.test.cards.single.c18;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AminatousAuguryTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testCastMultiple() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Pillarfield Ox"); // Creature (2/4)
|
||||
// As an additional cost to cast this spell, discard a card.
|
||||
// Draw two cards.
|
||||
addCard(Zone.LIBRARY, playerA, "Tormenting Voice"); // Sorcery
|
||||
// {1}: Adarkar Sentinel gets +0/+1 until end of turn.
|
||||
addCard(Zone.LIBRARY, playerA, "Adarkar Sentinel"); // Artifact Creature {5} (3/3)
|
||||
addCard(Zone.LIBRARY, playerA, "Storm Crow");
|
||||
// You have hexproof. (You can't be the target of spells or abilities your opponents control.)
|
||||
addCard(Zone.LIBRARY, playerA, "Aegis of the Gods"); // Enchantment Creature {1}{W} (2/1)
|
||||
addCard(Zone.LIBRARY, playerA, "Lightning Bolt"); // Instant
|
||||
addCard(Zone.LIBRARY, playerA, "Badlands");
|
||||
skipInitShuffling();
|
||||
// Exile the top eight cards of your library. You may put a land card from among them onto the battlefield.
|
||||
// Until end of turn, for each nonland card type, you may cast a card of that type from among the exiled cards
|
||||
// without paying its mana cost.
|
||||
addCard(Zone.HAND, playerA, "Aminatou's Augury"); // SORCERY {6}{U}{U}
|
||||
addCard(Zone.HAND, playerA, "Mountain");
|
||||
addCard(Zone.HAND, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aminatou's Augury");
|
||||
setChoice(playerA, true); // Put a land from among the exiled cards into play?
|
||||
setChoice(playerA, "Badlands"); // Select a land card
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Adarkar Sentinel");
|
||||
setChoice(playerA, "Artifact"); // Which card type do you want to consume?
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Aegis of the Gods");
|
||||
setChoice(playerA, "Enchantment"); // Which card type do you want to consume?
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Storm Crow");
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Tormenting Voice");
|
||||
setChoice(playerA, "Silvercoat Lion"); // Select a card (discard cost)
|
||||
|
||||
checkPlayableAbility("Cannot cast second creature from exile", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Pillarfield Ox", Boolean.FALSE); // Type Creature type is already consumed
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Aminatou's Augury", 1);
|
||||
assertPermanentCount(playerA, "Mountain", 1);
|
||||
assertPermanentCount(playerA, "Badlands", 1);
|
||||
assertPermanentCount(playerA, "Adarkar Sentinel", 1);
|
||||
assertPermanentCount(playerA, "Aegis of the Gods", 1);
|
||||
assertPermanentCount(playerA, "Storm Crow", 1);
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
assertHandCount(playerA, 2);
|
||||
assertGraveyardCount(playerA, "Silvercoat Lion",1);
|
||||
assertExileCount(playerA, 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,96 +1,96 @@
|
|||
|
||||
package org.mage.test.cards.single.c20;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class PakoArcaneRetrieverTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_CheckExiled() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.LIBRARY, playerB, "Pillarfield Ox", 1);
|
||||
|
||||
skipInitShuffling();
|
||||
// Partner with Pako, Arcane Retriever
|
||||
// You may play noncreature cards from exile with fetch counters on them if you
|
||||
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
|
||||
// Partner with Haldan, Avid Arcanist
|
||||
// Haste
|
||||
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)
|
||||
|
||||
attack(1, playerA, "Pako, Arcane Retriever");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
assertExileCount(playerA, "Silvercoat Lion", 1);
|
||||
assertExileCount(playerB, "Pillarfield Ox", 1);
|
||||
|
||||
for(Card card :currentGame.getExile().getAllCards(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " has a fetch counter",card.getCounters(currentGame).getCount(CounterType.FETCH) == 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastExiled() {
|
||||
// setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Lightning Bolt", 1); // Instant 3 damge
|
||||
// Create a 3/3 green Centaur creature token.
|
||||
addCard(Zone.LIBRARY, playerB, "Call of the Conclave", 1); // Sorcery {W}{G}
|
||||
|
||||
skipInitShuffling();
|
||||
// Partner with Pako, Arcane Retriever
|
||||
// You may play noncreature cards from exile with fetch counters on them if you
|
||||
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
|
||||
// Partner with Haldan, Avid Arcanist
|
||||
// Haste
|
||||
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)
|
||||
|
||||
attack(1, playerA, "Pako, Arcane Retriever");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Call of the Conclave");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 12); // 3+2 (attack) + 3 Lighning Bolt
|
||||
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerB, "Call of the Conclave", 1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
package org.mage.test.cards.single.c20;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class PakoArcaneRetrieverTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_CheckExiled() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion", 1);
|
||||
addCard(Zone.LIBRARY, playerB, "Pillarfield Ox", 1);
|
||||
|
||||
skipInitShuffling();
|
||||
// Partner with Pako, Arcane Retriever
|
||||
// You may play noncreature cards from exile with fetch counters on them if you
|
||||
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
|
||||
// Partner with Haldan, Avid Arcanist
|
||||
// Haste
|
||||
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)
|
||||
|
||||
attack(1, playerA, "Pako, Arcane Retriever");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 17);
|
||||
|
||||
assertExileCount(playerA, "Silvercoat Lion", 1);
|
||||
assertExileCount(playerB, "Pillarfield Ox", 1);
|
||||
|
||||
for(Card card :currentGame.getExile().getAllCards(currentGame)) {
|
||||
Assert.assertTrue(card.getName() + " has a fetch counter",card.getCounters(currentGame).getCount(CounterType.FETCH) == 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_CastExiled() {
|
||||
// setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Lightning Bolt", 1); // Instant 3 damge
|
||||
// Create a 3/3 green Centaur creature token.
|
||||
addCard(Zone.LIBRARY, playerB, "Call of the Conclave", 1); // Sorcery {W}{G}
|
||||
|
||||
skipInitShuffling();
|
||||
// Partner with Pako, Arcane Retriever
|
||||
// You may play noncreature cards from exile with fetch counters on them if you
|
||||
// exiled them, and you may spend mana as though it were mana of any color to cast those spells.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Haldan, Avid Arcanist", 1);
|
||||
// Partner with Haldan, Avid Arcanist
|
||||
// Haste
|
||||
// Whenever Pako, Arcane Retriever attacks, exile the top card of each player's library and put a fetch counter on each of them. Put a +1/+1 counter on Pako for each noncreature card exiled this way.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pako, Arcane Retriever", 1); // Creature {3}{R}{G} (3/3)
|
||||
|
||||
attack(1, playerA, "Pako, Arcane Retriever");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Call of the Conclave");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 12); // 3+2 (attack) + 3 Lighning Bolt
|
||||
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerB, "Call of the Conclave", 1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,72 +1,72 @@
|
|||
package org.mage.test.cards.single.dst;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DemonsHornTest extends CardTestPlayerBase {
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithBlackSpell() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Abyssal Gatekeeper dies, each player sacrifices a creature.
|
||||
addCard(Zone.HAND, playerA, "Abyssal Gatekeeper", 1); // Creature {2}{B} 1/1
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
// Whenever a player casts a black spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Demon's Horn", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Abyssal Gatekeeper");
|
||||
setChoice(playerB, true);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Abyssal Gatekeeper", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/magefree/mage/issues/6890
|
||||
*
|
||||
* Color == Color Identity #6890
|
||||
*
|
||||
* Alesha, Who Smiles at Death triggers Demon's Horn
|
||||
*/
|
||||
@Test
|
||||
public void testSpellWithBlackManaOnlyInTriggeredOptionalCost() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// First strike
|
||||
// Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking.
|
||||
addCard(Zone.HAND, playerA, "Alesha, Who Smiles at Death", 1); // Creature {2}{R} 3/2
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// Whenever a player casts a black spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Demon's Horn", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alesha, Who Smiles at Death");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Alesha, Who Smiles at Death", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
}
|
||||
package org.mage.test.cards.single.dst;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DemonsHornTest extends CardTestPlayerBase {
|
||||
|
||||
|
||||
@Test
|
||||
public void testWithBlackSpell() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Abyssal Gatekeeper dies, each player sacrifices a creature.
|
||||
addCard(Zone.HAND, playerA, "Abyssal Gatekeeper", 1); // Creature {2}{B} 1/1
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
// Whenever a player casts a black spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Demon's Horn", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Abyssal Gatekeeper");
|
||||
setChoice(playerB, true);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Abyssal Gatekeeper", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 21);
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/magefree/mage/issues/6890
|
||||
*
|
||||
* Color == Color Identity #6890
|
||||
*
|
||||
* Alesha, Who Smiles at Death triggers Demon's Horn
|
||||
*/
|
||||
@Test
|
||||
public void testSpellWithBlackManaOnlyInTriggeredOptionalCost() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// First strike
|
||||
// Whenever Alesha, Who Smiles at Death attacks, you may pay {W/B}{W/B}. If you do, return target creature card with power 2 or less from your graveyard to the battlefield tapped and attacking.
|
||||
addCard(Zone.HAND, playerA, "Alesha, Who Smiles at Death", 1); // Creature {2}{R} 3/2
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// Whenever a player casts a black spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Demon's Horn", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alesha, Who Smiles at Death");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Alesha, Who Smiles at Death", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,88 +1,88 @@
|
|||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BarteredCowTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bartered Cow");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiscardTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.HAND, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
// Choose one —
|
||||
// • Target player discards a card.
|
||||
// • Target creature gets +2/-1 until end of turn.
|
||||
// • Target creature gains swampwalk until end of turn. (It can't be blocked as long as defending player controls a Swamp.)
|
||||
addCard(Zone.HAND, playerB, "Funeral Charm", 1); // Instant {B}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Funeral Charm");
|
||||
setModeChoice(playerB, "1");
|
||||
addTarget(playerB, playerA);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Funeral Charm", 1);
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiscardTriggerWithTorturedExistence() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.HAND, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
|
||||
// {B}, Discard a creature card: Return target creature card from your graveyard to your hand.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Tortured Existence", 1); // Instant {B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
|
||||
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{B}, Discard a creature card");
|
||||
setChoice(playerA, "Bartered Cow");
|
||||
addTarget(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
}
|
||||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BarteredCowTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bartered Cow");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt", 1);
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiscardTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.HAND, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
// Choose one —
|
||||
// • Target player discards a card.
|
||||
// • Target creature gets +2/-1 until end of turn.
|
||||
// • Target creature gains swampwalk until end of turn. (It can't be blocked as long as defending player controls a Swamp.)
|
||||
addCard(Zone.HAND, playerB, "Funeral Charm", 1); // Instant {B}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Funeral Charm");
|
||||
setModeChoice(playerB, "1");
|
||||
addTarget(playerB, playerA);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Funeral Charm", 1);
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiscardTriggerWithTorturedExistence() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// When Bartered Cow dies or when you discard it, create a Food token.
|
||||
addCard(Zone.HAND, playerA, "Bartered Cow"); // Creature {3}{W} 3/3
|
||||
|
||||
// {B}, Discard a creature card: Return target creature card from your graveyard to your hand.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Tortured Existence", 1); // Instant {B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp");
|
||||
addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{B}, Discard a creature card");
|
||||
setChoice(playerA, "Bartered Cow");
|
||||
addTarget(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Bartered Cow", 1);
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Food", 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,89 +1,89 @@
|
|||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class OnceUponATimeTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_castRegularly() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.LIBRARY, playerA, "Plains", 4);
|
||||
skipInitShuffling();
|
||||
|
||||
// If this spell is the first spell you've cast this game, you may cast it without paying its mana cost.
|
||||
// Look at the top five cards of your library.
|
||||
// You may reveal a creature or land card from among them and put it into your hand.
|
||||
// Put the rest on the bottom of your library in a random order.
|
||||
addCard(Zone.HAND, playerA, "Once Upon a Time"); // Instant {1}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.HAND, playerA, "Forest", 1);
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Once Upon a Time");
|
||||
|
||||
setChoice(playerA, false); // Cast without paying its mana cost?
|
||||
|
||||
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Once Upon a Time", 1);
|
||||
assertTappedCount("Forest", true, 2);
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_castForFree() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.LIBRARY, playerA, "Plains", 4);
|
||||
|
||||
addCard(Zone.LIBRARY, playerB, "Silvercoat Lion", 5);
|
||||
|
||||
skipInitShuffling();
|
||||
|
||||
// If this spell is the first spell you've cast this game, you may cast it without paying its mana cost.
|
||||
// Look at the top five cards of your library.
|
||||
// You may reveal a creature or land card from among them and put it into your hand.
|
||||
// Put the rest on the bottom of your library in a random order.
|
||||
addCard(Zone.HAND, playerA, "Once Upon a Time"); // Instant {1}{G}
|
||||
addCard(Zone.HAND, playerB, "Once Upon a Time"); // Instant {1}{G}
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Once Upon a Time");
|
||||
setChoice(playerA, true); // Cast without paying its mana cost?
|
||||
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Once Upon a Time");
|
||||
setChoice(playerB, true); // Cast without paying its mana cost?
|
||||
setChoice(playerB, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Once Upon a Time", 1);
|
||||
assertGraveyardCount(playerB, "Once Upon a Time", 1);
|
||||
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
assertHandCount(playerB, "Silvercoat Lion", 2);
|
||||
}
|
||||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class OnceUponATimeTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_castRegularly() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.LIBRARY, playerA, "Plains", 4);
|
||||
skipInitShuffling();
|
||||
|
||||
// If this spell is the first spell you've cast this game, you may cast it without paying its mana cost.
|
||||
// Look at the top five cards of your library.
|
||||
// You may reveal a creature or land card from among them and put it into your hand.
|
||||
// Put the rest on the bottom of your library in a random order.
|
||||
addCard(Zone.HAND, playerA, "Once Upon a Time"); // Instant {1}{G}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.HAND, playerA, "Forest", 1);
|
||||
|
||||
playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Once Upon a Time");
|
||||
|
||||
setChoice(playerA, false); // Cast without paying its mana cost?
|
||||
|
||||
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Once Upon a Time", 1);
|
||||
assertTappedCount("Forest", true, 2);
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_castForFree() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.LIBRARY, playerA, "Plains", 4);
|
||||
|
||||
addCard(Zone.LIBRARY, playerB, "Silvercoat Lion", 5);
|
||||
|
||||
skipInitShuffling();
|
||||
|
||||
// If this spell is the first spell you've cast this game, you may cast it without paying its mana cost.
|
||||
// Look at the top five cards of your library.
|
||||
// You may reveal a creature or land card from among them and put it into your hand.
|
||||
// Put the rest on the bottom of your library in a random order.
|
||||
addCard(Zone.HAND, playerA, "Once Upon a Time"); // Instant {1}{G}
|
||||
addCard(Zone.HAND, playerB, "Once Upon a Time"); // Instant {1}{G}
|
||||
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Once Upon a Time");
|
||||
setChoice(playerA, true); // Cast without paying its mana cost?
|
||||
setChoice(playerA, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerA, "Silvercoat Lion");
|
||||
|
||||
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Once Upon a Time");
|
||||
setChoice(playerB, true); // Cast without paying its mana cost?
|
||||
setChoice(playerB, true); // Do you wish to reveal a creature or land card and put into your hand?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setStopAt(2, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Once Upon a Time", 1);
|
||||
assertGraveyardCount(playerB, "Once Upon a Time", 1);
|
||||
|
||||
assertHandCount(playerA, "Silvercoat Lion", 1);
|
||||
assertHandCount(playerB, "Silvercoat Lion", 2);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +1,57 @@
|
|||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SyrGwynHeroOfAshvaleTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void equipKnightTest() {
|
||||
// Equipped creature gets +2/+2 and has trample and lifelink.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Behemoth Sledge"); // Artifact - Equipment {1}{G}{W}
|
||||
|
||||
// Vigilance, menace
|
||||
// Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.
|
||||
// Equipment you control have equip Knight {0}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Syr Gwyn, Hero of Ashvale"); // Legendary Creature {3}{R}{W}{B} 5/5 Human Knight
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip Knight", "Syr Gwyn, Hero of Ashvale");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Syr Gwyn, Hero of Ashvale", 7, 7);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void equipKnightTestInstantSpeed() {
|
||||
// Equipped creature gets +2/+2 and has trample and lifelink.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Behemoth Sledge"); // Artifact - Equipment {1}{G}{W}
|
||||
|
||||
// You may activate equip abilities any time you could cast an instant.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Leonin Shikari", 2); // Creature 2/2
|
||||
|
||||
// Vigilance, menace
|
||||
// Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.
|
||||
// Equipment you control have equip Knight {0}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Syr Gwyn, Hero of Ashvale"); // Legendary Creature {3}{R}{W}{B} 5/5 Human Knight
|
||||
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "Equip Knight", "Syr Gwyn, Hero of Ashvale");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Syr Gwyn, Hero of Ashvale", 7, 7);
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.single.eld;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SyrGwynHeroOfAshvaleTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void equipKnightTest() {
|
||||
// Equipped creature gets +2/+2 and has trample and lifelink.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Behemoth Sledge"); // Artifact - Equipment {1}{G}{W}
|
||||
|
||||
// Vigilance, menace
|
||||
// Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.
|
||||
// Equipment you control have equip Knight {0}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Syr Gwyn, Hero of Ashvale"); // Legendary Creature {3}{R}{W}{B} 5/5 Human Knight
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip Knight", "Syr Gwyn, Hero of Ashvale");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Syr Gwyn, Hero of Ashvale", 7, 7);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void equipKnightTestInstantSpeed() {
|
||||
// Equipped creature gets +2/+2 and has trample and lifelink.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Behemoth Sledge"); // Artifact - Equipment {1}{G}{W}
|
||||
|
||||
// You may activate equip abilities any time you could cast an instant.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Leonin Shikari", 2); // Creature 2/2
|
||||
|
||||
// Vigilance, menace
|
||||
// Whenever an equipped creature you control attacks, you draw a card and you lose 1 life.
|
||||
// Equipment you control have equip Knight {0}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Syr Gwyn, Hero of Ashvale"); // Legendary Creature {3}{R}{W}{B} 5/5 Human Knight
|
||||
|
||||
activateAbility(1, PhaseStep.DECLARE_ATTACKERS, playerA, "Equip Knight", "Syr Gwyn, Hero of Ashvale");
|
||||
|
||||
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPowerToughness(playerA, "Syr Gwyn, Hero of Ashvale", 7, 7);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,245 +1,245 @@
|
|||
package org.mage.test.cards.single.grn;
|
||||
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2, TheElk801
|
||||
*/
|
||||
public class PeltCollectorTest extends CardTestPlayerBase {
|
||||
|
||||
private static final String collector = "Pelt Collector";
|
||||
private static final String lion = "Silvercoat Lion";
|
||||
private static final String trostani = "Trostani Discordant";
|
||||
private static final String bear = "Grizzly Bears";
|
||||
private static final String murder = "Murder";
|
||||
private static final String courser = "Centaur Courser";
|
||||
private static final String growth = "Giant Growth";
|
||||
private static final String karstoderm = "Karstoderm";
|
||||
|
||||
@Test
|
||||
public void test_Simple() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector.
|
||||
// As long as Pelt Collector has three or more +1/+1 counters on it, it has trample.
|
||||
addCard(Zone.HAND, playerA, collector, 1); // Creature {G}
|
||||
addCard(Zone.HAND, playerA, lion, 1); // Creature {1}{W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, collector, 1);// Creature {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, collector);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lion);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerB, collector, 1, 1);
|
||||
|
||||
assertPowerToughness(playerA, lion, 2, 2);
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertAbility(playerA, collector, TrampleAbility.getInstance(), false);
|
||||
assertAbility(playerB, collector, TrampleAbility.getInstance(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* To determine if Pelt Collector’s first ability triggers when a creature
|
||||
* enters the battlefield, use the creature’s power after applying any
|
||||
* static abilities (such as that of Trostani Discordant) that modify its
|
||||
* power.
|
||||
*/
|
||||
@Test
|
||||
public void test_TrostaniDiscordant() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
// Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector.
|
||||
// As long as Pelt Collector has three or more +1/+1 counters on it, it has trample.
|
||||
addCard(Zone.HAND, playerA, collector, 1); // Creature {G}
|
||||
addCard(Zone.HAND, playerA, lion, 1); // Creature {1}{W}
|
||||
// Other creatures you control get +1/+1.
|
||||
// When Trostani Discordant enters the battlefield, create two 1/1 white Soldier creature tokens with lifelink.
|
||||
// At the beginning of your end step, each player gains control of all creatures they own.
|
||||
addCard(Zone.HAND, playerA, trostani, 1); // Creature {3}{G}{W} /1/4)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, collector, 1);// Creature {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, trostani);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, collector);
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, lion);
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerB, collector, 1, 1);
|
||||
|
||||
assertPowerToughness(playerA, "Soldier", 2, 2, Filter.ComparisonScope.All);
|
||||
|
||||
assertPowerToughness(playerA, lion, 3, 3);
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertAbility(playerA, collector, TrampleAbility.getInstance(), false);
|
||||
assertAbility(playerB, collector, TrampleAbility.getInstance(), false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testEntersTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEntersTrigger2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, karstoderm);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, karstoderm);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, courser);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 6);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, courser);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, courser);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertCounterCount(collector, CounterType.P1P1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger3() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, karstoderm);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 7);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, karstoderm);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, karstoderm);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertCounterCount(collector, CounterType.P1P1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterveningIf() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, growth);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, growth, collector);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 4, 4);
|
||||
assertCounterCount(collector, CounterType.P1P1, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterveningIf2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, "Scar");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 3);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scar", bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 1, 1);
|
||||
assertCounterCount(collector, CounterType.P1P1, 0);
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.single.grn;
|
||||
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2, TheElk801
|
||||
*/
|
||||
public class PeltCollectorTest extends CardTestPlayerBase {
|
||||
|
||||
private static final String collector = "Pelt Collector";
|
||||
private static final String lion = "Silvercoat Lion";
|
||||
private static final String trostani = "Trostani Discordant";
|
||||
private static final String bear = "Grizzly Bears";
|
||||
private static final String murder = "Murder";
|
||||
private static final String courser = "Centaur Courser";
|
||||
private static final String growth = "Giant Growth";
|
||||
private static final String karstoderm = "Karstoderm";
|
||||
|
||||
@Test
|
||||
public void test_Simple() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
|
||||
// Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector.
|
||||
// As long as Pelt Collector has three or more +1/+1 counters on it, it has trample.
|
||||
addCard(Zone.HAND, playerA, collector, 1); // Creature {G}
|
||||
addCard(Zone.HAND, playerA, lion, 1); // Creature {1}{W}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, collector, 1);// Creature {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, collector);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lion);
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerB, collector, 1, 1);
|
||||
|
||||
assertPowerToughness(playerA, lion, 2, 2);
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertAbility(playerA, collector, TrampleAbility.getInstance(), false);
|
||||
assertAbility(playerB, collector, TrampleAbility.getInstance(), false);
|
||||
}
|
||||
|
||||
/**
|
||||
* To determine if Pelt Collector’s first ability triggers when a creature
|
||||
* enters the battlefield, use the creature’s power after applying any
|
||||
* static abilities (such as that of Trostani Discordant) that modify its
|
||||
* power.
|
||||
*/
|
||||
@Test
|
||||
public void test_TrostaniDiscordant() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
// Whenever another creature you control enters the battlefield or dies, if that creature's power is greater than Pelt Collector's, put a +1/+1 counter on Pelt Collector.
|
||||
// As long as Pelt Collector has three or more +1/+1 counters on it, it has trample.
|
||||
addCard(Zone.HAND, playerA, collector, 1); // Creature {G}
|
||||
addCard(Zone.HAND, playerA, lion, 1); // Creature {1}{W}
|
||||
// Other creatures you control get +1/+1.
|
||||
// When Trostani Discordant enters the battlefield, create two 1/1 white Soldier creature tokens with lifelink.
|
||||
// At the beginning of your end step, each player gains control of all creatures they own.
|
||||
addCard(Zone.HAND, playerA, trostani, 1); // Creature {3}{G}{W} /1/4)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, collector, 1);// Creature {G}
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, trostani);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, collector);
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, lion);
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerB, collector, 1, 1);
|
||||
|
||||
assertPowerToughness(playerA, "Soldier", 2, 2, Filter.ComparisonScope.All);
|
||||
|
||||
assertPowerToughness(playerA, lion, 3, 3);
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertAbility(playerA, collector, TrampleAbility.getInstance(), false);
|
||||
assertAbility(playerB, collector, TrampleAbility.getInstance(), false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testEntersTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEntersTrigger2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, karstoderm);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, karstoderm);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 2, 2);
|
||||
assertCounterCount(collector, CounterType.P1P1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, courser);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 6);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, courser);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, courser);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertCounterCount(collector, CounterType.P1P1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDiesTrigger3() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, karstoderm);
|
||||
addCard(Zone.HAND, playerA, murder);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 7);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, karstoderm);
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, murder, karstoderm);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 3, 3);
|
||||
assertCounterCount(collector, CounterType.P1P1, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterveningIf() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, growth);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, growth, collector);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 4, 4);
|
||||
assertCounterCount(collector, CounterType.P1P1, 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInterveningIf2() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, collector);
|
||||
addCard(Zone.HAND, playerA, bear);
|
||||
addCard(Zone.HAND, playerA, "Scar");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Bayou", 3);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, bear);
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, true);
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Scar", bear);
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, collector, 1, 1);
|
||||
assertCounterCount(collector, CounterType.P1P1, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,88 +1,88 @@
|
|||
package org.mage.test.cards.single.hou;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.FreeForAll;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameException;
|
||||
import mage.game.mulligan.MulliganType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestMultiPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TormentOfHailfireTest extends CardTestMultiPlayerBase {
|
||||
|
||||
@Override
|
||||
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||
// Start Life = 2
|
||||
Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ONE, MulliganType.GAME_DEFAULT.getMulligan(0), 20);
|
||||
// Player order: A -> D -> C -> B
|
||||
playerA = createPlayer(game, playerA, "PlayerA");
|
||||
playerB = createPlayer(game, playerB, "PlayerB");
|
||||
playerC = createPlayer(game, playerC, "PlayerC");
|
||||
playerD = createPlayer(game, playerD, "PlayerD");
|
||||
return game;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_Normal() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Repeat the following process X times. Each opponent loses 3 life unless they sacrifice a nonland permanent or discards a card.
|
||||
addCard(Zone.HAND, playerA, "Torment of Hailfire", 1); // Sorcery {X}{B}{B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 12);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
|
||||
addCard(Zone.HAND, playerB, "Plains", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerC, "Silvercoat Lion", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerD, "Silvercoat Lion", 3);
|
||||
addCard(Zone.HAND, playerD, "Plains", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Torment of Hailfire");
|
||||
setChoice(playerA, "X=10");
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerB, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerB, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerD, false);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, true);// Discard a card?
|
||||
|
||||
setChoice(playerB, true);// Discard a card?
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Torment of Hailfire", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerC, 20);
|
||||
assertLife(playerD, 2);
|
||||
assertLife(playerB, -1);
|
||||
Assert.assertFalse("Player B is dead", playerB.isInGame());
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.single.hou;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.FreeForAll;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameException;
|
||||
import mage.game.mulligan.MulliganType;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestMultiPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TormentOfHailfireTest extends CardTestMultiPlayerBase {
|
||||
|
||||
@Override
|
||||
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||
// Start Life = 2
|
||||
Game game = new FreeForAll(MultiplayerAttackOption.MULTIPLE, RangeOfInfluence.ONE, MulliganType.GAME_DEFAULT.getMulligan(0), 20);
|
||||
// Player order: A -> D -> C -> B
|
||||
playerA = createPlayer(game, playerA, "PlayerA");
|
||||
playerB = createPlayer(game, playerB, "PlayerB");
|
||||
playerC = createPlayer(game, playerC, "PlayerC");
|
||||
playerD = createPlayer(game, playerD, "PlayerD");
|
||||
return game;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_Normal() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Repeat the following process X times. Each opponent loses 3 life unless they sacrifice a nonland permanent or discards a card.
|
||||
addCard(Zone.HAND, playerA, "Torment of Hailfire", 1); // Sorcery {X}{B}{B}
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 12);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2);
|
||||
addCard(Zone.HAND, playerB, "Plains", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerC, "Silvercoat Lion", 3);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerD, "Silvercoat Lion", 3);
|
||||
addCard(Zone.HAND, playerD, "Plains", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Torment of Hailfire");
|
||||
setChoice(playerA, "X=10");
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerB, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerB, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerB, "Silvercoat Lion");
|
||||
|
||||
setChoice(playerD, false);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, true);// Discard a card?
|
||||
|
||||
setChoice(playerB, true);// Discard a card?
|
||||
|
||||
setChoice(playerD, true);// Sacrifices a nonland permanent?
|
||||
setChoice(playerD, "Silvercoat Lion");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Torment of Hailfire", 1);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerC, 20);
|
||||
assertLife(playerD, 2);
|
||||
assertLife(playerB, -1);
|
||||
Assert.assertFalse("Player B is dead", playerB.isInGame());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
package org.mage.test.cards.single.iko;
|
||||
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class OboshThePreypiercerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testZeroCMSIsHandledAsOdd() {
|
||||
setStrictChooseMode(true);
|
||||
// At the beginning of your upkeep, flip a coin. If you lose the flip, Mana Crypt deals 3 damage to you.
|
||||
// {T}: Add {C}{C}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mana Crypt");
|
||||
// Companion — Your starting deck contains only cards with odd converted mana costs and land cards.
|
||||
// If a source you control with an odd converted mana cost would deal damage to a permanent or player, it deals double that damage to that permanent or player instead.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Obosh, the Preypiercer");
|
||||
|
||||
// lose the flip
|
||||
setFlipCoinResult(playerA, false);
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
}
|
||||
package org.mage.test.cards.single.iko;
|
||||
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class OboshThePreypiercerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testZeroCMSIsHandledAsOdd() {
|
||||
setStrictChooseMode(true);
|
||||
// At the beginning of your upkeep, flip a coin. If you lose the flip, Mana Crypt deals 3 damage to you.
|
||||
// {T}: Add {C}{C}.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mana Crypt");
|
||||
// Companion — Your starting deck contains only cards with odd converted mana costs and land cards.
|
||||
// If a source you control with an odd converted mana cost would deal damage to a permanent or player, it deals double that damage to that permanent or player instead.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Obosh, the Preypiercer");
|
||||
|
||||
// lose the flip
|
||||
setFlipCoinResult(playerA, false);
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertLife(playerA, 20 - 3);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,90 +1,90 @@
|
|||
package org.mage.test.cards.single.iko;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SkycatSovereignTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_BoostFromFlyers() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 3, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Skycat Sovereign still gets +1/+1 for each creature that is supposed to have flying when there's an opposing Archetype of Imagination.
|
||||
*/
|
||||
@Test
|
||||
public void test_NoBoostIfFlyingLost() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
// Creatures you control have flying.
|
||||
// Creatures your opponents control lose flying and can't have or gain flying.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Archetype of Imagination"); //
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_BoostFromToken() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{W}{U}: Create");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cat Bird", 1);
|
||||
assertColor(playerA, "Cat Bird", ObjectColor.WHITE, true);
|
||||
assertColor(playerA, "Cat Bird", ObjectColor.BLUE, false);
|
||||
assertAbility(playerA, "Cat Bird", FlyingAbility.getInstance(), true);
|
||||
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 4, 4);
|
||||
}
|
||||
package org.mage.test.cards.single.iko;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class SkycatSovereignTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_BoostFromFlyers() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 3, 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* Skycat Sovereign still gets +1/+1 for each creature that is supposed to have flying when there's an opposing Archetype of Imagination.
|
||||
*/
|
||||
@Test
|
||||
public void test_NoBoostIfFlyingLost() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
// Creatures you control have flying.
|
||||
// Creatures your opponents control lose flying and can't have or gain flying.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Archetype of Imagination"); //
|
||||
|
||||
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 1, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_BoostFromToken() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
|
||||
// Flying
|
||||
// Skycat Sovereign gets +1/+1 for each other creature you control with flying.
|
||||
// {2}{W}{U}: Create a 1/1 white Cat Bird creature token with flying.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Skycat Sovereign"); // Creature {W}{U} (1/1)
|
||||
|
||||
// Flying, vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Abbey Griffin", 2); // Creature — Griffin (2/2)
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}{W}{U}: Create");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Cat Bird", 1);
|
||||
assertColor(playerA, "Cat Bird", ObjectColor.WHITE, true);
|
||||
assertColor(playerA, "Cat Bird", ObjectColor.BLUE, false);
|
||||
assertAbility(playerA, "Cat Bird", FlyingAbility.getInstance(), true);
|
||||
|
||||
assertPowerToughness(playerA, "Skycat Sovereign", 4, 4);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,39 +1,39 @@
|
|||
package org.mage.test.cards.single.mh1;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PlagueEngineerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_Standard() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
// Deathtouch
|
||||
// As Plague Engineer enters the battlefield, choose a creature type.
|
||||
// Creatures of the chosen type your opponents control get -1/-1.
|
||||
addCard(Zone.HAND, playerA, "Plague Engineer"); // Creature {2}{B} (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Defiant Elf", 2); //Creature - Elf (1/1)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Defiant Elf", 2); //Creature - Elf (1/1)
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Plague Engineer");
|
||||
setChoice(playerA, "Elf");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Plague Engineer", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Defiant Elf", 2);
|
||||
assertGraveyardCount(playerB, "Defiant Elf", 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
package org.mage.test.cards.single.mh1;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class PlagueEngineerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_Standard() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
// Deathtouch
|
||||
// As Plague Engineer enters the battlefield, choose a creature type.
|
||||
// Creatures of the chosen type your opponents control get -1/-1.
|
||||
addCard(Zone.HAND, playerA, "Plague Engineer"); // Creature {2}{B} (2/2)
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Defiant Elf", 2); //Creature - Elf (1/1)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Defiant Elf", 2); //Creature - Elf (1/1)
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Plague Engineer");
|
||||
setChoice(playerA, "Elf");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Plague Engineer", 1);
|
||||
|
||||
assertPermanentCount(playerA, "Defiant Elf", 2);
|
||||
assertGraveyardCount(playerB, "Defiant Elf", 2);
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,51 +1,51 @@
|
|||
package org.mage.test.cards.single.som;
|
||||
|
||||
import mage.abilities.keyword.IntimidateAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class NimDeathmantleTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_Basic() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
// Equipped creature gets +2/+2, has intimidate, and is a black Zombie.
|
||||
// Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {4}. If you do, return that card to the battlefield and attach Nim Deathmantle to it.
|
||||
addCard(Zone.HAND, playerA, "Nim Deathmantle"); // Artifact Equipment {2}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nim Deathmantle");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
|
||||
setChoice(playerA, true); // Message: Nim Deathmantle - Pay {4}?
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt",1);
|
||||
|
||||
assertPermanentCount(playerA, "Nim Deathmantle", 1);
|
||||
|
||||
assertPowerToughness(playerA, "Silvercoat Lion", 4, 4);
|
||||
assertAbility(playerA, "Silvercoat Lion", IntimidateAbility.getInstance(), true);
|
||||
assertType("Silvercoat Lion", CardType.CREATURE, SubType.ZOMBIE);
|
||||
|
||||
}
|
||||
package org.mage.test.cards.single.som;
|
||||
|
||||
import mage.abilities.keyword.IntimidateAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class NimDeathmantleTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_Basic() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
|
||||
// Equipped creature gets +2/+2, has intimidate, and is a black Zombie.
|
||||
// Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {4}. If you do, return that card to the battlefield and attach Nim Deathmantle to it.
|
||||
addCard(Zone.HAND, playerA, "Nim Deathmantle"); // Artifact Equipment {2}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||
addCard(Zone.HAND, playerB, "Lightning Bolt");
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nim Deathmantle");
|
||||
|
||||
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
|
||||
setChoice(playerA, true); // Message: Nim Deathmantle - Pay {4}?
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Lightning Bolt",1);
|
||||
|
||||
assertPermanentCount(playerA, "Nim Deathmantle", 1);
|
||||
|
||||
assertPowerToughness(playerA, "Silvercoat Lion", 4, 4);
|
||||
assertAbility(playerA, "Silvercoat Lion", IntimidateAbility.getInstance(), true);
|
||||
assertType("Silvercoat Lion", CardType.CREATURE, SubType.ZOMBIE);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,103 +1,103 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.mage.test.cards.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KardurDoomscourgeAndKithkinMourncallerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testKDRemovedFromCombatViaRegenerateAbility() {
|
||||
setStrictChooseMode(true);
|
||||
// Kardur, Doomscourge: if an attacking creature dies, each opponent loses 1 life and you gain 1 life
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kardur, Doomscourge");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel");
|
||||
addCard(Zone.HAND, playerA, "Regenerate");
|
||||
addCard(Zone.HAND, playerA, "Terror");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Regenerate", "Elvish Archers");
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // regeneration shield used up and EA is removed from combat
|
||||
|
||||
castSpell(1, PhaseStep.END_COMBAT, playerA, "Terror", "Elvish Archers"); // still within the combat phase, the EA is destroyed/dies
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
|
||||
// does not fire due to the Elvish Archers not in an attacking state
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccessfulKDTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
// Kardur, Doomscourge: if an attacking creature dies, each opponent loses 1 life and you gain 1 life
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kardur, Doomscourge");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers"); // 2/2 first strike
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel"); // 4/4 vigilance
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // Elvish Archer dies causing KD to trigger
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
|
||||
// successful fire so playerA gains 1 life and playerB loses 1 life
|
||||
assertLife(playerA, 21);
|
||||
assertLife(playerB, 19);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKMTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
// Kithkin Mourncaller: if an elf or kithkin dies, you may draw a card
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kithkin Mourncaller");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers"); // 2/1 first strike
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pearled Unicorn"); // 2/2
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel"); // 4/4 vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear"); // 2/2
|
||||
addCard(Zone.LIBRARY, playerA, "Island", 2); // used for draw trigger
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
attack(1, playerA, "Pearled Unicorn");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // Elvish Achers will die and trigger KM
|
||||
block(1, playerB, "Runeclaw Bear", "Pearled Unicorn"); // Pearled Unicorn will die but not trigger KM
|
||||
|
||||
setChoice(playerA, "Yes"); // accept the drawing of a card from the single trigger (Elvish Archers "elf type")
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
assertGraveyardCount(playerA, "Pearled Unicorn", 1);
|
||||
|
||||
// successful fire due to dead Elvish Archers (elf) so playerA draws a card
|
||||
assertHandCount(playerA, 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.mage.test.cards.triggers;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KardurDoomscourgeAndKithkinMourncallerTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testKDRemovedFromCombatViaRegenerateAbility() {
|
||||
setStrictChooseMode(true);
|
||||
// Kardur, Doomscourge: if an attacking creature dies, each opponent loses 1 life and you gain 1 life
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kardur, Doomscourge");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel");
|
||||
addCard(Zone.HAND, playerA, "Regenerate");
|
||||
addCard(Zone.HAND, playerA, "Terror");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 4);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Regenerate", "Elvish Archers");
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // regeneration shield used up and EA is removed from combat
|
||||
|
||||
castSpell(1, PhaseStep.END_COMBAT, playerA, "Terror", "Elvish Archers"); // still within the combat phase, the EA is destroyed/dies
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
|
||||
// does not fire due to the Elvish Archers not in an attacking state
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSuccessfulKDTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
// Kardur, Doomscourge: if an attacking creature dies, each opponent loses 1 life and you gain 1 life
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kardur, Doomscourge");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers"); // 2/2 first strike
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel"); // 4/4 vigilance
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // Elvish Archer dies causing KD to trigger
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
|
||||
// successful fire so playerA gains 1 life and playerB loses 1 life
|
||||
assertLife(playerA, 21);
|
||||
assertLife(playerB, 19);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testKMTrigger() {
|
||||
setStrictChooseMode(true);
|
||||
// Kithkin Mourncaller: if an elf or kithkin dies, you may draw a card
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kithkin Mourncaller");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Elvish Archers"); // 2/1 first strike
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Pearled Unicorn"); // 2/2
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Serra Angel"); // 4/4 vigilance
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Runeclaw Bear"); // 2/2
|
||||
addCard(Zone.LIBRARY, playerA, "Island", 2); // used for draw trigger
|
||||
|
||||
attack(1, playerA, "Elvish Archers");
|
||||
attack(1, playerA, "Pearled Unicorn");
|
||||
block(1, playerB, "Serra Angel", "Elvish Archers"); // Elvish Achers will die and trigger KM
|
||||
block(1, playerB, "Runeclaw Bear", "Pearled Unicorn"); // Pearled Unicorn will die but not trigger KM
|
||||
|
||||
setChoice(playerA, "Yes"); // accept the drawing of a card from the single trigger (Elvish Archers "elf type")
|
||||
|
||||
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerA, "Elvish Archers", 1);
|
||||
assertGraveyardCount(playerA, "Pearled Unicorn", 1);
|
||||
|
||||
// successful fire due to dead Elvish Archers (elf) so playerA draws a card
|
||||
assertHandCount(playerA, 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,68 +1,68 @@
|
|||
package org.mage.test.cards.triggers.dies;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class AshenRiderTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
* Volrath, the Shapestealer and Ashen Rider, Ashen Rider has a counter on it:
|
||||
Turn Volrath into Ashen Rider:
|
||||
Destroy the Volrath (who's the Ashen Rider) with Putrefy:
|
||||
The death trigger for the Volrath copying Ashen Rider did not trigger.
|
||||
*/
|
||||
@Test
|
||||
public void cartelAristrocraftInteractionOpponentDoesNotPayLife() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
|
||||
// Flying
|
||||
// When Ashen Rider enters the battlefield or dies, exile target permanent.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Ashen Rider"); // Creature {4}{W}{W}{B}{B}
|
||||
|
||||
// At the beginning of combat on your turn, put a -1/-1 counter on up to one target creature.
|
||||
// {1}: Until your next turn, Volrath, the Shapestealer becomes a copy of target creature with a counter on it, except it's 7/5 and it has this ability.
|
||||
addCard(Zone.HAND, playerA, "Volrath, the Shapestealer"); // Creature {2}{B}{G}{U}
|
||||
addTarget(playerA, "Ashen Rider");
|
||||
|
||||
// Destroy target artifact or creature. It can't be regenerated.
|
||||
addCard(Zone.HAND, playerA, "Putrefy"); // Instant {1}{B}{G}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volrath, the Shapestealer");
|
||||
|
||||
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: Until your next turn");
|
||||
addTarget(playerA, "Ashen Rider");
|
||||
|
||||
waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Putrefy", "Ashen Rider[only copy]");
|
||||
|
||||
addTarget(playerA, "Silvercoat Lion"); // Dies trigger of Volrath, the Shapestealer copied from Ashen Rider
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, "Ashen Rider", 4,4);
|
||||
|
||||
assertGraveyardCount(playerA, "Putrefy", 1);
|
||||
assertGraveyardCount(playerA, "Volrath, the Shapestealer", 1);
|
||||
|
||||
assertExileCount(playerB, "Silvercoat Lion", 1);
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.cards.triggers.dies;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class AshenRiderTest extends CardTestPlayerBase {
|
||||
|
||||
/*
|
||||
* Volrath, the Shapestealer and Ashen Rider, Ashen Rider has a counter on it:
|
||||
Turn Volrath into Ashen Rider:
|
||||
Destroy the Volrath (who's the Ashen Rider) with Putrefy:
|
||||
The death trigger for the Volrath copying Ashen Rider did not trigger.
|
||||
*/
|
||||
@Test
|
||||
public void cartelAristrocraftInteractionOpponentDoesNotPayLife() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
|
||||
// Flying
|
||||
// When Ashen Rider enters the battlefield or dies, exile target permanent.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Ashen Rider"); // Creature {4}{W}{W}{B}{B}
|
||||
|
||||
// At the beginning of combat on your turn, put a -1/-1 counter on up to one target creature.
|
||||
// {1}: Until your next turn, Volrath, the Shapestealer becomes a copy of target creature with a counter on it, except it's 7/5 and it has this ability.
|
||||
addCard(Zone.HAND, playerA, "Volrath, the Shapestealer"); // Creature {2}{B}{G}{U}
|
||||
addTarget(playerA, "Ashen Rider");
|
||||
|
||||
// Destroy target artifact or creature. It can't be regenerated.
|
||||
addCard(Zone.HAND, playerA, "Putrefy"); // Instant {1}{B}{G}
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volrath, the Shapestealer");
|
||||
|
||||
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}: Until your next turn");
|
||||
addTarget(playerA, "Ashen Rider");
|
||||
|
||||
waitStackResolved(3, PhaseStep.PRECOMBAT_MAIN);
|
||||
|
||||
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Putrefy", "Ashen Rider[only copy]");
|
||||
|
||||
addTarget(playerA, "Silvercoat Lion"); // Dies trigger of Volrath, the Shapestealer copied from Ashen Rider
|
||||
|
||||
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPowerToughness(playerA, "Ashen Rider", 4,4);
|
||||
|
||||
assertGraveyardCount(playerA, "Putrefy", 1);
|
||||
assertGraveyardCount(playerA, "Volrath, the Shapestealer", 1);
|
||||
|
||||
assertExileCount(playerB, "Silvercoat Lion", 1);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,122 +1,122 @@
|
|||
package org.mage.test.commander.duel;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameException;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CommanderColorChangeTest extends CardTestCommanderDuelBase {
|
||||
|
||||
@Override
|
||||
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary. Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
setDecknamePlayerA("CMDNorinTheWary.dck"); // Commander = Norin the Wary {R}
|
||||
return super.createNewGameAndPlayers();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void castCommanderWithAddedBlueColor() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// As Painter's Servant enters the battlefield, choose a color.
|
||||
// All cards that aren't on the battlefield, spells, and permanents are the chosen color in addition to their other colors.
|
||||
addCard(Zone.HAND, playerA, "Painter's Servant", 1); // Artifact Creature {2}
|
||||
|
||||
// Whenever a player casts a blue spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kraken's Eye", 1);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant");
|
||||
setChoice(playerA, "Blue");
|
||||
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary.
|
||||
// Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Norin the Wary", 1);
|
||||
|
||||
Permanent norin = getPermanent("Norin the Wary", playerA);
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isBlue());
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isRed());
|
||||
|
||||
Permanent kraken = getPermanent("Kraken's Eye", playerA);
|
||||
Assert.assertEquals(true, kraken.getColor(currentGame).isBlue());
|
||||
|
||||
assertLife(playerA, 41);
|
||||
assertLife(playerB, 40);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* I played a Painter's Servant, named black, but the other commanders get a extra colors
|
||||
* Later it got removed but the commanders and some cards still have the extra color
|
||||
* I played it again later, named green, and the previously affected cards get the extra color
|
||||
* so now they have 2 extra colors and the commander get and additional color on top of that
|
||||
* And finally I got the empty hand error #6738 on my turn for what I assume is the Painter's Servant + Grindstone combo I have,
|
||||
* but nonetheless manage to tie the game so it go into a second game and the issue carry over,
|
||||
* all the commanders have all the extra colors they gain from the first game
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void castCommanderWithoutAddedBlueColor() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// As Painter's Servant enters the battlefield, choose a color.
|
||||
// All cards that aren't on the battlefield, spells, and permanents are the chosen color in addition to their other colors.
|
||||
addCard(Zone.HAND, playerA, "Painter's Servant", 1); // Artifact Creature {2}
|
||||
|
||||
// Whenever a player casts a blue spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kraken's Eye", 1);
|
||||
|
||||
|
||||
// Exile target artifact or enchantment.
|
||||
addCard(Zone.HAND, playerB, "Altar's Light", 1); // Instant {2}{W}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant");
|
||||
setChoice(playerA, "Blue");
|
||||
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary.
|
||||
// Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Altar's Light", "Painter's Servant", "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Norin the Wary", 1);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
Permanent norin = getPermanent("Norin the Wary", playerA);
|
||||
Assert.assertEquals(false, norin.getColor(currentGame).isBlue());
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isRed());
|
||||
|
||||
Permanent kraken = getPermanent("Kraken's Eye", playerA);
|
||||
Assert.assertEquals(false, kraken.getColor(currentGame).isBlue());
|
||||
|
||||
assertLife(playerA, 42);
|
||||
assertLife(playerB, 40);
|
||||
|
||||
}
|
||||
}
|
||||
package org.mage.test.commander.duel;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameException;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CommanderColorChangeTest extends CardTestCommanderDuelBase {
|
||||
|
||||
@Override
|
||||
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary. Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
setDecknamePlayerA("CMDNorinTheWary.dck"); // Commander = Norin the Wary {R}
|
||||
return super.createNewGameAndPlayers();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void castCommanderWithAddedBlueColor() {
|
||||
setStrictChooseMode(true);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// As Painter's Servant enters the battlefield, choose a color.
|
||||
// All cards that aren't on the battlefield, spells, and permanents are the chosen color in addition to their other colors.
|
||||
addCard(Zone.HAND, playerA, "Painter's Servant", 1); // Artifact Creature {2}
|
||||
|
||||
// Whenever a player casts a blue spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kraken's Eye", 1);
|
||||
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant");
|
||||
setChoice(playerA, "Blue");
|
||||
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary.
|
||||
// Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, "Norin the Wary", 1);
|
||||
|
||||
Permanent norin = getPermanent("Norin the Wary", playerA);
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isBlue());
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isRed());
|
||||
|
||||
Permanent kraken = getPermanent("Kraken's Eye", playerA);
|
||||
Assert.assertEquals(true, kraken.getColor(currentGame).isBlue());
|
||||
|
||||
assertLife(playerA, 41);
|
||||
assertLife(playerB, 40);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* I played a Painter's Servant, named black, but the other commanders get a extra colors
|
||||
* Later it got removed but the commanders and some cards still have the extra color
|
||||
* I played it again later, named green, and the previously affected cards get the extra color
|
||||
* so now they have 2 extra colors and the commander get and additional color on top of that
|
||||
* And finally I got the empty hand error #6738 on my turn for what I assume is the Painter's Servant + Grindstone combo I have,
|
||||
* but nonetheless manage to tie the game so it go into a second game and the issue carry over,
|
||||
* all the commanders have all the extra colors they gain from the first game
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void castCommanderWithoutAddedBlueColor() {
|
||||
setStrictChooseMode(true);
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// As Painter's Servant enters the battlefield, choose a color.
|
||||
// All cards that aren't on the battlefield, spells, and permanents are the chosen color in addition to their other colors.
|
||||
addCard(Zone.HAND, playerA, "Painter's Servant", 1); // Artifact Creature {2}
|
||||
|
||||
// Whenever a player casts a blue spell, you may gain 1 life.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kraken's Eye", 1);
|
||||
|
||||
|
||||
// Exile target artifact or enchantment.
|
||||
addCard(Zone.HAND, playerB, "Altar's Light", 1); // Instant {2}{W}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Painter's Servant");
|
||||
setChoice(playerA, "Blue");
|
||||
|
||||
// When a player casts a spell or a creature attacks, exile Norin the Wary.
|
||||
// Return it to the battlefield under its owner's control at the beginning of the next end step.
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Altar's Light", "Painter's Servant", "Norin the Wary");
|
||||
setChoice(playerA, true); // Whenever a player casts a blue spell, you may gain 1 life. Choices: Yes - No
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Norin the Wary", 1);
|
||||
assertAllCommandsUsed();
|
||||
|
||||
Permanent norin = getPermanent("Norin the Wary", playerA);
|
||||
Assert.assertEquals(false, norin.getColor(currentGame).isBlue());
|
||||
Assert.assertEquals(true, norin.getColor(currentGame).isRed());
|
||||
|
||||
Permanent kraken = getPermanent("Kraken's Eye", playerA);
|
||||
Assert.assertEquals(false, kraken.getColor(currentGame).isBlue());
|
||||
|
||||
assertLife(playerA, 42);
|
||||
assertLife(playerB, 40);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue