diff --git a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java index 71baafc456..a11af61489 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java +++ b/Mage.Sets/src/mage/cards/e/ExtraplanarLens.java @@ -127,6 +127,7 @@ class ExtraplanarLensTriggeredAbility extends TriggeredManaAbility { ManaEvent mEvent = (ManaEvent) event; for (Effect effect : getEffects()) { effect.setValue("mana", mEvent.getMana()); + effect.setValue("tappedPermanent", landTappedForMana); } getEffects().get(0).setTargetPointer(new FixedTarget(landTappedForMana.getId())); return true; diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/mana/ExtraplanarLensTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ExtraplanarLensTest.java new file mode 100644 index 0000000000..0d9e4e8bfc --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/mana/ExtraplanarLensTest.java @@ -0,0 +1,69 @@ +package org.mage.test.cards.mana; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +public class ExtraplanarLensTest extends CardTestPlayerBase { + + // Imprint - When Extraplanar Lens enters the battlefield, you may exile target land you control. + // Whenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana of any type that land produced. + private final String lens = "Extraplanar Lens"; + // + private final String snow_covered_forest = "Snow-Covered Forest"; + private final String forest = "Forest"; + + + // issue 8050 + // Extraplanar Lens is not working when I exiled a snow-covered land + + @Test + public void add_snow_mana() { + addCard(Zone.HAND, playerA, lens); + addCard(Zone.BATTLEFIELD, playerA, snow_covered_forest, 10); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lens); + setChoice(playerA, "Yes"); + addTarget(playerA, snow_covered_forest); + + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}"); + checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "G", 2); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + + assertPermanentCount(playerA, lens, 1); + assertExileCount(snow_covered_forest, 1); + + + } + + @Test + public void add_regular_mana() { + addCard(Zone.HAND, playerA, lens); + addCard(Zone.BATTLEFIELD, playerA, forest, 10); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lens); + setChoice(playerA, "Yes"); + addTarget(playerA, forest); + + waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN); + + activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {G}"); + checkManaPool("mana", 1, PhaseStep.PRECOMBAT_MAIN, playerA, "G", 2); + + setStopAt(1, PhaseStep.POSTCOMBAT_MAIN); + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + assertPermanentCount(playerA, lens, 1); + assertExileCount(forest, 1); + + + } +}