diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-09-15 12:10:06 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-09-15 12:10:06 +0200 |
commit | 7a5406a1910d54bc68688f54d7a4dcd48d9765c9 (patch) | |
tree | 46a353200f6ea7a94726ea11e7e851e611f17794 /rules.js | |
parent | 70520cf7f360d8f2bbce1557ea1c40dbd53710f4 (diff) | |
download | richard-iii-7a5406a1910d54bc68688f54d7a4dcd48d9765c9.tar.gz |
No treachery attempts when you must retreat.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -2431,6 +2431,7 @@ states.battle_round = { if (game.battle_round > 1) can_retreat = true can_pass = true } + for (let b of game.battle_list) { if (can_fire) gen_action(view, 'battle_fire', b) if (must_retreat || (can_retreat && can_retreat_with_block(b))) @@ -2439,17 +2440,19 @@ states.battle_round = { gen_action(view, 'block', b) } - let heir = can_heir_charge() - if (heir !== NOBODY && set_has(game.battle_list, heir)) - gen_action(view, 'battle_charge', heir) - if (can_attempt_treachery(game.king)) - gen_action(view, 'battle_treachery', game.king) - if (can_attempt_treachery(game.pretender)) - gen_action(view, 'battle_treachery', game.pretender) - if (can_attempt_treachery(B_WARWICK_L)) - gen_action(view, 'battle_treachery', B_WARWICK_L) - if (can_attempt_treachery(B_WARWICK_Y)) - gen_action(view, 'battle_treachery', B_WARWICK_Y) + if (!must_retreat) { + let heir = can_heir_charge() + if (heir !== NOBODY && set_has(game.battle_list, heir)) + gen_action(view, 'battle_charge', heir) + if (can_attempt_treachery(game.king)) + gen_action(view, 'battle_treachery', game.king) + if (can_attempt_treachery(game.pretender)) + gen_action(view, 'battle_treachery', game.pretender) + if (can_attempt_treachery(B_WARWICK_L)) + gen_action(view, 'battle_treachery', B_WARWICK_L) + if (can_attempt_treachery(B_WARWICK_Y)) + gen_action(view, 'battle_treachery', B_WARWICK_Y) + } }, battle_fire: function (who) { fire_with_block(who) |