use of mage.abilities.effects.common.cost.SpellsCostReductionAllEffect in project mage by magefree.
the class CheeringFanaticEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source);
String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY);
if (cardName == null) {
return false;
}
FilterCard filter = new FilterCard();
filter.add(new NamePredicate(cardName));
ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1);
effect.setDuration(Duration.EndOfTurn);
game.addEffect(effect, source);
return true;
}
use of mage.abilities.effects.common.cost.SpellsCostReductionAllEffect 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.SpellsCostReductionAllEffect in project mage by magefree.
the class WillKenrithCostReductionEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
SpellsCostReductionAllEffect effect = new SpellsCostReductionAllEffect(filter, 2);
effect.setDuration(Duration.UntilYourNextTurn);
effect.setControllerId(source.getFirstTarget());
game.addEffect(effect, source);
return true;
}
use of mage.abilities.effects.common.cost.SpellsCostReductionAllEffect in project mage by magefree.
the class CastSplitCardsWithCostModificationTest method prepareReduceEffect.
private void prepareReduceEffect(String cardNameToReduce, int reduceAmount) {
FilterCard filter = new FilterCard();
filter.add(new NamePredicate(cardNameToReduce));
addCustomCardWithAbility("reduce", playerA, new SimpleStaticAbility(new SpellsCostReductionAllEffect(filter, reduceAmount)));
}
Aggregations