From 7e6c1ede2a8a6de160e3ddc1627bb719a1a74ee2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 26 Apr 2014 18:40:32 +0200 Subject: [PATCH] * Ad Nauseam - Fixed log output of revealed and moved cards. --- .../mage/sets/shardsofalara/AdNauseam.java | 27 ++++++++----------- Mage/src/mage/game/Revealed.java | 7 ++--- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AdNauseam.java b/Mage.Sets/src/mage/sets/shardsofalara/AdNauseam.java index ebafdbbf1d..972d9ad47a 100644 --- a/Mage.Sets/src/mage/sets/shardsofalara/AdNauseam.java +++ b/Mage.Sets/src/mage/sets/shardsofalara/AdNauseam.java @@ -28,16 +28,15 @@ package mage.sets.shardsofalara; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.cards.CardImpl; -import mage.cards.Cards; import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -87,23 +86,19 @@ class AdNauseamEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { String message = "Reveal the top card of your library and put that card into your hand? You lose life equal to its converted mana cost."; Card sourceCard = game.getCard(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (player == null || sourceCard == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null || sourceCard == null) { return false; } - Cards cards = new CardsImpl(); - while (player.chooseUse(outcome, message, game) && player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); + while (controller.chooseUse(outcome, message, game) && controller.getLibrary().size() > 0) { + Card card = controller.getLibrary().removeFromTop(game); if (card != null) { - card.moveToZone(Zone.HAND, source.getSourceId(), game, true); - + controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY); int cmc = card.getManaCost().convertedManaCost(); if (cmc > 0) { - player.loseLife(cmc, game); + controller.loseLife(cmc, game); } - cards.add(card); - player.revealCards("card(s) from top of library put into hand by " + sourceCard.getName(), cards, game); - game.informPlayers(sourceCard.getName() + ": "+ player.getName() + " revealed " +card.getName() + " and lost " + cmc + " live"); + controller.revealCards(new StringBuilder(sourceCard.getName()).append(" put into hand").toString(), new CardsImpl(card), game); } } return true; diff --git a/Mage/src/mage/game/Revealed.java b/Mage/src/mage/game/Revealed.java index fd0df46ce2..f7400ca874 100644 --- a/Mage/src/mage/game/Revealed.java +++ b/Mage/src/mage/game/Revealed.java @@ -56,10 +56,11 @@ public class Revealed extends HashMap implements Serializable, Co } public void add(String name, Cards cards) { - if (!this.containsKey(name)) { - createRevealed(name); + if (this.containsKey(name)) { + this.get(name).addAll(cards); + } else { + this.put(name, cards.copy()); } - this.put(name, cards.copy()); } public Cards createRevealed(String name) {