* Squandered Resources - Fixed available mana calculation (#6698).

This commit is contained in:
LevelX2 2020-08-02 22:47:03 +02:00
parent 309b3f5636
commit 9dfc6eed69
2 changed files with 330 additions and 300 deletions

View file

@ -1,34 +1,33 @@
package mage.cards.s; package mage.cards.s;
import mage.Mana;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.ActivatedManaAbilityImpl;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.stream.Collectors;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.SacrificeTargetCost;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.AnyColorLandsProduceManaAbility; import mage.abilities.mana.AnyColorLandsProduceManaAbility;
import mage.abilities.mana.ManaOptions;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.ManaType; import mage.constants.ManaType;
import mage.constants.Zone;
import mage.filter.StaticFilters; import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
/** /**
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com) * @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
@ -68,14 +67,28 @@ class SquanderedResourcesEffect extends ManaEffect {
@Override @Override
public List<Mana> getNetMana(Game game, Ability source) { public List<Mana> getNetMana(Game game, Ability source) {
List<Mana> netManas = new ArrayList<>(); List<Mana> netManas = new ArrayList<>();
Set<ManaType> manaTypes = new HashSet<>();
if (game != null && game.inCheckPlayableState()) { if (game != null && game.inCheckPlayableState()) {
// add color combinations of available mana
ManaOptions allPossibleMana = new ManaOptions();
for (Permanent land : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), game)) { for (Permanent land : game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_LAND, source.getControllerId(), game)) {
manaTypes.addAll(AnyColorLandsProduceManaAbility.getManaTypesFromPermanent(land, game)); ManaOptions currentPossibleMana = new ManaOptions();
Set<ManaType> manaTypes = AnyColorLandsProduceManaAbility.getManaTypesFromPermanent(land, game);
if (manaTypes.size() == 5 && !manaTypes.contains(ManaType.COLORLESS) || manaTypes.size() == 6) {
currentPossibleMana.add(Mana.AnyMana(1));
if (manaTypes.contains(ManaType.COLORLESS)) {
currentPossibleMana.add(new Mana(ManaType.COLORLESS));
}
} else {
for (ManaType manaType : manaTypes) {
currentPossibleMana.add(new Mana(manaType));
}
}
allPossibleMana.addMana(currentPossibleMana);
} }
} else { allPossibleMana.removeDuplicated();
manaTypes = getManaTypesFromSacrificedPermanent(game, source); return allPossibleMana.stream().collect(Collectors.toList());
} }
Set<ManaType> manaTypes = getManaTypesFromSacrificedPermanent(game, source);
if (manaTypes.size() == 5 && !manaTypes.contains(ManaType.COLORLESS) && !manaTypes.contains(ManaType.GENERIC)) { if (manaTypes.size() == 5 && !manaTypes.contains(ManaType.COLORLESS) && !manaTypes.contains(ManaType.GENERIC)) {
netManas.add(Mana.AnyMana(1)); netManas.add(Mana.AnyMana(1));
} else { } else {

View file

@ -1,275 +1,292 @@
package org.mage.test.cards.mana; package org.mage.test.cards.mana;
import mage.abilities.mana.ManaOptions; import mage.abilities.mana.ManaOptions;
import mage.constants.PhaseStep; import mage.constants.PhaseStep;
import mage.constants.Zone; import mage.constants.Zone;
import mage.counters.CounterType; import mage.counters.CounterType;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase; import org.mage.test.serverside.base.CardTestPlayerBase;
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions; import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
/** /**
* *
* @author LevelX2 * @author LevelX2
*/ */
public class NonTappingManaAbilitiesTest extends CardTestPlayerBase { public class NonTappingManaAbilitiesTest extends CardTestPlayerBase {
@Test @Test
public void druidsRepositoryTest() { public void druidsRepositoryTest() {
setStrictChooseMode(true); setStrictChooseMode(true);
addCard(Zone.HAND, playerA, "Alaborn Grenadier", 1); //Creature {W}{W} addCard(Zone.HAND, playerA, "Alaborn Grenadier", 1); //Creature {W}{W}
addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2); addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 2);
// Whenever a creature you control attacks, put a charge counter on Druids' Repository. // 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. // Remove a charge counter from Druids' Repository: Add one mana of any color.
addCard(Zone.BATTLEFIELD, playerA, "Druids' Repository", 1); // Enchantment {1}{G}{G} addCard(Zone.BATTLEFIELD, playerA, "Druids' Repository", 1); // Enchantment {1}{G}{G}
attack(1, playerA, "Silvercoat Lion"); attack(1, playerA, "Silvercoat Lion");
attack(1, playerA, "Silvercoat Lion"); attack(1, playerA, "Silvercoat Lion");
setChoice(playerA, "Whenever a creature you control"); setChoice(playerA, "Whenever a creature you control");
setStopAt(1, PhaseStep.END_COMBAT); setStopAt(1, PhaseStep.END_COMBAT);
execute(); execute();
assertTappedCount("Silvercoat Lion", true, 2); assertTappedCount("Silvercoat Lion", true, 2);
assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 2); assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 2);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{Any}{Any}", manaOptions); assertManaOptions("{Any}{Any}", manaOptions);
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Alaborn Grenadier"); castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Alaborn Grenadier");
setChoice(playerA, "White"); setChoice(playerA, "White");
setChoice(playerA, "White"); setChoice(playerA, "White");
setStopAt(1, PhaseStep.END_TURN); setStopAt(1, PhaseStep.END_TURN);
execute(); execute();
assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 0); assertCounterCount(playerA, "Druids' Repository", CounterType.CHARGE, 0);
assertPermanentCount(playerA, "Alaborn Grenadier", 1); assertPermanentCount(playerA, "Alaborn Grenadier", 1);
} }
@Test @Test
public void TestWorkhorse() { public void TestWorkhorse() {
setStrictChooseMode(true); setStrictChooseMode(true);
// Workhorse enters the battlefield with four +1/+1 counters on it. // Workhorse enters the battlefield with four +1/+1 counters on it.
// Remove a +1/+1 counter from Workhorse: Add {C}. // Remove a +1/+1 counter from Workhorse: Add {C}.
addCard(Zone.BATTLEFIELD, playerA, "Workhorse", 1); addCard(Zone.BATTLEFIELD, playerA, "Workhorse", 1);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN); setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{C}{C}{C}{C}", manaOptions); assertManaOptions("{C}{C}{C}{C}", manaOptions);
} }
@Test @Test
public void TestMorselhoarder() { public void TestMorselhoarder() {
setStrictChooseMode(true); setStrictChooseMode(true);
// Morselhoarder enters the battlefield with two -1/-1 counters on it. // Morselhoarder enters the battlefield with two -1/-1 counters on it.
// Remove a -1/-1 counter from Morselhoarder: Add one mana of any color. // Remove a -1/-1 counter from Morselhoarder: Add one mana of any color.
addCard(Zone.BATTLEFIELD, playerA, "Morselhoarder", 2); addCard(Zone.BATTLEFIELD, playerA, "Morselhoarder", 2);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{B}{B}{Any}{Any}{Any}{Any}", manaOptions); assertManaOptions("{B}{B}{Any}{Any}{Any}{Any}", manaOptions);
} }
@Test @Test
public void TestFarrelitePriest() { public void TestFarrelitePriest() {
setStrictChooseMode(true); setStrictChooseMode(true);
// {1}: Add {W}. If this ability has been activated four or more times this turn, sacrifice Farrelite Priest at the beginning of the next end step. // {1}: Add {W}. If this ability has been activated four or more times this turn, sacrifice Farrelite Priest at the beginning of the next end step.
addCard(Zone.BATTLEFIELD, playerA, "Farrelite Priest", 1); addCard(Zone.BATTLEFIELD, playerA, "Farrelite Priest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 5, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 5, manaOptions.size());
assertManaOptions("{W}{W}{W}{W}", manaOptions); assertManaOptions("{W}{W}{W}{W}", manaOptions);
assertManaOptions("{W}{W}{W}{B}", manaOptions); assertManaOptions("{W}{W}{W}{B}", manaOptions);
assertManaOptions("{W}{W}{B}{B}", manaOptions); assertManaOptions("{W}{W}{B}{B}", manaOptions);
assertManaOptions("{W}{B}{B}{B}", manaOptions); assertManaOptions("{W}{B}{B}{B}", manaOptions);
assertManaOptions("{B}{B}{B}{B}", manaOptions); assertManaOptions("{B}{B}{B}{B}", manaOptions);
} }
@Test @Test
public void TestCrystallineCrawler() { public void TestCrystallineCrawler() {
setStrictChooseMode(true); setStrictChooseMode(true);
// Converge - Crystalline Crawler enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it. // 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. // Remove a +1/+1 counter from Crystalline Crawler: Add one mana of any color.
// {T}: Put a +1/+1 counter on Crystalline Crawler. // {T}: Put a +1/+1 counter on Crystalline Crawler.
addCard(Zone.BATTLEFIELD, playerA, "Crystalline Crawler", 1); addCard(Zone.BATTLEFIELD, playerA, "Crystalline Crawler", 1);
addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crystalline Crawler", CounterType.P1P1, 2); addCounters(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Crystalline Crawler", CounterType.P1P1, 2);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{Any}{Any}", manaOptions); assertManaOptions("{Any}{Any}", manaOptions);
} }
@Test @Test
public void TestCoalGolemAndDromarsAttendant() { public void TestCoalGolemAndDromarsAttendant() {
setStrictChooseMode(true); setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
// {1}, Sacrifice Dromar's Attendant: Add {W}{U}{B}. // {1}, Sacrifice Dromar's Attendant: Add {W}{U}{B}.
addCard(Zone.BATTLEFIELD, playerA, "Dromar's Attendant", 1); addCard(Zone.BATTLEFIELD, playerA, "Dromar's Attendant", 1);
// {3}, Sacrifice Coal Golem: Add {R}{R}{R}. // {3}, Sacrifice Coal Golem: Add {R}{R}{R}.
addCard(Zone.BATTLEFIELD, playerA, "Coal Golem", 1); addCard(Zone.BATTLEFIELD, playerA, "Coal Golem", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 3, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
assertManaOptions("{G}", manaOptions); assertManaOptions("{G}", manaOptions);
assertManaOptions("{W}{U}{B}", manaOptions); assertManaOptions("{W}{U}{B}", manaOptions);
assertManaOptions("{R}{R}{R}", manaOptions); assertManaOptions("{R}{R}{R}", manaOptions);
} }
/** /**
* The order the mana abilities are checked during available mana * The order the mana abilities are checked during available mana
* calculation does matter. Because Coal Golem can not be used as long as * calculation does matter. Because Coal Golem can not be used as long as
* Dromar's Attendant is not used yet to produce the 3 mana. * Dromar's Attendant is not used yet to produce the 3 mana.
*/ */
@Test @Test
public void TestCoalGolemAndDromarsAttendantOrder2() { public void TestCoalGolemAndDromarsAttendantOrder2() {
setStrictChooseMode(true); setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
// {3}, Sacrifice Coal Golem: Add {R}{R}{R}. // {3}, Sacrifice Coal Golem: Add {R}{R}{R}.
addCard(Zone.BATTLEFIELD, playerA, "Coal Golem", 1); addCard(Zone.BATTLEFIELD, playerA, "Coal Golem", 1);
// {1}, Sacrifice Dromar's Attendant: Add {W}{U}{B}. // {1}, Sacrifice Dromar's Attendant: Add {W}{U}{B}.
addCard(Zone.BATTLEFIELD, playerA, "Dromar's Attendant", 1); addCard(Zone.BATTLEFIELD, playerA, "Dromar's Attendant", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 3, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
assertManaOptions("{G}", manaOptions); assertManaOptions("{G}", manaOptions);
assertManaOptions("{W}{U}{B}", manaOptions); assertManaOptions("{W}{U}{B}", manaOptions);
assertManaOptions("{R}{R}{R}", manaOptions); assertManaOptions("{R}{R}{R}", manaOptions);
} }
@Test @Test
public void TestJunglePatrol() { public void TestJunglePatrol() {
setStrictChooseMode(true); setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 2); addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
// {1}{G}, {T}: Create a 0/1 green Wall creature token with defender named Wood. // {1}{G}, {T}: Create a 0/1 green Wall creature token with defender named Wood.
// Sacrifice a token named Wood: Add {R}. // Sacrifice a token named Wood: Add {R}.
addCard(Zone.BATTLEFIELD, playerA, "Jungle Patrol", 1); addCard(Zone.BATTLEFIELD, playerA, "Jungle Patrol", 1);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create");
activateAbility(3, 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"); activateAbility(5, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}{G}, {T}: Create");
setStopAt(5, PhaseStep.BEGIN_COMBAT); setStopAt(5, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertAllCommandsUsed(); assertAllCommandsUsed();
assertPermanentCount(playerA, "Wood", 3); assertPermanentCount(playerA, "Wood", 3);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{R}{R}{R}", manaOptions); assertManaOptions("{R}{R}{R}", manaOptions);
} }
@Test @Test
public void TestSquanderedResources() { public void TestSquanderedResources() {
setStrictChooseMode(true); setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Taiga", 1); // ({T}: Add {R} or {G}.) addCard(Zone.BATTLEFIELD, playerA, "Taiga", 1); // ({T}: Add {R} or {G}.)
// {T}: Add {C}. // {T}: Add {C}.
// {1}, {T}: Put a storage counter on Calciform Pools. // {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}. // {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); addCard(Zone.BATTLEFIELD, playerA, "Calciform Pools", 1);
// {T}: Add {U}. If you played a land this turn, add {B} instead. // {T}: Add {U}. If you played a land this turn, add {B} instead.
addCard(Zone.BATTLEFIELD, playerA, "River of Tears", 1); addCard(Zone.BATTLEFIELD, playerA, "River of Tears", 1);
// Sacrifice a land: Add one mana of any type the sacrificed land could produce.
// Sacrifice a land: Add one mana of any type the sacrificed land could produce. addCard(Zone.BATTLEFIELD, playerA, "Squandered Resources", 1);
addCard(Zone.BATTLEFIELD, playerA, "Squandered Resources", 1);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN); execute();
execute();
assertAllCommandsUsed();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); Assert.assertEquals("mana variations don't fit", 9, manaOptions.size());
Assert.assertEquals("mana variations don't fit", 9, manaOptions.size()); assertManaOptions("{C}{U}{U}{U}{R}{R}{G}{G}", manaOptions);
assertManaOptions("{C}{U}{R}{R}{G}", manaOptions); assertManaOptions("{C}{U}{U}{U}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{U}{U}{G}{G}", manaOptions); assertManaOptions("{C}{U}{U}{U}{R}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{U}{U}{R}{G}", manaOptions); assertManaOptions("{C}{C}{U}{U}{R}{R}{G}{G}", manaOptions);
assertManaOptions("{C}{U}{G}{G}{G}", manaOptions); assertManaOptions("{C}{C}{U}{U}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{U}{R}{G}{G}", manaOptions); assertManaOptions("{C}{C}{U}{U}{R}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{W}{U}{G}{G}", manaOptions); assertManaOptions("{C}{W}{U}{U}{R}{R}{G}{G}", manaOptions);
assertManaOptions("{C}{W}{U}{R}{G}", manaOptions); assertManaOptions("{C}{W}{U}{U}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{C}{U}{G}{G}", manaOptions); assertManaOptions("{C}{W}{U}{U}{R}{G}{G}{G}", manaOptions);
assertManaOptions("{C}{C}{U}{R}{G}", manaOptions); }
}
@Test
@Test public void TestSquanderedResourcesWithManaConfluence() {
public void TestSquanderedResourcesWithManaConfluence() { setStrictChooseMode(true);
setStrictChooseMode(true); addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 1); // {T}, Pay 1 life: Add one mana of any color.
// {T}, Pay 1 life: Add one mana of any color. addCard(Zone.BATTLEFIELD, playerA, "Mana Confluence", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mana Confluence", 1);
// Sacrifice a land: Add one mana of any type the sacrificed land could produce.
// Sacrifice a land: Add one mana of any type the sacrificed land could produce. addCard(Zone.BATTLEFIELD, playerA, "Squandered Resources", 1);
addCard(Zone.BATTLEFIELD, playerA, "Squandered Resources", 1);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN); execute();
execute();
assertAllCommandsUsed();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); assertManaOptions("{G}{G}{Any}{Any}", manaOptions);
assertManaOptions("{G}{Any}{Any}", manaOptions); }
}
@Test
@Test public void TestTreasonousOgre() {
public void TestTreasonousOgre() { setStrictChooseMode(true);
setStrictChooseMode(true); // Dethrone
// Dethrone // Pay 3 life: Add {R}.
// Pay 3 life: Add {R}. addCard(Zone.BATTLEFIELD, playerA, "Treasonous Ogre", 1);
addCard(Zone.BATTLEFIELD, playerA, "Treasonous Ogre", 1);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN);
setStopAt(1, PhaseStep.PRECOMBAT_MAIN); execute();
execute();
assertAllCommandsUsed();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame); Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size()); assertManaOptions("{R}{R}{R}{R}{R}{R}", manaOptions);
assertManaOptions("{R}{R}{R}{R}{R}{R}", manaOptions); }
}
} @Test
public void TestSquanderedResourcesTwoSwamps() {
setStrictChooseMode(true);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
// 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("{B}{B}{B}{B}", manaOptions);
}
}