summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 48b34af..5654997 100644
--- a/rules.js
+++ b/rules.js
@@ -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) {