From e877ac57c67e73fd0c4500498f5a573dc5b30745 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 15 Sep 2023 13:07:50 +0200 Subject: Fix strike_left_or_right if choice is only via strike group. If center lord has no strikes of his own, we need to check the lords he is grouped with for strikes before assuming there are no strikes. --- rules.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 91273ed..2aa19e8 100644 --- a/rules.js +++ b/rules.js @@ -8332,8 +8332,20 @@ function flanks_all_positions(S, TT) { return true } +function has_strike_within_group(S) { + if (has_strike(S)) + return true + if (game.battle.strikers) { + if (game.battle.strikers.includes(S)) + for (let X of game.battle.strikers) + if (has_strike(X)) + return true + } + return false +} + function strike_left_or_right(S2, T1, T2, T3) { - if (has_strike(S2)) { + if (has_strike_within_group(S2)) { if (filled(T2)) return T2 let has_t1 = filled(T1) -- cgit v1.2.3