From e91b0a01d2e25997586b6014b8a5f9f89872c77c Mon Sep 17 00:00:00 2001 From: jeffwadsworth Date: Thu, 16 Jan 2020 14:36:05 -0600 Subject: [PATCH] - Fixed #6192 --- .../mage/cards/l/LagonnaBandStoryteller.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java b/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java index 4c7096c7b6..b8e13a99e0 100644 --- a/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java +++ b/Mage.Sets/src/mage/cards/l/LagonnaBandStoryteller.java @@ -18,6 +18,8 @@ import mage.players.Player; import mage.target.common.TargetCardInYourGraveyard; import java.util.UUID; +import mage.cards.Cards; +import mage.constants.Zone; /** * @author TheElk801 @@ -34,7 +36,9 @@ public final class LagonnaBandStoryteller extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(4); - // When Lagonna-Band Storyteller enters the battlefield, you may put target enchantment card from your graveyard on top of your library. If you do, you gain life equal to its converted mana cost. + // When Lagonna-Band Storyteller enters the battlefield, you may put target + // enchantment card from your graveyard on top of your library. + // If you do, you gain life equal to its converted mana cost. Ability ability = new EntersBattlefieldTriggeredAbility(new LagonnaBandStorytellerEffect(), true); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); @@ -54,8 +58,8 @@ class LagonnaBandStorytellerEffect extends OneShotEffect { LagonnaBandStorytellerEffect() { super(Outcome.Benefit); - staticText = "put target enchantment card from your graveyard on top of your library. " + - "If you do, you gain life equal to its converted mana cost."; + staticText = "put target enchantment card from your graveyard on top of your library. " + + "If you do, you gain life equal to its converted mana cost."; } private LagonnaBandStorytellerEffect(final LagonnaBandStorytellerEffect effect) { @@ -69,16 +73,19 @@ class LagonnaBandStorytellerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getSourceId()); + Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(source.getFirstTarget()); - if (player == null || card == null) { + if (controller == null + || card == null + || !card.isEnchantment() + || game.getState().getZone(card.getId()) != Zone.GRAVEYARD) { return false; } int cmc = card.getConvertedManaCost(); - if (!player.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false)) { - return false; + if (controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false)) { + controller.gainLife(cmc, game, source); + return true; } - player.gainLife(cmc, game, source); - return true; + return false; } -} \ No newline at end of file +}