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

	religious_torture_decision = {
		ai_target_filter = court
		
		from_potential = {
			is_ruler = yes
			is_adult = yes
			has_regent = no
			OR = {
				religion_group = pagan_group
				culture = greek
				culture = armenian
				
				ai = no
			}
			
		}
		
		potential = {
			prisoner = yes
			host = { character = FROM }
			
			hidden_tooltip = {
				OR = {
					FROM = {religion_group = pagan_group}
					
					AND = {
						is_female = no
						NOT = {trait = eunuch}
					}
					
					NOT = {trait = blinded}
				}
			}
			
			OR = {
				NOT = {
					reverse_opinion = {
						who = FROM
						value = 0
					}
				}
				FROM = {ai = no}
			}
			
		}
		
		allow = {
			custom_tooltip = {
				text = recently_tortured
				hidden_tooltip = {
					NOT = {has_character_modifier = trcd}
				}
			}
			OR = {
				NOT = {
					FROM = {trait = kind}
				}
				FROM = {trait = lunatic}
				FROM = {trait = possessed}
			}
			NOT = {
				is_friend = FROM
				is_lover = FROM
			}
		}
		
		effect = {
			hidden_tooltip = {
				add_character_modifier = {
					name = trcd
					duration = 60
					hidden = yes
				}
				FROM = {character_event = {id = TTR.900 days = 1}}
			}
			
		}
		
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
			}
			modifier = {
				factor = 0.01
				FROM = { #YO SLOW IT WAY DOWN
					OR = {
						trait = cruel
						trait = impaler
					}
				}
			}
			
			modifier = {
				factor = 2.0
				FROM = {religion_group = pagan_group}
				war = yes
			}
			
			modifier = {
				factor = 50
				OR = {
					FROM = {trait = lunatic}
					FROM = {trait = possessed}
				}
			}

			modifier = {
				factor = 0.01
				OR = {
					is_primary_war_attacker = yes
					is_primary_war_defender = yes
				}
				OR = {
					war_with = FROM
					FROM = {
						any_liege = {
							war_with = FROM
						}
					}
				}
			}
			
			modifier = {
				factor = 100.0
				FROM = {religion_group = pagan_group}
				FROM = {trait = zealous}
			}
			
			modifier = {
				factor = 1000.0
				FROM = {religion_group = pagan_group}
				is_rival = FROM
			}
			
			modifier = {
				factor = 0.01
				OR = {
					is_child_of = FROM
					FROM = {is_child_of = FROM}
				}
			}
			
			modifier = {
				factor = 20
				OR = {
					FROM = {culture = greek}
					FROM = {culture = armenian}
				}
			}
			
			modifier = {
				factor = 10.0
				NOT = {
					reverse_opinion = {
						who = FROM
						value = -25
					}
				}
			}
			
			modifier = {
				factor = 0.01

				reverse_opinion = {
					who = FROM
					value = 30
				}

			}
			
			modifier = {
				factor = 2
				FROM = {trait = impaler}
			}
			
			modifier = {
				factor = 0.01
				FROM = {is_female = no}
				is_female = yes
			}
			
			modifier = {
				factor = 0.01
				FROM = {
					OR = {
						religion_group = christian
						religion_group = muslim
						religion_group = indian_group
					}
				}
			}

		}
	}
	
	normal_torture_decision = {
		ai_target_filter = court
		
		from_potential = {
			is_ruler = yes
			is_adult = yes
			has_regent = no
			OR = {
				trait = cruel
				trait = impaler
				trait = lunatic
				trait = possessed
				ai = no
			}
		}
		
		potential = {
			prisoner = yes
			host = { character = FROM }
			hidden_tooltip = {
				NOT = {
					AND = {
						trait = deaf
						trait = mute
						trait = blinded
						trait = maimed
					}
				}

			}
			
			OR = {
				NOT = {
					reverse_opinion = {
						who = FROM
						value = 0
					}
				}
				FROM = {ai = no}
			}
			
		}
		
		allow = {
			custom_tooltip = {
				text = recently_tortured
				hidden_tooltip = {
					NOT = {has_character_modifier = trcd}
				}
			}
			OR = {
				NOT = {
					FROM = {trait = kind}
				}
				FROM = {trait = lunatic}
				FROM = {trait = possessed}
			}
			FROM = {piety = 50}
			NOT = {
				is_friend = FROM
				is_lover = FROM
			}
		}
		
		effect = {
			FROM = {piety = -10}
			hidden_tooltip = {
				add_character_modifier = {
					name = trcd
					duration = 60
					hidden = yes
				}
				FROM = {character_event = {id = TTR.1000 days = 1}}
			}
			
		}
		
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.05
			}
			
			modifier = {
				factor = 5
				FROM = {trait = wroth}
			}
			
			modifier = {
				factor = 20
				OR = {
					FROM = {culture = greek}
					FROM = {culture = armenian}
				}
			}
			modifier = {
				factor = 50
				OR = {
					FROM = {trait = lunatic}
					FROM = {trait = possessed}
				}
			}
			
			modifier = {
				factor = 0.01
				OR = {
					is_child_of = FROM
					FROM = {is_child_of = FROM}
				}
			}
			
			modifier = {
				factor = 0.05
				dynasty = FROM
			}
			
			modifier = {
				factor = 10.0
				is_rival = FROM
			}
			
			modifier = {
				factor = 2.0
				is_landed = yes
			}
			
			modifier = {
				factor = 10.0
				NOT = {
					reverse_opinion = {
						who = FROM
						value = -25
					}
				}
			}
			
			modifier = {
				factor = 0.01

				reverse_opinion = {
					who = FROM
					value = 30
				}

			}
			
			modifier = {
				factor = 5
				FROM = {trait = arbitrary}
			}
			
			modifier = {
				factor = 20
				FROM = {trait = impaler}
			}
			
			modifier = {
				factor = 0.01
				FROM = {is_female = no}
				is_female = yes
			}
			
			modifier = {
				factor = 0.01
				FROM = {
					OR = {
						religion_group = christian
						religion_group = muslim
						religion_group = indian_group
					}
				}
			}

		}
	}

}
