summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorteisuru <31881306+teisuru@users.noreply.github.com>2024-02-13 15:48:32 +0100
committerteisuru <31881306+teisuru@users.noreply.github.com>2024-02-13 15:48:32 +0100
commit73f61808ab96f5bb5e392d6d00ffe9fbcef8d24b (patch)
tree3343b1d59fac8c2c5cfc7da61d964688030fc388 /rules.js
parent72980697863194ac887479ceff3a047d8dba2b98 (diff)
downloadplantagenet-73f61808ab96f5bb5e392d6d00ffe9fbcef8d24b.tar.gz
fix for trust not him
check vassal same locale as battle
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 52e7d8c..35642f3 100644
--- a/rules.js
+++ b/rules.js
@@ -8164,17 +8164,16 @@ function prompt_battle_events() {
// both attacker and defender events
if (game.active === LANCASTER) {
gen_action_card_if_held(EVENT_LANCASTER_LEEWARD_BATTLE_LINE)
- if (can_play_suspicion()) {
+ if (can_play_suspicion())
gen_action_card_if_held(EVENT_LANCASTER_SUSPICION)
- }
- gen_action_card_if_held(EVENT_LANCASTER_FOR_TRUST_NOT_HIM)
+ if (can_play_for_trust_not_him())
+ gen_action_card_if_held(EVENT_LANCASTER_FOR_TRUST_NOT_HIM)
gen_action_card_if_held(EVENT_LANCASTER_RAVINE)
}
if (game.active === YORK) {
gen_action_card_if_held(EVENT_YORK_LEEWARD_BATTLE_LINE)
- if (can_play_suspicion()) {
+ if (can_play_suspicion())
gen_action_card_if_held(EVENT_YORK_SUSPICION)
- }
gen_action_card_if_held(EVENT_YORK_CALTROPS)
gen_action_card_if_held(EVENT_YORK_REGROUP)
gen_action_card_if_held(EVENT_YORK_SWIFT_MANEUVER)
@@ -8518,6 +8517,18 @@ states.influence_check_suspicion = {
// === EVENT : FOR TRUST NOT HIM ===
+function can_play_for_trust_not_him() {
+ for (let vassal = first_vassal; vassal <= last_vassal; vassal++) {
+ if (is_vassal_mustered_with_york_lord(vassal) && get_lord_locale(get_vassal_lord(vassal)) === get_lord_locale(game.command)) {
+ // Hastings & Salisbury with Alice Montagu capability are immune.
+ if ((get_vassal_lord(vassal) !== LORD_SALISBURY || !lord_has_capability(LORD_SALISBURY, AOW_YORK_ALICE_MONTAGU)) && vassal !== VASSAL_HASTINGS) {
+ return true
+ }
+ }
+ }
+ return false
+}
+
states.for_trust_not_him = {
inactive: "For trust not him \u2014 Select Lord",
prompt() {
@@ -8545,7 +8556,7 @@ states.for_trust_not_him_vassal = {
prompt() {
view.prompt = "Select an enemy Vassal"
for (let vassal = first_vassal; vassal <= last_vassal; vassal++) {
- if (is_vassal_mustered_with_york_lord(vassal)) {
+ if (is_vassal_mustered_with_york_lord(vassal) && get_lord_locale(get_vassal_lord(vassal)) === get_lord_locale(game.command)) {
// Hastings & Salisbury with Alice Montagu capability are immune.
if ((get_vassal_lord(vassal) !== LORD_SALISBURY || !lord_has_capability(LORD_SALISBURY, AOW_YORK_ALICE_MONTAGU)) && vassal !== VASSAL_HASTINGS) {
gen_action_vassal(vassal)