From 87c05a92a3c95c8681a1b84e4cdcdbd2b1623224 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 28 Sep 2024 12:44:38 +0100 Subject: Updates Kremlin Coup --- rules.js | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/rules.js b/rules.js index d35eaaa..d3857ab 100644 --- a/rules.js +++ b/rules.js @@ -6596,7 +6596,7 @@ states.vm_kremlin_coup_choose_country = { }, prompt() { if (game.temp.length > 0) { - view.prompt = 'Select a country where the Communist retains power.' + view.prompt = 'Kremlin Coup! Select a country where the Communist retains power.' for (let country of countries) { console.log(`checking`, country) if (game.temp.includes(country)) { @@ -6604,6 +6604,9 @@ states.vm_kremlin_coup_choose_country = { gen_action(`${country.toLowerCase()}`) } } + } else { + view.prompt = 'Kremlin Coup! Done.' + gen_action('done') } }, east_germany() { @@ -6648,6 +6651,9 @@ states.vm_kremlin_coup_choose_country = { game.temp = game.temp.filter(country => country !== game.vm_active_country) vm_kremlin_coup_elite() }, + done() { + vm_next() + } } states.vm_kremlin_coup_take_control = { @@ -6667,18 +6673,15 @@ states.vm_kremlin_coup_take_control = { }, infl(space) { vm_take_control(space) - game.vm_active_country = spaces[find_space_index(space)].country - console.log('space', find_space_index(space), 'country', game.vm_active_country) - if (game.vm_active_country === 'East_Germany') {game.temp = 3 } - if (game.vm_active_country === 'Poland') {game.temp = 17} - if (game.vm_active_country === 'Czechoslovakia') {game.temp = 29} - if (game.vm_active_country === 'Hungary') {game.temp = 45} - if (game.vm_active_country === 'Romania') {game.temp = 61} - if (game.vm_active_country === 'Bulgaria') {game.temp = 68} - game.valid_spaces.push(game.temp) - game.state = 'vm_kremlin_coup_sc_prep' }, done() { + 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} + game.state = 'vm_kremlin_coup_sc_prep' vm_next() } } @@ -6689,10 +6692,10 @@ states.vm_kremlin_coup_sc_prep = { }, prompt() { view.prompt = `Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.` - gen_action_sc(spaces[game.temp].name_unique); + gen_action_sc(spaces[game.selected_space].name_unique); }, sc(space) { - game.selected_space = find_space_index(space) + //game.selected_space = find_space_index(space) game.state = 'vm_kremlin_coup_sc' } } @@ -6700,13 +6703,13 @@ states.vm_kremlin_coup_sc_prep = { states.vm_kremlin_coup_sc = { inactive: 'do support checks', prompt () { - view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die` + view.prompt = `Support check: ${spaces[game.selected_space].name_unique}. Roll a die.` gen_action('roll') }, roll() { clear_undo() do_sc(spaces[game.selected_space].name_unique) - game.state = 'vm_kremlin_coup_take_control' + game.state = 'vm_kremlin_coup_choose_country' return } } @@ -8629,8 +8632,8 @@ CODE[108] = [ // Army Backs Revolution* CODE[109] = [ // Kremlin Coup* [ vm_kremlin_coup ], - [ vm_prompt, 'Elite spaces in all countries where the Communist retains Power' ], - [ vm_take_control_prep, 6 ], + //[ vm_prompt, 'Elite spaces in all countries where the Communist retains Power' ], + //[ vm_take_control_prep, 6 ], [ vm_permanently_remove ], [ vm_return ], ] -- cgit v1.2.3