Search in sources :

Example 31 with ManaOptions

use of mage.abilities.mana.ManaOptions in project mage by magefree.

the class SylvokExplorerTest method testOneInstance.

@Test
public void testOneInstance() {
    addCard(Zone.BATTLEFIELD, playerB, "Island", 1);
    addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
    // {T}: Add one mana of any color that a land an opponent controls could produce.
    addCard(Zone.BATTLEFIELD, playerA, "Sylvok Explorer", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    setStrictChooseMode(true);
    execute();
    assertAllCommandsUsed();
    ManaOptions options = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("Player should be able to create 1 red and 1 white mana", "{R}{W}", options.get(0).toString());
    Assert.assertEquals("Player should be able to create 1 blue and 1 white mana", "{W}{U}", options.get(1).toString());
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) Test(org.junit.Test)

Example 32 with ManaOptions

use of mage.abilities.mana.ManaOptions in project mage by magefree.

the class CrypticTrilobiteTest method testAvailableManaCalculation.

@Test
public void testAvailableManaCalculation() {
    setStrictChooseMode(true);
    // Cryptic Trilobite enters the battlefield with X +1/+1 counters on it.
    // Remove a +1/+1 counter from Cryptic Trilobite: Add {C}{C}. Spend this mana only to activate abilities.
    // {1}, {T}: Put a +1/+1 counter on Cryptic Trilobite.
    // Creature {X}{X}
    addCard(Zone.HAND, playerA, "Cryptic Trilobite");
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
    setChoice(playerA, "X=5");
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Cryptic Trilobite", 1);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}[{CrypticTrilobiteManaCondition}]", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 33 with ManaOptions

use of mage.abilities.mana.ManaOptions in project mage by magefree.

the class TappedForManaRelatedTest method TestWildGrowth.

@Test
public void TestWildGrowth() {
    addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
    // Enchant land
    // Whenever enchanted land is tapped for mana, its controller adds {G}.
    // Enchantment {G}
    addCard(Zone.HAND, playerA, "Wild Growth", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wild Growth", "Forest");
    setStopAt(3, PhaseStep.BEGIN_COMBAT);
    execute();
    assertPermanentCount(playerA, "Wild Growth", 1);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{G}{G}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 34 with ManaOptions

use of mage.abilities.mana.ManaOptions in project mage by magefree.

the class TappedForManaRelatedTest method TestPriestOfYawgmoth.

@Test
public void TestPriestOfYawgmoth() {
    setStrictChooseMode(true);
    // {T}, Sacrifice an artifact: Add an amount of {B} equal to the sacrificed artifact's converted mana cost.
    // Creature {1}{B}  1/2
    addCard(Zone.BATTLEFIELD, playerA, "Priest of Yawgmoth", 1);
    // {3}
    addCard(Zone.BATTLEFIELD, playerA, "Abandoned Sarcophagus", 1);
    // {0}
    addCard(Zone.BATTLEFIELD, playerA, "Accorder's Shield", 1);
    // {5}
    addCard(Zone.BATTLEFIELD, playerA, "Adarkar Sentinel", 1);
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    execute();
    assertAllCommandsUsed();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{B}{B}{B}{B}{B}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 35 with ManaOptions

use of mage.abilities.mana.ManaOptions in project mage by magefree.

the class TappedForManaRelatedTest method TestCalciformPools2CounterAndTrigger.

@Test
public void TestCalciformPools2CounterAndTrigger() {
    setStrictChooseMode(true);
    // {T}: Add {C}.
    // {1}, {T}: Put a storage counter on Calciform Pools.
    // {1}, Remove X storage counters from Calciform Pools: Add X mana in any combination of {W} and/or {U}.
    addCard(Zone.BATTLEFIELD, playerA, "Calciform Pools", 1);
    addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Calciform Pools", CounterType.STORAGE, 2);
    // As Caged Sun enters the battlefield, choose a color.
    // Creatures you control of the chosen color get +1/+1.
    // Whenever a land's ability adds one or more mana of the chosen color, add one additional mana of that color.
    addCard(Zone.BATTLEFIELD, playerA, "Caged Sun", 1);
    setChoice(playerA, "White");
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertCounterCount("Calciform Pools", CounterType.STORAGE, 2);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
    assertManaOptions("{W}{W}{W}", manaOptions);
    assertManaOptions("{W}{W}{U}", manaOptions);
    assertManaOptions("{U}{U}", manaOptions);
    assertManaOptions("{C}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Aggregations

ManaOptions (mage.abilities.mana.ManaOptions)99 Test (org.junit.Test)85 ManaOptionsTestUtils.assertManaOptions (org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions)75 ManaOptionsTestUtils.assertDuplicatedManaOptions (org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions)38 Permanent (mage.game.permanent.Permanent)9 Mana (mage.Mana)8 Player (mage.players.Player)5 ActivatedManaAbilityImpl (mage.abilities.mana.ActivatedManaAbilityImpl)4 FilterCard (mage.filter.FilterCard)4 FilterPermanent (mage.filter.FilterPermanent)4 TargetPermanent (mage.target.TargetPermanent)4 AlternateManaPaymentAbility (mage.abilities.costs.mana.AlternateManaPaymentAbility)3 ManaCost (mage.abilities.costs.mana.ManaCost)3 ValueHint (mage.abilities.hint.ValueHint)3 FilterControlledPermanent (mage.filter.common.FilterControlledPermanent)3 UUID (java.util.UUID)2 ConditionalMana (mage.ConditionalMana)2 PassAbility (mage.abilities.common.PassAbility)2 PlayLandAsCommanderAbility (mage.abilities.common.PlayLandAsCommanderAbility)2 WhileSearchingPlayFromLibraryAbility (mage.abilities.common.WhileSearchingPlayFromLibraryAbility)2