From: Benjamin Auder Date: Mon, 30 Mar 2020 01:09:57 +0000 (+0200) Subject: Forbid capturing wall in Omega chess... X-Git-Url: https://git.auder.net/variants/current/css/doc/pieces/%24%7BgetWhatsApp%28link%29%7D?a=commitdiff_plain;h=e0953a57980cc933045cf93cd4c87a95334d7813;p=vchess.git Forbid capturing wall in Omega chess... --- diff --git a/client/src/variants/Omega.js b/client/src/variants/Omega.js index 7b5576cf..5431198b 100644 --- a/client/src/variants/Omega.js +++ b/client/src/variants/Omega.js @@ -228,6 +228,14 @@ export class OmegaRules extends ChessRules { return res.slice(0, -1); //remove last comma } + canTake([x1, y1], [x2, y2]) { + return ( + // Cannot take wall :) + this.board[x2][y2] != V.NOTHING && + this.getColor(x1, y1) !== this.getColor(x2, y2) + ); + } + // En-passant after 2-sq or 3-sq jumps getEpSquare(moveOrSquare) { if (!moveOrSquare) return undefined;