diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-21 14:06:02 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-21 14:06:02 +0000 |
commit | 94f9cbdf3256ddc92525769d4e418217631b7886 (patch) | |
tree | 1ba82a10ad8740fe67dc555f7ce8f0a19847d715 | |
parent | 7fca67b976e84313e894e0c685f49230891db0d4 (diff) | |
download | 1989-dawn-of-freedom-94f9cbdf3256ddc92525769d4e418217631b7886.tar.gz |
Updates to logging and prompts
-rw-r--r-- | events.txt | 4 | ||||
-rw-r--r-- | rules.js | 40 |
2 files changed, 33 insertions, 11 deletions
@@ -696,6 +696,8 @@ permanently_remove if !is_auto_resolve(C_DOMINO_THEORY) prompt 'Domino Theory: choose a Power Struggle card to play from the discard pile' domino_theory +else +domino_theory_pass endif @@ -773,7 +775,7 @@ support_check_modified 5 3 CARD 97 - The Tyrant is Gone* # Remove 4 Communist SPs from the Romanian Elite Space. The Democrat announces where the Ceausescus flee, choosing a space with no Democratic SPs. If the Democratic Player gains control of the space before the end of the game the Ceausescus are captured, +2 VP. If not they escape, -2 VP. Requires play of The Crowd Turns Against Ceausescu if game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) -valid_spaces 'Cluj-Napoca' +cluj_check prompt 'the Romanian Elite Space' remove_x_opp_infl 4 the_tyrant_is_gone @@ -564,7 +564,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 ${pluralize(8-game.round,'turn')} remaining. Scoring cards may not be held. Continue?` + view.prompt = `${pluralize(scoring_cards_count,'scoring card')} in hand with ${pluralize(8-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -1894,7 +1894,7 @@ 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?` + view.prompt = `${pluralize(count_scoring_cards(),'scoring card')} in hand with ${pluralize(7-game.round,'Action Round')} remaining. Scoring cards may not be held. Continue?` gen_action('continue') }, continue() { @@ -3055,10 +3055,8 @@ function is_auto_resolve(card) { } } else if (card === C_DOMINO_THEORY) { if (game.revolutions.filter(value => value === true).length < 2) { - logi('Democrat holds power in fewer than 2 countries') return true } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { - if (!game.state.startsWith('vm')) { logi('No scoring cards in discard') } return true } } else if (card === C_UNION_OF_DEMOCRATIC_FORCES && game.active === COM) { @@ -4541,20 +4539,23 @@ function vm_remove_all_infl() { function vm_do_remove_all_infl(space) { push_undo() - log(`Removed all SP from %${space}`) if (game.remove_opponent_infl === true) { if (game.active === COM) { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } else { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } check_tyrant() } else { if (game.active === COM) { + log(`Removed all Communist SP from %${space}`) game.comInfl[space] = 0 } else { + log(`Removed all Democratic SP from %${space}`) game.demInfl[space] = 0 } check_tyrant() @@ -4720,6 +4721,13 @@ function vm_civic_forum() { } } +function vm_cluj_check(){ + if (game.comInfl[S_CLUJ_NAPOCA] > 0 ) { + game.valid_spaces.push(S_CLUJ_NAPOCA) + } + vm_next() +} + function vm_common_european_home() { if (game.active === DEM) { for (let c of game.democrat_hand) { @@ -4773,6 +4781,15 @@ function vm_domino_theory() { game.state = 'vm_play_event_from_discard' } +function vm_domino_theory_pass() { + if (game.revolutions.filter(value => value === true).length < 2) { + logi('Democrat holds power in fewer than 2 countries') + } else if (!scoring_cards.some(card => game.strategy_discard.includes(card))) { + logi('No scoring cards in discard') + } + vm_next() +} + function vm_eco_glasnost() { add_to_persistent_events(C_ECO_GLASNOST) logi(`+1 VP for Communist support checks in Ruse for the rest of the game`) @@ -5712,7 +5729,8 @@ states.vm_remove_infl = { space(space) { remove_infl(space, 'vm_available_ops') game.vm_active_country = spaces[space].country - if (game.vm_event !== C_INFLATIONARY_CURRENCY) { + let require_done = [C_INFLATIONARY_CURRENCY, C_THE_WALL_MUST_GO] + if (!require_done.includes(game.vm_event)) { if (game.vm_available_ops === 0 ) { do_log_summary() vm_next() @@ -6002,7 +6020,7 @@ states.vm_adamec = { logi(`-${worker_spaces} from Democrat controlled worker spaces`) roll -= worker_spaces } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll > 2) { log_msg_gap('Adamec succeeds') vm_next() @@ -7211,7 +7229,7 @@ states.vm_shock_therapy = { } log(`Roll: D${roll}`) logi(`-${worker_farmer} from Communist controlled Worker and Farmer spaces`) - log(`Modified roll: ${roll - worker_farmer}`) + log(`Modified roll: ${Math.max(roll - worker_farmer, 0)}`) if ((roll - worker_farmer) > 2) { log('C93 is successful. +3 VP') vm_next() @@ -7628,7 +7646,7 @@ states.vm_workers_revolt_finish = { logi(`-${adj.dem_adj} from opponent controlled spaces`) roll -= adj.dem_adj } - log(`Modified roll: ${roll}`) + log(`Modified roll: ${Math.max(roll, 0)}`) if (roll >= 4) { log('Workers Revolt successful') vm_replace_all_infl(game.selected_space) @@ -8653,6 +8671,8 @@ CODE[89] = [ // Domino Theory* [ vm_if, ()=>!is_auto_resolve(C_DOMINO_THEORY) ], [ vm_prompt, 'Domino Theory: choose a Power Struggle card to play from the discard pile' ], [ vm_domino_theory ], + [ vm_else ], + [ vm_domino_theory_pass ], [ vm_endif ], [ vm_return ], ] @@ -8730,7 +8750,7 @@ CODE[96] = [ // The Chinese Solution* CODE[97] = [ // The Tyrant is Gone* [ vm_if, ()=>game.persistent_events.includes(THE_CROWD_TURNS_AGAINST_CEAUSESCU_OCCURRED) ], - [ vm_valid_spaces, 'Cluj-Napoca' ], + [ vm_cluj_check ], [ vm_prompt, 'the Romanian Elite Space' ], [ vm_remove_x_opp_infl, 4 ], [ vm_the_tyrant_is_gone ], |