diff --git a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java index 390b7a0423..55c564ca7f 100644 --- a/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java +++ b/Mage.Client/src/main/java/mage/client/draft/DraftPanel.java @@ -171,7 +171,7 @@ int left = draftView.getPlayers().size() - right; int height = left * 18; lblTableImage.setSize(new Dimension(lblTableImage.getWidth(), height)); - Image tableImage = ImageHelper.getImageFromResources((draftView.getBoosterNum() + 1) % 2 == 1 ? "/draft/table_left.png" : "/draft/table_right.png"); + Image tableImage = ImageHelper.getImageFromResources(draftView.getBoosterNum() % 2 == 1 ? "/draft/table_left.png" : "/draft/table_right.png"); BufferedImage resizedTable = ImageHelper.getResizedImage(BufferedImageBuilder.bufferImage(tableImage, BufferedImage.TYPE_INT_ARGB), lblTableImage.getWidth(), lblTableImage.getHeight()); lblTableImage.setIcon(new ImageIcon(resizedTable)); diff --git a/Mage.Common/src/main/java/mage/view/DraftView.java b/Mage.Common/src/main/java/mage/view/DraftView.java index b1f2b960a4..9b0100c74d 100644 --- a/Mage.Common/src/main/java/mage/view/DraftView.java +++ b/Mage.Common/src/main/java/mage/view/DraftView.java @@ -19,8 +19,8 @@ public class DraftView implements Serializable { private final List sets = new ArrayList<>(); private final List setCodes = new ArrayList<>(); - private final int boosterNum; - private final int cardNum; + private final int boosterNum; // starts with 1 + private final int cardNum; // starts with 1 private final List players = new ArrayList<>(); public DraftView(Draft draft) { diff --git a/Mage.Sets/src/mage/cards/c/ChaosMoon.java b/Mage.Sets/src/mage/cards/c/ChaosMoon.java index 262bebbf48..6741496ba7 100644 --- a/Mage.Sets/src/mage/cards/c/ChaosMoon.java +++ b/Mage.Sets/src/mage/cards/c/ChaosMoon.java @@ -84,7 +84,7 @@ class ChaosMoonEffect extends OneShotEffect { StaticFilters.FILTER_PERMANENT, source.getSourceId(), source.getControllerId(), game ); // Odd - if (permanentsInPlay % 2 != 0) { + if (permanentsInPlay % 2 == 1) { game.addEffect(new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false), source); new CreateDelayedTriggeredAbilityEffect(new ChaosMoonOddTriggeredAbility()).apply(game, source); } // Even diff --git a/Mage/src/main/java/mage/game/draft/BoosterDraft.java b/Mage/src/main/java/mage/game/draft/BoosterDraft.java index ee5901a05f..152834226b 100644 --- a/Mage/src/main/java/mage/game/draft/BoosterDraft.java +++ b/Mage/src/main/java/mage/game/draft/BoosterDraft.java @@ -24,10 +24,11 @@ public class BoosterDraft extends DraftImpl { cardNum = 1; fireUpdatePlayersEvent(); while (!isAbort() && pickCards()) { - if ((boosterNum + 1) % 2 == 1) { - passLeft(); + // pass booster order: left -> right -> left + if (boosterNum % 2 == 1) { + passBoosterToLeft(); } else { - passRight(); + passBoosterToRight(); } fireUpdatePlayersEvent(); } diff --git a/Mage/src/main/java/mage/game/draft/DraftImpl.java b/Mage/src/main/java/mage/game/draft/DraftImpl.java index cadea09ddc..9a78e7e98d 100644 --- a/Mage/src/main/java/mage/game/draft/DraftImpl.java +++ b/Mage/src/main/java/mage/game/draft/DraftImpl.java @@ -149,11 +149,11 @@ public abstract class DraftImpl implements Draft { this.addPick(playerId, booster.get(booster.size()-1).getId(), null); } - protected void passLeft() { + protected void passBoosterToLeft() { synchronized (players) { UUID startId = table.get(0); UUID currentId = startId; - UUID nextId = table.getNext(); + UUID nextId = table.getNext(); // getNext return left player by default DraftPlayer current = players.get(currentId); DraftPlayer next = players.get(nextId); List currentBooster = current.booster; @@ -170,11 +170,11 @@ public abstract class DraftImpl implements Draft { } } - protected void passRight() { + protected void passBoosterToRight() { synchronized (players) { UUID startId = table.get(0); UUID currentId = startId; - UUID prevId = table.getPrevious(); + UUID prevId = table.getPrevious(); // getPrevious return right player by default DraftPlayer current = players.get(currentId); DraftPlayer prev = players.get(prevId); List currentBooster = current.booster; diff --git a/Mage/src/main/java/mage/game/draft/RichManBoosterDraft.java b/Mage/src/main/java/mage/game/draft/RichManBoosterDraft.java index b8b63f5e05..8f7e3ca70e 100644 --- a/Mage/src/main/java/mage/game/draft/RichManBoosterDraft.java +++ b/Mage/src/main/java/mage/game/draft/RichManBoosterDraft.java @@ -32,7 +32,8 @@ public class RichManBoosterDraft extends DraftImpl { cardNum = 1; fireUpdatePlayersEvent(); while (!isAbort() && pickCards()) { - passLeft(); + // new booster each time, so order is irrelevant + passBoosterToLeft(); fireUpdatePlayersEvent(); } boosterNum++; @@ -42,7 +43,7 @@ public class RichManBoosterDraft extends DraftImpl { } @Override - protected void passLeft() { + protected void passBoosterToLeft() { synchronized (players) { UUID startId = table.get(0); UUID currentId = startId; diff --git a/Mage/src/main/java/mage/game/draft/RichManCubeBoosterDraft.java b/Mage/src/main/java/mage/game/draft/RichManCubeBoosterDraft.java index 7045e0b70b..e2d9c02361 100644 --- a/Mage/src/main/java/mage/game/draft/RichManCubeBoosterDraft.java +++ b/Mage/src/main/java/mage/game/draft/RichManCubeBoosterDraft.java @@ -30,7 +30,8 @@ public class RichManCubeBoosterDraft extends DraftImpl { cardNum = 1; fireUpdatePlayersEvent(); while (!isAbort() && pickCards()) { - passLeft(); + // new booster each time, so order is irrelevant + passBoosterToLeft(); fireUpdatePlayersEvent(); } boosterNum++; @@ -40,7 +41,7 @@ public class RichManCubeBoosterDraft extends DraftImpl { } @Override - protected void passLeft() { + protected void passBoosterToLeft() { synchronized (players) { UUID startId = table.get(0); UUID currentId = startId; diff --git a/Mage/src/main/java/mage/players/PlayerList.java b/Mage/src/main/java/mage/players/PlayerList.java index 11ae44c057..3a884c16da 100644 --- a/Mage/src/main/java/mage/players/PlayerList.java +++ b/Mage/src/main/java/mage/players/PlayerList.java @@ -6,6 +6,8 @@ import mage.util.CircularList; import java.util.UUID; /** + * Default players order: left (next player seated to the active player's left) + * * @author BetaSteward_at_googlemail.com */ public class PlayerList extends CircularList { @@ -34,7 +36,9 @@ public class PlayerList extends CircularList { } /** - * checkNextTurnReached - use it turns/priority code only to mark leaved player as "reached next turn end" (need for some continous effects) + * Find next player. Default order: next player from the left + * + * @checkNextTurnReached - use it turns/priority code only to mark leaved player as "reached next turn end" (need for some continous effects) */ public Player getNext(Game game, boolean checkNextTurnReached) { UUID start = this.get();