forked from External/mage
* Fixed some problems with getting cards at random from collection that could cause loops.
This commit is contained in:
parent
5fa20278b0
commit
4dd196f373
20 changed files with 134 additions and 160 deletions
|
|
@ -177,18 +177,7 @@ public class LookLibraryControllerEffect extends OneShotEffect {
|
|||
switch (targetZoneLookedCards) {
|
||||
case LIBRARY:
|
||||
if (putOnTop) {
|
||||
player.putCardsOnTopOfLibrary(cards, game, source, true);
|
||||
} else {
|
||||
if (backInRandomOrder) {
|
||||
Cards newOrder = new CardsImpl();
|
||||
while (!cards.isEmpty()) {
|
||||
Card card = cards.getRandom(game);
|
||||
newOrder.add(card);
|
||||
cards.remove(card);
|
||||
}
|
||||
cards = newOrder;
|
||||
}
|
||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||
player.putCardsOnBottomOfLibrary(cards, game, source, !backInRandomOrder);
|
||||
}
|
||||
break;
|
||||
case GRAVEYARD:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue