summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-10-23 20:38:09 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-10-23 20:38:09 +0100
commit61cccf6066db2628b151c185d875381575dfb422 (patch)
tree70ea621128fc337270a23cb39d7c1ebc458a7c97 /rules.js
parente1b09f952f52a0163a969b9c200d8b5fc3c50090 (diff)
download1989-dawn-of-freedom-61cccf6066db2628b151c185d875381575dfb422.tar.gz
Updates for events with edge cases when all countries are/are not in revolution
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js74
1 files changed, 51 insertions, 23 deletions
diff --git a/rules.js b/rules.js
index 4112e7f..3c927eb 100644
--- a/rules.js
+++ b/rules.js
@@ -6839,13 +6839,18 @@ states.vm_central_committee_reshuffle = {
return `resolve ${clean_name(cards[57].name)}.`
},
prompt() {
- 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')}
- if (!game.revolutions[3]) {gen_action('bulgaria')}
- if (!game.revolutions[4]) {gen_action('czechoslovakia')}
- if (!game.revolutions[5]) {gen_action('romania')}
+ if (game.revolutions.every(n => n === true)) {
+ view.prompt = 'Central Committee Reshuffle: no countries to choose.'
+ gen_action('pass')
+ } else {
+ 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')}
+ if (!game.revolutions[3]) {gen_action('bulgaria')}
+ if (!game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (!game.revolutions[5]) {gen_action('romania')}
+ }
},
east_germany() {
push_undo()
@@ -6890,6 +6895,10 @@ states.vm_central_committee_reshuffle = {
game.valid_spaces = [64,65,66,67,68,69,70,71,72,73,74,75]
vm_next()
},
+ pass() {
+ log('Passed')
+ vm_return()
+ }
}
@@ -8045,21 +8054,26 @@ states.vm_shock_therapy = {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- if (game.vm_active_country === '' ) {
- view.prompt = 'Shock Therapy: choose 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')}
- if (game.revolutions[3]) {gen_action('bulgaria')}
- if (game.revolutions[4]) {gen_action('czechoslovakia')}
- if (game.revolutions[5]) {gen_action('romania')}
- } /*else if (game.phase === 2) {
- view.prompt = 'Shock Therapy: done.'
- gen_action('done')
- } */
- else {
- view.prompt = 'Shock Therapy: roll a die.'
- gen_action('roll')
+ if (game.revolutions.every(n => n === false)) {
+ view.prompt = 'Shock Therapy: no countries to choose.'
+ gen_action('pass')
+ } else {
+ if (game.vm_active_country === '' ) {
+ view.prompt = 'Shock Therapy: choose 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')}
+ if (game.revolutions[3]) {gen_action('bulgaria')}
+ if (game.revolutions[4]) {gen_action('czechoslovakia')}
+ if (game.revolutions[5]) {gen_action('romania')}
+ } /*else if (game.phase === 2) {
+ view.prompt = 'Shock Therapy: done.'
+ gen_action('done')
+ } */
+ else {
+ view.prompt = 'Shock Therapy: roll a die.'
+ gen_action('roll')
+ }
}
},
east_germany() {
@@ -8114,6 +8128,10 @@ states.vm_shock_therapy = {
vm_return()
}
},
+ pass() {
+ log('Passed')
+ vm_return()
+ }
/*done() {
permanently_remove(93)
vm_return()
@@ -8125,6 +8143,10 @@ states.vm_social_democratic_platform_adopted = {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
+ if (game.revolutions.every(n => n === false)) {
+ view.prompt = 'Social Democratic Platform Adopted: no countries to choose.'
+ gen_action('pass')
+ } else {
view.prompt = 'Select a country where the Democrat holds Power.'
if (game.revolutions[0]) {gen_action('poland')}
if (game.revolutions[1]) {gen_action('hungary')}
@@ -8132,6 +8154,7 @@ states.vm_social_democratic_platform_adopted = {
if (game.revolutions[3]) {gen_action('bulgaria')}
if (game.revolutions[4]) {gen_action('czechoslovakia')}
if (game.revolutions[5]) {gen_action('romania')}
+ }
},
east_germany() {
push_undo()
@@ -8165,7 +8188,12 @@ states.vm_social_democratic_platform_adopted = {
push_undo()
game.vm_active_country = 'Bulgaria'
log(`Selected ${country_name(game.vm_active_country)}`)
- vm_next()}
+ vm_next()
+ },
+ pass() {
+ log('Passed')
+ vm_return()
+ }
}
states.vm_systematization = {