diff options
-rw-r--r-- | rules.js | 128 |
1 files changed, 94 insertions, 34 deletions
@@ -430,7 +430,6 @@ states.choose_card = { },
card(card) {
push_undo()
- game.vp = 19
game.played_card = card
let find_card
if (game.active === COM) {
@@ -468,7 +467,9 @@ states.choose_card = { if (game.active === DEM && game.persistent_events['ligachev'] && card !== 14) {
log('-3 VP from C99')
game.vp -= 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.persistent_events['ligachev'] = false
}
game.state = 'play_card'
@@ -563,11 +564,15 @@ states.play_card ={ if (game.active === DEM) {
game.vp --
log('-1 VP')
- check_vp()
+ if (check_vp()) {
+ return
+ }
} else {
game.vp ++
log('+1 VP')
- check_vp()
+ if (check_vp()) {
+ return
+ }
}
}
// Check if card is opponent card with event that needs to be resolved
@@ -1653,7 +1658,9 @@ states.finish_scoring ={ game.state = 'new_years_eve_party'
return
}
- check_vp()
+ if (check_vp()) {
+ return
+ }
reset_power()
end_round()
}
@@ -2151,7 +2158,9 @@ function do_sc(space) { if (game.active === COM && game.persistent_events['helsinki_final_act'] && (spaces[clicked_space].socio === 5 || spaces[clicked_space].socio === 6) ) {
log('+1 VP from C26')
game.vp ++
- check_vp()
+ if (check_vp()) {
+ return
+ }
}
// Continue with Support Check Logic
@@ -2313,7 +2322,9 @@ function do_sc(space) { if (game.active === COM && game.persistent_events['eco_glasnost'] && spaces[clicked_space].space_id === 66) {
log_msg_gap('+1 VP from Eco Glasnost')
game.vp++
- check_vp()
+ if (check_vp()) {
+ return
+ }
}
// If Austria-Hungary Border Reopened used, all future support checks must be in East Germany
@@ -2898,9 +2909,12 @@ function permanently_remove(card) { function check_vp() {
if (game.vp >= 20) {
goto_game_over(DEM, `${DEM} won an Automatic Victory!`)
+ return true
} else if(game.vp <= -20) {
goto_game_over(COM, `${COM} won an Automatic Victory!`)
+ return true
}
+ return false
}
function game_over() {
@@ -4033,6 +4047,7 @@ function vm_active_country () { function vm_take_control_prep() {
game.vm_available_ops = vm_operand(1)
game.state = 'vm_take_control'
+ console.log('in vm_take_control_prep game.state', game.state)
}
function vm_take_control(space) {
@@ -4447,7 +4462,9 @@ function vm_40th_anniversary_celebration() { function vm_40th_anniversary_celebration_vp() {
game.vp --
log('-1VP')
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
}
@@ -4481,7 +4498,9 @@ function vm_breakaway_baltic_republics() { log('+5 VP')
game.vp += 5
game.stability++
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.playable_cards[109].playable = 1
game.playable_cards[14].playable = 0
if (game.pieces[56].demCtrl === 0 && game.persistent_events['systematization'] !== 56) {game.valid_spaces.push(56)}
@@ -4502,7 +4521,9 @@ function vm_bulgarian_turks_expelled(){ game.remove_opponent_infl = true
game.vp -= 2
log('-2VP')
- check_vp()
+ if (check_vp()) {
+ return
+ }
if (game.pieces[70].demInfl > 0) {game.valid_spaces = [70]}
vm_next()
}
@@ -4531,7 +4552,9 @@ function vm_central_committee_reshuffle() { function vm_civic_forum() {
log('+1 VP')
game.vp++
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.persistent_events['civic_forum'] = true
if (game.pieces[31].demCtrl === 1) {
vm_next()
@@ -4637,12 +4660,15 @@ function vm_eliminate(space_id) { // Clear the adjacency list of the clicked space
game.pieces[space_id].adjacent = [];
- // Eliminate the democrat influence and move the communist influence to Bucharesti
+ // Eliminate the democrat influence and move the communist influence to Bucuresti
game.pieces[space_id].demInfl = 0
game.pieces[61].comInfl += game.pieces[space_id].comInfl
- log(`${game.pieces[space_id].comInfl} Communist influence relocated to Bucharesti`)
+ log(`${game.pieces[space_id].comInfl} Communist influence relocated to Bucuresti`)
game.pieces[space_id].comInfl = 0
+
+ //Update control in the eliminated space and in Bucuresti
check_control_change(space_id)
+ check_control_change(61)
}
@@ -4653,7 +4679,9 @@ function vm_exit_visas() { function vm_foreign_currency_debt_burden() {
log('+1VP')
game.vp++
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.table_cards.push(49)
game.state = 'vm_foreign_currency_debt_burden'
}
@@ -4733,7 +4761,9 @@ function vm_heal_our_bleeding_wounds() { else change_vp = 3
log(`${change_vp} VP`)
game.vp += change_vp
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
}
@@ -4792,7 +4822,9 @@ function vm_klaus_and_komarek() { function vm_kohl_proposes_reunification() {
log('+2 VP')
game.vp += 2
- check_vp()
+ if (check_vp()) {
+ return
+ }
if (game.persistent_events['the_wall_must_go']) {
game.vm_event = 87
game.state = 'vm_common_european_home'
@@ -4806,7 +4838,9 @@ function vm_kohl_proposes_reunification() { function vm_kremlin_coup() {
log('-3 VP')
game.vp -= 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
elite_spaces.forEach(space => {
if (!game.revolutions[spaces[space].country]) {
@@ -4991,7 +5025,9 @@ function vm_sajudis() { game.stability++
log('+1 VP')
game.vp++
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
}
@@ -5066,7 +5102,10 @@ function vm_the_baltic_way() { if (game.pieces[70].demCtrl === 0 && game.persistent_events['systematization'] !== 70) {game.valid_spaces.push(70)}
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
+ console.log('game.state', game.state)
vm_next()
}
@@ -5853,7 +5892,9 @@ states.vm_dash_for_the_west = { log(`More than the ${com_control} Communist controlled spaces in East Germany`)
log('+1 VP')
game.vp++
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.discard = true
game.state = 'vm_play_event_from_discard'
} else {
@@ -6482,7 +6523,9 @@ states.vm_malta_summit = { log('Summit successful')
game.vp += 3
log('+3 VP')
- check_vp()
+ if (check_vp()) {
+ return
+ }
if (game.pieces[12].comInfl > 0 ) {game.valid_spaces.push(12)}
if (game.pieces[15].comInfl > 0 ) {game.valid_spaces.push(15)}
if (game.pieces[27].comInfl > 0 ) {game.valid_spaces.push(27)}
@@ -6582,7 +6625,9 @@ states.vm_new_years_eve_party = { log(`Communist holds power in ${power} countries. +3 VP`)
game.vp += 3
}
- check_vp()
+ if (check_vp()) {
+ return
+ }
game.table_cards.push(104)
vm_next()
},
@@ -6860,25 +6905,26 @@ states.vm_systematization = { return `resolve ${cards[game.played_card].name}.`
},
prompt() {
- if (game.persistent_events['systematization'] === 0) {
+ /*if (game.persistent_events['systematization'] === 0) { */
view.prompt = 'Systematization: eliminate a space in Romania.'
for (let space_id of game.valid_spaces) {
gen_action_infl(spaces[space_id].name_unique);
}
- } else {
+ /*} else {
view.prompt = 'Systematization: done.'
gen_action('done')
- }
+ }*/
},
infl(space) {
push_undo()
vm_eliminate(find_space_index(space))
game.valid_spaces = []
game.persistent_events['systematization'] = find_space_index(space)
+ vm_next()
},
- done() {
+/* done() {
vm_next()
- }
+ } */
}
states.vm_the_chinese_solution = {
@@ -6901,7 +6947,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
poland() {
@@ -6910,7 +6958,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
czechoslovakia() {
@@ -6919,7 +6969,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
hungary() {
@@ -6928,7 +6980,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
romania() {
@@ -6937,7 +6991,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
bulgaria () {
@@ -6946,7 +7002,9 @@ states.vm_the_chinese_solution = { log(`Chose ${country_name(game.vm_active_country)}`)
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
vm_next()
},
pass() {
@@ -7054,7 +7112,9 @@ states.vm_the_wall_must_go = { game.persistent_events['the_wall_must_go'] = true
log('+3 VP')
game.vp += 3
- check_vp()
+ if (check_vp()) {
+ return
+ }
for (let space of game.pieces) {
if (space) {console.log('space.space_id', space.space_id)}
if (space && spaces[space.space_id].country === 'East_Germany' && space.comInfl > 0){
|