summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-28 16:51:16 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commit298695de12eac0884e1aa6b416b1300694e0ae70 (patch)
tree97b8f9f91251d2d5e014a22c5ef30fd998cede06 /play.js
parent1a34aa786c78743b4af552b10789e4b62b2c7235 (diff)
downloadnevsky-298695de12eac0884e1aa6b416b1300694e0ae70.tar.gz
Pursuit.
Diffstat (limited to 'play.js')
-rw-r--r--play.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/play.js b/play.js
index 276ae05..e9c0b17 100644
--- a/play.js
+++ b/play.js
@@ -491,6 +491,7 @@ const ui = {
battle_garrison: document.getElementById("mat_garrison"),
battle_panel: document.getElementById("battle_panel"),
battle_header: document.getElementById("battle_header"),
+ pursuit: document.getElementById("mat_pursuit"),
battle_mat: document.getElementById("battle_mat"),
battle_mat_array: [
document.getElementById("mat_a1"),
@@ -1303,6 +1304,21 @@ function update_cards() {
function update_battle() {
let array = view.battle.array
+ // Pursuit marker points "up" towards the conceding side
+ if (view.battle.conceded === "Russians") {
+ if (view.battle.attacker === "Russians")
+ ui.pursuit.className = "marker rectangle pursuit teutonic"
+ else
+ ui.pursuit.className = "marker rectangle pursuit teutonic rotate"
+ } else if (view.battle.conceded === "Teutons") {
+ if (view.battle.attacker === "Teutons")
+ ui.pursuit.className = "marker rectangle pursuit russian"
+ else
+ ui.pursuit.className = "marker rectangle pursuit russian rotate"
+ } else {
+ ui.pursuit.className = "hide"
+ }
+
ui.battle_attacker_reserves.replaceChildren()
ui.battle_defender_reserves.replaceChildren()
for (let lord of view.battle.reserves) {