Add Rococo variant
[vchess.git] / client / src / variants / Omega.js
index 3310dd5..5431198 100644 (file)
@@ -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;
@@ -274,7 +282,7 @@ export class OmegaRules extends ChessRules {
     }
   }
 
-  getEnpassanCaptures([x, y], shiftX) {
+  getEnpassantCaptures([x, y], shiftX) {
     const Lep = this.epSquares.length;
     const epSquare = this.epSquares[Lep - 1];
     let moves = [];