Search in sources :

Example 11 with ManaOptions

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

the class ManaOptionsTest method testSungrassPrairie2.

@Test
public void testSungrassPrairie2() {
    // {1}, {T}: Add {G}{W}.
    addCard(Zone.BATTLEFIELD, playerA, "Sungrass Prairie", 5);
    // ({T}: Add {U} or {W} to your mana pool.)
    addCard(Zone.BATTLEFIELD, playerA, "Tundra", 9);
    // ({T}: Add {G} or {U} to your mana pool.)
    addCard(Zone.BATTLEFIELD, playerA, "Tropical Island", 3);
    setStopAt(3, PhaseStep.PRECOMBAT_MAIN);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    assertDuplicatedManaOptions(manaOptions);
    Assert.assertEquals("mana variations don't fit", 88, manaOptions.size());
    assertManaOptions("{G}{G}{G}{G}{G}{G}{G}{G}{W}{W}{W}{W}{W}{W}{W}{W}{W}", manaOptions);
    assertManaOptions("{G}{G}{G}{G}{G}{G}{G}{G}{W}{W}{W}{W}{W}{W}{W}{W}{U}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) ManaOptionsTestUtils.assertDuplicatedManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions) Test(org.junit.Test)

Example 12 with ManaOptions

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

the class ManaOptionsTest method testDuplicatedHave.

@Test
public void testDuplicatedHave() {
    // getManaAvailable return any combination of mana variants evailable to player
    // if mana ability cost another mana then if replaced in mana cost
    // example:
    // 1x forest
    // 1x Chromatic Star ({1}, {T}, Sacrifice Chromatic Star: Add one mana of any color.)
    // give {G}{Any}, but after pay it transform to {Any} (1 green will be pay)
    // That's why there are can be duplicated records in getManaAvailable
    // {1}, {T}, Sacrifice Chromatic Star: Add one mana of any color.
    // When Chromatic Star is put into a graveyard from the battlefield, draw a card.
    addCard(Zone.BATTLEFIELD, playerA, "Chromatic Star", 1);
    // {1}, {T}, Sacrifice Chromatic Sphere: Add one mana of any color. Draw a card.
    addCard(Zone.BATTLEFIELD, playerA, "Chromatic Sphere", 1);
    // {T}: Add {C}. If you control an Urza's Mine and an Urza's Power-Plant, add {C}{C}{C} instead.
    addCard(Zone.BATTLEFIELD, playerA, "Urza's Tower", 1);
    // {T}: Add {C}.
    // {T}: Add {R} or {G}. Each opponent gains 1 life.
    addCard(Zone.BATTLEFIELD, playerA, "Grove of the Burnwillows", 1);
    setStopAt(1, PhaseStep.UPKEEP);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
    assertDuplicatedManaOptions(manaOptions);
    assertManaOptions("{C}{C}", manaOptions);
    assertManaOptions("{Any}{Any}", manaOptions);
    assertManaOptions("{C}{Any}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) ManaOptionsTestUtils.assertDuplicatedManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions) Test(org.junit.Test)

Example 13 with ManaOptions

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

the class ManaOptionsTest method testCabalCoffers2.

@Test
public void testCabalCoffers2() {
    addCard(Zone.BATTLEFIELD, playerA, "Cabal Coffers", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
    setStopAt(1, PhaseStep.UPKEEP);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    assertDuplicatedManaOptions(manaOptions);
    Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
    assertManaOptions("{W}{B}{B}", manaOptions);
    assertManaOptions("{B}{B}{B}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) ManaOptionsTestUtils.assertDuplicatedManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions) Test(org.junit.Test)

Example 14 with ManaOptions

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

the class ManaOptionsTest method testNykthos6.

@Test
public void testNykthos6() {
    // Creature {G} (1/1)
    addCard(Zone.BATTLEFIELD, playerA, "Sedge Scorpion", 4);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
    // Creature {1}{W}
    addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 4);
    // Land
    addCard(Zone.BATTLEFIELD, playerA, "Nykthos, Shrine to Nyx", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Radha, Heart of Keld");
    addCard(Zone.BATTLEFIELD, playerA, "Precognition Field");
    addCard(Zone.BATTLEFIELD, playerA, "Mystic Forge");
    addCard(Zone.BATTLEFIELD, playerA, "Experimental Frenzy");
    addCard(Zone.BATTLEFIELD, playerA, "Elsha of the Infinite");
    addCard(Zone.BATTLEFIELD, playerA, "Bolas's Citadel");
    addCard(Zone.BATTLEFIELD, playerA, "Verge Rangers");
    addCard(Zone.BATTLEFIELD, playerA, "Vivien, Monsters' Advocate");
    addCard(Zone.BATTLEFIELD, playerA, "Vizier of the Menagerie");
    setStopAt(1, PhaseStep.UPKEEP);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    assertDuplicatedManaOptions(manaOptions);
    Assert.assertEquals("mana variations don't fit", 6, manaOptions.size());
    assertManaOptions("{C}{G}{G}{G}", manaOptions);
    assertManaOptions("{G}{G}{G}{G}{G}{G}{G}{G}{G}", manaOptions);
    assertManaOptions("{G}{W}{W}{W}{W}{W}{W}", manaOptions);
    assertManaOptions("{R}{R}{R}{G}", manaOptions);
    assertManaOptions("{B}{B}{B}{G}", manaOptions);
    assertManaOptions("{G}{U}{U}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) ManaOptionsTestUtils.assertDuplicatedManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions) Test(org.junit.Test)

Example 15 with ManaOptions

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

the class ManaOptionsTest method testDampingSphere.

@Test
public void testDampingSphere() {
    // If a land is tapped for two or more mana, it produces {C} instead of any other type and amount.
    // Each spell a player casts costs {1} more to cast for each other spell that player has cast this turn.
    addCard(Zone.BATTLEFIELD, playerA, "Damping Sphere", 1);
    // {T}: Add {C}.
    // {T}: Add {C}{C}. Spend this mana only to cast colorless Eldrazi spells or activate abilities of colorless Eldrazi.
    addCard(Zone.BATTLEFIELD, playerA, "Eldrazi Temple", 1);
    setStopAt(1, PhaseStep.UPKEEP);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    assertDuplicatedManaOptions(manaOptions);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{C}", manaOptions);
}
Also used : ManaOptions(mage.abilities.mana.ManaOptions) ManaOptionsTestUtils.assertManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions) ManaOptionsTestUtils.assertDuplicatedManaOptions(org.mage.test.utils.ManaOptionsTestUtils.assertDuplicatedManaOptions) 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