Tsskyx

Untitled

Dec 9th, 2021 (edited)
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. Piece ghost;
  2.  
  3. if (highlighted != null && (ghost = highlighted.tryClickGhost()) != null) {
  4.     if (currentPlayer == 0)
  5.         currentPlayer = ghost.getArmy();
  6.     highlighted.move(ghost);
  7.     if (ghost.getVictim() != null)
  8.         pieces.remove(ghost.getVictim());
  9.     for (Piece piece : pieces)
  10.         piece.computeGhosts(this);
  11.     for (Piece newGhost : highlighted.getGhosts())
  12.         if (newGhost.getVictim() != null) {
  13.             extraRound = true;
  14.             return;
  15.         }
  16.     highlighted = null;
  17.     currentPlayer = currentPlayer == 1 ? 2 : 1;
  18.     return;
  19. }
  20.  
  21. for (Piece piece : pieces) {
  22.     if (piece.isClickable() && (currentPlayer == 0 || currentPlayer == piece.getArmy())) {
  23.         highlighted = piece == highlighted ? null : piece;
  24.         if (highlighted == null && extraRound) {
  25.             extraRound = false;
  26.             currentPlayer = currentPlayer == 1 ? 2 : 1;
  27.         }
  28.         break;
  29.     }
  30. }
Add Comment
Please, Sign In to add comment