summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-29 20:46:48 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-29 20:46:48 +0200
commita8be7858609a0a5651869c4c9c8a24f9f4e7d6f9 (patch)
treecc88a7300b6d3d02ccfd6ddeb8c87121049c90ce /rules.ts
parent5619c922e3060da937edb0ec2b0ca626795b5778 (diff)
downloadplantagenet-a8be7858609a0a5651869c4c9c8a24f9f4e7d6f9.tar.gz
fix surprise landing (sail shouldn't "end command", but cost all actions)
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts20
1 files changed, 12 insertions, 8 deletions
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()
}