summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authoriainp5 <iain.pearce.ip@gmail.com>2024-09-19 23:19:19 +0100
committeriainp5 <iain.pearce.ip@gmail.com>2024-09-19 23:19:19 +0100
commit5394f290e52cf7a92e10bd354ac61ea340130280 (patch)
tree249c6ef309bff58ba92ecc4bc1c81c29242a0c70 /rules.js
parenteac6d08d56c686b18fe813f72791ebedd3ca5ed9 (diff)
download1989-dawn-of-freedom-5394f290e52cf7a92e10bd354ac61ea340130280.tar.gz
Fix for Deutsche Marks with no valid cards
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index f388d67..3df2600 100644
--- a/rules.js
+++ b/rules.js
@@ -5732,10 +5732,15 @@ states.vm_play_event_from_discard = {
states.vm_deutsche_marks_prep = {
inactive: 'choose a card.',
prompt() {
- view.prompt = 'Deutsche Marks: choose a card to give.'
- for (let card of game.valid_cards) {
- gen_action_card(card)
- }
+ if (game.valid_cards.length === 0) {
+ view.prompt = 'Deutsche Marks: no cards to give.'
+ gen_action('pass')
+ } else {
+ view.prompt = 'Deutsche Marks: choose a card to give.'
+ for (let card of game.valid_cards) {
+ gen_action_card(card)
+ }
+ }
},
card(card) {
log(`Gave C${cards[card].number}`)