Search in sources :

Example 1 with InstantOrSorcerySpellManaBuilder

use of mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder in project mage by magefree.

the class ManaPoolTest method test_ConditionalMana_OneXSpell.

@Test
public void test_ConditionalMana_OneXSpell() {
    addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), new ManaCostsImpl("")));
    // {X}{R}{R}
    addCard(Zone.HAND, playerA, "Volcanic Geyser");
    // make mana
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
    // use for spell
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
    setChoice(playerA, "X=1");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3);
    checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 1);
    setStopAt(1, PhaseStep.END_TURN);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : AddConditionalManaEffect(mage.abilities.effects.mana.AddConditionalManaEffect) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) InstantOrSorcerySpellManaBuilder(mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) Test(org.junit.Test)

Example 2 with InstantOrSorcerySpellManaBuilder

use of mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder in project mage by magefree.

the class ManaPoolTest method test_ConditionalMana_MultipleXSpell.

@Test
public void test_ConditionalMana_MultipleXSpell() {
    addCustomCardWithAbility("add 10", playerA, new SimpleActivatedAbility(Zone.ALL, new AddConditionalManaEffect(Mana.RedMana(10), new InstantOrSorcerySpellManaBuilder()), new ManaCostsImpl("")));
    // {X}{R}{R}
    addCard(Zone.HAND, playerA, "Volcanic Geyser", 2);
    // make mana
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Add {R}");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10);
    // use for spell 1
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
    setChoice(playerA, "X=1");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3);
    // use for spell 2
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB);
    setChoice(playerA, "X=1");
    waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN);
    checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "R", 10 - 3 * 2);
    checkLife("after", 1, PhaseStep.END_TURN, playerB, 20 - 1 * 2);
    setStopAt(1, PhaseStep.END_TURN);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
}
Also used : AddConditionalManaEffect(mage.abilities.effects.mana.AddConditionalManaEffect) SimpleActivatedAbility(mage.abilities.common.SimpleActivatedAbility) InstantOrSorcerySpellManaBuilder(mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) Test(org.junit.Test)

Aggregations

SimpleActivatedAbility (mage.abilities.common.SimpleActivatedAbility)2 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)2 AddConditionalManaEffect (mage.abilities.effects.mana.AddConditionalManaEffect)2 InstantOrSorcerySpellManaBuilder (mage.abilities.mana.builder.common.InstantOrSorcerySpellManaBuilder)2 Test (org.junit.Test)2