* Fixed some more available mana calculation problems. Mana of the pool is now taken into account (e.g. Coal Golem problem). Crucible of the Spirit Dragon - Conditional mana curretnly not handled correctly in available mana calculation. Crystalline Crawler works now.Related to #6698.

This commit is contained in:
LevelX2 2020-07-16 22:37:51 +02:00
parent e3b2fa1240
commit 3a82840e66
16 changed files with 253 additions and 89 deletions

View file

@ -45,7 +45,7 @@ public class SpliceOnArcaneTest extends CardTestPlayerBase {
assertHandCount(playerA, "Through the Breach", 1);
assertPermanentCount(playerA, "Silvercoat Lion", 1);
assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
Assert.assertEquals("All available mana has to be used", 0, playerA.getManaAvailable(currentGame).size());
Assert.assertEquals("All available mana has to be used", "[]", playerA.getManaAvailable(currentGame).toString());
}
@Test

View file

@ -29,7 +29,7 @@ public class SasayaOrochiAscendantTest extends CardTestPlayerBase {
addCard(Zone.HAND, playerA, "Upwelling", 1); // Enchantment {3}{G}
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Reveal your hand: If you have seven or more land cards in your hand, flip");
activateManaAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}: Add {G}");
activateManaAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{T}: Add {G}");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Upwelling");
@ -38,7 +38,7 @@ public class SasayaOrochiAscendantTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Sasaya's Essence", 1);
assertPermanentCount(playerA, "Upwelling", 1);
@ -48,11 +48,11 @@ public class SasayaOrochiAscendantTest extends CardTestPlayerBase {
assertDuplicatedManaOptions(manaOptions);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{G}{G}{G}", manaOptions);
assertManaOptions("{G}{G}{G}{G}{G}", manaOptions);
}
@Test
@Test
public void testSasayasEssence2() {
addCard(Zone.HAND, playerA, "Plains", 7);
addCard(Zone.BATTLEFIELD, playerA, "Brushland", 3);
@ -73,26 +73,25 @@ public class SasayaOrochiAscendantTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Sasaya's Essence", 1);
assertPermanentCount(playerA, "Upwelling", 1);
assertManaPool(playerA, ManaType.GREEN, 2);
assertLife(playerA, 18);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
assertDuplicatedManaOptions(manaOptions);
Assert.assertEquals("mana variations don't fit", 3, manaOptions.size());
assertManaOptions("{C}{C}{C}", manaOptions);
assertManaOptions("{G}{G}{G}", manaOptions);
assertManaOptions("{W}{W}{W}", manaOptions);
assertManaOptions("{C}{C}{C}{G}{G}", manaOptions);
assertManaOptions("{G}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{W}{W}{W}{G}{G}", manaOptions);
}
@Test
}
@Test
public void testSasayasEssence3() {
addCard(Zone.HAND, playerA, "Plains", 7);
addCard(Zone.BATTLEFIELD, playerA, "Forest", 3);
@ -115,22 +114,22 @@ public class SasayaOrochiAscendantTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertPermanentCount(playerA, "Sasaya's Essence", 1);
assertPermanentCount(playerA, "Upwelling", 1);
assertManaPool(playerA, ManaType.GREEN, 2);
assertLife(playerA, 20);
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
assertDuplicatedManaOptions(manaOptions);
Assert.assertEquals("mana variations don't fit", 4, manaOptions.size());
assertManaOptions("{R}{R}{R}{R}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{R}{R}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{R}{G}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{G}{G}{G}{G}{G}{G}", manaOptions);
}
assertManaOptions("{R}{R}{R}{R}{G}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{R}{R}{G}{G}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{R}{G}{G}{G}{G}{G}{G}{G}", manaOptions);
assertManaOptions("{R}{G}{G}{G}{G}{G}{G}{G}{G}", manaOptions);
}
}

View file

@ -5,6 +5,7 @@ import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
import static org.mage.test.utils.ManaOptionsTestUtils.assertManaOptions;
@ -199,4 +200,44 @@ public class TappedForManaRelatedTest extends CardTestPlayerBase {
assertManaOptions("{U}", manaOptions);
assertManaOptions("{R}", manaOptions);
}
@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);
}
@Test
@Ignore // Because this is no mana ability, this mana will not be calculated during available mana calculation
public void TestDeathriteShaman() {
setStrictChooseMode(true);
// {T}: Exile target land card from a graveyard. Add one mana of any color.
// {B}, {T}: Exile target instant or sorcery card from a graveyard. Each opponent loses 2 life.
// {G}, {T}: Exile target creature card from a graveyard. You gain 2 life.
addCard(Zone.BATTLEFIELD, playerA, "Deathrite Shaman", 1);
addCard(Zone.GRAVEYARD, playerA, "Mountain", 3);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
ManaOptions manaOptions = playerA.getAvailableManaTest(currentGame);
Assert.assertEquals("mana variations don't fit", 1, manaOptions.size());
assertManaOptions("{Any}", manaOptions);
}
}