From f03c54096910c03e441ea3676f223bdabef753cc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 13 Jan 2025 22:23:25 +0000 Subject: Tweak PS logging --- play.css | 2 +- rules.js | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/play.css b/play.css index 52cc044..a29d8de 100644 --- a/play.css +++ b/play.css @@ -33,7 +33,7 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } #log .h1 { font-weight: bold; padding-top:2px; padding-bottom:2px; text-align: center; } #log .h2 { padding-top:2px; padding-bottom:2px; text-align: center; } #log .h3 { text-align: center; } -#log .h4 { text-align: center; text-decoration: underline; } +#log .h4 { font-weight: bold; } #log .h5 { text-decoration: underline; } #log { background-color: floralwhite } diff --git a/rules.js b/rules.js index 75802a7..995af40 100644 --- a/rules.js +++ b/rules.js @@ -2871,6 +2871,7 @@ function battlegrounds(country) { function take_power(country) { game.revolutions[find_country_index(country)] = true game.times_held[find_country_index(country)] = 1 + game.vp_retain = 0 } function retain_power(country) { @@ -2944,16 +2945,21 @@ function score_country(country) { } logi(`${com_vp} VP`) game.vp += dem_vp + com_vp - let final_vp = game.vp + game.vp_roll - if (final_vp > 0) - log(`C${scoring_cards[countries.indexOf(game.pwr_struggle_in)]}: +${final_vp} VP.`) - else - log(`C${scoring_cards[countries.indexOf(game.pwr_struggle_in)]}: ${final_vp} VP.`) if (game.state === 'final_scoring') { - if (game.vp > 0) - log_gap(`Score is +${game.vp} VP`) + if ((dem_vp + com_vp) > 0) + log_h4(`Total: +${dem_vp + com_vp} VP`) else - log_gap(`Score is ${game.vp} VP`) + log_h4(`Total: ${dem_vp + com_vp} VP`) + if (game.vp > 0) + log(`Score is +${game.vp} VP`) + else + log(`Score is ${game.vp} VP`) + } else { + let final_vp = dem_vp + com_vp + game.vp_roll + game.vp_retain + if (final_vp > 0) + log_h4(`Power Struggle total: +${final_vp} VP`) + else + log_h4(`Power Struggle total: ${final_vp} VP`) } } -- cgit v1.2.3