diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-08-06 12:40:49 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:26 +0100 |
commit | 75f1fe03db7c4355de7ffac7e0a48fd31b28e881 (patch) | |
tree | df2de2c2395665784947892fdb987a682e269e7d /rules.js | |
parent | 24c558ffceb514745f06998726799c67f30c5806 (diff) | |
download | rommel-in-the-desert-75f1fe03db7c4355de7ffac7e0a48fd31b28e881.tar.gz |
Enter map from engaged base queue via group move.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -2357,12 +2357,15 @@ states.group_move_from = { prompt() { view.prompt = `Group Move: Select hex to move from.` gen_rommel_move() - for (let x = first_hex; x <= last_hex; ++x) { + for (let x of all_hexes) { if (x === game.from1 && !game.to1) continue if (has_undisrupted_friendly_unit(x)) gen_action_hex(x) } + if (game.turn_option !== 'pass') + if (has_friendly_unit_in_raw_hex(friendly_queue())) + gen_action_hex(friendly_queue()) }, rommel() { push_undo() @@ -2377,6 +2380,14 @@ states.group_move_from = { game.from1 = x else game.from2 = x + + if (x === friendly_queue()) { + for_each_friendly_unit_in_hex(friendly_queue(), u => { + set_unit_hex(u, friendly_base()) + set_unit_moved(u) + }) + } + if (game.turn_option === 'offensive' && !game.from2) game.state = 'select_moves' else |