From 1159095b92d85e934037f2c0323135b2e443b0e6 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 29 Dec 2022 13:51:29 +0100 Subject: Storm. --- play.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'play.js') diff --git a/play.js b/play.js index 48913b8..54a9853 100644 --- a/play.js +++ b/play.js @@ -510,7 +510,7 @@ const ui = { court2: document.getElementById("court2"), battle_attacker_reserves: document.getElementById("mat_attacker_reserves"), battle_defender_reserves: document.getElementById("mat_defender_reserves"), - battle_garrison: document.getElementById("mat_garrison"), + garrison: document.getElementById("mat_garrison"), battle_panel: document.getElementById("battle_panel"), battle_header: document.getElementById("battle_header"), pursuit: document.getElementById("mat_pursuit"), @@ -1390,6 +1390,14 @@ function update_battle() { ui.battle_cylinder[lord].classList.toggle("action", is_battle_lord_action(lord)) ui.battle_cylinder[lord].classList.toggle("selected", view.who === lord) } + + ui.garrison.replaceChildren() + if (view.battle.garrison) { + for (let i = 0; i < view.battle.garrison.knights; ++i) + add_force(parent, KNIGHTS, -1, 0) + for (let i = 0; i < view.battle.garrison.men_at_arms; ++i) + add_force(parent, MEN_AT_ARMS, -1, 0) + } } function is_lord_in_grid(lord) { -- cgit v1.2.3