- ChangeZoneAllEffect: don't ask to order cards when they're going to end up being randomized.

This commit is contained in:
Michael Kamensky
2021-11-08 07:16:20 +03:00
parent 564873d05d
commit e2e32204e2

View File

@@ -137,8 +137,9 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
final int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0;
if (!random) {
if ((destination == ZoneType.Library || destination == ZoneType.PlanarDeck)
&& !sa.hasParam("Shuffle") && cards.size() >= 2 && !random) {
&& !sa.hasParam("Shuffle") && cards.size() >= 2) {
Player p = AbilityUtils.getDefinedPlayers(source, sa.getParamOrDefault("DefinedPlayer", "You"), sa).get(0);
cards = (CardCollection) p.getController().orderMoveToZoneList(cards, destination, sa);
//the last card in this list will be the closest to the top, but we want the first card to be closest.
@@ -147,6 +148,7 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
} else {
cards = (CardCollection) GameActionUtil.orderCardsByTheirOwners(game, cards, destination, sa);
}
}
if (destination.equals(ZoneType.Library) && random) {
CardLists.shuffle(cards);