X-Git-Url: https://git.auder.net/assets/rpsls.css?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCrazyhouse.js;h=ff705c73d1fb6948c011b435784f6ed951ff49d4;hb=e727fe31742dfb3e40eb222c94f4199e2be98453;hp=d677823d6c48d60d929fdb96c6aa1667072e24e3;hpb=c292ebb2a014646005b01e27253c162f1d639387;p=vchess.git diff --git a/client/src/variants/Crazyhouse.js b/client/src/variants/Crazyhouse.js index d677823d..ff705c73 100644 --- a/client/src/variants/Crazyhouse.js +++ b/client/src/variants/Crazyhouse.js @@ -28,6 +28,13 @@ export const VariantRules = class CrazyhouseRules extends ChessRules { }); } + getEpSquare(moveOrSquare) { + if (typeof moveOrSquare !== "object" || move.vanish.length > 0) + return super.getEpSquare(moveOrSquare); + // Landing move: no en-passant + return undefined; + } + static GenRandInitFen(randomness) { return ChessRules.GenRandInitFen(randomness) + " 0000000000 -"; } @@ -118,6 +125,14 @@ export const VariantRules = class CrazyhouseRules extends ChessRules { getReservePpath(index, color) { return color + V.RESERVE_PIECES[index]; } +// // Version if some day I have pieces with numbers printed on it: +// getReservePpath(index, color) { +// return ( +// "Crazyhouse/" + +// color + V.RESERVE_PIECES[index] + +// "_" + this.vr.reserve[playingColor][V.RESERVE_PIECES[i]] +// ); +// } // Ordering on reserve pieces static get RESERVE_PIECES() {