* Added Celestial Convergence and some changes to game draw handling.

This commit is contained in:
LevelX2 2017-04-21 15:18:04 +02:00
parent 274e0f9052
commit e284922017
8 changed files with 278 additions and 31 deletions

View file

@ -107,6 +107,7 @@ public abstract class PlayerImpl implements Player, Serializable {
protected boolean human;
protected int life;
protected boolean wins;
protected boolean draws;
protected boolean loses;
protected Library library;
protected Cards sideboard;
@ -226,6 +227,7 @@ public abstract class PlayerImpl implements Player, Serializable {
this.human = player.human;
this.life = player.life;
this.wins = player.wins;
this.draws = player.draws;
this.loses = player.loses;
this.library = player.library.copy();
@ -391,6 +393,7 @@ public abstract class PlayerImpl implements Player, Serializable {
this.abilities.clear();
this.counters.clear();
this.wins = false;
this.draws = false;
this.loses = false;
this.left = false;
// reset is neccessary because in tournament player will be used for each round
@ -2190,6 +2193,16 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
@Override
public void drew(Game game) {
if (!hasLost()) {
this.draws = true;
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DRAW_PLAYER, null, null, playerId));
game.informPlayers("For " + this.getLogName() + " the game is a draw.");
game.gameOver(playerId);
}
}
@Override
public boolean hasLost() {
return this.loses;
@ -2197,7 +2210,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean isInGame() {
return !hasQuit() && !hasLost() && !hasWon() && !hasLeft();
return !hasQuit() && !hasLost() && !hasWon() && !hasDrew() && !hasLeft();
}
@Override
@ -2210,6 +2223,11 @@ public abstract class PlayerImpl implements Player, Serializable {
return !this.loses && this.wins;
}
@Override
public boolean hasDrew() {
return this.draws;
}
@Override
public void declareAttacker(UUID attackerId, UUID defenderId, Game game, boolean allowUndo) {
if (allowUndo) {