mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
Additional tests for morph and #6680
This commit is contained in:
parent
75220caf0f
commit
5ae041f39a
5 changed files with 235 additions and 77 deletions
|
|
@ -1065,4 +1065,50 @@ public class MorphTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_MorphWithCostReductionMustBePlayable_NormalCondition() {
|
||||
// {1}{U} creature
|
||||
// Morph {1}{U} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)
|
||||
// When Willbender is turned face up, change the target of target spell or ability with a single target.
|
||||
addCard(Zone.HAND, playerA, "Willbender");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
//
|
||||
// Creature spells you cast cost {1} less to cast.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Nylea, Keen-Eyed");
|
||||
|
||||
checkPlayableAbility("can", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Willbender", true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Willbender");
|
||||
setChoice(playerA, "Yes"); // morph
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_MorphWithCostReductionMustBePlayable_MorphCondition() {
|
||||
// {1}{U} creature
|
||||
// Morph {1}{U} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)
|
||||
// When Willbender is turned face up, change the target of target spell or ability with a single target.
|
||||
addCard(Zone.HAND, playerA, "Willbender");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
//
|
||||
// Face-down creature spells you cast cost {1} less to cast.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Dream Chisel");
|
||||
|
||||
checkPlayableAbility("can", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Willbender", true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Willbender");
|
||||
setChoice(playerA, "Yes"); // morph
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertPermanentCount(playerA, EmptyNames.FACE_DOWN_CREATURE.toString(), 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
|
||||
package org.mage.test.cards.cost.alternate;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class UseAlternateSourceCostsTest extends CardTestPlayerBase {
|
||||
|
|
@ -75,4 +74,85 @@ public class UseAlternateSourceCostsTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Gray Ogre", 1);
|
||||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_Playable_WithMana() {
|
||||
// {1}{W}{W} instant
|
||||
// You may discard a Plains card rather than pay Abolish's mana cost.
|
||||
// Destroy target artifact or enchantment.
|
||||
addCard(Zone.HAND, playerA, "Abolish");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.HAND, playerA, "Plains", 1); // discard cost
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Alpha Myr");
|
||||
|
||||
checkPlayableAbility("can", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Abolish", true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Abolish", "Alpha Myr");
|
||||
setChoice(playerA, "Yes"); // use alternative cost
|
||||
setChoice(playerA, "Plains");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Alpha Myr", 1);
|
||||
assertTappedCount("Plains", false, 3); // must discard 1 instead tap
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_Playable_WithoutMana() {
|
||||
// {1}{W}{W} instant
|
||||
// You may discard a Plains card rather than pay Abolish's mana cost.
|
||||
// Destroy target artifact or enchantment.
|
||||
addCard(Zone.HAND, playerA, "Abolish");
|
||||
//addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.HAND, playerA, "Plains", 1); // discard cost
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Alpha Myr");
|
||||
|
||||
checkPlayableAbility("can", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Abolish", true);
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Abolish", "Alpha Myr");
|
||||
setChoice(playerA, "Yes"); // use alternative cost
|
||||
setChoice(playerA, "Plains");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Alpha Myr", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_Playable_WithoutManaAndCost() {
|
||||
// {1}{W}{W} instant
|
||||
// You may discard a Plains card rather than pay Abolish's mana cost.
|
||||
// Destroy target artifact or enchantment.
|
||||
addCard(Zone.HAND, playerA, "Abolish");
|
||||
//addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
//addCard(Zone.HAND, playerA, "Plains", 1); // discard cost
|
||||
//
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Alpha Myr");
|
||||
|
||||
// can't see as playable (no mana for normal, no discard for alternative)
|
||||
checkPlayableAbility("can't", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cast Abolish", false);
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore // TODO: make test to check combo of alternative cost and cost reduction effects
|
||||
public void test_Playable_WithCostReduction() {
|
||||
addCard(Zone.HAND, playerA, "xxx");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
package org.mage.test.cards.cost.modification;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class CostReduceWithConditionTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void test_PriceOfFame_Normal() {
|
||||
// {3}{B}
|
||||
// This spell costs {2} less to cast if it targets a legendary creature.
|
||||
// Destroy target creature.
|
||||
addCard(Zone.HAND, playerA, "Price of Fame", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Balduvian Bears", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Price of Fame", "Balduvian Bears");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Balduvian Bears", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
// TODO: implement workaround like putToStackAsNonPlayable for abilities, see https://github.com/magefree/mage/issues/6685
|
||||
public void test_PriceOfFame_Reduce() {
|
||||
// {3}{B}
|
||||
// This spell costs {2} less to cast if it targets a legendary creature.
|
||||
// Destroy target creature.
|
||||
addCard(Zone.HAND, playerA, "Price of Fame", 1);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4 - 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Anje Falkenrath", 1);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Price of Fame", "Anje Falkenrath");
|
||||
|
||||
setStrictChooseMode(true);
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
assertAllCommandsUsed();
|
||||
|
||||
assertGraveyardCount(playerB, "Anje Falkenrath", 1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue