summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-15 02:58:17 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commitb83115ce40d88c789fbbd5a891057e14d4cf553b (patch)
treefbccd0059aa41bc05ff7e97b2a5aaa3c2980aca1 /play.js
parent4640a9affe7633628ce95de0bb5640e30dd71039 (diff)
downloadtable-battles-b83115ce40d88c789fbbd5a891057e14d4cf553b.tar.gz
stick shift special
Diffstat (limited to 'play.js')
-rw-r--r--play.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/play.js b/play.js
index 7eb87af..c51f2c0 100644
--- a/play.js
+++ b/play.js
@@ -19,6 +19,7 @@ let ui = {
cards: {},
slots: {},
slot_sticks: {},
+ slot_shift: {},
slot_cubes: {},
slot_dice: {},
@@ -127,6 +128,8 @@ function create_formation_slot(id, top) {
if (top) {
ui.slot_dice[id] = append_div(e, "slot_dice")
+ if (card.infantry || card.cavalry)
+ ui.slot_shift[id] = append_div(e, "slot_shift")
e.appendChild(ui.cards[id])
}
@@ -137,6 +140,8 @@ function create_formation_slot(id, top) {
if (!top) {
e.appendChild(ui.cards[id])
+ if (card.infantry || card.cavalry)
+ ui.slot_shift[id] = append_div(e, "slot_shift")
ui.slot_dice[id] = append_div(e, "slot_dice")
}
@@ -275,6 +280,12 @@ function fill_card_row(top, parent, list) {
add_hit_stick(ui.slot_sticks[id])
for (let i = x; i < n; ++i)
add_stick(ui.slot_sticks[id])
+
+ if (view.shift) {
+ n = map_get(view.shift, id, 0)
+ for (let i = 0; i < n; ++i)
+ add_stick(ui.slot_shift[id])
+ }
}
}
@@ -402,6 +413,7 @@ function on_update() {
action_button("screen", "Screen")
action_button("counterattack", "Counterattack")
action_button("absorb", "Absorb")
+ action_button("shift", "Shift")
action_button("roll", "Roll")
action_button("pass", "Pass")
action_button("next", "Next")