diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-03-28 14:35:19 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-03-28 14:35:24 +0100 |
commit | db493cf2a4b4c589106d66117cc35dfe52ead7bb (patch) | |
tree | 8783e7033753eb17e9249eb16f26554511fc3986 | |
parent | abaadae10dc002c70db5cc9e488b930a85fb4d83 (diff) | |
download | land-and-freedom-db493cf2a4b4c589106d66117cc35dfe52ead7bb.tar.gz |
Initiative player to pull tokens from bag at year end procedure.
-rw-r--r-- | rules.js | 17 | ||||
-rw-r--r-- | rules.ts | 18 |
2 files changed, 16 insertions, 19 deletions
@@ -1223,11 +1223,13 @@ function draw_glory_from_bag() { game.glory.push(faction); game.glory_current_year[faction] = true; array_remove(game.bag_of_glory, index); - logi(`Pulled T${faction} from the Bag`); + log(`Pulled T${faction} from the Bag.`); } states.draw_glory = { inactive: 'draw from the Bag of Glory', auto_resolve() { + if (get_active_faction() === game.initiative) + return false; draw_glory_from_bag(); return true; }, @@ -1259,17 +1261,12 @@ states.end_of_year_discard = { for (let c of tableau) gen_action_card(c); } - if (needs_to_discard_from_hand && needs_to_discard_from_tableau) { - view.prompt = 'Discard a card from your hand or tableau.'; - } - else if (needs_to_discard_from_hand) { - view.prompt = 'Discard a card from your hand.'; - } - else if (needs_to_discard_from_tableau) { - view.prompt = 'Discard a card from your tableau.'; + view.prompt = JSON.stringify({ needs_to_discard_from_hand, needs_to_discard_from_tableau }); + if (needs_to_discard_from_hand || needs_to_discard_from_tableau) { + view.prompt = 'End of Year: Discard cards from your hand and tableau.'; } else { - view.prompt = 'Confirm discard.'; + view.prompt = 'End of Year: Done.'; view.actions.confirm = 1; } if (discarded[faction_id].h.length > 0 || discarded[faction_id].t.length > 0) { @@ -1367,7 +1367,7 @@ states.choose_final_bid = { } let n = 0 for (let c of game.selected_cards[faction]) { - n += cards[c].strength + n += (cards[c] as PlayerCard).strength } if (n > 0) view.prompt = `Final Bid for Glory: Discard up to 3 cards for ${n} strength.` @@ -1521,12 +1521,15 @@ function draw_glory_from_bag() { array_remove(game.bag_of_glory, index); - logi(`Pulled T${faction} from the Bag`); + log(`Pulled T${faction} from the Bag.`); } states.draw_glory = { inactive: 'draw from the Bag of Glory', auto_resolve() { + // active player to trigger the draw + if (get_active_faction() === game.initiative) + return false; draw_glory_from_bag(); return true; }, @@ -1562,14 +1565,11 @@ states.end_of_year_discard = { for (let c of tableau) gen_action_card(c); } - if (needs_to_discard_from_hand && needs_to_discard_from_tableau) { - view.prompt = 'Discard a card from your hand or tableau.'; - } else if (needs_to_discard_from_hand) { - view.prompt = 'Discard a card from your hand.'; - } else if (needs_to_discard_from_tableau) { - view.prompt = 'Discard a card from your tableau.'; + view.prompt = JSON.stringify({needs_to_discard_from_hand,needs_to_discard_from_tableau}); + if (needs_to_discard_from_hand || needs_to_discard_from_tableau) { + view.prompt = 'End of Year: Discard cards from your hand and tableau.'; } else { - view.prompt = 'Confirm discard.'; + view.prompt = 'End of Year: Done.'; view.actions.confirm = 1; } if (discarded[faction_id].h.length > 0 || discarded[faction_id].t.length > 0) { |