X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FMonochrome.js;h=22242ed296686110a0267c1045f9ab9266ef4f10;hb=7e8a7ea1cb66adb4a987badfb0a3c2f99a21bd0a;hp=919e7703fe95360020f42262353406a382006e0f;hpb=0fbe4ffafd65f35ad939134cc89b8bafcc4cd5ca;p=vchess.git diff --git a/client/src/variants/Monochrome.js b/client/src/variants/Monochrome.js index 919e7703..22242ed2 100644 --- a/client/src/variants/Monochrome.js +++ b/client/src/variants/Monochrome.js @@ -1,6 +1,7 @@ import { ChessRules } from "@/base_rules"; export class MonochromeRules extends ChessRules { + static get HasEnpassant() { // Pawns would be on the same side return false; @@ -37,6 +38,10 @@ export class MonochromeRules extends ChessRules { return true; } + getPpath(b) { + return (b[1] == V.KNIGHT ? "Enpassant/" : "") + b; + } + canIplay(side, [x, y]) { const xBounds = side == 'w' ? [4,7] : [0,3]; return this.turn == side && x >= xBounds[0] && x <= xBounds[1]; @@ -154,6 +159,8 @@ export class MonochromeRules extends ChessRules { static GenRandInitFen(randomness) { // Remove the en-passant + castle part of the FEN let fen = ChessRules.GenRandInitFen(randomness).slice(0, -6); + // Replace kings with queens + fen = fen.replace("k", "q").replace("K", "Q"); // Move pawns up: fen = fen.replace("pppppppp/8","8/pppppppp") .replace("8/PPPPPPPP","PPPPPPPP/8"); @@ -211,4 +218,5 @@ export class MonochromeRules extends ChessRules { } return notation; } + };