// { name: 'Allmate', desc: 'Mate any piece' },
// { name: 'Ambiguous', desc: "Play opponent's pieces" },
// { name: 'Antiking1', desc: 'Keep antiking in check', disp: 'Anti-King' },
-// { name: 'Antimatter', desc: 'Dangerous collisions', disp: 'Antimatter' },
+// { name: 'Antimatter', desc: 'Dangerous collisions' },
// { name: 'Apocalypse', desc: 'The end of the world' },
// { name: 'Arena', desc: 'Middle battle' },
// { name: 'Atarigo', desc: 'First capture wins', disp: 'Atari-Go' },
// { name: 'Doublearmy', desc: '64 pieces on the board', disp: 'Double Army' },
{ name: 'Doublemove', desc: 'Double moves' },
// { name: 'Dynamo', desc: 'Push and pull' },
-// { name: 'Eightpieces', desc: 'Each piece is unique', disp: '8-Pieces' },
+// { name: 'Eightpieces', desc: 'Each piece is unique', disp: '8 Pieces' },
// { name: 'Emergo', desc: 'Stacking Checkers variant' },
// { name: 'Empire', desc: 'Empire versus Kingdom' },
// { name: 'Enpassant', desc: 'Capture en passant', disp: 'En-passant' },
// { name: 'Sittuyin', desc: 'Burmese Chess' },
// { name: 'Spartan', desc: 'Spartan versus Persians' },
// { name: 'Squatter', desc: 'Squat last rank' },
-// { name: 'Stealthbomb', desc: 'Beware the bomb', disp: 'Stealth Bomb' },
+// { name: 'Stealthbomb', desc: 'Beware the bomb' },
// { name: 'Suicide', desc: 'Lose all pieces' },
// { name: 'Suction', desc: 'Attract opposite king' },
// { name: 'Swap', desc: 'Dangerous captures' },
// { name: 'Wormhole', desc: 'Squares disappear' },
// { name: 'Xiangqi', desc: 'Chinese Chess' },
// { name: 'Yote', desc: 'African Draughts' },
- { name: "Zen", disp: "Zen Chess", desc: "Reverse captures" }
+ { name: "Zen", desc: "Reverse captures" }
];
// Next line for usage on server (Node.js)
--- /dev/null
+import ChessRules from "/base_rules.js";
+
+export default class ProgressiveRules extends ChessRules {
+
+ static get Options() {
+ return {
+ select: C.Options.select,
+ check: [
+ {
+ label: "Logical",
+ defaut: false,
+ variable: "logical"
+ }
+ ].concat(C.Options.check),
+ styles: C.Options.styles.filter(s => s != "progressive")
+ };
+ }
+
+ constructor(o) {
+ o.options["progressive"] = true;
+ super(o);
+ }
+
+ get hasCastle() {
+ return !this.options["logical"];
+ }
+
+ pieces(color, x, y) {
+ let res = super.pieces(color, x, y);
+ if (this.options["logical"]) {
+ const pawnShift = (color == "w" ? -1 : 1);
+ res["p"].moves[0] = {
+ steps: [[pawnShift, 0]],
+ range: 1 //always
+ };
+ }
+ return res;
+ }
+
+};