+ if (
+ this.firstMove.appear.length == 0 ||
+ this.firstMove.vanish.length == 0 ||
+ this.board[x][y] != V.EMPTY
+ ) {
+ return false;
+ }
+ const deltaX = Math.abs(this.firstMove.end.x - x);
+ const deltaY = Math.abs(this.firstMove.end.y - y);
+ return (
+ this.subTurn == 2 &&
+ // Condition: rook or bishop move, may capture, but no bonus move
+ [V.ROOK, V.BISHOP].includes(this.firstMove.vanish[0].p) &&
+ (
+ this.firstMove.vanish.length == 1 ||
+ ['w', 'b'].includes(this.firstMove.vanish[1].c)
+ ) &&
+ (
+ this.firstMove.vanish[0].p == V.ROOK && deltaX == 1 && deltaY == 1 ||
+ this.firstMove.vanish[0].p == V.BISHOP && deltaX + deltaY == 1
+ )
+ );