From 8b38dbef827b7b42f54f118554ab8e83ab639b4e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 21 Dec 2024 18:46:48 +0000 Subject: Update logging for completing Tyrant --- rules.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 8fd76c2..b2cc2db 100644 --- a/rules.js +++ b/rules.js @@ -4311,6 +4311,7 @@ function check_tyrant() { function check_tyrant_sc() { if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { logi('+2 VP from C' + C_THE_TYRANT_IS_GONE + '.') + console.log('game.summary',game.summary) game.vp += 2 if (check_vp()) { return @@ -4520,10 +4521,12 @@ function pop_summary_i() { } */ function pop_summary_i() { + console.log('pop summary', game.summary) if (game.summary.length > 0) { // Create a map to group by space and track totals and details let grouped_summary = new Map(); let c63_logged = false; + let deferred_logs = []; for (let [n, msg] of game.summary) { // Special case: Log C63 only once @@ -4536,9 +4539,12 @@ function pop_summary_i() { } // Direct log for messages like C50, C123 - if (/^C\d{1,3}$/.test(msg)) { - logi(msg); - continue; + if (!/^£/.test(msg)) { + if (msg.includes('VP')) { + deferred_logs.push(msg); + } else { + logi(msg); + } } // Extract the space identifier (e.g., %33) and type (e.g., "in" or "from") @@ -4579,9 +4585,11 @@ function pop_summary_i() { let details = start && end ? ` (${start} .to ${end})` : ""; logi(`${total} ${key}${details}`); } + for (let msg of deferred_logs) { + logi(msg); + } } - // Clear the summary after logging game.summary = []; } -- cgit v1.2.3