
# 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 = {
	
	rape_decision = {
		filter = court
		ai_target_filter = court
	
		from_potential = {
			is_ruler = yes
			is_female = no
			age = 16
			NOT = { trait = kind }
			NOT = { trait = homosexual }

		}
	
		potential = {
			host = { character = FROM }
			prisoner = yes
			is_female = yes
			age = 16	
			NOT = { trait = Raped }

		}
		allow = {
			prisoner = yes
		}
		effect = {
			add_trait = Raped
			prestige = -100
			if = {
				limit = { NOT = { trait = pregnant } }
				limit = { NOT = { age = 40 } }
				random = {
					chance = 50
					impregnate = FROM
				}
			}		
			opinion = {
				modifier = opinion_raped_me
				who = FROM
			}
			FROM = {
				piety = -15
			}
			hidden_tooltip = {
				mother = {
					opinion = {
						modifier = opinion_raped_daughter
						who = FROM
					}
				}
				father = {
					opinion = {
						modifier = opinion_raped_daughter
						who = FROM
					}
				}
				spouse = {
					opinion = {
						modifier = opinion_raped_wife
						who = FROM
					}
				}
				any_child = {
					opinion = {
						modifier = opinion_raped_mom
						who = FROM
					}
				}
				if = {
					limit = {
						FROM = {
							NOT = { dynasty = ROOT }
							NOT = { sibling = ROOT }
						}
					}
					any_sibling = {
						opinion = {
							modifier = opinion_raped_family
							who = FROM
						}
					}
				}
				FROM = {
					remove_opinion = { who = ROOT modifier = opinion_traitor }
					remove_opinion = { who = ROOT modifier = opinion_rebel_traitor }
					remove_opinion = { who = ROOT modifier = opinion_dishonorable }
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	rape2_decision = {
		filter = court
		ai_target_filter = court
	
		from_potential = {
			is_ruler = yes
			is_female = no
			age = 14
			NOT = { trait = kind }
			NOT = { trait = homosexual }
		}
	
		potential = {
			host = { character = FROM }
			is_female = yes
			prisoner = no
			age = 16
			is_ruler = no
			NOT = { any_spouse = { character = FROM } }
            NOT = { any_consort = { character = FROM } }						
			NOT = { trait = Raped }
		}
		allow = {
			is_female = yes
		}
		effect = {
			add_trait = Raped
			prestige = -50
			if = {
				limit = { NOT = { trait = pregnant } }
				limit = { NOT = { age = 40 } }
				random = {
					chance = 50
					impregnate = FROM
				}
			}	
			opinion = {
				modifier = opinion_raped_me
				who = FROM
			}
			FROM = {
				piety = -50
				cost_piety = 50
			}
			hidden_tooltip = {
				mother = {
					opinion = {
						modifier = opinion_raped_daughter
						who = FROM
					}
				}
				father = {
					opinion = {
						modifier = opinion_raped_daughter
						who = FROM
					}
				}
				spouse = {
					opinion = {
						modifier = opinion_raped_wife
						who = FROM
					}
				}
				any_child = {
					opinion = {
						modifier = opinion_raped_mom
						who = FROM
					}
				}
				if = {
					limit = {
						FROM = {
							NOT = { dynasty = ROOT }
							NOT = { sibling = ROOT }		
						}
					}
					any_sibling = {
						opinion = {
							modifier = opinion_raped_family
							who = FROM
						}
					}
				}
				FROM = {
					remove_opinion = { who = ROOT modifier = opinion_traitor }
					remove_opinion = { who = ROOT modifier = opinion_rebel_traitor }
					remove_opinion = { who = ROOT modifier = opinion_dishonorable }
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 0
		}
	}

	torture_decision = {
		filter = court
		ai_target_filter = court
	
		from_potential = {
			is_ruler = yes
			age = 16
		}
		allow = {
			FROM = { trait = cruel = yes }
		}
		potential = {
			host = { character = FROM }
			prisoner = yes
			age = 16	
		}
		allow = {
			prisoner = yes
		}
		effect = {
			add_trait = wounded
			prestige = -10
			if = {
				limit = { NOT = { trait = pregnant } }
				limit = { NOT = { age = 40 } }
				random = {
					chance = 90
					wound = FROM
				}
			}		
			opinion = {
				modifier = opinion_tortured_me
				who = FROM
			}
			FROM = {
				piety = -5
			}
			hidden_tooltip = {
				mother = {
					opinion = {
						modifier = opinion_tortured_daughter
						who = FROM
					}
				}
				father = {
					opinion = {
						modifier = opinion_tortured_daughter
						who = FROM
					}
				}
				spouse = {
					opinion = {
						modifier = opinion_tortured_wife
						who = FROM
					}
				}
				any_child = {
					opinion = {
						modifier = opinion_tortured_mom
						who = FROM
					}
				}
				if = {
					limit = {
						FROM = {
							NOT = { dynasty = ROOT }
							NOT = { sibling = ROOT }
						}
					}
					any_sibling = {
						opinion = {
							modifier = opinion_tortured_family
							who = FROM
						}
					}
				}
				FROM = {
					remove_opinion = { who = ROOT modifier = opinion_traitor }
					remove_opinion = { who = ROOT modifier = opinion_rebel_traitor }
					remove_opinion = { who = ROOT modifier = opinion_dishonorable }
				}
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 2
		}
	}

	vassal_silverblooded_decision = {
	
		ai_target_filter = home_court
	
		from_potential = {
			is_ruler = yes
			religion = Serpentanism
		}
	
		potential = {
			prisoner = yes
			is_adult = yes
			host = { character = FROM }
			NOT = { religion = Serpentanism }
		}
		
		allow = {
			prisoner = yes
		}
		
		effect = {
			add_trait = silverblooded
			any_liege = {
				limit = { 
					NOT = { character = FROM }
				}
			}
			death = {
				death_reason = death_silverblooded
				killer = FROM
			}
			FROM = {
				if = {
					limit = { NOT = { trait = cruel } }
					random = {
						chance = 5
						add_trait = cruel
						hidden_tooltip = {
						}
					}
				}
				piety = 10
			}
		}
		revoke_allowed = {
			always = no
		}
		ai_will_do = {
			factor = 1
		}
	}
}