﻿# Leo VI's Mass Vassal Directives - script values

# Tier multipliers for the military-strength condition. The threshold a rule
# picks is the duchy-tier baseline (multiplier 1); a vassal's own threshold is
# that baseline scaled to their highest title tier, so one setting stays
# meaningful up and down the realm. The curve tracks how armies actually scale:
# max_military_strength compounds the levy contributions of a vassal's own
# vassals down the feudal chain, so the tier gap is steeper than linear. The
# county figure lines up with vanilla's own "powerful ruler" mark of 400 (a
# 1000 baseline asks a count for 400).
leo_mvd_threshold_mult_county = 0.4
leo_mvd_threshold_mult_kingdom = 3
leo_mvd_threshold_mult_empire = 8

# The duchy-tier baseline the built-in presets steer their military-strength
# split on. Kept as one constant here, rather than a literal in each preset, so
# the AGOT build can raise it in one place: A Game of Thrones roughly doubles
# field armies (levies x2), so its build overrides this to 2000 in
# zz_leo_mvd_agot_values.txt. The condition's own default and option ladder are
# set target-aware in tools/gen_panel.sh to match.
leo_mvd_mil_baseline = 1000

# Current scope: vassal. Requires scope:leo_mvd_thresh, the baseline staged from
# the rule node being evaluated (leo_mvd_stage_cond_effect). It is read from a
# staged scope rather than a variable so that the military-strength condition
# can be written once instead of once per rule node.
#
# Effective military-strength threshold for this vassal, tier-scaled from the
# chosen duchy baseline so it stays meaningful for counts vs kings.
leo_mvd_effective_threshold = {
	value = scope:leo_mvd_thresh
	if = {
		limit = { highest_held_title_tier = tier_county }
		multiply = leo_mvd_threshold_mult_county
	}
	else_if = {
		limit = { highest_held_title_tier = tier_kingdom }
		multiply = leo_mvd_threshold_mult_kingdom
	}
	else_if = {
		limit = { highest_held_title_tier >= tier_empire }
		multiply = leo_mvd_threshold_mult_empire
	}
}

# Current scope: vassal. Average development of the counties the vassal holds
# personally, the ones a directive could actually improve: directives are not
# passed down to sub-vassals. Iterated as county-tier held titles because the
# script value parser accepts every_held_title but not every_held_county, which
# exists only for effects and triggers. The count is its own value because the
# divisor cannot iterate inline, and the divide is guarded so a vassal with no
# held county (a baron) reads 0 instead of dividing by zero.
leo_mvd_held_county_count = {
	value = 0
	every_held_title = {
		limit = { tier = tier_county }
		add = 1
	}
}
leo_mvd_avg_held_development = {
	value = 0
	every_held_title = {
		limit = { tier = tier_county }
		add = development_level
	}
	if = {
		limit = { any_held_title = { tier = tier_county } }
		divide = leo_mvd_held_county_count
	}
}
