X-Git-Url: https://git.auder.net/assets/rpsls.css?a=blobdiff_plain;f=variants%2FAtomic%2Fclass.js;h=4bd27122749cad4dec8ee903188ab14aa18b5f2e;hb=061c078d4724d24003897415939ab3a5c057a45d;hp=b0662d3aeaf807c50dbf68104c671d875e6df66d;hpb=c9ab034035a3cac65e4ac9f48a946ecef5ed111e;p=xogo.git diff --git a/variants/Atomic/class.js b/variants/Atomic/class.js index b0662d3..4bd2712 100644 --- a/variants/Atomic/class.js +++ b/variants/Atomic/class.js @@ -7,18 +7,14 @@ export default class AtomicRules extends ChessRules { static get Options() { return { select: C.Options.select, - check: [ + input: [ { label: "Balanced", - defaut: false, - variable: "rempawn" - }, - { - label: "Falling pawn", - defaut: false, - variable: "pawnfall" + variable: "rempawn", + type: "checkbox", + defaut: false } - ], + ].concat(C.Options.input.filter(i => i.variable == "pawnfall")), styles: C.Options.styles.filter(s => s != "atomic") }; } @@ -30,7 +26,7 @@ export default class AtomicRules extends ChessRules { canIplay(x, y) { if (this.options["rempawn"] && this.movesCount == 0) - return (this.turn == side && this.getPiece(x, y) == "p"); + return (this.playerColor == this.turn && this.getPiece(x, y) == "p"); return super.canIplay(x, y); } @@ -49,8 +45,8 @@ export default class AtomicRules extends ChessRules { c: c }) ], - start: { x: x, y: y }, - end: { x: x, y: y } + start: {x: x, y: y}, + end: {x: x, y: y} }) ]; }