From 132d8e5f7a39247aaa64cea18947a38d932b77b8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 23 Mar 2025 12:20:08 +0100 Subject: Fix check for available card in hand to claim momentum medallion. --- rules.js | 6 +++--- rules.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rules.js b/rules.js index 01443d6..1754c45 100644 --- a/rules.js +++ b/rules.js @@ -1121,7 +1121,7 @@ states.choose_medallion = { for (let m of game.medallions[POOL_ID]) { if (m !== null) { if (m === data_1.MOMENTUM_MEDALLION_ID) { - if (game.hands[faction].length > game.selected_cards[faction].length) { + if (game.hands[faction].some(c => !game.selected_cards[faction].includes(c))) { gen_action_medallion(m); skip = false; } @@ -1582,14 +1582,14 @@ function resolve_spend_hp() { function set_player_turn_prompt({ can_play_card, use_ap, use_momentum, use_morale_bonus, }) { if (can_play_card) view.prompt = "Play card for Action Points or for the Event."; - else if (use_momentum) - view.prompt = "Play a second card."; else if (use_ap && use_morale_bonus) view.prompt = "Use Action Points and Morale Bonus."; else if (use_morale_bonus) view.prompt = "Use Morale Bonus."; else if (use_ap) view.prompt = "Use Action Points."; + else if (use_momentum) + view.prompt = "Play a second card."; else view.prompt = "Player Turn: Done."; } diff --git a/rules.ts b/rules.ts index 3945b71..d11e9dc 100644 --- a/rules.ts +++ b/rules.ts @@ -1410,7 +1410,7 @@ states.choose_medallion = { for (let m of game.medallions[POOL_ID]) { if (m !== null) { if (m === MOMENTUM_MEDALLION_ID) { - if (game.hands[faction].length > game.selected_cards[faction].length) { + if (game.hands[faction].some(c => !game.selected_cards[faction].includes(c))) { gen_action_medallion(m); skip = false; } @@ -1933,14 +1933,14 @@ function set_player_turn_prompt({ }: { can_spend_hp: boolean; can_play_card: boolean; use_ap: boolean; use_momentum: boolean; use_morale_bonus: boolean }) { if (can_play_card) view.prompt = "Play card for Action Points or for the Event." - else if (use_momentum) - view.prompt = "Play a second card." else if (use_ap && use_morale_bonus) view.prompt = "Use Action Points and Morale Bonus." else if (use_morale_bonus) view.prompt = "Use Morale Bonus." else if (use_ap) view.prompt = "Use Action Points." + else if (use_momentum) + view.prompt = "Play a second card." else view.prompt = "Player Turn: Done." } -- cgit v1.2.3