From 31163eec6d26486d4d8e205d3ce159775e588e72 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 12 Jul 2020 08:50:56 +0200 Subject: [PATCH] * Fixed that mana sources that produce any mana type that other sources produce (e.g. Reflecting Pool) could erroneously produce colorless mana from mana sources that could only produce any color mana (fixes #6814). --- Mage.Sets/src/mage/cards/a/AcademyRuins.java | 4 +-- .../test/cards/mana/ReflectingPoolTest.java | 28 ++++++++++++++++++- .../mana/AnyColorLandsProduceManaAbility.java | 8 ++---- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AcademyRuins.java b/Mage.Sets/src/mage/cards/a/AcademyRuins.java index 6c3f06bd42d..fc58483d3ac 100644 --- a/Mage.Sets/src/mage/cards/a/AcademyRuins.java +++ b/Mage.Sets/src/mage/cards/a/AcademyRuins.java @@ -26,9 +26,9 @@ public final class AcademyRuins extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.LAND},""); addSuperType(SuperType.LEGENDARY); - // {tap}: Add {C}. + // {T}: Add {C}. this.addAbility(new ColorlessManaAbility()); - // {1}{U}, {tap}: Put target artifact card from your graveyard on top of your library. + // {1}{U}, {T}: Put target artifact card from your graveyard on top of your library. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutOnLibraryTargetEffect(true), new ManaCostsImpl("{1}{U}")); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard"))); diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java index c1b6021bc36..6778a29a28f 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ReflectingPoolTest.java @@ -248,7 +248,7 @@ public class ReflectingPoolTest extends CardTestPlayerBase { public void testReflectingPoolAnyManaTapped() { // any mana source with tapped must allow use any too addCard(Zone.BATTLEFIELD, playerA, "Plains", 1); - addCard(Zone.BATTLEFIELD, playerA, "City of Brass", 1); + addCard(Zone.BATTLEFIELD, playerA, "City of Brass", 1); addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); addCard(Zone.BATTLEFIELD, playerA, "Upwelling", 1); @@ -266,4 +266,30 @@ public class ReflectingPoolTest extends CardTestPlayerBase { assertTapped("Reflecting Pool", false); Assert.assertEquals(1, playerA.getManaPool().get(ManaType.BLACK)); } + + /** + * I only control 3 lands, a Triome, a Reflecting Pool, and a Mana + * Confluence. The Reflecting Pool is able to tap for colorless, but it + * should not be able to. + * + * https://blogs.magicjudges.org/rulestips/2012/09/you-have-to-name-a-color-when-you-add-one-mana-of-any-color-to-your-mana-pool/ + */ + @Test + public void testWithTriomeAndManaConfluence() { + // {T}: Add {C}. + // {1}{U}, {T}: Put target artifact card from your graveyard on top of your library. + addCard(Zone.BATTLEFIELD, playerA, "Academy Ruins", 1); + // {T}, Pay 1 life: Add one mana of any color. + addCard(Zone.BATTLEFIELD, playerA, "Mana Confluence", 1); + // {T}: Add one mana of any type that a land you control could produce. + addCard(Zone.BATTLEFIELD, playerA, "Reflecting Pool", 1); + + setStopAt(1, PhaseStep.PRECOMBAT_MAIN); + execute(); + + ManaOptions options = playerA.getAvailableManaTest(currentGame); + Assert.assertEquals("Player A should be able to create only 3 different mana options", 2, options.size()); + assertManaOptions("{C}{C}{Any}", options); + assertManaOptions("{C}{Any}{Any}", options); + } } diff --git a/Mage/src/main/java/mage/abilities/mana/AnyColorLandsProduceManaAbility.java b/Mage/src/main/java/mage/abilities/mana/AnyColorLandsProduceManaAbility.java index 3df21cd459d..981e5ac83d3 100644 --- a/Mage/src/main/java/mage/abilities/mana/AnyColorLandsProduceManaAbility.java +++ b/Mage/src/main/java/mage/abilities/mana/AnyColorLandsProduceManaAbility.java @@ -140,16 +140,12 @@ class AnyColorLandsProduceManaEffect extends ManaEffect { if (!onlyColors && types.getColorless() > 0) { choice.getChoices().add("Colorless"); } - if (types.getAny() > 0) { + if (types.getAny() > 0) { // Only any Color choice.getChoices().add("Black"); choice.getChoices().add("Red"); choice.getChoices().add("Blue"); choice.getChoices().add("Green"); choice.getChoices().add("White"); - if (!onlyColors) { - choice.getChoices().add("Colorless"); - } - } if (!choice.getChoices().isEmpty()) { Player player = game.getPlayer(source.getControllerId()); @@ -199,7 +195,7 @@ class AnyColorLandsProduceManaEffect extends ManaEffect { for (Permanent land : lands) { Abilities mana = land.getAbilities().getActivatedManaAbilities(Zone.BATTLEFIELD); for (ActivatedManaAbilityImpl ability : mana) { - if (!ability.equals(source) && ability.definesMana(game)) { + if (!ability.getSourceId().equals(source.getSourceId()) && ability.definesMana(game)) { for (Mana netMana : ability.getNetMana(game)) { types.add(netMana); }