Draft Hiddenqueen, Grasshopper and Knightmate chess (rules unwritten)
[vchess.git] / client / src / variants / Wildebeest.js
index 933abbd..fa89cb2 100644 (file)
@@ -3,10 +3,6 @@ import { ArrayFun } from "@/utils/array";
 import { sample, randInt } from "@/utils/alea";
 
 export const VariantRules = class WildebeestRules extends ChessRules {
-  static getPpath(b) {
-    return ([V.CAMEL, V.WILDEBEEST].includes(b[1]) ? "Wildebeest/" : "") + b;
-  }
-
   static get size() {
     return { x: 10, y: 11 };
   }
@@ -52,6 +48,10 @@ export const VariantRules = class WildebeestRules extends ChessRules {
     return true;
   }
 
+  getPpath(b) {
+    return ([V.CAMEL, V.WILDEBEEST].includes(b[1]) ? "Wildebeest/" : "") + b;
+  }
+
   // There may be 2 enPassant squares (if pawn jump 3 squares)
   getEnpassantFen() {
     const L = this.epSquares.length;
@@ -117,8 +117,9 @@ export const VariantRules = class WildebeestRules extends ChessRules {
     const shiftX = color == "w" ? -1 : 1;
     const startRanks = color == "w" ? [sizeX - 2, sizeX - 3] : [1, 2];
     const lastRank = color == "w" ? 0 : sizeX - 1;
-    const finalPieces =
-      x + shiftX == lastRank ? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN] : [V.PAWN];
+    const finalPieces = x + shiftX == lastRank
+      ? [V.WILDEBEEST, V.QUEEN]
+      : [V.PAWN];
 
     if (this.board[x + shiftX][y] == V.EMPTY) {
       // One square forward
@@ -234,8 +235,8 @@ export const VariantRules = class WildebeestRules extends ChessRules {
 
   static get VALUES() {
     return Object.assign(
-      ChessRules.VALUES,
-      { c: 3, w: 7 } //experimental
+      { c: 3, w: 7 }, //experimental
+      ChessRules.VALUES
     );
   }