Add Wormhole1 + ranem Wormhole --> Wormhole2. Rename Selfabsorption (too long) into...
[vchess.git] / client / src / variants / Wormhole2.js
similarity index 98%
rename from client/src/variants/Wormhole.js
rename to client/src/variants/Wormhole2.js
index 05d8f2a..06b7fb6 100644 (file)
@@ -1,6 +1,6 @@
 import { ChessRules } from "@/base_rules";
 
-export class WormholeRules extends ChessRules {
+export class Wormhole2Rules extends ChessRules {
 
   static get HasFlags() {
     return false;
@@ -150,7 +150,7 @@ export class WormholeRules extends ChessRules {
           this.canTake([x, y], sq)
         )
       ) {
-          moves.push(this.getBasicMove([x, y], sq));
+        moves.push(this.getBasicMove([x, y], sq));
       }
     }
     return moves;
@@ -186,7 +186,7 @@ export class WormholeRules extends ChessRules {
         this.canTake([x, y], [sq[0], sq[1]])
       ) {
         const finalPieces = sq[0] == lastRank
-          ? [V.ROOK, V.KNIGHT, V.BISHOP, V.QUEEN]
+          ? V.PawnSpecs.promotions
           : [V.PAWN];
         for (let piece of finalPieces) {
           moves.push(