+ return ChessRules.PIECES.concat([V.ANTIKING]);
+ }
+
+ setOtherVariables(fen)
+ {
+ super.setOtherVariables(fen);
+ this.antikingPos = {'w':[-1,-1], 'b':[-1,-1]};
+ const rows = V.ParseFen(fen).position.split("/");
+ for (let i=0; i<rows.length; i++)
+ {
+ let k = 0;
+ for (let j=0; j<rows[i].length; j++)
+ {
+ switch (rows[i].charAt(j))
+ {
+ case 'a':
+ this.antikingPos['b'] = [i,k];
+ break;
+ case 'A':
+ this.antikingPos['w'] = [i,k];
+ break;
+ default:
+ const num = parseInt(rows[i].charAt(j));
+ if (!isNaN(num))
+ k += (num-1);
+ }
+ k++;
+ }
+ }
+ }
+
+ canTake([x1,y1], [x2,y2])
+ {
+ const piece1 = this.getPiece(x1,y1);
+ const piece2 = this.getPiece(x2,y2);
+ const color1 = this.getColor(x1,y1);
+ const color2 = this.getColor(x2,y2);
+ return piece2 != "a" &&
+ ((piece1 != "a" && color1 != color2) || (piece1 == "a" && color1 == color2));