diff --git a/Mage.Sets/src/mage/cards/a/AstralCornucopia.java b/Mage.Sets/src/mage/cards/a/AstralCornucopia.java index cac362f10d..9560fa3421 100644 --- a/Mage.Sets/src/mage/cards/a/AstralCornucopia.java +++ b/Mage.Sets/src/mage/cards/a/AstralCornucopia.java @@ -107,6 +107,6 @@ class AstralCornucopiaManaEffect extends ManaEffect { } ManaType chosenType = ManaType.findByName(choice.getChoice()); - return chosenType == null ? null : new Mana(chosenType); + return chosenType == null ? null : new Mana(chosenType, counters); } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/bng/AstralCornucopiaTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/bng/AstralCornucopiaTest.java new file mode 100644 index 0000000000..1146801cd0 --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/bng/AstralCornucopiaTest.java @@ -0,0 +1,45 @@ +package org.mage.test.cards.single.bng; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import mage.counters.CounterType; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * {@link mage.cards.a.AstralCornucopia Astral Cornucopia} + * Artifact + * {X}{X}{X} + * Astral Cornucopia enters the battlefield with X charge counters on it. + * {T}: Choose a color. Add one mana of that color for each charge counter on Astral Cornucopia. + */ +public class AstralCornucopiaTest extends CardTestPlayerBase { + + private static final String astralCornucopia = "Astral Cornucopia"; + + /** + * Reported bug: https://github.com/magefree/mage/issues/9392 + * + * Astral Cornucopia taps for 1 mana regardless of how many charge counters it has on it. + */ + @Test + public void testCorrectManaAmount() { + // Artifact {2} + String arcaneSignet = "Arcane Signet"; + + addCard(Zone.BATTLEFIELD, playerA, "Plains", 6); + addCard(Zone.HAND, playerA, astralCornucopia); + addCard(Zone.HAND, playerA, arcaneSignet); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, astralCornucopia, true); + setChoice(playerA, "X=2"); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, arcaneSignet); + + execute(); + + assertPermanentCount(playerA, astralCornucopia,1 ); + assertCounterCount(playerA, astralCornucopia, CounterType.CHARGE, 2); + assertPermanentCount(playerA, arcaneSignet, 1); + } +}