diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 28 |
1 files changed, 10 insertions, 18 deletions
@@ -228,17 +228,6 @@ function on_log(text) { // eslint-disable-line no-unused-vars let p = document.createElement("div")
-
-/*
- let last_text = last_log_entry ? last_log_entry.split(' ') : []
- console.log('last text', last_text, 'text', text.split(' ')[3])
- if (last_text[0] === 'Added' && last_text[4] === text.split(' ')[4]) {
- let new_influence = parseInt(last_text[1]) + 1
- new_text = `Added ${new_influence} influence in ${last_text[4]}`
- console.log('new_influence', new_influence, 'new_text', new_text)
- } */
-
-
if (text.match(/^>/)) {
text = text.substring(1)
p.className = 'i'
@@ -249,6 +238,7 @@ function on_log(text) { // eslint-disable-line no-unused-vars text = text.replace(/P(\d+)/g, sub_power_card_name)
text = text.replace(/V(\d+)/g, sub_power_card_value)
text = text.replace(/%(\d+)/g, sub_space_name)
+ text = text.replace(/\b[D][1-6]\b/g, sub_die)
if (text.match(/^\.h1/)) {
@@ -272,13 +262,6 @@ function on_log(text) { // eslint-disable-line no-unused-vars p.className = 'h3'
}
- //console.log('view.log', view.log)
- /*console.log('new text', text)
- if (last_log_entry_text) {
- console.log('log = text', last_log_entry_text === text)
- }
-
-*/
p.innerHTML = text
return p
}
@@ -741,6 +724,15 @@ function sub_die(match) { return die[match] || match
}
+const die = {
+ D1: '<span class="die white d1"></span>',
+ D2: '<span class="die white d2"></span>',
+ D3: '<span class="die white d3"></span>',
+ D4: '<span class="die white d4"></span>',
+ D5: '<span class="die white d5"></span>',
+ D6: '<span class="die white d6"></span>'
+}
+
// =========================== VISUAL FUNCTIONS ==========================================#
function on_focus_card_tip(card_number) {
|