* Reworked flashback ability (fixes #4482 #3324 #215 #3435 #3883 #3337 #2183 #2447).

This commit is contained in:
LevelX2 2018-02-18 02:52:16 +01:00
parent 2e827a50ec
commit d80d588963
9 changed files with 107 additions and 122 deletions

View file

@ -27,9 +27,9 @@
*/
package org.mage.test.cards.abilities.keywords;
import mage.abilities.keyword.TrampleAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -39,6 +39,27 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*/
public class FlashbackTest extends CardTestPlayerBase {
@Test
public void testNormalWildHunger() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
// Target creature gets +3/+1 and gains trample until end of turn.
// Flashback {3}{R}
addCard(Zone.GRAVEYARD, playerA, "Wild Hunger");
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flashback", "Silvercoat Lion");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertPowerToughness(playerA, "Silvercoat Lion", 5, 3);
assertAbility(playerA, "Silvercoat Lion", TrampleAbility.getInstance(), true);
assertExileCount("Wild Hunger", 1);
}
/**
* Fracturing Gust is bugged. In a match against Affinity, it worked
* properly when cast from hand. When I cast it from graveyard c/o
@ -219,7 +240,7 @@ public class FlashbackTest extends CardTestPlayerBase {
// Conflagrate deals X damage divided as you choose among any number of target creatures and/or players.
// Flashback-{R}{R}, Discard X cards.
addCard(Zone.HAND, playerA, "Conflagrate", 1);
addCard(Zone.HAND, playerA, "Conflagrate", 1); // Sorcery {X}{X}{R}
addCard(Zone.HAND, playerA, "Forest", 4);
@ -307,20 +328,26 @@ public class FlashbackTest extends CardTestPlayerBase {
public void testAltarsReap() {
addCard(Zone.LIBRARY, playerA, "Island", 2);
addCard(Zone.GRAVEYARD, playerA, "Altar's Reap", 1);
// As an additional cost to cast Altar's Reap, sacrifice a creature.
// Draw two cards.
addCard(Zone.GRAVEYARD, playerA, "Altar's Reap", 1); // Instant {1}{B}
addCard(Zone.BATTLEFIELD, playerA, "Underground Sea", 4);
addCard(Zone.HAND, playerA, "Snapcaster Mage", 1);
// Flash
// When Snapcaster Mage enters the battlefield, target instant or sorcery card in your graveyard gains flashback until end of turn.
// The flashback cost is equal to its mana cost.
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
setChoice(playerA, "Altar's Reap");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {1}{B}");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback");
setChoice(playerA, "Snapcaster Mage");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Snapcaster Mage", 1);
assertExileCount(playerA, "Altar's Reap", 1);
}
/**
@ -520,7 +547,6 @@ public class FlashbackTest extends CardTestPlayerBase {
* to a spell, and the flashback cost is already an alternative cost.
*/
@Test
@Ignore
public void testSnapcasterMageSpellWithAlternateCost() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);