summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js28
1 files changed, 18 insertions, 10 deletions
diff --git a/rules.js b/rules.js
index 83fc567..39338e2 100644
--- a/rules.js
+++ b/rules.js
@@ -3001,10 +3001,14 @@ states.select_moves = {
view.actions.regroup = can_regroup_move
}
- if (game.turn_option === 'pass')
- gen_action('end_turn')
- else if (!can_group_move && !can_regroup_move)
+ if (game.turn_option === 'pass') {
+ if (has_mandatory_combats() && (can_group_move || can_regroup_move))
+ view.actions.end_turn = 0
+ else
+ view.actions.end_turn = 1
+ } else if (!can_group_move && !can_regroup_move) {
gen_action('end_move')
+ }
},
group_rommel() {
push_undo()
@@ -3293,7 +3297,7 @@ function can_end_move() {
// must retreat from mandatory combat!
for (let fortress of FORTRESS_HEX_LIST) {
if (is_hex_or_adjacent_to(game.from1, fortress))
- if (is_mandatory_combat(fortress) && set_has(fortress, game.regroup.always))
+ if (is_mandatory_combat(fortress) && set_has(game.regroup.always, fortress))
return !has_friendly_unit(fortress)
}
@@ -3397,6 +3401,7 @@ states.move = {
break
}
}
+
if (has_overrun_hex) {
if (can_move)
view.prompt = `Movement: Select unit to move, or hex to overrun.`
@@ -3413,13 +3418,12 @@ states.move = {
if (can_end_move())
gen_action_end_move()
} else {
- if (can_end_move()) {
- if (can_move)
- view.prompt = `Movement: Select unit to move.`
- else
- view.prompt = `Movement: Done.`
+ if (can_move)
+ view.prompt = `Movement: Select unit to move.`
+ else
+ view.prompt = `Movement: Done.`
+ if (can_end_move())
gen_action_end_move()
- }
}
}
} else {
@@ -4570,6 +4574,10 @@ function end_rout() {
// ==== COMBAT PHASE ===
+function has_mandatory_combats() {
+ return is_mandatory_combat(BARDIA) || is_mandatory_combat(BENGHAZI) || is_mandatory_combat(TOBRUK)
+}
+
function is_mandatory_combat(fortress) {
if (is_battle_hex(fortress)) {
if (game.phasing === AXIS)