# Targetted decisions are possible vs _all_ other characters and shown are in the Diplomacy View, not the Intrigue View. The taker is in the FROM scope.
#
# filter = [self/court/home_court/vassals/sub_realm/realm/dynasty/spouse/liege/religious_head/rivals/society/all] ('self' MUST be set for decisions targetting only the taker, the other filter types can be set to lessen CPU load)
# ai_target_filter = [self/court/home_court/vassals/sub_realm/realm/dynasty/spouse/liege/religious_head/rivals/society/all] (which characters for which the AI evaluates the decision.)
#	court: all characters in the AI's host court, including prisoners, and characters currently away (wards, prisoners, etc)
#	home_court: all characters in the AI's home court, including prisoners, and characters currently away (wards, prisoners, etc)
#	vassals: direct vassal rulers of the AI's employer
#	sub_realm: all characters below the AI's employer
#	realm: all characters in the same top realm as the AI
#	dynasty: all members of the same dynasty (but not yourself)
#	rivals: your rivals plus any character you have an opinion modifier with 'crime = yes' set (the same set of characters the 'is_foe' trigger evaluates)
# society: the other members of your society (but not yourself)
#	all: all living characters (Avoid if possible. VERY CPU-HEAVY!)
#	independent_rulers
#	close_relatives. Includes children, grandchildren, parents, siblings, and niblings
#	

targetted_decisions = {
	house_customiser_target = {	
		ai_target_filter = none
		filter = all
		ai = no
		
		from_potential = {
			ai = no
			is_ruler = yes
			trait = house_customizer
		}
		potential = {
			NOT = { dynasty = FROM }
			NOT = { dynasty = 0 }
			NOT = { trait = dragon }
		}
		allow = {
			FROM = { NOT = { is_nomadic = yes } }
			OR = {
				FROM = { is_patrician = no }
				NOR = {
					is_patrician = yes
					any_dynasty_member = { is_patrician = yes is_alive = yes }
				}
			}
			# OR = {
				# FROM = { is_nomadic = no }
				# NOR = {
					# is_nomadic = yes
					# any_dynasty_member = { is_nomadic = yes is_alive = yes }
				# }
			# }
			# OR = {
				# AND = {
					# is_older_than = FROM
					# age_diff = { who = FROM years = 13 }
					# OR = {
						# is_female = no
						# is_married_matrilineally = yes
					# }
					# OR = {
						# is_female = yes
						# is_married_matrilineally = no
						# is_married = no
					# }
				# }
				# father_even_if_dead = {
					# OR = {
						# AND = {
							# FROM = { NOT = { age_diff = { who = ROOT years = 20 } } }
							# dynasty = PREV
							# is_older_than = FROM
						# }	
						# father_even_if_dead = {
							# OR = {
								# AND = {
									# FROM = { age_diff = { who = ROOT years = 15 } }
									# dynasty = PREV
									# is_older_than = FROM
								# }	
								# father_even_if_dead = {
									# FROM = { age_diff = { who = ROOT years = 30 } }
									# dynasty = PREV
									# is_older_than = FROM
								# }
							# }	
						# }
						# mother_even_if_dead = {
							# FROM = { age_diff = { who = ROOT years = 15 } }
							# dynasty = PREV
							# is_older_than = FROM
						# }
					# }	
				# }
				# mother_even_if_dead = {
					# OR = {
						# AND = {
							# FROM = { NOT = { age_diff = { who = ROOT years = 20 } } }
							# dynasty = PREV
							# is_older_than = FROM
						# }	
						# father_even_if_dead = {
							# FROM = { age_diff = { who = ROOT years = 15 } }
							# dynasty = PREV
							# is_older_than = FROM
						# }
						# mother_even_if_dead = {
							# FROM = { age_diff = { who = ROOT years = 15 } }
							# dynasty = PREV
							# is_older_than = FROM
						# }
					# }	
				# }
			# }
		}
		effect = {
			FROM = {
				dynasty = ROOT
				any_child = { dynasty = ROOT }
				character_event = { id = customizer_houses.3 tooltip = TOOLTIPcustomizer_houses.3 }
				hidden_tooltip = { remove_trait = house_customizer }
				recalc_succession = yes
				chronicle = {
					entry = CHRONICLE_HOUSE_CUSTOMISER
					portrait = [This.GetID]
				}	
			}	
			recalc_succession = yes			
		}
		ai_will_do = {
			factor = 0
		}
	}
}
