summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
Diffstat (limited to 'play.js')
-rw-r--r--play.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/play.js b/play.js
index 3ea8f94..56f4b8e 100644
--- a/play.js
+++ b/play.js
@@ -7,6 +7,7 @@ const reactions = [ "Screen", "Counterattack", "Absorb" ]
let ui = {
main: document.querySelector("main"),
+ role_panel: [ document.getElementById("role_First"), document.getElementById("role_Second") ],
role_name: [ document.getElementById("role1"), document.getElementById("role2") ],
role_stat: [ document.getElementById("stat1"), document.getElementById("stat2") ],
name: [ document.getElementById("name1"), document.getElementById("name2") ],
@@ -318,19 +319,21 @@ function on_update() {
let w1 = data.cards[view.front[0][0]].wing
let w2 = data.cards[view.front[1][0]].wing
- console.log("W", w1, w2)
- ui.role_name[p1].textContent = data.scenarios[view.scenario].players[0].name
- ui.role_name[p2].textContent = data.scenarios[view.scenario].players[1].name
+ ui.role_panel[0].className = "role " + wing_name[w1]
+ ui.role_panel[1].className = "role " + wing_name[w2]
+
+ ui.role_name[0].textContent = data.scenarios[view.scenario].players[0].name
+ ui.role_name[1].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]})`
+ ui.role_stat[0].textContent = `${view.morale[0]} (-${view.lost[0]})`
else
- ui.role_stat[p1].textContent = view.morale[0]
+ ui.role_stat[0].textContent = view.morale[0]
if (data.scenarios[view.scenario].players[0].tactical)
- ui.role_stat[p2].textContent = `${view.morale[1]} (-${view.lost[1]})`
+ ui.role_stat[1].textContent = `${view.morale[1]} (-${view.lost[1]})`
else
- ui.role_stat[p2].textContent = view.morale[1]
+ ui.role_stat[1].textContent = view.morale[1]
for (let e of animation_registry)
remember_position(e)