- const [x,y] = [moves.start.x, move.start.y];
- let move = JSON.parse(JSON.stringify(standardMove));
+ const V = VariantRules;
+ if (move.appear[0].p == V.KING && move.appear.length==1)
+ return [move]; //kings are not charged
+ const aIdx = (move.appear[0].p != V.KING ? 0 : 1); //if castling, rook is charged
+ const [x,y] = [move.appear[aIdx].x, move.appear[aIdx].y];
+ const color = this.turn;
+ const lastRank = (color=="w" ? 0 : 7);
+ const standardMove = JSON.parse(JSON.stringify(move));