From 04afceebeb0a029bc48841d77a386cfc268bfdf3 Mon Sep 17 00:00:00 2001 From: igoudt <igoudt@bol.com> Date: Wed, 24 May 2017 12:48:46 +0200 Subject: [PATCH] fix issue 3415 --- .../mage/cards/n/NarsetEnlightenedMaster.java | 5 ++- .../asthough/PlayFromNonHandZoneTest.java | 34 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java b/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java index 5435f7b888..d9e5da23fc 100644 --- a/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java +++ b/Mage.Sets/src/mage/cards/n/NarsetEnlightenedMaster.java @@ -33,6 +33,9 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.costs.Cost; +import mage.abilities.costs.Costs; +import mage.abilities.costs.CostsImpl; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; @@ -146,7 +149,7 @@ class NarsetEnlightenedMasterCastFromExileEffect extends AsThoughEffectImpl { if (card != null) { Player player = game.getPlayer(affectedControllerId); if (player != null) { - player.setCastSourceIdWithAlternateMana(objectId, null, null); + player.setCastSourceIdWithAlternateMana(objectId, null, card.getSpellAbility().getCosts()); return true; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java index 5868ed362d..8c59cbab3d 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/asthough/PlayFromNonHandZoneTest.java @@ -33,7 +33,6 @@ import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; /** - * * @author LevelX2 */ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { @@ -137,4 +136,37 @@ public class PlayFromNonHandZoneTest extends CardTestPlayerBase { } + @Test + public void testNarsetEnlightenedMasterAdditionalCost() { + // First strike + // Hexproof + // Whenever Narset, Enlightented Master attacks, exile the top four cards of your library. Until end of turn, you may cast noncreature cards exiled with Narset this turn without paying their mana costs. + skipInitShuffling(); + + addCard(Zone.BATTLEFIELD, playerB, "Narset, Enlightened Master", 1); + addCard(Zone.HAND, playerB, "Swamp"); + addCard(Zone.LIBRARY, playerB, "Plains"); + addCard(Zone.LIBRARY, playerB, "Plains"); + addCard(Zone.LIBRARY, playerB, "Plains"); + addCard(Zone.LIBRARY, playerB, "Cathartic Reunion"); + addCard(Zone.LIBRARY, playerB, "Forest"); + + attack(2, playerB, "Narset, Enlightened Master"); + + castSpell(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "Cathartic Reunion"); + setChoice(playerB, "Swamp^Forest"); + setStopAt(2, PhaseStep.END_TURN); + execute(); + + assertHandCount(playerB, 3); + assertGraveyardCount(playerB, "Forest", 1); + assertGraveyardCount(playerB, "Swamp", 1); + assertGraveyardCount(playerB, "Cathartic Reunion", 1); + assertGraveyardCount(playerB, 3); + assertExileCount(playerB, "Plains", 3); + assertExileCount(playerB, 3); + + + } + }