X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FTeleport%2Fclass.js;h=7ac3b34a6e15d0640727b3668d827cd144b63584;hb=de1421be3ee53cb4ea8f112834d3de7a863fdd40;hp=5e52252f57c7ee934302197d1f3f031317409301;hpb=a7d092011535bc7da231c2c254ec5c936b62cd71;p=xogo.git diff --git a/variants/Teleport/class.js b/variants/Teleport/class.js index 5e52252..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"? - check: C.Options.check, + 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)); + } + };