diff --git a/Mage.Sets/src/mage/cards/e/ElkinLair.java b/Mage.Sets/src/mage/cards/e/ElkinLair.java index fc3e806532b..e57b06a63ed 100644 --- a/Mage.Sets/src/mage/cards/e/ElkinLair.java +++ b/Mage.Sets/src/mage/cards/e/ElkinLair.java @@ -35,7 +35,9 @@ public final class ElkinLair extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); addSuperType(SuperType.WORLD); - // At the beginning of each player's upkeep, that player exiles a card at random from their hand. The player may play that card this turn. At the beginning of the next end step, if the player hasn't played the card, they put it into their graveyard. + // At the beginning of each player's upkeep, that player exiles a card at random from their hand. + // The player may play that card this turn. + // At the beginning of the next end step, if the player hasn't played the card, they put it into their graveyard. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ElkinLairUpkeepEffect(), TargetController.ANY, false)); } @@ -74,28 +76,32 @@ class ElkinLairUpkeepEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player player = game.getPlayer(game.getActivePlayerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - if (player != null - && sourcePermanent != null) { - Card[] cards = player.getHand().getCards(new FilterCard(), game).toArray(new Card[0]); - if (cards.length > 0) { - Card card = cards[RandomUtil.nextInt(cards.length)]; - if (card != null) { - String exileName = sourcePermanent.getIdName() + " cardsInExile = game.getExile().getExileZone(source.getSourceId()).getCards(game); - if (cardsInExile != null) { - player.moveCardsToGraveyardWithInfo(cardsInExile, source, game, Zone.EXILED); - return true; - } + if (player == null) { + return false; } - return false; + + Set cardsInExile = game.getExile().getExileZone(source.getSourceId()).getCards(game); + if (cardsInExile == null) { + return false; + } + + player.moveCardsToGraveyardWithInfo(cardsInExile, source, game, Zone.EXILED); + return true; } @Override