diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/StreamOfConsciousness.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/StreamOfConsciousness.java index 2c43beec4c..bf3df01a3c 100644 --- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/StreamOfConsciousness.java +++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/StreamOfConsciousness.java @@ -105,7 +105,7 @@ class StreamOfConsciousnessEffect extends OneShotEffect { } } for (Player player: usingPlayers) { - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } return true; } diff --git a/Mage.Sets/src/mage/sets/commander2013/LimDulsVault.java b/Mage.Sets/src/mage/sets/commander2013/LimDulsVault.java index 17db75ab9e..2fb27daa83 100644 --- a/Mage.Sets/src/mage/sets/commander2013/LimDulsVault.java +++ b/Mage.Sets/src/mage/sets/commander2013/LimDulsVault.java @@ -111,7 +111,7 @@ class LimDulsVaultEffect extends OneShotEffect { if (doAgain) { player.loseLife(1, game); } else { - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } TargetCard target = new TargetCard(Zone.PICK, new FilterCard(doAgain ? textBottom : textTop)); diff --git a/Mage.Sets/src/mage/sets/dissension/LoamingShaman.java b/Mage.Sets/src/mage/sets/dissension/LoamingShaman.java index e74a4ae9dd..baa75e4195 100644 --- a/Mage.Sets/src/mage/sets/dissension/LoamingShaman.java +++ b/Mage.Sets/src/mage/sets/dissension/LoamingShaman.java @@ -103,7 +103,7 @@ class LoamingShamanEffect extends OneShotEffect { card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); } } - targetPlayer.getLibrary().shuffle(); + targetPlayer.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/gatecrash/UnexpectedResults.java b/Mage.Sets/src/mage/sets/gatecrash/UnexpectedResults.java index f831c66e4c..ecd1e57e76 100644 --- a/Mage.Sets/src/mage/sets/gatecrash/UnexpectedResults.java +++ b/Mage.Sets/src/mage/sets/gatecrash/UnexpectedResults.java @@ -113,7 +113,7 @@ class UnexpectedResultEffect extends OneShotEffect { return false; } if (controller.getLibrary().size() > 0) { - controller.getLibrary().shuffle(); + controller.shuffleLibrary(game); Card card = controller.getLibrary().getFromTop(game); if (card == null) { return false; diff --git a/Mage.Sets/src/mage/sets/innistrad/MemorysJourney.java b/Mage.Sets/src/mage/sets/innistrad/MemorysJourney.java index 9f75a7c3ea..4eeef82898 100644 --- a/Mage.Sets/src/mage/sets/innistrad/MemorysJourney.java +++ b/Mage.Sets/src/mage/sets/innistrad/MemorysJourney.java @@ -109,7 +109,7 @@ class MemorysJourneyEffect extends OneShotEffect { } } if (shuffle) { - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } return true; } diff --git a/Mage.Sets/src/mage/sets/lorwyn/PrimalCommand.java b/Mage.Sets/src/mage/sets/lorwyn/PrimalCommand.java index 9fda7dde88..91b129ad18 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/PrimalCommand.java +++ b/Mage.Sets/src/mage/sets/lorwyn/PrimalCommand.java @@ -123,7 +123,7 @@ class PrimalCommandShuffleGraveyardEffect extends OneShotEffect { } if (count > 0) { - player.getLibrary().shuffle(); + player.shuffleLibrary(game); } permanentsCount.put(player.getId(), count); diff --git a/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java b/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java index f023492bf8..5ec18226e8 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java +++ b/Mage.Sets/src/mage/sets/modernmasters/Riftsweeper.java @@ -106,7 +106,7 @@ class RiftsweeperEffect extends OneShotEffect { card.getCounters().clear(); // move to exile card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); - game.getPlayer(card.getOwnerId()).getLibrary().shuffle(); + game.getPlayer(card.getOwnerId()).shuffleLibrary(game); game.informPlayers(new StringBuilder("Riftsweeper: Choosen card was ").append(card.getName()).toString()); return true; } diff --git a/Mage.Sets/src/mage/sets/morningtide/Deglamer.java b/Mage.Sets/src/mage/sets/morningtide/Deglamer.java index 82e53a8324..b90f9fb465 100644 --- a/Mage.Sets/src/mage/sets/morningtide/Deglamer.java +++ b/Mage.Sets/src/mage/sets/morningtide/Deglamer.java @@ -99,7 +99,7 @@ class DeglamerShuffleIntoLibraryEffect extends OneShotEffect { if (c != null) { player.getGraveyard().remove(c); player.getLibrary().putOnTop(c, game); - player.getLibrary().shuffle(); + player.shuffleLibrary(game); return true; } diff --git a/Mage.Sets/src/mage/sets/urzassaga/SerraAvatar.java b/Mage.Sets/src/mage/sets/urzassaga/SerraAvatar.java index 6ac1bf37e2..252314ef00 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/SerraAvatar.java +++ b/Mage.Sets/src/mage/sets/urzassaga/SerraAvatar.java @@ -91,7 +91,7 @@ class SerraAvatarEffect extends OneShotEffect { if (c != null) { player.getGraveyard().remove(c); player.getLibrary().putOnTop(c, game); - player.getLibrary().shuffle(); + player.shuffleLibrary(game); return true; } diff --git a/Mage.Sets/src/mage/sets/worldwake/SelectiveMemory.java b/Mage.Sets/src/mage/sets/worldwake/SelectiveMemory.java index ccfd6325c5..0d9ec0fb21 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SelectiveMemory.java +++ b/Mage.Sets/src/mage/sets/worldwake/SelectiveMemory.java @@ -96,7 +96,7 @@ class SelectiveMemoryEffect extends OneShotEffect { } } - player.getLibrary().shuffle(); + player.shuffleLibrary(game); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForAncientSecrets.java b/Mage.Sets/src/mage/sets/zendikar/QuestForAncientSecrets.java index 38bea8003e..b086ab18c1 100644 --- a/Mage.Sets/src/mage/sets/zendikar/QuestForAncientSecrets.java +++ b/Mage.Sets/src/mage/sets/zendikar/QuestForAncientSecrets.java @@ -135,7 +135,7 @@ class QuestForAncientSecretsEffect extends OneShotEffect { sb.append(" (add ").append(CardUtil.numberToText(tributeValue)).append(" +1/+1 counter"); sb.append(tributeValue > 1 ? "s":"").append("to it)?"); if (opponent.chooseUse(outcome, sb.toString(), game)) { - sourcePermanent.addCounters(CounterType.P1P1.createInstance(tributeValue), game); + game.informPlayers(new StringBuilder(opponent.getName()).append(" pays tribute to ").append(sourcePermanent.getName()).toString()); game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "yes"); + return new AddCountersSourceEffect(CounterType.P1P1.createInstance(tributeValue), true).apply(game, source); } else { + game.informPlayers(new StringBuilder(opponent.getName()).append(" does not pay tribute to ").append(sourcePermanent.getName()).toString()); game.getState().setValue(new StringBuilder("tributeValue").append(source.getSourceId()).toString(), "no"); } return true; diff --git a/Mage/src/mage/players/Library.java b/Mage/src/mage/players/Library.java index 1efb204f89..0995d0df1b 100644 --- a/Mage/src/mage/players/Library.java +++ b/Mage/src/mage/players/Library.java @@ -60,6 +60,10 @@ public class Library implements Serializable { } } + /** + * Don't use this directly. + * Use instead. + */ public void shuffle() { UUID[] shuffled = library.toArray(new UUID[0]); for (int n = shuffled.length - 1; n > 0; n--) { diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index ec054c112d..333792d4ea 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1004,6 +1004,7 @@ public abstract class PlayerImpl> implements Player, Ser public void shuffleLibrary(Game game) { if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.SHUFFLE_LIBRARY, playerId, playerId))) { this.library.shuffle(); + game.informPlayers(new StringBuilder(this.name).append(" shuffels his or her library.").toString()); game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LIBRARY_SHUFFLED, playerId, playerId)); } }