use of mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect in project mage by magefree.
the class CustomTestCard method addCustomEffect_SpellCostModification.
/**
* Add cost modification effect to the game (all cast cost will be increaded or decreased for controller)
*
* @param controller
* @param modificationAmount
*/
protected void addCustomEffect_SpellCostModification(TestPlayer controller, int modificationAmount) {
Effect effect;
if (modificationAmount >= 0) {
effect = new SpellsCostIncreasingAllEffect(modificationAmount, StaticFilters.FILTER_CARD, TargetController.YOU);
} else {
effect = new SpellsCostReductionAllEffect(StaticFilters.FILTER_CARD, -1 * modificationAmount, false, true);
}
addCustomCardWithAbility("cost modification " + controller.getName(), controller, new SimpleStaticAbility(effect));
}
use of mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect 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