summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-20 17:36:58 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-20 17:36:58 +0200
commitdf8a83b155abb4e1faa21430bc0b22655c2d1bce (patch)
treede7af6de919e526951235e1e8e9bee798fe3129e
parent50822f73d98403d844f32fd3246a03e7af9fb29a (diff)
downloadplantagenet-df8a83b155abb4e1faa21430bc0b22655c2d1bce.tar.gz
Forbid intercept when moving to locale with another friendly lord.
-rw-r--r--rules.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/rules.ts b/rules.ts
index 31cbf7d..9f73421 100644
--- a/rules.ts
+++ b/rules.ts
@@ -4786,8 +4786,19 @@ states.march_confirm_intercept = {
// === 4.3.4 INTERCEPT ===
+function has_unmoving_friendly_lord(here) {
+ for (let lord of all_friendly_lords()) {
+ if (get_lord_locale(lord) === here)
+ if (!set_has(game.group, lord))
+ return true
+ }
+ return false
+}
+
function can_intercept_to(to: Locale) {
- // TODO: forbid lancaster intercept into york moving to york, and vice versa
+ // forbid lancaster intercept into york moving to york, and vice versa
+ if (has_unmoving_friendly_lord(to))
+ return false
if (is_truce_in_effect())
return false
if (is_wales_forbidden_to_enemy(to))