diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-28 16:22:38 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-28 16:22:38 +0200 |
commit | cbfcfe09f1d6634798c6de487e51da8c58a0d113 (patch) | |
tree | 75c5868a9ad085562180c7cae23fb9717b7cda0e | |
parent | 0f2869feb1d0c35693c6daf30df9ee068c141d46 (diff) | |
download | plantagenet-cbfcfe09f1d6634798c6de487e51da8c58a0d113.tar.gz |
Improve prompts when player doesn't have prompted event.
-rw-r--r-- | rules.js | 18 | ||||
-rw-r--r-- | rules.ts | 20 |
2 files changed, 22 insertions, 16 deletions
@@ -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) { @@ -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) { |