diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-06 19:43:29 +0100 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-10-06 19:43:29 +0100 |
commit | b05884c4412a403a8fde4e58d30d96da14a9eee9 (patch) | |
tree | 68f746ae098b5562b85f66d19ff4ae46c0e1d83a /rules.js | |
parent | b283e3c47b5235dd99291612600014c72f35032e (diff) | |
download | 1989-dawn-of-freedom-b05884c4412a403a8fde4e58d30d96da14a9eee9.tar.gz |
Working on popup
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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)) {
|