summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-09-16 00:32:56 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commite40e0171938dfe33c7069f2ca5c199a294bcd586 (patch)
tree473bd1b9a1ecb394d1c7679b7416add22bd5d955 /play.js
parented3fbab5440ea95bf04d10880f178681a379ff5b (diff)
downloadrommel-in-the-desert-e40e0171938dfe33c7069f2ca5c199a294bcd586.tar.gz
Show eliminated units off to the side of the Qattara depression.
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/play.js b/play.js
index ed17112..f083057 100644
--- a/play.js
+++ b/play.js
@@ -23,6 +23,7 @@ const SS_TOBRUK = 4
const SS_OASIS = 5
const DEPLOY = 1
+const ELIMINATED = 2
const ARMOR = 0
const INFANTRY = 1
@@ -375,6 +376,8 @@ function on_focus_unit(evt) {
t += " - moved"
if (is_unit_fired(u))
t += " - fired"
+ if (unit_hex(u) === ELIMINATED)
+ t += " - eliminated"
document.getElementById("status").textContent = t
}
@@ -716,6 +719,7 @@ function layout_stack(stack, hex, start_x, start_y, wrap, xdir) {
e.classList.toggle("action", !view.battle && is_unit_action(u))
e.classList.toggle("selected", !view.battle && is_unit_selected(u))
e.classList.toggle("moved", is_unit_moved(u))
+ e.classList.toggle("eliminated", unit_hex(u) === ELIMINATED)
}
}
@@ -750,6 +754,12 @@ function update_map() {
for (let u = 0; u < unit_count; ++u) {
let e = ui.units[u]
let hex = unit_hex(u)
+ if (hex === 2) {
+ if (is_axis_unit(u))
+ hex = 170
+ else
+ hex = 171
+ }
if (hex >= hexdeploy + view.month + 10)
hex = 0
if (is_setup_hex(hex)) {