From 8b2c3e75e1840edf16293864f2bda067937de5ce Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 15 Apr 2013 17:56:06 +0200 Subject: [PATCH] Some minor changes to game classes. --- .../src/mage/game/FreeForAll.java | 7 ++++--- Mage/src/mage/game/GameImpl.java | 12 ++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java b/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java index 6b8ba22cbdd..704fac442a2 100644 --- a/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java +++ b/Mage.Server.Plugins/Mage.Game.FreeForAll/src/mage/game/FreeForAll.java @@ -28,7 +28,6 @@ package mage.game; -import mage.game.match.MatchType; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -36,6 +35,7 @@ import java.util.Set; import java.util.UUID; import mage.Constants.MultiplayerAttackOption; import mage.Constants.RangeOfInfluence; +import mage.game.match.MatchType; import mage.players.Player; /** @@ -82,8 +82,9 @@ public class FreeForAll extends GameImpl { public Set getOpponents(UUID playerId) { Set opponents = new HashSet(); for (UUID opponentId: this.getPlayer(playerId).getInRange()) { - if (!opponentId.equals(playerId)) + if (!opponentId.equals(playerId)) { opponents.add(opponentId); + } } return opponents; } @@ -100,8 +101,8 @@ public class FreeForAll extends GameImpl { player.getLibrary().addAll(player.getHand().getCards(this), this); player.getHand().clear(); player.shuffleLibrary(this); - player.drawCards(numCards - 1, this); fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards"); + player.drawCards(numCards - 1, this); } @Override diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index 9fec5e24e1a..6014f2a5c3e 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -1486,6 +1486,18 @@ public abstract class GameImpl> implements Game, Serializa return getActivePlayerId().equals(playerId) && getStack().isEmpty() && isMainPhase(); } + /** + * 800.4a When a player leaves the game, all objects (see rule 109) owned by that player leave + * the game and any effects which give that player control of any objects or players end. Then, + * if that player controlled any objects on the stack not represented by cards, those objects + * cease to exist. Then, if there are any objects still controlled by that player, those objects + * are exiled. This is not a state-based action. It happens as soon as the player leaves the game. + * If the player who left the game had priority at the time he or she left, priority passes to + * the next player in turn order who's still in the game. # + * + * @param playerId + */ + @Override public void leave(UUID playerId) { Player player = getPlayer(playerId);