+ updateVariables(move)
+ {
+ super.updateVariables(move); //standard king
+ const piece = this.getPiece(move.start.x,move.start.y);
+ const c = this.getColor(move.start.x,move.start.y);
+ // "l" = Alice king
+ if (piece == "l")
+ {
+ this.kingPos[c][0] = move.appear[0].x;
+ this.kingPos[c][1] = move.appear[0].y;
+ this.castleFlags[c] = [false,false];
+ }
+ }
+
+ unupdateVariables(move)
+ {
+ super.unupdateVariables(move);
+ const c = this.getColor(move.start.x,move.start.y);
+ if (this.getPiece(move.start.x,move.start.y) == "l")
+ this.kingPos[c] = [move.start.x, move.start.y];
+ }
+
+ checkGameEnd()
+ {
+ const color = this.turn;
+ let sideBoard = this.getBoardOfPiece(this.kingPos[color]);
+ let saveBoard = this.board;
+ this.board = sideBoard;
+ let res = "*";
+ if (!this.isAttacked(this.kingPos[color], this.getOppCol(color)))
+ res = "1/2";
+ else
+ res = (color == "w" ? "0-1" : "1-0");
+ this.board = saveBoard;
+ return res;
+ }
+
+ static get VALUES() {
+ return {
+ 'p': 1,
+ 's': 1,
+ 'r': 5,
+ 'u': 5,
+ 'n': 3,
+ 'o': 3,
+ 'b': 3,
+ 'c': 3,
+ 'q': 9,
+ 't': 9,
+ 'k': 1000,
+ 'l': 1000
+ };
+ }
+