diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -457,7 +457,7 @@ exports.view = function (state, player) { if (game.state === "game_over") { view.prompt = game.victory - } else if (player === "Observer" || (game.active !== player && game.active !== "Both")) { + } else if (game.active !== player) { if (states[game.state]) { let inactive = states[game.state].inactive if (!inactive) @@ -3982,13 +3982,9 @@ function draw_deck() { function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { let turn = "communist" while (democrat_hand.length < dem_hand_limit || communist_hand.length < com_hand_limit) { - if (deck.length === 0) { - log_h3("--- Reshuffle ---") - deck.push(...game.strategy_discard) - game.strategy_discard = [] - if (deck.length === 0) - throw "NO MORE CARDS" // abort! - } else if (turn === "communist" && communist_hand.length < com_hand_limit) { + if (deck.length === 0) + reshuffle(deck) + else if (turn === "communist" && communist_hand.length < com_hand_limit) { communist_hand.push(draw_card(deck)) turn = "democrat" } else if (turn === "communist" && communist_hand.length >= com_hand_limit) { @@ -4002,9 +3998,19 @@ function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_han throw new Error("Impossible state when drawing cards.") } } + if (deck.length === 0) + reshuffle(deck) clear_undo() } +function reshuffle(deck) { + log_h3("--- Reshuffle ---") + deck.push(...game.strategy_discard) + game.strategy_discard = [] + if (deck.length === 0) + throw "NO MORE CARDS" // abort! +} + function draw_card(deck) { if (deck.length === 0) { log_h3('--- Reshuffle ---') @@ -5129,6 +5135,7 @@ function vm_betrayal() { } function vm_breakaway_baltic_republics() { + add_to_persistent_events(C_BREAKAWAY_BALTIC_REPUBLICS) log('+5 VP') game.vp += 5 game.stability++ @@ -5699,6 +5706,7 @@ function vm_roundtable_talks() { } function vm_sajudis_check() { + add_to_persistent_events(C_SAJUDIS) if (!check_dem_control(S_RAZGRAD)) game.valid_spaces.push(S_RAZGRAD) if (!check_dem_control(S_HARGHITA_COVASNA) && game.systematization !== S_HARGHITA_COVASNA) @@ -5820,6 +5828,7 @@ function vm_tear_gas() { } function vm_the_baltic_way_prep() { + add_to_persistent_events(C_THE_BALTIC_WAY) game.playable_cards.push(C_BREAKAWAY_BALTIC_REPUBLICS) game.stability++ log('+3 VP') @@ -8686,7 +8695,6 @@ CODE[32] = [ // Peasant Parties* ] CODE[33] = [ // Sajudis* - [ vm_permanently_remove ], [ vm_sajudis ], [ vm_if, ()=>!is_auto_resolve(C_SAJUDIS) ], [ vm_sajudis_check ], @@ -9081,7 +9089,6 @@ CODE[80] = [ // Nepotism* ] CODE[81] = [ // The Baltic Way* - [ vm_permanently_remove ], [ vm_the_baltic_way_prep ], [ vm_if, ()=>!is_auto_resolve(C_THE_BALTIC_WAY) ], [ vm_the_baltic_way ], @@ -9110,7 +9117,6 @@ CODE[83] = [ // Modrow* ] CODE[84] = [ // Breakaway Baltic Republics* - [ vm_permanently_remove ], [ vm_breakaway_baltic_republics ], [ vm_prompt, 'any Minorities space' ], [ vm_take_control_prep, 1 ], |