summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js37
1 files changed, 34 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index f10039d..8255c9d 100644
--- a/rules.js
+++ b/rules.js
@@ -3443,7 +3443,7 @@ states.move = {
apply_move(to)
- goto_intercept()
+ goto_confirm_move(from, to)
},
drop_off() {
push_undo()
@@ -3475,10 +3475,11 @@ states.move = {
states.lake_schooner_confirm = {
prompt() {
- view.prompt = "You may be interrupted by Lake Schooner. Continue?"
+ view.prompt = "This move may be interrupted by Lake Schooner. Continue?"
view.who = moving_piece()
view.where = game.move.lake_schooner
view.actions.move = 1
+ view.danger = [ game.move.lake_schooner ]
},
move() {
set_active_enemy()
@@ -3683,9 +3684,10 @@ states.amphibious_landing = {
},
space(to) {
push_undo()
+ let from = moving_piece_space()
set_add(game.amphib, to)
apply_move(to)
- goto_intercept()
+ goto_confirm_move(from, to)
},
}
@@ -3866,6 +3868,35 @@ function gen_intercept() {
})
}
+function goto_confirm_move(from, to) {
+ if (is_danger_move(from, to))
+ game.state = "confirm_move"
+ else
+ goto_intercept()
+}
+
+states.confirm_move = {
+ prompt() {
+ let from = moving_piece_came_from()
+ let to = moving_piece_space()
+ if (has_unbesieged_enemy_units(to))
+ view.prompt = "This move may trigger a battle. Continue?"
+ else if (can_be_intercepted(from, to))
+ view.prompt = "This move may be intercepted. Continue?"
+ else if (has_unbesieged_enemy_leader(to))
+ view.prompt = "This move will force the enemy to retreat. Continue?"
+ else
+ view.prompt = "This move may be interrupted. Continue?"
+ view.who = moving_piece()
+ view.where = moving_piece_space()
+ view.actions.move = 1
+ view.danger = [ to ]
+ },
+ move() {
+ goto_intercept()
+ },
+}
+
function goto_intercept() {
// Abandoned lone leader at formerly besieged fortification with enemy units...
let from = moving_piece_came_from()