Search in sources :

Example 66 with ManaOptions

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

the class TappedForManaRelatedTest method TestCradleWithWildGrowthNoCreatures.

/**
 * This is a new rule that slightly changes how we resolve abilities that
 * trigger whenever a permanent is tapped for mana or for mana of a
 * specified type. Now, you look at what was actually produced after the
 * activated mana ability resolves. So, tapping a Gaea's Cradle while you no
 * control no creatures won't cause a Wild Growth attached to it to trigger.
 */
@Test
public void TestCradleWithWildGrowthNoCreatures() {
    // {T}: Add {G} for each creature you control.
    addCard(Zone.BATTLEFIELD, playerA, "Gaea's Cradle", 1);
    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", "Gaea's Cradle");
    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 67 with ManaOptions

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

the class TappedForManaRelatedTest method TestCradleWithWildGrowthTwoCreatures.

@Test
public void TestCradleWithWildGrowthTwoCreatures() {
    // {T}: Add {G} for each creature you control.
    addCard(Zone.BATTLEFIELD, playerA, "Gaea's Cradle", 1);
    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", "Gaea's Cradle");
    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}{G}{G}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 68 with ManaOptions

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

the class TappedForManaRelatedTest method TestCastleSengir.

@Test
public void TestCastleSengir() {
    setStrictChooseMode(true);
    // {T}: Add Colorless.
    // {1}, {T}: Add Black.
    // {2}, {T}: Add Blue or Red.
    addCard(Zone.BATTLEFIELD, playerA, "Castle Sengir", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
    setStopAt(1, PhaseStep.UPKEEP);
    execute();
    assertAllCommandsUsed();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
    assertManaOptions("{C}{R}", manaOptions);
    assertManaOptions("{B}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 69 with ManaOptions

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

the class TappedForManaRelatedTest method TestDeathriteShaman.

@Test
// Because this is no mana ability, this mana will not be calculated during available mana calculation
@Ignore
public void TestDeathriteShaman() {
    setStrictChooseMode(true);
    // {T}: Exile target land card from a graveyard. Add one mana of any color.
    // {B}, {T}: Exile target instant or sorcery card from a graveyard. Each opponent loses 2 life.
    // {G}, {T}: Exile target creature card from a graveyard. You gain 2 life.
    addCard(Zone.BATTLEFIELD, playerA, "Deathrite Shaman", 1);
    addCard(Zone.GRAVEYARD, playerA, "Mountain", 3);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{Any}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 70 with ManaOptions

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

the class TappedForManaRelatedTest method TestChromaticOrrery.

@Test
public void TestChromaticOrrery() {
    setStrictChooseMode(true);
    // You may spend mana as though it were mana of any color.
    // {T}: Add {C}{C}{C}{C}{C}.
    // {5}, {T}: Draw a card for each color among permanents you control.
    addCard(Zone.BATTLEFIELD, playerA, "Chromatic Orrery", 1);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{C}{C}{C}{C}{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