X-Git-Url: https://git.auder.net/img/rock_paper_scissors_lizard_spock.gif?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FKnightrelay.js;h=43aef74dfe243f99b0b26a985a7247e47b42a9ca;hb=bfed878da7f9f78c955527ab51fe6094adede20f;hp=eebb0f22ba3000bd4564b884d6bdb4fbb3fe65ea;hpb=e2d2b49c4b8f5228126991ac5cf41086a51a4285;p=vchess.git diff --git a/client/src/variants/Knightrelay.js b/client/src/variants/Knightrelay.js index eebb0f22..43aef74d 100644 --- a/client/src/variants/Knightrelay.js +++ b/client/src/variants/Knightrelay.js @@ -29,7 +29,7 @@ export const VariantRules = class KnightrelayRules extends ChessRules { // Potential promotions: const finalPieces = piece == V.PAWN && x + step[0] == lastRank ? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN] - : [V.PAWN]; + : [piece]; for (let p of finalPieces) { moves.push( this.getBasicMove([x,y], [x+step[0],y+step[1]], { @@ -88,6 +88,10 @@ export const VariantRules = class KnightrelayRules extends ChessRules { }; } + static get SEARCH_DEPTH() { + return 2; + } + getNotation(move) { if (move.appear.length == 2 && move.appear[0].p == V.KING) // Castle