From cbfcfe09f1d6634798c6de487e51da8c58a0d113 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 28 May 2024 16:22:38 +0200 Subject: Improve prompts when player doesn't have prompted event. --- rules.js | 18 +++++++++++------- rules.ts | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/rules.js b/rules.js index 94668ab..c05acd2 100644 --- a/rules.js +++ b/rules.js @@ -4687,11 +4687,13 @@ function goto_parliaments_truce() { states.parliaments_truce = { inactive: "Parliament's Truce", prompt() { - view.prompt = "Approach: You may play Parliament's Truce to cancel approach."; - if (game.active === YORK) - gen_action_card_if_held(EVENT_YORK_PARLIAMENTS_TRUCE); + view.prompt = "Approach: You may play Parliament's Truce to cancel appreach."; + if (has_card_in_hand(EVENT_YORK_PARLIAMENTS_TRUCE)) + gen_action_card(EVENT_YORK_PARLIAMENTS_TRUCE); + else if (has_card_in_hand(EVENT_LANCASTER_PARLIAMENTS_TRUCE)) + gen_action_card(EVENT_LANCASTER_PARLIAMENTS_TRUCE); else - gen_action_card_if_held(EVENT_LANCASTER_PARLIAMENTS_TRUCE); + view.prompt = "Approach: You don't have Parliament's Truce."; view.actions.pass = 1; }, card(c) { @@ -4744,10 +4746,12 @@ states.blocked_ford = { inactive: "Blocked Ford", prompt() { view.prompt = "Approach: You may play Blocked Ford."; - if (game.active === YORK) - gen_action_card_if_held(EVENT_YORK_BLOCKED_FORD); + if (has_card_in_hand(EVENT_YORK_BLOCKED_FORD)) + gen_action_card(EVENT_YORK_BLOCKED_FORD); + else if (has_card_in_hand(EVENT_LANCASTER_BLOCKED_FORD)) + gen_action_card(EVENT_LANCASTER_BLOCKED_FORD); else - gen_action_card_if_held(EVENT_LANCASTER_BLOCKED_FORD); + view.prompt = "Approach: You don't have Blocked Ford."; view.actions.pass = 1; }, card(c) { diff --git a/rules.ts b/rules.ts index f3706bd..2b9ac10 100644 --- a/rules.ts +++ b/rules.ts @@ -5623,11 +5623,13 @@ function goto_parliaments_truce() { states.parliaments_truce = { inactive: "Parliament's Truce", prompt() { - view.prompt = "Approach: You may play Parliament's Truce to cancel approach." - if (game.active === YORK) - gen_action_card_if_held(EVENT_YORK_PARLIAMENTS_TRUCE) + view.prompt = "Approach: You may play Parliament's Truce to cancel appreach." + if (has_card_in_hand(EVENT_YORK_PARLIAMENTS_TRUCE)) + gen_action_card(EVENT_YORK_PARLIAMENTS_TRUCE) + else if (has_card_in_hand(EVENT_LANCASTER_PARLIAMENTS_TRUCE)) + gen_action_card(EVENT_LANCASTER_PARLIAMENTS_TRUCE) else - gen_action_card_if_held(EVENT_LANCASTER_PARLIAMENTS_TRUCE) + view.prompt = "Approach: You don't have Parliament's Truce." view.actions.pass = 1 }, card(c) { @@ -5695,12 +5697,12 @@ states.blocked_ford = { inactive: "Blocked Ford", prompt() { view.prompt = "Approach: You may play Blocked Ford." - - if (game.active === YORK) - gen_action_card_if_held(EVENT_YORK_BLOCKED_FORD) + if (has_card_in_hand(EVENT_YORK_BLOCKED_FORD)) + gen_action_card(EVENT_YORK_BLOCKED_FORD) + else if (has_card_in_hand(EVENT_LANCASTER_BLOCKED_FORD)) + gen_action_card(EVENT_LANCASTER_BLOCKED_FORD) else - gen_action_card_if_held(EVENT_LANCASTER_BLOCKED_FORD) - + view.prompt = "Approach: You don't have Blocked Ford." view.actions.pass = 1 }, card(c) { -- cgit v1.2.3