summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.js6
-rw-r--r--rules.js77
2 files changed, 42 insertions, 41 deletions
diff --git a/play.js b/play.js
index 0471007..d78cfd4 100644
--- a/play.js
+++ b/play.js
@@ -624,7 +624,7 @@ function layout_vp_marker() {
}
function layout_country(id) {
- // TODO: what number to display?
+ // TODO: what number to display?
if (view.revolutions[id])
ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id]
else if (view.times_held[id] > 0)
@@ -992,7 +992,7 @@ function sub_icon(match) {
return ICONS[match] || match
}
-function sub_arrow(match) {
+function sub_arrow(_match) {
return '<span>&nbsp&#8594&nbsp</span>'
}
@@ -1122,7 +1122,7 @@ function on_log(text, ix) {
log_event = 0
}
-//Group events
+ // Group events
// Reset group box counters (when log is rewound)
if (ix <= log_event) log_event = 0
diff --git a/rules.js b/rules.js
index 064c108..8a06fbb 100644
--- a/rules.js
+++ b/rules.js
@@ -2204,10 +2204,10 @@ states.stasi_play_ceh = {
return `play ${quoted_card_name[game.played_card]}`
},
prompt() {
- view.prompt = "Play " + quoted_card_name[game.played_card]
- gen_action('influence')
- gen_action('support_check')
- },
+ view.prompt = 'Play ' + quoted_card_name[game.played_card]
+ gen_action('influence')
+ gen_action('support_check')
+ },
influence() {
push_undo()
log_ops_banner()
@@ -4326,7 +4326,7 @@ function log_event(n) {
else if (cards[n].side === "D")
game.log.push(".E:C" + n + ".D")
else
- game.log.push(".E:C" + n + ".N")
+ game.log.push(".E:C" + n + ".N")
}
function log_br() {
@@ -4436,74 +4436,75 @@ function pop_summary_i() {
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;
- let deferred_logs = [];
+ let grouped_summary = new Map()
+ let c63_logged = false
+ let deferred_logs = []
- for (let [n, msg] of game.summary) {
+ for (let [ n, msg ] of game.summary) {
// Special case: Log C63 only once
- if (msg === "(-1 Op due to C63)") {
+ if (msg === '(-1 Op due to C63)') {
if (!c63_logged) {
- logi(msg);
- c63_logged = true;
+ logi(msg)
+ c63_logged = true
}
- continue;
+ continue
}
// Direct log for messages like C50, C123
if (!/^£/.test(msg)) {
if (msg.includes('VP')) {
- deferred_logs.push(msg);
- } else {
- logi(msg);
- }
+ deferred_logs.push(msg)
+ } else {
+ logi(msg)
+ }
}
// Extract the space identifier (e.g., %33) and type (e.g., "in" or "from")
- let space_match = msg.match(/(in|from) (%\d+)/);
- if (!space_match) continue; // Skip if no valid match
+ let space_match = msg.match(/(in|from) (%\d+)/)
+ if (!space_match)
+ continue // Skip if no valid match
- let type = space_match[1];
- let space = space_match[2];
+ let type = space_match[1]
+ let space = space_match[2]
// Extract additional details (e.g., £DC .to £UU)
- let details_match = msg.match(/\((.*?)\)$/);
- let details = details_match ? details_match[1] : "";
+ let details_match = msg.match(/\((.*?)\)$/)
+ let details = details_match ? details_match[1] : ''
// Split the details into "start" and "end" parts
- let [start, end] = details.split(" .to ");
+ let [ start, end ] = details.split(' .to ')
// Group by type and space
- let key = `${type} ${space}`;
+ let key = `${type} ${space}`
if (!grouped_summary.has(key)) {
- grouped_summary.set(key, { total: 0, start: "", end: "" });
+ grouped_summary.set(key, { total: 0, start: '', end: '' })
}
- let entry = grouped_summary.get(key);
- entry.total += n;
+ let entry = grouped_summary.get(key)
+ entry.total += n
// Update the start only if it's not already set
if (start && !entry.start) {
- entry.start = start;
+ entry.start = start
}
// Always update the end with the most recent value
if (end) {
- entry.end = end;
+ entry.end = end
}
}
// Log the grouped results
- for (let [key, { total, start, end }] of grouped_summary) {
- let details = start && end ? ` (${start} .to ${end})` : "";
- logi(`${total} ${key}${details}`);
+ for (let [ key, { total, start, end } ] of grouped_summary) {
+ let details = start && end ? ` (${start} .to ${end})` : ''
+ logi(`${total} ${key}${details}`)
}
for (let msg of deferred_logs) {
- logi(msg);
- }
+ logi(msg)
+ }
}
- game.summary = [];
-}
+ game.summary = []
+}
function do_log_summary() {
@@ -8383,7 +8384,7 @@ states.vm_tst_6 = {
if (game.active === DEM)
log('Democrat free 2 Ops support check.')
else
- log('Communist free 2 Ops support check.')
+ log('Communist free 2 Ops support check.')
game.selected_space = space
if (
game.active === DEM &&