From 8b89868a519fdcae695a97ea899fcfa252053624 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 18 Jul 2024 23:46:38 +0200 Subject: pay vassals (at zero cost) automatically for percy's power --- rules.js | 9 +++++++++ rules.ts | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/rules.js b/rules.js index 901bfea..aa3fccf 100644 --- a/rules.js +++ b/rules.js @@ -2192,6 +2192,15 @@ function for_each_unpaid_vassal(f) { } } function goto_pay_vassals() { + // Percy's Power pays all affected vassals + if (is_percys_power_triggered()) { + for (let v of all_vassals) { + let lord = get_vassal_lord(v); + if (is_friendly_lord(lord) && get_vassal_service(v) === current_turn() && is_lord_in_north(lord)) { + set_vassal_lord_and_service(v, get_vassal_lord(v), current_turn() + 1); + } + } + } if (has_unpaid_vassals()) { log_h3("Pay Vassals"); game.state = "pay_vassals"; diff --git a/rules.ts b/rules.ts index 8d67771..90db8b4 100644 --- a/rules.ts +++ b/rules.ts @@ -2742,6 +2742,16 @@ function for_each_unpaid_vassal(f) { } function goto_pay_vassals() { + // Percy's Power pays all affected vassals + if (is_percys_power_triggered()) { + for (let v of all_vassals) { + let lord = get_vassal_lord(v) + if (is_friendly_lord(lord) && get_vassal_service(v) === current_turn() && is_lord_in_north(lord)) { + set_vassal_lord_and_service(v, get_vassal_lord(v), current_turn() + 1) + } + } + } + if (has_unpaid_vassals()) { log_h3("Pay Vassals") game.state = "pay_vassals" -- cgit v1.2.3