- 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).

This commit is contained in:
Agetian
2015-05-25 11:59:32 +00:00
parent b3513df03b
commit 090009ffa3

View File

@@ -1038,11 +1038,12 @@ public class Player extends GameEntity implements Comparable<Player> {
public final CardCollectionView drawCards(final int n) { public final CardCollectionView drawCards(final int n) {
final CardCollection drawn = new CardCollection(); final CardCollection drawn = new CardCollection();
boolean isDrawingMultipleCards = n > 1;
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
if (!canDraw()) { if (!canDraw()) {
return drawn; return drawn;
} }
drawn.addAll(doDraw()); drawn.addAll(doDraw(isDrawingMultipleCards));
} }
return drawn; return drawn;
} }
@@ -1050,7 +1051,7 @@ public class Player extends GameEntity implements Comparable<Player> {
/** /**
* @return a CardCollectionView of cards actually drawn * @return a CardCollectionView of cards actually drawn
*/ */
private CardCollectionView doDraw() { private CardCollectionView doDraw(boolean multipleCards) {
final CardCollection drawn = new CardCollection(); final CardCollection drawn = new CardCollection();
final PlayerZone library = getZone(ZoneType.Library); final PlayerZone library = getZone(ZoneType.Library);
@@ -1065,10 +1066,13 @@ public class Player extends GameEntity implements Comparable<Player> {
if (!library.isEmpty()) { if (!library.isEmpty()) {
Card c = library.get(0); Card c = library.get(0);
boolean topCardRevealed = c.hasKeyword("Your opponent may look at this card.");
c = game.getAction().moveToHand(c); c = game.getAction().moveToHand(c);
drawn.add(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; boolean reveal = false;
final CardCollectionView cards = getCardsIn(ZoneType.Battlefield); final CardCollectionView cards = getCardsIn(ZoneType.Battlefield);
for (final Card card : cards) { for (final Card card : cards) {