Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Piece ghost;
- if (highlighted != null && (ghost = highlighted.tryClickGhost()) != null) {
- if (currentPlayer == 0)
- currentPlayer = ghost.getArmy();
- highlighted.move(ghost);
- if (ghost.getVictim() != null)
- pieces.remove(ghost.getVictim());
- for (Piece piece : pieces)
- piece.computeGhosts(this);
- for (Piece newGhost : highlighted.getGhosts())
- if (newGhost.getVictim() != null) {
- extraRound = true;
- return;
- }
- highlighted = null;
- currentPlayer = currentPlayer == 1 ? 2 : 1;
- return;
- }
- for (Piece piece : pieces) {
- if (piece.isClickable() && (currentPlayer == 0 || currentPlayer == piece.getArmy())) {
- highlighted = piece == highlighted ? null : piece;
- if (highlighted == null && extraRound) {
- extraRound = false;
- currentPlayer = currentPlayer == 1 ? 2 : 1;
- }
- break;
- }
- }
Add Comment
Please, Sign In to add comment