Added a test for storm with flashback.

This commit is contained in:
LevelX2 2015-07-15 16:54:31 +02:00
parent 635c33fa87
commit 3bac7b550c

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.PhaseStep; import mage.constants.PhaseStep;
@ -41,23 +40,20 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
public class StormTest extends CardTestPlayerBase { public class StormTest extends CardTestPlayerBase {
/** /**
* 702.39. Storm * 702.39. Storm 702.39a Storm is a triggered ability that functions on the
* 702.39a Storm is a triggered ability that functions on the stack. Storm means When you cast this * stack. Storm means When you cast this spell, put a copy of it onto the
* spell, put a copy of it onto the stack for each other spell that was cast before it this turn. If the * stack for each other spell that was cast before it this turn. If the
* spell has any targets, you may choose new targets for any of the copies. * spell has any targets, you may choose new targets for any of the copies.
* 702.39b If a spell has multiple instances of storm, each triggers separately. * 702.39b If a spell has multiple instances of storm, each triggers
* separately.
* *
*/ */
/** /**
* Grapeshot * Grapeshot Sorcery, 1R (2) Grapeshot deals 1 damage to target creature or
* Sorcery, 1R (2) * player. Storm (When you cast this spell, copy it for each spell cast
* Grapeshot deals 1 damage to target creature or player. * before it this turn. You may choose new targets for the copies.)
* Storm (When you cast this spell, copy it for each spell cast before it
* this turn. You may choose new targets for the copies.)
* *
*/ */
@Test @Test
public void testStorm1x() { public void testStorm1x() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
@ -138,11 +134,11 @@ public class StormTest extends CardTestPlayerBase {
} }
/** /**
* If a spell with storm gets countered, the strom trigger is also stifled, which isn't how its supposed to work. * If a spell with storm gets countered, the strom trigger is also stifled,
* For example a Chalic of the Void set to 1 counters Flusterstorm and also counters the storm trigger, which shouldn't happen * which isn't how its supposed to work. For example a Chalic of the Void
* set to 1 counters Flusterstorm and also counters the storm trigger, which
* shouldn't happen
*/ */
@Test @Test
public void testStormSpellCountered() { public void testStormSpellCountered() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
@ -166,7 +162,8 @@ public class StormTest extends CardTestPlayerBase {
} }
/** /**
* I provide a game log fo the issue with storm mentioned earlier. I guess Pyromancer Ascension is a culprit. * I provide a game log fo the issue with storm mentioned earlier. I guess
* Pyromancer Ascension is a culprit.
* *
* *
*/ */
@ -199,4 +196,39 @@ public class StormTest extends CardTestPlayerBase {
assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2); assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2);
assertLife(playerB, 8); // 6 from the Shocks + 5 from Grapeshot + 1 from Pyromancer Ascencsion copy assertLife(playerB, 8); // 6 from the Shocks + 5 from Grapeshot + 1 from Pyromancer Ascencsion copy
} }
/**
* I provide a game log fo the issue with storm mentioned earlier. I guess
* Pyromancer Ascension is a culprit.
*
*
*/
@Test
public void testStormAndFlshback() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 8);
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
// Geistflame deals 1 damage to target creature or player.
// Flashback {3}{R} (You may cast this card from your graveyard for its flashback cost. Then exile it.)
addCard(Zone.HAND, playerA, "Geistflame", 2); // {R}
addCard(Zone.LIBRARY, playerA, "Grapeshot", 2);
skipInitShuffling();
// Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
addCard(Zone.HAND, playerA, "Sleight of Hand");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sleight of Hand");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Geistflame", playerB);
activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Flashback {3}{R}");
addTarget(playerA, playerB);
castSpell(1, PhaseStep.END_COMBAT, playerA, "Geistflame", playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grapeshot", playerB);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertExileCount("Geistflame", 1);
assertGraveyardCount(playerA, "Geistflame", 1);
assertGraveyardCount(playerA, "Grapeshot", 1);
assertLife(playerB, 12); // 3 from the Geistflame + 5 from Grapeshot
}
} }