diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-27 20:41:10 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-27 20:41:10 +0000 |
commit | 3e36074596d23d78b48c0a999b57d5a6f3808030 (patch) | |
tree | 6760d8dd3b4adc09a1306350f76c5a68301b3569 /rules.js | |
parent | 966d67c6d8d0dde94635f4cfaea5181944848a79 (diff) | |
download | 1989-dawn-of-freedom-3e36074596d23d78b48c0a999b57d5a6f3808030.tar.gz |
New power struggle card layout
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -400,6 +400,9 @@ exports.view = function(state, player) { if (game.is_pwr_struggle) { view.power_struggle_discard = game.power_struggle_discard view.played_power_card = game.played_power_card + console.log('game.com_power_card', game.com_power_card, 'game.dem_power_card', game.dem_power_card) + view.power_card_1 = game.power_card_1 + view.power_card_2 = game.power_card_2 } view.strategy_discard = game.strategy_discard @@ -1574,6 +1577,13 @@ states.power_struggle = { power_card(card) { push_undo() discard(card) + if (game.phase === 0) { + game.power_card_1 = card + delete game.power_card_2 + } + if (game.phase === 1) { + game.power_card_2 = card + } game.valid_cards=[] game.return_state = 'power_struggle' if (game.phase === 0) {delete game.proxy_power_card} @@ -1643,6 +1653,8 @@ states.power_struggle = { concede () { push_undo() game.valid_cards = [] + delete game.power_card_1 + delete game.power_card_2 log('Conceded') log_h2('Aftermath') log_h3('Support Loss') @@ -2114,8 +2126,8 @@ states.general_strike = { prompt() { if (game.played_card === 0 ) { view.prompt = 'General Strike: you must discard a card or play a Scoring Card.' - available_cards = game.communist_hand - for (let card of available_cards) { + game.communist_hand + for (let card of game.communist_hand) { gen_action_card(card) } } else if (game.played_card > 0 ) { @@ -3884,11 +3896,11 @@ function find_country_index(country) { } function draw_deck() { - let hand = [] + let deck = [] for (let c = first_strategy_card; c <= last_strategy_card; ++c) if (cards[c].period === 1) - hand.push(c) - return c + deck.push(c) + return deck } function draw_cards(deck, democrat_hand, communist_hand, dem_hand_limit, com_hand_limit) { |