diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-09-15 13:07:50 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-09-15 13:07:50 +0200 |
commit | e877ac57c67e73fd0c4500498f5a573dc5b30745 (patch) | |
tree | 9f9dcb50d82fde71d5fcc018d3c095af5fb62a89 /rules.js | |
parent | 41aaecfbaed1ea7ade81668d816e874eef03a9b3 (diff) | |
download | nevsky-e877ac57c67e73fd0c4500498f5a573dc5b30745.tar.gz |
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.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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) |