summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 7f30a1b..6ddbb46 100644
--- a/rules.js
+++ b/rules.js
@@ -5950,10 +5950,14 @@ function goto_surrender_place() {
set_active_enemy()
if (has_friendly_units(game.siege_where)) {
game.state = 'surrender'
- if (game.siege_where === LOUISBOURG)
+ if (game.siege_where === LOUISBOURG) {
game.surrender = find_closest_friendly_unbesieged_fortification(QUEBEC)
- else
+ } else {
game.surrender = find_closest_friendly_unbesieged_fortification(game.siege_where)
+ if (game.surrender.length === 0)
+ if (has_unbesieged_friendly_fortifications(LOUISBOURG))
+ game.surrender.push(LOUISBOURG)
+ }
} else {
end_surrender()
}
@@ -5968,13 +5972,21 @@ states.surrender = {
view.where = game.siege_where
for (let i=0; i < game.surrender.length; ++i)
gen_action_space(game.surrender[i])
+ if (game.surrender.length === 0)
+ gen_action('eliminate')
},
space(s) {
for (let p = first_friendly_piece; p <= last_friendly_piece; ++p)
if (piece_node(p) === game.siege_where)
move_piece_to(p, s)
end_surrender()
- }
+ },
+ eliminate() {
+ for (let p = first_friendly_piece; p <= last_friendly_piece; ++p)
+ if (piece_node(p) === game.siege_where)
+ eliminate_piece(p)
+ end_surrender()
+ },
}
function end_surrender() {