summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-05-28 16:22:38 +0200
committerTor Andersson <tor@ccxvii.net>2024-05-28 16:22:38 +0200
commitcbfcfe09f1d6634798c6de487e51da8c58a0d113 (patch)
tree75c5868a9ad085562180c7cae23fb9717b7cda0e
parent0f2869feb1d0c35693c6daf30df9ee068c141d46 (diff)
downloadplantagenet-cbfcfe09f1d6634798c6de487e51da8c58a0d113.tar.gz
Improve prompts when player doesn't have prompted event.
-rw-r--r--rules.js18
-rw-r--r--rules.ts20
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) {