summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-24 22:03:58 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-30 21:59:25 +0200
commit5cf699902c6f1a37175380f050ecc7456aaaff41 (patch)
treecd7a0586fa3ccfd6bd1f28397aa98658d9d993d0
parent6f5be691ae545b8e85ca9549bb8eddb23f567ba2 (diff)
downloadfriedrich-5cf699902c6f1a37175380f050ecc7456aaaff41.tar.gz
test detach by clicking directly only
-rw-r--r--rules.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 64ae5ab..b71803e 100644
--- a/rules.js
+++ b/rules.js
@@ -1645,10 +1645,17 @@ states.move_general_OLD = {
let here = game.pos[who]
if (game.count === 0) {
+ /*
if (game.selected.length > 1)
view.actions.detach = 1
else
view.actions.detach = 0
+ */
+
+ // detach
+ if (game.selected.length > 1)
+ for (let p of game.selected)
+ gen_action_piece(p)
let s_take = count_stacked_take()
let s_give = count_stacked_give()
@@ -1684,10 +1691,14 @@ states.move_general_OLD = {
game.state = "move_detach"
},
piece(p) {
- if (p === game.selected[0])
- this.stop()
- else
- this.space(game.pos[p])
+ if (game.count === 0) {
+ set_delete(game.selected, p)
+ } else {
+ if (p === game.selected[0])
+ this.stop()
+ else
+ this.space(game.pos[p])
+ }
},
stop() {
for (let p of game.selected)