* Flashback ability -- added support of additional cost like flashback with kicker combo (#5389);

This commit is contained in:
Oleg Agafonov 2019-06-17 15:03:37 +04:00
parent e39dc1124b
commit fe28c9c7d9
3 changed files with 123 additions and 8 deletions

View file

@ -0,0 +1,95 @@
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class KickerWithFlashbackTest extends CardTestPlayerBase {
// https://github.com/magefree/mage/issues/5389
// Burst Lightning {R}
// Kicker {4} (You may pay an additional {4} as you cast this spell.)
// Burst Lightning deals 2 damage to any target. If this spell was kicked, it deals 4 damage to that permanent or player instead.
// Snapcaster Mage {1}{U}
// 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. (You may cast that card from your graveyard for its flashback cost. Then exile it.)
@Test
public void test_SimpleKicker() {
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
addCard(Zone.HAND, playerA, "Burst Lightning");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Burst Lightning", playerB);
setChoice(playerA, "Yes"); // use kicker
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 4);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
@Test
public void test_SimpleFlashback() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.HAND, playerA, "Snapcaster Mage");
//
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.GRAVEYARD, playerA, "Lightning Bolt", 1);
// add flashback to bolt
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U}");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
addTarget(playerA, "Lightning Bolt");
// cast bolt by flashback
activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Flashback");
addTarget(playerA, playerB);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 3);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
@Test
public void test_KickerWithFlashback() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
addCard(Zone.HAND, playerA, "Snapcaster Mage");
//
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1 + 4);
addCard(Zone.GRAVEYARD, playerA, "Burst Lightning", 1);
// add flashback to burst
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U}");
activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {U}");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Snapcaster Mage");
addTarget(playerA, "Burst Lightning");
// cast burst by flashback
showAvaileableAbilities("after", 1, PhaseStep.BEGIN_COMBAT, playerA);
activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Flashback");
setChoice(playerA, "Yes"); // use kicker
addTarget(playerA, playerB);
checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 4);
setStopAt(1, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
}

View file

@ -835,7 +835,7 @@ public class TestPlayer implements Player {
return perm;
}
}
Assert.assertNotNull(action.getActionName() + " - can''t find permanent to check PT: " + cardName, founded);
Assert.assertNotNull(action.getActionName() + " - can''t find permanent to check: " + cardName, founded);
return null;
}