- 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,15 +137,17 @@ public class ChangeZoneAllEffect extends SpellAbilityEffect {
final int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0; final int libraryPos = sa.hasParam("LibraryPosition") ? Integer.parseInt(sa.getParam("LibraryPosition")) : 0;
if ((destination == ZoneType.Library || destination == ZoneType.PlanarDeck) if (!random) {
&& !sa.hasParam("Shuffle") && cards.size() >= 2 && !random) { if ((destination == ZoneType.Library || destination == ZoneType.PlanarDeck)
Player p = AbilityUtils.getDefinedPlayers(source, sa.getParamOrDefault("DefinedPlayer", "You"), sa).get(0); && !sa.hasParam("Shuffle") && cards.size() >= 2) {
cards = (CardCollection) p.getController().orderMoveToZoneList(cards, destination, sa); Player p = AbilityUtils.getDefinedPlayers(source, sa.getParamOrDefault("DefinedPlayer", "You"), sa).get(0);
//the last card in this list will be the closest to the top, but we want the first card to be closest. cards = (CardCollection) p.getController().orderMoveToZoneList(cards, destination, sa);
//so reverse it here before moving them to the library. //the last card in this list will be the closest to the top, but we want the first card to be closest.
java.util.Collections.reverse(cards); //so reverse it here before moving them to the library.
} else { java.util.Collections.reverse(cards);
cards = (CardCollection) GameActionUtil.orderCardsByTheirOwners(game, cards, destination, sa); } else {
cards = (CardCollection) GameActionUtil.orderCardsByTheirOwners(game, cards, destination, sa);
}
} }
if (destination.equals(ZoneType.Library) && random) { if (destination.equals(ZoneType.Library) && random) {