From bd283b25d99ea18901bff4f6d53aa9a62ac875d3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 7 Dec 2024 12:46:21 +0100 Subject: Allow ending hussar placement early if no pieces on bohemia map. --- rules.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'rules.js') 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 -- cgit v1.2.3