* Added a bestow test.

This commit is contained in:
LevelX2 2015-07-02 21:53:28 +02:00
parent 7375ba2819
commit 7b4f2dd33a

View file

@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed * authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com. * or implied, of BetaSteward_at_googlemail.com.
*/ */
package org.mage.test.cards.abilities.keywords; package org.mage.test.cards.abilities.keywords;
import mage.constants.CardType; import mage.constants.CardType;
@ -44,9 +43,9 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
public class BestowTest extends CardTestPlayerBase { public class BestowTest extends CardTestPlayerBase {
/** /**
* Tests that if from bestow permanent targeted creature * Tests that if from bestow permanent targeted creature gets protection
* gets protection from the color of the bestow permanent, * from the color of the bestow permanent, the bestow permanent becomes a
* the bestow permanent becomes a creature on the battlefield. * creature on the battlefield.
* *
*/ */
@ -67,7 +66,6 @@ public class BestowTest extends CardTestPlayerBase {
* Scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.) * Scry 1. (Look at the top card of your library. You may put that card on the bottom of your library.)
* *
*/ */
@Test @Test
public void bestowEnchantmentToCreature() { public void bestowEnchantmentToCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 5); addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
@ -97,7 +95,7 @@ public class BestowTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); addCard(Zone.BATTLEFIELD, playerA, "Forest", 6);
// Creature - Giant 3/5 // Creature - Giant 3/5
addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan"); addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan");
addCard(Zone.HAND, playerA, "Experiment One"); addCard(Zone.HAND, playerA, "Experiment One");
// Enchanted creature gets +4/+2. // Enchanted creature gets +4/+2.
addCard(Zone.HAND, playerA, "Boon Satyr"); addCard(Zone.HAND, playerA, "Boon Satyr");
@ -111,26 +109,27 @@ public class BestowTest extends CardTestPlayerBase {
// because Boon Satyr is no creature on the battlefield, evolve may not trigger // because Boon Satyr is no creature on the battlefield, evolve may not trigger
assertPermanentCount(playerA, "Boon Satyr", 1); assertPermanentCount(playerA, "Boon Satyr", 1);
Permanent boonSatyr = getPermanent("Boon Satyr", playerA); Permanent boonSatyr = getPermanent("Boon Satyr", playerA);
Assert.assertTrue("Boon Satyr may not be a creature",!boonSatyr.getCardType().contains(CardType.CREATURE)); Assert.assertTrue("Boon Satyr may not be a creature", !boonSatyr.getCardType().contains(CardType.CREATURE));
assertPermanentCount(playerA, "Silent Artisan", 1); assertPermanentCount(playerA, "Silent Artisan", 1);
assertPermanentCount(playerA, "Experiment One", 1); assertPermanentCount(playerA, "Experiment One", 1);
assertPowerToughness(playerA, "Experiment One", 1, 1); assertPowerToughness(playerA, "Experiment One", 1, 1);
assertPowerToughness(playerA, "Silent Artisan", 7, 7); assertPowerToughness(playerA, "Silent Artisan", 7, 7);
} }
/** /**
* Test that the bestow enchantment becomes a creature if the enchanted creature dies * Test that the bestow enchantment becomes a creature if the enchanted
* creature dies
*/ */
@Test @Test
public void bestowEnchantmentBecomesCreature() { public void bestowEnchantmentBecomesCreature() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion");
addCard(Zone.HAND, playerA, "Hopeful Eidolon"); addCard(Zone.HAND, playerA, "Hopeful Eidolon");
addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1); addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt"); addCard(Zone.HAND, playerB, "Lightning Bolt");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silvercoat Lion"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Hopeful Eidolon using bestow", "Silvercoat Lion");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", "Silvercoat Lion");
@ -140,7 +139,7 @@ public class BestowTest extends CardTestPlayerBase {
// because Boon Satyr is no creature on the battlefield, evolve may not trigger // because Boon Satyr is no creature on the battlefield, evolve may not trigger
assertLife(playerA, 20); assertLife(playerA, 20);
assertLife(playerB, 20); assertLife(playerB, 20);
assertPermanentCount(playerA, "Silvercoat Lion", 0); assertPermanentCount(playerA, "Silvercoat Lion", 0);
assertPermanentCount(playerA, "Hopeful Eidolon", 1); assertPermanentCount(playerA, "Hopeful Eidolon", 1);
assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1); assertPowerToughness(playerA, "Hopeful Eidolon", 1, 1);
@ -149,23 +148,23 @@ public class BestowTest extends CardTestPlayerBase {
Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.getCardType().contains(CardType.CREATURE)); Assert.assertTrue("Hopeful Eidolon has to be a creature but is not", hopefulEidolon.getCardType().contains(CardType.CREATURE));
Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.getCardType().contains(CardType.ENCHANTMENT)); Assert.assertTrue("Hopeful Eidolon has to be an enchantment but is not", hopefulEidolon.getCardType().contains(CardType.ENCHANTMENT));
} }
/** /**
* Test that card cast with bestow will not be tapped, if creatures come into play tapped * Test that card cast with bestow will not be tapped, if creatures come
* into play tapped
*/ */
@Test @Test
public void bestowEnchantmentWillNotBeTapped() { public void bestowEnchantmentWillNotBeTapped() {
addCard(Zone.BATTLEFIELD, playerA, "Forest", 6); addCard(Zone.BATTLEFIELD, playerA, "Forest", 6);
addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan"); addCard(Zone.BATTLEFIELD, playerA, "Silent Artisan");
addCard(Zone.HAND, playerA, "Boon Satyr"); addCard(Zone.HAND, playerA, "Boon Satyr");
// Enchantment {1}{W} // Enchantment {1}{W}
// Creatures your opponents control enter the battlefield tapped. // Creatures your opponents control enter the battlefield tapped.
addCard(Zone.BATTLEFIELD, playerB, "Imposing Sovereign"); addCard(Zone.BATTLEFIELD, playerB, "Imposing Sovereign");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Boon Satyr using bestow", "Silent Artisan");
setStopAt(1, PhaseStep.END_TURN); setStopAt(1, PhaseStep.END_TURN);
@ -176,34 +175,32 @@ public class BestowTest extends CardTestPlayerBase {
assertPowerToughness(playerA, "Silent Artisan", 7, 7); assertPowerToughness(playerA, "Silent Artisan", 7, 7);
// because cast with bestow, Boon Satyr may not be tapped // because cast with bestow, Boon Satyr may not be tapped
assertTapped("Boon Satyr", false); assertTapped("Boon Satyr", false);
} }
/** /**
* If I have a bestowed creature on the battlefield and my opponent uses Far // Away casting * If I have a bestowed creature on the battlefield and my opponent uses Far
* both sides, will the creature that has bestow come in time for it to be sacrificed or does * // Away casting both sides, will the creature that has bestow come in
* it fully resolve before the creature comes in? * time for it to be sacrificed or does it fully resolve before the creature
* * comes in?
*
* Bestowed creature can be used to sacrifice a creature for the Away part. * Bestowed creature can be used to sacrifice a creature for the Away part.
* http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/513828-bestow-far-away * http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/513828-bestow-far-away
*/ */
@Test @Test
@Ignore // Handling of targets of Fused spells is not handled yet in TestPlayer class @Ignore // Handling of targets of Fused spells is not handled yet in TestPlayer class
public void bestowWithFusedSpell() { public void bestowWithFusedSpell() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
/** /**
* Cyclops of One-Eyed Pass {2}{R}{R} * Cyclops of One-Eyed Pass {2}{R}{R} Creature - Cyclops 5/2
* Creature - Cyclops
* 5/2
*/ */
addCard(Zone.BATTLEFIELD, playerA, "Cyclops of One-Eyed Pass"); addCard(Zone.BATTLEFIELD, playerA, "Cyclops of One-Eyed Pass");
/** /**
* Nyxborn Rollicker {R} * Nyxborn Rollicker {R} Enchantment Creature - Satyr 1/1 Bestow {1}{R}
* Enchantment Creature - Satyr * (If you cast this card for its bestow cost, it's an Aura spell with
* 1/1 * enchant creature. It becomes a creature again if it's not attached to
* Bestow {1}{R} (If you cast this card for its bestow cost, it's an Aura spell with enchant creature. It becomes a creature again if it's not attached to a creature.) * a creature.) Enchanted creature gets +1/+1.
* Enchanted creature gets +1/+1.
*/ */
addCard(Zone.HAND, playerA, "Nyxborn Rollicker"); addCard(Zone.HAND, playerA, "Nyxborn Rollicker");
@ -211,18 +208,14 @@ public class BestowTest extends CardTestPlayerBase {
addCard(Zone.BATTLEFIELD, playerB, "Island", 2); addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
/** /**
* Far {1}{U} * Far {1}{U} Instant Return target creature to its owner's hand. Away
* Instant * {2}{B} Instant Target player sacrifices a creature. Fuse (You may
* Return target creature to its owner's hand. * cast one or both halves of this card from your hand.)
* Away {2}{B} */
* Instant
* Target player sacrifices a creature.
* Fuse (You may cast one or both halves of this card from your hand.)
*/
addCard(Zone.HAND, playerB, "Far // Away"); addCard(Zone.HAND, playerB, "Far // Away");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nyxborn Rollicker using bestow", "Cyclops of One-Eyed Pass"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nyxborn Rollicker using bestow", "Cyclops of One-Eyed Pass");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "fused Far // Away", "Cyclops of One-Eyed Pass^targetPlayer=PlayerA"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "fused Far // Away", "Cyclops of One-Eyed Pass^targetPlayer=PlayerA");
playerA.addTarget("Nyxborn Rollicker"); playerA.addTarget("Nyxborn Rollicker");
@ -231,18 +224,18 @@ public class BestowTest extends CardTestPlayerBase {
assertHandCount(playerA, 0); assertHandCount(playerA, 0);
assertHandCount(playerB, 0); assertHandCount(playerB, 0);
assertGraveyardCount(playerB, "Far // Away", 1); assertGraveyardCount(playerB, "Far // Away", 1);
assertPermanentCount(playerA, "Nyxborn Rollicker", 0); assertPermanentCount(playerA, "Nyxborn Rollicker", 0);
assertGraveyardCount(playerA, "Nyxborn Rollicker", 1); assertGraveyardCount(playerA, "Nyxborn Rollicker", 1);
} }
/** /**
* Test that CMC of a spell cast with bestowed is correct * Test that CMC of a spell cast with bestowed is correct Disdainful Stroke
* Disdainful Stroke doesn't check converted mana cost correctly. Opponent was * doesn't check converted mana cost correctly. Opponent was able to use it
* able to use it to counter a Hypnotic Siren cast with Bestow. * to counter a Hypnotic Siren cast with Bestow.
*/ */
@Test @Test
public void bestowCheckForCorrectCMC() { public void bestowCheckForCorrectCMC() {
@ -275,14 +268,14 @@ public class BestowTest extends CardTestPlayerBase {
// because cast with bestow, Boon Satyr may not be tapped // because cast with bestow, Boon Satyr may not be tapped
assertPermanentCount(playerA, "Silvercoat Lion", 1); assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertPowerToughness(playerA, "Silvercoat Lion", 3,3); assertPowerToughness(playerA, "Silvercoat Lion", 3, 3);
} }
/** /**
* *
* *
* *
*/ */
@Test @Test
public void bestowMogissWarhound() { public void bestowMogissWarhound() {
@ -311,5 +304,60 @@ public class BestowTest extends CardTestPlayerBase {
assertPermanentCount(playerA, "Mogis's Warhound", 1); assertPermanentCount(playerA, "Mogis's Warhound", 1);
assertGraveyardCount(playerA, "Silvercoat Lion", 1); assertGraveyardCount(playerA, "Silvercoat Lion", 1);
} }
/*
* Bug with the Nighthowler Card. Card does sometimes not get a creature
* after Bestow.
Steps:
1) Cast any creature
2) Cast Nightowler using Bestow on that creature
3) Make sure creature is tapped
4) Opponent uses any spell that kills creature which is bestowed by nighthowler
5) Result: Nighthowler is still on the field, but is no creature (no Power/Toughness)
Expected:Nighthowler gets on field as a creature
Important: This happens ONLY if the creature is killed with a spell when
its TAPPED!
*/
@Test
public void bestowNighthowlerTest() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// Instant - {2}{R}{R}
// Chandra's Outrage deals 4 damage to target creature and 2 damage to that creature's controller.
addCard(Zone.HAND, playerA, "Chandra's Outrage");
// Enchantment Creature Horror
// 0/0
// Bestow {2}{B}{B}
// Nighthowler and enchanted creature each get +X/+X, where X is the number of creature cards in all graveyards.
addCard(Zone.HAND, playerB, "Nighthowler");
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 4);
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
addCard(Zone.GRAVEYARD, playerB, "Pillarfield Ox");
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Nighthowler using bestow", "Silvercoat Lion");
attack(2, playerB, "Silvercoat Lion");
castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerA, "Chandra's Outrage", "Silvercoat Lion");
setStopAt(2, PhaseStep.END_TURN);
execute();
assertLife(playerB, 18); // -2 from Chandra's Outrage
assertLife(playerA, 17); // -3 from attack Nighthowler
assertGraveyardCount(playerA, "Chandra's Outrage", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertPermanentCount(playerB, "Nighthowler", 1);
assertPowerToughness(playerB, "Nighthowler", 2, 2);
Permanent nighthowler = getPermanent("Nighthowler", playerB);
Assert.assertEquals("Nighthowler has to be a creature", true, nighthowler.getCardType().contains(CardType.CREATURE));
}
} }