Search in sources :

Example 26 with ManaOptions

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

the class NonTappingManaAbilitiesTest method Test_ManaCache.

@Test
public void Test_ManaCache() {
    setStrictChooseMode(true);
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
    // At the beginning of each player's end step, put a charge counter on Mana Cache for each untapped land that player controls.
    // Remove a charge counter from Mana Cache: Add {C}. Any player may activate this ability but only during their turn before the end step.
    addCard(Zone.BATTLEFIELD, playerA, "Mana Cache", 1);
    setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
    execute();
    assertAllCommandsUsed();
    assertCounterCount("Mana Cache", CounterType.CHARGE, 2);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{C}{C}{B}{B}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 27 with ManaOptions

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

the class NonTappingManaAbilitiesTest method TestJunglePatrol.

@Test
public void TestJunglePatrol() {
    setStrictChooseMode(true);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
    // {1}{G}, {T}: Create a 0/1 green Wall creature token with defender named Wood.
    // Sacrifice a token named Wood: Add {R}.
    addCard(Zone.BATTLEFIELD, playerA, "Jungle Patrol", 1);
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create");
    activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create");
    activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create");
    setStopAt(5, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Wood", 3);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{R}{R}{R}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 28 with ManaOptions

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

the class NonTappingManaAbilitiesTest method druidsRepositoryTest.

@Test
public void druidsRepositoryTest() {
    setStrictChooseMode(true);
    // Creature {W}{W}
    addCard(Zone.HAND, playerA, "Alaborn Grenadier", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2);
    // Whenever a creature you control attacks, put a charge counter on Druids' Repository.
    // Remove a charge counter from Druids' Repository: Add one mana of any color.
    // Enchantment {1}{G}{G}
    addCard(Zone.BATTLEFIELD, playerA, "Druids' Repository", 1);
    attack(1, playerA, "Silvercoat Lion");
    attack(1, playerA, "Silvercoat Lion");
    setChoice(playerA, "Whenever a creature you control");
    setStopAt(1, PhaseStep.END_COMBAT);
    execute();
    assertTappedCount("Silvercoat Lion", true, 2);
    assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 2);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{Any}{Any}", manaOptions);
    castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Alaborn Grenadier");
    setChoice(playerA, "White");
    setChoice(playerA, "White");
    setStopAt(1, PhaseStep.END_TURN);
    execute();
    assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 0);
    assertPermanentCount(playerA, "Alaborn Grenadier", 1);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) Test(org.junit.Test)

Example 29 with ManaOptions

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

the class ReflectingPoolTest method test2WithExoticOrchard.

/**
 * Test 2 Reflecting Pools
 */
@Test
public void test2WithExoticOrchard() {
    addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
    // {T}: Add one mana of any type that a land you control could produce.
    addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 2);
    // {T}: Add one mana of any color that a land an opponent controls could produce.
    addCard(Zone.BATTLEFIELD, playerA, "Exotic Orchard", 1);
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    execute();
    ManaOptions options = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("Player should be able to create 3 red mana", "{R}{R}{R}", options.get(0).toString());
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) Test(org.junit.Test)

Example 30 with ManaOptions

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

the class ReflectingPoolTest method testWithGaeasCradle.

/**
 * Reflecting Pool does not see Gaea's Cradle or Serra's Sanctum as
 * producing mana
 */
@Test
public void testWithGaeasCradle() {
    addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
    // {T}: Add one mana of any type that a land you control could produce.
    addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1);
    // {T}: Add {G} for each creature you control.
    addCard(Zone.BATTLEFIELD, playerA, "Gaea's Cradle", 1);
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    execute();
    ManaOptions options = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("Player should be able to create 2 red mana", "{G}{G}", options.get(0).toString());
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) 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