summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js39
1 files changed, 24 insertions, 15 deletions
diff --git a/rules.js b/rules.js
index ead708f..2811b83 100644
--- a/rules.js
+++ b/rules.js
@@ -2965,10 +2965,10 @@ function goto_move_phase() {
}
function show_move_commands() {
- if (game.from1) view.from1 = game.from1
- if (game.from2) view.from2 = game.from2
- if (game.to1) view.to1 = game.to1
- if (game.to2) view.to2 = game.to2
+ if (game.from1 && game.from2)
+ view.selected_hexes = [ game.from1, game.from2 ]
+ else if (game.from1)
+ view.selected_hexes = game.from1
}
states.select_moves = {
@@ -3082,10 +3082,13 @@ states.group_move_from = {
},
hex(x) {
push_undo()
- if (game.from1 === 0)
+ if (game.from1 === 0) {
game.from1 = x
- else
+ print_move_1()
+ } else {
game.from2 = x
+ print_move_2()
+ }
if (x === friendly_queue()) {
for_each_friendly_unit_in_hex(friendly_queue(), u => {
@@ -3176,10 +3179,13 @@ states.regroup_move_destination = {
},
hex(x) {
push_undo()
- if (game.from2 === 0)
+ if (game.from2 === 0) {
game.to1 = x
- else
+ print_move_1()
+ } else {
game.to2 = x
+ print_move_2()
+ }
if (game.turn_option === 'offensive' && !game.from2)
game.state = 'select_moves'
else
@@ -3212,30 +3218,35 @@ function search_current_move(who, is_retreat) {
}
}
-function goto_move() {
+function print_move_1() {
if (game.rommel === 1) {
if (game.from1 && game.to1)
- log(`Rommel Regroup move\nfrom #${game.from1}\nto #${game.to1}.`)
+ log(`Regroup move with Rommel\nfrom #${game.from1}\nto #${game.to1}.`)
else if (game.from1)
- log(`Rommel Group move\nfrom #${game.from1}.`)
+ log(`Group move with Rommel\nfrom #${game.from1}.`)
} else {
if (game.from1 && game.to1)
log(`Regroup move\nfrom #${game.from1}\nto #${game.to1}.`)
else if (game.from1)
log(`Group move\nfrom #${game.from1}.`)
}
+}
+
+function print_move_2() {
if (game.rommel === 2) {
if (game.from2 && game.to2)
- log(`Rommel Regroup move\nfrom #${game.from2}\nto #${game.to2}.`)
+ log(`Regroup (R) move\nfrom #${game.from2}\nto #${game.to2}.`)
else if (game.from2)
- log(`Rommel Group move\nfrom #${game.from2}.`)
+ log(`Group (R) move\nfrom #${game.from2}.`)
} else {
if (game.from2 && game.to2)
log(`Regroup move\nfrom #${game.from2}\nto #${game.to2}.`)
else if (game.from2)
log(`Group move\nfrom #${game.from2}.`)
}
+}
+function goto_move() {
log_br()
game.state = 'move'
}
@@ -3280,8 +3291,6 @@ states.move = {
if (game.selected < 0) {
view.prompt = `Move: Select unit to move.`
- show_move_commands()
-
// Select Group Move 1
if (!game.to1 && game.from1) {
if (!is_battle_hex(game.from1)) {