From b05884c4412a403a8fde4e58d30d96da14a9eee9 Mon Sep 17 00:00:00 2001 From: iainp5 Date: Sun, 6 Oct 2024 19:43:29 +0100 Subject: Working on popup --- rules.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 6ded040..520de48 100644 --- a/rules.js +++ b/rules.js @@ -264,15 +264,18 @@ exports.view = function(state, player) { // === ACTIONS =========== function gen_action(action, argument) { -//console.log('gen_action called with ', action, ' and ', argument) +console.log('gen_action called with ', action, ' and ', argument) if (argument === undefined) { + console.log('argument undefined') view.actions[action] = 1 } else { - if (!(action in view.actions)) + if (!(action in view.actions)) { + console.log('push argument') view.actions[action] = [] + } view.actions[action].push(argument) } - //console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) + console.log('view.actions: ', view.actions, 'view.actions[action]: ', view.actions[action]) } function gen_action_infl(space){ @@ -425,11 +428,11 @@ states.choose_card = { available_cards = game.communist_hand } for (let card of available_cards) { - gen_action_card(card) + gen_action('card_select', card) } } }, - card(card) { + card_select(card) { push_undo() //Check if player is at risk of losing game due to held scoring card if (!scoring_cards.includes(card)) { -- cgit v1.2.3