diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-15 02:58:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | b83115ce40d88c789fbbd5a891057e14d4cf553b (patch) | |
tree | fbccd0059aa41bc05ff7e97b2a5aaa3c2980aca1 /play.js | |
parent | 4640a9affe7633628ce95de0bb5640e30dd71039 (diff) | |
download | table-battles-b83115ce40d88c789fbbd5a891057e14d4cf553b.tar.gz |
stick shift special
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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") |