diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-20 17:36:58 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-20 17:36:58 +0200 |
commit | df8a83b155abb4e1faa21430bc0b22655c2d1bce (patch) | |
tree | de7af6de919e526951235e1e8e9bee798fe3129e | |
parent | 50822f73d98403d844f32fd3246a03e7af9fb29a (diff) | |
download | plantagenet-df8a83b155abb4e1faa21430bc0b22655c2d1bce.tar.gz |
Forbid intercept when moving to locale with another friendly lord.
-rw-r--r-- | rules.ts | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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)) |