diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 125 |
1 files changed, 91 insertions, 34 deletions
@@ -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 - |