use of mage.abilities.mana.ManaOptions in project mage by magefree.
the class ConditionalManaTest method testTwoConditionalMana.
@Test
public void testTwoConditionalMana() {
setStrictChooseMode(true);
// At the beginning of your upkeep, look at the top card of your library. You may put that card into your graveyard.
// Exile a card from your graveyard: Add {C}. Spend this mana only to cast a colored spell without {X} in its mana cost.
// Enchantment {1}{B}{G}{U}
addCard(Zone.BATTLEFIELD, playerA, "Titans' Nest");
// {T}: Add {C}{C}{C}{C}. Spend this mana only on costs that contain {X}.
addCard(Zone.BATTLEFIELD, playerA, "Rosheen Meanderer", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
addCard(Zone.GRAVEYARD, playerA, "Grizzly Bears", 2);
// Put [Top Card of Library] into your graveyard?
setChoice(playerA, false);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Titans' Nest", 1);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
assertManaOptions("{R}", manaOptions);
assertManaOptions("{C}{C}{R}[{TitansNestManaCondition}]", manaOptions);
assertManaOptions("{C}{C}{C}{C}{R}[{RosheenMeandererManaCondition}]", manaOptions);
assertManaOptions("{C}{C}{C}{C}{C}{C}{R}[{RosheenMeandererManaCondition}{TitansNestManaCondition}]", manaOptions);
}
use of mage.abilities.mana.ManaOptions in project mage by magefree.
the class ConditionalManaTest method TriggeredManaAbilityMustGivesExtraManaOptions.
// TODO: add support TriggeredManaAbility for available mana calculations
// AI can't see extra mana added by AddManaOfAnyTypeProducedEffect and same
// (maybe it was removed by https://github.com/magefree/mage/pull/5943 to fix multiple TAPPED_FOR_MANA calls or never works before)
// As idea: getPlayable -> getManaAvailable -> available.addMana -- search all TriggeredManaAbility
// and process all available net mana by special call like TriggeredManaAbility->getNetManaForEvent(ManaEvent xxx)
@Test
public void TriggeredManaAbilityMustGivesExtraManaOptions() {
// TriggeredManaAbility must give extra mana options (2 red instead 1)
// Whenever you tap a land for mana, add one mana of any type that land produced.
addCard(Zone.BATTLEFIELD, playerA, "Dictate of Karametra");
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
assertDuplicatedManaOptions(manaOptions);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{R}{R}", manaOptions);
}
use of mage.abilities.mana.ManaOptions in project mage by magefree.
the class NonTappingManaAbilitiesTest method TestSquanderedResourcesWithManaConfluence.
@Test
public void TestSquanderedResourcesWithManaConfluence() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
// {T}, Pay 1 life: Add one mana of any color.
addCard(Zone.BATTLEFIELD, playerA, "Mana Confluence", 1);
// Sacrifice a land: Add one mana of any type the sacrificed land could produce.
addCard(Zone.BATTLEFIELD, playerA, "Squandered Resources", 1);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{G}{G}{Any}{Any}", manaOptions);
}
use of mage.abilities.mana.ManaOptions in project mage by magefree.
the class NonTappingManaAbilitiesTest method TestCrystallineCrawler.
@Test
public void TestCrystallineCrawler() {
setStrictChooseMode(true);
// Converge - Crystalline Crawler enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.
// Remove a +1/+1 counter from Crystalline Crawler: Add one mana of any color.
// {T}: Put a +1/+1 counter on Crystalline Crawler.
addCard(Zone.BATTLEFIELD, playerA, "Crystalline Crawler", 1);
addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crystalline Crawler", CounterType.P1P1, 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{Any}{Any}", manaOptions);
}
use of mage.abilities.mana.ManaOptions in project mage by magefree.
the class NonTappingManaAbilitiesTest method Test_ManaCacheOpponent.
@Test
public void Test_ManaCacheOpponent() {
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(2, PhaseStep.PRECOMBAT_MAIN);
execute();
assertAllCommandsUsed();
assertCounterCount("Mana Cache", CounterType.CHARGE, 2);
ManaOptions manaOptions = playerB.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{C}{C}", manaOptions);
}
Aggregations