﻿# by JawwadBR #

# Defined values for legitimacy based on title tier
lot_legitimacy_multiplier_level_1 = {
	value = 1
	# If tribal then the value for count is 0.5
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		subtract = 0.5
	}

	if = {
		limit = { 
			has_game_rule = lot_gain_default_lot_value 
		}
		# ... nothing
	}
	# If game rule to reduce by 25%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_25
		}
		multiply = 0.75
	}
	# If game rule to reduce by 50%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_50
		}
		multiply = 0.5
	}
	# If game rule to reduce by 75%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_75
		}
		multiply = 0.25
	}
}

lot_legitimacy_multiplier_level_2 = {
	value = 2
	# If tribal then the value for duke is 1
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		subtract = 1
	}

	if = {
		limit = { 
			has_game_rule = lot_gain_default_lot_value 
		}
		# ... nothing
	}
	# If game rule to reduce by 25%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_25
		}
		multiply = 0.75
	}
	# If game rule to reduce by 50%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_50
		}
		multiply = 0.5
	}
	# If game rule to reduce by 75%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_75
		}
		multiply = 0.25
	}
}

lot_legitimacy_multiplier_level_3 = {
	value = 4
	# If tribal then the value for king is 2
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		subtract = 2
	}
	
	if = {
		limit = { 
			has_game_rule = lot_gain_default_lot_value 
		}
		# ... nothing
	}
	# If game rule to reduce by 25%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_25
		}
		multiply = 0.75
	}
	# If game rule to reduce by 50%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_50
		}
		multiply = 0.5
	}
	# If game rule to reduce by 75%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_75
		}
		multiply = 0.25
	}
}

lot_legitimacy_multiplier_level_4 = {
	value = 6
	# If tribal then the value for emperor is 4
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		subtract = 2
	}

	if = {
		limit = { 
			has_game_rule = lot_gain_default_lot_value 
		}
		# ... nothing
	}
	# If game rule to reduce by 25%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_25
		}
		multiply = 0.75
	}
	# If game rule to reduce by 50%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_50
		}
		multiply = 0.5
	}
	# If game rule to reduce by 75%
	else_if = {
		limit = {
			has_game_rule = lot_gain_reduced_by_75
		}
		multiply = 0.25
	}
}

# Minimum age to be aligible to gain yearly legitimacy
lot_legitimacy_min_eligible_age = 16

# Values for powerful vassal logic
lot_min_percentage_for_powerful_vassal_mod = 60
lot_critical_bad_percentage_for_powerful_vassal_mod = 0

lot_positive_opinion_for_legitimacy_gain_mod = 1.1
lot_negative_opinion_for_legitimacy_gain_mod = 0.9

lot_percentage_per_negative_powerful_vassal_multipler = {
	value = 10
	# If tribal then the percentage value is 5% per negative vassal
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		subtract = 5
	}
}
lot_critical_bad_negative_powerful_vassal_multipler = {
	value = -10
	# If tribal then the multiplier is 3 instead of 10
	if = {
		limit = {
			culture = {
				NOT = { has_cultural_era_or_later = culture_era_early_medieval }
			}
		}
		add = 7
	}
}

# Values for consecutive years for legitimacy gain
lot_consecutive_years_legitimacy_level_1 = 4
lot_consecutive_years_legitimacy_level_2 = 6
lot_consecutive_years_legitimacy_level_3 = 8
lot_negative_consecutive_years_legitimacy_level_1 = -2
lot_negative_consecutive_years_legitimacy_level_2 = -4

lot_minor_years_modifier = 2
lot_medium_years_modifier = 3
lot_major_years_modifier = 5
lot_massive_years_modifier = 10
