summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-02-11 22:54:17 +0100
committerTor Andersson <tor@ccxvii.net>2024-02-11 22:54:44 +0100
commitca0b58349ef50110fc4c0543377c55b09e53c3d2 (patch)
tree714ad2bb88484b1a5bd696ebf311ffaa25b2e417 /rules.js
parente616aa0d9a3438d56c3e0264a0ca92fc70d23736 (diff)
downloadplantagenet-ca0b58349ef50110fc4c0543377c55b09e53c3d2.tar.gz
Blocked Ford.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js41
1 files changed, 32 insertions, 9 deletions
diff --git a/rules.js b/rules.js
index 9bf7e1d..e28ded7 100644
--- a/rules.js
+++ b/rules.js
@@ -4058,14 +4058,6 @@ function prompt_held_event_intercept() {
function can_play_held_event(c) {
switch (c) {
-
- /* APPROACH
- case EVENT_LANCASTER_BLOCKED_FORD:
- return can_play_l_blocked_ford()
- case EVENT_YORK_BLOCKED_FORD:
- return can_play_y_blocked_ford()
- */
-
case EVENT_LANCASTER_ASPIELLES:
return can_play_l_aspielles()
case EVENT_LANCASTER_REBEL_SUPPLY_DEPOT:
@@ -6583,11 +6575,42 @@ function end_parliaments_truce() {
}
function goto_blocked_ford() {
- // The marching lord can now play blocked ford to prevent going into exile.
+ // The marching lord can now play blocked ford to prevent enemy going into exile.
+ if (
+ has_enemy_lord(here) && (
+ (game.active === YORK && could_play_card(EVENT_YORK_BLOCKED_FORD)) ||
+ (game.active === LANCASTER && could_play_card(EVENT_LANCASTER_BLOCKED_FORD))
+ )
+ ) {
+ game.state = "blocked_ford"
+ return
+ }
goto_exiles()
}
+states.blocked_ford = {
+ inactive: "Blocked Ford?",
+ prompt() {
+ view.prompt = "You may play Blocked Ford."
+
+ if (game.active === YORK)
+ gen_action_card_if_held(EVENT_YORK_BLOCKED_FORD)
+ else
+ gen_action_card_if_held(EVENT_LANCASTER_BLOCKED_FORD)
+
+ view.actions.pass = 1
+ },
+ card(c) {
+ play_held_event(c)
+ goto_battle()
+ },
+ pass() {
+ set_active_enemy()
+ goto_exiles()
+ },
+}
+
// === Exile ===
function goto_exiles() {