# 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 = {

	theo_decision = {
		ai_target_filter = realm
		
		from_potential = {
			is_ruler = yes
			is_adult = yes
			has_regent = no
			OR = {
				ai = no
				is_theocracy = yes
				is_priest = yes
			}
		}
		
		potential = {
			is_adult = yes
			
			has_regent = no
			NOT = {trait = incapable}
			holy_order = no
			mercenary = no
			NOT = { religion = FROM }
		}
		
		allow = {
			FROM = { ### Valid reason for duel
				NOT = {trait = cynical} #You cannot convert others if you do not believe it yourself
				war = no
			}
			war = no
			custom_tooltip = {
				text = theo_tooltip_not_before
				hidden_tooltip = {
					NOT = {
						has_opinion_modifier = {
							modifier = theo_challenge
							who = FROM
						}
					}
				}
			}
			
			custom_tooltip = {
				text = theo_tooltip_cd
				hidden_tooltip = {
					NOT = {
						FROM = {
							has_character_modifier = thcd
						}
					}
				}
			}
			
			is_within_diplo_range = FROM
		}
		
		effect = {
			hidden_tooltip = {
				add_character_modifier = {
					name = thds
					duration = 365
					hidden = yes
				}
				if = {
					limit = {FROM = {is_priest = no}}
					FROM = {
						add_character_modifier = {
							name = thcd
							duration = 365
							hidden = yes
						}
					}
				}
				if = {
					limit = {FROM = {is_priest = yes}}
					FROM = {
						add_character_modifier = {
							name = thcd
							duration = 120
							hidden = yes
						}
					}
				}
				opinion = {
					modifier = theo_challenge
					who = FROM
					months = 1200
				}
				character_event = {
					id = THD.100
					days = 1
				}
			}
			
		}
		
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			
			
			modifier = {
				factor = 0
				has_character_modifier = thds
			}
			
			modifier = {
				factor = 0
				FROM = {trait = depressed}
			}
			
			modifier = {
				factor = 0
				attribute_diff = {
					character = FROM
					attribute = learning
					value = 3 #He's too good
				}
			}
			
			
			
			modifier = {
				factor = 3
				FROM = {trait = zealous}
			}
			
			modifier = {
				factor = 0.02
				FROM = {
					religion_group = pagan_group
					is_reformed_religion = no
				}
				
			} #Not really pagans who are not reformed
			
			modifier = {
				factor = 3
				
				FROM = {
					OR = {
						religion_group = muslim
						religion_group = christian
					}
				}

			}
			
			modifier = {
				factor = 0.1
				NOT = {FROM = {learning = 5}}
			}
			modifier = {
				factor = 0.1
				NOT = {FROM = {learning = 10}}
			}
			modifier = {
				factor = 0.1
				NOT = {FROM = {learning = 20}}
			}
		}
	}
	
	

}
