Ghostfire Blade - fixed that it can't be played without full available mana (#6698);

This commit is contained in:
Oleg Agafonov 2020-07-02 20:37:59 +04:00
parent 2a31e8063b
commit 6dccaee9a4
7 changed files with 127 additions and 48 deletions

View file

@ -0,0 +1,43 @@
package org.mage.test.cards.single;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class GhostfireBladeTest extends CardTestPlayerBase {
@Test
public void test_CanPlayWithCostReduce() {
// Equipped creature gets +2/+2.
// Equip {3}
// Ghostfire Blades equip ability costs {2} less to activate if it targets a colorless creature.
addCard(Zone.BATTLEFIELD, playerA, "Ghostfire Blade", 1);
//
addCard(Zone.HAND, playerA, "Alpha Myr", 1); // {2}, 2/1
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
checkPlayableAbility("can't play", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {3}", false);
// add creature and activate cost reduce
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Alpha Myr");
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
checkPlayableAbility("can't play wit no mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {3}", false); // no mana after creature cast
// can play on next turn
checkPlayableAbility("can play", 3, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {3}", true);
activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip {3}", "Alpha Myr");
setStopAt(3, PhaseStep.END_TURN);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
assertPowerToughness(playerA, "Alpha Myr", 2 + 2, 1 + 2);
}
}