From 825327cb8e82529bdd4b219e4f419cfa5c5ea5c8 Mon Sep 17 00:00:00 2001 From: "Alex W. Jackson" Date: Wed, 28 Sep 2022 22:32:18 -0400 Subject: [PATCH] [MH2] Discerning Taste only gains life if cards actually put in graveyard --- .../src/mage/cards/d/DiscerningTaste.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DiscerningTaste.java b/Mage.Sets/src/mage/cards/d/DiscerningTaste.java index af77e13612..79afbce533 100644 --- a/Mage.Sets/src/mage/cards/d/DiscerningTaste.java +++ b/Mage.Sets/src/mage/cards/d/DiscerningTaste.java @@ -1,7 +1,7 @@ package mage.cards.d; -import java.util.UUID; - +import mage.MageInt; +import mage.MageObject; import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; @@ -11,10 +11,13 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.Cards; import mage.constants.CardType; +import mage.constants.Zone; import mage.filter.StaticFilters; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * * @author weirddan455 @@ -56,13 +59,13 @@ class DiscerningTasteEffect extends LookLibraryAndPickControllerEffect { @Override protected boolean actionWithPickedCards(Game game, Ability source, Player player, Cards pickedCards, Cards otherCards) { super.actionWithPickedCards(game, source, player, pickedCards, otherCards); - int life = 0; - for (Card card : otherCards.getCards(StaticFilters.FILTER_CARD_CREATURE, game)) { - int power = card.getPower().getValue(); - if (power > life) { - life = power; - } - } + otherCards.retainZone(Zone.GRAVEYARD, game); + int life = otherCards.getCards(StaticFilters.FILTER_CARD_CREATURE, game) + .stream() + .map(MageObject::getPower) + .mapToInt(MageInt::getValue) + .max() + .orElse(0); player.gainLife(life, game, source); return true; }