Added CAN_TAKE_MULLIGAN game event.

This commit is contained in:
LevelX2 2013-02-28 08:27:24 +01:00
parent 8c79a87af6
commit 955f5ea391
2 changed files with 11 additions and 1 deletions

View file

@ -587,7 +587,16 @@ public abstract class GameImpl<T extends GameImpl<T>> 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");

View file

@ -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,