Skip to content

Commit

Permalink
Added a test for storm with flashback.
Browse files Browse the repository at this point in the history
  • Loading branch information
LevelX2 committed Jul 15, 2015
1 parent 635c33f commit 3bac7b5
Showing 1 changed file with 61 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/

package org.mage.test.cards.abilities.keywords;

import mage.constants.PhaseStep;
Expand All @@ -41,23 +40,20 @@
public class StormTest extends CardTestPlayerBase {

/**
* 702.39. Storm
* 702.39a Storm is a triggered ability that functions on the stack. “Storm” means “When you cast this
* spell, put a copy of it onto the stack for each other spell that was cast before it this turn. If the
* 702.39. Storm 702.39a Storm is a triggered ability that functions on the
* stack. “Storm” means “When you cast this spell, put a copy of it onto 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.”
* 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
* Sorcery, 1R (2)
* Grapeshot deals 1 damage to target creature or player.
* Storm (When you cast this spell, copy it for each spell cast before it
* this turn. You may choose new targets for the copies.)
*
* Grapeshot Sorcery, 1R (2) Grapeshot deals 1 damage to target creature or
* player. 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
public void testStorm1x() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
Expand Down Expand Up @@ -105,7 +101,7 @@ public void testStorm3x() {

assertLife(playerB, 7);
}

@Test
public void testStorm4x() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 6);
Expand All @@ -123,7 +119,7 @@ public void testStorm4x() {

assertLife(playerB, 3);
}

@Test
public void testNoStorm() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
Expand All @@ -136,13 +132,13 @@ public void testNoStorm() {

assertLife(playerB, 19);
}

/**
* If a spell with storm gets countered, the strom trigger is also stifled, 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
* If a spell with storm gets countered, the strom trigger is also stifled,
* 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
public void testStormSpellCountered() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
Expand All @@ -155,20 +151,21 @@ public void testStormSpellCountered() {
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);

castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grapeshot", playerB);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Counterspell", "Grapeshot");

setStopAt(1, PhaseStep.END_TURN);
execute();

assertLife(playerB, 16); // 3 (Lightning Bolt) + 1 from Storm copied Grapeshot
}

/**
* 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.
*
*
*/
@Test
public void testStormAndPyromancerAscension() {
Expand All @@ -178,7 +175,7 @@ public void testStormAndPyromancerAscension() {
// Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy.
addCard(Zone.BATTLEFIELD, playerA, "Pyromancer Ascension", 1);
// Grapeshot deals 1 damage to target creature or player. - Sorcery {1}{R}
// Storm (When you cast this spell, copy it for each spell cast 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.)
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.
Expand All @@ -198,5 +195,40 @@ public void testStormAndPyromancerAscension() {
assertGraveyardCount(playerA, "Grapeshot", 1);
assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2);
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
}

}

0 comments on commit 3bac7b5

Please sign in to comment.