mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Added CAN_TAKE_MULLIGAN game event.
This commit is contained in:
parent
8c79a87af6
commit
955f5ea391
2 changed files with 11 additions and 1 deletions
|
@ -587,7 +587,16 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
||||||
//20091005 - 103.4
|
//20091005 - 103.4
|
||||||
for (UUID playerId: state.getPlayerList(startingPlayerId)) {
|
for (UUID playerId: state.getPlayerList(startingPlayerId)) {
|
||||||
Player player = getPlayer(playerId);
|
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());
|
mulligan(player.getId());
|
||||||
}
|
}
|
||||||
fireInformEvent(player.getName() + " keeps hand");
|
fireInformEvent(player.getName() + " keeps hand");
|
||||||
|
|
|
@ -102,6 +102,7 @@ public class GameEvent {
|
||||||
SEARCH_LIBRARY, LIBRARY_SEARCHED,
|
SEARCH_LIBRARY, LIBRARY_SEARCHED,
|
||||||
SHUFFLE_LIBRARY, LIBRARY_SHUFFLED,
|
SHUFFLE_LIBRARY, LIBRARY_SHUFFLED,
|
||||||
ENCHANT_PLAYER, ENCHANTED_PLAYER,
|
ENCHANT_PLAYER, ENCHANTED_PLAYER,
|
||||||
|
CAN_TAKE_MULLIGAN,
|
||||||
|
|
||||||
//permanent events
|
//permanent events
|
||||||
ENTERS_THE_BATTLEFIELD,
|
ENTERS_THE_BATTLEFIELD,
|
||||||
|
|
Loading…
Reference in a new issue