use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalPreventionTest method test_PreventDamageConditionalActive.
@Test
public void test_PreventDamageConditionalActive() {
addCustomCardWithAbility("prevent", playerA, new SimpleStaticAbility(new ConditionalPreventionEffect(new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT), MyTurnCondition.instance, "")));
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Balduvian Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Balduvian Bears", 1);
assertHandCount(playerA, "Lightning Bolt", 0);
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalPreventionTest method test_PreventDamageNormal.
@Test
public void test_PreventDamageNormal() {
addCustomCardWithAbility("prevent", playerA, new SimpleStaticAbility(new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT)));
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Balduvian Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Balduvian Bears", 1);
assertHandCount(playerA, "Lightning Bolt", 0);
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalPreventionTest method test_PreventDamageConditionalNotActive.
@Test
public void test_PreventDamageConditionalNotActive() {
addCustomCardWithAbility("prevent", playerA, new SimpleStaticAbility(new ConditionalPreventionEffect(new PreventAllDamageToAllEffect(Duration.WhileOnBattlefield, StaticFilters.FILTER_PERMANENT), NotMyTurnCondition.instance, "")));
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Balduvian Bears");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Balduvian Bears", 0);
assertHandCount(playerA, "Lightning Bolt", 0);
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class EndOfTurnMultiOpponentsTest method test_UntilYourNextTurnMulti.
@Test
public void test_UntilYourNextTurnMulti() {
// Player order: A -> D -> C -> B
addCustomCardWithAbility("boost1", playerA, new SimpleStaticAbility(Zone.ALL, new BoostAllEffect(1, 1, Duration.UntilYourNextTurn)));
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 1, playerA, true, PhaseStep.END_TURN);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 2, playerD, true, PhaseStep.END_TURN);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 3, playerC, true, PhaseStep.END_TURN);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 4, playerB, true, PhaseStep.END_TURN);
//
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 5, playerA, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 6, playerD, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 7, playerC, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 8, playerB, true, null);
//
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 9, playerA, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 10, playerD, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 11, playerC, true, null);
EndOfTurnOneOpponentTest.prepareStepChecks(this, "Duration.UntilYourNextTurn effect", 12, playerB, true, null);
addCard(Zone.BATTLEFIELD, playerA, cardBear2, 1);
addCard(Zone.BATTLEFIELD, playerB, cardBear2, 1);
addCard(Zone.BATTLEFIELD, playerC, cardBear2, 1);
addCard(Zone.BATTLEFIELD, playerD, cardBear2, 1);
attack(1, playerA, cardBear2);
attack(2, playerD, cardBear2);
attack(3, playerC, cardBear2);
attack(4, playerB, cardBear2);
//
attack(5, playerA, cardBear2);
attack(6, playerD, cardBear2);
attack(7, playerC, cardBear2);
attack(8, playerB, cardBear2);
//
attack(9, playerA, cardBear2);
attack(10, playerD, cardBear2);
attack(11, playerC, cardBear2);
attack(12, playerB, cardBear2);
setStopAt(12, PhaseStep.CLEANUP);
setStrictChooseMode(true);
execute();
assertAllCommandsUsed();
}
use of mage.abilities.common.SimpleStaticAbility in project mage by magefree.
the class ConditionalCostModificationTest method test_ModificationConditionalNotActiveWithOtherEffect.
@Test
public void test_ModificationConditionalNotActiveWithOtherEffect() {
addCustomCardWithAbility("mod", playerA, new SimpleStaticAbility(new ConditionalCostModificationEffect(new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip"), NotMyTurnCondition.instance, new SpellsCostIncreasingAllEffect(1, new FilterCard(), TargetController.ANY), "")));
addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
addCard(Zone.BATTLEFIELD, playerA, "Dagger of the Worthy", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
// no mod, 2 cost
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
// +1 for spell, 2 cost
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", playerB);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertTappedCount("Mountain", true, 4);
assertTappedCount("Mountain", false, 0);
assertLife(playerB, 20 - 3);
}
Aggregations