From 990faf9a6d27a795d87e89286ba499fccbd24a4d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 28 Oct 2024 17:05:47 +0000 Subject: Updates to Table Cards and cleanup --- events.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index eaf585d..637f6c7 100644 --- a/events.txt +++ b/events.txt @@ -95,7 +95,6 @@ add_infl_free 3 CARD 13 - Stasi # For the rest this turn the Democratic Player must reveal the card he will play this action round before the Communist plays his card. -permanently_remove stasi @@ -173,7 +172,6 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. -permanently_remove perestroika @@ -376,7 +374,6 @@ foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -permanently_remove the_sinatra_doctrine -- cgit v1.2.3 From 7b10f6e1f438fd29057222f0dfbefb01f9b3fc71 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 14:37:42 +0000 Subject: Fix persistent events being permanently removed --- events.txt | 9 --------- rules.js | 8 +++----- 2 files changed, 3 insertions(+), 14 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 637f6c7..4f0158f 100644 --- a/events.txt +++ b/events.txt @@ -362,13 +362,11 @@ remove_all_infl 1 CARD 48 - We are the People!* # The Democrat can move up to 4 SPs from the Lutheran Church space to any spaces in Germany, no more than 2 per space. The Communist may no longer make Support Checks in Leipzig. -permanently_remove we_are_the_people CARD 49 - Foreign Currency Debt Burden* # The Democrat designates 1 country in Eastern Europe. For the rest of this turn the Communist has a -2 modifier for support checks in this country. -permanently_remove foreign_currency_debt_burden @@ -397,7 +395,6 @@ remove_all_infl 2 CARD 53 - Li Peng* # +1 modifier to all Communist Tiananmen Square track attempts for the rest of the game -permanently_remove li_peng @@ -528,7 +525,6 @@ peasant_parties_revolt CARD 73 - Laszlo Tokes* # Place 1 Democratic SP in Timisoara and Harghita/Covasna. The Democratic may then place SPs or make Support Check rolls in Romania using the Ops value of this card. Allows play of Massacre in Timisoara. -permanently_remove valid_spaces 'Timisoara', 'Harghita/Covasna' prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 @@ -614,7 +610,6 @@ remove_opp_infl 2 CARD 83 - Modrow* # Roll a die. If the die roll exceeds the number of Democratically controlled spaces in Germany, then place 4 Communist SPs in Germany, no more than 2 per space. -permanently_remove modrow valid_spaces_country 'East_Germany' prompt 'East Germany, no more than 2 per space' @@ -672,7 +667,6 @@ domino_theory CARD 90 - Civic Forum* # +1 VP. Place 4 SPs in Czechoslovakia. The Democratic Player may make Support Checks in Czechoslovakia using the Ops value of this card if the Czech Writers space is Democratically controlled. -permanently_remove valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 @@ -766,13 +760,11 @@ ligachev CARD 100 - Stand Fast* # -1 to opponent Support Checks in spaces you control for the rest of this turn. -permanently_remove stand_fast CARD 101 - Elena* # Add 2 SPs to the Romania Elite Space. -1 drm for Democratic Player for Support Checks in Romania the rest of this turn. No longer playable after The Tyrant is Gone -permanently_remove if !game.the_tyrant_is_gone valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' @@ -842,7 +834,6 @@ endif CARD 108 - Army Backs Revolution* # Place in front of the Democratic Player. Cancels effects of Securitate* event. -permanently_remove army_backs_revolution diff --git a/rules.js b/rules.js index a7a462c..05d1365 100644 --- a/rules.js +++ b/rules.js @@ -4890,6 +4890,7 @@ function vm_massacre_in_timisoara() { function vm_modrow() { game.playable_cards = game.playable_cards.filter(n => n !== C_HONECKER) + add_to_persistent_events(C_MODROW) game.state = 'vm_modrow' } @@ -7756,7 +7757,7 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ -// BEGIN EVENTS {{{ +// #region GENERATED EVENT CODE const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -8121,7 +8122,6 @@ CODE[47] = [ // Bulgarian Turks Expelled* ] CODE[48] = [ // We are the People!* - [ vm_permanently_remove ], [ vm_we_are_the_people ], [ vm_return ], ] @@ -8370,7 +8370,6 @@ CODE[82] = [ // Spitzel* ] CODE[83] = [ // Modrow* - [ vm_permanently_remove ], [ vm_modrow ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, 'East Germany, no more than 2 per space' ], @@ -8425,7 +8424,6 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* - [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -8650,4 +8648,4 @@ CODE[351] = [ // Scare Tactics [ vm_remove_opp_infl, 1 ], [ vm_return ], ] -// END EVENTS }}} +// #endregion -- cgit v1.2.3 From 8c35d6f14ca93044afa3ded1c687c8834eb20b69 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 21:09:12 +0000 Subject: More tweaks to permanently remove --- events.txt | 1 - rules.js | 36 +++++++++++++++++++++++------------- 2 files changed, 23 insertions(+), 14 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 4f0158f..0cccd73 100644 --- a/events.txt +++ b/events.txt @@ -472,7 +472,6 @@ add_limited_infl 11 1 CARD 65 - Presidential Visit* # The Communist's hand size is reduced to 7 next turn. -permanently_remove presidential_visit diff --git a/rules.js b/rules.js index 05d1365..9d5fb0d 100644 --- a/rules.js +++ b/rules.js @@ -1803,7 +1803,7 @@ states.general_strike = { if (total > 5) { log('The strike is over.') - permanently_remove(5) + permanently_remove(C_GENERAL_STRIKE) game.persistent_events = game.persistent_events.filter(n => n !== 5) } else { log('The strike continues. Required 6 or more') @@ -2374,14 +2374,14 @@ function valid_spaces_infl() { for (let i = 0; i < game.demInfl.length; i++) { let space = spaces[i] let player_influence = game.active === COM ? game.comInfl[i] : game.demInfl[i]; - + // If the piece has the player's influence, add it and its adjacent spaces to the set if (player_influence > 0) { valid_spaces_set.add(space.space_id); let adjacent_spaces = get_adjusted_adjacency(space.space_id) for (let adj_space_id of adjacent_spaces) { - if (adj_space_id) { + if (adj_space_id >= 0) { const adj_piece = spaces[adj_space_id]; // Check if the adjacent space is controlled by the opponent @@ -2391,9 +2391,9 @@ function valid_spaces_infl() { if (game.active === DEM && adj_piece.country === 'East_Germany' && game.persistent_events.includes(C_GENSCHER)){ valid_spaces_set.add(adj_piece.space_id) } - + // Otherwise, only add the adjacent space if the available_ops >= 2 or the space is not controlled by the opponent - if (ops >= 2 || !opponent_control) { + if (ops >= 2 || !opponent_control) { valid_spaces_set.add(adj_piece.space_id) } } @@ -2867,9 +2867,9 @@ function add_to_persistent_events(card) { } function permanently_remove(card) { - if (game.strategy_removed.includes(card)) {return} + discard_from_table(card) remove_from_discard(card) - + if (game.strategy_removed.includes(card)) {return} let card_index = game.table_cards.indexOf(card) if (card_index !== -1) { game.table_cards.splice(card_index, 1) @@ -3405,7 +3405,8 @@ function new_turn() { if (game.persistent_events.includes(C_PRESIDENTIAL_VISIT)) { game.com_hand_limit = 7 log('Communist draws 7 cards due to C65') - game.persistent_events = game.persistent_events.filter(n => n !== C_PRESIDENTIAL_VISIT) + permanently_remove(C_PRESIDENTIAL_VISIT) + game.persistent_events = game.persistent_events.filter( card => card !== C_PRESIDENTIAL_VISIT) } draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) game.com_hand_limit = 8 @@ -3596,8 +3597,9 @@ function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) if (find_card !== -1) { game.table_cards.splice(find_card, 1) - if (cards[card].remove === 1 && !game.strategy_removed.includes(card)) { - game.strategy_removed.push(card) + if (cards[card].remove === 1) { + if (!game.strategy_removed.includes(card)) { + game.strategy_removed.push(card) } } else {game.strategy_discard.push(card) } } } @@ -4031,6 +4033,16 @@ function vm_valid_spaces() { vm_next(); } +function vm_valid_spaces_com() { + let operand = vm_operand(1) + let space = spaces.find(space => space.ascii_name === operand) + if (game.comInfl[space.space_id] >0) { + game.valid_spaces.push(space.space_id) + } + check_systematization(); + vm_next(); +} + function vm_valid_spaces_opponent () { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { @@ -8232,7 +8244,6 @@ CODE[64] = [ // Legacy of 1968* ] CODE[65] = [ // Presidential Visit* - [ vm_permanently_remove ], [ vm_presidential_visit ], [ vm_return ], ] @@ -8488,7 +8499,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_valid_spaces_com, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8511,7 +8522,6 @@ CODE[98] = [ // Politburo Intrigue* ] CODE[99] = [ // Ligachev* - [ vm_permanently_remove ], [ vm_ligachev ], [ vm_return ], ] -- cgit v1.2.3 From 61bf91de549df935c4cfac0ba9173e1fd7dbeb5d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:10:05 +0000 Subject: Fix Ligachev --- events.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 0cccd73..827524b 100644 --- a/events.txt +++ b/events.txt @@ -753,7 +753,6 @@ prompt 'make a support check in Bulgaria' CARD 99 - Ligachev* # -3 VP if the Democrat does not play Gorbachev Charms the West for the event his next action round. -3 VPs take effect as soon as the Democrat plays his card but before the effect of the Democrat's card takes place. -permanently_remove ligachev -- cgit v1.2.3 From cad6d1d612b3175b472864e73adbb4757c020fec Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 22:39:02 +0000 Subject: Don't permanently remove eco-glasnost --- events.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 827524b..de4a3b4 100644 --- a/events.txt +++ b/events.txt @@ -278,7 +278,6 @@ add_infl_free 3 CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. -permanently_remove valid_spaces 'Ruse' prompt 'Ruse' add_x_infl 4 -- cgit v1.2.3 From ac1d0084681864a652a462acb79a82fa2ab5529f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 1 Nov 2024 23:17:09 +0000 Subject: More table cards tidying --- events.txt | 5 ----- 1 file changed, 5 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index de4a3b4..4176519 100644 --- a/events.txt +++ b/events.txt @@ -12,7 +12,6 @@ prompt 'make a Support Check in Poland' CARD 2 - Solidarity Legalised* # Place a Democratic SP in every uncontrolled Worker and Farmer space in Poland. Allows play of Walesa. -permanently_remove solidarity_legalised valid_spaces_solidarity_legalised prompt 'to every uncontrolled Worker and Farmer space in Poland' @@ -62,7 +61,6 @@ prudence CARD 9 - The Wall* # Place in front of the Communist Player. In his next Support Check in Germany cancel drm for any adjacent spaces controlled by the Democratic Player. -permanently_remove the_wall @@ -109,7 +107,6 @@ prompt 'select a space for the Support Check' CARD 15 - Honecker # The Communist Player may take any non-Power Struggle - card in the discard pile and put it in his hand. The Communist Player may take one extra action round this turn. May not be played as event after Modrow*. -permanently_remove honecker @@ -163,7 +160,6 @@ power_struggle CARD 24 - St Nicolas Church # Place sufficient Democratic SPs in the Lutheran Church space for Democratic control. Allows play of The Monday Demonstrations. -permanently_remove valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 @@ -177,7 +173,6 @@ perestroika CARD 26 - Helsinki Final Act* # +1 VP for every Support Check die roll by the Communist Player in Student or Intellectual spaces the rest of the game. -permanently_remove helsinki_final_act -- cgit v1.2.3