From e699e5d0fbd401a2e1a8dd13c54d54221327eabc Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sat, 28 Sep 2024 16:16:14 +0100 Subject: Add Tyrant is Gone to end game scoring --- events.txt | 2 +- rules.js | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/events.txt b/events.txt index aac0f46..b368b7c 100644 --- a/events.txt +++ b/events.txt @@ -249,7 +249,7 @@ permanently_remove CARD 36 - Dash for the West* # Roll a die. If the die roll exceeds the number of Communist controlled spaces in Germany, +1 VP and select any Blue Event with asterisk(*) from the discard pile. The event occurs immediately. permanently_remove -prompt 'select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately.' +prompt 'Dash for the West: select any Democratic event with an asterix(*) from the discard pile. Event occurs immediately' dash_for_the_west diff --git a/rules.js b/rules.js index eb11635..aad8617 100644 --- a/rules.js +++ b/rules.js @@ -425,11 +425,13 @@ states.choose_card = { card(card) { push_undo() //Check if player is at risk of losing game due to held scoring card - let scoring_cards_count = count_scoring_cards() + if (!scoring_cards.includes(card)) { + let scoring_cards_count = count_scoring_cards() - if (scoring_cards_count >= (8-game.round)){ - game.state = 'confirm_card' - return + if (scoring_cards_count >= (8-game.round)){ + game.state = 'confirm_card' + return + } } select_card(card) }, @@ -446,7 +448,7 @@ states.confirm_card = { inactive: 'choose a card.', prompt() { let scoring_cards_count = count_scoring_cards() - view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${8-game.round} standard turns remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -1659,8 +1661,15 @@ states.end_turn_4_5_4 = { } else if(game.turn === 10) { clear_undo() - game.state = 'final_scoring_held' log_h2('Final Scoring') + + //Check if the Communist receives VP from The Tyrant is Gone + if (game.persistent_events['the_tyrant_is_gone'] > 0) { + game.vp -= 2 + log(`Communist receives 2 VP from C97`) + } + game.state = 'final_scoring_held' + } else { game.return_state = '' new_turn() @@ -3044,7 +3053,7 @@ function count_scoring_cards() { if (game.active === DEM) { scoring_check = game.democrat_hand.filter(card => scoring_cards.includes(card)).length } else { - scoring_check = game.democrat_hand.filter(card => scoring_cards.includes(card)).length + scoring_check = game.communist_hand.filter(card => scoring_cards.includes(card)).length } return scoring_check } @@ -6262,6 +6271,7 @@ states.vm_deutsche_marks = { log(`Played C${cards[game.vm_event].number} for influence`) game.vm_available_ops = cards[game.vm_event].ops if (game.persistent_events['perestroika']) {game.vm_available_ops++ } + game.vm_available_ops += game.persistent_events['prudence'].COM valid_spaces_infl() game.state = 'vm_add_infl' }, -- cgit v1.2.3