summaryrefslogtreecommitdiff
path: root/rules.ts
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-04-28 22:36:59 +0200
committerTor Andersson <tor@ccxvii.net>2024-04-28 22:36:59 +0200
commited80dbcad00a20b44e3a08f997b7a54f3fdcd857 (patch)
tree4aa1f98931545eb074a3551607de0bfc65f56f3e /rules.ts
parentcfcd2f88681c1576b0ffbda5bb156dfd780b5b22 (diff)
downloadplantagenet-ed80dbcad00a20b44e3a08f997b7a54f3fdcd857.tar.gz
margaret beaufort
Diffstat (limited to 'rules.ts')
-rw-r--r--rules.ts43
1 files changed, 21 insertions, 22 deletions
diff --git a/rules.ts b/rules.ts
index e95c516..31114f8 100644
--- a/rules.ts
+++ b/rules.ts
@@ -3000,6 +3000,11 @@ states.muster_lord = {
if (can_action_parley_levy())
view.actions.parley = 1
+ // Levy Vassal (event overrides need for friendly stronghold)
+ for (let vassal of all_vassals)
+ if (can_levy_vassal(vassal))
+ gen_action_vassal(vassal)
+
if (is_friendly_locale(here)) {
// Levy another ready Lord
for (let lord of all_friendly_lords()) {
@@ -3007,11 +3012,6 @@ states.muster_lord = {
gen_action_lord(lord)
}
- // Levy Vassal
- for (let vassal of all_vassals)
- if (can_levy_vassal(vassal))
- gen_action_vassal(vassal)
-
// Add Transport
if (can_add_transport_ship(game.command, here))
view.actions.take_ship = 1
@@ -3292,25 +3292,24 @@ states.levy_lord_at_seat = {
// === 3.4.3 LEVY VASSAL ===
function can_levy_vassal(vassal: Vassal) {
- if (!is_vassal_ready(vassal)) {
- return false
- }
- if (
- !is_friendly_locale(get_vassal_seat(vassal)) &&
- (game.command !== LORD_HENRY_TUDOR || !is_event_in_play(EVENT_LANCASTER_MARGARET_BEAUFORT))
- ) {
- return false
- }
- if (!is_friendly_locale(get_vassal_seat(vassal)))
+ let here = get_lord_locale(game.command)
+ let seat = get_vassal_seat(vassal)
+
+ if (!is_vassal_ready(vassal))
return false
- if (
- game.active === LANCASTER &&
- is_event_in_play(EVENT_YORK_YORKISTS_BLOCK_PARLIAMENT) &&
- !(is_event_in_play(EVENT_LANCASTER_MARGARET_BEAUFORT) && !is_event_in_play(EVENT_LANCASTER_THE_EARL_OF_RICHMOND))
- ) {
+
+ // Margaret Beaufort overrides all!
+ if (game.command === LORD_HENRY_TUDOR && is_event_in_play(EVENT_LANCASTER_MARGARET_BEAUFORT))
+ return true
+
+ // Yorkist Block Parliament (except when overridden by The Earl of Richmond)
+ if (game.active === LANCASTER && is_event_in_play(EVENT_YORK_YORKISTS_BLOCK_PARLIAMENT) && !is_event_in_play(EVENT_LANCASTER_THE_EARL_OF_RICHMOND))
return false
- }
- return true
+
+ if (is_friendly_locale(here) && is_friendly_locale(seat) && !has_enemy_lord(seat))
+ return true
+
+ return false
}
states.levy_vassal = {