diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -153,7 +153,7 @@ function create_formation_card(id) { let e = create_div("card formation " + wing_name[card.wing]) if (card.squeeze) - e.classList.add("squeeze" + card.squeeze) + e.classList.add("squeeze") register_action(e, "card", id) @@ -206,22 +206,27 @@ function create_formation_card(id) { append_div(ee, "action_target", a.target.map(t=>data.cards[t].name).join(", ")) else append_div(ee, "action_target", a.target) - if (a.effect && a.rule_text) - append_div(ee, "action_effect short", a.effect) - else if (a.effect) - append_div(ee, "action_effect", a.effect) - if (a.rule_text) - append_div(e, "action_rule", a.rule_text) + if (a.effect) { + if (a.short) + append_div(ee, "action_effect short", a.effect) + else + append_div(ee, "action_effect", a.effect) + } return et } if (card.actions.length >= 1) create_action(card.actions[0], 1) + + if (card.rule_text_1) + append_div(e, "rule_text", card.rule_text_1) + if (card.actions.length >= 2) create_action(card.actions[1], 2) - if (card.rule_text) - append_div(e, "rule_text", card.rule_text) + if (card.rule_text_2) + append_div(e, "rule_text", card.rule_text_2) + if (card.lore_text) append_div(e, "lore_text", card.lore_text) @@ -351,13 +356,13 @@ function on_update() { 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[0].textContent = `${view.morale[0]} (-${view.lost[0]})` + if (data.scenarios[view.scenario].players[0].tactical) + ui.role_stat[0].textContent = `${view.morale[0]} (${view.tv1})` else ui.role_stat[0].textContent = view.morale[0] - if (data.scenarios[view.scenario].players[0].tactical) - ui.role_stat[1].textContent = `${view.morale[1]} (-${view.lost[1]})` + if (data.scenarios[view.scenario].players[1].tactical) + ui.role_stat[1].textContent = `${view.morale[1]} (${view.tv2})` else ui.role_stat[1].textContent = view.morale[1] |