diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-13 22:53:36 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-01-08 16:36:48 +0100 |
commit | 40fd74d16cdd2749c512e38989783894b001d7b2 (patch) | |
tree | e044fa6bb8441fd3956283e7209c65116993c199 /play.js | |
parent | d6373f1887af64b092d55fa07d70ad383721405b (diff) | |
download | table-battles-40fd74d16cdd2749c512e38989783894b001d7b2.tar.gz |
Tactical victory check.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -8,6 +8,7 @@ const reactions = [ "Screen", "Counterattack", "Absorb" ] let ui = { main: document.querySelector("main"), role_name: [ document.getElementById("role1"), document.getElementById("role2") ], + role_stat: [ document.getElementById("stat1"), document.getElementById("stat2") ], name: [ document.getElementById("name1"), document.getElementById("name2") ], front: [ document.getElementById("front1"), document.getElementById("front2") ], morale: [ document.getElementById("morale1"), document.getElementById("morale2") ], @@ -315,6 +316,16 @@ function on_update() { ui.role_name[p1].textContent = data.scenarios[view.scenario].players[0].name ui.role_name[p2].textContent = data.scenarios[view.scenario].players[1].name + if (data.scenarios[view.scenario].players[1].tactical) + ui.role_stat[p1].textContent = `${view.morale[0]} (-${view.lost[0]})` + else + ui.role_stat[p1].textContent = view.morale[0] + + if (data.scenarios[view.scenario].players[0].tactical) + ui.role_stat[p2].textContent = `${view.morale[1]} (-${view.lost[1]})` + else + ui.role_stat[p2].textContent = view.morale[1] + for (let e of animation_registry) remember_position(e) |