From ed80dbcad00a20b44e3a08f997b7a54f3fdcd857 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 28 Apr 2024 22:36:59 +0200 Subject: margaret beaufort --- rules.ts | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'rules.ts') 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 = { -- cgit v1.2.3