From a8be7858609a0a5651869c4c9c8a24f9f4e7d6f9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 29 Apr 2024 20:46:48 +0200 Subject: fix surprise landing (sail shouldn't "end command", but cost all actions) --- rules.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'rules.ts') diff --git a/rules.ts b/rules.ts index 155c16c..2126844 100644 --- a/rules.ts +++ b/rules.ts @@ -3651,6 +3651,16 @@ function spend_march_action(cost) { game.actions -= cost } +function spend_sail_action() { + clear_flag(FLAG_SURPRISE_LANDING) + clear_flag(FLAG_FIRST_ACTION) + clear_flag(FLAG_FIRST_MARCH_HIGHWAY) + if (is_seamanship_in_play()) + game.actions -= 1 + else + game.actions = 0 +} + function spend_all_actions() { /* No more actions (including free ones)! */ clear_flag(FLAG_SURPRISE_LANDING) @@ -4212,10 +4222,7 @@ function do_sail(to: Locale) { levy_burgundians(lord) } - if (is_seamanship_in_play()) - spend_action(1) - else - spend_all_actions() + spend_sail_action() // you can go to enemy lord with norfolk capability if (is_seaport(to) && has_enemy_lord(to)) @@ -4225,10 +4232,7 @@ function do_sail(to: Locale) { } function fail_sail() { - if (is_seamanship_in_play()) - spend_action(1) - else - spend_all_actions() + spend_sail_action() end_sail() } -- cgit v1.2.3