mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[MH2] Discerning Taste only gains life if cards actually put in graveyard
This commit is contained in:
parent
938c0e37aa
commit
825327cb8e
1 changed files with 12 additions and 9 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue