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=90e814b6717b1ba932bba0e52958f54f814a2503;hp=daa7bbb8cca1e974dd5043b985068dab828c0635;hpb=8055eabd23feaabe878b25522929c7273dcb0f24;p=vchess.git diff --git a/client/src/variants/Knightrelay.js b/client/src/variants/Knightrelay.js index daa7bbb8..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]], { @@ -77,6 +77,21 @@ export const VariantRules = class KnightrelayRules extends ChessRules { return false; } + static get VALUES() { + return { + p: 1, + r: 5, + n: 7, //the knight is valuable + b: 3, + q: 9, + k: 1000 + }; + } + + static get SEARCH_DEPTH() { + return 2; + } + getNotation(move) { if (move.appear.length == 2 && move.appear[0].p == V.KING) // Castle