update
[xogo.git] / variants / Chakart / class.js
index 9659ef3..69a2e4c 100644 (file)
@@ -1,7 +1,15 @@
-import { ChessRules, Move, PiPo } from "@/base_rules";
-import { SuicideRules } from "@/variants/Suicide";
-import { ArrayFun } from "@/utils/array";
-import { randInt } from "@/utils/alea";
+import ChessRules from "/base_rules";
+import GiveawayRules from "/variants/Giveaway";
+
+// TODO + display bonus messages
+// + animation + multi-moves for bananas/bombs/mushrooms
+
+
+
+import { ArrayFun } from "/utils/array";
+import { randInt } from "/utils/alea";
+import PiPo from "/utils/PiPo.js";
+import Move from "/utils/Move.js";
 
 export class ChakartRules extends ChessRules {
 
@@ -25,28 +33,13 @@ export class ChakartRules extends ChessRules {
   static get PawnSpecs() {
     return SuicideRules.PawnSpecs;
   }
-
-  static get HasCastle() {
+  get hasCastle() {
     return false;
   }
-
-  static get HasEnpassant() {
+  get hasEnpassant() {
     return false;
   }
 
-  static get CorrConfirm() {
-    // Because of bonus effects
-    return false;
-  }
-
-  static get CanAnalyze() {
-    return false;
-  }
-
-  static get SomeHiddenMoves() {
-    return true;
-  }
-
   static get IMMOBILIZE_CODE() {
     return {
       'p': 's',
@@ -1173,11 +1166,12 @@ export class ChakartRules extends ChessRules {
     return "*";
   }
 
-  static GenRandInitFen(options) {
+  genRandInitFen(seed) {
+    const gr = new GiveawayRules({}, true);
     return (
-      SuicideRules.GenRandInitFen(options).slice(0, -1) +
+      gr.genRandInitFen(seed).slice(0, -1) +
       // Add Peach + Mario flags + capture counts
-      "1111 000000000000"
+      '{"flags": "1111", "ccount": "000000000000"}'
     );
   }