summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-28 12:35:15 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-28 12:35:15 +0100
commit71e67158a9833bb85c41abff755b4c02bbda3dd1 (patch)
tree1c67b8181109aa788ee4ccd02be6dfe77187e944
parent00fb40ce2e89a8fe0945457d0f5a03e67be0a18f (diff)
download1989-dawn-of-freedom-71e67158a9833bb85c41abff755b4c02bbda3dd1.tar.gz
Updates Kremlin Coup
-rw-r--r--rules.js58
1 files changed, 55 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index 6b26936..0726b03 100644
--- a/rules.js
+++ b/rules.js
@@ -3322,12 +3322,14 @@ function new_turn() {
if (game.persistent_events['frg_embassies']) {
game.persistent_events['frg_embassies'] = false
log(`C74 no longer in effect`)
+ discard_from_table(74)
//permanently_remove(74)
}
if (game.persistent_events['genscher']) {
game.persistent_events['genscher'] = false
log(`C63 no longer in effect`)
+ discard_from_table(63)
//permanently_remove(63)
}
@@ -5504,6 +5506,14 @@ function vm_support_falters() {
game.state = 'vm_support_falters'
}
+function vm_kremlin_coup_elite() {
+ elite_spaces.forEach(space => {
+ if (spaces[space].country === game.vm_active_country && !check_com_control(space)) {
+ game.valid_spaces.push(space);
+ }
+ })
+ game.state = 'vm_kremlin_coup_take_control'
+}
/* ================== VM STATES ============================== */
@@ -6599,7 +6609,49 @@ states.vm_kremlin_coup_choose_country = {
}
}
}
- }
+ },
+ east_germany() {
+ push_undo()
+ game.vm_active_country = 'East_Germany'
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ vm_kremlin_coup_elite()
+ },
+ poland() {
+ push_undo()
+ game.vm_active_country = 'Poland'
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ vm_kremlin_coup_elite()
+ },
+ czechoslovakia() {
+ push_undo()
+ game.vm_active_country = 'Czechoslovakia'
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ vm_kremlin_coup_elite()
+ },
+ hungary() {
+ push_undo()
+ game.vm_active_country = 'Hungary'
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ vm_kremlin_coup_elite()
+ },
+ romania() {
+ push_undo()
+ game.vm_active_country = 'Romania'
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ vm_kremlin_coup_elite()
+ },
+ bulgaria () {
+ push_undo()
+ game.vm_active_country = 'Bulgaria'
+ log(`Chose ${country_name(game.vm_active_country)}`)
+ game.temp = game.temp.filter(country => country !== game.vm_active_country)
+ vm_kremlin_coup_elite()
+ },
}
states.vm_kremlin_coup_take_control = {
@@ -6608,10 +6660,10 @@ states.vm_kremlin_coup_take_control = {
},
prompt() {
if (game.valid_spaces.length === 0){
- view.prompt = 'No spaces remaining. Kremlin Coup: done.'
+ view.prompt = 'Kremlin Coup. Elite space controlled: done.'
gen_action('done')
} else {
- view.prompt = `Kremlin Coup: Take control of Elite spaces in countries where the Communist retains power.`
+ view.prompt = `Kremlin Coup: Take control of the Elite spaces in ${country_name(game.vm_active_country)}.`
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}