diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-03 12:29:49 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-03 12:29:49 +0000 |
commit | 4e6c9fb098aadf7933d74caf8aca9c1e8df4c0b3 (patch) | |
tree | dc64fe9aeb434fbd79d76a7f9079df74fa625629 /rules.js | |
parent | 0f97242b7812957b63fe11b33246260ad7eb8e3c (diff) | |
download | 1989-dawn-of-freedom-4e6c9fb098aadf7933d74caf8aca9c1e8df4c0b3.tar.gz |
Add check held scoring card warning under Stasi
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 61 |
1 files changed, 39 insertions, 22 deletions
@@ -1047,6 +1047,7 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 2 game.com_pwr_hand_limit -= 2 game.persistent_events = game.persistent_events.filter(n => n !== C_ROUNDTABLE_TALKS) + game.strategy_discard.push(C_ROUNDTABLE_TALKS) } if (game.persistent_events.includes(C_PEASANT_PARTIES_REVOLT)) { @@ -1061,7 +1062,6 @@ states.draw_power_cards = { game.dem_pwr_hand_limit += 1 game.com_pwr_hand_limit -= 1 permanently_remove(C_PEASANT_PARTIES_REVOLT) - game.persistent_events = game.persistent_events.filter(n => n !== C_PEASANT_PARTIES_REVOLT) } } @@ -1070,7 +1070,6 @@ states.draw_power_cards = { game.dem_pwr_hand_limit -= 2 game.com_pwr_hand_limit += 2 permanently_remove(C_NATIONAL_SALVATION_FRONT) - game.persistent_events = game.persistent_events.filter(n => n !== C_NATIONAL_SALVATION_FRONT) } //Draw Power Cards @@ -1927,6 +1926,11 @@ states.stasi_end_round = { push_undo() log_gap(`Democrat selected C${card} as next card.`) game.stasi_card = card + if (!scoring_cards.includes(card) && count_scoring_cards() >= (7-game.round)){ + game.temp = card + game.state = 'stasi_confirm_scoring_card' + return + } game.state = 'stasi_finish' }, pass() { @@ -1936,6 +1940,18 @@ states.stasi_end_round = { }, } +states.stasi_confirm_scoring_card = { + inactive: 'choose a card.', + prompt() { + view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + gen_action('continue') + }, + continue() { + push_undo() + end_stasi_choose_card() + } +} + states.stasi_finish = { inactive: 'choose next card due to Stasi.', prompt() { @@ -1944,11 +1960,7 @@ states.stasi_finish = { }, done() { push_undo() - if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { - game.state = 'stasi_confirm' - } else { - end_stasi_choose_card() - } + end_stasi_choose_card() } } @@ -2287,7 +2299,7 @@ function do_sc(space) { game.valid_spaces = game.valid_spaces.filter(n => spaces[n].country === 'East_Germany') } } - game.selected_space = 0 + delete game.selected_space } function valid_spaces_setup() { @@ -2860,7 +2872,7 @@ function get_aftermath_roll() { function add_to_persistent_events(card) { game.persistent_events.push(card) remove_from_discard(card) - log(`C${card} in effect:`) + if (card !== C_SYSTEMATIZATION) {log(`C${card}:`)} } function permanently_remove(card) { @@ -2912,16 +2924,20 @@ function reset_austria_hungary_border_reopened() { } function end_stasi_choose_card() { - game.round_player = COM - game.round ++ - log_h2(`Action Round ${game.round}`) - next_player() - game.valid_spaces = [] - if (game.persistent_events.includes(5)) { - log_h3('C5') - game.state = 'general_strike' + if (game.stasi_card === C_COMMON_EUROPEAN_HOME) { + game.state = 'stasi_confirm' } else { - game.state = 'choose_card' + game.round_player = COM + game.round ++ + log_h2(`Action Round ${game.round}`) + next_player() + game.valid_spaces = [] + if (game.persistent_events.includes(5)) { + log_h3('C5') + game.state = 'general_strike' + } else { + game.state = 'choose_card' + } } } @@ -3236,9 +3252,11 @@ function end_round() { } } else if (game.turn <=7) { if (card_check.length !== 81) { + console.log('cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } } else if (card_check.length !== 110) { + console.log('cards in game', card_check) throw new Error(`Wrong number of cards: ${card_check.length}`) } @@ -4367,7 +4385,7 @@ function vm_remove_limited_opp_infl() { function vm_do_remove_limited_infl(space, max_infl) { push_undo() - log(`Removed SP from %${space}.`) + log(`Removed 1 SP from %${space}.`) game.vm_available_ops -- if (!game.vm_influence_added) { @@ -7131,7 +7149,7 @@ states.vm_systematization = { vm_eliminate(space) game.valid_spaces = [] game.systematization = space - //game.persistent_events.push(C_SYSTEMATIZATION) /*IS THIS STILL NEEDED? For view?*/ + add_to_persistent_events(C_SYSTEMATIZATION) vm_next() }, } @@ -7457,7 +7475,7 @@ states.vm_workers_revolt_finish = { log('Workers Revolt successful') vm_replace_all_infl(game.temp) } else {log('Workers Revolt fails. Required 4 or more')} - game.selected_space = 0 + delete game.selected_space vm_next() }, } @@ -8278,7 +8296,6 @@ CODE[68] = [ // Klaus and Komarek* ] CODE[69] = [ // Systematization* - [ vm_permanently_remove ], [ vm_valid_spaces_country, 'Romania' ], [ vm_systematization ], [ vm_return ], |