From 7396312cd495803df67a2e8ca17cf7b01927cfdb Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 10 Oct 2024 22:29:33 +0100 Subject: Adding undo steps --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index b95fa7c..5855621 100644 --- a/events.txt +++ b/events.txt @@ -486,7 +486,7 @@ permanently_remove CARD 67 - Reformer Rehabilitated* # If you are ahead on the Tiananmen Square track, draw any card in the discard pile. The event takes place immediately. -prompt 'Chose any non-scoring card in the discard pile. Event takes place immediately' +prompt 'Reformer Rehabilitated: chose any non-scoring card in the discard pile. Event takes place immediately' reformer_rehabilitated -- cgit v1.2.3 From db5c4c7f8e937b6527a04b097f1c4c61f94ae9c5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 11 Oct 2024 09:05:28 +0100 Subject: Updates to SC log --- events.txt | 2 +- play.js | 2 +- rules.js | 106 +++++++++++++++++++++++++++++++++++++------------------------ 3 files changed, 66 insertions(+), 44 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 5855621..7f83643 100644 --- a/events.txt +++ b/events.txt @@ -25,7 +25,7 @@ valid_spaces_country 'Poland' prompt 'any space(s) in Poland' add_infl_free 4 valid_spaces_country_sc 'Poland' -prompt 'Make Support Checks in Poland' +prompt 'make Support Checks in Poland' support_check 2 permanently_remove diff --git a/play.js b/play.js index 9f4c107..be10507 100644 --- a/play.js +++ b/play.js @@ -238,7 +238,7 @@ function on_log(text) { // eslint-disable-line no-unused-vars text = text.replace(/P(\d+)/g, sub_power_card_name) text = text.replace(/V(\d+)/g, sub_power_card_value) text = text.replace(/%(\d+)/g, sub_space_name) - text = text.replace(/\b[D][1-6]\b/g, sub_die) + text = text.replace(/D[1-6]/g, sub_die) if (text.match(/^\.h1/)) { diff --git a/rules.js b/rules.js index a00f77f..8250dfc 100644 --- a/rules.js +++ b/rules.js @@ -1406,7 +1406,7 @@ states.power_struggle = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { log('Initiative roll successful') game.phase = 0 @@ -1516,7 +1516,7 @@ states.support_loss ={ let roll = Math.floor(Math.random() * 6) + 1 let rally_win = 0 let petition_win = 0 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) { rally_win = 2} if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win @@ -1585,7 +1585,7 @@ states.vp_roll = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) let rally_win = 0 let petition_win = 0 if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {rally_win = 2} @@ -1906,12 +1906,12 @@ states.general_strike = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) - log(`+${game.available_ops} from card ops`) + log(`+${game.available_ops} ops`) let total = roll + game.available_ops - log(`Modified total: ${total}`) + log(`TOTAL: ${total}`) if (total > 5) { log('The strike is over.') @@ -2285,7 +2285,7 @@ function do_sc(space) { // Continue with Support Check Logic let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) console.log('game.vm_event', game.vm_event) console.log('game.is_pwr_struggle', game.is_pwr_struggle) /* @@ -2300,7 +2300,7 @@ function do_sc(space) { //else if (game.is_pwr_struggle) { roll += game.vm_available_ops - log(`+${game.vm_available_ops} from Ceausescu`) + logi(`+${game.vm_available_ops} from Ceausescu`) } // Check if in Tiananmen Square Track Award @@ -2308,53 +2308,53 @@ function do_sc(space) { else if (game.state === 'vm_tst_6_sc') { roll += get_tst_6_ops() roll += 2 - log('+2 from Tiananmen Square Track award') + logi('+2 TST award') } else { //let modifier = 0 let card_ops = get_card_ops(this_card()) roll += card_ops - log(`+${card_ops} from card ops`) + logi(`+${card_ops} ops`) } if (game.support_check_modifier > 0) { roll += game.support_check_modifier - log(`+${game.support_check_modifier} from event`) + logi(`+${game.support_check_modifier} event`) } // Events which modify SC rolls //Tear Gas if (game.active === COM && game.persistent_events.includes(30) && spaces[clicked_space].socio === 6) { roll ++ - log('+1 from C30') + logi('+1 C30') permanently_remove(30) game.persistent_events = game.persistent_events.filter(n => n !== 30) } //FRG Embassies if (game.active === DEM && spaces[clicked_space].region === 'Eastern Europe' && game.persistent_events.includes(74)) { roll++ - log('+1 from C74') + logi('+1 C74') } //GrenzTruppen if (game.active === DEM && spaces[clicked_space].country === 'East_Germany' && game.persistent_events.includes(59)) { roll-- - log('-1 from C59') + logi('-1 C59') } //Stand Fast if ((game.active === COM && game.stand_fast === DEM && check_dem_control(clicked_space)) || (game.active === DEM && game.stand_fast === COM && check_com_control(clicked_space))){ roll-- - log('-1 from C100') + logi('-1 C100') } //Elena if (game.active === DEM && game.persistent_events.includes(101) && spaces[clicked_space].country === 'Romania') { roll-- - log('-1 from C101') + logi('-1 C101') } //Austria Hungary Border Reopened if (game.active === DEM && game.persistent_events.includes(58) && game.austria_hungary_border_reopened_tracker) { roll++ - log(`+1 from C58`) + logi(`+1 C58`) } // Continue with logic - check for adjacency @@ -2364,11 +2364,11 @@ function do_sc(space) { const adj = count_adj(space) console.log('adj', adj) if (game.active === COM && game.persistent_events.includes(9) && spaces[clicked_space].country === 'East_Germany') { - log('No adjacency for Democrats due to C9') - log('C9 no longer in effect') + logi('No adjacency for Democrats due to C9') + logi('C9 no longer in effect') roll += adj.com_adj if (adj.com_adj > 0) { - log(`+${adj.com_adj} from adjacent control`) + logi(`+${adj.com_adj} adjacency`) } game.persistent_events = game.persistent_events.filter(n => n !== 9) @@ -2379,19 +2379,19 @@ function do_sc(space) { roll += adj.dem_adj roll -= adj.com_adj if (adj.dem_adj > 0) { - log(`+${adj.dem_adj} from adjacent control`) + logi(`+${adj.dem_adj} adjacency`) } if (adj.com_adj > 0) { - log(`-${adj.com_adj} from adjacent opponent control`) + logi(`-${adj.com_adj} opponenet adjacency`) } } else { roll += adj.com_adj roll -= adj.dem_adj if (adj.com_adj > 0) { - log(`+${adj.com_adj} from adjacent control`) + logi(`+${adj.com_adj} adjacency`) } if (adj.dem_adj > 0) { - log(`-${adj.dem_adj} from adjacent opponent control`) + logi(`-${adj.dem_adj} opponenet adjacency`) } } } @@ -2399,12 +2399,12 @@ function do_sc(space) { } // Support check calcs - log(`Total support check strength: ${roll}`) + log(`TOTAL: ${roll}`) const stability = spaces[find_space_index(space)].stability - log(`Stability is ${stability}. Defence is ${stability*2}`) + logi(`-${stability*2} (stability * 2)`) const change_infl = Math.max(0, roll - stability*2) if (change_infl > 0) { - log_msg_gap(`${change_infl} point swing`) + log_msg_gap(`CHANGE: ${change_infl} SP`) let clicked_space = find_space_index(space) if(game.active === DEM) { if (change_infl > game.comInfl[clicked_space]) { @@ -2432,7 +2432,7 @@ function do_sc(space) { check_control_change(clicked_space) } else { - log_msg_gap('No change in influence') + log_msg_gap('CHANGE: 0 SP') } if (game.active === COM && game.persistent_events.includes(39) && spaces[clicked_space].space_id === 66) { log_msg_gap('+1 VP from C39') @@ -2761,7 +2761,7 @@ function check_com_control(space_id) { function do_tst_attempt() { let roll = Math.floor(Math.random() * 6) + 1; - log(`Roll: D${roll}`); + log(`ROLL: D${roll}`); roll += game.available_ops log(`+${game.available_ops} from card ops`) @@ -2788,7 +2788,7 @@ function do_tst_attempt() { roll ++ log('+1 from C53') } - log(`Modified die roll: ${roll}`) + log(`TOTAL: ${roll}`) // TIANANMEN SQUARE ATTEMPT game.return = game.active @@ -4298,6 +4298,15 @@ function vm_return() { reset_austria_hungary_border_reopened() } + //Check if end event state is needed + if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { + game.state = 'vm_end_event' + } else { + vm_end_event() + } +} + +function vm_end_event() { //game.view_opp_hand = false console.log('in vm_return, game.return:', game.return, 'game.return_state:', game.return_state, 'game.vm_infl_to_do', game.vm_infl_to_do, 'game.vm_event_to_do', game.vm_event_to_do) /*if (!game.vm_infl_to_do && !game.vm_event_to_do) { @@ -5895,6 +5904,19 @@ function vm_kremlin_coup_elite() { /* ================== VM STATES ============================== */ +states.vm_end_event = { + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt () { + view.prompt = `${clean_name(cards[this_card()].name)}: done.` + gen_action('done') + }, + done(){ + vm_end_event() + } +} + states.vm_take_control = { get inactive() { return `resolve ${clean_name(cards[game.played_card].name)}.` @@ -6414,7 +6436,7 @@ states.vm_adamec = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) let worker_spaces = spaces.filter(space => space && space.country === 'Czechoslovakia' && space.socio === 4 && check_dem_control(space.space_id)).length if (worker_spaces > 0) { log(`-${worker_spaces} from Democrat controlled worker spaces`) @@ -6601,7 +6623,7 @@ states.vm_dash_for_the_west = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) let com_control = check_presence('East_Germany').com_spaces if (roll > com_control) { @@ -7366,7 +7388,7 @@ states.vm_malta_summit = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) if (game.stability > 0) { log(`+${game.stability} from USSR Stability Track`) log(`Modified roll: ${roll + game.stability}`) @@ -7412,11 +7434,11 @@ states.vm_modrow = { let roll = Math.floor(Math.random() * 6) + 1 let dem_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length if (roll > dem_spaces) { - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) log(`Success. More than the ${dem_spaces} Democratically controlled spaces`) vm_next() } else { - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) log(`Fail. More than ${dem_spaces} required`) permanently_remove(83) vm_return() @@ -7441,13 +7463,13 @@ states.vm_nepotism = { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 if (roll < 3) { - log(`Roll: D${roll} adds 4 SPs`) + log(`ROLL: D${roll} adds 4 SPs`) game.vm_available_ops = 4} else if (roll < 5 ) { - log(`Roll: D${roll} adds 3 SPs`) + log(`ROLL: D${roll} adds 3 SPs`) game.vm_available_ops = 3} else { - log(`Roll: D${roll} adds 1 SP`) + log(`ROLL: D${roll} adds 1 SP`) game.vm_available_ops = 1} //game.phase = 2 vm_next() @@ -7697,7 +7719,7 @@ states.vm_shock_therapy = { worker_farmer++ } } - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) log(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) log(`Modified roll: ${roll - worker_farmer}`) if ((roll - worker_farmer) > 2) { @@ -7924,7 +7946,7 @@ states.vm_the_wall_must_go = { } let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) if (game.active === DEM) { let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length if (controlled_spaces > 0) { @@ -8142,7 +8164,7 @@ states.vm_workers_revolt_finish = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`Roll: D${roll}`) + log(`ROLL: D${roll}`) let adj = count_adj(spaces[game.selected_space].name_unique) if (game.active === DEM) { log(`-${adj.com_adj} from opponent controlled spaces`) @@ -8439,7 +8461,7 @@ CODE[3] = [ // Walesa [ vm_prompt, 'any space(s) in Poland' ], [ vm_add_infl_free, 4 ], [ vm_valid_spaces_country_sc, 'Poland' ], - [ vm_prompt, 'Make Support Checks in Poland' ], + [ vm_prompt, 'make Support Checks in Poland' ], [ vm_support_check, 2 ], [ vm_permanently_remove ], [ vm_return ], -- cgit v1.2.3 From 6e7a3c69a79ecca8e45df60b59a22de504e1a2f5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 12 Oct 2024 14:21:30 +0100 Subject: Updates to events handling --- events.txt | 175 +++++++++--------- play.css | 2 +- play.js | 10 +- rules.js | 591 ++++++++++++++++++++++++++++++++++++------------------------- 4 files changed, 453 insertions(+), 325 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 7f83643..85b50bf 100644 --- a/events.txt +++ b/events.txt @@ -1,41 +1,41 @@ CARD 1 - Legacy of Martial Law* # Replace 1 Democratic SP with a Communist SP in Poland and make a Support Check using the Ops value of this card in Poland. +permanently_remove valid_spaces_country_opp 'Poland' prompt 'replace 1 Democratic SP in Poland with a Communist SP' legacy_of_martial_law valid_spaces_country_sc 'Poland' prompt 'make a Support Check in Poland' 1_support_check -permanently_remove 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' add_limited_infl 9 1 -permanently_remove CARD 3 - Walesa # Place a total of 4 SPs in any spaces(s) in Poland. The Democratic Player may then may Support Checks in Poland using the Ops value of this card. Requires Solidarity Legalized* to be played as event. +permanently_remove valid_spaces_country 'Poland' prompt 'any space(s) in Poland' add_infl_free 4 valid_spaces_country_sc 'Poland' prompt 'make Support Checks in Poland' support_check 2 -permanently_remove CARD 4 - Michnik # Place 3 Democratic SPs in the Polish Intellectuals space. +permanently_remove valid_spaces 26 prompt 'the Polish Intellectuals space' add_x_infl 3 -permanently_remove CARD 5 - General strike @@ -50,9 +50,9 @@ brought_in_for_questioning CARD 7 - State Run Media* # Remove four Democratic SPs, no more than 2 per space. +permanently_remove valid_spaces_opponent remove_limited_opp_infl 4 2 -permanently_remove CARD 8 - Prudence @@ -62,18 +62,20 @@ 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. -the_wall permanently_remove +the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. +permanently_remove if !game.the_tyrant_is_gone valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 +else +tyrant_block endif -permanently_remove CARD 11 - Dissident arrested @@ -85,16 +87,16 @@ remove_x_opp_infl 2 CARD 12 - Apparatchicks # Place 3 Communist SPs in any Bureaucratic space(s). +permanently_remove valid_spaces_socio 2 prompt ' to any Bureaucratic space(s)' add_infl_free 3 -permanently_remove 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. -stasi permanently_remove +stasi CARD 14 - Gorbachev Charms the West @@ -114,8 +116,8 @@ honecker CARD 16 - Nomenklatura* # Place 3 SPs in any Elite space(s), or remove all Democratic SPs from Elite spaces. -nomenklatura permanently_remove +nomenklatura CARD 17 - Roundtable talks @@ -125,18 +127,18 @@ roundtable_talks CARD 18 - Poszgay Defends the Revolution # Place Communist SPs in 4 spaces in Hungary not under Democratic control. +permanently_remove poszgay prompt 'to 4 spaces in Hungary not under Democratic control' add_limited_infl 4 1 -permanently_remove CARD 19 - Papal vist # Place 3 SPs in any Catholic Church space. +permanently_remove valid_spaces 20 35 38 prompt 'any Catholic Church space' add_x_infl 3 -permanently_remove CARD 20 - Deutsche Marks* @@ -162,6 +164,7 @@ 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 6 prompt 'the Lutheran Church' take_control_prep 1 @@ -170,13 +173,14 @@ st_nicholas_church CARD 25 - Perestroika # +1 Ops value for cards played by the Communist for the rest of turn. +permanently_remove 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. -helsinki_final_act permanently_remove +helsinki_final_act CARD 27 - Consumerism @@ -199,10 +203,10 @@ remove_limited_opp_infl 3 2 CARD 29 - Jan Palach Week* # Place 6 Democratic SPs in the Charles University space. +permanently_remove valid_spaces 30 prompt 'the Charles University space' add_x_infl 6 -permanently_remove CARD 30 - Tear Gas @@ -219,33 +223,33 @@ add_limited_infl 4 2 CARD 32 - Peasant Parties* # Place 4 Communist SPs in Farmer spaces, no more than 2 per space. +permanently_remove valid_spaces_socio 3 prompt 'Farmer spaces, no more than 2 per space' add_limited_infl 4 2 -permanently_remove CARD 33 - Sajudis* # +1 VP. Reduce USSR stability by 1. Place sufficient Democratic support in any Minorities space for control. Allows play of The Baltic Way. +permanently_remove sajudis_check prompt 'any Minorities space' take_control_prep 1 sajudis -permanently_remove CARD 34 - Fidesz* # Place 5 Democratic SPs in Hungary Student space. +permanently_remove valid_spaces 47 prompt 'the Hungary students space' add_x_infl 5 -permanently_remove CARD 35 - Heal our Bleeding Wounds* # If played in Early Year, -3 VPs. If played in Mid Year, -1 VP. If played in Late Year, +3 VPs. -heal_our_bleeding_wounds permanently_remove +heal_our_bleeding_wounds CARD 36 - Dash for the West* @@ -255,28 +259,28 @@ prompt 'Dash for the West: select any Democratic event with an asterix(*) from t dash_for_the_west - CARD 37 - Nagy Reburied* # Remove all Communist SPs from the Hungary Elite space. Then place 4 Communist SPs in Hungary, no more than 2 per space. +permanently_remove nagy_reburied prompt 'the Hungary Elite space' remove_all_infl 1 valid_spaces_country 'Hungary' prompt 'Hungary, no more than 2 per space' add_limited_infl 4 2 -permanently_remove CARD 38 - July Concept # Place 3 Communist SPs in Bulgaria +permanently_remove valid_spaces_country 'Bulgaria' prompt 'Bulgaria' add_infl_free 3 -permanently_remove CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. +permanently_remove valid_spaces 66 prompt 'Ruse' add_x_infl 4 @@ -285,17 +289,18 @@ eco_glasnost CARD 40 - Hungarian Democratic Forum # Place 3 Democratic SPs in Hungary and make one Support Check in Hungary. +permanently_remove valid_spaces_country 'Hungary' prompt 'Hungary' add_infl_free 3 valid_spaces_country_sc 'Hungary' prompt 'make a Support Check in Hungary' 1_support_check -permanently_remove CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. +permanently_remove if !game.the_tyrant_is_gone valid_spaces_country_opp 'Romania' prompt ' from Romania' @@ -305,8 +310,9 @@ prompt 'make a support check in Romania' 1_support_check prompt ' from Bucharesti' ceausescu +else +tyrant_block endif -permanently_remove CARD 42 - Power Struggle - East Germany @@ -321,6 +327,7 @@ power_struggle CARD 44 - Inflationary Currency # Target any Country where your opponent has Power. Place 2 SPs and make 1 Support Check in the Country using the Ops value of this card. Your opponent may cancel the Support Check by discarding a 3 Ops value card. +permanently_remove inflationary_currency valid_spaces_country_opp prompt ()=>` from ${country_name(game.vm_active_country)}` @@ -331,71 +338,70 @@ valid_spaces_country_sc prompt `make a Support Check in ${country_name(game.vm_active_country)}` 1_support_check endif -permanently_remove CARD 45 - Soviet Troop Withdrawals* # The Democratic Player may remove 5 Communist SPs from Eastern Europe, no more than 2 per space. +permanently_remove valid_spaces_region_opp 'Eastern Europe' prompt ' from Eastern Europe' remove_limited_opp_infl 5 2 -permanently_remove CARD 46 - Goodbye Lenin!* # The Communist Player must reveal all his events with title written in red. The Democrat may exchange this card for any of them with the event occurring immediately, or he may play this card for Operations. -goodbye_lenin permanently_remove +goodbye_lenin CARD 47 - Bulgarian Turks Expelled* # -2 VP. Remove any Democratic SPs in Razgrad. +permanently_remove bulgarian_turks_expelled prompt 'Razgrad' remove_all_infl 1 -permanently_remove 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. -we_are_the_people 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. -foreign_currency_debt_burden permanently_remove +foreign_currency_debt_burden CARD 50 - The Sinatra Doctrine* # +1 Ops value for cards played by the Democratic Player the rest of this turn. -the_sinatra_doctrine permanently_remove +the_sinatra_doctrine CARD 51 - 40th Anniversary Celebration* # Place 2 Communist SPs in Germany. If Communist is ahead add 4 SPs. Then subtract 1 VP. +permanently_remove 40th_anniversary_celebration valid_spaces_country 'East_Germany' prompt 'East Germany' add_infl_free 40th_anniversary_celebration_vp -permanently_remove CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. +permanently_remove normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 -permanently_remove CARD 53 - Li Peng* # +1 modifier to all Communist Tiananmen Square track attempts for the rest of the game -li_peng permanently_remove +li_peng CARD 54 - The Crowd Turns Against Ceausescu* @@ -410,17 +416,17 @@ power_struggle CARD 56 - Foreign Television # Remove 4 Communist SPs no more than 2 per space. +permanently_remove foreign_television remove_limited_opp_infl 4 2 -permanently_remove CARD 57 - Central Committee Reshuffle* # Place 3 Communist SPs in any Country where the Communist holds Power. +permanently_remove central_committee_reshuffle prompt `${country_name(game.vm_active_country)}` add_infl_free 3 -permanently_remove CARD 58 - Austria-Hungary Border Reopened* @@ -435,21 +441,21 @@ grenztruppen CARD 60 - Toxic Waste* # Add 3 Democratic SPs in any Worker space(s). +permanently_remove valid_spaces_socio 4 prompt 'any Worker space(s)' add_infl_free 3 -permanently_remove CARD 61 - The Monday Demonstrations* # Place sufficient SPs in the Lutheran Church Space and Leipzig for Democratic control. Then the Democratic Player may make FIVE support checks in Germany using the Ops value of this card. Requires play of St. Nicholas Church as an event. +permanently_remove the_monday_demonstrations prompt 'the Lutheran Church Space and Leipzig' take_control_prep 2 valid_spaces_country_sc 'East_Germany' prompt 'make 5 Support Checks in East Germany' support_check 5 -permanently_remove CARD 62 - Yakovlev Counsels Gorbachev* @@ -464,24 +470,24 @@ genscher CARD 64 - Legacy of 1968* # The Democratic Player may place 1 SP in all spaces in Czechoslovakia not controlled by the Communist Player +permanently_remove legacy_of_1968 prompt 'all spaces in Czechoslovakia not controlled by the Communist Player' add_limited_infl 11 1 -permanently_remove CARD 65 - Presidential Visit* # The Communist's hand size is reduced to 7 next turn. -presidential_visit permanently_remove +presidential_visit CARD 66 - New Forum # Place a Democratic SP in 3 spaces in Germany +permanently_remove valid_spaces_country 'East_Germany' prompt '3 spaces in East Germany' add_limited_infl 3 1 -permanently_remove CARD 67 - Reformer Rehabilitated* @@ -492,19 +498,19 @@ reformer_rehabilitated CARD 68 - Klaus and Komarek* # Remove 2 Communist SPs and add 2 Democratic SPs in Prague. +permanently_remove klaus_and_komarek prompt 'Prague' remove_x_opp_infl 2 valid_spaces 29 add_x_infl 2 -permanently_remove CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. +permanently_remove valid_spaces_country 'Romania' systematization -permanently_remove CARD 70 - Securitate* @@ -525,6 +531,7 @@ 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 50 56 prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 @@ -536,8 +543,6 @@ else prompt 'make 2 Support Checks in Romania' support_check 2 endif -permanently_remove - CARD 74 - FRG Embassies @@ -547,12 +552,13 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. -exit_visas permanently_remove +exit_visas CARD 76 - Warsaw Pact Summit # The Warsaw Pact holds a summit in Bucharest. The Communist player chooses who dominates the summit, the hardliners or the reformers. The Communist may either make 2 Support Checks with a +2 drm against Student and intellectual spaces, or place 4 SPs in spaces with no influence that are not controlled by the Democratic player. +permanently_remove warsaw_pact_summit if game.phase === 3 prompt ' spaces with no Democratic SPs' @@ -562,13 +568,12 @@ prompt 'Select a Student or Intellectual space' valid_spaces_country_socio_2 3, 4 support_check_modified 2 2 endif -permanently_remove CARD 77 - Samizdat # The Democratic Player can put a card in his hand aside for next turn and draw a replacement card from the deck. -samizdat permanently_remove +samizdat CARD 78 - Workers Revolt @@ -578,95 +583,99 @@ workers_revolt CARD 79 - The Third Way* # -2 VP. Place 3 Communist SPs in the German writers space. +permanently_remove the_third_way valid_spaces 4 prompt 'the East German Writers space' add_x_infl 3 -permanently_remove CARD 80 - Nepotism* # Roll a die. 1-2: Place 4 Communist SPs in Worker spaces in the Balkans. 3-4: add 3 SPs in Worker spaces in the Balkans. 5-6: add 1 SP to a Worker space in the Balkans. +permanently_remove nepotism valid_spaces_region_socio 'Balkans', 4 prompt 'Worker spaces in the Balkans' add_infl_free -permanently_remove CARD 81 - The Baltic Way* # +2 VP. Reduce USSR stability by 1. Place sufficient Democratic SPs in any Minorities space for control. .Requires play of Sajudis. Allows play of Breakaway Baltic Republics. +permanently_remove the_baltic_way prompt 'any Minorities space' take_control_prep 1 -permanently_remove CARD 82 - Spitzel* # Remove 2 Democratic SPs in Germany. +permanently_remove valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 -permanently_remove 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' add_limited_infl 4 2 -permanently_remove CARD 84 - Breakaway Baltic Republics* # +3 VPs. Reduce USSR stability by 2. Place sufficient Democratic SPs in any Minorities space for control. Cancels the effect of Gorbachev Charms the West for the rest of the game. Make 1 Support Check using the Ops value of this card. Requires play of The Baltic Way as an event. +permanently_remove breakaway_baltic_republics prompt 'any Minorities space' take_control_prep 1 valid_spaces_sc prompt 'select a space for the support check' 1_support_check -permanently_remove CARD 85 - Tank Column/Tank Man* # Advance 1 space on the Tiananmen Square track. -tank_column permanently_remove +tank_column CARD 86 - The Wall Must Go!* # Reduce USSR stability by 1. The Democratic Player attempts to tear down the Berlin Wall. Each player rolls a die and adds the number of spaces in Germany they control. Higher total wins. This is best 2 out of 3. If successful +3 VPs and the Communist must remove 3 SPs from Germany. +permanently_remove the_wall_must_go remove_infl 3 -permanently_remove CARD 87 - Kohl Proposes Reunification* # +2 VP. The Democratic Player may place SPs or make Support Checks using the Ops value of this card if The Wall Must Go! has been played as an event successfully. -kohl_proposes_reunification permanently_remove +kohl_proposes_reunification + CARD 88 - Adamec* # Roll a die. On a 4-6 add 4 Communist SPs in Czechoslovakia, no more than 2 per space. -1 drm for every Worker or Farmer space in Czechoslovakia that is controlled by the Democratic Player. +permanently_remove adamec valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_limited_infl 4 2 -permanently_remove + CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. -prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile.' -domino_theory +prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' permanently_remove +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 @@ -674,45 +683,44 @@ civic_forum valid_spaces_country_sc 'Czechoslovakia' prompt 'Select a space in Czechoslovakia' support_check 2 -permanently_remove CARD 91 - My First Banana* # Remove 2 Communist SPs and make two Support Checks in Germany using the Ops value of this card. +permanently_remove valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 valid_spaces_country_sc 'East_Germany' prompt 'select a space in East Germany' support_check 2 -permanently_remove CARD 92 - Betrayal # Choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs. +permanently_remove prompt 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' betrayal -permanently_remove CARD 93 - Shock Therapy* # Target country must be one where the Communist has been toppled from power. Successful 3-6. -1 for every Communist Worker or Farmer space. +2 VPs and place 3 SPs in the country +permanently_remove shock_therapy valid_spaces_country prompt ` ${country_name(game.vm_active_country)}` add_infl_free 3 -permanently_remove CARD 94 - Union of Democratic Forces* # Remove 4 Communist SPs from Bulgaria. Democratic Player may make Support Checks in Bulgaria using the Ops value of this card if the Bulgarian writers space is Democratically controlled. +permanently_remove valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_opp_infl 4 valid_spaces_country_sc 'Bulgaria' prompt 'Make 2 Support Checks in Bulgaria' support_check 2 -permanently_remove CARD 95 - Power Struggle - Romania @@ -722,16 +730,16 @@ power_struggle CARD 96 - The Chinese Solution* # Can only take place if the Communist has reached the Protesters Massacred space on the Tiananmen Square track. The Communist may choose 1 country where he retains Power and conduct 5 Support Checks with a +3 modifier, but suffers a penalty of +3 VPs. +permanently_remove the_chinese_solution valid_spaces_country_sc -prompt `Make 5 Support Checks in ${country_name(game.vm_active_country)}` +prompt `make 5 Support Checks in ${country_name(game.vm_active_country)}` support_check_modified 5 3 -permanently_remove CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu -if game.persistent_events['the_crowd_turns_against_ceausescu'] +if game.persistent_events.includes(54) valid_spaces 51 prompt 'the Romanian Elite Space' remove_x_opp_infl 4 @@ -744,35 +752,38 @@ endif CARD 98 - Politburo Intrigue* # Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card. +permanently_remove valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_limited_opp_infl 3 2 valid_spaces_country_sc 'Bulgaria' prompt 'make a support check in Bulgaria' 1_support_check -permanently_remove 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. -ligachev permanently_remove +ligachev CARD 100 - Stand Fast* # -1 to opponent Support Checks in spaces you control for the rest of this turn. -stand_fast 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 51 prompt 'the Romania Elite Space' add_x_infl 2 -endif elena +else +tyrant_block +endif CARD 102 - National Salvation Front* @@ -795,19 +806,21 @@ new_years_eve_party CARD 105 - Public Against Violence* # Place 2 Democratic SPs each in Kosice and Presov. Make one Support Check in Bratislava using the Ops value of this card. -valid_spaces 36 37 -prompt 'Kosice and Presov' +permanently_remove +valid_spaces 36 +prompt 'Kosice' add_x_infl 2 -valid_spaces 36 37 +valid_spaces 37 +prompt 'Presov' add_x_infl 2 public_against_violence prompt 'Make a Support Check in Bratislava' support_check_modified 1 2 -permanently_remove CARD 106 - Social Democratic Platform Adopted* # Play as an event in a Country where the Democrat has Power. Add 2 SPs and make 1 Support Check in the Country using the Ops value of this card. +permanently_remove social_democratic_platform_adopted valid_spaces_country prompt `${country_name(game.vm_active_country)}` @@ -815,36 +828,38 @@ add_infl_free 2 valid_spaces_country_sc prompt `make a Support Check in ${country_name(game.vm_active_country)}` 1_support_check -permanently_remove CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. +permanently_remove if !game.the_tyrant_is_gone massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' support_check_modified 2 2 +else +tyrant_block endif -permanently_remove CARD 108 - Army Backs Revolution* # Place in front of the Democratic Player. Cancels effects of Securitate* event. -army_backs_revolution permanently_remove +army_backs_revolution CARD 109 - Kremlin Coup* # Can only take place if Breakaway Baltic Republics has been played as an event. -3 VPs. In all countries where the Communist retains Power, place sufficient SPs in Elite space for Communist control, then make a support check against the bureaucratic space with a +1 modifier, even if there are no Democratic SPs in the space. -kremlin_coup permanently_remove +kremlin_coup CARD 110 - Malta Summit* # Roll a die. The summit is successful 4-6. If successful, +3VPs and remove 5 Communist SPs from elite space(s). The Democrat receives a modifier based on the USSR Stability Track: +1 if Sajudis +2 if The Baltic Way +3 if Breakaway Baltic Republics Not playable for the event after Kremlin Coup. +permanently_remove malta_summit prompt ' from Elite spaces' remove_opp_infl 5 -permanently_remove + diff --git a/play.css b/play.css index 8b3f266..0e7ef68 100644 --- a/play.css +++ b/play.css @@ -143,7 +143,7 @@ header.your_turn { background-color: orange; } display: none; } -#events_panel, #played_card_panel, #table_panel { +#events_panel, #played_card_panel, #table_panel, #samizdat_panel { min-width: 200px; width: auto; /*display: inline-block;*/ diff --git a/play.js b/play.js index be10507..f8d5cf5 100644 --- a/play.js +++ b/play.js @@ -405,8 +405,8 @@ function on_update() { ui.dem_hand_count.innerText = `${view.democrat_power_hand} Power cards` ui.com_hand_count.innerText = `${view.communist_power_hand} Power cards` } else{ - ui.dem_hand_count.innerText = `${view.democrat_hand} cards in hand` - ui.com_hand_count.innerText = `${view.communist_hand} cards in hand` + ui.dem_hand_count.innerText = `${view.democrat_hand} cards` + ui.com_hand_count.innerText = `${view.communist_hand} cards` } ui.deck_length.innerText = `${view.strategy_deck} cards` @@ -516,7 +516,8 @@ if (!view.is_pwr_struggle) { document.getElementById("opp_hand_panel").classList.add("hide") } } else { - if (view.show_opp_hand && view.opp_hand.length >0) { + console.log('power struggle, show opp hand', view.show_opp_hand, 'view opp hand', view.opp_hand ) + if (view.show_opp_hand && view.opp_hand && view.opp_hand.length > 0) { document.getElementById("opp_hand_panel").classList.remove("hide") for (let c of view.opp_hand) { let card = ui.power_cards[c] @@ -537,6 +538,7 @@ if (!view.is_pwr_struggle) { for (let c of view.power_hand) { let power_card = ui.power_cards[c] document.getElementById("power_hand").appendChild(power_card); + power_card.classList.remove('discard_card') if (view.valid_cards.includes(c)) { power_card.classList.add('selected'); } @@ -682,7 +684,7 @@ if (view.persistent_events.includes(97)) { action_button("concede", "Concede") action_button("struggle", "Begin power struggle") action_button("raise", "Raise the stakes") - action_button("draw", "Draw cards") + action_button("draw", "Draw") action_button("scoring", "Scoring") action_button("event", "Event") action_button("opp_event", "Resolve opponent event") diff --git a/rules.js b/rules.js index 8250dfc..617dcb6 100644 --- a/rules.js +++ b/rules.js @@ -107,8 +107,9 @@ function start_game() { //starting influence // Draw cards - /* const card_numbers = cards.filter(card => card !== null && card !== undefined).map(card => card.number); - console.log('card numbers: ', card_numbers) */ + + console.log('start game') + game.strategy_deck = draw_deck(cards) reset_power() @@ -225,7 +226,7 @@ exports.view = function(state, player) { } else if (player === COM) { view.hand = game.communist_hand - view.opp_hand = game.dem_pwr_hand.sort((a, b) => a - b) /*Does the Communist ever see Democrat hand? */ + view.opp_hand = game.dem_pwr_hand.sort((a, b) => a - b) view.power_hand = game.com_pwr_hand.sort((a, b) => a - b) } @@ -267,7 +268,7 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) +console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { //console.log('argument undefined') view.actions[action] = 1 @@ -316,6 +317,7 @@ exports.action = function (state, player, action, arg) { states.com_init = { inactive: 'place starting SPs', prompt() { + console.log('state:', game.state, 'game.valid_spaces', game.valid_spaces) if (game.available_ops == 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); @@ -362,6 +364,7 @@ states.com_init = { states.dem_init = { inactive: 'place starting SPs.', prompt() { + console.log('state:', game.state) if (game.available_ops == 0) { view.prompt = 'Place starting SPs: done.'; gen_action("done"); @@ -400,6 +403,7 @@ states.dem_init = { states.start_game = { inactive: 'start Turn 1.', prompt() { + console.log('state:', game.state) view.prompt = 'Start Turn 1.' gen_action('start') }, @@ -413,6 +417,7 @@ states.start_game = { states.choose_card = { inactive: 'choose a card.', prompt() { + console.log('state:', game.state) if ((game.active===DEM && game.democrat_hand.length === 0) || game.active === COM && game.communist_hand.length === 0) { view.prompt = 'No cards remaining: you must pass.' gen_action('pass') @@ -431,6 +436,7 @@ states.choose_card = { }, card(card) { push_undo() + //Check if player is at risk of losing game due to held scoring card if (!scoring_cards.includes(card)) { let scoring_cards_count = count_scoring_cards() @@ -480,16 +486,6 @@ states.play_card ={ return } - - //Check for Tiananmen Square Track awards special abilities - if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ - gen_action('tst_7') - } - - if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){ - gen_action('tst_8') - } - // Check for Reformer Rehabilitated //console.log('game.active', game.active, 'game.playable_cards[67].playable', game.playable_cards[67].playable) @@ -503,26 +499,32 @@ states.play_card ={ gen_action('event') } } + + //Check for events + console.log('event_is_playable(game.played_card)', event_is_playable(game.played_card)) + if (event_is_playable(game.played_card)) { + console.log('card is playable') + //Check for Tiananmen Square Track awards special abilities + console.log('game.tst_7', game.tst_7) + if ((game.active === DEM && cards[game.played_card].side === 'C' && game.dem_tst_position >= 7 && game.com_tst_position < 7 && !game.tst_7) || (game.active === COM && cards[game.played_card].side === 'D' && game.com_tst_position >= 7 && game.dem_tst_position < 7 && !game.tst_7)){ + gen_action('tst_7') + } - //Continue with normal logic - - //Check if it is a card with an event which is always playable - - if (cards[game.played_card].playable) { - get_events(game.played_card) - } - - // Resolve cards with variable events (not Reformer) + if ((game.active === DEM && cards[game.played_card].side !== 'C' && game.dem_tst_position >= 8 && game.com_tst_position < 8 && !game.tst_8) || (game.active === COM && cards[game.played_card].side !== 'D' && game.com_tst_position >= 8 && game.dem_tst_position < 8 && !game.tst_8)){ + gen_action('tst_8') + } - if (game.played_card !== 67 && game.playable_cards.includes(game.played_card)) { + //Continue with normal logic get_events(game.played_card) } gen_action('influence') - if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 && game.dem_tst_position <=8 || game.active === COM && game.com_tst_attempted_this_turn === 0 && game.com_tst_position <= 8) { - gen_action('tst') - } gen_action('support_check') + + if ((game.active === DEM && game.dem_tst_attempted_this_turn === 0 && game.dem_tst_position < 8 ) || (game.active === COM && game.com_tst_attempted_this_turn === 0 && game.com_tst_position < 8)) { + gen_action('tst') + } + }, event() { push_undo() @@ -610,7 +612,7 @@ states.play_card ={ }, tst_7() { /*Cancel opponent event */ push_undo() - log('Event cancelled using Tiananmen Square Track Award') + log(`Played C${game.played_card}. Event cancelled using TST Award`) game.tst_7 = true game.vm_infl_to_do = true game.state = 'resolve_opponent_event' @@ -685,7 +687,7 @@ states.resolve_opponent_event = { }, tst_7() { push_undo() - log('Event cancelled using Tiananmen Square Track Award') + log('Event cancelled using TST Award') game.tst_7 = true game.vm_event_to_do = false }, @@ -1230,6 +1232,7 @@ states.raise_stakes_1 = { game.raised_stakes_discard ++ if (game.raised_stakes_discard === 3) { game.raised_stakes++ + game.valid_cards = [] } @@ -1244,6 +1247,7 @@ states.raise_stakes_1 = { log_gap('Raised the stakes') game.raised_stakes_discard = 0 next_player() + game.valid_cards = [...all_power_cards] game.state = 'raise_stakes_2' } } @@ -1278,6 +1282,7 @@ states.raise_stakes_2 = { game.raised_stakes_discard ++ if (game.raised_stakes_discard === 3) { game.raised_stakes++ + game.valid_cards = [] } }, @@ -1406,7 +1411,7 @@ states.power_struggle = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) if (roll >= power_cards[game.played_power_card].value) { log('Initiative roll successful') game.phase = 0 @@ -1516,7 +1521,7 @@ states.support_loss ={ let roll = Math.floor(Math.random() * 6) + 1 let rally_win = 0 let petition_win = 0 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) { rally_win = 2} if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win @@ -1585,7 +1590,7 @@ states.vp_roll = { }, roll () { let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) let rally_win = 0 let petition_win = 0 if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {rally_win = 2} @@ -1785,11 +1790,22 @@ states.end_turn_4_5_4 = { } else { game.return_state = '' - new_turn() + game.state = 'end_turn' } } } +states.end_turn = { + inactive: 'end the turn.', + prompt() { + view.prompt = 'End Turn: done.' + gen_action('done') + }, + done() { + new_turn() + } +} + states.final_scoring_held = { inactive: 'resolve final scoring.', prompt() { @@ -1883,7 +1899,7 @@ states.general_strike = { view.prompt = 'General Strike: done.' gen_action('done') } else if (game.played_card > 0 ) { - view.prompt = 'Roll a die.' + view.prompt = 'General Strike: roll a die.' gen_action('roll') } }, @@ -1906,12 +1922,12 @@ states.general_strike = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) - log(`+${game.available_ops} ops`) + logi(`+${game.available_ops} ops`) let total = roll + game.available_ops - log(`TOTAL: ${total}`) + log(`Total: ${total}`) if (total > 5) { log('The strike is over.') @@ -2110,7 +2126,7 @@ states.stasi_play_card = { game.available_ops = get_card_ops(card) game.stasi_card = 0 - if (game.democrat_hand.includes(21)) { + if (game.democrat_hand.includes(21) && cards[card].side === "C") { game.state = 'stasi_resolve_common_european_home' } else { game.state = 'play_card' @@ -2139,7 +2155,7 @@ states.stasi_resolve_common_european_home = { gen_action('no') }, yes() { - log(`${clean_name(cards[game.played_card].name)}} played with Common European Home`) + log(`Played with Common European Home`) silent_discard(21) game.vm_infl_to_do = true game.vm_event_to_do = false @@ -2285,7 +2301,7 @@ function do_sc(space) { // Continue with Support Check Logic let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) console.log('game.vm_event', game.vm_event) console.log('game.is_pwr_struggle', game.is_pwr_struggle) /* @@ -2382,7 +2398,7 @@ function do_sc(space) { logi(`+${adj.dem_adj} adjacency`) } if (adj.com_adj > 0) { - logi(`-${adj.com_adj} opponenet adjacency`) + logi(`-${adj.com_adj} opponent adjacency`) } } else { roll += adj.com_adj @@ -2391,7 +2407,7 @@ function do_sc(space) { logi(`+${adj.com_adj} adjacency`) } if (adj.dem_adj > 0) { - logi(`-${adj.dem_adj} opponenet adjacency`) + logi(`-${adj.dem_adj} opponent adjacency`) } } } @@ -2399,12 +2415,12 @@ function do_sc(space) { } // Support check calcs - log(`TOTAL: ${roll}`) + log(`Total: ${roll}`) const stability = spaces[find_space_index(space)].stability logi(`-${stability*2} (stability * 2)`) const change_infl = Math.max(0, roll - stability*2) if (change_infl > 0) { - log_msg_gap(`CHANGE: ${change_infl} SP`) + log_msg_gap(`Change: ${change_infl} SP`) let clicked_space = find_space_index(space) if(game.active === DEM) { if (change_infl > game.comInfl[clicked_space]) { @@ -2432,7 +2448,7 @@ function do_sc(space) { check_control_change(clicked_space) } else { - log_msg_gap('CHANGE: 0 SP') + log_msg_gap('Change: 0 SP') } if (game.active === COM && game.persistent_events.includes(39) && spaces[clicked_space].space_id === 66) { log_msg_gap('+1 VP from C39') @@ -2456,8 +2472,8 @@ function do_sc(space) { function valid_spaces_setup() { game.valid_spaces = [] let valid_spaces_set = new Set(); - console.log('in vs setup, state', game.state) - for (let i =1 ; i < 75 ; i++) { + //console.log('in vs setup, state', game.state) + for (let i =1 ; i <= 75 ; i++) { space = spaces[i] if (game.state === 'com_init') { @@ -2482,7 +2498,7 @@ function valid_spaces_sc() { let valid_spaces_set = new Set(); console.log('valid spaces sc, persistent events', game.persistent_events) - for (let i = 1 ; i < 75; i++) { + for (let i = 1 ; i <= 75; i++) { space = spaces[i] if (game.active === DEM) { @@ -2761,34 +2777,34 @@ function check_com_control(space_id) { function do_tst_attempt() { let roll = Math.floor(Math.random() * 6) + 1; - log(`ROLL: D${roll}`); + log(`Roll: D${roll}`); roll += game.available_ops - log(`+${game.available_ops} from card ops`) + logi(`+${game.available_ops} from card ops`) // TIANANMEN SQUARE MODIFIERS if (game.active === DEM && game.dem_tst_attempted === 1 || game.active === COM && game.com_tst_attempted === 1) { roll ++; - log('+1 modifier from previous Tiananmen Square Track attempts') + logi('+1 from previous TST attempts') } if (game.active === DEM && game.dem_tst_position >= 1 && game.com_tst_position === 0) { roll ++ - log('+1 from TST award') + logi('+1 from TST award') } if (game.active === COM && game.com_tst_position >= 1 && game.dem_tst_position === 0) { roll ++ - log('+1 from TST award') + logi('+1 from TST award') } if ((game.active === DEM && cards[game.played_card].side === 'D') || (game.active === COM && cards[game.played_card].side === 'C')) { roll ++; - log('+1 for playing own card'); + logi('+1 for playing own card'); } if (game.active === COM && game.persistent_events.includes(53)) { roll ++ - log('+1 from C53') + logi('+1 from C53') } - log(`TOTAL: ${roll}`) + log(`Total: ${roll}`) // TIANANMEN SQUARE ATTEMPT game.return = game.active @@ -2830,21 +2846,27 @@ function do_tst_attempt() { if (roll >= com_tst_req[game.com_tst_position]) { log(`${com_tst_req[game.com_tst_position]} required: success`) game.com_tst_position++ + + //Check if they have reached the final box - Chinese Solution playable + if (game.com_tst_position === 8) { + game.playable_cards.push(96) + } + game.com_tst_attempted = 0 //Check if they have reached box 7 or 8 first - if (game.dem_tst_position === 7 && game.com_tst_position < 7) { + if (game.com_tst_position === 7 && game.dem_tst_position < 7) { game.tst_7 = false } - if (game.dem_tst_position === 8 && game.com_tst_position < 8) { + if (game.com_tst_position === 8 && game.dem_tst_position < 8) { game.tst_8 = false } //Check if they have caught up to box 7 or 8 - if (game.dem_tst_position >= 7 && game.com_tst_position >= 7) { + if (game.com_tst_position >= 7 && game.dem_tst_position >= 7) { delete game.tst_7 } - if (game.dem_tst_position >= 8 && game.com_tst_position >= 8) { + if (game.com_tst_position >= 8 && game.dem_tst_position >= 8) { delete game.tst_8 } @@ -3092,17 +3114,18 @@ function get_value(country) { } function permanently_remove(card) { - console.log('card:', card) + console.log('permanently removing card:', card) + if (game.strategy_removed.includes(card)) {return} log_msg_gap(`C${cards[card].number} permanently removed`) remove_from_discard(card) card_index = game.table_cards.indexOf(card) if (card_index !== -1) { - console.log('sub 2 called') + //console.log('sub 2 called') game.table_cards.splice(card_index, 1) } game.strategy_removed.push(card) - console.log('game.strategy_removed', game.strategy_removed) + //console.log('game.strategy_removed', game.strategy_removed) } function check_vp() { @@ -3206,15 +3229,37 @@ function find_event(card) { } function get_events(card){ - if (cards[card].side === 'D') { - if (game.active === DEM) {gen_action('event')} - if (game.active === COM) {gen_action('opp_event')} - } - else if (cards[card].side === 'C') { - if (game.active === COM) {gen_action('event')} - if (game.active === DEM) {gen_action('opp_event')} + if (event_is_playable(card)) { + if (cards[card].side === 'D') { + if (game.active === DEM) {gen_action('event')} + if (game.active === COM) {gen_action('opp_event')} + } + else if (cards[card].side === 'C') { + if (game.active === COM) {gen_action('event')} + if (game.active === DEM) {gen_action('opp_event')} + } + else { + gen_action('event') + } + } +} + +function event_is_playable(card) { + //Reformer never playable here + if (card === 67) { + return false + } + //Check for Common European Hmme under Stasi + else if (game.persistent_events.includes(13) && card === 21 && game.active === DEM) { + return false + } + //Then check normally + else if (cards[card].playable) { + return true + } else if (game.playable_cards.includes(card)) { + return true } else { - gen_action('event') + return false } } @@ -3616,11 +3661,11 @@ function new_turn() { //permanently_remove(65) game.persistent_events = game.persistent_events.filter(n => n !== 65) } - console.log('deck', game.strategy_deck) - console.log('game.com_hand_limit', game.com_hand_limit, 'communist hand before draw', game.communist_hand) + //console.log('deck', game.strategy_deck) + //console.log('game.com_hand_limit', game.com_hand_limit, 'communist hand before draw', game.communist_hand) draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) game.com_hand_limit = 8 - console.log('communist hand after draw', game.communist_hand) + //console.log('communist hand after draw', game.communist_hand) } @@ -3693,7 +3738,7 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han //console.log('game.valid_cards at start of draw cards: ', game.valid_cards) let turn = 'communist'; // Start with the communist player //console.log('game.strategy_deck', game.strategy_deck) - console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit) + //console.log('deck', deck, 'democrat_hand', democrat_hand, 'communist_hand', communist_hand, 'dem_hand_limit', dem_hand_limit, 'com_hand_limit', com_hand_limit) while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { //console.log('deck.length: ', deck.length) //console.log('discard.length', game.strategy_discard ) @@ -3871,19 +3916,9 @@ function reset_power() { } function check_control_change(space_id) { - /*game.pieces[space_id].demCtrl = 0 - game.pieces[space_id].comCtrl = 0 - - if ((game.demInfl[space_id] - game.comInfl[space_id]) >= game.pieces[space_id].stability) { - game.pieces[space_id].demCtrl = 1 - } - if ((game.comInfl[space_id] - game.demInfl[space_id]) >= game.pieces[space_id].stability) { - game.pieces[space_id].comCtrl = 1 - }*/ // Check if the Tyrant is Gone has been fulfilled - console.log('check control change_player, game.the_tyrant_is_gone', game.the_tyrant_is_gone) - //console.log('dem control', check_dem_control(game.the_tyrant_is_gone)) + if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { console.log('in tyrant') log('+2 VP from C97') @@ -4287,6 +4322,8 @@ function pop_vm_prompt() { function vm_return() { + console.log('in vm_return') + //Remove temporary vm variables delete game.support_check_modifier delete game.vm_max_infl @@ -4299,10 +4336,14 @@ function vm_return() { } //Check if end event state is needed - if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { - game.state = 'vm_end_event' - } else { + if (game.is_pwr_struggle || game.state === 'vm_tst_6') { vm_end_event() + } else { + if ((game.active === DEM && game.round_player !==DEM) || (game.active === COM && game.round_player !== COM)) { + game.state = 'vm_end_event' + } else { + vm_end_event() + } } } @@ -5155,15 +5196,11 @@ function vm_domino_theory() { function vm_eco_glasnost() { game.persistent_events.push(39) - permanently_remove(39) vm_next() } function vm_elena(){ game.persistent_events.push(101) - permanently_remove(101) - //game.table_cards.push(101) - //remove_from_discard(101) vm_next() } @@ -5377,7 +5414,7 @@ function vm_inflationary_currency_discard() { } } else { for (let card of game.democrat_hand){ - if (get_cards_ops(card) >= 3) { + if (get_card_ops(card) >= 3) { game.valid_cards.push(card) } } @@ -5520,7 +5557,6 @@ function vm_peasant_parties_revolt() { function vm_perestroika() { game.persistent_events.push(25) log_msg_gap('C25 in effect') - permanently_remove(25) vm_next() } @@ -5667,7 +5703,6 @@ function vm_solidarity_legalised() { function vm_st_nicholas_church () { game.persistent_events.push(24) game.playable_cards.push(61) - permanently_remove(24) vm_next() } @@ -5760,10 +5795,7 @@ function vm_the_tyrant_is_gone() { game.valid_spaces.push(space.space_id) } } - /*game.playable_cards[10].playable = 0 - game.playable_cards[41].playable = 0 - game.playable_cards[101].playable = 0 - game.playable_cards[107].playable = 0*/ + console.log('game.vm_event', game.vm_event, 'game.played_card', game.played_card) game.state = 'vm_the_tyrant_is_gone' } @@ -5775,6 +5807,10 @@ function vm_the_tyrant_is_gone_prep() { vm_next() } +function vm_tyrant_block() { + game.state = 'vm_tyrant_block' +} + function vm_the_wall () { game.persistent_events.push(9) //game.strategy_removed.push(9) @@ -5883,7 +5919,7 @@ function vm_scare_tactics() { vm_next() } function vm_support_surges() { - game.state = 'vm_support_surges' + game.state = 'vm_support_surges_1' } function vm_support_falters() { @@ -5940,9 +5976,6 @@ states.vm_take_control = { push_undo() vm_take_control(space) game.vm_available_ops-- - if (game.vm_available_ops === 0) { - vm_next() - } }, done() { vm_next() @@ -5954,7 +5987,7 @@ states.vm_add_infl = { prompt () { console.log('in vm add infl') if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { - view.prompt = 'No available spaces remaining. Add SPs: done.' + view.prompt = `${clean_name(cards[this_card()].name)}. No available spaces remaining. Add SPs: done.` gen_action('done') } else if (game.vm_available_ops > 0 ) { @@ -5964,12 +5997,15 @@ states.vm_add_infl = { gen_action_infl(spaces[space_id].name_unique) } } else { - view.prompt = 'Add SP: done.' + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') } }, infl(space) { vm_do_add_infl(space) + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + } }, done () { if (game.summary.length > 0) { @@ -5988,7 +6024,7 @@ states.vm_add_infl_free = { }, prompt () { if (game.vm_available_ops > 0 && game.valid_spaces.length === 0 ) { - view.prompt = 'No available spaces remaining. Add SPs: done.' + view.prompt = `${clean_name(cards[this_card()].name)}. No available spaces remaining. Add SPs: done.` gen_action('done') } else if (game.vm_available_ops > 0 ) { @@ -5998,15 +6034,15 @@ states.vm_add_infl_free = { gen_action_infl(spaces[space_id].name_unique); } } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.` + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') } }, infl(space) { vm_do_add_infl_free(space) - /*if (game.vm_available_ops === 0 ) { - - }*/ + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + } }, done () { game.valid_spaces = [] @@ -6032,7 +6068,7 @@ states.vm_add_x_infl = { gen_action_infl(spaces[space_id].name_unique) } } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Add influence: done.` + view.prompt = `${clean_name(cards[this_card()].name)}. Add SPs: done.` gen_action('done') } }, @@ -6070,22 +6106,9 @@ states.vm_add_limited_infl = { }, infl(space) { vm_do_add_limited_infl(space, game.vm_max_infl) - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { - game.vm_event_done = true - if (game.summary.length > 0) { - pop_summary() - log_br() - } - vm_next() - }*/ - /*if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - if (game.summary.length > 0) { - pop_summary() - log_br() - } - game.vm_event_done = true - vm_next() - }*/ + if (game.vm_available_ops === 0) { + game.valid_spaces = [] + } }, done () { if (game.summary.length > 0) { @@ -6156,7 +6179,7 @@ states.vm_remove_x_infl = { gen_action_infl(spaces[space_id].name_unique); } } else { - view.prompt = `${clean_name(cards[this_card()].name)}. Remove influence: done.` + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` gen_action('done') } }, @@ -6175,14 +6198,17 @@ states.vm_remove_limited_infl = { inactive: 'remove SP.', prompt () { if (game.vm_available_ops > 0 && game.valid_spaces.length > 0) { - view.prompt = `${clean_name(cards[this_card()].name)}: remove ${game.vm_available_ops} SP${event_prompt()}, no more than ${game.vm_max_infl} per space.` + view.prompt = `${clean_name(cards[this_card()].name)}: remove ${pluralize(game.vm_available_ops,'SP')}${event_prompt()}, no more than ${game.vm_max_infl} per space.` for (let space_id of game.valid_spaces) { gen_action_infl(spaces[space_id].name_unique); } - } else if (game.valid_spaces.length === 0) { + } else if (game.valid_spaces.length === 0 && game.vm_available_ops > 0) { view.prompt = `${clean_name(cards[this_card()].name)}: no further SP to remove.` gen_action('done') + } else { + view.prompt = `${clean_name(cards[this_card()].name)}. Remove SPs: done.` + gen_action('done') } }, infl(space) { @@ -6436,7 +6462,7 @@ states.vm_adamec = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) let worker_spaces = spaces.filter(space => space && space.country === 'Czechoslovakia' && space.socio === 4 && check_dem_control(space.space_id)).length if (worker_spaces > 0) { log(`-${worker_spaces} from Democrat controlled worker spaces`) @@ -6503,7 +6529,7 @@ states.vm_central_committee_reshuffle = { return `resolve ${clean_name(cards[57].name)}.` }, prompt() { - view.prompt = 'Choose a country to add SP.' + view.prompt = 'Central Committee Reshuffle: choose a country to add SPs.' if (!game.revolutions[0]) {gen_action('poland')} if (!game.revolutions[1]) {gen_action('hungary')} if (!game.revolutions[2]) {gen_action('east_germany')} @@ -6623,7 +6649,7 @@ states.vm_dash_for_the_west = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) let com_control = check_presence('East_Germany').com_spaces if (roll > com_control) { @@ -6819,10 +6845,10 @@ states.vm_exit_visas_finish = { }, prompt() { if (game.temp > 0 ) { - view.prompt = 'Draw replacement cards.' + view.prompt = 'Exit Visas: draw replacement cards.' gen_action('draw') } else { - view.prompt = 'Exit Visas: done.' + view.prompt = 'Exit Visas. Draw cards: done.' gen_action('done') } }, @@ -6907,6 +6933,9 @@ states.vm_goodbye_lenin = { goto_vm(card) }, ops() { + if (game.valid_cards.length === 0) { + logi('No red events') + } log('C46 played for operations') game.view_opp_hand = false game.state = 'vm_goodbye_lenin_ops' @@ -7270,7 +7299,7 @@ states.vm_kremlin_coup_sc_prep = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - view.prompt = `Kremlin Coup! Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.` + view.prompt = `Kremlin Coup! Conduct a support check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` gen_action_sc(spaces[game.selected_space].name_unique); }, sc(space) { @@ -7301,7 +7330,7 @@ states.vm_kremlin_coup_end = { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt() { - view.prompt = `${clean_name(cards[this_card()].name)}: done.` + view.prompt = `${clean_name(cards[this_card()].name)} Support checks: done.` gen_action('done') }, done() { @@ -7388,7 +7417,7 @@ states.vm_malta_summit = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) if (game.stability > 0) { log(`+${game.stability} from USSR Stability Track`) log(`Modified roll: ${roll + game.stability}`) @@ -7434,11 +7463,11 @@ states.vm_modrow = { let roll = Math.floor(Math.random() * 6) + 1 let dem_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length if (roll > dem_spaces) { - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) log(`Success. More than the ${dem_spaces} Democratically controlled spaces`) vm_next() } else { - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) log(`Fail. More than ${dem_spaces} required`) permanently_remove(83) vm_return() @@ -7463,13 +7492,13 @@ states.vm_nepotism = { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 if (roll < 3) { - log(`ROLL: D${roll} adds 4 SPs`) + log(`Roll: D${roll} adds 4 SPs`) game.vm_available_ops = 4} else if (roll < 5 ) { - log(`ROLL: D${roll} adds 3 SPs`) + log(`Roll: D${roll} adds 3 SPs`) game.vm_available_ops = 3} else { - log(`ROLL: D${roll} adds 1 SP`) + log(`Roll: D${roll} adds 1 SP`) game.vm_available_ops = 1} //game.phase = 2 vm_next() @@ -7557,7 +7586,7 @@ states.vm_nomenklatura_remove = { }, prompt() { if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - view.prompt = 'Remove SPs: done.' + view.prompt = 'Nomenklatura. Remove SPs: done.' gen_action('done') } else { view.prompt = 'Nomenklatura: remove all Democratic SPs from Elite spaces.' @@ -7570,9 +7599,9 @@ states.vm_nomenklatura_remove = { infl(space) { push_undo() vm_do_remove_all_infl(space) - if (game.vm_available_ops === 0) { + /*if (game.vm_available_ops === 0) { vm_next() - } + }*/ }, done() { vm_next() @@ -7585,7 +7614,7 @@ states.vm_nomenklatura_add = { }, prompt() { if (game.vm_available_ops === 0 || game.valid_spaces.length === 0 ) { - view.prompt = 'Add SPs: done.' + view.prompt = 'Nomenklatura. Add SPs: done.' gen_action('done') } else { view.prompt = `Nomenklatura: add 3 SPs to any Elite space(s). ${pluralize(game.vm_available_ops, 'SP')} remaining.` @@ -7719,7 +7748,7 @@ states.vm_shock_therapy = { worker_farmer++ } } - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) log(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) log(`Modified roll: ${roll - worker_farmer}`) if ((roll - worker_farmer) > 2) { @@ -7817,7 +7846,7 @@ states.vm_the_chinese_solution = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - view.prompt = 'You may give up 3 VP to conduct support checks in a country where you hold power.' + view.prompt = 'The Chinese Solution: you may give up 3 VP to conduct support checks in a country where you hold power.' if (!game.revolutions[0]) {gen_action('poland')} if (!game.revolutions[1]) {gen_action('hungary')} if (!game.revolutions[2]) {gen_action('east_germany')} @@ -7925,13 +7954,28 @@ states.vm_the_tyrant_is_gone = { } } +states.vm_tyrant_block ={ + get inactive() { + return `resolve ${clean_name(cards[this_card()].name)}.` + }, + prompt() { + view.prompt = `${clean_name(cards[this_card()].name)} has no effect after The Tyrant Has Gone.` + gen_action('done') + }, + done() { + push_undo() + vm_next() + } +} + + states.vm_the_wall_must_go = { get inactive() { return `resolve ${clean_name(cards[this_card()].name)}.` }, prompt() { if (game.the_wall_must_go['dem_wins'] === 2 || game.the_wall_must_go['com_wins'] === 2) { - view.prompt = 'The Wall Must Go! Done.' + view.prompt = '"The Wall Must Go!" Rolls: done.' gen_action('done') } else { view.prompt = ('The Wall Must Go! Roll a die.') @@ -7946,7 +7990,7 @@ states.vm_the_wall_must_go = { } let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) if (game.active === DEM) { let controlled_spaces = spaces.filter(space => space && space.country === 'East_Germany' && check_dem_control(space.space_id)).length if (controlled_spaces > 0) { @@ -8066,7 +8110,7 @@ states.vm_we_are_the_people_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.demInfl[6] === 0) { + if (game.demInfl[6] === 0 && game.vm_available_ops > 0) { view.prompt = '"We are the People!": no SPs to remove.' gen_action('done') } else if (game.vm_available_ops > 0 ) { @@ -8076,7 +8120,7 @@ states.vm_we_are_the_people_remove = { gen_action_infl(spaces[space_id].name_unique); } } else { - view.prompt = 'Remove SPs: done.' + view.prompt = '"We are the People!" Remove SPs: done.' gen_action('done') } }, @@ -8103,7 +8147,7 @@ states.vm_we_are_the_people_add = { }, prompt() { if (!game.vm_influence_added[6]) { - view.prompt = '"We are the People!": done.' + view.prompt = '"We are the People!" Add SPs: done.' gen_action('done') return } @@ -8115,7 +8159,6 @@ states.vm_we_are_the_people_add = { } }, infl(space) { - push_undo() vm_do_add_infl_free(space) game.vm_influence_added[6]-- if (game.vm_influence_added[6] === 0 ) {game.valid_spaces = []} @@ -8164,7 +8207,7 @@ states.vm_workers_revolt_finish = { roll() { clear_undo() let roll = Math.floor(Math.random() * 6) + 1 - log(`ROLL: D${roll}`) + log(`Roll: D${roll}`) let adj = count_adj(spaces[game.selected_space].name_unique) if (game.active === DEM) { log(`-${adj.com_adj} from opponent controlled spaces`) @@ -8238,7 +8281,7 @@ states.vm_tst_4 = { inactive: 'remove SPs', prompt () { if (game.vm_available_ops === 0 || game.valid_spaces.length === 0) { - view.prompt = 'Remove SPs: done.' + view.prompt = 'Tiananmen Square Track award. Remove SPs: done.' gen_action('done') return } @@ -8380,19 +8423,72 @@ states.vm_tst_8_ops = { // ========================= POWER STRUGGLE STATES ======================== -states.vm_support_surges = { +states.vm_support_surges_1 = { inactive: 'draw cards.', prompt() { - view.prompt = 'Support Surges: draw 2 cards.' + view.prompt = 'Support Surges: draw a card.' gen_action('draw') }, draw() { if (game.active === DEM) { - draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+2, game.com_pwr_hand.length) + console.log('hand before', game.dem_pwr_hand) + draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+1, game.com_pwr_hand.length) + game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length-1] + console.log('hand before', game.dem_pwr_hand, 'game.temp', game.temp) } else { - draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+2) + draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+1) + game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length-1] } + game.state = 'vm_support_surges_2' + + //game.phase = 0 + //log('Drew 2 cards') + //log('Surrenders initiative') + //vm_next() + } +} + +states.vm_support_surges_2 = { + inactive: 'draw cards.', + prompt() { + if (numberless_cards.includes(game.temp)) { + view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name}. Draw a second card.` + } else { + view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name} ${power_cards[game.temp].value}. Draw a second card.` + } + gen_action('draw') + }, + draw() { + if (game.active === DEM) { + console.log('hand before', game.dem_pwr_hand) + draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length+1, game.com_pwr_hand.length) + game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length - 1] + console.log('hand before', game.dem_pwr_hand, 'game.temp', game.temp) + } else { + draw_cards(game.power_struggle_deck, game.dem_pwr_hand, game.com_pwr_hand, game.dem_pwr_hand.length, game.com_pwr_hand.length+1) + game.temp = game.dem_pwr_hand[game.dem_pwr_hand.length - 1] + } + game.state = 'vm_support_surges_3' + /*game.phase = 0 + log('Drew 2 cards') + log('Surrenders initiative') + vm_next()*/ + } +} + +states.vm_support_surges_3 = { + inactive: 'draw cards.', + prompt() { + if (numberless_cards.includes(game.temp)) { + view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name}. Done.` + } else { + view.prompt = `Support Surges: you drew a ${power_cards[game.temp].name} ${power_cards[game.temp].value}. Done.` + } + gen_action('done') + }, + done() { game.phase = 0 + delete game.temp log('Drew 2 cards') log('Surrenders initiative') vm_next() @@ -8437,41 +8533,41 @@ states.vm_support_falters = { const CODE = [] CODE[1] = [ // Legacy of Martial Law* + [ vm_permanently_remove ], [ vm_valid_spaces_country_opp, 'Poland' ], [ vm_prompt, 'replace 1 Democratic SP in Poland with a Communist SP' ], [ vm_legacy_of_martial_law ], [ vm_valid_spaces_country_sc, 'Poland' ], [ vm_prompt, 'make a Support Check in Poland' ], [ vm_1_support_check ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[2] = [ // Solidarity Legalised* + [ vm_permanently_remove ], [ vm_solidarity_legalised ], [ vm_valid_spaces_solidarity_legalised ], [ vm_prompt, 'to every uncontrolled Worker and Farmer space in Poland' ], [ vm_add_limited_infl, 9, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[3] = [ // Walesa + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Poland' ], [ vm_prompt, 'any space(s) in Poland' ], [ vm_add_infl_free, 4 ], [ vm_valid_spaces_country_sc, 'Poland' ], [ vm_prompt, 'make Support Checks in Poland' ], [ vm_support_check, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[4] = [ // Michnik + [ vm_permanently_remove ], [ vm_valid_spaces, 26 ], [ vm_prompt, 'the Polish Intellectuals space' ], [ vm_add_x_infl, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8486,9 +8582,9 @@ CODE[6] = [ // Brought in for Questioning ] CODE[7] = [ // State Run Media* + [ vm_permanently_remove ], [ vm_valid_spaces_opponent ], [ vm_remove_limited_opp_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8498,18 +8594,20 @@ CODE[8] = [ // Prudence ] CODE[9] = [ // The Wall* - [ vm_the_wall ], [ vm_permanently_remove ], + [ vm_the_wall ], [ vm_return ], ] CODE[10] = [ // Cult of Personality + [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], [ vm_valid_spaces_country_socio_2, 'Romania', 3, 4 ], [ vm_prompt, 'Worker or Farmer spaces in Romania, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], + [ vm_else ], + [ vm_tyrant_block ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8521,16 +8619,16 @@ CODE[11] = [ // Dissident arrested ] CODE[12] = [ // Apparatchicks + [ vm_permanently_remove ], [ vm_valid_spaces_socio, 2 ], [ vm_prompt, ' to any Bureaucratic space(s)' ], [ vm_add_infl_free, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[13] = [ // Stasi - [ vm_stasi ], [ vm_permanently_remove ], + [ vm_stasi ], [ vm_return ], ] @@ -8550,8 +8648,8 @@ CODE[15] = [ // Honecker ] CODE[16] = [ // Nomenklatura* - [ vm_nomenklatura ], [ vm_permanently_remove ], + [ vm_nomenklatura ], [ vm_return ], ] @@ -8561,18 +8659,18 @@ CODE[17] = [ // Roundtable talks ] CODE[18] = [ // Poszgay Defends the Revolution + [ vm_permanently_remove ], [ vm_poszgay ], [ vm_prompt, 'to 4 spaces in Hungary not under Democratic control' ], [ vm_add_limited_infl, 4, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[19] = [ // Papal vist + [ vm_permanently_remove ], [ vm_valid_spaces, 20, 35, 38 ], [ vm_prompt, 'any Catholic Church space' ], [ vm_add_x_infl, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8598,6 +8696,7 @@ CODE[23] = [ // Power Struggle - Hungary ] CODE[24] = [ // St Nicolas Church + [ vm_permanently_remove ], [ vm_valid_spaces, 6 ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], @@ -8606,13 +8705,14 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika + [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] CODE[26] = [ // Helsinki Final Act* - [ vm_helsinki_final_act ], [ vm_permanently_remove ], + [ vm_helsinki_final_act ], [ vm_return ], ] @@ -8635,10 +8735,10 @@ CODE[28] = [ // Factory Party Cells ] CODE[29] = [ // Jan Palach Week* + [ vm_permanently_remove ], [ vm_valid_spaces, 30 ], [ vm_prompt, 'the Charles University space' ], [ vm_add_x_infl, 6 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8655,33 +8755,33 @@ CODE[31] = [ // Intelligentsia ] CODE[32] = [ // Peasant Parties* + [ vm_permanently_remove ], [ vm_valid_spaces_socio, 3 ], [ vm_prompt, 'Farmer spaces, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[33] = [ // Sajudis* + [ vm_permanently_remove ], [ vm_sajudis_check ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], [ vm_sajudis ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[34] = [ // Fidesz* + [ vm_permanently_remove ], [ vm_valid_spaces, 47 ], [ vm_prompt, 'the Hungary students space' ], [ vm_add_x_infl, 5 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[35] = [ // Heal our Bleeding Wounds* - [ vm_heal_our_bleeding_wounds ], [ vm_permanently_remove ], + [ vm_heal_our_bleeding_wounds ], [ vm_return ], ] @@ -8693,25 +8793,26 @@ CODE[36] = [ // Dash for the West* ] CODE[37] = [ // Nagy Reburied* + [ vm_permanently_remove ], [ vm_nagy_reburied ], [ vm_prompt, 'the Hungary Elite space' ], [ vm_remove_all_infl, 1 ], [ vm_valid_spaces_country, 'Hungary' ], [ vm_prompt, 'Hungary, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[38] = [ // July Concept + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Bulgaria' ], [ vm_prompt, 'Bulgaria' ], [ vm_add_infl_free, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[39] = [ // Eco-Glasnost* + [ vm_permanently_remove ], [ vm_valid_spaces, 66 ], [ vm_prompt, 'Ruse' ], [ vm_add_x_infl, 4 ], @@ -8720,17 +8821,18 @@ CODE[39] = [ // Eco-Glasnost* ] CODE[40] = [ // Hungarian Democratic Forum + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Hungary' ], [ vm_prompt, 'Hungary' ], [ vm_add_infl_free, 3 ], [ vm_valid_spaces_country_sc, 'Hungary' ], [ vm_prompt, 'make a Support Check in Hungary' ], [ vm_1_support_check ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[41] = [ // Ceausescu* + [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], [ vm_valid_spaces_country_opp, 'Romania' ], [ vm_prompt, ' from Romania' ], @@ -8740,8 +8842,9 @@ CODE[41] = [ // Ceausescu* [ vm_1_support_check ], [ vm_prompt, ' from Bucharesti' ], [ vm_ceausescu ], + [ vm_else ], + [ vm_tyrant_block ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8756,6 +8859,7 @@ CODE[43] = [ // Power Struggle - Bulgaria ] CODE[44] = [ // Inflationary Currency + [ vm_permanently_remove ], [ vm_inflationary_currency ], [ vm_valid_spaces_country_opp ], [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], @@ -8766,71 +8870,70 @@ CODE[44] = [ // Inflationary Currency [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], [ vm_1_support_check ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[45] = [ // Soviet Troop Withdrawals* + [ vm_permanently_remove ], [ vm_valid_spaces_region_opp, 'Eastern Europe' ], [ vm_prompt, ' from Eastern Europe' ], [ vm_remove_limited_opp_infl, 5, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[46] = [ // Goodbye Lenin!* - [ vm_goodbye_lenin ], [ vm_permanently_remove ], + [ vm_goodbye_lenin ], [ vm_return ], ] CODE[47] = [ // Bulgarian Turks Expelled* + [ vm_permanently_remove ], [ vm_bulgarian_turks_expelled ], [ vm_prompt, 'Razgrad' ], [ vm_remove_all_infl, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[48] = [ // We are the People!* - [ vm_we_are_the_people ], [ vm_permanently_remove ], + [ vm_we_are_the_people ], [ vm_return ], ] CODE[49] = [ // Foreign Currency Debt Burden* - [ vm_foreign_currency_debt_burden ], [ vm_permanently_remove ], + [ vm_foreign_currency_debt_burden ], [ vm_return ], ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_the_sinatra_doctrine ], [ vm_permanently_remove ], + [ vm_the_sinatra_doctrine ], [ vm_return ], ] CODE[51] = [ // 40th Anniversary Celebration* + [ vm_permanently_remove ], [ vm_40th_anniversary_celebration ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, 'East Germany' ], [ vm_add_infl_free ], [ vm_40th_anniversary_celebration_vp ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[52] = [ // Normalisation + [ vm_permanently_remove ], [ vm_normalisation ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[53] = [ // Li Peng* - [ vm_li_peng ], [ vm_permanently_remove ], + [ vm_li_peng ], [ vm_return ], ] @@ -8845,17 +8948,17 @@ CODE[55] = [ // Power Struggle - Czechoslovakia ] CODE[56] = [ // Foreign Television + [ vm_permanently_remove ], [ vm_foreign_television ], [ vm_remove_limited_opp_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[57] = [ // Central Committee Reshuffle* + [ vm_permanently_remove ], [ vm_central_committee_reshuffle ], [ vm_prompt, ()=>`${country_name(game.vm_active_country)}` ], [ vm_add_infl_free, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8870,21 +8973,21 @@ CODE[59] = [ // GrenzTruppen* ] CODE[60] = [ // Toxic Waste* + [ vm_permanently_remove ], [ vm_valid_spaces_socio, 4 ], [ vm_prompt, 'any Worker space(s)' ], [ vm_add_infl_free, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[61] = [ // The Monday Demonstrations* + [ vm_permanently_remove ], [ vm_the_monday_demonstrations ], [ vm_prompt, 'the Lutheran Church Space and Leipzig' ], [ vm_take_control_prep, 2 ], [ vm_valid_spaces_country_sc, 'East_Germany' ], [ vm_prompt, 'make 5 Support Checks in East Germany' ], [ vm_support_check, 5 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8899,24 +9002,24 @@ CODE[63] = [ // Genscher* ] CODE[64] = [ // Legacy of 1968* + [ vm_permanently_remove ], [ vm_legacy_of_1968 ], [ vm_prompt, 'all spaces in Czechoslovakia not controlled by the Communist Player' ], [ vm_add_limited_infl, 11, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[65] = [ // Presidential Visit* - [ vm_presidential_visit ], [ vm_permanently_remove ], + [ vm_presidential_visit ], [ vm_return ], ] CODE[66] = [ // New Forum + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, '3 spaces in East Germany' ], [ vm_add_limited_infl, 3, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8927,19 +9030,19 @@ CODE[67] = [ // Reformer Rehabilitated* ] CODE[68] = [ // Klaus and Komarek* + [ vm_permanently_remove ], [ vm_klaus_and_komarek ], [ vm_prompt, 'Prague' ], [ vm_remove_x_opp_infl, 2 ], [ vm_valid_spaces, 29 ], [ vm_add_x_infl, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[69] = [ // Systematization* + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8960,6 +9063,7 @@ CODE[72] = [ // Peasant Parties Revolt ] CODE[73] = [ // Laszlo Tokes* + [ vm_permanently_remove ], [ vm_valid_spaces, 50, 56 ], [ vm_prompt, 'in Timisoara and Harghita/Covasna' ], [ vm_add_limited_infl, 2, 1 ], @@ -8971,7 +9075,6 @@ CODE[73] = [ // Laszlo Tokes* [ vm_prompt, 'make 2 Support Checks in Romania' ], [ vm_support_check, 2 ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -8981,12 +9084,13 @@ CODE[74] = [ // FRG Embassies ] CODE[75] = [ // Exit Visas* - [ vm_exit_visas ], [ vm_permanently_remove ], + [ vm_exit_visas ], [ vm_return ], ] CODE[76] = [ // Warsaw Pact Summit + [ vm_permanently_remove ], [ vm_warsaw_pact_summit ], [ vm_if, ()=>game.phase === 3 ], [ vm_prompt, ' spaces with no Democratic SPs' ], @@ -8996,13 +9100,12 @@ CODE[76] = [ // Warsaw Pact Summit [ vm_valid_spaces_country_socio_2, 3,, 4 ], [ vm_support_check_modified, 2, 2 ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[77] = [ // Samizdat - [ vm_samizdat ], [ vm_permanently_remove ], + [ vm_samizdat ], [ vm_return ], ] @@ -9012,95 +9115,96 @@ CODE[78] = [ // Workers Revolt ] CODE[79] = [ // The Third Way* + [ vm_permanently_remove ], [ vm_the_third_way ], [ vm_valid_spaces, 4 ], [ vm_prompt, 'the East German Writers space' ], [ vm_add_x_infl, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[80] = [ // Nepotism* + [ vm_permanently_remove ], [ vm_nepotism ], [ vm_valid_spaces_region_socio, 'Balkans', 4 ], [ vm_prompt, 'Worker spaces in the Balkans' ], [ vm_add_infl_free ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[81] = [ // The Baltic Way* + [ vm_permanently_remove ], [ vm_the_baltic_way ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[82] = [ // Spitzel* + [ vm_permanently_remove ], [ vm_valid_spaces_country_opp, 'East_Germany' ], [ vm_prompt, ' from East Germany' ], [ vm_remove_opp_infl, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[83] = [ // Modrow* + [ vm_permanently_remove ], [ vm_modrow ], [ vm_valid_spaces_country, 'East_Germany' ], [ vm_prompt, 'East Germany' ], [ vm_add_limited_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[84] = [ // Breakaway Baltic Republics* + [ vm_permanently_remove ], [ vm_breakaway_baltic_republics ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], [ vm_valid_spaces_sc ], [ vm_prompt, 'select a space for the support check' ], [ vm_1_support_check ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[85] = [ // Tank Column/Tank Man* - [ vm_tank_column ], [ vm_permanently_remove ], + [ vm_tank_column ], [ vm_return ], ] CODE[86] = [ // The Wall Must Go!* + [ vm_permanently_remove ], [ vm_the_wall_must_go ], [ vm_remove_infl, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[87] = [ // Kohl Proposes Reunification* - [ vm_kohl_proposes_reunification ], [ vm_permanently_remove ], + [ vm_kohl_proposes_reunification ], [ vm_return ], ] CODE[88] = [ // Adamec* + [ vm_permanently_remove ], [ vm_adamec ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_limited_infl, 4, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[89] = [ // Domino Theory* - [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile.' ], - [ vm_domino_theory ], + [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_permanently_remove ], + [ vm_domino_theory ], [ vm_return ], ] CODE[90] = [ // Civic Forum* + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -9108,45 +9212,44 @@ CODE[90] = [ // Civic Forum* [ vm_valid_spaces_country_sc, 'Czechoslovakia' ], [ vm_prompt, 'Select a space in Czechoslovakia' ], [ vm_support_check, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[91] = [ // My First Banana* + [ vm_permanently_remove ], [ vm_valid_spaces_country_opp, 'East_Germany' ], [ vm_prompt, ' from East Germany' ], [ vm_remove_opp_infl, 2 ], [ vm_valid_spaces_country_sc, 'East_Germany' ], [ vm_prompt, 'select a space in East Germany' ], [ vm_support_check, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[92] = [ // Betrayal + [ vm_permanently_remove ], [ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ], [ vm_betrayal ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[93] = [ // Shock Therapy* + [ vm_permanently_remove ], [ vm_shock_therapy ], [ vm_valid_spaces_country ], [ vm_prompt, ()=>` ${country_name(game.vm_active_country)}` ], [ vm_add_infl_free, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[94] = [ // Union of Democratic Forces* + [ vm_permanently_remove ], [ vm_valid_spaces_country_opp, 'Bulgaria' ], [ vm_prompt, ' from Bulgaria' ], [ vm_remove_opp_infl, 4 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], [ vm_prompt, 'Make 2 Support Checks in Bulgaria' ], [ vm_support_check, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] @@ -9156,16 +9259,16 @@ CODE[95] = [ // Power Struggle - Romania ] CODE[96] = [ // The Chinese Solution* + [ vm_permanently_remove ], [ vm_the_chinese_solution ], [ vm_valid_spaces_country_sc ], - [ vm_prompt, ()=>`Make 5 Support Checks in ${country_name(game.vm_active_country)}` ], + [ vm_prompt, ()=>`make 5 Support Checks in ${country_name(game.vm_active_country)}` ], [ vm_support_check_modified, 5, 3 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events['the_crowd_turns_against_ceausescu'] ], + [ vm_if, ()=>game.persistent_events.includes(54) ], [ vm_valid_spaces, 51 ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], @@ -9178,35 +9281,38 @@ CODE[97] = [ // The Tyrant is Gone* ] CODE[98] = [ // Politburo Intrigue* + [ vm_permanently_remove ], [ vm_valid_spaces_country_opp, 'Bulgaria' ], [ vm_prompt, ' from Bulgaria' ], [ vm_remove_limited_opp_infl, 3, 2 ], [ vm_valid_spaces_country_sc, 'Bulgaria' ], [ vm_prompt, 'make a support check in Bulgaria' ], [ vm_1_support_check ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[99] = [ // Ligachev* - [ vm_ligachev ], [ vm_permanently_remove ], + [ vm_ligachev ], [ vm_return ], ] CODE[100] = [ // Stand Fast* - [ vm_stand_fast ], [ vm_permanently_remove ], + [ vm_stand_fast ], [ vm_return ], ] CODE[101] = [ // Elena* + [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], [ vm_valid_spaces, 51 ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], - [ vm_endif ], [ vm_elena ], + [ vm_else ], + [ vm_tyrant_block ], + [ vm_endif ], [ vm_return ], ] @@ -9229,19 +9335,21 @@ CODE[104] = [ // New Year's Eve Party* ] CODE[105] = [ // Public Against Violence* - [ vm_valid_spaces, 36, 37 ], - [ vm_prompt, 'Kosice and Presov' ], + [ vm_permanently_remove ], + [ vm_valid_spaces, 36 ], + [ vm_prompt, 'Kosice' ], [ vm_add_x_infl, 2 ], - [ vm_valid_spaces, 36, 37 ], + [ vm_valid_spaces, 37 ], + [ vm_prompt, 'Presov' ], [ vm_add_x_infl, 2 ], [ vm_public_against_violence ], [ vm_prompt, 'Make a Support Check in Bratislava' ], [ vm_support_check_modified, 1, 2 ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[106] = [ // Social Democratic Platform Adopted* + [ vm_permanently_remove ], [ vm_social_democratic_platform_adopted ], [ vm_valid_spaces_country ], [ vm_prompt, ()=>`${country_name(game.vm_active_country)}` ], @@ -9249,43 +9357,46 @@ CODE[106] = [ // Social Democratic Platform Adopted* [ vm_valid_spaces_country_sc ], [ vm_prompt, ()=>`make a Support Check in ${country_name(game.vm_active_country)}` ], [ vm_1_support_check ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[107] = [ // Massacre in Timisoara* + [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], [ vm_support_check_modified, 2, 2 ], + [ vm_else ], + [ vm_tyrant_block ], [ vm_endif ], - [ vm_permanently_remove ], [ vm_return ], ] CODE[108] = [ // Army Backs Revolution* - [ vm_army_backs_revolution ], [ vm_permanently_remove ], + [ vm_army_backs_revolution ], [ vm_return ], ] CODE[109] = [ // Kremlin Coup* - [ vm_kremlin_coup ], [ vm_permanently_remove ], + [ vm_kremlin_coup ], [ vm_return ], ] CODE[110] = [ // Malta Summit* + [ vm_permanently_remove ], [ vm_malta_summit ], [ vm_prompt, ' from Elite spaces' ], [ vm_remove_opp_infl, 5 ], - [ vm_permanently_remove ], [ vm_return ], ] // #endregion + + // ============= TIANANMEN SQUARE TRACK AWARDS ==================== CODE[203] = [//Tiananmen Square space 3 award [vm_tst_3], -- cgit v1.2.3 From cda50293541d39c8304f6934ddcef6c7dd1614ee Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 11:25:57 +0100 Subject: Update Modrow prompt --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 85b50bf..0f66954 100644 --- a/events.txt +++ b/events.txt @@ -620,7 +620,7 @@ CARD 83 - Modrow* permanently_remove modrow valid_spaces_country 'East_Germany' -prompt 'East Germany' +prompt 'East Germany, no more than 2 per space' add_limited_infl 4 2 -- cgit v1.2.3 From 7b2084f413b19f3d2bcea32261d29a766ff49b70 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 25 Oct 2024 12:40:17 +0100 Subject: Added TST and Power Struggle events --- events.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 0f66954..ded984f 100644 --- a/events.txt +++ b/events.txt @@ -863,3 +863,32 @@ prompt ' from Elite spaces' remove_opp_infl 5 +#// ============= TIANANMEN SQUARE TRACK AWARDS ==================== +CARD 203 - Tiananmen Square space 3 award +tst_3 + +CARD 204 - Tiananmen Square space 4 award +valid_spaces_opponent +tst_4 + +CARD 206 - Tiananmen Square space 6 +valid_spaces_sc +tst_6 + +CARD 208 - Tiananmen Square space 8 event +tst_8 + +#// ============= POWER STRUGGLE WILDCARDS ========================= + +CARD 349 - Scare Tactics +scare_tactics +valid_spaces_country_opp +prompt ()=>` from ${country_name(game.vm_active_country)}` +remove_opp_infl 1 + +CARD 350 - Support Surges +support_surges + +CARD 351 - Support Falters +support_falters + -- cgit v1.2.3 From f08940b60cb3a873aead8db1c2b25445c6af5a1e Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 07:53:43 +0100 Subject: Fix typo --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index ded984f..e900510 100644 --- a/events.txt +++ b/events.txt @@ -565,7 +565,7 @@ prompt ' spaces with no Democratic SPs' add_infl_free 4 else prompt 'Select a Student or Intellectual space' -valid_spaces_country_socio_2 3, 4 +valid_spaces_country_socio_2 3 4 support_check_modified 2 2 endif -- cgit v1.2.3 From 264161f150688577c757835dafbd78645106172c Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 12:21:13 +0100 Subject: Remove null space --- data.js | 2552 ++++++++++++++++++++++++++++++------------------------------ events.txt | 28 +- play.js | 14 +- rules.js | 245 +++--- 4 files changed, 1426 insertions(+), 1413 deletions(-) (limited to 'events.txt') diff --git a/data.js b/data.js index 6c37c50..c8194f1 100644 --- a/data.js +++ b/data.js @@ -1,1282 +1,1280 @@ const spaces = [ - null, - { - name_unique: "Schwerin", - space_id: 1, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 111, - y: 61, - }, - adjacent: [ 2, 3 ], - ascii_name: "Schwerin", - }, - { - name_unique: "Rostock", - space_id: 2, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 228, - y: 41, - }, - adjacent: [ 1, 3 ], - ascii_name: "Rostock", - }, - { - name_unique: "Berlin", - space_id: 3, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 251, - y: 113, - }, - adjacent: [ 1, 2, 5, 9 ], - ascii_name: "Berlin", - }, - { - name_unique: "German Writers", - space_id: 4, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 58, - y: 185, - }, - adjacent: [ 5 ], - ascii_name: "German Writers", - }, - { - name_unique: "Walter Ulbricht Academy", - space_id: 5, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 175, - y: 187, - }, - adjacent: [ 3, 4 ], - ascii_name: "Walter Ulbricht Academy", - }, - { - name_unique: "Lutheran Church", - space_id: 6, - socio: 7, - stability: 5, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 300, - y: 212, - }, - adjacent: [ 9 ], - ascii_name: "Lutheran Church", - }, - { - name_unique: "Magdeburg", - space_id: 7, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 58, - y: 275, - }, - adjacent: [ 8, 10, 11 ], - ascii_name: "Magdeburg", - }, - { - name_unique: "Halle", - space_id: 8, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 175, - y: 278, - }, - adjacent: [ 7, 9, 11 ], - ascii_name: "Halle", - }, - { - name_unique: "Leipzig", - space_id: 9, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 297, - y: 297, - }, - adjacent: [ 3, 6, 8, 11, 12 ], - ascii_name: "Leipzig", - }, - { - name_unique: "Erfurt", - space_id: 10, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 23, - y: 356, - }, - adjacent: [ 7 ], - ascii_name: "Erfurt", - }, - { - name_unique: "Karl-Marx-Stadt", - space_id: 11, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 138, - y: 385, - }, - adjacent: [ 7, 8, 9, 12 ], - ascii_name: "Karl-Marx-Stadt", - }, - { - name_unique: "Dresden", - space_id: 12, - socio: 1, - stability: 4, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "East_Germany", - region: "Eastern Europe", - box: { - x: 262, - y: 375, - }, - adjacent: [ 9, 11, 19, 27 ], - ascii_name: "Dresden", - }, - { - name_unique: "Szczecin", - space_id: 13, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 434, - y: 204, - }, - adjacent: [ 14, 16 ], - ascii_name: "Szczecin", - }, - { - name_unique: "Gdańsk", - space_id: 14, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 699, - y: 215, - }, - adjacent: [ 13, 15, 16, 17, 18 ], - ascii_name: "Gdansk", - }, - { - name_unique: "Bydgoszcz", - space_id: 15, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 679, - y: 304, - }, - adjacent: [ 14, 17 ], - ascii_name: "Bydgoszcz", - }, - { - name_unique: "Poznań", - space_id: 16, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 521, - y: 355, - }, - adjacent: [ 13, 14, 19, 20 ], - ascii_name: "Poznan", - }, - { - name_unique: "Warszawa", - space_id: 17, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 806, - y: 383, - }, - adjacent: [ 14, 15, 18, 21, 24 ], - ascii_name: "Warszawa", - }, - { - name_unique: "Białystok", - space_id: 18, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 940, - y: 342, - }, - adjacent: [ 14, 17, 24 ], - ascii_name: "Bialystok", - }, - { - name_unique: "Wrocław", - space_id: 19, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 462, - y: 443, - }, - adjacent: [ 12, 16, 20, 22 ], - ascii_name: "Wroclaw", - }, - { - name_unique: "Catholic Church, Poland", - space_id: 20, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 5, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 625, - y: 437, - }, - adjacent: [ 16, 19, 21, 22, 23 ], - ascii_name: "Catholic Church, Poland", - }, - { - name_unique: "Łódź", - space_id: 21, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 749, - y: 486, - }, - adjacent: [ 17, 20, 23, 24 ], - ascii_name: "Lodz", - }, - { - name_unique: "Katowice", - space_id: 22, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 570, - y: 569, - }, - adjacent: [ 19, 20, 23, 33 ], - ascii_name: "Katowice", - }, - { - name_unique: "Kraków", - space_id: 23, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 711, - y: 598, - }, - adjacent: [ 20, 21, 22, 25 ], - ascii_name: "Krakow", - }, - { - name_unique: "Lublin", - space_id: 24, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Poland", - region: "Eastern Europe", - box: { - x: 879, - y: 603, - }, - adjacent: [ 17, 18, 21 ], - ascii_name: "Lublin", - }, - { - name_unique: "Jagiellonian University", - space_id: 25, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 679, - y: 681, - }, - adjacent: [ 23, 26 ], - ascii_name: "Jagiellonian University", - }, - { - name_unique: "Polish Writers", - space_id: 26, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Poland", - region: "Eastern Europe", - box: { - x: 832, - y: 694, - }, - adjacent: [ 25 ], - ascii_name: "Polish Writers", - }, - { - name_unique: "Plzeň", - space_id: 27, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 2, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 159, - y: 483, - }, - adjacent: [ 12, 28, 29 ], - ascii_name: "Plzen", - }, - { - name_unique: "České Budĕjovice", - space_id: 28, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 196, - y: 601, - }, - adjacent: [ 27, 29 ], - ascii_name: "Ceske Budejovice", - }, - { - name_unique: "Praha", - space_id: 29, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 317, - y: 614, - }, - adjacent: [ 27, 28, 30, 32 ], - ascii_name: "Praha", - }, - { - name_unique: "Charles University", - space_id: 30, - socio: 6, - stability: 1, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 380, - y: 532, - }, - adjacent: [ 29, 31 ], - ascii_name: "Charles University", - }, - { - name_unique: "Czech Writers", - space_id: 31, - socio: 5, - stability: 2, - battleground: 1, - demInfl: 2, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 444, - y: 607, - }, - adjacent: [ 30 ], - ascii_name: "Czech Writers", - }, - { - name_unique: "Brno", - space_id: 32, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 1, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 403, - y: 711, - }, - adjacent: [ 29, 33, 34 ], - ascii_name: "Brno", - }, - { - name_unique: "Ostrava", - space_id: 33, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 523, - y: 681, - }, - adjacent: [ 22, 32, 34, 35 ], - ascii_name: "Ostrava", - }, - { - name_unique: "Bratislava", - space_id: 34, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 417, - y: 797, - }, - adjacent: [ 32, 33, 35 ], - ascii_name: "Bratislava", - }, - { - name_unique: "Catholic Church, Czechoslovakia", - space_id: 35, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 538, - y: 794, - }, - adjacent: [ 33, 34, 36 ], - ascii_name: "Catholic Church, Czechoslovakia", - }, - { - name_unique: "Prešov", - space_id: 36, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 658, - y: 794, - }, - adjacent: [ 35, 37 ], - ascii_name: "Presov", - }, - { - name_unique: "Košice", - space_id: 37, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Czechoslovakia", - region: "Eastern Europe", - box: { - x: 777, - y: 815, - }, - adjacent: [ 36, 42 ], - ascii_name: "Kosice", - }, - { - name_unique: "Catholic Church, Hungary", - space_id: 38, - socio: 7, - stability: 5, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 314, - y: 886, - }, - adjacent: [ 39, 43 ], - ascii_name: "Catholic Church, Hungary", - }, - { - name_unique: "Győr", - space_id: 39, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 434, - y: 887, - }, - adjacent: [ 38, 40, 43, 44 ], - ascii_name: "Gyor", - }, - { - name_unique: "Tatabánya", - space_id: 40, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 549, - y: 886, - }, - adjacent: [ 39, 41, 45 ], - ascii_name: "Tatabanya", - }, - { - name_unique: "Miskolc", - space_id: 41, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 664, - y: 901, - }, - adjacent: [ 40, 42, 45 ], - ascii_name: "Miskolc", - }, - { - name_unique: "Debrecen", - space_id: 42, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 781, - y: 938, - }, - adjacent: [ 37, 41 ], - ascii_name: "Debrecen", - }, - { - name_unique: "Szombathely", - space_id: 43, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 316, - y: 963, - }, - adjacent: [ 38, 39, 44 ], - ascii_name: "Szombathely", - }, - { - name_unique: "Székesfehérvár", - space_id: 44, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 442, - y: 962, - }, - adjacent: [ 39, 43, 45 ], - ascii_name: "Szekesfehervar", - }, - { - name_unique: "Budapest", - space_id: 45, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 630, - y: 983, - }, - adjacent: [ 40, 41, 44, 47, 48 ], - ascii_name: "Budapest", - }, - { - name_unique: "Hungarian Writers", - space_id: 46, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 348, - y: 1040, - }, - adjacent: [ 47 ], - ascii_name: "Hungarian Writers", - }, - { - name_unique: "Eötvös Loránd University", - space_id: 47, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 512, - y: 1034, - }, - adjacent: [ 46, 45 ], - ascii_name: "Eotvos Lorand University", - }, - { - name_unique: "Szeged", - space_id: 48, - socio: 3, - stability: 4, - battleground: 1, - demInfl: 1, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 632, - y: 1073, - }, - adjacent: [ 45, 49, 50 ], - ascii_name: "Szeged", - }, - { - name_unique: "Pécs", - space_id: 49, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Hungary", - region: "Eastern Europe", - box: { - x: 486, - y: 1105, - }, - adjacent: [ 48 ], - ascii_name: "Pecs", - }, - { - name_unique: "Timişoara", - space_id: 50, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 597, - y: 1204, - }, - adjacent: [ 48, 51, 60 ], - ascii_name: "Timisoara", - }, - { - name_unique: "Cluj-Napoca", - space_id: 51, - socio: 1, - stability: 4, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Romania", - region: "Balkans", - box: { - x: 756, - y: 1125, - }, - adjacent: [ 50, 54, 58, 61 ], - ascii_name: "Cluj-Napoca", - }, - { - name_unique: "Târgu Mureş", - space_id: 52, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 915, - y: 1136, - }, - adjacent: [ 53, 56 ], - ascii_name: "Targu Mures", - }, - { - name_unique: "Iaşi", - space_id: 53, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1072, - y: 1097, - }, - adjacent: [ 52, 57, 62 ], - ascii_name: "Iasi", - }, - { - name_unique: "Babeş-Bolyai University", - space_id: 54, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 746, - y: 1203, - }, - adjacent: [ 51, 55 ], - ascii_name: "Babes-Bolyai University", - }, - { - name_unique: "Romanian Writers", - space_id: 55, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 739, - y: 1278, - }, - adjacent: [ 54 ], - ascii_name: "Romanian Writers", - }, - { - name_unique: "Harghita/Covasna", - space_id: 56, - socio: 8, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 928, - y: 1227, - }, - adjacent: [ 52 ], - ascii_name: "Harghita/Covasna", - }, - { - name_unique: "Braşov", - space_id: 57, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1049, - y: 1225, - }, - adjacent: [ 53, 59, 61 ], - ascii_name: "Brasov", - }, - { - name_unique: "Orthodox Church, Romania", - space_id: 58, - socio: 7, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 855, - y: 1338, - }, - adjacent: [ 51, 60 ], - ascii_name: "Orthodox Church, Romania", - }, - { - name_unique: "Ploieşti", - space_id: 59, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1061, - y: 1316, - }, - adjacent: [ 57, 61, 62 ], - ascii_name: "Ploiesti", - }, - { - name_unique: "Craiova", - space_id: 60, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 763, - y: 1411, - }, - adjacent: [ 50, 58, 61 ], - ascii_name: "Craiova", - }, - { - name_unique: "Bucureşti", - space_id: 61, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Romania", - region: "Balkans", - box: { - x: 929, - y: 1445, - }, - adjacent: [ 51, 57, 59, 60, 63 ], - ascii_name: "Bucuresti", - }, - { - name_unique: "Galaţi", - space_id: 62, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1104, - y: 1399, - }, - adjacent: [ 53, 59, 63 ], - ascii_name: "Galati", - }, - { - name_unique: "Constanţa", - space_id: 63, - socio: 4, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Romania", - region: "Balkans", - box: { - x: 1130, - y: 1517, - }, - adjacent: [ 61, 62, 72 ], - ascii_name: "Constanta", - }, - { - name_unique: "Pleven", - space_id: 64, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 764, - y: 1534, - }, - adjacent: [ 68 ], - ascii_name: "Pleven", - }, - { - name_unique: "Orthodox Church, Bulgaria", - space_id: 65, - socio: 7, - stability: 3, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 882, - y: 1540, - }, - adjacent: [ 66, 68 ], - ascii_name: "Orthodox Church, Bulgaria", - }, - { - name_unique: "Ruse", - space_id: 66, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 998, - y: 1540, - }, - adjacent: [ 65, 69, 70, 71, 72 ], - ascii_name: "Ruse", - }, - { - name_unique: "Sofia University", - space_id: 67, - socio: 6, - stability: 1, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 645, - y: 1650, - }, - adjacent: [ 68, 73 ], - ascii_name: "Sofia University", - }, - { - name_unique: "Sofia", - space_id: 68, - socio: 2, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 2, - country: "Bulgaria", - region: "Balkans", - box: { - x: 768, - y: 1653, - }, - adjacent: [ 64, 65, 67, 69, 74 ], - ascii_name: "Sofia", - }, - { - name_unique: "Stara Zagora", - space_id: 69, - socio: 1, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 1, - country: "Bulgaria", - region: "Balkans", - box: { - x: 886, - y: 1694, - }, - adjacent: [ 66, 68, 71 ], - ascii_name: "Stara Zagora", - }, - { - name_unique: "Razgrad", - space_id: 70, - socio: 8, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 954, - y: 1620, - }, - adjacent: [ 66 ], - ascii_name: "Razgrad", - }, - { - name_unique: "Burgas", - space_id: 71, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 1004, - y: 1695, - }, - adjacent: [ 66, 69, 72 ], - ascii_name: "Burgas", - }, - { - name_unique: "Varna", - space_id: 72, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 1086, - y: 1613, - }, - adjacent: [ 63, 66, 71 ], - ascii_name: "Varna", - }, - { - name_unique: "Bulgarian Writers", - space_id: 73, - socio: 5, - stability: 2, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 652, - y: 1726, - }, - adjacent: [ 67 ], - ascii_name: "Bulgarian Writers", - }, - { - name_unique: "Plovdiv", - space_id: 74, - socio: 4, - stability: 3, - battleground: 1, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 771, - y: 1739, - }, - adjacent: [ 68, 75 ], - ascii_name: "Plovdiv", - }, - { - name_unique: "Sliven", - space_id: 75, - socio: 3, - stability: 4, - battleground: 0, - demInfl: 0, - comInfl: 0, - country: "Bulgaria", - region: "Balkans", - box: { - x: 894, - y: 1768, - }, - adjacent: [ 74 ], - ascii_name: "Sliven", - }, + { +         name_unique: "Schwerin", +         space_id: 0, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 111, +                 y: 61, +         }, +         adjacent: [ 1, 2 ], +         ascii_name: "Schwerin", + }, + { +         name_unique: "Rostock", +         space_id: 1, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 228, +                 y: 41, +         }, +         adjacent: [ 0, 2 ], +         ascii_name: "Rostock", + }, + { +         name_unique: "Berlin", +         space_id: 2, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 251, +                 y: 113, +         }, +         adjacent: [ 0, 1, 4, 8 ], +         ascii_name: "Berlin", + }, + { +         name_unique: "German Writers", +         space_id: 3, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 58, +                 y: 185, +         }, +         adjacent: [ 4 ], +         ascii_name: "German Writers", + }, + { +         name_unique: "Walter Ulbricht Academy", +         space_id: 4, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 175, +                 y: 187, +         }, +         adjacent: [ 2, 3 ], +         ascii_name: "Walter Ulbricht Academy", + }, + { +         name_unique: "Lutheran Church", +         space_id: 5, +         socio: 7, +         stability: 5, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 300, +                 y: 212, +         }, +         adjacent: [ 8 ], +         ascii_name: "Lutheran Church", + }, + { +         name_unique: "Magdeburg", +         space_id: 6, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 58, +                 y: 275, +         }, +         adjacent: [ 7, 9, 10 ], +         ascii_name: "Magdeburg", + }, + { +         name_unique: "Halle", +         space_id: 7, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 175, +                 y: 278, +         }, +         adjacent: [ 6, 8, 10 ], +         ascii_name: "Halle", + }, + { +         name_unique: "Leipzig", +         space_id: 8, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 297, +                 y: 297, +         }, +         adjacent: [ 2, 5, 7, 10, 11 ], +         ascii_name: "Leipzig", + }, + { +         name_unique: "Erfurt", +         space_id: 9, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 23, +                 y: 356, +         }, +         adjacent: [ 6 ], +         ascii_name: "Erfurt", + }, + { +         name_unique: "Karl-Marx-Stadt", +         space_id: 10, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 138, +                 y: 385, +         }, +         adjacent: [ 6, 7, 8, 11 ], +         ascii_name: "Karl-Marx-Stadt", + }, + { +         name_unique: "Dresden", +         space_id: 11, +         socio: 1, +         stability: 4, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "East_Germany", +         region: "Eastern Europe", +         box: { +                 x: 262, +                 y: 375, +         }, +         adjacent: [ 8, 10, 18, 26 ], +         ascii_name: "Dresden", + }, + { +         name_unique: "Szczecin", +         space_id: 12, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 434, +                 y: 204, +         }, +         adjacent: [ 13, 15 ], +         ascii_name: "Szczecin", + }, + { +         name_unique: "Gdańsk", +         space_id: 13, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 699, +                 y: 215, +         }, +         adjacent: [ 12, 14, 15, 16, 17 ], +         ascii_name: "Gdansk", + }, + { +         name_unique: "Bydgoszcz", +         space_id: 14, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 679, +                 y: 304, +         }, +         adjacent: [ 13, 16 ], +         ascii_name: "Bydgoszcz", + }, + { +         name_unique: "Poznań", +         space_id: 15, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 521, +                 y: 355, +         }, +         adjacent: [ 12, 13, 18, 19 ], +         ascii_name: "Poznan", + }, + { +         name_unique: "Warszawa", +         space_id: 16, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 806, +                 y: 383, +         }, +         adjacent: [ 13, 14, 17, 20, 23 ], +         ascii_name: "Warszawa", + }, + { +         name_unique: "Białystok", +         space_id: 17, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 940, +                 y: 342, +         }, +         adjacent: [ 13, 16, 23 ], +         ascii_name: "Bialystok", + }, + { +         name_unique: "Wrocław", +         space_id: 18, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 462, +                 y: 443, +         }, +         adjacent: [ 11, 15, 19, 21 ], +         ascii_name: "Wroclaw", + }, + { +         name_unique: "Catholic Church, Poland", +         space_id: 19, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 5, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 625, +                 y: 437, +         }, +         adjacent: [ 15, 18, 20, 21, 22 ], +         ascii_name: "Catholic Church, Poland", + }, + { +         name_unique: "Łódź", +         space_id: 20, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 749, +                 y: 486, +         }, +         adjacent: [ 16, 19, 22, 23 ], +         ascii_name: "Lodz", + }, + { +         name_unique: "Katowice", +         space_id: 21, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 570, +                 y: 569, +         }, +         adjacent: [ 18, 19, 22, 32 ], +         ascii_name: "Katowice", + }, + { +         name_unique: "Kraków", +         space_id: 22, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 711, +                 y: 598, +         }, +         adjacent: [ 19, 20, 21, 24 ], +         ascii_name: "Krakow", + }, + { +         name_unique: "Lublin", +         space_id: 23, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 879, +                 y: 603, +         }, +         adjacent: [ 16, 17, 20 ], +         ascii_name: "Lublin", + }, + { +         name_unique: "Jagiellonian University", +         space_id: 24, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 679, +                 y: 681, +         }, +         adjacent: [ 22, 25 ], +         ascii_name: "Jagiellonian University", + }, + { +         name_unique: "Polish Writers", +         space_id: 25, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Poland", +         region: "Eastern Europe", +         box: { +                 x: 832, +                 y: 694, +         }, +         adjacent: [ 24 ], +         ascii_name: "Polish Writers", + }, + { +         name_unique: "Plzeň", +         space_id: 26, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 2, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 159, +                 y: 483, +         }, +         adjacent: [ 11, 27, 28 ], +         ascii_name: "Plzen", + }, + { +         name_unique: "České Budĕjovice", +         space_id: 27, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 196, +                 y: 601, +         }, +         adjacent: [ 26, 28 ], +         ascii_name: "Ceske Budejovice", + }, + { +         name_unique: "Praha", +         space_id: 28, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 317, +                 y: 614, +         }, +         adjacent: [ 26, 27, 29, 31 ], +         ascii_name: "Praha", + }, + { +         name_unique: "Charles University", +         space_id: 29, +         socio: 6, +         stability: 1, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 380, +                 y: 532, +         }, +         adjacent: [ 28, 30 ], +         ascii_name: "Charles University", + }, + { +         name_unique: "Czech Writers", +         space_id: 30, +         socio: 5, +         stability: 2, +         battleground: 1, +         demInfl: 2, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 444, +                 y: 607, +         }, +         adjacent: [ 29 ], +         ascii_name: "Czech Writers", + }, + { +         name_unique: "Brno", +         space_id: 31, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 1, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 403, +                 y: 711, +         }, +         adjacent: [ 28, 32, 33 ], +         ascii_name: "Brno", + }, + { +         name_unique: "Ostrava", +         space_id: 32, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 523, +                 y: 681, +         }, +         adjacent: [ 21, 31, 33, 34 ], +         ascii_name: "Ostrava", + }, + { +         name_unique: "Bratislava", +         space_id: 33, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 417, +                 y: 797, +         }, +         adjacent: [ 31, 32, 34 ], +         ascii_name: "Bratislava", + }, + { +         name_unique: "Catholic Church, Czechoslovakia", +         space_id: 34, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 538, +                 y: 794, +         }, +         adjacent: [ 32, 33, 35 ], +         ascii_name: "Catholic Church, Czechoslovakia", + }, + { +         name_unique: "Prešov", +         space_id: 35, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 658, +                 y: 794, +         }, +         adjacent: [ 34, 36 ], +         ascii_name: "Presov", + }, + { +         name_unique: "Košice", +         space_id: 36, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Czechoslovakia", +         region: "Eastern Europe", +         box: { +                 x: 777, +                 y: 815, +         }, +         adjacent: [ 35, 41 ], +         ascii_name: "Kosice", + }, + { +         name_unique: "Catholic Church, Hungary", +         space_id: 37, +         socio: 7, +         stability: 5, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 314, +                 y: 886, +         }, +         adjacent: [ 38, 42 ], +         ascii_name: "Catholic Church, Hungary", + }, + { +         name_unique: "Győr", +         space_id: 38, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 434, +                 y: 887, +         }, +         adjacent: [ 37, 39, 42, 43 ], +         ascii_name: "Gyor", + }, + { +         name_unique: "Tatabánya", +         space_id: 39, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 549, +                 y: 886, +         }, +         adjacent: [ 38, 40, 44 ], +         ascii_name: "Tatabanya", + }, + { +         name_unique: "Miskolc", +         space_id: 40, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 664, +                 y: 901, +         }, +         adjacent: [ 39, 41, 44 ], +         ascii_name: "Miskolc", + }, + { +         name_unique: "Debrecen", +         space_id: 41, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 781, +                 y: 938, +         }, +         adjacent: [ 36, 40 ], +         ascii_name: "Debrecen", + }, + { +         name_unique: "Szombathely", +         space_id: 42, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 316, +                 y: 963, +         }, +         adjacent: [ 37, 38, 43 ], +         ascii_name: "Szombathely", + }, + { +         name_unique: "Székesfehérvár", +         space_id: 43, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 442, +                 y: 962, +         }, +         adjacent: [ 38, 42, 44 ], +         ascii_name: "Szekesfehervar", + }, + { +         name_unique: "Budapest", +         space_id: 44, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 630, +                 y: 983, +         }, +         adjacent: [ 39, 40, 43, 46, 47 ], +         ascii_name: "Budapest", + }, + { +         name_unique: "Hungarian Writers", +         space_id: 45, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 348, +                 y: 1040, +         }, +         adjacent: [ 46 ], +         ascii_name: "Hungarian Writers", + }, + { +         name_unique: "Eötvös Loránd University", +         space_id: 46, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 512, +                 y: 1034, +         }, +         adjacent: [ 45, 44 ], +         ascii_name: "Eotvos Lorand University", + }, + { +         name_unique: "Szeged", +         space_id: 47, +         socio: 3, +         stability: 4, +         battleground: 1, +         demInfl: 1, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 632, +                 y: 1073, +         }, +         adjacent: [ 44, 48, 49 ], +         ascii_name: "Szeged", + }, + { +         name_unique: "Pécs", +         space_id: 48, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Hungary", +         region: "Eastern Europe", +         box: { +                 x: 486, +                 y: 1105, +         }, +         adjacent: [ 47 ], +         ascii_name: "Pecs", + }, + { +         name_unique: "Timişoara", +         space_id: 49, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 597, +                 y: 1204, +         }, +         adjacent: [ 47, 50, 59 ], +         ascii_name: "Timisoara", + }, + { +         name_unique: "Cluj-Napoca", +         space_id: 50, +         socio: 1, +         stability: 4, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 756, +                 y: 1125, +         }, +         adjacent: [ 49, 53, 57, 60 ], +         ascii_name: "Cluj-Napoca", + }, + { +         name_unique: "Târgu Mureş", +         space_id: 51, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 915, +                 y: 1136, +         }, +         adjacent: [ 52, 55 ], +         ascii_name: "Targu Mures", + }, + { +         name_unique: "Iaşi", +         space_id: 52, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1072, +                 y: 1097, +         }, +         adjacent: [ 51, 56, 61 ], +         ascii_name: "Iasi", + }, + { +         name_unique: "Babeş-Bolyai University", +         space_id: 53, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 746, +                 y: 1203, +         }, +         adjacent: [ 50, 54 ], +         ascii_name: "Babes-Bolyai University", + }, + { +         name_unique: "Romanian Writers", +         space_id: 54, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 739, +                 y: 1278, +         }, +         adjacent: [ 53 ], +         ascii_name: "Romanian Writers", + }, + { +         name_unique: "Harghita/Covasna", +         space_id: 55, +         socio: 8, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 928, +                 y: 1227, +         }, +         adjacent: [ 51 ], +         ascii_name: "Harghita/Covasna", + }, + { +         name_unique: "Braşov", +         space_id: 56, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1049, +                 y: 1225, +         }, +         adjacent: [ 52, 58, 60 ], +         ascii_name: "Brasov", + }, + { +         name_unique: "Orthodox Church, Romania", +         space_id: 57, +         socio: 7, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 855, +                 y: 1338, +         }, +         adjacent: [ 50, 59 ], +         ascii_name: "Orthodox Church, Romania", + }, + { +         name_unique: "Ploieşti", +         space_id: 58, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1061, +                 y: 1316, +         }, +         adjacent: [ 56, 60, 61 ], +         ascii_name: "Ploiesti", + }, + { +         name_unique: "Craiova", +         space_id: 59, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 763, +                 y: 1411, +         }, +         adjacent: [ 49, 57, 60 ], +         ascii_name: "Craiova", + }, + { +         name_unique: "Bucureşti", +         space_id: 60, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 929, +                 y: 1445, +         }, +         adjacent: [ 50, 56, 58, 59, 62 ], +         ascii_name: "Bucuresti", + }, + { +         name_unique: "Galaţi", +         space_id: 61, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1104, +                 y: 1399, +         }, +         adjacent: [ 52, 58, 62 ], +         ascii_name: "Galati", + }, + { +         name_unique: "Constanţa", +         space_id: 62, +         socio: 4, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Romania", +         region: "Balkans", +         box: { +                 x: 1130, +                 y: 1517, +         }, +         adjacent: [ 60, 61, 71 ], +         ascii_name: "Constanta", + }, + { +         name_unique: "Pleven", +         space_id: 63, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 764, +                 y: 1534, +         }, +         adjacent: [ 67 ], +         ascii_name: "Pleven", + }, + { +         name_unique: "Orthodox Church, Bulgaria", +         space_id: 64, +         socio: 7, +         stability: 3, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 882, +                 y: 1540, +         }, +         adjacent: [ 65, 67 ], +         ascii_name: "Orthodox Church, Bulgaria", + }, + { +         name_unique: "Ruse", +         space_id: 65, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 998, +                 y: 1540, +         }, +         adjacent: [ 64, 68, 69, 70, 71 ], +         ascii_name: "Ruse", + }, + { +         name_unique: "Sofia University", +         space_id: 66, +         socio: 6, +         stability: 1, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 645, +                 y: 1650, +         }, +         adjacent: [ 67, 72 ], +         ascii_name: "Sofia University", + }, + { +         name_unique: "Sofia", +         space_id: 67, +         socio: 2, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 2, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 768, +                 y: 1653, +         }, +         adjacent: [ 63, 64, 66, 68, 73 ], +         ascii_name: "Sofia", + }, + { +         name_unique: "Stara Zagora", +         space_id: 68, +         socio: 1, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 1, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 886, +                 y: 1694, +         }, +         adjacent: [ 65, 67, 70 ], +         ascii_name: "Stara Zagora", + }, + { +         name_unique: "Razgrad", +         space_id: 69, +         socio: 8, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 954, +                 y: 1620, +         }, +         adjacent: [ 65 ], +         ascii_name: "Razgrad", + }, + { +         name_unique: "Burgas", +         space_id: 70, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 1004, +                 y: 1695, +         }, +         adjacent: [ 65, 68, 71 ], +         ascii_name: "Burgas", + }, + { +         name_unique: "Varna", +         space_id: 71, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 1086, +                 y: 1613, +         }, +         adjacent: [ 62, 65, 70 ], +         ascii_name: "Varna", + }, + { +         name_unique: "Bulgarian Writers", +         space_id: 72, +         socio: 5, +         stability: 2, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 652, +                 y: 1726, +         }, +         adjacent: [ 66 ], +         ascii_name: "Bulgarian Writers", + }, + { +         name_unique: "Plovdiv", +         space_id: 73, +         socio: 4, +         stability: 3, +         battleground: 1, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 771, +                 y: 1739, +         }, +         adjacent: [ 67, 74 ], +         ascii_name: "Plovdiv", + }, + { +         name_unique: "Sliven", +         space_id: 74, +         socio: 3, +         stability: 4, +         battleground: 0, +         demInfl: 0, +         comInfl: 0, +         country: "Bulgaria", +         region: "Balkans", +         box: { +                 x: 894, +                 y: 1768, +         }, +         adjacent: [ 73 ], +         ascii_name: "Sliven", + }, ] - const cards = [ null, {number: 1, period: 1, side: 'C', name: 'Legacy of Martial Law*', ops: 2, remove: 1, playable: true, red: false}, diff --git a/events.txt b/events.txt index e900510..82d3c59 100644 --- a/events.txt +++ b/events.txt @@ -33,7 +33,7 @@ support_check 2 CARD 4 - Michnik # Place 3 Democratic SPs in the Polish Intellectuals space. permanently_remove -valid_spaces 26 +valid_spaces 'Polish Writers' prompt 'the Polish Intellectuals space' add_x_infl 3 @@ -136,7 +136,7 @@ add_limited_infl 4 1 CARD 19 - Papal vist # Place 3 SPs in any Catholic Church space. permanently_remove -valid_spaces 20 35 38 +valid_spaces 'Catholic Church, Poland', 'Catholic Church, Czechoslovakia', 'Catholic Church, Hungary' prompt 'any Catholic Church space' add_x_infl 3 @@ -165,7 +165,7 @@ 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 6 +valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 st_nicholas_church @@ -204,7 +204,7 @@ remove_limited_opp_infl 3 2 CARD 29 - Jan Palach Week* # Place 6 Democratic SPs in the Charles University space. permanently_remove -valid_spaces 30 +valid_spaces 'Charles University' prompt 'the Charles University space' add_x_infl 6 @@ -216,7 +216,7 @@ tear_gas CARD 31 - Intelligentsia # Place 4 Democratic SPs in Intellectual spaces, no more than 2 per space. -valid_spaces 4 26 31 46 55 73 +valid_spaces_socio 5 prompt 'Intellectual spaces, no more than 2 per space' add_limited_infl 4 2 @@ -241,7 +241,7 @@ sajudis CARD 34 - Fidesz* # Place 5 Democratic SPs in Hungary Student space. permanently_remove -valid_spaces 47 +valid_spaces 'Eotvos Lorand University' prompt 'the Hungary students space' add_x_infl 5 @@ -281,7 +281,7 @@ add_infl_free 3 CARD 39 - Eco-Glasnost* # Place 4 Democratic SPs in Ruse. permanently_remove -valid_spaces 66 +valid_spaces 'Ruse' prompt 'Ruse' add_x_infl 4 eco_glasnost @@ -502,7 +502,7 @@ permanently_remove klaus_and_komarek prompt 'Prague' remove_x_opp_infl 2 -valid_spaces 29 +valid_spaces 'Praha' add_x_infl 2 @@ -532,7 +532,7 @@ 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 50 56 +valid_spaces 'Timisoara', 'Harghita/Covasna' prompt 'in Timisoara and Harghita/Covasna' add_limited_infl 2 1 laszlo_tokes @@ -585,7 +585,7 @@ CARD 79 - The Third Way* # -2 VP. Place 3 Communist SPs in the German writers space. permanently_remove the_third_way -valid_spaces 4 +valid_spaces 'German Writers' prompt 'the East German Writers space' add_x_infl 3 @@ -740,7 +740,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu if game.persistent_events.includes(54) -valid_spaces 51 +valid_spaces 'Cluj-Napoca' prompt 'the Romanian Elite Space' remove_x_opp_infl 4 the_tyrant_is_gone @@ -777,7 +777,7 @@ 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 51 +valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 elena @@ -807,10 +807,10 @@ new_years_eve_party CARD 105 - Public Against Violence* # Place 2 Democratic SPs each in Kosice and Presov. Make one Support Check in Bratislava using the Ops value of this card. permanently_remove -valid_spaces 36 +valid_spaces 'Kosice' prompt 'Kosice' add_x_infl 2 -valid_spaces 37 +valid_spaces 'Presov' prompt 'Presov' add_x_infl 2 public_against_violence diff --git a/play.js b/play.js index 7f73430..dc2c592 100644 --- a/play.js +++ b/play.js @@ -18,7 +18,7 @@ function on_click_action(evt) { send_action(evt.target.my_action, evt.target.my_id) } -const last_space = 75 +const last_space = 74 const last_card = 110 const last_power_card = 52 @@ -152,11 +152,11 @@ function create_ui() { // SUPPORTING FUNCTIONS function on_click_space(evt) { - if (evt.button === 0) { - const space = evt.target.my_space; - //console.log('on_click_space_called with space:', space); - if (send_action('space', space)) { - //console.log('send_action with infl:', space); + if (evt.button === 0) { + const space = evt.target.my_space + //console.log('on_click_space_called with space:', space); + if (send_action("space", space)) { + console.log('send_action with space:', space); evt.stopPropagation() } else if (send_action("sc", space)) { //console.log('send_action with sc:', space); @@ -655,4 +655,4 @@ var LAYOUT = { "vp_neg_19": [246,2456,55,50], "vp_neg_2": [772,2395,56,51], "vp_neg_20": [215,2395,55,51], -} +} \ No newline at end of file diff --git a/rules.js b/rules.js index a82a641..a691129 100644 --- a/rules.js +++ b/rules.js @@ -269,13 +269,18 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { +//console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { + //console.log('argument undefined') view.actions[action] = 1 } else { - if (!(action in view.actions)) + if (!(action in view.actions)) { + //console.log('push argument') view.actions[action] = [] + } view.actions[action].push(argument) } + //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_space(space){ @@ -2621,7 +2626,7 @@ function valid_spaces_setup() { game.valid_spaces = [] let valid_spaces_set = new Set(); //console.log('in vs setup, state', game.state) - for (let i =1 ; i <= 75 ; i++) { + for (let i =0 ; i <= 74 ; i++) { space = spaces[i] if (game.state === 'com_init') { @@ -2646,7 +2651,7 @@ function valid_spaces_sc() { let valid_spaces_set = new Set(); //console.log('valid spaces sc, persistent events', game.persistent_events) - for (let i = 1 ; i <= 75; i++) { + for (let i = 0 ; i <= 74; i++) { space = spaces[i] if (game.active === DEM) { @@ -2658,13 +2663,13 @@ function valid_spaces_sc() { infl = game.demInfl[i] if (infl !== 0 ) { // Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + if (game.persistent_events.includes(2) && space.space_id === 13) {continue} // Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + if (game.persistent_events.includes(90) && space.space_id === 29) {continue} // Check We Are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + if (game.persistent_events.includes(48) && space.space_id === 8) {continue} //Check for Foreign Currency Debt Burden if (game.persistent_events.includes(49) && space.country === game.foreign_currency_debt_burden) {continue} { @@ -2689,7 +2694,7 @@ function valid_spaces_sc() { function valid_spaces_support_loss() { let valid_spaces_set = new Set(); - for (let i = 1; i < game.demInfl.length; i++) { + for (let i = 0; i < game.demInfl.length; i++) { //console.log('spaces.length', game.demInfl.length, 'i', i) space = spaces[i] if (game.active === DEM) { @@ -2746,7 +2751,7 @@ function valid_spaces_infl() { let valid_spaces_set = new Set(); // Iterate over all spaces to find the ones with the player's influence - for (let i = 1; i < game.demInfl.length; i++) { + for (let i = 0; i < game.demInfl.length; i++) { //piece = game.pieces[i] space = spaces[i] @@ -3034,7 +3039,7 @@ function check_presence(country) { let com_leaders = {1: false, 4: false, 5: false, 6: false, 7: false}; - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === country) { @@ -3549,7 +3554,7 @@ function finish_the_wall() { if (check_vp()) { return } - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === 'East_Germany' && game.comInfl[i] > 0){ game.valid_spaces.push(space.space_id) @@ -3623,7 +3628,7 @@ function end_round() { return [...new Set(duplicates)]; } - //console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) + console.log('game.strategy_deck', game.strategy_deck, 'game.strategy_discard', game.strategy_discard, 'game.strategy_removed', game.strategy_removed, 'game.table_cards', game.table_cards, 'game.communist_hand', game.communist_hand, 'game.democrat_hand', game.democrat_hand) if (check_duplicates(card_check)) { console.log('card check', card_check) @@ -4629,13 +4634,21 @@ function vm_opp_hand_false() { } function vm_valid_spaces() { - let space_1 = vm_operand(1) - let space_2 = vm_operand(2) - let space_3 = vm_operand(3) - let space_4 = vm_operand(4) - let space_5 = vm_operand(5) - let space_6 = vm_operand(6) - game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] + let space_1 + let space_2 + let space_3 + let space_4 + let space_5 + let space_6 + + if (vm_operand(1)) { space_1 = spaces.find(space => space.ascii_name === vm_operand(1)).space_id} + if (vm_operand(2)) { space_2 = spaces.find(space => space.ascii_name === vm_operand(2)).space_id} + if (vm_operand(3)) { space_3 = spaces.find(space => space.ascii_name === vm_operand(3)).space_id} + if (vm_operand(4)) { space_4 = spaces.find(space => space.ascii_name === vm_operand(4)).space_id} + if (vm_operand(5)) { space_5 = spaces.find(space => space.ascii_name === vm_operand(5)).space_id} + if (vm_operand(6)) { space_6 = spaces.find(space => space.ascii_name === vm_operand(6)).space_id} + + game.valid_spaces = [space_1, space_2, space_3, space_4, space_5, space_6] game.valid_spaces = game.valid_spaces.filter( n => n ) // Check for Systematization - may not use this space @@ -4646,7 +4659,7 @@ function vm_valid_spaces() { function vm_valid_spaces_opponent () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.active === DEM) { @@ -4668,7 +4681,7 @@ function vm_valid_spaces_opponent () { function vm_valid_spaces_socio () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === vm_operand(1)) { @@ -4686,7 +4699,7 @@ function vm_valid_spaces_socio () { function vm_valid_spaces_opponent_socio () { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.active === DEM) { @@ -4772,13 +4785,13 @@ function vm_valid_spaces_country_sc () { } else { if (space.country === country && game.demInfl[space.space_id] >0) { //Check Solidarity Legalised - if (game.persistent_events.includes(2) && space.space_id === 14) {continue} + if (game.persistent_events.includes(2) && space.space_id === 13) {continue} //Check Civic Forum - if (game.persistent_events.includes(90) && space.space_id === 30) {continue} + if (game.persistent_events.includes(90) && space.space_id === 29) {continue} //Check We are the People - if (game.persistent_events.includes(48) && space.space_id === 9) {continue} + if (game.persistent_events.includes(48) && space.space_id === 8) {continue} valid_spaces.push(space.space_id); //Check Foreign Currency Debt Burden @@ -4834,7 +4847,7 @@ function vm_valid_spaces_region_opp() { function vm_valid_spaces_solidarity_legalised() { let valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] let uncontrolled = (!check_control(i) && !check_opp_control(i)) if ((space.country === 'Poland' && uncontrolled && space.socio === 3) || (space.country === 'Poland' && uncontrolled && space.socio === 4)) { @@ -5319,8 +5332,8 @@ function vm_breakaway_baltic_republics() { } game.playable_cards.push(109) game.playable_cards = game.playable_cards.filter(n => n !== 14) - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70)) {game.valid_spaces.push(70)} + if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)} + if (!check_dem_control(69)) {game.valid_spaces.push(69)} vm_next() } @@ -5346,13 +5359,19 @@ function vm_bulgarian_turks_expelled(){ function vm_ceausescu() { let adj_cluj = false - if (game.demInfl[50] > 0 ) {adj_cluj = true} - if (game.demInfl[54] > 0 ) {adj_cluj = true} - if (game.demInfl[58] > 0 ) {adj_cluj = true} - if (game.demInfl[61] > 0 ) {adj_cluj = true} + let Timisoara = spaces.find(space => space.ascii_name === "Timisoara").space_id + let Babes = spaces.find(space => space.ascii_name === "Babes-Bolyai University").space_id + let Church = spaces.find(space => space.ascii_name === "Orthodox Church, Romania").space_id + let Bucuresti = spaces.find(space => space.ascii_name === "Bucuresti").space_id + - if (adj_cluj && game.comInfl[61]>0) { - game.valid_spaces = [61] + if (game.demInfl[Timisoara] > 0 ) {adj_cluj = true} + if (game.demInfl[Babes] > 0 ) {adj_cluj = true} + if (game.demInfl[Church] > 0 ) {adj_cluj = true} + if (game.demInfl[Bucuresti] > 0 ) {adj_cluj = true} + + if (adj_cluj && game.comInfl[Bucuresti]>0) { + game.valid_spaces = [60] game.vm_available_ops = 1 //next_player() game.remove_opponent_infl = false @@ -5372,7 +5391,7 @@ function vm_civic_forum() { return } game.persistent_events.push(90) - if (check_dem_control(31)) { + if (check_dem_control(30)) { vm_next() } else { permanently_remove(90) @@ -5451,20 +5470,20 @@ function vm_eliminate(space_id) { //console.log('adjacency before: Iasi', game.pieces[53].adjacent, 'Ploesti:', game.pieces[59].adjacent, 'Bucharesti:', game.pieces[61].adjacent) // Eliminate the democrat influence and move the communist influence to Bucuresti - if (space_id === 61) { + if (space_id === 60) { game.demInfl[space_id] = 0 game.comInfl[space_id] = 0 } else { game.demInfl[space_id] = 0 - game.comInfl[61] += game.comInfl[space_id] + game.comInfl[60] += game.comInfl[space_id] if (game.comInfl[space_id] > 0 ) { - log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %61`) + log(`${pluralize(game.comInfl[space_id],'Communist SP')} relocated to %60`) } game.comInfl[space_id] = 0 } //Update control in the eliminated space and in Bucuresti check_control_change(space_id) - check_control_change(61) + check_control_change(60) } @@ -5509,8 +5528,8 @@ function vm_foreign_currency_debt_burden() { } function vm_foreign_television() { - for (let i = 1 ; i < spaces.length; i++) { - if (i === 12) {continue} /*Does not apply to Dresden*/ + for (let i = 0 ; i < spaces.length; i++) { + if (i === 11) {continue} /*Does not apply to Dresden*/ if (game.comInfl[i] > 0 ) { game.valid_spaces.push(i) } @@ -5560,7 +5579,7 @@ function vm_goodbye_lenin() { } function vm_government_resigns() { - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === 1 && game.comInfl[i] > 0 && !check_control(i)) { game.valid_spaces.push(i) @@ -5643,7 +5662,7 @@ function vm_kiss_of_death() { } function vm_klaus_and_komarek() { - if (game.comInfl[29] > 0 ) {game.valid_spaces = [29]} + if (game.comInfl[28] > 0 ) {game.valid_spaces = [28]} vm_next() } @@ -5694,7 +5713,7 @@ function vm_legacy_of_martial_law() { } function vm_legacy_of_1968() { - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if ((!check_com_control(i) && space.country === 'Czechoslovakia')) { game.valid_spaces.push(space.space_id); @@ -5730,8 +5749,8 @@ function vm_modrow() { } function vm_nagy_reburied(){ - if (game.comInfl[43] > 0) { - game.valid_spaces.push(43) + if (game.comInfl[42] > 0) { + game.valid_spaces.push(42) } vm_next() } @@ -5756,8 +5775,8 @@ function vm_nomenklatura() { } function vm_normalisation() { - if (game.demInfl[27] >0) {game.valid_spaces.push(27)} - if (game.demInfl[29] > 0) {game.valid_spaces.push(29)} + if (game.demInfl[26] >0) {game.valid_spaces.push(26)} + if (game.demInfl[28] > 0) {game.valid_spaces.push(28)} game.remove_opponent_infl = true vm_next() } @@ -5840,7 +5859,7 @@ function vm_prudence() { function vm_public_against_violence() { game.valid_spaces = [] - if (game.comInfl[34] > 0 ) {game.valid_spaces.push(34)} + if (game.comInfl[33] > 0 ) {game.valid_spaces.push(33)} vm_next() } @@ -5867,11 +5886,11 @@ function vm_roundtable_talks() { } function vm_sajudis_check() { - if (!check_dem_control(56)) { - game.valid_spaces.push(56) + if (!check_dem_control(55)) { + game.valid_spaces.push(55) } - if (!check_dem_control(70)) { - game.valid_spaces.push(70) + if (!check_dem_control(69)) { + game.valid_spaces.push(69) } vm_next() } @@ -5960,8 +5979,8 @@ function vm_tear_gas () { function vm_the_baltic_way() { game.playable_cards.push(84) game.stability++ - if (!check_dem_control(56) && game.systematization !== 56) {game.valid_spaces.push(56)} - if (!check_dem_control(70) && game.systematization !== 70) {game.valid_spaces.push(70)} + if (!check_dem_control(55) && game.systematization !== 55) {game.valid_spaces.push(55)} + if (!check_dem_control(69) ) {game.valid_spaces.push(69)} log('+3 VP') game.vp += 3 if (check_vp()) { @@ -5982,8 +6001,8 @@ function vm_the_crowd_turns_against_ceausescu() { } function vm_the_monday_demonstrations() { - if (!check_dem_control(6)) {game.valid_spaces.push(6)} - if (!check_dem_control(9)) {game.valid_spaces.push(9)} + if (!check_dem_control(5)) {game.valid_spaces.push(5)} + if (!check_dem_control(8)) {game.valid_spaces.push(8)} vm_next() } @@ -6000,7 +6019,7 @@ function vm_the_third_way() { function vm_the_tyrant_is_gone() { game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.demInfl[i] === 0 && space.country === 'Romania') { if (space.space_id === game.systematization) {continue} @@ -6046,12 +6065,12 @@ function vm_warsaw_pact_summit() { } function vm_we_are_the_people() { - if (game.demInfl[6] > 0) {game.valid_spaces = [6]} - game.persistent_events.push(48) + if (game.demInfl[5] > 0) {game.valid_spaces = [5]} + game.persistent_events.push(48) if (!game.vm_influence_added) { game.vm_influence_added = {}; } - game.vm_influence_added[6] = 0 + game.vm_influence_added[5] = 0 game.vm_available_ops = 4 game.state = 'vm_we_are_the_people_remove' } @@ -6871,39 +6890,39 @@ states.vm_central_committee_reshuffle = { if (!game.revolutions[5]) {gen_action('romania')} } }, - east_germany() { + east_germany() { /*Updated for zero index spaces*/ push_undo() game.vm_active_country = "East_Germany" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [1,2,3,4,5,6,7,8,9,10,11,12] + game.valid_spaces = [0,1,2,3,4,5,6,7,8,9,10,11] vm_next() }, poland() { push_undo() game.vm_active_country = "Poland" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [13,14,15,16,17,18,19,20,21,22,23,24,25,26] + game.valid_spaces = [12,13,14,15,16,17,18,19,20,21,22,23,24,25] vm_next() }, czechoslovakia() { push_undo() game.vm_active_country = "Czechoslovakia" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [27,28,29,30,31,32,33,34,35,36,37] + game.valid_spaces = [26,27,28,29,30,31,32,33,34,35,36] vm_next() }, hungary() { push_undo() game.vm_active_country = "Hungary" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [38,39,40,41,42,43,44,45,46,47,48,49] + game.valid_spaces = [37,38,39,40,41,42,43,44,45,46,47,48] vm_next() }, romania() { push_undo() game.vm_active_country = "Romania" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [50,51,52,53,54,55,56,57,58,59,60,61,62,63] + game.valid_spaces = [49,50,51,52,53,54,55,56,57,58,59,60,61,62] game.valid_spaces = game.valid_spaces.filter(space => space !== game.systematization) vm_next() }, @@ -6911,7 +6930,7 @@ states.vm_central_committee_reshuffle = { push_undo() game.vm_active_country = "Bulgaria" log(`Chose ${country_name(game.vm_active_country)}`) - game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75] + game.valid_spaces = [63,64,65,66,67,68,69,70,71,72,73,74] vm_next() }, pass() { @@ -7310,10 +7329,6 @@ states.vm_goodbye_lenin_ops = { influence(){ push_undo() game.vm_available_ops = get_card_ops(this_card()) - /*if (game.persistent_events.includes(50)) { - log(`+1 from C50`) - game.vm_available_ops++ - }*/ valid_spaces_infl() // If ABHR - Set AHBR tracker to true @@ -7644,22 +7659,22 @@ states.vm_kremlin_coup_take_control = { space(space) { push_undo() vm_take_control(space) - if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + if (game.vm_active_country === 'East_Germany') {game.selected_space = 2 } + if (game.vm_active_country === 'Poland') {game.selected_space = 16} + if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 28} + if (game.vm_active_country === 'Hungary') {game.selected_space = 44} + if (game.vm_active_country === 'Romania') {game.selected_space = 60} + if (game.vm_active_country === 'Bulgaria') {game.selected_space = 67} game.state = 'vm_kremlin_coup_sc_prep' }, done() { push_undo() - if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 } - if (game.vm_active_country === 'Poland') {game.selected_space = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 29} - if (game.vm_active_country === 'Hungary') {game.selected_space = 45} - if (game.vm_active_country === 'Romania') {game.selected_space = 61} - if (game.vm_active_country === 'Bulgaria') {game.selected_space = 68} + if (game.vm_active_country === 'East_Germany') {game.selected_space = 2 } + if (game.vm_active_country === 'Poland') {game.selected_space = 16} + if (game.vm_active_country === 'Czechoslovakia') {game.selected_space = 28} + if (game.vm_active_country === 'Hungary') {game.selected_space = 44} + if (game.vm_active_country === 'Romania') {game.selected_space = 60} + if (game.vm_active_country === 'Bulgaria') {game.selected_space = 67} game.state = 'vm_kremlin_coup_sc_prep' } } @@ -7801,12 +7816,12 @@ states.vm_malta_summit = { if (check_vp()) { return } - if (game.comInfl[12] > 0 ) {game.valid_spaces.push(12)} - if (game.comInfl[15] > 0 ) {game.valid_spaces.push(15)} - if (game.comInfl[27] > 0 ) {game.valid_spaces.push(27)} - if (game.comInfl[43] > 0 ) {game.valid_spaces.push(43)} - if (game.comInfl[51] > 0 ) {game.valid_spaces.push(51)} - if (game.comInfl[69] > 0 ) {game.valid_spaces.push(69)} + if (game.comInfl[11] > 0 ) {game.valid_spaces.push(11)} + if (game.comInfl[14] > 0 ) {game.valid_spaces.push(14)} + if (game.comInfl[26] > 0 ) {game.valid_spaces.push(26)} + if (game.comInfl[42] > 0 ) {game.valid_spaces.push(42)} + if (game.comInfl[50] > 0 ) {game.valid_spaces.push(50)} + if (game.comInfl[68] > 0 ) {game.valid_spaces.push(68)} //game.vm_available_ops = 5 game.remove_opponent_infl = true vm_next() @@ -7928,7 +7943,7 @@ states.vm_nomenklatura = { remove() { push_undo() game.valid_spaces = [] - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.socio === 1 && game.demInfl[i] > 0) { @@ -8457,7 +8472,7 @@ states.vm_the_wall_must_go = { if (check_vp()) { return } - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (space.country === 'East_Germany' && game.comInfl[i] > 0){ game.valid_spaces.push(space.space_id) @@ -8491,7 +8506,7 @@ states.vm_warsaw_pact_summit = { }, influence(){ push_undo() - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.demInfl[i] === 0) { game.valid_spaces.push(space.space_id); @@ -8504,7 +8519,7 @@ states.vm_warsaw_pact_summit = { }, support_check(){ push_undo() - for (let i = 1; i < spaces.length; i++) { + for (let i = 0; i < spaces.length; i++) { let space = spaces[i] if (game.demInfl[i] > 0 && (space.socio === 5 || space.socio === 6)) { game.valid_spaces.push(space.space_id) @@ -8521,7 +8536,7 @@ states.vm_we_are_the_people_remove = { return `resolve ${clean_name(cards[game.played_card].name)}.` }, prompt() { - if (game.demInfl[6] === 0 && game.vm_available_ops > 0) { + if (game.demInfl[5] === 0 && game.vm_available_ops > 0) { view.prompt = '"We are the People!": no SPs to remove.' gen_action('done') } else if (game.vm_available_ops > 0 ) { @@ -8543,11 +8558,11 @@ states.vm_we_are_the_people_remove = { pop_summary() log_br() } - if (!game.vm_influence_added[6]) { + if (!game.vm_influence_added[5]) { log('No SPs removed') vm_next() } else { - game.valid_spaces = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + game.valid_spaces = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] game.state = 'vm_we_are_the_people_add' } } @@ -8563,15 +8578,15 @@ states.vm_we_are_the_people_add = { return }*/ - view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[6],'SP')} to spaces in Germany.` + view.prompt = `"We are the People!": you must add the ${pluralize(game.vm_influence_added[5],'SP')} to spaces in Germany.` for (let space_id of game.valid_spaces) { gen_action_space(space_id); } }, space(space) { vm_do_add_infl_free(space) - game.vm_influence_added[6]-- - if (game.vm_influence_added[6] === 0 ) { + game.vm_influence_added[5]-- + if (game.vm_influence_added[5] === 0 ) { game.valid_spaces = [] if (game.summary.length > 0) { pop_summary() @@ -9011,7 +9026,6 @@ states.vm_support_falters = { /* =================== EVENTS ================================ */ // #region GENERATED EVENT CODE - const CODE = [] CODE[1] = [ // Legacy of Martial Law* @@ -9047,7 +9061,7 @@ CODE[3] = [ // Walesa CODE[4] = [ // Michnik [ vm_permanently_remove ], - [ vm_valid_spaces, 26 ], + [ vm_valid_spaces, 'Polish Writers' ], [ vm_prompt, 'the Polish Intellectuals space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9150,7 +9164,7 @@ CODE[18] = [ // Poszgay Defends the Revolution CODE[19] = [ // Papal vist [ vm_permanently_remove ], - [ vm_valid_spaces, 20, 35, 38 ], + [ vm_valid_spaces, 'Catholic Church, Poland', 'Catholic Church, Czechoslovakia', 'Catholic Church, Hungary' ], [ vm_prompt, 'any Catholic Church space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9179,7 +9193,7 @@ CODE[23] = [ // Power Struggle - Hungary CODE[24] = [ // St Nicolas Church [ vm_permanently_remove ], - [ vm_valid_spaces, 6 ], + [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], [ vm_st_nicholas_church ], @@ -9218,7 +9232,7 @@ CODE[28] = [ // Factory Party Cells CODE[29] = [ // Jan Palach Week* [ vm_permanently_remove ], - [ vm_valid_spaces, 30 ], + [ vm_valid_spaces, 'Charles University' ], [ vm_prompt, 'the Charles University space' ], [ vm_add_x_infl, 6 ], [ vm_return ], @@ -9230,7 +9244,7 @@ CODE[30] = [ // Tear Gas ] CODE[31] = [ // Intelligentsia - [ vm_valid_spaces, 4, 26, 31, 46, 55, 73 ], + [ vm_valid_spaces_socio, 5 ], [ vm_prompt, 'Intellectual spaces, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], [ vm_return ], @@ -9255,7 +9269,7 @@ CODE[33] = [ // Sajudis* CODE[34] = [ // Fidesz* [ vm_permanently_remove ], - [ vm_valid_spaces, 47 ], + [ vm_valid_spaces, 'Eotvos Lorand University' ], [ vm_prompt, 'the Hungary students space' ], [ vm_add_x_infl, 5 ], [ vm_return ], @@ -9295,7 +9309,7 @@ CODE[38] = [ // July Concept CODE[39] = [ // Eco-Glasnost* [ vm_permanently_remove ], - [ vm_valid_spaces, 66 ], + [ vm_valid_spaces, 'Ruse' ], [ vm_prompt, 'Ruse' ], [ vm_add_x_infl, 4 ], [ vm_eco_glasnost ], @@ -9516,7 +9530,7 @@ CODE[68] = [ // Klaus and Komarek* [ vm_klaus_and_komarek ], [ vm_prompt, 'Prague' ], [ vm_remove_x_opp_infl, 2 ], - [ vm_valid_spaces, 29 ], + [ vm_valid_spaces, 'Praha' ], [ vm_add_x_infl, 2 ], [ vm_return ], ] @@ -9546,7 +9560,7 @@ CODE[72] = [ // Peasant Parties Revolt CODE[73] = [ // Laszlo Tokes* [ vm_permanently_remove ], - [ vm_valid_spaces, 50, 56 ], + [ vm_valid_spaces, 'Timisoara', 'Harghita/Covasna' ], [ vm_prompt, 'in Timisoara and Harghita/Covasna' ], [ vm_add_limited_infl, 2, 1 ], [ vm_laszlo_tokes ], @@ -9579,7 +9593,7 @@ CODE[76] = [ // Warsaw Pact Summit [ vm_add_infl_free, 4 ], [ vm_else ], [ vm_prompt, 'Select a Student or Intellectual space' ], - [ vm_valid_spaces_country_socio_2, 3,, 4 ], + [ vm_valid_spaces_country_socio_2, 3, 4 ], [ vm_support_check_modified, 2, 2 ], [ vm_endif ], [ vm_return ], @@ -9599,7 +9613,7 @@ CODE[78] = [ // Workers Revolt CODE[79] = [ // The Third Way* [ vm_permanently_remove ], [ vm_the_third_way ], - [ vm_valid_spaces, 4 ], + [ vm_valid_spaces, 'German Writers' ], [ vm_prompt, 'the East German Writers space' ], [ vm_add_x_infl, 3 ], [ vm_return ], @@ -9751,7 +9765,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(54) ], - [ vm_valid_spaces, 51 ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -9788,7 +9802,7 @@ CODE[100] = [ // Stand Fast* CODE[101] = [ // Elena* [ vm_permanently_remove ], [ vm_if, ()=>!game.the_tyrant_is_gone ], - [ vm_valid_spaces, 51 ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], [ vm_elena ], @@ -9818,10 +9832,10 @@ CODE[104] = [ // New Year's Eve Party* CODE[105] = [ // Public Against Violence* [ vm_permanently_remove ], - [ vm_valid_spaces, 36 ], + [ vm_valid_spaces, 'Kosice' ], [ vm_prompt, 'Kosice' ], [ vm_add_x_infl, 2 ], - [ vm_valid_spaces, 37 ], + [ vm_valid_spaces, 'Presov' ], [ vm_prompt, 'Presov' ], [ vm_add_x_infl, 2 ], [ vm_public_against_violence ], @@ -9915,3 +9929,4 @@ CODE[351] = [ // Support Falters [ vm_return ], ] // #endregion + -- cgit v1.2.3 From c2df9cc16c98db5286509e2bf6deef028b111fac Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 26 Oct 2024 15:14:48 +0100 Subject: New power cards --- data.js | 106 ++++++++++++++++++++++++++++++------------------------------- events.txt | 16 +++++----- play.css | 4 +-- play.js | 6 ++-- rules.js | 79 +++++++++++++++++++++++++++------------------ 5 files changed, 113 insertions(+), 98 deletions(-) (limited to 'events.txt') diff --git a/data.js b/data.js index c8194f1..17291e8 100644 --- a/data.js +++ b/data.js @@ -1391,60 +1391,58 @@ const cards = [ const power_cards = [ null, -{number: 1, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 2, name: 'Strike', value: 6, socio: 0, url: 'ps2'}, -{number: 3, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 4, name: 'Strike', value: 5, socio: 0, url: 'ps3'}, -{number: 5, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 6, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 7, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 8, name: 'Strike', value: 4, socio: 0, url: 'ps4'}, -{number: 9, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 10, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 11, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 12, name: 'Strike', value: 3, socio: 0, url: 'ps5'}, -{number: 13, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 14, name: 'March', value: 6, socio: 0, url: 'ps6'}, -{number: 15, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 16, name: 'March', value: 5, socio: 0, url: 'ps7'}, -{number: 17, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 18, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 19, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 20, name: 'March', value: 4, socio: 0, url: 'ps8'}, -{number: 21, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 22, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 23, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 24, name: 'March', value: 3, socio: 0, url: 'ps9'}, -{number: 25, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 26, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 27, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 28, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 29, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 30, name: 'Rally in the Square', value: 1, socio: 0, url: 'ps1'}, -{number: 31, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 32, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 33, name: 'Petition', value: 6, socio: 0, url: 'ps10'}, -{number: 34, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 35, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 36, name: 'Petition', value: 5, socio: 0, url: 'ps11'}, -{number: 37, name: 'Elite Leader', value: 3, socio: 1, url: 'ps16'}, -{number: 38, name: 'Elite Leader', value: 3, socio: 1, url: 'ps17'}, -{number: 39, name: 'Elite Leader', value: 3, socio: 1, url: 'ps18'}, -{number: 40, name: 'Elite Leader', value: 3, socio: 1, url: 'ps19'}, -{number: 41, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps12'}, -{number: 42, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps13'}, -{number: 43, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps14'}, -{number: 44, name: 'Intellectual Leader', value: 3, socio: 5, url: 'ps15'}, -{number: 45, name: 'Worker Leader', value: 3, socio: 4, url: 'ps20'}, -{number: 46, name: 'Worker Leader', value: 3, socio: 4, url: 'ps21'}, -{number: 47, name: 'Church Leader', value: 3, socio: 7, url: 'ps23'}, -{number: 48, name: 'Student Leader', value: 3, socio: 6, url: 'ps22'}, -{number: 49, name: 'Scare Tactics', value: '', socio: 0, url: 'ps26'}, -{number: 50, name: 'Support Surges', value: '', socio: 0, url: 'ps25'}, -{number: 51, name: 'Support Falters', value: '', socio: 0, url: 'ps24'}, -{number: 52, name: 'Tactic Fails', value: '', socio: 0, url: 'ps27'}, -{number: 53, name: 'Rally in the Square', value: 3, socio: 0, url: 'ps1'}, -{number: 54, name: 'Petition', value: 3, socio: 0, url: 'ps10'}, +{number: 1, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 2, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 3, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 4, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 5, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 6, name: 'Rally in the Square', value: 1, socio: 0}, +{number: 7, name: 'Strike', value: 6, socio: 0}, +{number: 8, name: 'Strike', value: 6, socio: 0}, +{number: 9, name: 'Strike', value: 5, socio: 0}, +{number: 10, name: 'Strike', value: 5, socio: 0}, +{number: 11, name: 'Strike', value: 4, socio: 0}, +{number: 12, name: 'Strike', value: 4, socio: 0}, +{number: 13, name: 'Strike', value: 4, socio: 0}, +{number: 14, name: 'Strike', value: 3, socio: 0}, +{number: 15, name: 'Strike', value: 3, socio: 0}, +{number: 16, name: 'Strike', value: 3, socio: 0}, +{number: 17, name: 'Strike', value: 3, socio: 0}, +{number: 18, name: 'Strike', value: 4, socio: 0}, +{number: 19, name: 'March', value: 6, socio: 0}, +{number: 20, name: 'March', value: 6, socio: 0}, +{number: 21, name: 'March', value: 5, socio: 0}, +{number: 22, name: 'March', value: 5, socio: 0}, +{number: 23, name: 'March', value: 4, socio: 0}, +{number: 24, name: 'March', value: 4, socio: 0}, +{number: 25, name: 'March', value: 4, socio: 0}, +{number: 26, name: 'March', value: 4, socio: 0}, +{number: 27, name: 'March', value: 3, socio: 0}, +{number: 28, name: 'March', value: 3, socio: 0}, +{number: 29, name: 'March', value: 3, socio: 0}, +{number: 30, name: 'March', value: 3, socio: 0}, +{number: 31, name: 'Petition', value: 6, socio: 0}, +{number: 32, name: 'Petition', value: 6, socio: 0}, +{number: 33, name: 'Petition', value: 6, socio: 0}, +{number: 34, name: 'Petition', value: 5, socio: 0}, +{number: 35, name: 'Petition', value: 5, socio: 0}, +{number: 36, name: 'Petition', value: 5, socio: 0}, +{number: 37, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 38, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 39, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 40, name: 'Intellectual Leader', value: 3, socio: 5}, +{number: 41, name: 'Elite Leader', value: 3, socio: 1}, +{number: 42, name: 'Elite Leader', value: 3, socio: 1}, +{number: 43, name: 'Elite Leader', value: 3, socio: 1}, +{number: 44, name: 'Elite Leader', value: 3, socio: 1}, +{number: 45, name: 'Worker Leader', value: 3, socio: 4}, +{number: 46, name: 'Worker Leader', value: 3, socio: 4}, +{number: 47, name: 'Student Leader', value: 3, socio: 6}, +{number: 48, name: 'Church Leader', value: 3, socio: 7}, +{number: 49, name: 'Support Falters', value: '', socio: 0}, +{number: 50, name: 'Support Surges', value: '', socio: 0}, +{number: 51, name: 'Scare Tactics', value: '', socio: 0}, +{number: 52, name: 'Tactic Fails', value: '', socio: 0}, ] if (typeof module !== 'undefined') module.exports = { spaces, cards, power_cards } diff --git a/events.txt b/events.txt index 82d3c59..eaf585d 100644 --- a/events.txt +++ b/events.txt @@ -880,15 +880,15 @@ tst_8 #// ============= POWER STRUGGLE WILDCARDS ========================= -CARD 349 - Scare Tactics -scare_tactics -valid_spaces_country_opp -prompt ()=>` from ${country_name(game.vm_active_country)}` -remove_opp_infl 1 + +CARD 349 - Support Falters +support_falters CARD 350 - Support Surges support_surges -CARD 351 - Support Falters -support_falters - +CARD 351 - Scare Tactics +scare_tactics +valid_spaces_country_opp +prompt ()=>` from ${country_name(game.vm_active_country)}` +remove_opp_infl 1 \ No newline at end of file diff --git a/play.css b/play.css index 1a9b4dd..ec93266 100644 --- a/play.css +++ b/play.css @@ -391,11 +391,11 @@ body.Communist header.your_turn { background-color: hsl(355, 70%, 75%); } .card.power_11 { background-image: url(cards100/power_11.webp) } .card.power_12 { background-image: url(cards100/power_12.webp) } .card.power_13 { background-image: url(cards100/power_13.webp) } -.card.power_14 { background-image: url(cards100/power_14.webp) } +.card.power_14 { background-image: url(cards100/power_18.webp) } .card.power_15 { background-image: url(cards100/power_15.webp) } .card.power_16 { background-image: url(cards100/power_16.webp) } .card.power_17 { background-image: url(cards100/power_17.webp) } -.card.power_18 { background-image: url(cards100/power_18.webp) } +.card.power_18 { background-image: url(cards100/power_14.webp) } .card.power_19 { background-image: url(cards100/power_19.webp) } .card.power_20 { background-image: url(cards100/power_20.webp) } .card.power_21 { background-image: url(cards100/power_21.webp) } diff --git a/play.js b/play.js index dc2c592..03f58f5 100644 --- a/play.js +++ b/play.js @@ -20,7 +20,7 @@ function on_click_action(evt) { const last_space = 74 const last_card = 110 -const last_power_card = 52 +const last_power_card = 54 const countries = [ "Poland", "Hungary", "East_Germany", "Bulgaria", "Czechoslovakia", "Romania" ] const board_events = [ 2, 9, 69, 97 ] @@ -273,9 +273,9 @@ function layout_country(id) { for (let i = 0; i < 6; i++) { // TODO: what number to display? if (view.revolutions[id]) - ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] - else if (view.times_held[id] > 0) ui.countries[id].className = "marker demInfl ctl v" + view.times_held[id] + else if (view.times_held[id] > 0) + ui.countries[id].className = "marker comInfl ctl v" + view.times_held[id] else ui.countries[id].className = "marker hide" } diff --git a/rules.js b/rules.js index a691129..bebde72 100644 --- a/rules.js +++ b/rules.js @@ -18,9 +18,9 @@ const leaders = [1, 4, 5, 6, 7] const support_loss_roll = [0, 0, 1, 1, 2, 2, 3, 4] const vp_roll = [0, 0, 1, 1, 2, 2, 3, 4] const countries = ['Poland', 'Hungary', 'East_Germany', 'Bulgaria', 'Czechoslovakia', 'Romania'] -const elite_spaces = [12, 15, 27, 43, 51, 69] +const elite_spaces = [11, 14, 26, 42, 50, 68] const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] -const numberless_cards = [25, 26, 27, 28, 29, 30, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52] +const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] @@ -194,9 +194,9 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card - } else { - view.strategy_discard = game.strategy_discard - } + } + view.strategy_discard = game.strategy_discard + if (player === game.active && game.vm && game.vm.draw) view.drawn = game.vm.draw @@ -1276,7 +1276,7 @@ states.raise_stakes_1 = { inactive: 'raise the stakes.', prompt () { - // console.log('raise stakes 1 - valid cards', game.valid_cards) + console.log('raise stakes 1 - com hand', game.com_pwr_hand, 'dem hand', game.dem_pwr_hand) // console.log('raise the stakes: game.played_power_card', game.played_power_card, 'game.active', game.active, 'game.view_opp_hand', game.view_opp_hand) if ((game.active === DEM && game.dem_pwr_hand < 3) || (game.active === COM && game.com_pwr_hand < 3)) { view.prompt = 'Raise the stakes: you must pass.' @@ -1421,13 +1421,21 @@ states.power_struggle = { } if (game.phase === 1) { if (game.valid_cards.length > 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` - gen_action('concede') + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must match or concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must match or concede.` + } + gen_action('concede') for (let card of game.valid_cards) { gen_action_power_card(card) } } else if (game.valid_cards.length === 0) { - view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + if (leader_cards.includes(game.played_power_card)) { + view.prompt = `${power_cards[game.played_power_card].name} played as a ${game.proxy_power_card}. You must concede.` + } else { + view.prompt = `${power_cards[game.played_power_card].name} played. You must concede.` + } gen_action('concede') } } @@ -1448,6 +1456,7 @@ states.power_struggle = { discard(card) game.valid_cards=[] game.return_state = 'power_struggle' + if (game.phase === 0) {delete game.proxy_power_card} if (card === 52) { log_gap(`Played P52: P${power_cards[game.played_power_card].number} no longer playable`) @@ -1463,9 +1472,9 @@ states.power_struggle = { if (card >= 37 && card <= 48) { /*When a leader is played */ game.played_power_card = card game.phase = 3 - } else if (card === 49){ /*Scare Tactics */ + } else if (card === 51){ /*Scare Tactics */ game.return = '' - goto_vm(349) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ + goto_vm(351) /*Can I combine these 3 into a single stage where you goto_vm(300 + card) ? */ } else if (card === 50) { /*Support Surges */ if (game.active === DEM) { game.return = COM @@ -1473,9 +1482,9 @@ states.power_struggle = { game.return = DEM } goto_vm(350) - } else if (game.phase === 0 && card === 51) { /*Support Falters */ + } else if (game.phase === 0 && card === 49) { /*Support Falters */ next_player() - goto_vm(351) + goto_vm(349) } else { game.played_power_card = card game.phase = 1 @@ -1527,28 +1536,28 @@ states.power_struggle = { }, strike () { log(`Played: P${power_cards[game.played_power_card].number} as a Strike`) - game.played_power_card = 9 + game.proxy_power_card = 'Strike' game.phase = 1 next_player() do_valid_cards() }, march () { log(`Played: P${power_cards[game.played_power_card].number} as a March`) - game.played_power_card = 21 + game.proxy_power_card = 'March' game.phase = 1 next_player() do_valid_cards() }, rally () { log(`Played: P${power_cards[game.played_power_card].number} as a Rally in the Square`) - game.played_power_card = 53 + game.proxy_power_card = 'Rally in the Square' game.phase = 1 next_player() do_valid_cards() }, petition () { log(`Played: P${power_cards[game.played_power_card].number} as a Petition`) - game.played_power_card = 54 + game.proxy_power_card = 'Petition' game.phase = 1 next_player() do_valid_cards() @@ -1629,8 +1638,8 @@ states.support_loss ={ let rally_win = 0 let petition_win = 0 log(`Roll: D${roll}`) - if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) { rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) { petition_win = 2} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.proxy_power_card === 'Petition') { petition_win = 2} let modified_roll = roll + game.raised_stakes + rally_win - petition_win // Roll modifiers @@ -1647,7 +1656,7 @@ states.support_loss ={ log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -1715,8 +1724,8 @@ states.vp_roll = { log(`Roll: D${roll}`) let rally_win = 0 let petition_win = 0 - if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.played_power_card === 53) {rally_win = 2} - if ((game.played_power_card >= 31 && game.played_power_card <= 36) || game.played_power_card === 54) {petition_win = 2} + if ((game.played_power_card >= 25 && game.played_power_card <= 30) || game.proxy_power_card === 'Rally in the Square') { rally_win = 2} + if ((game.played_power_card >= 31 && game.played_power_card <= 36) || 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(62)) { log('+1 from C62') @@ -1729,7 +1738,7 @@ states.vp_roll = { log(`+${game.raised_stakes} from Raising the Stakes`) } if (rally_win !== 0) { - log('+2 from winning on a P25') + log('+2 from winning on a P1') } if (petition_win !== 0) { log('-2 from winning on a P31') @@ -2810,9 +2819,13 @@ function valid_cards(player_hand, presence) { } else if (game.phase === 1) { for (let c of player_hand) { let card = power_cards.find(card => card && card.number === c); + console.log('card', card, ) if (card.name === power_cards[game.played_power_card].name) { valid_cards_set.add(card.number); - } else if (leaders.includes(card.socio) && presence[card.socio]) { + } else if (card.name === game.proxy_power_card) { + valid_cards_set.add(card.number) + } + else if (leaders.includes(card.socio) && presence[card.socio]) { valid_cards_set.add(card.number); } else if (card.number === 52) {valid_cards_set.add(card.number)} } @@ -9911,11 +9924,8 @@ CODE[208] = [ // Tiananmen Square space 8 event [ vm_return ], ] -CODE[349] = [ // Scare Tactics - [ vm_scare_tactics ], - [ vm_valid_spaces_country_opp ], - [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], - [ vm_remove_opp_infl, 1 ], +CODE[349] = [ // Support Falters + [ vm_support_falters ], [ vm_return ], ] @@ -9924,9 +9934,16 @@ CODE[350] = [ // Support Surges [ vm_return ], ] -CODE[351] = [ // Support Falters - [ vm_support_falters ], +CODE[351] = [ // Scare Tactics + [ vm_scare_tactics ], + [ vm_valid_spaces_country_opp ], + [ vm_prompt, ()=>` from ${country_name(game.vm_active_country)}` ], + [ vm_remove_opp_infl, 1 ], [ vm_return ], ] + + + + // #endregion -- cgit v1.2.3 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 --- rules.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 13 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 diff --git a/rules.js b/rules.js index 54cfd26..0593375 100644 --- a/rules.js +++ b/rules.js @@ -222,6 +222,7 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] +const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 @@ -3752,7 +3753,27 @@ function new_turn() { delete game.selected_space //Remove events that only last one turn - game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + + for (let e of one_turn_events) { + if (game.persistent_events.includes(e)) { + end_one_turn_event(e) + } + } + if (game.prudence) { + delete game.prudence + log_summary(`C${8}`) + } + if (game.summary.length > 0) { + log('No longer in effect:') + pop_summary_i() + log_br() + } + delete game.stasi_card + delete game.stand_fast + +/* TODO: Add log for events no longer in effect */ + + /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) @@ -3795,12 +3816,18 @@ function new_turn() { discard_from_table(63) permanently_remove(63) } + //Stasi + if (game.persistent_events.includes(C_STASI)) { + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + discard_from_table(C_STASI) + log(`C${C_STASI} no longer in effect`) + } //Stand Fast if (game.persistent_events.includes(100)) { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - } + }*/ if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) @@ -3857,6 +3884,12 @@ function new_turn() { } } +function end_one_turn_event(event) { + game.persistent_events = game.persistent_events.filter(n => n !== event) + discard_from_table(event) + log_summary(`C${event}`) +} + function next_player() { clear_undo() if (game.active === DEM) @@ -4020,8 +4053,12 @@ function discard_card(hand) { function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(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) + } else {game.strategy_discard.push(card) } + } } @@ -4214,6 +4251,19 @@ function pop_summary() { game.summary = [] } +function pop_summary_i() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + logi(msg.replace("£ SP", `${n} SPs`)); + } else { + logi(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) @@ -5556,8 +5606,9 @@ function vm_peasant_parties_revolt() { } function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') + game.persistent_events.push(C_PERESTROIKA) + game.table_cards.push(C_PERESTROIKA) + log_msg_gap(`C${C_PERESTROIKA} in effect`) vm_next() } @@ -5687,6 +5738,7 @@ function vm_st_nicholas_church () { function vm_stasi() { log_msg_gap('C13 in effect') + game.table_cards.push(C_STASI) game.persistent_events.push(C_STASI) vm_next() } @@ -5754,7 +5806,8 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap('C50 in effect') + game.table_cards.push(C_THE_SINATRA_DOCTRINE) + log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) vm_next() } @@ -8537,7 +8590,6 @@ CODE[12] = [ // Apparatchicks ] CODE[13] = [ // Stasi - [ vm_permanently_remove ], [ vm_stasi ], [ vm_return ], ] @@ -8615,7 +8667,6 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika - [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] @@ -8818,7 +8869,6 @@ CODE[49] = [ // Foreign Currency Debt Burden* ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_permanently_remove ], [ vm_the_sinatra_doctrine ], [ vm_return ], ] -- 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 From 64fa63421fb188db9c23c244ef6b81335cb10752 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 --- rules.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 13 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 diff --git a/rules.js b/rules.js index 54cfd26..0593375 100644 --- a/rules.js +++ b/rules.js @@ -222,6 +222,7 @@ const all_power_cards = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 ] const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] +const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 @@ -3752,7 +3753,27 @@ function new_turn() { delete game.selected_space //Remove events that only last one turn - game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) + + for (let e of one_turn_events) { + if (game.persistent_events.includes(e)) { + end_one_turn_event(e) + } + } + if (game.prudence) { + delete game.prudence + log_summary(`C${8}`) + } + if (game.summary.length > 0) { + log('No longer in effect:') + pop_summary_i() + log_br() + } + delete game.stasi_card + delete game.stand_fast + +/* TODO: Add log for events no longer in effect */ + + /*game.persistent_events = game.persistent_events.filter(n => n !== C_PERESTROIKA) game.persistent_events = game.persistent_events.filter(n => n !== C_THE_SINATRA_DOCTRINE) game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) game.persistent_events = game.persistent_events.filter(n => n !== C_HONECKER) @@ -3795,12 +3816,18 @@ function new_turn() { discard_from_table(63) permanently_remove(63) } + //Stasi + if (game.persistent_events.includes(C_STASI)) { + game.persistent_events = game.persistent_events.filter(n => n !== C_STASI) + discard_from_table(C_STASI) + log(`C${C_STASI} no longer in effect`) + } //Stand Fast if (game.persistent_events.includes(100)) { game.persistent_events = game.persistent_events.filter(n => n !== 100) delete game.stand_fast log(`C100 no longer in effect`) - } + }*/ if (game.samizdat_card > 0 ) { game.democrat_hand.push(game.samizdat_card) @@ -3857,6 +3884,12 @@ function new_turn() { } } +function end_one_turn_event(event) { + game.persistent_events = game.persistent_events.filter(n => n !== event) + discard_from_table(event) + log_summary(`C${event}`) +} + function next_player() { clear_undo() if (game.active === DEM) @@ -4020,8 +4053,12 @@ function discard_card(hand) { function discard_from_table(card) { let find_card = game.table_cards.indexOf(card) - game.table_cards.splice(find_card, 1) - game.strategy_discard.push(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) + } else {game.strategy_discard.push(card) } + } } @@ -4214,6 +4251,19 @@ function pop_summary() { game.summary = [] } +function pop_summary_i() { + if (game.summary.length > 0) { + for (let [n, msg] of game.summary) { + if (n > 1) { + logi(msg.replace("£ SP", `${n} SPs`)); + } else { + logi(msg.replace("£ SP", `${n} SP`)); + } + } + } + game.summary = [] +} + function log_summary_place(p) { let from = piece_space(p) if (from !== AVAILABLE) @@ -5556,8 +5606,9 @@ function vm_peasant_parties_revolt() { } function vm_perestroika() { - game.persistent_events.push(25) - log_msg_gap('C25 in effect') + game.persistent_events.push(C_PERESTROIKA) + game.table_cards.push(C_PERESTROIKA) + log_msg_gap(`C${C_PERESTROIKA} in effect`) vm_next() } @@ -5687,6 +5738,7 @@ function vm_st_nicholas_church () { function vm_stasi() { log_msg_gap('C13 in effect') + game.table_cards.push(C_STASI) game.persistent_events.push(C_STASI) vm_next() } @@ -5754,7 +5806,8 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { game.persistent_events.push(C_THE_SINATRA_DOCTRINE) - log_msg_gap('C50 in effect') + game.table_cards.push(C_THE_SINATRA_DOCTRINE) + log_msg_gap(`C${C_THE_SINATRA_DOCTRINE} in effect`) vm_next() } @@ -8537,7 +8590,6 @@ CODE[12] = [ // Apparatchicks ] CODE[13] = [ // Stasi - [ vm_permanently_remove ], [ vm_stasi ], [ vm_return ], ] @@ -8615,7 +8667,6 @@ CODE[24] = [ // St Nicolas Church ] CODE[25] = [ // Perestroika - [ vm_permanently_remove ], [ vm_perestroika ], [ vm_return ], ] @@ -8818,7 +8869,6 @@ CODE[49] = [ // Foreign Currency Debt Burden* ] CODE[50] = [ // The Sinatra Doctrine* - [ vm_permanently_remove ], [ vm_the_sinatra_doctrine ], [ vm_return ], ] -- cgit v1.2.3 From 1b63e91f7ce8e1f80cd69c2d8c96c85d89b1db7e 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 dc3d2c0e71f8b024cc80416fe029aa1d73222d58 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 d4901969f9b83b17b8a929feff64d80ee2f5c5e6 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 40aacfb71684d31d451813a40c139fdacb712153 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 c47245d2ff8f255ea2ad5bc1f45a721286bae235 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 From 7e5158ecaf5cb53c9bed95e58d197a06201f5d9d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 2 Nov 2024 19:22:45 +0000 Subject: Verbose logs --- events.txt | 2 ++ rules.js | 69 ++++++++++++++++++++++++++++++++++++++------------------------ 2 files changed, 44 insertions(+), 27 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 4176519..84bfe37 100644 --- a/events.txt +++ b/events.txt @@ -362,6 +362,7 @@ 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. foreign_currency_debt_burden +logi `Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` CARD 50 - The Sinatra Doctrine* @@ -660,6 +661,7 @@ 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 diff --git a/rules.js b/rules.js index dff42c5..2ee3e8a 100644 --- a/rules.js +++ b/rules.js @@ -306,7 +306,6 @@ exports.setup = function (seed, scenario, options) { function start_game() { // Draw cards game.strategy_deck = draw_deck() - reset_power() //Set starting influence spaces.forEach((space, index) => { @@ -2318,7 +2317,6 @@ function valid_spaces_sc() { if (infl !== 0 ) { // Check Events that block support checks in a given space if (game.persistent_events.includes(C_SOLIDARITY_LEGALIZED) && space.space_id === S_GDANSK) {continue} - if (game.persistent_events.includes(C_CIVIC_FORUM) && space.space_id === S_CHARLES_UNIVERSITY) {continue} if (game.persistent_events.includes(C_WE_ARE_THE_PEOPLE) && space.space_id === S_LEIPZIG) {continue} if (game.persistent_events.includes(C_FOREIGN_CURRENCY_DEBT_BURDEN) && space.country === game.foreign_currency_debt_burden) {continue} @@ -2851,7 +2849,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - log(`C${card} in effect`) + log(`C${card} in effect:`) } function permanently_remove(card) { @@ -3024,15 +3022,10 @@ function event_is_playable(card) { else if (game.com_tst_position === 8 && card === C_THE_CHINESE_SOLUTION) { return true } - - //Check for Gorbachev Charms the West after Breakaway Baltic Republics - else if (card === C_GORBACHEV_CHARMS_THE_WEST && !game.playable_cards.includes(C_GORBACHEV_CHARMS_THE_WEST)) { - return false - } //Then check normally - else if (cards[card].playable) { + else if (game.playable_cards.includes(card)) { return true - } else if (game.playable_cards.includes(card)) { + } else if (cards[card].playable) { return true } else { return false @@ -3040,11 +3033,7 @@ function event_is_playable(card) { } function get_card_ops(card) { - let ops = 0 - - if (card) { - ops = cards[card].ops - } + let ops = cards[card].ops if (game.persistent_events.includes(C_PERESTROIKA) && game.active === COM) { if(game.state === 'choose_card' || game.state === 'stasi_play_card') { log(`+1 op from C${C_PERESTROIKA}`) @@ -3166,7 +3155,7 @@ function finish_the_wall() { // =========== MOVING THROUGH TURNS ============ function end_round() { - //Check if the game is over! + //Check if the game is over! WHY IS THIS NEEDED? if (game.state === 'game_over') { return} @@ -3288,7 +3277,6 @@ function end_round() { next_player() } else { log_h3('Democratic Action Round') - } if (game.democrat_hand.includes(game.stasi_card)) { log_h3('C13') @@ -3457,10 +3445,6 @@ function roll_d6() { return random(6) + 1 } -function find_space_index(name_unique) { - return spaces.findIndex(space => space && space.name_unique === name_unique) -} - function find_country_index(country) { return countries.indexOf(country) } @@ -3869,6 +3853,11 @@ function vm_next() { vm_exec(); } +function vm_logi(){ + logi(vm_operand(1)) + vm_next() +} + function vm_operand(a) { let x = CODE[game.vm.fp][game.vm.ip][a] if (a > 0 && typeof x === "function") @@ -4483,11 +4472,13 @@ function vm_army_backs_revolution() { game.persistent_events = game.persistent_events.filter(n => n !== C_SECURITATE) game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) + logi(`${C_SECURITATE} no longer has any effect`) vm_next() } function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) + logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) game.austria_hungary_border_reopened_tracker = false vm_next() } @@ -4495,7 +4486,6 @@ function vm_austria_hungary_border_reopened() { function vm_betrayal() { if (game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] > 0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_ROMANIA) } if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] >0 ) { game.valid_spaces.push(S_ORTHODOX_CHURCH_BULGARIA) } - game.vm_available_ops = Math.max(game.demInfl[S_ORTHODOX_CHURCH_ROMANIA], game.demInfl[S_ORTHODOX_CHURCH_BULGARIA]) game.state = 'vm_switch_infl' } @@ -4559,7 +4549,6 @@ function vm_civic_forum() { if (check_vp()) { return } - add_to_persistent_events(C_CIVIC_FORUM) if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { @@ -4622,11 +4611,13 @@ function vm_domino_theory() { function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) + logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) vm_next() } function vm_elena(){ add_to_persistent_events(C_ELENA) + logi(`-1 modifier to Democratic Support checks in Romania for the rest of this turn`) vm_next() } @@ -4687,16 +4678,19 @@ function vm_foreign_television() { } function vm_frg_embassies() { add_to_persistent_events(C_FRG_EMBASSIES) + logi(`+1 modifier for Democratic Support Checks in Eastern Europe for the rest of this turn`) vm_next() } function vm_general_strike() { add_to_persistent_events(C_GENERAL_STRIKE) + logi(`Each Action Round the Communist must instead discard a card and roll a die until the modified die roll exceeds 5`) vm_next() } function vm_genscher() { add_to_persistent_events(C_GENSCHER) + logi(`Cancels +1 Ops cost to place Democratic SPs in Communist controlled spaces in East Germany for the rest of the turn`) vm_next() } @@ -4731,6 +4725,7 @@ function vm_government_resigns() { function vm_grenztruppen() { add_to_persistent_events(C_GRENZTRUPPEN) + logi(`-1 modifier for Democratic Support Checks in East Germany for the rest of this turn`) vm_next() } @@ -4753,11 +4748,13 @@ function vm_heal_our_bleeding_wounds() { function vm_helsinki_final_act() { add_to_persistent_events(C_HELSINKI_FINAL_ACT) + logi(`+1 VP for every Support Check by the Communist Player in Student or Intellectual spaces for the rest of the game`) vm_next() } function vm_honecker() { add_to_persistent_events(C_HONECKER) + logi(`The Communist may take one extra Action Round this turn`) game.valid_cards = [] for (let c of game.strategy_discard) { if (scoring_cards.includes(c)) { @@ -4838,6 +4835,7 @@ function vm_kremlin_coup() { function vm_laszlo_tokes() { add_to_persistent_events(C_LASZLO_TOKES) + logi(`Allows play of C${C_MASSACRE_IN_TIMISOARA}`) game.playable_cards.push(C_MASSACRE_IN_TIMISOARA) game.state = 'vm_laszlo_tokes' } @@ -5041,20 +5039,25 @@ function vm_solidarity_legalised() { function vm_st_nicholas_church () { add_to_persistent_events(C_ST_NICHOLAS_CHURCH) + logi(`Allows play of C${C_THE_MONDAY_DEMONSTRATIONS}`) game.playable_cards.push(C_THE_MONDAY_DEMONSTRATIONS) vm_next() } function vm_stasi() { add_to_persistent_events(C_STASI) + logi(`For the rest of this turn the Democrat must reveal the card he will play this Action Round before the Communist player plays his card`) vm_next() } function vm_stand_fast() { add_to_persistent_events(C_STAND_FAST) if (game.active === DEM) { + logi(`-1 Modifier to Support Checks in Democratic controlled spaces for the rest of this turn`) game.stand_fast = DEM - } else {game.stand_fast = COM} + } else { + logi(`-1 Modifier to Support Checks in Communist controlled spaces for the rest of this turn`) + game.stand_fast = COM} vm_next() } @@ -5099,6 +5102,7 @@ function vm_tank_column() { function vm_tear_gas () { add_to_persistent_events(C_TEAR_GAS) + logi(`+1 modifier to the next Communist Support Check in a Student space`) vm_next() } @@ -5121,6 +5125,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}`) game.playable_cards.push(C_THE_TYRANT_IS_GONE) vm_next() } @@ -5133,6 +5138,7 @@ function vm_the_monday_demonstrations() { function vm_the_sinatra_doctrine() { add_to_persistent_events(C_THE_SINATRA_DOCTRINE) + logi(`+1 Ops value for cards played by the Democrat for the rest of this turn`) vm_next() } @@ -5165,6 +5171,7 @@ function vm_tyrant_block() { function vm_the_wall () { add_to_persistent_events(C_THE_WALL) + logi(`Cancels the modifier for any Democratic controlled spaces for the next Communist Support Check in East Germany`) vm_next() } @@ -5184,6 +5191,7 @@ function vm_warsaw_pact_summit() { function vm_we_are_the_people() { if (game.demInfl[S_LUTHERAN_CHURCH] > 0) {game.valid_spaces = [S_LUTHERAN_CHURCH]} add_to_persistent_events(C_WE_ARE_THE_PEOPLE) + logi(`The Communist may no longer make Support Checks in Leipzig`) if (!game.vm_influence_added) { game.vm_influence_added = {}; } @@ -5215,6 +5223,7 @@ function vm_workers_revolt() { function vm_yakovlev_counsels_gorbachev() { add_to_persistent_events(C_YAKOVLEV_COUNSELS_GORBACHEV) + logi(`The Democrat receives a +1 modifier to the Support Loss and Victory Point die rolls if he wins the next Power Struggle`) vm_next() } @@ -6675,6 +6684,9 @@ states.vm_switch_infl = { }, space(space) { push_undo() + if (game.vm_event === C_BETRAYAL) { + game.vm_available_ops = game.demInfl[space] + } vm_switch_infl(space) if (game.vm_available_ops === 0) { game.valid_spaces = [] @@ -7092,7 +7104,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ + //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ vm_next() }, } @@ -8105,6 +8117,7 @@ CODE[48] = [ // We are the People!* CODE[49] = [ // Foreign Currency Debt Burden* [ vm_foreign_currency_debt_burden ], + [ vm_logi, ()=>`Communist cannot make Support Checks in ${country_name(game.foreign_currency_debt_burden)} for the rest of the turn` ], [ vm_return ], ] @@ -8400,6 +8413,7 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* + [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], @@ -8463,8 +8477,8 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces_com, 'Cluj-Napoca' ], + [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8624,3 +8638,4 @@ CODE[351] = [ // Scare Tactics [ vm_return ], ] // #endregion + -- cgit v1.2.3 From 2304345d1092f47265e9a4bb22ecc915863f7413 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 3 Nov 2024 12:31:40 +0000 Subject: Restore systematisation --- events.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index b9b187a..54203f1 100644 --- a/events.txt +++ b/events.txt @@ -496,7 +496,6 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -permanently_remove valid_spaces_country 'Romania' systematization -- cgit v1.2.3 From ebf691da7c8f992a2b1a20fc2b7cee7b84c3bee9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 5 Nov 2024 20:03:45 +0000 Subject: Update autoresolve events --- events.txt | 42 ++++++++++++++++++--- rules.js | 125 ++++++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 128 insertions(+), 39 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 54203f1..01ba963 100644 --- a/events.txt +++ b/events.txt @@ -44,7 +44,9 @@ general_strike CARD 6 - Brought in for Questioning # The Democratic Player must randomly discard a card. If it is a Communist event it takes place immediately. +if !is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING) brought_in_for_questioning +endif CARD 7 - State Run Media* @@ -78,9 +80,11 @@ endif CARD 11 - Dissident arrested # Remove 2 Democratic SPs from any Intellectuals space. +if !is_auto_resolve(C_DISSIDENT_ARRESTED) valid_spaces_opponent_socio 5 prompt 'any Intellectuals space' remove_x_opp_infl 2 +endif CARD 12 - Apparatchicks @@ -140,7 +144,9 @@ add_x_infl 3 CARD 20 - Deutsche Marks* # Democratic Player gives the Communist Player his highest Ops value card. If a Communist event it takes place immediately, otherwise use the Ops value of the card without triggering the event. permanently_remove +if !is_auto_resolve(C_DEUTSCHE_MARKS) deutsche_marks +endif CARD 21 - Common European Home @@ -160,9 +166,11 @@ 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. +if !check_dem_control(S_LUTHERAN_CHURCH) valid_spaces 'Lutheran Church' prompt 'the Lutheran Church' take_control_prep 1 +endif st_nicholas_church @@ -225,10 +233,13 @@ add_limited_infl 4 2 CARD 33 - Sajudis* # +1 VP. Reduce USSR stability by 1. Place sufficient Democratic support in any Minorities space for control. Allows play of The Baltic Way. permanently_remove +sajudis +if !is_auto_resolve(C_SAJUDIS) sajudis_check prompt 'any Minorities space' take_control_prep 1 -sajudis +endif + CARD 34 - Fidesz* @@ -293,7 +304,10 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if !game.the_tyrant_is_gone +if game.the_tyrant_is_gone +tyrant_block +else +if !is_auto_resolve(C_CEAUSESCU) valid_spaces_country_opp 'Romania' prompt ' from Romania' remove_opp_infl 3 @@ -302,8 +316,6 @@ prompt 'make a support check in Romania' 1_support_check prompt ' from Bucharesti' ceausescu -else -tyrant_block endif @@ -350,13 +362,18 @@ CARD 47 - Bulgarian Turks Expelled* # -2 VP. Remove any Democratic SPs in Razgrad. permanently_remove bulgarian_turks_expelled +if !is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED) +valid_spaces 'Razgrad' prompt 'Razgrad' remove_all_infl 1 +endif 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. +if !is_auto_resolve(C_WE_ARE_THE_PEOPLE) we_are_the_people +endif CARD 49 - Foreign Currency Debt Burden* @@ -383,9 +400,11 @@ add_infl_free CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove +if !is_auto_resolve(C_NORMALISATION) normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 +endif CARD 53 - Li Peng* @@ -508,7 +527,9 @@ securitate CARD 71 - Kiss of Death* # The Communist Player must randomly discard a card. If it is neutral or Democratic it takes place immediately. permanently_remove +if !is_auto_resolve(C_KISS_OF_DEATH) kiss_of_death +endif CARD 72 - Peasant Parties Revolt @@ -588,9 +609,12 @@ add_infl_free CARD 81 - The Baltic Way* # +2 VP. Reduce USSR stability by 1. Place sufficient Democratic SPs in any Minorities space for control. .Requires play of Sajudis. Allows play of Breakaway Baltic Republics. permanently_remove +the_baltic_way_prep +if !is_auto_resolve(C_THE_BALTIC_WAY) the_baltic_way prompt 'any Minorities space' take_control_prep 1 +endif CARD 82 - Spitzel* @@ -636,7 +660,10 @@ remove_infl 3 CARD 87 - Kohl Proposes Reunification* # +2 VP. The Democratic Player may place SPs or make Support Checks using the Ops value of this card if The Wall Must Go! has been played as an event successfully. permanently_remove +kohl_proposes_reunification_prep +if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification +endif @@ -683,8 +710,10 @@ support_check 2 CARD 92 - Betrayal # Choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs. permanently_remove +if !is_auto_resolve(C_BETRAYAL) prompt 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' betrayal +endif CARD 93 - Shock Therapy* @@ -774,10 +803,13 @@ national_salvation_front CARD 103 - Government Resigns* # Remove all Communist SPs from any uncontrolled Elite space. +permanently_remove +if !is_auto_resolve(C_GOVERNMENT_RESIGNS) government_resigns prompt 'any uncontrolled Elite space' remove_all_infl 1 -permanently_remove +endif + CARD 104 - New Year's Eve Party* diff --git a/rules.js b/rules.js index 6ca2c78..3c3eebd 100644 --- a/rules.js +++ b/rules.js @@ -3009,53 +3009,81 @@ function is_auto_resolve(card) { else if (card === C_KOHL_PROPOSES_REUNIFICATION && !game.persistent_events.includes(C_THE_WALL_MUST_GO)) { return true } - if (card === C_BROUGHT_IN_FOR_QUESTIONING || card === C_DEUTSCHE_MARKS) { - if (game.democrat_hand.length === 0) { return true } + else if (card === C_BROUGHT_IN_FOR_QUESTIONING ) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Democrat has no cards to discard') } + return true } + } + else if (card === C_DEUTSCHE_MARKS) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Democrat has no cards to give') } + return true } + } + else if (card === C_KISS_OF_DEATH ) { + if (game.communist_hand.length === 0) { + if (!game.state.startsWith('vm')) { log('Communist has no cards to discard') } + return true } } else if (card === C_DISSIDENT_ARRESTED) { - let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space] > 0).length + let dem_intellectual_infl = spaces.filter(space => space.socio === 5 && game.demInfl[space.space_id] > 0).length + console.log('dem_intellectual_infl', dem_intellectual_infl) if (dem_intellectual_infl === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_SAJUDIS || card === C_THE_BALTIC_WAY) { if (!game.systematization === S_HARGHITA_COVASNA) { - if (dem_control(S_RAZGRAD) && dem_control(S_HARGHITA_COVASNA)) { - log('Both Minorities spaces already controlled') + if (check_dem_control(S_RAZGRAD) && check_dem_control(S_HARGHITA_COVASNA)) { + if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } return true } - } else if (dem_control(S_RAZGRAD)) { - log('Both Minorities spaces already controlled') + } else if (check_dem_control(S_RAZGRAD)) { + if (!game.state.startsWith('vm')) { log('Both Minorities spaces already controlled') } return true } } else if (card === C_CEAUSESCU) { let dem_romania_infl = spaces.filter(space => space.country === 'Romania' && game.demInfl[space] > 0).length if (dem_romania_infl === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_WE_ARE_THE_PEOPLE) { if (game.demInfl[S_LUTHERAN_CHURCH] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_BETRAYAL) { if (!game.systematization === S_ORTHODOX_CHURCH_ROMANIA) { if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (game.demInfl[S_ORTHODOX_CHURCH_BULGARIA] === 0 && game.demInfl[S_ORTHODOX_CHURCH_ROMANIA] === 0) { - log('No influence to remove') + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } else if (card === C_GOVERNMENT_RESIGNS) { let uncontrolled_elites = spaces.filter( s => game.comInfl[s] > 0 && !check_control(s)).length if (uncontrolled_elites === 0) { - log('No uncontrolled Elite spaces') + if (!game.state.startsWith('vm')) { log('No uncontrolled Elite spaces') } + return true + } + } else if (card === C_ST_NICHOLAS_CHURCH) { + if (check_dem_control(S_LUTHERAN_CHURCH)) { + if (!game.state.startsWith('vm')) { log('Lutheran Church already controlled') } + return true + } + } else if (card === C_BULGARIAN_TURKS_EXPELLED) { + if (game.demInfl[S_RAZGRAD] === 0 ) { + if (!game.state.startsWith('vm')) { log('No influence to remove') } + return true + } + } else if (card === C_NORMALIZATION) { + if (game.demInfl[S_PRAHA] === 0 && game.demInfl[S_PLZEN] === 0 ) { + if (!game.state.startsWith('vm')) { log('No influence to remove') } return true } } @@ -4595,7 +4623,6 @@ function vm_bulgarian_turks_expelled(){ if (check_vp()) { return } - if (game.demInfl[S_RAZGRAD] > 0) {game.valid_spaces = [S_RAZGRAD]} vm_next() } @@ -4878,20 +4905,16 @@ function vm_klaus_and_komarek() { vm_next() } -function vm_kohl_proposes_reunification() { +function vm_kohl_proposes_reunification_prep() { log('+2 VP') game.vp += 2 if (check_vp()) { return } - if (game.persistent_events.includes(C_THE_WALL_MUST_GO)) { - game.vm_event = C_KOHL_PROPOSES_REUNIFICATION - game.state = 'vm_common_european_home_play' - } else { - permanently_remove(C_KOHL_PROPOSES_REUNIFICATION) - vm_return() - } - +} +function vm_kohl_proposes_reunification() { + game.vm_event = C_KOHL_PROPOSES_REUNIFICATION + game.state = 'vm_common_european_home_play' } function vm_kremlin_coup() { @@ -5096,6 +5119,7 @@ function vm_sajudis() { if (check_vp()) { return } + log(`Allows play of C${C_THE_BALTIC_WAY} for the event`) vm_next() } @@ -5194,11 +5218,9 @@ function vm_tear_gas () { vm_next() } -function vm_the_baltic_way() { +function vm_the_baltic_way_prep() { game.playable_cards.push(C_BREAKAWAY_BALTIC_REPUBLICS) game.stability++ - if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)} - if (!check_dem_control(S_RAZGRAD) ) {game.valid_spaces.push(S_RAZGRAD)} log('+3 VP') game.vp += 3 if (check_vp()) { @@ -5207,6 +5229,12 @@ function vm_the_baltic_way() { vm_next() } +function vm_the_baltic_way() { + if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) {game.valid_spaces.push(S_HARGHITA_COVASNA)} + if (!check_dem_control(S_RAZGRAD) ) {game.valid_spaces.push(S_RAZGRAD)} + vm_next() +} + function vm_the_chinese_solution() { game.state = 'vm_the_chinese_solution' } @@ -7888,7 +7916,9 @@ CODE[5] = [ // General strike ] CODE[6] = [ // Brought in for Questioning + [ vm_if, ()=>!is_auto_resolve(C_BROUGHT_IN_FOR_QUESTIONING) ], [ vm_brought_in_for_questioning ], + [ vm_endif ], [ vm_return ], ] @@ -7922,9 +7952,11 @@ CODE[10] = [ // Cult of Personality ] CODE[11] = [ // Dissident arrested + [ vm_if, ()=>!is_auto_resolve(C_DISSIDENT_ARRESTED) ], [ vm_valid_spaces_opponent_socio, 5 ], [ vm_prompt, 'any Intellectuals space' ], [ vm_remove_x_opp_infl, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -7984,7 +8016,9 @@ CODE[19] = [ // Papal vist CODE[20] = [ // Deutsche Marks* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_DEUTSCHE_MARKS) ], [ vm_deutsche_marks ], + [ vm_endif ], [ vm_return ], ] @@ -8004,9 +8038,11 @@ CODE[23] = [ // Power Struggle - Hungary ] CODE[24] = [ // St Nicolas Church + [ vm_if, ()=>!check_dem_control(S_LUTHERAN_CHURCH) ], [ vm_valid_spaces, 'Lutheran Church' ], [ vm_prompt, 'the Lutheran Church' ], [ vm_take_control_prep, 1 ], + [ vm_endif ], [ vm_st_nicholas_church ], [ vm_return ], ] @@ -8069,10 +8105,12 @@ CODE[32] = [ // Peasant Parties* CODE[33] = [ // Sajudis* [ vm_permanently_remove ], + [ vm_sajudis ], + [ vm_if, ()=>!is_auto_resolve(C_SAJUDIS) ], [ vm_sajudis_check ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], - [ vm_sajudis ], + [ vm_endif ], [ vm_return ], ] @@ -8137,7 +8175,10 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>game.the_tyrant_is_gone ], + [ vm_tyrant_block ], + [ vm_else ], + [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], [ vm_valid_spaces_country_opp, 'Romania' ], [ vm_prompt, ' from Romania' ], [ vm_remove_opp_infl, 3 ], @@ -8146,8 +8187,6 @@ CODE[41] = [ // Ceausescu* [ vm_1_support_check ], [ vm_prompt, ' from Bucharesti' ], [ vm_ceausescu ], - [ vm_else ], - [ vm_tyrant_block ], [ vm_endif ], [ vm_return ], ] @@ -8194,13 +8233,18 @@ CODE[46] = [ // Goodbye Lenin!* CODE[47] = [ // Bulgarian Turks Expelled* [ vm_permanently_remove ], [ vm_bulgarian_turks_expelled ], + [ vm_if, ()=>!is_auto_resolve(C_BULGARIAN_TURKS_EXPELLED) ], + [ vm_valid_spaces, 'Razgrad' ], [ vm_prompt, 'Razgrad' ], [ vm_remove_all_infl, 1 ], + [ vm_endif ], [ vm_return ], ] CODE[48] = [ // We are the People!* + [ vm_if, ()=>!is_auto_resolve(C_WE_ARE_THE_PEOPLE) ], [ vm_we_are_the_people ], + [ vm_endif ], [ vm_return ], ] @@ -8227,9 +8271,11 @@ CODE[51] = [ // 40th Anniversary Celebration* CODE[52] = [ // Normalisation [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_NORMALISATION) ], [ vm_normalisation ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], + [ vm_endif ], [ vm_return ], ] @@ -8352,7 +8398,9 @@ CODE[70] = [ // Securitate* CODE[71] = [ // Kiss of Death* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_KISS_OF_DEATH) ], [ vm_kiss_of_death ], + [ vm_endif ], [ vm_return ], ] @@ -8432,9 +8480,12 @@ CODE[80] = [ // Nepotism* CODE[81] = [ // The Baltic Way* [ vm_permanently_remove ], + [ vm_the_baltic_way_prep ], + [ vm_if, ()=>!is_auto_resolve(C_THE_BALTIC_WAY) ], [ vm_the_baltic_way ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], + [ vm_endif ], [ vm_return ], ] @@ -8480,7 +8531,10 @@ CODE[86] = [ // The Wall Must Go!* CODE[87] = [ // Kohl Proposes Reunification* [ vm_permanently_remove ], + [ vm_kohl_proposes_reunification_prep ], + [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], + [ vm_endif ], [ vm_return ], ] @@ -8524,8 +8578,10 @@ CODE[91] = [ // My First Banana* CODE[92] = [ // Betrayal [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_BETRAYAL) ], [ vm_prompt, 'choose any Orthodox Church space. Replace all Democratic SPs with Communist SPs' ], [ vm_betrayal ], + [ vm_endif ], [ vm_return ], ] @@ -8564,8 +8620,8 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces_com, 'Cluj-Napoca' ], + [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], @@ -8615,10 +8671,12 @@ CODE[102] = [ // National Salvation Front* ] CODE[103] = [ // Government Resigns* + [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_GOVERNMENT_RESIGNS) ], [ vm_government_resigns ], [ vm_prompt, 'any uncontrolled Elite space' ], [ vm_remove_all_infl, 1 ], - [ vm_permanently_remove ], + [ vm_endif ], [ vm_return ], ] @@ -8725,4 +8783,3 @@ CODE[351] = [ // Scare Tactics [ vm_return ], ] // #endregion - -- cgit v1.2.3 From e3d8b1c1639218973805c0fa64e33af8b66b33aa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 7 Nov 2024 19:48:16 +0000 Subject: Update autoresolve events --- events.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 01ba963..52cd269 100644 --- a/events.txt +++ b/events.txt @@ -679,9 +679,11 @@ add_limited_infl 4 2 CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. -prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' permanently_remove +if !is_auto_resolve(C_DOMINO_THEORY) +prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' domino_theory +endif @@ -728,12 +730,14 @@ add_infl_free 3 CARD 94 - Union of Democratic Forces* # Remove 4 Communist SPs from Bulgaria. Democratic Player may make Support Checks in Bulgaria using the Ops value of this card if the Bulgarian writers space is Democratically controlled. permanently_remove +if !is_auto_resolve(C_UNION_OF_DEMOCRATIC_FORCES) valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' -remove_opp_infl 4 +remove_limited_opp_infl 4 2 valid_spaces_country_sc 'Bulgaria' prompt 'Make 2 Support Checks in Bulgaria' support_check 2 +endif CARD 95 - Power Struggle - Romania -- cgit v1.2.3 From 8b9f51b9a547531a8b045f0b60d9fec9e58da4fd Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 11:40:04 +0000 Subject: Fix typo in Normalization --- events.txt | 2 +- rules.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 52cd269..45c48e2 100644 --- a/events.txt +++ b/events.txt @@ -400,7 +400,7 @@ add_infl_free CARD 52 - Normalisation # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove -if !is_auto_resolve(C_NORMALISATION) +if !is_auto_resolve(C_NORMALIZATION) normalisation prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 diff --git a/rules.js b/rules.js index 94f4c92..1ef5ec8 100644 --- a/rules.js +++ b/rules.js @@ -8304,7 +8304,7 @@ CODE[51] = [ // 40th Anniversary Celebration* CODE[52] = [ // Normalisation [ vm_permanently_remove ], - [ vm_if, ()=>!is_auto_resolve(C_NORMALISATION) ], + [ vm_if, ()=>!is_auto_resolve(C_NORMALIZATION) ], [ vm_normalisation ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], -- cgit v1.2.3 From cc33f1abaef7b291cb43da27fa7b8b4e1120decc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Fri, 8 Nov 2024 12:13:10 +0000 Subject: Consistent spelling of Normalization --- events.txt | 4 ++-- rules.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 45c48e2..88cd639 100644 --- a/events.txt +++ b/events.txt @@ -397,11 +397,11 @@ add_infl_free 40th_anniversary_celebration_vp -CARD 52 - Normalisation +CARD 52 - Normalization # Remove all Democratic SPs from the Czechoslovakia Elite and Bureaucrat Spaces. permanently_remove if !is_auto_resolve(C_NORMALIZATION) -normalisation +normalization prompt 'the Czechoslovakia Elite and Bureaucrat Spaces' remove_all_infl 2 endif diff --git a/rules.js b/rules.js index ce6d596..4f03953 100644 --- a/rules.js +++ b/rules.js @@ -5031,7 +5031,7 @@ function vm_nomenklatura() { game.state = 'vm_nomenklatura' } -function vm_normalisation() { +function vm_normalization() { if (game.demInfl[S_PLZEN] >0) {game.valid_spaces.push(S_PLZEN)} if (game.demInfl[S_PRAHA] > 0) {game.valid_spaces.push(S_PRAHA)} game.remove_opponent_infl = true @@ -8306,10 +8306,10 @@ CODE[51] = [ // 40th Anniversary Celebration* [ vm_return ], ] -CODE[52] = [ // Normalisation +CODE[52] = [ // Normalization [ vm_permanently_remove ], [ vm_if, ()=>!is_auto_resolve(C_NORMALIZATION) ], - [ vm_normalisation ], + [ vm_normalization ], [ vm_prompt, 'the Czechoslovakia Elite and Bureaucrat Spaces' ], [ vm_remove_all_infl, 2 ], [ vm_endif ], -- cgit v1.2.3 From 4913146fdf49ff941e582970c6056d21444e6efa Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 10 Nov 2024 10:42:28 +0000 Subject: Update implementation of Tyrant --- events.txt | 12 ++++++++---- play.js | 2 +- rules.js | 21 ++++++++++++--------- 3 files changed, 21 insertions(+), 14 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 88cd639..532b892 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,8 +515,12 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces_country 'Romania' systematization +else +tyrant_block +endif CARD 70 - Securitate* @@ -790,7 +794,7 @@ 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 -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -850,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.the_tyrant_is_gone +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/play.js b/play.js index 7c53d39..8ea17a2 100644 --- a/play.js +++ b/play.js @@ -629,7 +629,7 @@ function on_update() { ui.events[C_SYSTEMATIZATION].style.display = "none" } - if (view.the_tyrant_is_gone && view.the_tyrant_is_gone <= last_space) { + if (view.the_tyrant_is_gone) { ui.events[C_THE_TYRANT_IS_GONE].style.display = "block" ui.events[C_THE_TYRANT_IS_GONE].style.left = ui.layout_xy[view.the_tyrant_is_gone][0] - 25 + "px" ui.events[C_THE_TYRANT_IS_GONE].style.top = ui.layout_xy[view.the_tyrant_is_gone][1] - 50 + "px" diff --git a/rules.js b/rules.js index ed79e5e..e61586c 100644 --- a/rules.js +++ b/rules.js @@ -2972,7 +2972,7 @@ function select_card(card){ } function is_auto_resolve(card) { - let ceausecu_events = [10, 41, 101, 107] + let ceausecu_events = [10, 41, 69, 101, 107] if (auto_resolve_events.includes(card)) { return true } @@ -3729,14 +3729,13 @@ function reset_power() { } function check_tyrant() { - if (game.the_tyrant_is_gone > 0 && game.the_tyrant_is_gone !== 111 && check_dem_control(game.the_tyrant_is_gone)) { + if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) { log('+2 VP from C97') game.vp += 2 if (check_vp()) { return } - game.persistent_events = game.persistent_events.filter(n => n !== C_THE_TYRANT_IS_GONE) - game.the_tyrant_is_gone = 111 + delete game.the_tyrant_is_gone } } @@ -7986,7 +7985,7 @@ CODE[9] = [ // The Wall* CODE[10] = [ // Cult of Personality [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_valid_spaces_country_socio_2, 'Romania', 3, 4 ], [ vm_prompt, 'Worker or Farmer spaces in Romania, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], @@ -8220,7 +8219,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_tyrant_block ], [ vm_else ], [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], @@ -8431,8 +8430,12 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], + [ vm_else ], + [ vm_tyrant_block ], + [ vm_endif ], [ vm_return ], ] @@ -8669,7 +8672,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], + [ vm_if, ()=>game.persistent_events.includes(54) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], @@ -8703,7 +8706,7 @@ CODE[100] = [ // Stand Fast* ] CODE[101] = [ // Elena* - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], @@ -8762,7 +8765,7 @@ CODE[106] = [ // Social Democratic Platform Adopted* CODE[107] = [ // Massacre in Timisoara* [ vm_permanently_remove ], - [ vm_if, ()=>!game.the_tyrant_is_gone ], + [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE) ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], -- cgit v1.2.3 From a718121b64cbf7dde9fab9fe729df415c70a821d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:18:24 +0000 Subject: Update handling of Tyrant --- events.txt | 12 ++++++------ rules.js | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 532b892..a47d48b 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,7 +515,7 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country 'Romania' systematization else @@ -760,7 +760,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu -if game.persistent_events.includes(54) +if game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romanian Elite Space' remove_x_opp_infl 4 @@ -794,7 +794,7 @@ 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 -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -854,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE) +if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/rules.js b/rules.js index 535fa2b..18061df 100644 --- a/rules.js +++ b/rules.js @@ -226,6 +226,7 @@ const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] const PC_TACTIC_FAILS = 52 const THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED = 540 +const THE_TYRANT_IS_GONE_OCCURRED = 970 // COUNTRY CONSTANTS @@ -5297,6 +5298,7 @@ function vm_the_third_way() { } function vm_the_tyrant_is_gone() { + game.persistent_events.push(THE_TYRANT_IS_GONE_OCCURRED) game.valid_spaces = [] for (let i = 0; i < spaces.length; i++) { let space = spaces[i] @@ -8671,7 +8673,7 @@ CODE[96] = [ // The Chinese Solution* ] CODE[97] = [ // The Tyrant is Gone* - [ vm_if, ()=>game.persistent_events.includes(54) ], + [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], -- cgit v1.2.3 From bda4e3eb1a7cb72088334599a3eba1bec8752efe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 11 Nov 2024 08:23:56 +0000 Subject: Fix typo --- events.txt | 10 +++++----- rules.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index a47d48b..c25dfca 100644 --- a/events.txt +++ b/events.txt @@ -69,7 +69,7 @@ the_wall CARD 10 - Cult of Personality # Place 4 Communist SPs in Worker or Farmer spaces in Romania, no more than 2 per space. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country_socio_2 'Romania', 3, 4 prompt 'Worker or Farmer spaces in Romania, no more than 2 per space' add_limited_infl 4 2 @@ -304,7 +304,7 @@ prompt 'make a Support Check in Hungary' CARD 41 - Ceausescu* # Remove 3 Democratic SPs in Romania and make a Support Check in Romania using the Ops value of this card. If the Democratic Player has any SPs in spaces adjacent to Cluj at the end of this action round remove 1 Communist SP from Bucharest. May not be played as an event after The Tyrant is Gone. permanently_remove -if game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) tyrant_block else if !is_auto_resolve(C_CEAUSESCU) @@ -515,7 +515,7 @@ add_x_infl 2 CARD 69 - Systematization* # The Communist player may eliminate 1 space in Romania. Any Democratic SPs are eliminated. Communist SPs are relocated to Bucharest. The connections to the destroyed space are considered to pass through and connect the adjacent spaces directly. -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces_country 'Romania' systematization else @@ -794,7 +794,7 @@ 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 -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) valid_spaces 'Cluj-Napoca' prompt 'the Romania Elite Space' add_x_infl 2 @@ -854,7 +854,7 @@ prompt `make a Support Check in ${country_name(game.vm_active_country)}` CARD 107 - Massacre in Timisoara* # Communist Player makes Support Checks in Romania using the Ops value of this card with +2 drm. Requires play of Lazslo Tokes. permanently_remove -if !game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) +if !game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) massacre_in_timisoara valid_spaces_country_sc 'Romania' prompt 'Make Support Checks in Romania' diff --git a/rules.js b/rules.js index c4a4a38..6755fe0 100644 --- a/rules.js +++ b/rules.js @@ -7986,7 +7986,7 @@ CODE[9] = [ // The Wall* CODE[10] = [ // Cult of Personality [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces_country_socio_2, 'Romania', 3, 4 ], [ vm_prompt, 'Worker or Farmer spaces in Romania, no more than 2 per space' ], [ vm_add_limited_infl, 4, 2 ], @@ -8220,7 +8220,7 @@ CODE[40] = [ // Hungarian Democratic Forum CODE[41] = [ // Ceausescu* [ vm_permanently_remove ], - [ vm_if, ()=>game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_tyrant_block ], [ vm_else ], [ vm_if, ()=>!is_auto_resolve(C_CEAUSESCU) ], @@ -8431,7 +8431,7 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], [ vm_else ], @@ -8707,7 +8707,7 @@ CODE[100] = [ // Stand Fast* ] CODE[101] = [ // Elena* - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_valid_spaces, 'Cluj-Napoca' ], [ vm_prompt, 'the Romania Elite Space' ], [ vm_add_x_infl, 2 ], @@ -8766,7 +8766,7 @@ CODE[106] = [ // Social Democratic Platform Adopted* CODE[107] = [ // Massacre in Timisoara* [ vm_permanently_remove ], - [ vm_if, ()=>!game.persistent_events.includes(C_THE_TYRANT_IS_GONE_OCCURRED) ], + [ vm_if, ()=>!game.persistent_events.includes(THE_TYRANT_IS_GONE_OCCURRED) ], [ vm_massacre_in_timisoara ], [ vm_valid_spaces_country_sc, 'Romania' ], [ vm_prompt, 'Make Support Checks in Romania' ], -- cgit v1.2.3 From 327a597984be4c2276cdc43ffde098ec155fc7b9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:29:05 +0000 Subject: Simplify the wall must go --- events.txt | 1 - rules.js | 8 -------- 2 files changed, 9 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index c25dfca..94738a7 100644 --- a/events.txt +++ b/events.txt @@ -656,7 +656,6 @@ tank_column CARD 86 - The Wall Must Go!* # Reduce USSR stability by 1. The Democratic Player attempts to tear down the Berlin Wall. Each player rolls a die and adds the number of spaces in Germany they control. Higher total wins. This is best 2 out of 3. If successful +3 VPs and the Communist must remove 3 SPs from Germany. -permanently_remove the_wall_must_go remove_infl 3 diff --git a/rules.js b/rules.js index 910e46f..c8c7de6 100644 --- a/rules.js +++ b/rules.js @@ -3259,13 +3259,6 @@ function finish_the_wall() { game.valid_spaces.push(space.space_id) } } - if (!game.vm_infl_to_do) { - if (game.round_player === DEM) { - game.return = COM - } else { - game.return = DEM - } - } if (game.active === DEM) {next_player()} vm_next () } else { @@ -8568,7 +8561,6 @@ CODE[85] = [ // Tank Column/Tank Man* ] CODE[86] = [ // The Wall Must Go!* - [ vm_permanently_remove ], [ vm_the_wall_must_go ], [ vm_remove_infl, 3 ], [ vm_return ], -- cgit v1.2.3 From 811996a28cd232f6041285e336a4cefbd2888a6f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 16:51:29 +0000 Subject: Improve log for Kohl proposes reunification --- events.txt | 2 ++ rules.js | 2 ++ 2 files changed, 4 insertions(+) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 94738a7..a461071 100644 --- a/events.txt +++ b/events.txt @@ -666,6 +666,8 @@ permanently_remove kohl_proposes_reunification_prep if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification +else +log `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif diff --git a/rules.js b/rules.js index 487f7c1..41c7c9f 100644 --- a/rules.js +++ b/rules.js @@ -8573,6 +8573,8 @@ CODE[87] = [ // Kohl Proposes Reunification* [ vm_kohl_proposes_reunification_prep ], [ vm_if, ()=>!is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) ], [ vm_kohl_proposes_reunification ], + [ vm_else ], + [ vm_log, ()=>`C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` ], [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 2cfaa6f7f223719b3a6e0be7352ccc7b1d712921 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 14 Nov 2024 17:13:41 +0000 Subject: Indent log --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index a461071..a216941 100644 --- a/events.txt +++ b/events.txt @@ -667,7 +667,7 @@ kohl_proposes_reunification_prep if !is_auto_resolve(C_KOHL_PROPOSES_REUNIFICATION) kohl_proposes_reunification else -log `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` +logi `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif -- cgit v1.2.3 From c86eb75d757a0c30e54544e19aea3fc8260cb49d Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 11:38:52 +0000 Subject: Add Dash for the West to conditional auto_resolve --- events.txt | 2 ++ rules.js | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'events.txt') diff --git a/events.txt b/events.txt index a216941..879fcac 100644 --- a/events.txt +++ b/events.txt @@ -259,8 +259,10 @@ heal_our_bleeding_wounds CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove +if !is_auto_resolve(C_DASH_FOR_THE_WEST) prompt 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west +endif CARD 37 - Nagy Reburied* diff --git a/rules.js b/rules.js index 8dc33a0..d46a814 100644 --- a/rules.js +++ b/rules.js @@ -223,6 +223,7 @@ const numberless_cards = [1, 2, 3, 4, 5, 6, 37, 38, 39, 40, 41, 42, 43, 44, 45, const auto_resolve_events = [5, 8, 9, 13, 17, 25, 26, 30, 35, 50, 53, 54, 58, 59, 62, 63, 65, 70, 72, 74, 86, 99, 102, 108] const switch_events = [6, 20, 71] const one_turn_events = [ 8, 13, 25, 50, 63, 74, 49, 58, 59, 100, 101 ] +const dem_asterisks = [2, 3, 4, 5, 19, 24, 26, 29, 33, 34, 36, 39, 40, 45, 46, 48, 49, 50, 54, 56, 58, 60, 61, 62, 63, 64, 65, 66, 68, 71, 72, 73, 74, 75, 77, 81, 84, 86, 87, 89, 90, 91, 93, 94, 97, 103, 105, 108, 110] const PC_TACTIC_FAILS = 52 const PC_SUPPORT_FALTERS = 49 @@ -3076,6 +3077,11 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } + } else if (card === C_DASH_FOR_THE_WEST) { + if (!game.strategy_discard.includes(dem_asterisks)) { + if (!game.state.startsWith('vm')) { logi('No Democratic Events with an asterisk in the discard') } + return true + } } else { return false @@ -8170,8 +8176,10 @@ CODE[35] = [ // Heal our Bleeding Wounds* CODE[36] = [ // Dash for the West* [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_DASH_FOR_THE_WEST) ], [ vm_prompt, 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' ], [ vm_dash_for_the_west ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 11a1cc9522ac038e909b6e53cf913e63f7bd3472 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 17 Nov 2024 17:37:09 +0000 Subject: Update Dash for The West text to have consistent capitalisation with the card --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 879fcac..b4016de 100644 --- a/events.txt +++ b/events.txt @@ -260,7 +260,7 @@ CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove if !is_auto_resolve(C_DASH_FOR_THE_WEST) -prompt 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' +prompt 'Dash for the West: select any Democratic Event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west endif -- cgit v1.2.3 From 4520aee01a5e79120d2e9bf07a4ca8ee794bfbfe Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 11:33:10 +0000 Subject: Remove Dash for the West from auto_resolve --- events.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index b4016de..7db1b63 100644 --- a/events.txt +++ b/events.txt @@ -259,10 +259,8 @@ heal_our_bleeding_wounds CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove -if !is_auto_resolve(C_DASH_FOR_THE_WEST) prompt 'Dash for the West: select any Democratic Event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west -endif CARD 37 - Nagy Reburied* -- cgit v1.2.3 From 2c25d82a4e308d5e1d93606c28698934c22751c5 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 15:32:55 +0000 Subject: Add autoresolve for Exit Visas --- events.txt | 2 ++ rules.js | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 7db1b63..09eb662 100644 --- a/events.txt +++ b/events.txt @@ -563,8 +563,10 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. +if !is_auto_resolve(C_EXIT_VISAS) permanently_remove exit_visas +endif CARD 76 - Warsaw Pact Summit diff --git a/rules.js b/rules.js index 4bf7a33..b991456 100644 --- a/rules.js +++ b/rules.js @@ -3077,7 +3077,12 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('No SPs to remove') } return true } - } + } else if (card === C_EXIT_VISAS) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } + return true + } + } else { return false } @@ -8478,8 +8483,10 @@ CODE[74] = [ // FRG Embassies ] CODE[75] = [ // Exit Visas* + [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_permanently_remove ], [ vm_exit_visas ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From a5cad5916776ff66e7c7d224f6b2d966db8d888f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 15:36:32 +0000 Subject: Add autoresolve for Samizdat --- events.txt | 4 +++- rules.js | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 09eb662..a62e810 100644 --- a/events.txt +++ b/events.txt @@ -563,8 +563,8 @@ frg_embassies CARD 75 - Exit Visas* # The Democratic Player may discard any cards in his hand and draw new cards from the deck. -if !is_auto_resolve(C_EXIT_VISAS) permanently_remove +if !is_auto_resolve(C_EXIT_VISAS) exit_visas endif @@ -586,7 +586,9 @@ endif CARD 77 - Samizdat # The Democratic Player can put a card in his hand aside for next turn and draw a replacement card from the deck. permanently_remove +if !is_auto_resolve(C_SAMIZDAT) samizdat +endif CARD 78 - Workers Revolt diff --git a/rules.js b/rules.js index b991456..ac40f5b 100644 --- a/rules.js +++ b/rules.js @@ -3082,6 +3082,11 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to discard') } return true } + } else if (card === C_SAMIZDAT) { + if (game.democrat_hand.length === 0) { + if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') } + return true + } } else { return false @@ -8483,8 +8488,8 @@ CODE[74] = [ // FRG Embassies ] CODE[75] = [ // Exit Visas* - [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_EXIT_VISAS) ], [ vm_exit_visas ], [ vm_endif ], [ vm_return ], @@ -8506,7 +8511,9 @@ CODE[76] = [ // Warsaw Pact Summit CODE[77] = [ // Samizdat [ vm_permanently_remove ], + [ vm_if, ()=>!is_auto_resolve(C_SAMIZDAT) ], [ vm_samizdat ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From 828b47de96c9ce53fe94d47bf4d9ad59998c3e89 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Mon, 18 Nov 2024 19:10:28 +0000 Subject: Add conditional autoresolves --- events.txt | 9 ++++++--- rules.js | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index a62e810..a3ff2d2 100644 --- a/events.txt +++ b/events.txt @@ -628,9 +628,11 @@ endif CARD 82 - Spitzel* # Remove 2 Democratic SPs in Germany. permanently_remove +if !is_auto_resolve(C_SPITZEL) valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 +endif CARD 83 - Modrow* @@ -675,7 +677,6 @@ logi `C${C_THE_WALL_MUST_GO} has not been successfully played for the event.` endif - CARD 88 - Adamec* # Roll a die. On a 4-6 add 4 Communist SPs in Czechoslovakia, no more than 2 per space. -1 drm for every Worker or Farmer space in Czechoslovakia that is controlled by the Democratic Player. permanently_remove @@ -685,7 +686,6 @@ prompt 'Czechoslovakia' add_limited_infl 4 2 - CARD 89 - Domino Theory* # If the Democrat holds Power in at least 2 counties, he may retrieve any Power Struggle - card from the discard pile and play it immediately as an event. The Democrat receives a -1 drm to his dice rolls for this Power Struggle. permanently_remove @@ -695,7 +695,6 @@ domino_theory endif - 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. valid_spaces_country 'Czechoslovakia' @@ -710,12 +709,14 @@ support_check 2 CARD 91 - My First Banana* # Remove 2 Communist SPs and make two Support Checks in Germany using the Ops value of this card. permanently_remove +if !is_auto_resolve(C_MY_FIRST_BANANA) valid_spaces_country_opp 'East_Germany' prompt ' from East Germany' remove_opp_infl 2 valid_spaces_country_sc 'East_Germany' prompt 'select a space in East Germany' support_check 2 +endif CARD 92 - Betrayal @@ -779,12 +780,14 @@ endif CARD 98 - Politburo Intrigue* # Remove 3 Democratic SPs in Bulgaria, no more than 2 per space. Then make one Support Check in Bulgaria, using the Ops value of this card. permanently_remove +if !is_auto_resolve(C_POLITBURO_INTRIGUE) valid_spaces_country_opp 'Bulgaria' prompt ' from Bulgaria' remove_limited_opp_infl 3 2 valid_spaces_country_sc 'Bulgaria' prompt 'make a support check in Bulgaria' 1_support_check +endif CARD 99 - Ligachev* diff --git a/rules.js b/rules.js index ac40f5b..d3c4dd6 100644 --- a/rules.js +++ b/rules.js @@ -3087,6 +3087,18 @@ function is_auto_resolve(card) { if (!game.state.startsWith('vm')) { logi('Democrat has no cards to set aside') } return true } + } else if (card === C_SPITZEL) { + let dem_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.demInfl[space.space_id] > 0).length + if (dem_germany_infl === 0) { + if (!game.state.startsWith('vm')) { logi('No influence to remove') } + return true + } + } else if (card === C_MY_FIRST_BANANA) { + let com_germany_infl = spaces.filter(space => space.country === 'East_Germany' && game.comInfl[space.space_id] > 0).length + if (com_germany_infl === 0) { + if (!game.state.startsWith('vm')) { logi('No influence to remove') } + return true + } } else { return false -- cgit v1.2.3 From 2d407f9d901104590844038bc1bf2e8f3a31d50f Mon Sep 17 00:00:00 2001 From: iainp5 Date: Tue, 19 Nov 2024 18:37:21 +0000 Subject: Fix capitalisation of Grenztruppen --- events.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index a3ff2d2..01102f4 100644 --- a/events.txt +++ b/events.txt @@ -442,7 +442,7 @@ CARD 58 - Austria-Hungary Border Reopened* austria_hungary_border_reopened -CARD 59 - GrenzTruppen* +CARD 59 - Grenztruppen* # -1 modifier for Democratic Support Checks in East Germany the rest of this turn. grenztruppen -- cgit v1.2.3 From b6f3751c0916edd0fec4be767b833ac1656b30ae Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 06:08:55 +0000 Subject: Update handling of Securitate --- events.txt | 4 ++++ rules.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 01102f4..bbe4220 100644 --- a/events.txt +++ b/events.txt @@ -525,7 +525,11 @@ endif CARD 70 - Securitate* # The Democrat must reveal his battlecards at the start of the Power Struggles in Romania. This event remains in effect until cancelled by Army Backs the Revolution event. +if !game.persistent_events.includes(C_ARMY_BACKS_REVOLUTION) securitate +else +army_block +endif CARD 71 - Kiss of Death* diff --git a/rules.js b/rules.js index 95c8530..189abb3 100644 --- a/rules.js +++ b/rules.js @@ -323,7 +323,7 @@ function start_game() { // Set variable event cards where event is playable at start of game - game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_SECURITATE, C_MALTA_SUMMIT] + game.playable_cards = [C_THE_WALL, C_GORBACHEV_CHARMS_THE_WEST, C_HONECKER, C_COMMON_EUROPEAN_HOME, C_MALTA_SUMMIT] draw_cards(game.strategy_deck, game.democrat_hand, game.communist_hand, game.dem_hand_limit, game.com_hand_limit) @@ -4633,12 +4633,17 @@ function vm_army_backs_revolution() { if (game.persistent_events.includes(C_SECURITATE)) { permanently_remove(C_SECURITATE) } - game.playable_cards = game.playable_cards.filter(n => n !== C_SECURITATE) add_to_persistent_events(C_ARMY_BACKS_REVOLUTION) logi(`C${C_SECURITATE} no longer has any effect`) vm_next() } +function vm_army_block() { + permanently_remove(C_SECURITATE) + logi(`Has no effect after C${C_ARMY_BACKS_REVOLUTION}`) + vm_next() +} + function vm_austria_hungary_border_reopened() { add_to_persistent_events(C_AUSTRIA_HUNGARY_BORDER_REOPENED) logi(`For the remainder of the turn, cards played by the Democrat have +1 Ops value if all Operations Points are used in East Germany`) @@ -8479,7 +8484,11 @@ CODE[69] = [ // Systematization* ] CODE[70] = [ // Securitate* + [ vm_if, ()=>!game.persistent_events.includes(C_ARMY_BACKS_REVOLUTION) ], [ vm_securitate ], + [ vm_else ], + [ vm_army_block ], + [ vm_endif ], [ vm_return ], ] -- cgit v1.2.3 From d4718cfbd613e6b906653270b1ac0e14e82b87d7 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 06:17:21 +0000 Subject: Award Civic Forum VP before adding influence --- events.txt | 2 ++ rules.js | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index bbe4220..39de8fc 100644 --- a/events.txt +++ b/events.txt @@ -701,6 +701,8 @@ endif 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 +civic_forum_prep valid_spaces_country 'Czechoslovakia' prompt 'Czechoslovakia' add_infl_free 4 diff --git a/rules.js b/rules.js index 189abb3..061d615 100644 --- a/rules.js +++ b/rules.js @@ -4710,22 +4710,24 @@ function vm_central_committee_reshuffle() { game.state = 'vm_central_committee_reshuffle' } -function vm_civic_forum() { +function vm_civic_forum_prep() { log('+1 VP') game.vp++ if (check_vp()) { return } + vm_next() +} + +function vm_civic_forum() { if (check_dem_control(S_CZECH_WRITERS)) { vm_next() } else { - permanently_remove(C_CIVIC_FORUM) vm_return() } } function vm_common_european_home() { - if (game.active === DEM) { for (let c of game.democrat_hand) { if (cards[c].side === 'C') { @@ -8660,6 +8662,8 @@ CODE[89] = [ // Domino Theory* ] CODE[90] = [ // Civic Forum* + [ vm_permanently_remove ], + [ vm_civic_forum_prep ], [ vm_valid_spaces_country, 'Czechoslovakia' ], [ vm_prompt, 'Czechoslovakia' ], [ vm_add_infl_free, 4 ], -- cgit v1.2.3 From 94f9cbdf3256ddc92525769d4e418217631b7886 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Thu, 21 Nov 2024 14:06:02 +0000 Subject: Updates to logging and prompts --- events.txt | 4 +++- rules.js | 40 ++++++++++++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 11 deletions(-) (limited to 'events.txt') diff --git a/events.txt b/events.txt index 39de8fc..5823e7d 100644 --- a/events.txt +++ b/events.txt @@ -696,6 +696,8 @@ permanently_remove if !is_auto_resolve(C_DOMINO_THEORY) prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' domino_theory +else +domino_theory_pass endif @@ -773,7 +775,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu if game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) -valid_spaces 'Cluj-Napoca' +cluj_check prompt 'the Romanian Elite Space' remove_x_opp_infl 4 the_tyrant_is_gone diff --git a/rules.js b/rules.js index 4d5fb23..dec489d 100644 --- a/rules.js +++ b/rules.js @@ -564,7 +564,7 @@ states.confirm_card = { inactive: 'choose a card.', prompt() { let scoring_cards_count = count_scoring_cards() - view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -1894,7 +1894,7 @@ states.stasi_end_round = { states.stasi_confirm_scoring_card = { inactive: 'choose a card.', prompt() { - view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -3055,10 +3055,8 @@ function is_auto_resolve(card) { } } else if (card === C_DOMINO_THEORY) { if (game.revolutions.filter(value => value === true).length < 2) { - logi('Democrat holds power in fewer than 2 countries') return true } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { - if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') } return true } } else if (card === C_UNION_OF_DEMOCRATIC_FORCES && game.active === COM) { @@ -4541,20 +4539,23 @@ function vm_remove_all_infl() { function vm_do_remove_all_infl(space) { push_undo() - log(`Removed all SP from %${space}`) if (game.remove_opponent_infl === true) { if (game.active === COM) { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } else { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } check_tyrant() } else { if (game.active === COM) { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } else { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } check_tyrant() @@ -4720,6 +4721,13 @@ function vm_civic_forum() { } } +function vm_cluj_check(){ + if (game.comInfl[S_CLUJ_NAPOCA] > 0 ) { + game.valid_spaces.push(S_CLUJ_NAPOCA) + } + vm_next() +} + function vm_common_european_home() { if (game.active === DEM) { for (let c of game.democrat_hand) { @@ -4773,6 +4781,15 @@ function vm_domino_theory() { game.state = 'vm_play_event_from_discard' } +function vm_domino_theory_pass() { + if (game.revolutions.filter(value => value === true).length < 2) { + logi('Democrat holds power in fewer than 2 countries') + } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { + logi('No scoring cards in discard') + } + vm_next() +} + function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) @@ -5712,7 +5729,8 @@ states.vm_remove_infl = { space(space) { remove_infl(space, 'vm_available_ops') game.vm_active_country = spaces[space].country - if (game.vm_event !== C_INFLATIONARY_CURRENCY) { + let require_done = [C_INFLATIONARY_CURRENCY, C_THE_WALL_MUST_GO] + if (!require_done.includes(game.vm_event)) { if (game.vm_available_ops === 0 ) { do_log_summary() vm_next() @@ -6002,7 +6020,7 @@ states.vm_adamec = { logi(`-${worker_spaces} from Democrat controlled worker spaces`) roll -= worker_spaces } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll > 2) { log_msg_gap('Adamec succeeds') vm_next() @@ -7211,7 +7229,7 @@ states.vm_shock_therapy = { } log(`Roll: D${roll}`) logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) - log(`Modified roll: ${roll - worker_farmer}`) + log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { log('C93 is successful. +3 VP') vm_next() @@ -7628,7 +7646,7 @@ states.vm_workers_revolt_finish = { logi(`-${adj.dem_adj} from opponent controlled spaces`) roll -= adj.dem_adj } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll >= 4) { log('Workers Revolt successful') vm_replace_all_infl(game.selected_space) @@ -8653,6 +8671,8 @@ CODE[89] = [ // Domino Theory* [ vm_if, ()=>!is_auto_resolve(C_DOMINO_THEORY) ], [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_domino_theory ], + [ vm_else ], + [ vm_domino_theory_pass ], [ vm_endif ], [ vm_return ], ] @@ -8730,7 +8750,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_cluj_check ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], -- cgit v1.2.3