
# 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/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/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
#	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)
#	all: all living characters (Avoid if possible. VERY CPU-HEAVY!)
#	


targetted_decisions = {
	demand_religious_conversion = {
		filter = sub_realm
		ai_target_filter = sub_realm
		
		from_potential = {
			is_playable = yes
			has_regent = no
			proselyte_religion_trigger = yes #Only proselyte religions may do this freely
		}
		potential = {
			NOR = {
				character = FROM
				religion = FROM
				trait = incapable
			}
			is_adult = yes
			liege = {
				character = FROM
			}
			OR = {
				prisoner = no
				host = {
					character = FROM
				}
			}
		}
		allow = {
			OR = {
				AND = {
					NOT = {
						has_opinion_modifier = {	#Can not try to convert if recently failed to convert
							who = FROM
							modifier = tried_to_convert_me
						}
					}
					FROM = {
						war = no
					}
					opinion = { who = FROM value = 35}
				}
				AND = {
					prisoner = yes
					host = {
						character = FROM
					}
					custom_tooltip = {
						text = third_conversion_attempt
						hidden_tooltip = {
							NOT = { has_character_flag = third_conversion_attempt }
						}
					}
				}
			}
		}
		effect = {
			ROOT = {
				letter_event = {
					id = demand_conversion.1
					days = 3
					random = 7
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.001	#slow it down
			}
		}
	}	
	demand_religious_conversion_2 = { # Bastion of Faith towards Ancestral
		filter = sub_realm
		ai_target_filter = sub_realm
		
		from_potential = {
			is_playable = yes
			has_regent = no
			bastion_of_faith_religion_trigger = yes 
		}
		potential = {
			NOR = {
				character = FROM
				religion = FROM
				trait = incapable
			}
			is_adult = yes
			liege = {
				character = FROM
			}
			OR = {
				prisoner = no
				host = {
					character = FROM
				}
			}
			ancestral_religion_trigger = yes 
		}
		allow = {
			OR = {
				AND = {
					NOT = {
						has_opinion_modifier = {	#Can not try to convert if recently failed to convert
							who = FROM
							modifier = tried_to_convert_me
						}
					}
					FROM = {
						war = no
					}
					opinion = { who = FROM value = 35}
				}
				AND = {
					prisoner = yes
					host = {
						character = FROM
					}
					custom_tooltip = {
						text = third_conversion_attempt
						hidden_tooltip = {
							NOT = { has_character_flag = third_conversion_attempt }
						}
					}
				}
			}
		}
		effect = {
			ROOT = {
				letter_event = {
					id = demand_conversion.1
					days = 3
					random = 7
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.001	#slow it down
			}
		}
	}	
	
	demand_religious_conversion_3 = { # Ancestral towards religion with low moral authority 
		filter = sub_realm
		ai_target_filter = sub_realm
		
		from_potential = {
			is_playable = yes
			has_regent = no
			offensive_ancestral_religion_trigger = yes
		}
		potential = {
			NOR = {
				character = FROM
				religion = FROM
				trait = incapable
			}
			is_adult = yes
			liege = {
				character = FROM
			}
			OR = {
				prisoner = no
				host = {
					character = FROM
				}
			}
			NOT = { religion_authority = 0.2 } 
		}
		allow = {
			OR = {
				AND = {
					NOT = {
						has_opinion_modifier = {	#Can not try to convert if recently failed to convert
							who = FROM
							modifier = tried_to_convert_me
						}
					}
					FROM = {
						war = no
					}
					opinion = { who = FROM value = 35}
				}
				AND = {
					prisoner = yes
					host = {
						character = FROM
					}
					custom_tooltip = {
						text = third_conversion_attempt
						hidden_tooltip = {
							NOT = { has_character_flag = third_conversion_attempt }
						}
					}
				}
			}
		}
		effect = {
			ROOT = {
				letter_event = {
					id = demand_conversion.1
					days = 3
					random = 7
				}
			}
		}
		
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.001	#slow it down
			}
		}
	}	
}
