Search in sources :

Example 1 with SpellsCostIncreasingAllEffect

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));
}
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 2 with SpellsCostIncreasingAllEffect

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);
}
Also used : FilterCard(mage.filter.FilterCard) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) ConditionalCostModificationEffect(mage.abilities.decorator.ConditionalCostModificationEffect) AbilitiesCostReductionControllerEffect(mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect) EquipAbility(mage.abilities.keyword.EquipAbility) SpellsCostIncreasingAllEffect(mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect) Test(org.junit.Test)

Aggregations

SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)2 SpellsCostIncreasingAllEffect (mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect)2 ConditionalCostModificationEffect (mage.abilities.decorator.ConditionalCostModificationEffect)1 Effect (mage.abilities.effects.Effect)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 AbilitiesCostReductionControllerEffect (mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect)1 SpellsCostReductionAllEffect (mage.abilities.effects.common.cost.SpellsCostReductionAllEffect)1 SearchLibraryPutInHandEffect (mage.abilities.effects.common.search.SearchLibraryPutInHandEffect)1 EquipAbility (mage.abilities.keyword.EquipAbility)1 FilterCard (mage.filter.FilterCard)1 Test (org.junit.Test)1