summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 647c996..71ac755 100644
--- a/rules.js
+++ b/rules.js
@@ -3734,6 +3734,12 @@ function end_recruit() {
/* COMBAT (CHOOSE TARGETS) */
+function remove_from_combat(p) {
+ let s = game.pos[p]
+ if (game.combat)
+ game.combat = map_filter(game.combat, (atk, def) => atk !== s && def !== s)
+}
+
function goto_combat() {
let from = []
let to = []
@@ -5627,6 +5633,8 @@ states.saxony_return_foreign_where = {
gen_action_space(s)
},
space(s) {
+ if (is_general(game.selected))
+ remove_from_combat(game.selected)
log(">P" + game.selected + " to S" + s)
enter_piece_at(game.selected, s)
game.selected = -1
@@ -5654,6 +5662,8 @@ states.saxony_return_home = {
view.actions.next = 1
},
piece(p) {
+ if (is_general(p))
+ remove_from_combat(p)
let s = setup_piece_position[p]
game.pos[p] = s
log(">P" + p + " to S" + s)
@@ -5699,6 +5709,7 @@ states.saxony_move_general = {
gen_action_space(s)
},
space(s) {
+ remove_from_combat(game.selected)
log(">P" + game.selected + " to S" + s)
enter_piece_at(game.selected, s)
end_saxony_neutral()
@@ -5977,7 +5988,7 @@ states.silesia_enter_prussian_train = {
states.silesia_done = {
inactive: "annex Silesia",
prompt() {
- prompt("Silesian annexation done.")
+ prompt("Silesian annexion done.")
view.actions.next = 1
},
next() {