summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-23 12:20:08 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-23 12:20:08 +0100
commit132d8e5f7a39247aaa64cea18947a38d932b77b8 (patch)
tree31e8b73b620911b803745b31b13d93fcad7b853a
parentf4009f4b7ce0ba26ad4ff224b4f285fb43e166a0 (diff)
downloadland-and-freedom-132d8e5f7a39247aaa64cea18947a38d932b77b8.tar.gz
Fix check for available card in hand to claim momentum medallion.
-rw-r--r--rules.js6
-rw-r--r--rules.ts6
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."
}