summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-09-15 00:56:47 +0200
committerTor Andersson <tor@ccxvii.net>2024-09-15 00:57:06 +0200
commit07bfab1d9f1b66aa4f8a0010cfda2c5324b86609 (patch)
tree44285c60306cfb7e71a922a099c0d466287b4684 /rules.js
parent0a1193a08ac28c3df4614a469b795acbee55f91c (diff)
downloadwilderness-war-07bfab1d9f1b66aa4f8a0010cfda2c5324b86609.tar.gz
Prompt for "Siege" even if impossible.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index 8255c9d..8ed37cb 100644
--- a/rules.js
+++ b/rules.js
@@ -2859,7 +2859,7 @@ function goto_move_piece(who) {
}
function start_move() {
- if (can_moving_force_siege_or_assault()) {
+ if (has_besieged_enemy_fortifications(moving_piece_space())) {
game.state = 'siege_or_move'
} else if (is_piece_inside(moving_piece())) {
goto_break_siege()
@@ -2876,17 +2876,22 @@ states.siege_or_move = {
let where = moving_piece_space()
view.who = moving_piece()
view.where = where
- if (is_assault_possible(where)) {
- if (player.hand.includes(SURRENDER)) {
- view.prompt = `You may assault at ${space_name(where)}, play "Surrender!", or move.`
- gen_action('play_event', SURRENDER)
+ if (can_moving_force_siege_or_assault()) {
+ if (is_assault_possible(where)) {
+ if (player.hand.includes(SURRENDER)) {
+ view.prompt = `You may assault at ${space_name(where)}, play "Surrender!", or move.`
+ gen_action('play_event', SURRENDER)
+ } else {
+ view.prompt = `You may assault at ${space_name(where)} or move.`
+ }
+ view.actions.assault = 1
} else {
- view.prompt = `You may assault at ${space_name(where)} or move.`
+ view.prompt = `You may siege at ${space_name(where)} or move.`
+ view.actions.siege = 1
}
- view.actions.assault = 1
} else {
- view.prompt = `You may siege at ${space_name(where)} or move.`
- view.actions.siege = 1
+ view.prompt = `You may move from ${space_name(where)}.`
+ view.actions.siege = 0
}
view.actions.move = 1
},