﻿namespace = stress_trait_coping_decisions

#Drunkard
#Hashishiyah
#Rakish
#Reclusive
#Irritable
#Flagellant
#Profligate
#Improvident
#Contrite
#Comfort Eater
#Inappetetic
#Journaller
#Confider
#Athletic





###############
#	DRUNKARD
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.1001 = {
	type = character_event
	title = stress_trait_coping_decisions.1001.t
	desc = stress_trait_coping_decisions.1001.desc
	theme = mental_break
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = drink_goblet
	}

	option = {
		name = stress_trait_coping_decisions.1001.a
		trait = drunkard
		add_prestige = medium_prestige_loss
		add_stress = medium_stress_loss
	}
}


#Vassal/liege is also drunkard! Bond
#by Linnéa Thimrén
stress_trait_coping_decisions.1002 = {
	type = character_event
	title = stress_trait_coping_decisions.1002.t
	desc = stress_trait_coping_decisions.1002.desc
	theme = mental_break
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = yes }
			animation = toast_goblet
		}
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = no }
			animation = toast
		}
	}
	right_portrait = {
		character = scope:fellow_drunkard
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = yes }
			animation = drink_goblet
		}
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = no }
			animation = drink
		}
	}

	trigger = {
		is_playable_character = yes
		is_adult = yes
		has_trait = drunkard
		OR = {
			any_vassal = {
				NOT = { has_relation_rival = root }
				has_trait = drunkard
				is_available_ai_adult = yes
			}
			AND = {
				liege ?= {
					this != root
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
				}
			}
			trigger_if = {
				limit = { is_landed = no }
				any_courtier = {
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
				}
			}
		}
	}

	weight_multiplier = {
		base = 1

		modifier = { #Less likely if you have many friends already
			add = -0.75
			any_relation = {
				type = friend
				count >= 2
			}
		}

		modifier = { #More likely if they're a potential friend already
			add = 0.25
			OR = {
				any_vassal = {
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
					has_relation_potential_friend = root
				}
				AND = {
					liege ?= {
						this != root
						NOT = { has_relation_rival = root }
						has_trait = drunkard
						is_available_ai_adult = yes
						has_relation_potential_friend = root
					}
				}
			}
		}
	}

	immediate = {
		save_scope_as = original_drunkard
		if = {
			limit = {
				liege ?= {
					this != root
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
				}
			}
			liege = {
				save_scope_as = fellow_drunkard
			}
		}
		else_if = {
			limit = { is_landed = no }
			random_courtier = {
				limit = {
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
				}
				save_scope_as = fellow_drunkard
			}
		}
		else = {
			random_vassal = {
				limit = {
					NOT = { has_relation_rival = root }
					has_trait = drunkard
					is_available_ai_adult = yes
				}
				save_scope_as = fellow_drunkard
			}
		}

		#To clear out any bad blood between you
		hidden_effect = {
			if = {
				limit = {
					has_relation_potential_rival = scope:fellow_drunkard
				}
				remove_relation_potential_rival = scope:fellow_drunkard
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.1002.a
		trait = drunkard
		add_prestige = medium_prestige_loss
		add_stress = medium_stress_loss
		show_as_tooltip = {
			if = {
				limit = {
					has_relation_friend = scope:fellow_drunkard
				}
				scope:fellow_drunkard = {
					add_opinion = {
						target = root
						modifier = friendliness_opinion
						opinion = 20
					}
				}
			}
			else = {
				set_relation_friend = { reason = friend_drinking_buddies target = scope:fellow_drunkard }
			}
		}
		#Response event for your fellow drunkard
		scope:fellow_drunkard = {
			trigger_event = stress_trait_coping_decisions.1003
		}
	}
}

#Response event for your fellow drunkard
stress_trait_coping_decisions.1003 = {
	type = character_event
	title = stress_trait_coping_decisions.1003.t
	desc = stress_trait_coping_decisions.1003.desc
	theme = mental_break
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = yes }
			animation = drink_goblet
		}
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = no }
			animation = drink
		}
	}
	right_portrait = {
		character = scope:original_drunkard
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = yes }
			animation = drink_goblet
		}
		triggered_animation = {
			trigger = { use_goblet_in_tavern_trigger = no }
			animation = drink
		}
	}

	immediate = {
		if = {
			limit = {
				has_relation_friend = scope:original_drunkard
			}
			scope:original_drunkard = {
				add_opinion = {
					target = root
					modifier = friendliness_opinion
					opinion = 20
				}
			}
		}
		else = {
			set_relation_friend = { reason = friend_drinking_buddies target = scope:original_drunkard }
		}
	}

	option = {
		name = stress_trait_coping_decisions.1002.a
		trait = drunkard
		add_stress = medium_stress_loss
	}
}


#Hmm... You wake up with sheep
#by Linnéa Thimrén
stress_trait_coping_decisions.1004 = {
	type = character_event
	title = stress_trait_coping_decisions.1004.t
	desc = stress_trait_coping_decisions.1004.desc
	theme = mental_break
	override_background = {
		reference = terrain_scope
	}
	left_portrait = {
		character = root
		animation = disbelief
	}

	option = {
		name = stress_trait_coping_decisions.1004.a
		trait = drunkard
		add_stress = medium_stress_loss
	}
}

###############
#	HASHISHIYAH
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.1501 = {
	type = character_event
	title = stress_trait_coping_decisions.1501.t
	desc = stress_trait_coping_decisions.1501.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_irrational
	}

	option = {
		name = stress_trait_coping_decisions.1501.a
		trait = hashishiyah
		add_character_modifier = {
			modifier = stress_hashish_stupor
			years = 2
		}
		add_stress = medium_stress_loss
	}
}


###############
#	RAKISH
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.2001 = {
	type = character_event
	title = stress_trait_coping_decisions.2001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_female = yes
				}
				desc = stress_trait_coping_decisions.2001.desc_woman
			}
			desc = stress_trait_coping_decisions.2001.desc_man
		}
		desc = stress_trait_coping_decisions.2001.desc_ending
	}
	theme = mental_break
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = personality_bold
	}

	option = {
		name = stress_trait_coping_decisions.2001.a
		trait = rakish
		remove_short_term_gold = minor_gold_value
		rakish_brothel_night_effect = yes
	}
}


#Your stuff got stolen by a person in a brothel!
#by Linnéa Thimrén
stress_trait_coping_decisions.2002 = {
	type = character_event
	title = stress_trait_coping_decisions.2002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_female = yes
				}
				desc = stress_trait_coping_decisions.2002.desc_woman
			}
			desc = stress_trait_coping_decisions.2002.desc_man
		}
		desc = stress_trait_coping_decisions.2002.desc
		desc = {
			first_valid = {
				triggered_desc = {
					trigger = {
						exists = scope:rival
					}
					desc = stress_trait_coping_decisions.2002.desc_ending_rival
				}
				desc = stress_trait_coping_decisions.2002.desc_ending
			}
		}
	}
	theme = mental_break
	override_background = { reference = tavern }
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:rival
		animation = schadenfreude
	}

	trigger = {
		short_term_gold >= 20
		OR = {
			exists = scope:from_stress_loss_decision
			has_trait = lustful
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #More likely if you have a rival and it's triggered from the yearly pulse
			add = 2
			NOT = { exists = scope:from_stress_loss_decision }
			any_relation = {
				type = rival
				is_ai = yes
			}
		}
	}

	immediate = {
		hidden_effect = {
			if = {
				limit = {
					any_relation = {
						type = rival
						is_ai = yes
					}
				}
				random_relation = {
					type = rival
					limit = {
						is_ai = yes
					}
					save_scope_as = rival
				}
			}
		}
		add_character_flag = is_naked
	}

	option = {
		name = stress_trait_coping_decisions.2002.a
		trigger = {
			NOR = { 
				exists = scope:rival
				has_trait = lustful
			}
		}
		trait = rakish
		hidden_effect = {
			rakish_brothel_night_effect = yes
		}
		remove_short_term_gold = 20
		add_prestige = minor_prestige_loss
	}

	option = {
		name = stress_trait_coping_decisions.2002.a
		trigger = {
			NOT = { exists = scope:rival }
			NOT = { has_trait = rakish }
			has_trait = lustful
		}
		trait = lustful
		hidden_effect = {
			rakish_brothel_night_effect = yes
		}
		remove_short_term_gold = 20
		add_prestige = minor_prestige_loss
	}

	option = {
		name = stress_trait_coping_decisions.2002.b
		trigger = {
			exists = scope:rival
		}
		trait = rakish
		hidden_effect = {
			rakish_brothel_night_effect = yes
		}
		remove_short_term_gold = 20
		add_prestige = minor_prestige_loss
	}
	after = {
		remove_character_flag = is_naked
	}
}

##################################################
# Brothel Bastard
# by Joe Parkin
# 2003-2004
##################################################

scripted_trigger potential_brothel_bastard_real_father_trigger = {
	is_male = yes
	is_adult = yes
	is_attracted_to_women = yes
	fertility > 0
	might_cheat_on_every_partner_trigger = yes
}

stress_trait_coping_decisions.2003 = {
	type = character_event
	hidden = yes
	cooldown = { years = 15 }

	trigger = {
		is_ai = no
		# Only men have a chance of bastards this way, as real_father cannot be anonymous
		is_male = yes
		# Must be attracted to women
		is_attracted_to_women = yes
	}

	immediate = {
		# Determine real father and fire event in 9 months
		random_list = {
			25 = { # Real father is someone else
				# An existing nearby character
				location.province_owner = {
					every_courtier_or_guest = {
						limit = { potential_brothel_bastard_real_father_trigger = yes }
						add_to_list = potential_real_fathers
					}
					every_vassal = {
						limit = { potential_brothel_bastard_real_father_trigger = yes }
						add_to_list = potential_real_fathers
					}
					every_liege_or_above = {
						limit = { potential_brothel_bastard_real_father_trigger = yes }
						add_to_list = potential_real_fathers
					}
				}
				every_pool_character = {
					province = root.location
					limit = { potential_brothel_bastard_real_father_trigger = yes }
					add_to_list = potential_real_fathers
				}
				random_in_list = {
					list = potential_real_fathers
					weight = {
						base = 1
						modifier = {
							has_trait = fecund
							add = 25
						}
						modifier = {
							has_trait = lustful
							add = 25
						}
						modifier = {
							has_trait = rakish
							add = 100
						}
					}
					save_scope_as = real_father
				}
				# Fallback unknown real father
				if = {
					limit = {
						NOT = { exists = scope:real_father }
					}
					create_character = {
						location = root.location
						culture = root.location.culture
						faith = root.location.faith
						template = peasant_character
						gender = root
						save_scope_as = real_father
					}
					scope:real_father = { add_character_flag = silently_disappear }
				}
			}
			50 = { # You are the real father
				trigger = { fertility > 0 }
				modifier = {
					add = {
						value = fertility
						multiply = scope:brothel_bastard_chance
					}
				}
				save_scope_as = real_father
			}
		}
		set_variable = {
			name = prostitute_culture_scope
			value = root.location.culture
		}
		set_variable = {
			name = prostitute_faith_scope
			value = root.location.faith
		}
		trigger_event = {
			id = stress_trait_coping_decisions.2004
			months = 9
		}
		
		# Delete real father if generated
		scope:real_father ?= {
			if = {
				limit = { has_character_flag = silently_disappear }
				silent_disappearance_effect = yes
			}
		}
	}
}

stress_trait_coping_decisions.2004 = {
	type = character_event
	title = stress_trait_coping_decisions.2004.t
	desc = stress_trait_coping_decisions.2004.desc
	theme = mental_break
	left_portrait = { 
		character = root
		animation = stunned
	}
	right_portrait = {
		character = scope:prostitute
		animation = newborn
	}
	lower_center_portrait = scope:baby
	override_background = { reference = market }

	trigger = {
		exists = var:prostitute_culture_scope
		exists = var:prostitute_faith_scope
		exists = scope:real_father
	}

	immediate = {
		# Create brothel partner
		create_character = {
			location = root.location
			template = beautiful_peasant_character
			opposite_gender = root
			culture = root.var:prostitute_culture_scope
			faith = root.var:prostitute_faith_scope
			save_scope_as = prostitute
		}
		# Mirror your diseases
		hidden_effect = {
			if = {
				limit = { has_trait = great_pox }
				scope:prostitute = { add_trait = great_pox }
			}
			if = {
				limit = { has_trait = lovers_pox }
				scope:prostitute = { add_trait = lovers_pox }
			}
		}
		# Save characters who might be annoyed at your claiming a bastard
		every_child = {
			limit = {
				NOR = {
					has_trait = bastard
					has_trait = wild_oat
				}
			}
			add_to_list = insulted_list
		}
		every_spouse = { add_to_list = insulted_list }
		every_relation = {
			type = lover
			add_to_list = insulted_list
		}
		# Create a child of real father and prostitute
		create_character = {
			location = root.location
			real_father = scope:real_father
			mother = scope:prostitute
			dynasty = none
			culture = scope:prostitute.culture
			faith = scope:prostitute.faith
			gender_female_chance = 50
			age = 0
			save_scope_as = baby
		}
		# Add bastardy trait to child
		scope:baby = {
			if = {
				limit = {
					faith = { has_doctrine = doctrine_bastardry_none }
				}
				add_trait = wild_oat
			}
			else = { add_trait = bastard }
		}
	}

	option = { # Claim child as own
		name = stress_trait_coping_decisions.2004.a
		scope:baby = {
			set_father = root
			set_house = root.house
		}
		add_courtier = scope:prostitute
		every_in_list = {
			list = insulted_list
			custom = stress_trait_coping_decisions_2004_a_custom
			limit = {
				NOR = {
					this = scope:baby
					this = scope:prostitute
				}
			}
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -25
			}
			add_opinion = {
				target = scope:prostitute
				modifier = angry_opinion
				opinion = -50
			}
			add_opinion = {
				target = scope:baby
				modifier = angry_opinion
				opinion = -50
			}
		}
		add_legitimacy = major_legitimacy_loss
		stress_impact = {
			base = minor_stress_impact_gain
			callous = medium_stress_impact_gain
			paranoid = medium_stress_impact_gain
			arrogant = medium_stress_impact_gain
			humble = minor_stress_impact_loss
			compassionate = medium_stress_impact_loss
		}
	}

	option = { # Take child and mother into court, but don't acknowledge them as your own
		name = stress_trait_coping_decisions.2004.b
		add_piety = minor_piety_gain
		add_courtier = scope:baby
		add_courtier = scope:prostitute
		every_in_list = {
			list = insulted_list
			custom = stress_trait_coping_decisions_2004_a_custom
			limit = {
				NOR = {
					this = scope:baby
					this = scope:prostitute
				}
			}
			add_opinion = {
				target = root
				modifier = angry_opinion
				opinion = -10
			}
			add_opinion = {
				target = scope:prostitute
				modifier = angry_opinion
				opinion = -25
			}
			add_opinion = {
				target = scope:baby
				modifier = angry_opinion
				opinion = -25
			}
		}
		stress_impact = {
			callous = minor_stress_impact_gain
			paranoid = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			greedy = minor_stress_impact_gain
			generous = medium_stress_impact_loss
			compassionate = minor_stress_impact_loss
		}
	}

	option = { # Reject child and mother
		name = stress_trait_coping_decisions.2004.c
		stress_impact = {
			base = medium_stress_impact_gain
			callous = minor_stress_impact_loss
			compassionate = medium_stress_impact_gain
			honest = medium_stress_impact_gain
		}
	}

	after = {
		# Clean up variables
		remove_variable = prostitute_culture_scope
		remove_variable = prostitute_faith_scope
	}
}

###############
#	RECLUSIVE
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.2501 = {
	type = character_event
	title = stress_trait_coping_decisions.2501.t
	desc = stress_trait_coping_decisions.2501.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_content
	}

	option = {
		name = stress_trait_coping_decisions.2501.a
		trait = reclusive
		if = { # always lose prestige as the player, ai only does if it can afford it
			limit = {
				OR = {
					is_ai = no
					prestige > medium_prestige_value
				}
			}
			add_prestige = medium_prestige_loss
		}
		add_stress = medium_stress_loss
	}
}


###############
#	IRRITABLE
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.3001 = {
	type = character_event
	title = stress_trait_coping_decisions.3001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:vassal_opinion
				}
				desc = stress_trait_coping_decisions.3001.desc_has_target_character
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = {
							exists = scope:target_character
							exists = scope:vassal_2
						}
						desc = stress_trait_coping_decisions.3001.desc_has_vassals
					}
					desc = {
						first_valid = {
							triggered_desc = {
								trigger = { exists = scope:target_character }
								desc = stress_trait_coping_decisions.3001.desc_has_target_character
							}
							desc = stress_trait_coping_decisions.3001.desc
						}
					}
				}
			}
		}
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = schadenfreude
	}
	right_portrait = {
		character = scope:target_character
		animation = shame
	}
	lower_right_portrait = scope:vassal_2
	override_background = { reference = council_chamber }

	immediate = {
		get_quirk_character_effect = yes
		hidden_effect = {
			random_list = {
				50 = {
					trigger = {
						any_vassal = { }
					}
					#Pick vassal to insult. Preferably not a friend
					save_scope_value_as = {
						name = vassal_opinion
						value = yes
					}
					random_vassal = {
						limit = {
							NOR = {
								has_relation_friend = root
								has_relation_potential_friend = root
							}
						}
						alternative_limit = {
							NOT = { has_relation_friend = root }
						}
						alternative_limit = {
							is_alive = yes
						}
						save_scope_as = target_character
					}
				}
				50 = {
					if = {
						limit = {
							any_vassal = { count >= 2 }
						}
						#Pick vassals to start insulting. Preferably not friends
						random_vassal = {
							limit = {
								NOR = {
									has_relation_friend = root
									has_relation_potential_friend = root
								}
							}
							alternative_limit = {
								NOT = { has_relation_friend = root }
							}
							alternative_limit = {
								is_alive = yes
							}
							save_scope_as = target_character
						}
						random_vassal = {
							limit = {
								this != scope:target_character
								NOR = {
									has_relation_friend = root
									has_relation_potential_friend = root
								}
							}
							alternative_limit = {
								this != scope:target_character
								NOT = { has_relation_friend = root }
							}
							alternative_limit = {
								this != scope:target_character
							}
							save_scope_as = vassal_2
						}
					}
					else_if = {
						limit = { 
							any_courtier_or_guest = { 
								count >= 1
								OR = { 
									this != root
									this = { is_adult = no }
								}
							}
						}
						#Find a courtier or follower to insult
						random_courtier_or_guest = {
							limit = {
								OR = { 
									this != root
									this = { is_adult = no }
								} 
								NOR = {
									has_relation_friend = root
									has_relation_potential_friend = root
								}
							}
							alternative_limit = {
								OR = { 
									this != root
									this = { is_adult = no }
								}
								NOT = { has_relation_friend = root }
							}
							alternative_limit = {
								this != root
								is_alive = yes
							}
							save_scope_as = target_character
						}
					}
					else = {
						save_scope_value_as = {
							name = courtiers
							value = yes
						}
					}
				}
			}
		}
	}

	option = {
		name = {
			trigger = { exists = scope:target_character }
			text = stress_trait_coping_decisions.3001.a_target
		}
		name = {
			trigger = {
				NOT = { exists = scope:target_character }
			}
			text = stress_trait_coping_decisions.3001.a
		}
		trait = irritable
		if = {
			limit = {
				exists = scope:target_character
			}
			scope:target_character = {
				add_opinion = {
					modifier = insult_opinion
					opinion = medium_negative_opinion
					target = root
				}
			}
		}
		else_if = {
			limit = {
				exists = scope:courtiers
			}
			add_character_modifier = {
				modifier = irritating_everyone_courtier_modifier
				years = 1
			}
		}
		else = {
			add_character_modifier = {
				modifier = irritating_everyone_modifier
				years = 1
			}
		}
		add_stress = medium_stress_loss
	}
}


###############
#	FLAGELLANT
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.3501 = {
	type = character_event
	title = stress_trait_coping_decisions.3501.t
	desc = stress_trait_coping_decisions.3501.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = pain
	}
	override_background = { reference = bedchamber }

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = stress_trait_coping_decisions.3501.a
		flagellation_decision_effect = yes
	}
	after = {
		remove_character_flag = is_naked
	}
}


###############
#	PROFLIGATE
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.4001 = {
	type = character_event
	title = stress_trait_coping_decisions.4001.t
	desc = stress_trait_coping_decisions.4001.desc
	theme = mental_break
	override_background = {
		reference = market
	}
	left_portrait = {
		character = root
		animation = steward
	}

	option = {
		name = stress_trait_coping_decisions.4001.a
		trait = profligate
		remove_short_term_gold = medium_gold_value
		add_stress = medium_stress_loss
	}
}


###############
#	IMPROVIDENT
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.4501 = {
	type = character_event
	title = stress_trait_coping_decisions.4501.t
	desc = stress_trait_coping_decisions.4501.desc
	theme = mental_break
	override_background = {
		reference = alley_day
	}
	left_portrait = {
		character = root
		animation = personality_compassionate
	}

	option = {
		name = stress_trait_coping_decisions.4501.a
		trait = improvident
		remove_short_term_gold = medium_gold_value
		add_stress = medium_stress_loss
	}
}


###############
#	CONTRITE
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.5001 = {
	type = character_event
	title = stress_trait_coping_decisions.5001.t
	desc = {
		desc = stress_trait_coping_decisions.5001.desc_opening
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:secret
				}
				desc = stress_trait_coping_decisions.5001.desc_secret
			}
			desc = {
				first_valid = {
					triggered_desc = {
						trigger = {
							num_sinful_traits >= 1
						}
						desc = stress_trait_coping_decisions.5001.desc_sin
					}
					desc = stress_trait_coping_decisions.5001.desc
				}
			}
		}
		desc = stress_trait_coping_decisions.5001.desc_ending
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = shame
	}
	override_background = { reference = throne_room }

	immediate = {
		if = {
			limit = {
				any_secret = {
					can_be_exposed_by = root
				}
			}
			random_secret = {
				limit = {
					can_be_exposed_by = root
				}
				save_scope_as = secret
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.5001.a
		trait = contrite
		if = {
			limit = {
				exists = scope:secret
			}
			scope:secret = {
				expose_secret = root
			}
		}
		else = {
			add_character_modifier = {
				modifier = stress_disturbing_confession
				years = 2
			}
		}
		add_stress = medium_stress_loss
	}
}


#Confess someone else's secret
#by Linnéa Thimrén
stress_trait_coping_decisions.5002 = {
	type = character_event
	title = stress_trait_coping_decisions.5001.t
	desc = {
		desc = stress_trait_coping_decisions.5001.desc_opening
		desc = stress_trait_coping_decisions.5002.desc
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:secret_character
		animation = shock
	}

	trigger = {
		OR = {
			has_trait = dull
			has_trait_rank = {
				trait = intellect_bad
				rank >= 1
			}
		}
		OR = {
			any_courtier = {
				any_secret = {
					is_known_by = root
				}
			}
			any_vassal = {
				any_secret = {
					is_known_by = root
				}
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { #More likely if you're very dumb
			add = 0.75
			has_trait_rank = {
				trait = intellect_bad
				rank >= 2
			}
		}
	}

	immediate = {
		hidden_effect = {
			random_list = {
				50 = {
					trigger = {
						any_courtier = {
							any_secret = {
								is_known_by = root
							}
						}
					}
					random_courtier = {
						limit = {
							any_secret = {
								is_known_by = root
							}
						}
						save_scope_as = secret_character
					}
				}
				50 = {
					trigger = {
						any_vassal = {
							any_secret = {
								is_known_by = root
							}
						}
					}
					random_vassal = {
						limit = {
							any_secret = {
								is_known_by = root
							}
						}
						save_scope_as = secret_character
					}
				}
			}
		}
		scope:secret_character = {
			random_secret = {
				limit = {
					is_known_by = root
				}
				save_scope_as = secret
				expose_secret = root
			}
			add_opinion = {
				target = root
				modifier = hate_opinion
				opinion = -10
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.5002.a
		trait = contrite
		trait = dull
		trait = intellect_bad_1
		trait = intellect_bad_2
		trait = intellect_bad_3

		add_stress = medium_stress_loss
	}
}

###############
#	COMFORT EATER
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.5501 = {
	type = character_event
	title = stress_trait_coping_decisions.5501.t
	desc = stress_trait_coping_decisions.5501.desc
	theme = mental_break
	override_background = {
		trigger = { is_landless_adventurer = no }
		reference = feast
	}
	override_background = {
		trigger = { has_government = landless_adventurer_government }
		reference = bp1_bonfire
	}
	left_portrait = {
		character = root
		animation = toast
	}
	immediate = {
		set_favorite_treat_effect = yes

		#weight change
		if = {
			limit = {
				has_variable = character_weight_variable
			}
			change_variable = {
				name = character_weight_variable
				add = 4
			}
		}
	}
	option = {
		name = stress_trait_coping_decisions.5501.a
		trait = comfort_eater
		remove_short_term_gold = medium_gold_value
		add_stress = medium_stress_loss
	}
}

#Cannibal
#by Linnéa Thimrén
stress_trait_coping_decisions.5502 = {
	type = character_event
	title = stress_trait_coping_decisions.5502.t
	desc = {
		first_valid = {
			#We're a landless adventurer
			triggered_desc = {
				trigger = { has_government = landless_adventurer_government }
				desc = stress_trait_coping_decisions.5502.desc_landless
			}
			#We actually have a hallway and basement
			desc = stress_trait_coping_decisions.5502.desc
		}
	}
	theme = mental_break
	override_background = {
		trigger = { is_landless_adventurer = no }
		reference = feast
	}
	override_background = {
		trigger = { has_government = landless_adventurer_government }
		reference = bp1_bonfire
	}
	left_portrait = {
		character = root
		animation = personality_greedy
	}
	trigger = {
		is_cannibal_trigger = yes
	}
	immediate = {
		#weight change
		if = {
			limit = {
				has_variable = character_weight_variable
			}
			change_variable = {
				name = character_weight_variable
				add = 4
			}
		}
		else = {
			set_variable = {
				name = character_weight_variable
				value = 4
			}
		}
	}
	option = {
		name = {
			text = {
				first_valid = {
					triggered_desc = {
						trigger = { has_government = landless_adventurer_government }
						desc = stress_trait_coping_decisions.5502.a_landless
					}
					desc = stress_trait_coping_decisions.5502.a
				}
			}
		}
		trait = comfort_eater
		trait = cannibal
		remove_short_term_gold = medium_gold_value
		add_stress = medium_stress_loss
	}
}

###############
#	INAPPETETIC
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.6001 = {
	type = character_event
	title = stress_trait_coping_decisions.6001.t
	desc = stress_trait_coping_decisions.6001.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_content
	}

	immediate = {

		#weight change
		if = {
			limit = {
				has_variable = character_weight_variable
			}
			change_variable = {
				name = character_weight_variable
				add = -4
			}
		}
		else = {
			set_variable = {
				name = character_weight_variable
				value = -4
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.6001.a
		trait = inappetetic
		inappetetic_advance_starvation_effect = yes
		add_stress = medium_stress_loss
	}
}


###############
#	JOURNALLER
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.6501 = {
	type = character_event
	title = stress_trait_coping_decisions.6501.t
	desc = stress_trait_coping_decisions.6501.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_rational
	}

	option = {
		name = stress_trait_coping_decisions.6501.a
		trait = journaller
		add_character_modifier = {
			modifier = stress_busy_writing
			years = 1
		}
		add_stress = medium_stress_loss
	}
}


###############
#	CONFIDER
###############

#Basic event - I have confidant-friend
#by Linnéa Thimrén
stress_trait_coping_decisions.7001 = {
	type = character_event
	title = stress_trait_coping_decisions.7001.t
	desc = {
		desc = stress_trait_coping_decisions.7001.desc
		desc = stress_trait_coping_decisions.7001.desc_ending
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_compassionate
	}

	trigger = {
		any_relation = {
			type = friend
			has_relation_flag = {
				target = root
				relation = friend
				flag = has_been_confided_in
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.7001.a
		trait = confider
		every_courtier = {
			limit = {
				NOT = {
					any_relation = {
						type = friend
						has_relation_flag = {
							target = root
							relation = friend
							flag = has_been_confided_in
						}
					}
				}
			}
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = -10
			}
		}
		random_relation = {
			type = friend
			limit = {
				has_relation_flag = {
					target = root
					relation = friend
					flag = has_been_confided_in
				}
			}
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = 5
			}
		}
		add_stress = medium_stress_loss
	}
}

#Basic event - I DON'T have confidant-friend
#by Linnéa Thimrén
stress_trait_coping_decisions.7002 = {
	type = character_event
	title = stress_trait_coping_decisions.7001.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:confidant
				}
				desc = stress_trait_coping_decisions.7001.desc
			}
			desc = stress_trait_coping_decisions.7002.desc
		}
		desc = stress_trait_coping_decisions.7001.desc_ending
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_compassionate
	}
	right_portrait = scope:confidant

	trigger = {
		any_courtier = {
			is_adult = yes
			NOR = {
				has_relation_rival = root
				has_relation_potential_rival = root
			}
		}
		NOT = {
			any_relation = {
				type = friend
				has_relation_flag = {
					target = root
					relation = friend
					flag = has_been_confided_in
				}
			}
		}
	}

	immediate = {
		if = {
			limit = {
				any_courtier = {
					is_adult = yes
					NOR = {
						has_relation_rival = root
						has_relation_potential_rival = root
					}
				}
			}
			random_courtier = {
				limit = {
					is_adult = yes
					has_relation_friend = root
				}
				alternative_limit = {
					is_adult = yes
					has_relation_potential_friend = root
				}
				alternative_limit = {
					is_adult = yes
					NOR = {
						has_relation_rival = root
						has_relation_potential_rival = root
					}
				}
				weight = {
					base = 1
					opinion_modifier = {
						opinion_target = root
						multiplier = 2
					}
				}
				save_scope_as = confidant
			}
		}
	}

	option = {
		name = stress_trait_coping_decisions.7001.a
		trait = confider
		if = {
			limit = { has_relation_friend = scope:confidant }
			scope:confidant = {
				if = {
					limit = { has_relation_best_friend = root }
					add_relation_flag = {
						target = root
						relation = best_friend
						flag = has_been_confided_in
					}
				}
				else = {
					add_relation_flag = {
						target = root
						relation = friend
						flag = has_been_confided_in
					}
				}
			}
		}
		else = {
			scope:confidant = {
				set_relation_friend = {
					reason = friend_confide
					target = root
				}
				add_relation_flag = {
					target = root
					relation = friend
					flag = has_been_confided_in
				}
			}
		}
		every_courtier = {
			custom = all_courtiers_except_confidant
			limit = {
				NOT = {
					any_relation = {
						type = friend
						has_relation_flag = {
							target = root
							relation = friend
							flag = has_been_confided_in
						}
					}
				}
				this != scope:confidant
			}
			add_opinion = {
				target = root
				modifier = friendliness_opinion
				opinion = -10
			}
		}
		add_stress = medium_stress_loss
	}
}


###############
#	ATHLETIC
###############

#Basic event
#by Linnéa Thimrén
stress_trait_coping_decisions.7501 = {
	type = character_event
	title = stress_trait_coping_decisions.7501.t
	desc = stress_trait_coping_decisions.7501.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = personality_bold
	}

	option = {
		name = stress_trait_coping_decisions.7501.a
		trait = athletic
		add_character_modifier = {
			modifier = stress_smelling_of_sweat
			years = 1
		}
		add_stress = medium_stress_loss
	}
}

#Heavier is more
#by Bianca Savazzi
scripted_trigger stress_7502_artifact_requirement_trigger = {
	OR = {
		artifact_type = cabinet
		artifact_type = chest
		artifact_type = throne
		artifact_type = sculpture
	}	
}

scripted_effect stress_7502_artifact_outcome_effect = {
	scope:random_artifact = {
		random_list = {
			50 = {
				add_durability = {
					value = artifact_durability
					multiply = -0.10
				}
			}
			30 = {
				add_durability = {
					value = artifact_durability
					multiply = -0.25
				}
			}
			15 = {
				# Remove 50% of remaining durability
				add_durability = {
					value = artifact_durability
					multiply = -0.50
				}
			}
			5 = {
				# Remove 75% of remaining durability
				add_durability = {
					value = artifact_durability
					multiply = -0.75
				}
			}
		}
	}
	add_character_modifier = {
		modifier = good_exercise_modifier
		years = 1
	}
	add_stress = major_stress_loss	
}

scripted_effect stress_7502_generic_outcome_effect = {
	add_character_modifier = {
		modifier = good_exercise_modifier
		years = 1
	}
	add_stress = major_stress_loss
}

stress_trait_coping_decisions.7502 = {
	type = character_event
	title = stress_trait_coping_decisions.7502.t
	desc = stress_trait_coping_decisions.7502.desc
	theme = mental_break
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = personality_bold
	}
	lower_left_portrait = {
		character = scope:lifted_child
		trigger = { exists = scope:lifted_child }
	}
	artifact = { # To display the artifact in the event-window
		target = scope:random_artifact
		position = lower_center_portrait
		trigger = { exists = scope:random_artifact }
	}

	trigger = {
		is_physically_able_adult = yes
	}

	immediate = {
		#For loc
		set_signature_weapon_effect = yes 

		#Fetch artifact for Opt A
		if = {
			limit = {
				any_character_artifact = { stress_7502_artifact_requirement_trigger = yes }
			}
			random_character_artifact = {
				limit = { stress_7502_artifact_requirement_trigger = yes }
				save_scope_as = random_artifact
			}
		}

		#Fetch child for Opt C
		if = {
			limit = {
				any_child = {
					is_physically_able = yes
					is_adult = no
				}
			}
			random_child = {
				limit = { 
					is_physically_able = yes
					is_adult = no
				}
				save_scope_as = lifted_child
			}
		}
	}

	#Use random court artifact
	option = {
		trigger = { exists = scope:random_artifact }
		name = stress_trait_coping_decisions.7502.a

		#Shown as tooltip here so that it's displayed both in the tooltip but also the toast
		show_as_tooltip = { stress_7502_artifact_outcome_effect = yes }

		random_list = {
			50 = {
				modifier = {
					add = root.prowess
				}
				custom_tooltip = stress_trait_coping_decisions.7502.success
				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.success
						left_icon = scope:random_artifact
						stress_7502_artifact_outcome_effect = yes
					}
				}
			}
			40 = {
				custom_tooltip = stress_trait_coping_decisions.7502.failure
				show_as_tooltip = { increase_wounds_effect = { REASON = fall } }

				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.failure
						left_icon = scope:random_artifact
						stress_7502_artifact_outcome_effect = yes
						increase_wounds_effect = { REASON = fall } 
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 2 #Sure got spirit
				ai_boldness = 0.5
				ai_rationality = -0.5 #These things are not meant for exercise...
			}
		}
	}

	#Pay for heavier training weapons
	option = {
		name = stress_trait_coping_decisions.7502.b
		trigger = { is_landless_adventurer = no }
		remove_short_term_gold = miniscule_gold_value
		stress_7502_generic_outcome_effect = yes
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -2 #what it says on the tin
				ai_rationality = 2 #The best and safest option
			}
			modifier = {
				short_term_gold < major_gold_value #shouldn't spend money they don't have...
				factor = 0
			}
		}	
	}

	#Lift child
	option = {
		trigger = {
			exists = scope:lifted_child 
		}
		name = stress_trait_coping_decisions.7502.c
		#Shown as tooltip here so that it's displayed both in the tooltip but also the toast
		show_as_tooltip = {	stress_7502_generic_outcome_effect = yes }

		random_list = {
			45 = { #nothing happens
				modifier = {
					add = root.prowess
				}
				custom_tooltip = stress_trait_coping_decisions.7502.success
				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.success
						left_icon = scope:lifted_child
						stress_7502_generic_outcome_effect = yes
					}
				}
			}
			20 = { #you get hurt
				show_as_tooltip = { increase_wounds_effect = { REASON = fall } }
				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.failure
						left_icon = scope:lifted_child
						stress_7502_generic_outcome_effect = yes
						increase_wounds_effect = { REASON = fall } 
					}
				}
			}
			20 = { #child gets hurt
				show_as_tooltip = { scope:lifted_child = { increase_wounds_effect = { REASON = fall } } }
				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.failure
						left_icon = scope:lifted_child
						stress_7502_generic_outcome_effect = yes
						scope:lifted_child = { increase_wounds_effect = { REASON = fall } }
					}
				}
			}
			5 = { #Critical failure
				show_as_tooltip = { increase_wounds_effect = { REASON = fall } scope:lifted_child = { increase_wounds_effect = { REASON = fall } } }
				hidden_effect = {
					send_interface_toast = {
						title = stress_trait_coping_decisions.7502.failure
						left_icon = scope:lifted_child
						stress_7502_generic_outcome_effect = yes
						increase_wounds_effect = { REASON = fall }
						scope:lifted_child = { increase_wounds_effect = { REASON = fall } }
					}
				}
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5 #wants to spend time with child
				ai_sociability = 0.5
				ai_rationality = -0.5 #Don't mind risking their child's wellbeing
			}
		}	
	}

	#Do nothing for now
	option = {
		name = stress_trait_coping_decisions.7502.d

		#default outcome
		add_character_modifier = {
			modifier = stress_smelling_of_sweat
			years = 1
		}
		add_stress = medium_stress_loss

		ai_chance = {
			base = 100
		}
	}
}

#Gym bro be sizing up the competition
#by Bianca Savazzi
scripted_effect stress_7503_friendship_or_rivalry_outcome_effect = {
	if = {
		limit = {
			scope:random_knight = {
				OR = {
					has_trait = vengeful
					has_trait = ambitious
				}
			}
		}
		progress_towards_rival_effect = { 
			REASON = rival_gym_bro
			CHARACTER = scope:random_knight 
			OPINION = default_rival_opinion 
		}
	}
	else = {
		progress_towards_friend_effect = { CHARACTER = scope:random_knight REASON = friend_gym_bro OPINION = default_friend_opinion }
	}
}

stress_trait_coping_decisions.7503 = {
	type = character_event
	title = stress_trait_coping_decisions.7503.t
	desc = stress_trait_coping_decisions.7503.desc
	theme = mental_break
	cooldown = { years = 5 }

	left_portrait = { 
		character = scope:random_knight 
		animation = personality_bold
	}

	trigger = {
		is_physically_able_adult = yes
		any_knight = {
			is_physically_able_ai_adult = yes
		}
	}

	immediate = {
		random_knight = {
			limit = {
				is_physically_able_ai_adult = yes
			}
			save_scope_as = random_knight
		}

		add_character_modifier = {
			modifier = stress_smelling_of_sweat
			years = 1
		}
		add_stress = medium_stress_loss
	}

	#wrestle!
	option = { 
		name = stress_trait_coping_decisions.7503.a
		custom_tooltip = stress_trait_coping_decisions.7503.a.tt
		hidden_effect = {
			duel = {
				skill = prowess
				target = scope:random_knight
				50 = { #You win
					compare_modifier = {
						value = scope:duel_value
						multiplier = medium_positive_duel_skill_multiplier #+50 when extremely skilled meets avarage
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.success
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
				50 = { #You lose
					compare_modifier = {
						value = scope:duel_value
						multiplier = medium_negative_duel_skill_multiplier #-50 when extremely skilled meets avarage
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.failure
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
			}
		}
		stress_7503_friendship_or_rivalry_outcome_effect = yes
	}

	#duel!
	option = {
		name = stress_trait_coping_decisions.7503.b
		custom_tooltip = stress_trait_coping_decisions.7503.b.tt
		hidden_effect = {
			random_list = {
				1 = {
					modifier = {
						add = root.prowess
					}
					modifier = {
						add = root.martial
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.success
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
				1 = { #they win
					modifier = {
						add = scope:random_knight.prowess
					}
					modifier = {
						add = scope:random_knight.martial
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.failure
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
			}
		}
		stress_7503_friendship_or_rivalry_outcome_effect = yes
	}

	#running!
	option = {
		name = stress_trait_coping_decisions.7503.c
		custom_tooltip = stress_trait_coping_decisions.7503.c.tt

		hidden_effect = {
			random_list = {
				1 = {
					modifier = {
						add = root.prowess
					}
					modifier = {
						add = root.health
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.success
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
				1 = { #they win
					modifier = {
						add = scope:random_knight.prowess
					}
					modifier = {
						add = scope:random_knight.health
					}
					send_interface_toast = {
						title = stress_trait_coping_decisions.7503.failure
						left_icon = scope:random_knight
						show_as_tooltip = { stress_7503_friendship_or_rivalry_outcome_effect = yes }
					}
				}
			}
		}
		stress_7503_friendship_or_rivalry_outcome_effect = yes
	}

	#Back out
	option = {
		name = stress_trait_coping_decisions.7503.d
	}
}

#Athletics person wants to exercise with someone
#by Bianca Savazzi

scripted_trigger stress_7504_ideal_character_trigger = {
	is_physically_able_ai_adult = yes
	prowess_diff = {
		target = root
		value >= 5
	}
}

scripted_trigger stress_7504_similar_character_trigger = {
	is_physically_able_ai_adult = yes
	trigger_if = {
		limit = { exists = scope:ideal_character }
		NOR = {
			this = scope:ideal_character
			prowess > scope:ideal_character.prowess
		}
	}
   
	NOR = {
		prowess_diff = {
			target = root
			value <= -5
		}
		prowess_diff = {
			target = root
			value >= 5
		}
	}
	OR = { 
		prowess_diff = {
			target = root
			value <= -1
		}
		prowess_diff = {
			target = root
			value >= 1
		}
	}
}

scripted_trigger stress_7504_not_ideal_character_trigger = {
	is_physically_able_ai_adult = yes
	trigger_if = {
		limit = { exists = scope:similar_character }
		NOR = {
			this = scope:similar_character
			prowess > scope:similar_character.prowess
		}
	}
   prowess_diff = {
		target = root
		value <= -5
	}
}

scripted_effect stress_7504_opinion_with_character_effect = {
	if = {
		limit = {
			$CHARACTER$ = {
				OR = {
					has_trait = vengeful
					has_trait = ambitious
				}
			}
		}
		root = { progress_towards_rival_effect = { CHARACTER = $CHARACTER$ OPINION = default_rival_opinion REASON = rival_coping_motivation } }
	}
	else = {
		root = { progress_towards_friend_effect = { CHARACTER = $CHARACTER$ REASON = friend_coping_motivation OPINION = default_friend_opinion } }
	}
}

stress_trait_coping_decisions.7504 = {
	type = character_event
	title = stress_trait_coping_decisions.7503.t
	desc = stress_trait_coping_decisions.7504.desc
	theme = mental_break
	cooldown = { years = 5 }
	left_portrait = {
		character = root
		animation = personality_bold
	}
	lower_left_portrait = {
		character = scope:ideal_character
		trigger = { exists = scope:ideal_character }
	}
	lower_center_portrait = {
		character = scope:similar_character
		trigger = { exists = scope:similar_character }
	}
	lower_right_portrait = {
		character = scope:not_ideal_character
		trigger = { exists = scope:not_ideal_character }
	}

	trigger = {
		is_physically_able_adult = yes
		any_knight = {
			OR = {
				stress_7504_ideal_character_trigger = yes
				stress_7504_similar_character_trigger = yes
				stress_7504_not_ideal_character_trigger = yes
			}
		}
	}

	immediate = {
		#Fetch character for Opt A
		if = {
			limit = {
				any_knight = {
					stress_7504_ideal_character_trigger = yes
				}
			}
			random_knight = {
				limit = { 
					stress_7504_ideal_character_trigger = yes
				}
				save_scope_as = ideal_character
			}
		}

		#Fetch character for Opt B
		if = {
			limit = {
				any_knight = {
					stress_7504_similar_character_trigger = yes
				}
			}
			random_knight = {  			
				limit = { 
					stress_7504_similar_character_trigger = yes
				}
				save_scope_as = similar_character
			}
		}

		#Fetch character for Opt C
		if = {
			limit = {
				any_knight = {
					stress_7504_not_ideal_character_trigger = yes
				}
			}
			random_knight = {
				limit = { 
					stress_7504_not_ideal_character_trigger = yes
				}
				save_scope_as = not_ideal_character
			}
		}

		add_character_modifier = {
			modifier = stress_smelling_of_sweat
			years = 1
		}
		add_stress = medium_stress_loss
	}

	#someone stronger
	option = {
		name = stress_trait_coping_decisions.7504.a
		trigger = { exists = scope:ideal_character }
		stress_7504_opinion_with_character_effect = { CHARACTER = scope:ideal_character }

		scope:ideal_character = {
			random = {
				chance = 50
				add_trait = athletic
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 2 
			}
		}
	}

	#someone similar to you
	option = {
		name = stress_trait_coping_decisions.7504.b
		trigger = { exists = scope:similar_character }
		stress_7504_opinion_with_character_effect = { CHARACTER = scope:similar_character }

		scope:similar_character = {
			random = {
				chance = 50
				add_trait = athletic
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 2
			}
		}
	}

	#someone weaker
	option = {
		name = stress_trait_coping_decisions.7504.c
		trigger = { exists = scope:not_ideal_character }
		stress_7504_opinion_with_character_effect = { CHARACTER = scope:not_ideal_character }
		
		scope:not_ideal_character = {
			random = {
				chance = 50
				add_trait = athletic
			}
		}

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -2 
				ai_sociability = -2
			}
		}	
	}

	#Back out
	option = {
		name = stress_trait_coping_decisions.7504.d

		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -0.5 
				ai_sociability = -2
			}
		}	
	}
}
