From 955f5ea391f71c8957360310a51ed739d7d1139a Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 28 Feb 2013 08:27:24 +0100 Subject: [PATCH] Added CAN_TAKE_MULLIGAN game event. --- Mage/src/mage/game/GameImpl.java | 11 ++++++++++- Mage/src/mage/game/events/GameEvent.java | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java index d57968d52f..34290dd590 100644 --- a/Mage/src/mage/game/GameImpl.java +++ b/Mage/src/mage/game/GameImpl.java @@ -587,7 +587,16 @@ public abstract class GameImpl> implements Game, Serializa //20091005 - 103.4 for (UUID playerId: state.getPlayerList(startingPlayerId)) { Player player = getPlayer(playerId); - while (player.getHand().size() > 0 && player.chooseMulligan(this)) { + GameEvent event = new GameEvent(GameEvent.EventType.CAN_TAKE_MULLIGAN, null, null, playerId); + while (player.getHand().size() > 0) { + if (replaceEvent(event)) { + continue; + } + fireEvent(event); + if (!player.chooseMulligan(this)) { + break; + } + mulligan(player.getId()); } fireInformEvent(player.getName() + " keeps hand"); diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index af97ed1b5d..8f1225e8f9 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -102,6 +102,7 @@ public class GameEvent { SEARCH_LIBRARY, LIBRARY_SEARCHED, SHUFFLE_LIBRARY, LIBRARY_SHUFFLED, ENCHANT_PLAYER, ENCHANTED_PLAYER, + CAN_TAKE_MULLIGAN, //permanent events ENTERS_THE_BATTLEFIELD,