summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-12-17 17:31:43 +0000
committeriainp5 <iain.pearce.ip@gmail.com>2024-12-17 17:31:43 +0000
commite0f13a64a26050e4b517fee1c563ec17052f3f22 (patch)
treeec34b979007460253426b9b4f49f32d7dd72fc23
parent7ac88e90d44cf077ed3cc1c8bc827993daab8b4a (diff)
download1989-dawn-of-freedom-e0f13a64a26050e4b517fee1c563ec17052f3f22.tar.gz
Update logging for Genscher
-rw-r--r--rules.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 7abbfab..4ffef6a 100644
--- a/rules.js
+++ b/rules.js
@@ -2888,7 +2888,7 @@ function do_tst_attempt() {
//log(`Modified roll: ${roll}`)
// TIANANMEN SQUARE ATTEMPT
- game.return = game.active
+ game.return = game.round_player
//game.return_state = 'tiananmen_square_attempt_done'
if (game.active === DEM) {
@@ -4489,6 +4489,7 @@ function log_summary(msg) {
}
}
game.summary.push([1, msg])
+ console.log('game.summary', game.summary)
}
function pop_summary() {
@@ -4520,7 +4521,8 @@ function pop_summary_i() {
let c63_logged = false;
for (let [n, msg] of game.summary) {
- if (msg === "-1 op due to C63") {
+ console.log('msg', msg)
+ if (msg === "(-1 op due to C63)") {
if (!c63_logged) {
logi(msg);
c63_logged = true;
@@ -4530,7 +4532,7 @@ function pop_summary_i() {
// Extract the space identifier (e.g., %67) from the message
let space_match = msg.match(/%\d+/);
let space = space_match ? space_match[0] : "unknown";
-
+ console.log('msg', msg, 'space_match', space_match)
// Extract any details (e.g., £CU to £CC) from the message
let details_match = msg.match(/\(.*?\)$/);
let details = details_match ? details_match[0] : "";
@@ -4784,6 +4786,7 @@ function vm_end_event() {
end_round()
return
}
+ console.log('in game return, game.return', game.return)
if (game.return !== game.active) {
//next_player()
console.log('2')
@@ -5063,12 +5066,15 @@ function vm_add_x_infl() {
function vm_do_add_x_infl(space) {
push_undo()
- logi(`${game.vm_available_ops} - %${space}`)
+ let starting_control = check_control(space)
+
if (game.active === COM) {
game.comInfl[space] += game.vm_available_ops
} else {
game.demInfl[space] += game.vm_available_ops
}
+ let end_control = check_control(space)
+ logi(`${game.vm_available_ops} in %${space}${get_icons(starting_control, end_control)}`)
check_tyrant()
game.vm_available_ops = 0
game.valid_spaces = []
@@ -7287,7 +7293,6 @@ states.vm_goodbye_lenin_ops = {
},
tst() {
push_undo()
- game.return = game.round_player
game.state = 'vm_tiananmen_square_attempt'
},
}