summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-08-06 12:40:49 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:26 +0100
commit75f1fe03db7c4355de7ffac7e0a48fd31b28e881 (patch)
treedf2de2c2395665784947892fdb987a682e269e7d /rules.js
parent24c558ffceb514745f06998726799c67f30c5806 (diff)
downloadrommel-in-the-desert-75f1fe03db7c4355de7ffac7e0a48fd31b28e881.tar.gz
Enter map from engaged base queue via group move.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index a6b1f2e..3720c0d 100644
--- a/rules.js
+++ b/rules.js
@@ -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