mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
...
This commit is contained in:
parent
df642c2bd5
commit
3fa0e8b8f4
544 changed files with 13327 additions and 3074 deletions
|
|
@ -41,7 +41,7 @@ import mage.players.Player;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class FreeForAll extends GameImpl {
|
||||
public class FreeForAll extends GameImpl<FreeForAll> {
|
||||
|
||||
private int numPlayers;
|
||||
private List<UUID> mulliganed = new ArrayList<UUID>();
|
||||
|
|
@ -50,6 +50,14 @@ public class FreeForAll extends GameImpl {
|
|||
super(attackOption, range);
|
||||
}
|
||||
|
||||
public FreeForAll(final FreeForAll game) {
|
||||
super(game);
|
||||
this.numPlayers = game.numPlayers;
|
||||
for (UUID playerId: game.mulliganed) {
|
||||
mulliganed.add(playerId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameType getGameType() {
|
||||
return new FreeForAllType();
|
||||
|
|
@ -88,11 +96,16 @@ public class FreeForAll extends GameImpl {
|
|||
numCards += 1;
|
||||
mulliganed.add(playerId);
|
||||
}
|
||||
player.getLibrary().addAll(player.getHand());
|
||||
player.getLibrary().addAll(player.getHand().getCards(this));
|
||||
player.getHand().clear();
|
||||
player.shuffleLibrary(this);
|
||||
player.drawCards(numCards - 1, this);
|
||||
fireInformEvent(player.getName() + " mulligans down to " + Integer.toString(numCards - 1) + " cards");
|
||||
}
|
||||
|
||||
@Override
|
||||
public FreeForAll copy() {
|
||||
return new FreeForAll(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue