summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rules.js68
1 files changed, 38 insertions, 30 deletions
diff --git a/rules.js b/rules.js
index 71697ca..3d3d57d 100644
--- a/rules.js
+++ b/rules.js
@@ -4512,40 +4512,48 @@ function pop_summary_i() {
game.summary = []
} */
- function pop_summary_i() {
- if (game.summary.length > 0) {
- // Create a map to group by space and track totals and details
- let grouped_summary = new Map();
-
- for (let [n, msg] of game.summary) {
- // Extract the space identifier (e.g., %67) from the message
- let space_match = msg.match(/%\d+/);
- let space = space_match ? space_match[0] : "unknown";
-
- // Extract any details (e.g., £CU to £CC) from the message
- let details_match = msg.match(/\(.*?\)$/);
- let details = details_match ? details_match[0] : "";
-
- // Update or initialize the entry for the space
- if (!grouped_summary.has(space)) {
- grouped_summary.set(space, { total: 0, details });
- }
- let entry = grouped_summary.get(space);
- entry.total += n;
-
- // Always keep the most specific details (non-empty)
- if (details) {
- entry.details = details;
- }
+function pop_summary_i() {
+ 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;
+
+ for (let [n, msg] of game.summary) {
+ if (msg === "-1 op due to C63") {
+ if (!c63_logged) {
+ logi(msg);
+ c63_logged = true;
+ }
+ continue;
+ }
+ // Extract the space identifier (e.g., %67) from the message
+ let space_match = msg.match(/%\d+/);
+ let space = space_match ? space_match[0] : "unknown";
+
+ // Extract any details (e.g., £CU to £CC) from the message
+ let details_match = msg.match(/\(.*?\)$/);
+ let details = details_match ? details_match[0] : "";
+
+ // Update or initialize the entry for the space
+ if (!grouped_summary.has(space)) {
+ grouped_summary.set(space, { total: 0, details });
}
-
- // Log the grouped results
- for (let [space, { total, details }] of grouped_summary) {
- logi(`${total} in ${space} ${details}`);
+ let entry = grouped_summary.get(space);
+ entry.total += n;
+
+ // Always keep the most specific details (non-empty)
+ if (details) {
+ entry.details = details;
}
}
- game.summary = [];
+
+ // Log the grouped results
+ for (let [space, { total, details }] of grouped_summary) {
+ logi(`${total} in ${space} ${details}`);
+ }
}
+ game.summary = [];
+}