diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-09-03 19:35:56 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 13:11:27 +0100 |
commit | 0e8fb16e6f787da2ec0b5cd0a759fb9ca228ab39 (patch) | |
tree | 6bb94d647d626b6e60e891f3c7e5bb837c8c6a99 /play.js | |
parent | 0e18ac1858718ab16e3bd1d7c0aa19d7bcaa2f1c (diff) | |
download | rommel-in-the-desert-0e8fb16e6f787da2ec0b5cd0a759fb9ca228ab39.tar.gz |
Misc fixes.
End battle properly when routing.
Forced march into battle.
Skip combat phase during pass turns.
Clear moved flags before buildup.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -841,17 +841,16 @@ function update_battle() { ui.battle.classList.remove("hide") ui.battle_header.textContent = hex_name[view.battle] ui.battle_message.textContent = view.flash - // TODO: don't show disrupted units? if (player === ALLIED) { - update_battle_line(view.battle, ui.battle_line_1, u => is_axis_unit(u) && is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_2, u => is_axis_unit(u) && !is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_3, u => is_allied_unit(u) && !is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_4, u => is_allied_unit(u) && is_artillery_unit(u)) + update_battle_line(view.battle, ui.battle_line_1, u => is_axis_unit(u) && is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_2, u => is_axis_unit(u) && !is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_3, u => is_allied_unit(u) && !is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_4, u => is_allied_unit(u) && is_artillery_unit(u) && !is_unit_disrupted(u)) } else { - update_battle_line(view.battle, ui.battle_line_1, u => is_allied_unit(u) && is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_2, u => is_allied_unit(u) && !is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_3, u => is_axis_unit(u) && !is_artillery_unit(u)) - update_battle_line(view.battle, ui.battle_line_4, u => is_axis_unit(u) && is_artillery_unit(u)) + update_battle_line(view.battle, ui.battle_line_1, u => is_allied_unit(u) && is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_2, u => is_allied_unit(u) && !is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_3, u => is_axis_unit(u) && !is_artillery_unit(u) && !is_unit_disrupted(u)) + update_battle_line(view.battle, ui.battle_line_4, u => is_axis_unit(u) && is_artillery_unit(u) && !is_unit_disrupted(u)) } for (let i = 0; i < 4; ++i) ui.battle_hits[i].textContent = view.hits[i] |