From 7b97d2c42bcb5b1be04b35400a10aeffb0023d4e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 13:36:51 +0000 Subject: Fix Power Struggle reset --- rules.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/rules.js b/rules.js index a5efc95..efb2771 100644 --- a/rules.js +++ b/rules.js @@ -2726,23 +2726,23 @@ function score_country(country) { if (presence.dem_control || presence.dem_domination) { log(`Democrat:`) if (presence.dem_control) { - log(`Control: +${value_control} VP`) + logi(`Control: +${value_control} VP`) dem_vp += value_control } else { - log(`Domination: +${value_domination} VP`) + logi(`Domination: +${value_domination} VP`) dem_vp += value_domination } - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds log(`Total: +${dem_vp} VP`) log_gap('Communist:') if (presence.com_spaces > 0) { - log(`Presence: -${value_presence} VP`) + logi(`Presence: -${value_presence} VP`) com_vp -= value_presence if (presence.com_battlegrounds >0) { - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds } log(`Total: ${com_vp} VP`) @@ -2753,23 +2753,23 @@ function score_country(country) { else if (presence.com_control || presence.com_domination) { log('Communist:') if (presence.com_control) { - log(`Control: -${value_control} VP`) + logi(`Control: -${value_control} VP`) com_vp -= value_control } else { - log(`Domination: -${value_domination} VP`) + logi(`Domination: -${value_domination} VP`) com_vp -= value_domination } - log(`Battlegrounds: -${presence.com_battlegrounds} VP`) + logi(`Battlegrounds: -${presence.com_battlegrounds} VP`) com_vp -= presence.com_battlegrounds log(`Total: ${com_vp} VP`) log_gap('Democrat:') if (presence.dem_spaces > 0) { - log(`Presence: +${value_presence} VP`) + logi(`Presence: +${value_presence} VP`) dem_vp += value_presence if (presence.dem_battlegrounds > 0) { - log(`Battlegrounds: +${presence.dem_battlegrounds} VP`) + logi(`Battlegrounds: +${presence.dem_battlegrounds} VP`) dem_vp += presence.dem_battlegrounds } log (`Total: +${dem_vp} VP`) @@ -2848,20 +2848,20 @@ function get_aftermath_roll() { if (petitions.includes(game.played_power_card) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win if (game.active === DEM && game.persistent_events.includes(C_YAKOVLEV_COUNSELS_GORBACHEV)) { - log(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) + logi(`+1 from C${C_YAKOVLEV_COUNSELS_GORBACHEV}`) modified_roll ++ } if (modified_roll < 0) {modified_roll = 0} else if (modified_roll > 7) {modified_roll = 7} if (game.raised_stakes !== 0) { - log(`+${game.raised_stakes} from Raising the Stakes`) + logi(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P1') + logi('+2 from winning on a P1') } if (petition_win !== 0) { - log('-2 from winning on a P31') + logi('-2 from winning on a P31') } if (modified_roll !== roll) { log(`Modified roll: ${modified_roll}`) @@ -2872,7 +2872,8 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - if (card !== C_SYSTEMATIZATION) {log(`C${card}:`)} + let silent_cards = [C_SYSTEMATIZATION, C_FOREIGN_CURRENCY_DEBT_BURDEN] + if (!silent_cards.includes(card)) {log(`C${card}:`)} } function permanently_remove(card) { @@ -3628,15 +3629,14 @@ function reset_power() { delete game.tactics_fails game.view_opp_hand = false - let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU, C_SECURITATE] + let scoring_events = [C_PEASANT_PARTIES_REVOLT, C_YAKOVLEV_COUNSELS_GORBACHEV, C_THE_CROWD_TURNS_AGAINST_CEAUSESCU] for (let e of scoring_events ) { - if ( e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU && game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { - permanently_remove(e) - } else if (e === C_SECURITATE && game.pwr_struggle_in === 'Romania' && game.persistent_events.includes(e)){ - game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) + if (e === C_THE_CROWD_TURNS_AGAINST_CEAUSESCU ) { + if (game.persistent_events.includes(e) && game.pwr_struggle_in === 'Romania') { + permanently_remove(e) + } } else if (game.persistent_events.includes(e)) { permanently_remove(e) - game.persistent_events = game.persistent_events.filter(n => n !== e) } } } @@ -5170,7 +5170,7 @@ function vm_the_chinese_solution() { function vm_the_crowd_turns_against_ceausescu() { add_to_persistent_events(C_THE_CROWD_TURNS_AGAINST_CEAUSESCU) - logi(`After the players draw cards for the next Power Struggle in Romania, the Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops equal to 3 times the number of Rally cards drawn. Allows play of C${C_THE_TYRANT_IS_GONE}`) + logi(`Power Struggle: Romania. Democrat draws 15 Power Struggle cards and takes 1 Action Round using Ops 3 times the number of Rallies. Allows play of C${C_THE_TYRANT_IS_GONE}`) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } -- cgit v1.2.3