X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FTeleport%2Fclass.js;h=7ac3b34a6e15d0640727b3668d827cd144b63584;hb=de1421be3ee53cb4ea8f112834d3de7a863fdd40;hp=2698eaf6f75c89cbe482a2ace64dc478708e415b;hpb=727f2e558776b14a29cb1552a05a88cc9a4b0297;p=xogo.git diff --git a/variants/Teleport/class.js b/variants/Teleport/class.js index 2698eaf..7ac3b34 100644 --- a/variants/Teleport/class.js +++ b/variants/Teleport/class.js @@ -5,8 +5,12 @@ export default class TeleportRules extends ChessRules { static get Options() { return { select: C.Options.select, - // TODO? option "teleport king"? - input: C.Options.input, + input: C.Options.input.concat({ + label: "Teleport king", + variable: "tpking", + type: "checkbox", + defaut: false + }), styles: C.Options.styles.filter(s => s != "teleport") }; } @@ -16,4 +20,8 @@ export default class TeleportRules extends ChessRules { super(o); } + canSelfTake([x1, y1], [x2, y2]) { + return (this.options["tpking"] || !this.isKing(x2, y2)); + } + };