From 090009ffa3c73a69f24f9e3f80f04a674e9f62f9 Mon Sep 17 00:00:00 2001 From: Agetian Date: Mon, 25 May 2015 11:59:32 +0000 Subject: [PATCH] - Reveal and announce the cards drawn when playing with the top of the library revealed (currently does not announce when drawing one card by one since a card on the top of the library can easily be seen in that case, to avoid message box spam). --- .../src/main/java/forge/game/player/Player.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/forge-game/src/main/java/forge/game/player/Player.java b/forge-game/src/main/java/forge/game/player/Player.java index 26e2ca29417..185d791e181 100644 --- a/forge-game/src/main/java/forge/game/player/Player.java +++ b/forge-game/src/main/java/forge/game/player/Player.java @@ -1038,11 +1038,12 @@ public class Player extends GameEntity implements Comparable { public final CardCollectionView drawCards(final int n) { final CardCollection drawn = new CardCollection(); + boolean isDrawingMultipleCards = n > 1; for (int i = 0; i < n; i++) { if (!canDraw()) { return drawn; } - drawn.addAll(doDraw()); + drawn.addAll(doDraw(isDrawingMultipleCards)); } return drawn; } @@ -1050,7 +1051,7 @@ public class Player extends GameEntity implements Comparable { /** * @return a CardCollectionView of cards actually drawn */ - private CardCollectionView doDraw() { + private CardCollectionView doDraw(boolean multipleCards) { final CardCollection drawn = new CardCollection(); final PlayerZone library = getZone(ZoneType.Library); @@ -1065,10 +1066,13 @@ public class Player extends GameEntity implements Comparable { if (!library.isEmpty()) { Card c = library.get(0); + boolean topCardRevealed = c.hasKeyword("Your opponent may look at this card."); c = game.getAction().moveToHand(c); drawn.add(c); - if (numDrawnThisTurn == 0) { + if (multipleCards && topCardRevealed) { + game.getAction().reveal(drawn, this, true, "Revealing the card drawn from "); + } else if (numDrawnThisTurn == 0) { boolean reveal = false; final CardCollectionView cards = getCardsIn(ZoneType.Battlefield); for (final Card card : cards) { @@ -1081,7 +1085,7 @@ public class Player extends GameEntity implements Comparable { if (reveal) { game.getAction().reveal(drawn, this, true, "Revealing the first card drawn from "); } - } + } setLastDrawnCard(c); c.setDrawnThisTurn(true);