
### Legal trigger list

opposes_succession_law_change_trigger = {
	is_imprisoned = no
	opinion = {
		target = liege
		value < 0
	}
	custom_description = {
		text = law_change_approval_is_cowed
		has_dread_level_towards = {
			target = liege
			level < 2
		}
	}
}

can_change_succession_laws_realm_flag_trigger = {
	trigger_if = {
		limit = { realm_law_use_tribal_authority = yes }
		custom_description = {
			text = "has_tribal_law_allowing_succession_law_change"
			has_realm_law_flag = can_change_succession_laws
		}
	}
	trigger_else_if = {
		limit = { realm_law_use_imperial_bureaucracy = yes }
		custom_description = {
			text = has_imperial_bureaucracy_law_allowing_succession_law_change
			has_realm_law_flag = can_change_succession_laws
		}
	}
	trigger_else = {
		custom_description = {
			text = "has_crown_law_allowing_succession_law_change"
			has_realm_law_flag = can_change_succession_laws
		}
	}
}

can_change_succession_law_trigger = {
	can_change_succession_laws_realm_flag_trigger = yes
	custom_description = {
		text = "no_powerful_vassal_with_negative_opinion"
		NOT = {
			any_vassal = {
				is_powerful_vassal = yes
				opposes_succession_law_change_trigger = yes
			}
		}
	}
}

can_change_single_heir_dynasty_house_succession_law_trigger = {
	trigger_if = {
		limit = {
			culture = {
				OR = {
					this = culture:czech
					this = culture:NEOW_slovak
					any_parent_culture_or_above = {
						this = culture:czech
					}
					any_parent_culture_or_above = {
						this = culture:NEOW_slovak
					}
				}
			}
			NOT = {
				has_realm_law_flag = can_change_succession_laws
			}
		}
		culture = {
			has_innovation = innovation_table_of_princes
		}
	}
	trigger_else = {
		can_change_succession_laws_realm_flag_trigger = yes
	}
	custom_description = {
		text = "no_powerful_vassal_with_negative_opinion"
		NOT = {
			any_vassal = {
				is_powerful_vassal = yes
				opposes_succession_law_change_trigger = yes
			}
		}
	}
}

can_change_to_equal_succession_law_trigger = {
	trigger_if = {
		limit = {
			NOT = { has_realm_law_flag = can_change_succession_laws }
		}
		OR = {
			culture = { has_cultural_parameter = gender_equal_inheritance }
			faith = { has_doctrine = doctrine_gender_equal }
		}
	}
	trigger_else = {
		can_change_succession_laws_realm_flag_trigger = yes
	}
	custom_description = {
		text = "no_powerful_vassal_with_negative_opinion"
		NOT = {
			any_vassal = {
				is_powerful_vassal = yes
				opposes_succession_law_change_trigger = yes
			}
		}
	}
}

can_change_partition_succession_law_trigger = {
	custom_description = {
		text = "has_law_allowing_partition_succession_law_change"	
		OR = {
			has_realm_law_flag = can_change_partition_succession_laws
			has_realm_law_flag = can_change_succession_laws
		}
	}
	custom_description = {
		text = "no_powerful_vassal_with_negative_opinion"
		NOT = {
			any_vassal = {
				is_powerful_vassal = yes
				opposes_succession_law_change_trigger = yes
			}
		}
	}
}


## Can this character assign a dedicated heir?
#
# Check if a character can assign some designated heir,
# but not if the heir is a valid candidate.
#
# root: Character that will assign an heir
#
can_designate_heir_trigger = {
	trigger_if = {
		# Admin always has access to this
		limit = { government_allows = administrative }

		custom_description = {
			text = "has_admin_allowing_designate_heir"
			any_held_title = {
				is_noble_family_title = yes
			}
		}
	}
	trigger_else_if = {
		# Feudal and clan can get this by increasing crown authority
		limit = { has_realm_law_in_group = crown_authority }

		custom_description = {
			text = "has_crown_authority_designate_heir"
			has_realm_law_flag = can_designate_heirs
		}
	}
	trigger_else = {
		# Everyone else also needs a law to gain access to this interaction
		custom_description = {
			text = "has_law_allowing_designate_heir"
			has_realm_law_flag = can_designate_heirs
		}
	}
}


can_change_title_law_trigger = {
	is_at_war = no
}
