Search in sources :

Example 61 with ManaOptions

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

the class CrypticTrilobiteTest method testUse.

@Test
public void testUse() {
    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");
    // Flying
    // {2}: Deathknell Kami gets +1/+1 until end of turn. Sacrifice it at the beginning of the next end step.
    // Soulshift 1 (When this creature dies, you may return target Spirit card with converted mana cost 1 or less from your graveyard to your hand.)
    // Creature   (0/1)
    addCard(Zone.BATTLEFIELD, playerA, "Deathknell Kami");
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 10);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Trilobite");
    setChoice(playerA, "X=5");
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
    activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{2}:");
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertPermanentCount(playerA, "Cryptic Trilobite", 1);
    assertCounterCount(playerA, "Cryptic Trilobite", CounterType.P1P1, 3);
    assertPowerToughness(playerA, "Deathknell Kami", 2, 3);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{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 62 with ManaOptions

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

the class NagaVitalistTest method nagaVitalist_GiftOfParadiseCanAnyColor.

@Test
public void nagaVitalist_GiftOfParadiseCanAnyColor() {
    // Mana pools don't empty as steps and phases end.
    addCard(Zone.BATTLEFIELD, playerA, "Upwelling");
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
    addCard(Zone.HAND, playerA, giftParadise);
    addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
    // manual mana cost, cause auto cost can get swamp to pay
    activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
    activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
    activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}");
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, giftParadise, "Swamp");
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    assertDuplicatedManaOptions(manaOptions);
    Assert.assertEquals("mana variations don't fit", 2, manaOptions.size());
    assertManaOptions("{B}", manaOptions);
    assertManaOptions("{Any}{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 63 with ManaOptions

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

the class TappedForManaRelatedTest method TestViridianJoiner.

@Test
public void TestViridianJoiner() {
    setStrictChooseMode(true);
    // {T}: Add an amount of {G} equal to Viridian Joiner's power.
    // Creature {2}{G}  1/2
    addCard(Zone.HAND, playerA, "Viridian Joiner", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
    addCard(Zone.BATTLEFIELD, playerB, "Forest", 1);
    addCard(Zone.HAND, playerB, "Giant Growth", 1);
    castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Viridian Joiner");
    castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerB, "Giant Growth", "Viridian Joiner");
    setStopAt(3, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    assertGraveyardCount(playerB, "Giant Growth", 1);
    assertPowerToughness(playerA, "Viridian Joiner", 4, 5);
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
    assertManaOptions("{G}{G}{G}{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 64 with ManaOptions

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

the class TappedForManaRelatedTest method TestCalciformPools.

@Test
public void TestCalciformPools() {
    // {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);
    setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
    execute();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    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) Test(org.junit.Test)

Example 65 with ManaOptions

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

the class TappedForManaRelatedTest method TestCastleSengir2.

@Test
public void TestCastleSengir2() {
    setStrictChooseMode(true);
    // {T}: Add {C}.
    // {1}, {T}: Add {B}.
    // {2}, {T}: Add {U} or {R}.
    addCard(Zone.BATTLEFIELD, playerA, "Castle Sengir", 1);
    addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
    setStopAt(1, PhaseStep.BEGIN_COMBAT);
    execute();
    assertAllCommandsUsed();
    ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
    Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
    assertManaOptions("{C}{W}{W}", manaOptions);
    assertManaOptions("{W}{B}", manaOptions);
    assertManaOptions("{U}", manaOptions);
    assertManaOptions("{R}", 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