Search in sources :

Example 1 with AbilitiesCostReductionControllerEffect

use of mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect in project mage by magefree.

the class ConditionalCostModificationTest method test_ModificationNormal.

@Test
public void test_ModificationNormal() {
    addCustomCardWithAbility("mod", playerA, new SimpleStaticAbility(new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip")));
    addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Dagger of the Worthy", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
    setStrictChooseMode(true);
    setStopAt(1, PhaseStep.END_TURN);
    execute();
    assertAllCommandsUsed();
    assertTappedCount("Mountain", true, 1);
    assertTappedCount("Mountain", false, 1);
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) AbilitiesCostReductionControllerEffect(mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect) Test(org.junit.Test)

Example 2 with AbilitiesCostReductionControllerEffect

use of mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect in project mage by magefree.

the class ConditionalCostModificationTest method test_ModificationConditionalActive.

@Test
public void test_ModificationConditionalActive() {
    addCustomCardWithAbility("mod", playerA, new SimpleStaticAbility(new ConditionalCostModificationEffect(new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip"), MyTurnCondition.instance, "")));
    addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Dagger of the Worthy", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
    setStrictChooseMode(true);
    setStopAt(1, PhaseStep.END_TURN);
    execute();
    assertAllCommandsUsed();
    assertTappedCount("Mountain", true, 1);
    assertTappedCount("Mountain", false, 1);
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) ConditionalCostModificationEffect(mage.abilities.decorator.ConditionalCostModificationEffect) AbilitiesCostReductionControllerEffect(mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect) EquipAbility(mage.abilities.keyword.EquipAbility) Test(org.junit.Test)

Example 3 with AbilitiesCostReductionControllerEffect

use of mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect 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)

Example 4 with AbilitiesCostReductionControllerEffect

use of mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect in project mage by magefree.

the class ConditionalCostModificationTest method test_ModificationConditionalNotActive.

@Test
public void test_ModificationConditionalNotActive() {
    addCustomCardWithAbility("mod", playerA, new SimpleStaticAbility(new ConditionalCostModificationEffect(new AbilitiesCostReductionControllerEffect(EquipAbility.class, "equip"), NotMyTurnCondition.instance, "")));
    addCard(Zone.BATTLEFIELD, playerA, "Balduvian Bears", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Dagger of the Worthy", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Equip", "Balduvian Bears");
    setStrictChooseMode(true);
    setStopAt(1, PhaseStep.END_TURN);
    execute();
    assertAllCommandsUsed();
    assertTappedCount("Mountain", true, 2);
    assertTappedCount("Mountain", false, 0);
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) ConditionalCostModificationEffect(mage.abilities.decorator.ConditionalCostModificationEffect) AbilitiesCostReductionControllerEffect(mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect) EquipAbility(mage.abilities.keyword.EquipAbility) Test(org.junit.Test)

Aggregations

SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)4 AbilitiesCostReductionControllerEffect (mage.abilities.effects.common.cost.AbilitiesCostReductionControllerEffect)4 Test (org.junit.Test)4 ConditionalCostModificationEffect (mage.abilities.decorator.ConditionalCostModificationEffect)3 EquipAbility (mage.abilities.keyword.EquipAbility)3 SpellsCostIncreasingAllEffect (mage.abilities.effects.common.cost.SpellsCostIncreasingAllEffect)1 FilterCard (mage.filter.FilterCard)1