summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-12-21 18:46:48 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-12-21 18:46:48 +0000
commit8b38dbef827b7b42f54f118554ab8e83ab639b4e (patch)
treef0533d48ae36f09f772608196aaf9c5d013f10bd /rules.js
parent0489dda2d8bdb3b127163c739b8805003346a95e (diff)
download1989-dawn-of-freedom-8b38dbef827b7b42f54f118554ab8e83ab639b4e.tar.gz
Update logging for completing Tyrant
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js16
1 files 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 = [];
}