summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 7910e84..df8666e 100644
--- a/rules.js
+++ b/rules.js
@@ -2497,13 +2497,15 @@ function can_retreat_before_battle() {
return false
for (let to of SPACES[here].adjacent)
- if (can_retreat_before_battle_to(to))
+ if (can_retreat_before_battle_to(g, here, to))
return true
return false
}
-function can_retreat_before_battle_to(to) {
+function can_retreat_before_battle_to(g, from, to) {
+ if (is_quebec_falmouth_path(from, to) && g !== ARNOLD)
+ return false
if (to === game.move.from)
return false
if (has_friendly_pc(to))
@@ -3037,7 +3039,9 @@ function resolve_battle() {
/* RETREAT AFTER BATTLE */
-function can_defender_retreat(to, is_lone) {
+function can_defender_retreat(g, from, to, is_lone) {
+ if (is_quebec_falmouth_path(from, to) && g !== ARNOLD)
+ return false
if (to === game.move.from)
return false
if (has_enemy_pc(to))
@@ -3050,7 +3054,11 @@ function can_defender_retreat(to, is_lone) {
}
function can_attacker_retreat() {
+ let g = game.move.who
+ let from = game.move.to
let to = game.move.from
+ if (is_quebec_falmouth_path(from, to) && g !== ARNOLD)
+ return false
if (has_enemy_pc(to))
return false
if (has_enemy_cu(to))
@@ -3075,14 +3083,17 @@ function gen_defender_retreat() {
let here = game.move.to
let is_lone = is_general_without_cu(here)
let can_retreat = false
+ let g
if (game.active === P_BRITAIN)
- view.selected_general = find_british_general(here)
+ g = find_british_general(here)
else
- view.selected_general = find_american_or_french_general(here)
+ g = find_american_or_french_general(here)
+
+ view.selected_general = g
for (let to of SPACES[here].adjacent) {
- if (can_defender_retreat(to, is_lone)) {
+ if (can_defender_retreat(g, here, to, is_lone)) {
gen_action_space(to)
can_retreat = true
}