summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-12-06 21:37:49 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-12-06 21:37:49 +0000
commit1ad1a6ddfbc94b649b1f629aed4f12fee414c6f2 (patch)
tree1f48c87c7d59d335a77bcb54136aa5eed0df0330 /play.js
parent992e03dcbf2e17cf1f20e7237d3eb21d64a5cb19 (diff)
download1989-dawn-of-freedom-1ad1a6ddfbc94b649b1f629aed4f12fee414c6f2.tar.gz
Event and Operation banners in log
Diffstat (limited to 'play.js')
-rw-r--r--play.js48
1 files changed, 41 insertions, 7 deletions
diff --git a/play.js b/play.js
index 0135fd3..6e05560 100644
--- a/play.js
+++ b/play.js
@@ -837,7 +837,10 @@ let event_side = null
function sub_card_name(_match, p1) {
let x = p1 | 0
- return `<span class="card_name" onmouseenter="on_focus_card_tip(${x})" onmouseleave="on_blur_card_tip()">${cards[x].name.replace("*", "")}</span>`
+ if (scoring_cards.includes(x))
+ return `<span class="scoring_card_name" onmouseenter="on_focus_card_tip(${x})" onmouseleave="on_blur_card_tip()">${cards[x].name.replace("*", "")}</span>`
+ else
+ return `<span class="card_name" onmouseenter="on_focus_card_tip(${x})" onmouseleave="on_blur_card_tip()">${cards[x].name.replace("*", "")}</span>`
}
function sub_power_card_name(_match, p1) {
@@ -872,6 +875,7 @@ const die = {
function on_log(text, ix) {
let p = document.createElement("div")
+ console.log('text', text)
let event_string = text.match(/^C(\d+)/)
if (event_string)
event_n = parseInt(event_string[1])
@@ -902,16 +906,46 @@ function on_log(text, ix) {
text = text.substring(4)
p.className = "h2"
log_event = 0
- } else if (text.match(/^\.d/)) {
- text = "Democrat Action Round"
+ } else if (text.match(/^\.O\.d/)) {
+ text = "operations"
+ p.className = "h2 dem"
+ log_event = 0
+ } else if (text.match(/^\.V\.d/)) {
+ text = "event"
+ p.className = "h2 dem"
+ log_event = 0
+ } else if (text.match(/^\.T\.d/)) {
+ text = "event and operations"
p.className = "h2 dem"
log_event = 0
- } /*else if (text.match(/\.D$/)) {
- p.classList.add("dem")
- } */ else if (text.match(/^\.c/)) {
- text = "Communist Action Round"
+ } else if (text.match(/^\.S\.d/)) {
+ text = text.replace(".S.d", "")
+ p.className = "h2 dem"
+ log_event = 0
+ } else if (text.match(/^\.O\.c/)) {
+ text = "operations"
+ p.className = "h2 com"
+ log_event = 0
+ } else if (text.match(/^\.V\.c/)) {
+ text = "event"
p.className = "h2 com"
log_event = 0
+ } else if (text.match(/^\.T\.c/)) {
+ text = "event and operations"
+ p.className = "h2 com"
+ log_event = 0
+ } else if (text.match(/^\.S\.c/)) {
+ text = text.replace(".S.c", "")
+ p.className = "h2 com"
+ log_event = 0
+ } else if (text.match(/\.c/)) {
+ text = text.replace(".c", "")
+ p.className = "h2 com"
+ log_event = 0
+ } else if (text.match(/\.d/)) {
+ text = text.replace(".d", "")
+ p.className = "h2 dem"
+ log_event = 0
} else if (text.match(/^\.h3/)) {
text = text.substring(4)
p.className = "h3"