summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-12-07 12:46:21 +0100
committerTor Andersson <tor@ccxvii.net>2024-12-07 12:46:21 +0100
commitbd283b25d99ea18901bff4f6d53aa9a62ac875d3 (patch)
tree99a96036c3ef7f5e4e39deb8a99dc1b62240478d
parent14b8222d7059df64234bd92ee627b6f6b4ff051d (diff)
downloadmaria-bd283b25d99ea18901bff4f6d53aa9a62ac875d3.tar.gz
Allow ending hussar placement early if no pieces on bohemia map.
-rw-r--r--rules.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/rules.js b/rules.js
index 71ac755..6ee4a7c 100644
--- a/rules.js
+++ b/rules.js
@@ -1627,7 +1627,7 @@ states.place_hussars = {
for (let p of all_hussars)
if (!set_has(game.moved, p))
gen_action_piece(p)
- if (!has_any_hussar(ELIMINATED))
+ if (!has_any_hussar(ELIMINATED) || !has_piece_on_bohemia_map(P_AUSTRIA))
view.actions.end_place_hussars = 1
},
piece(p) {
@@ -2424,6 +2424,13 @@ function has_unmoved_piece_on_flanders_map(pow) {
return false
}
+function has_piece_on_bohemia_map(pow) {
+ for (let p of all_power_pieces[pow])
+ if (is_bohemia_space(game.pos[p]))
+ return true
+ return false
+}
+
function resume_movement() {
if (is_two_player() && game.power === P_PRAGMATIC)
game.power = P_AUSTRIA