From a578ed25a36a16207c2eb01fc095b78888723ba9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 19 Apr 2025 11:52:08 +0100 Subject: Fix events with coups under Foreign Currency Debt Burden --- events.txt | 2 +- rules.js | 26 +++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/events.txt b/events.txt index cedcd6c..546120d 100644 --- a/events.txt +++ b/events.txt @@ -593,7 +593,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 +vm_valid_spaces_socio_2_sc SOCIO_STUDENT SOCIO_INTELLECTUALS support_check_modified 2 2 endif diff --git a/rules.js b/rules.js index d1f2984..bb0cbcb 100644 --- a/rules.js +++ b/rules.js @@ -4657,6 +4657,13 @@ function vm_valid_spaces_socio() { vm_next() } +function vm_valid_spaces_socio_2_sc() { + let socios = [vm_operand(1), vm_operand(2)] + valid_spaces_sc() + game.valid_spaces = game.valid_spaces.filter(s => socios.includes(spaces[s].socio)) + vm_next() +} + function vm_valid_spaces_opponent_socio() { let valid_spaces = [] for (let i = 0; i < spaces.length; i++) { @@ -7310,14 +7317,27 @@ states.vm_kremlin_coup_take_control = { states.vm_kremlin_coup_sc_prep = { prompt() { - view.prompt = `Kremlin Coup! Conduct a Support Check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` - gen_action_space(game.selected_space) + if (game.foreign_currency_debt_burden === game.vm_active_country) { + view.prompt = `Kremlin Coup! May not Support Check in ${country_name(game.vm_active_country)} due to Foreign Currency Debt Burden.` + gen_action('done') + } else { + view.prompt = `Kremlin Coup! Conduct a Support Check in ${country_name(game.vm_active_country)}'s Bureaucratic space.` + gen_action_space(game.selected_space) + } }, space(_space) { push_undo() log('Support check:') game.state = 'vm_kremlin_coup_sc' }, + done() { + push_undo() + if (game.temp.length > 0) { + game.state = 'vm_kremlin_coup_choose_country' + } else { + vm_next() + } + } } states.vm_kremlin_coup_sc = { @@ -9106,7 +9126,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_socio_2_sc, SOCIO_STUDENT, SOCIO_INTELLECTUAL ], [ vm_support_check_modified, 2, 2 ], [ vm_endif ], [ vm_return ], -- cgit v1.2.3