Search in sources :

Example 1 with SpellsCostReductionAllEffect

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;
}
Also used : FilterCard(mage.filter.FilterCard) NamePredicate(mage.filter.predicate.mageobject.NamePredicate) ChooseACardNameEffect(mage.abilities.effects.common.ChooseACardNameEffect) ContinuousEffect(mage.abilities.effects.ContinuousEffect) SpellsCostReductionAllEffect(mage.abilities.effects.common.cost.SpellsCostReductionAllEffect)

Example 2 with SpellsCostReductionAllEffect

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));
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) DestroyTargetEffect(mage.abilities.effects.common.DestroyTargetEffect) ReturnFromExileEffect(mage.abilities.effects.common.ReturnFromExileEffect) SearchLibraryPutInHandEffect(mage.abilities.effects.common.search.SearchLibraryPutInHandEffect) Effect(mage.abilities.effects.Effect) SpellsCostReductionAllEffect(mage.abilities.effects.common.cost.SpellsCostReductionAllEffect) SpellsCostIncreasingAllEffect(mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect) ReturnFromGraveyardToHandTargetEffect(mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect) DamageTargetEffect(mage.abilities.effects.common.DamageTargetEffect) SpellsCostReductionAllEffect(mage.abilities.effects.common.cost.SpellsCostReductionAllEffect) SpellsCostIncreasingAllEffect(mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect)

Example 3 with SpellsCostReductionAllEffect

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;
}
Also used : SpellsCostReductionAllEffect(mage.abilities.effects.common.cost.SpellsCostReductionAllEffect)

Example 4 with SpellsCostReductionAllEffect

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)));
}
Also used : FilterCard(mage.filter.FilterCard) NamePredicate(mage.filter.predicate.mageobject.NamePredicate) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) SpellsCostReductionAllEffect(mage.abilities.effects.common.cost.SpellsCostReductionAllEffect)

Aggregations

SpellsCostReductionAllEffect (mage.abilities.effects.common.cost.SpellsCostReductionAllEffect)4 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)2 FilterCard (mage.filter.FilterCard)2 NamePredicate (mage.filter.predicate.mageobject.NamePredicate)2 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 Effect (mage.abilities.effects.Effect)1 ChooseACardNameEffect (mage.abilities.effects.common.ChooseACardNameEffect)1 DamageTargetEffect (mage.abilities.effects.common.DamageTargetEffect)1 DestroyTargetEffect (mage.abilities.effects.common.DestroyTargetEffect)1 ReturnFromExileEffect (mage.abilities.effects.common.ReturnFromExileEffect)1 ReturnFromGraveyardToHandTargetEffect (mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect)1 SpellsCostIncreasingAllEffect (mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect)1 SearchLibraryPutInHandEffect (mage.abilities.effects.common.search.SearchLibraryPutInHandEffect)1