summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js103
1 files changed, 69 insertions, 34 deletions
diff --git a/rules.js b/rules.js
index b7de6ec..e454215 100644
--- a/rules.js
+++ b/rules.js
@@ -1753,6 +1753,11 @@ states.end_turn_4_5_4 = {
}
else if (game.persistent_events.includes(104)) {
log_h1(`New Year's Eve Party`)
+ //Check if the Communist receives VP from The Tyrant is Gone
+ if (game.persistent_events.includes(97)) {
+ game.vp -= 2
+ log(`Communist receives 2 VP from C97`)
+ }
game.persistent_events.push(111)
game.state = 'new_years_eve_party'
}
@@ -2798,7 +2803,7 @@ function do_tst_attempt() {
log(`Rolled a ${roll}`);
roll += game.available_ops
- log(`+${game.available_ops} from card Ops`)
+ log(`+${game.available_ops} from card ops`)
// TIANANMEN SQUARE MODIFIERS
@@ -3807,12 +3812,16 @@ function check_control_change(space_id) {
}*/
// Check if the Tyrant is Gone has been fulfilled
+ console.log('check control change_player, game.the_tyrant_is_gone', game.the_tyrant_is_gone)
+ //console.log('dem control', check_dem_control(game.the_tyrant_is_gone))
if (game.the_tyrant_is_gone > 0 && check_dem_control(game.the_tyrant_is_gone)) {
+ console.log('in tyrant')
log('+2 VP from C97')
game.vp += 2
if (check_vp()) {
return
}
+ game.persistent_events = game.persistent_events.filter(n => n !== 97)
delete game.the_tyrant_is_gone
}
}
@@ -5017,7 +5026,7 @@ function vm_common_european_home() {
}
}
game.valid_cards = valid_cards
- game.state = 'vm_common_european_home'
+ game.state = 'vm_common_european_home_choose'
}
function vm_dash_for_the_west() {
@@ -5300,7 +5309,7 @@ function vm_kohl_proposes_reunification() {
}
if (game.persistent_events.includes(86)) {
game.vm_event = 87
- game.state = 'vm_common_european_home'
+ game.state = 'vm_common_european_home_play'
} else {
permanently_remove(87)
vm_return()
@@ -6411,26 +6420,14 @@ states.vm_central_committee_reshuffle = {
}
-states.vm_common_european_home = {
+states.vm_common_european_home_choose = {
get inactive() {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- if (game.vm_event === 0) {
- view.prompt = `Common European Home: play an opponent's card, event does not occur.`
- for (let card of game.valid_cards) {
- gen_action_card(card)
- }
- } else {
- view.prompt = `Play ${clean_name(cards[game.vm_event].name)} for:`
- gen_action('influence')
- gen_action('support_check')
- if (game.active === DEM && game.vm_event === 87 ) {
- return /*Special condition if card is actually Kohl Proposes Reunification*/
- }
- if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 || game.active === COM && game.com_tst_attempted_this_turn === 0) {
- gen_action('tst')
- }
+ view.prompt = `Common European Home: play an opponent's card, event does not occur.`
+ for (let card of game.valid_cards) {
+ gen_action_card(card)
}
},
card(card) {
@@ -6439,6 +6436,24 @@ states.vm_common_european_home = {
game.valid_cards = []
silent_discard(card)
game.vm_event = card
+ game.state = 'vm_common_european_home_play'
+ }
+}
+
+states.vm_common_european_home_play = {
+ get inactive() {
+ return `resolve ${clean_name(cards[this_card()].name)}.`
+ },
+ prompt() {
+ view.prompt = `Play ${clean_name(cards[this_card()].name)} for:`
+ gen_action('influence')
+ gen_action('support_check')
+ if (game.active === DEM && game.vm_event === 87 ) {
+ return /*Special condition if card is actually Kohl Proposes Reunification*/
+ }
+ if (game.active === DEM && game.dem_tst_attempted_this_turn === 0 || game.active === COM && game.com_tst_attempted_this_turn === 0) {
+ gen_action('tst')
+ }
},
influence(){
push_undo()
@@ -6981,7 +6996,7 @@ states.vm_kremlin_coup_choose_country = {
}
}
} else {
- view.prompt = 'Kremlin Coup! Done.'
+ view.prompt = 'Kremlin Coup! There are no countries where the Communist retains power.'
gen_action('done')
}
},
@@ -6989,41 +7004,41 @@ states.vm_kremlin_coup_choose_country = {
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)}`)
+ log(`${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)}`)
+ log(`${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)}`)
+ log(`${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)}`)
+ log(`${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)}`)
+ log(`${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)}`)
+ log(`${country_name(game.vm_active_country)}:`)
game.temp = game.temp.filter(country => country !== game.vm_active_country)
vm_kremlin_coup_elite()
},
@@ -7049,9 +7064,14 @@ states.vm_kremlin_coup_take_control = {
}
},
infl(space) {
- vm_take_control(space)
- game.state = 'vm_kremlin_coup_sc_prep'
- return
+ vm_take_control(space)
+ 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'
},
done() {
if (game.vm_active_country === 'East_Germany') {game.selected_space = 3 }
@@ -7069,7 +7089,7 @@ states.vm_kremlin_coup_sc_prep = {
return `resolve ${clean_name(cards[game.played_card].name)}.`
},
prompt() {
- view.prompt = `Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.`
+ view.prompt = `Kremlin Coup! Conduct a support check in ${game.vm_active_country}'s Bureaucratic space.`
gen_action_sc(spaces[game.selected_space].name_unique);
},
sc(space) {
@@ -7087,8 +7107,24 @@ states.vm_kremlin_coup_sc = {
roll() {
clear_undo()
do_sc(spaces[game.selected_space].name_unique)
- game.state = 'vm_kremlin_coup_choose_country'
- return
+ if (game.temp.length > 0 ){
+ game.state = 'vm_kremlin_coup_choose_country'
+ } else {
+ game.state = 'vm_kremlin_coup_end'
+ }
+ }
+}
+
+states.vm_kremlin_coup_end = {
+ get inactive() {
+ return `resolve ${clean_name(cards[this_card()].name)}.`
+ },
+ prompt() {
+ view.prompt = `${clean_name(cards[this_card()].name)}: done.`
+ gen_action('done')
+ },
+ done() {
+ vm_next()
}
}
@@ -8087,6 +8123,7 @@ states.vm_tst_6_sc = {
clear_undo()
do_sc(spaces[game.selected_space].name_unique)
game.vm_available_ops--
+ game.valid_spaces = []
game.state = 'vm_tst_6'
return
}
@@ -9044,8 +9081,6 @@ 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_permanently_remove ],
[ vm_return ],
]