﻿# EK NOTE: Added creation effects
namespace = bp1_yearly

# Your sibling tries opportunistically murdering you
bp1_yearly.5001 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5001.t
	desc = bp1_yearly.5001.desc
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = rage
	}

	trigger = {

		#DLC check
		has_bp1_dlc_trigger = yes

		#Standard check
		is_available = yes

		#You are in your capital
		exists = location
		exists = root.capital_province
		location = root.capital_province

		# Thematically
		is_landed_or_landless_administrative = yes

		#Your sibling is a child, is in your court, is AI and dislikes you OR is ambitious
		any_sibling = {
			is_ai = yes
			is_sibling_of = root
			age <= 18
			age > 12
			exists = location
			location = root.capital_province
			OR = {
				opinion = {
					target = root
					value < neutral_opinion
				}
				has_trait = ambitious
				has_trait = callous
				has_trait = sadistic
			}
		}

		#You have a parent and they're in the capital province
		any_parent = {
			location = root.capital_province
		}

		#There is another person who can be involved in your capital
		any_courtier = {
			location = root.capital_province
			is_available_ai_adult = yes
			NOT = {
				is_sibling_of = root
			}
		}

		#You are not a fully-grown adult, but also not a small child
		age <= 18
		age > 12
	}

	immediate = {
		random_sibling = {
			limit = {
				is_ai = yes
				is_sibling_of = root
				age <= 18
				age > 12
				location = root.capital_province
				OR = {
					opinion = {
						target = root
						value <= neutral_opinion
					}
					has_trait = ambitious
					has_trait = callous
					has_trait = sadistic
				}
			}
			weight = {
				base = 1
				modifier = {
					has_trait = sadistic
					add = 4
				}
				modifier = {
					has_trait = callous
					add = 3
				}
				modifier = {
					has_trait = ambitious
					add = 3
				}
				modifier = {
					has_trait = impatient
					add = 1
				}
			}
			save_scope_as = sibling_murderer
		}
		random_parent = {
			limit = {
				location = root.capital_province
			}
			save_scope_as = sibling_parent
		}
		random_courtier = {
			limit = {
				location = root.capital_province
				is_available_ai_adult = yes
				NOT = {
					is_sibling_of = root
				}
			}
			save_scope_as = guard
		}
		add_character_flag = is_naked
	}

	option = { # Fight back, with murderous intent
		name = bp1_yearly.5001.a

		trigger = {
			OR = {
				has_trait = vengeful
				has_trait = wrathful
			}
		}

		trait = vengeful
		trait = wrathful

		duel = {
			skill = prowess
			target = scope:sibling_murderer
			#You win
			60 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				custom_tooltip = bp1_yearly.5001.kill.tt

				hidden_effect = {
					scope:sibling_murderer = {
						increase_wounds_no_death_effect = { REASON = fight }
					}
				}

				trigger_event = bp1_yearly.5008
			}
			#You lose, triggering the death scene
			40 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				trigger_event = bp1_yearly.5003

				custom_tooltip = bp1_yearly.5001.die.tt
			}
		}

		stress_impact = {
			wrathful = minor_stress_impact_loss
			craven = major_stress_impact_gain
			forgiving = major_stress_impact_gain
			calm = major_stress_impact_gain
			sadistic = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
				has_trait = forgiving
				has_trait = calm
			}
		}
	}

	option = { # Fight back
		name = bp1_yearly.5001.b

		trigger = {
			NOR = {
				has_trait = vengeful
				has_trait = wrathful
			}
		}

		add_internal_flag = dangerous

		duel = {
			skill = prowess
			target = scope:sibling_murderer
			#You win
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}

				custom_tooltip = bp1_yearly.5001.win.tt

				trigger_event = bp1_yearly.5002
			}
			#You lose, triggering the death scene
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}

				trigger_event = bp1_yearly.5003

				custom_tooltip = bp1_yearly.5001.lose.tt
			}
		}

		stress_impact = {
			base = minor_stress_impact_gain
			craven = major_stress_impact_gain
			calm = major_stress_impact_gain
			forgiving = major_stress_impact_gain
			brave = miniscule_stress_impact_loss
			ambitious = miniscule_stress_impact_loss
			wrathful = massive_stress_impact_gain
			vengeful = massive_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = craven
				has_trait = forgiving
				has_trait = calm
			}
		}
	}

	option = { # Help!
		name = bp1_yearly.5001.c

		hidden_effect = {
			random_list = {
				1 = { #Guard saves you. Default option.
					trigger_event = bp1_yearly.5004
				}
				2 = { #Guard lets you die
					trigger = {
						scope:guard = {
							is_available_ai_adult = yes
							opinion = {
								target = scope:sibling_murderer
								value >= low_positive_opinion
							}
						}
					}
					trigger_event = bp1_yearly.5005
				}
				3 = { #Parent saves you. More likely than guard saving you.
					trigger_event = bp1_yearly.5006
				}
				5 = { #Parent lets you die. Unlikely for parent to hate you that much, but if they do...
					trigger = {
						scope:sibling_parent = {
							opinion = {
								target = root
								value <= medium_negative_opinion
							}
							opinion = {
								target = scope:sibling_murderer
								value >= medium_positive_opinion
							}
						}
					}
					trigger_event = bp1_yearly.5007
				}
			}
		}

		custom_tooltip = bp1_yearly.5001.shout.tt

		stress_impact = {
			base = minor_stress_impact_gain
			wrathful = major_stress_impact_gain
			brave = major_stress_impact_gain
			vengeful = major_stress_impact_gain
			ambitious = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = brave
				has_trait = wrathful
				has_trait = vengeful
			}
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

# You win the fight
bp1_yearly.5002 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5002.t
	desc = bp1_yearly.5002.desc
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = loss_1
	}
	lower_center_portrait = {
		character = scope:guard
		animation = shock
	}

	immediate = {
		scope:sibling_murderer = {
			increase_wounds_no_death_effect = { REASON = fight }
		}
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5002.a

		scope:sibling_murderer = {
			set_relation_rival = {
				target = root
				reason = rival_tried_to_kill_me
			}
		}

		scope:sibling_murderer = {
			every_parent = {
				add_opinion = {
					target = scope:sibling_murderer
					modifier = hate_opinion
					opinion = -90
				}
			}
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

# You lose the fight
bp1_yearly.5003 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5003.t
	desc = bp1_yearly.5003.desc
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = poison
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = rage
	}

	immediate = {
		increase_wounds_no_death_effect = { REASON = fight }
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5003.a

		death = {
			death_reason = death_mysterious
		}
	}
}

# You are saved by a guard
bp1_yearly.5004 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5004.t
	desc = {
		desc = bp1_yearly.5004.desc
		desc = bp1_yearly.5004.guard.save
	}
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = paranoia
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = throne_room_bow_1
	}
	lower_center_portrait = {
		character = scope:guard
		animation = shock
	}

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5002.a

		scope:sibling_murderer = {
			set_relation_rival = {
				target = root
				reason = rival_tried_to_kill_me
			}
		}

		add_opinion = {
	 		target = scope:guard
	 		modifier = grateful_opinion
	 		opinion = 40
		}

		scope:guard = {
			add_opinion = {
		 		target = scope:sibling_murderer
		 		modifier = suspicion_opinion
		 		opinion = -40
		 	}
		}

		scope:sibling_murderer = {
			every_parent = {
				add_opinion = {
					target = scope:sibling_murderer
					modifier = hate_opinion
					opinion = -90
				}
			}
			every_sibling = {
				add_opinion = {
					target = scope:sibling_murderer
					modifier = scared_opinion
					opinion = -70
				}
			}
		}

		stress_impact = {
			base = minor_stress_impact_gain
			craven = minor_stress_impact_gain
			brave = minor_stress_impact_loss
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

# The guard lets you die
bp1_yearly.5005 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5005.t
	desc = {
		desc = bp1_yearly.5004.desc
		desc = bp1_yearly.5004.guard.death
	}
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = poison
	}

	right_portrait = {
		character = scope:sibling_murderer
		animation = rage
	}

	lower_center_portrait = {
		character = scope:guard
		animation = shock
	}

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5003.a

		scope:guard = {
			add_hook = {
				type = manipulation_hook
				target = scope:sibling_murderer
			}
		}

		scope:sibling_murderer = {
			add_opinion = {
		 		target = scope:guard
		 		modifier = grateful_opinion
		 		opinion = 50
		 	}
			add_trait = kinslayer_3
		}

		add_internal_flag = dangerous

		root = {
			death = {
				death_reason = death_mysterious
			}
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

# You are saved by a parent
bp1_yearly.5006 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5006.t
	desc = {
		desc = bp1_yearly.5004.desc
		desc = bp1_yearly.5004.parent.save
	}
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = paranoia
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = throne_room_bow_1
	}
	lower_left_portrait = {
		character = scope:sibling_parent
	}
	lower_right_portrait = {
		character = scope:guard
	}

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5006.a

		scope:sibling_murderer = {
			set_relation_rival = {
				target = root
				reason = rival_tried_to_kill_me
			}
		}

		scope:guard = {
			add_opinion = {
		 		target = scope:sibling_murderer
		 		modifier = suspicion_opinion
		 		opinion = -40
		 	}
		}

		root = {
			add_opinion = {
		 		target = scope:sibling_parent
		 		modifier = grateful_opinion
		 		opinion = 40
		 	}
		}

		scope:sibling_murderer = {
			every_parent = {
				add_opinion = {
					target = scope:sibling_murderer
					modifier = hate_opinion
					opinion = -90
				}
			}
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

# You are left to die by a parent
bp1_yearly.5007 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5007.t
	desc = {
		desc = bp1_yearly.5004.desc
		desc = bp1_yearly.5004.parent.death
	}
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = poison
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = personality_vengeful
	}
	lower_center_portrait = {
		character = scope:sibling_parent
		animation = shock
	}

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5007.a

		scope:sibling_parent = {
			add_hook = {
				type = manipulation_hook
				target = scope:sibling_murderer
			}
			add_trait = kinslayer_3
		}

		add_internal_flag = dangerous
	}

	after = {
		root = {
			death = {
				death_reason = death_mysterious
			}
		}
	}
}


# You, a vengeful or wrathful person, now have the option to kill your rival for the throne
bp1_yearly.5008 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5008.t
	desc = bp1_yearly.5008.desc
	theme = murder_scheme
	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = root
		animation = spymaster
	}
	right_portrait = {
		character = scope:sibling_murderer
		animation = shock
	}

	immediate = {
		add_character_flag = is_naked
	}

	option = {
		name = bp1_yearly.5008.a

		add_trait = kinslayer_3

		scope:sibling_murderer = {
			death = {
				death_reason = death_mysterious
			}
		}
	}

	option = {
		name = bp1_yearly.5008.b

		root = {
			add_hook = {
				type = life_threat_hook
				target = scope:sibling_murderer
			}
		}
	}
	after = {
		remove_character_flag = is_naked
	}
}

###############################################
# Chadsplaining to a plain courtier
# by Nick Meredith
# An anecdotal story, obviously
# bp1_yearly.5100
###############################################

bp1_yearly.5100 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5100.t
	theme = friendly
	left_portrait = {
		character = root
		animation = personality_honorable
	}
	right_portrait = {
		character = scope:unloved_courtier
		animation = sadness
	}
	override_background = {
		reference = relaxing_room
	}
	cooldown = { years = 10 }
	desc = {
		desc = bp1_yearly.5100.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					has_trait = scarred
				}
				desc = bp1_yearly.5100.desc.scarred
			}
			triggered_desc = {
				trigger = {
					root = {
						OR = {
							has_trait = physique_good
							has_trait = strong
						}
					}
				}
				desc = bp1_yearly.5100.desc.swole
			}
			triggered_desc = {
				trigger = { root = { is_female = yes  } }
				desc = bp1_yearly.5100.desc.female
			}
			triggered_desc = {
				trigger = { root = { is_male = yes } }
				desc = bp1_yearly.5100.desc.male
			}
			triggered_desc = {
				desc = bp1_yearly.5100.desc.fallback
			}
		}
		desc = bp1_yearly.5100.desc.end
	}

	trigger = {

		# DLC check.
		has_bp1_dlc_trigger = yes

		# Standard checks.
		is_available_at_peace_adult = yes

		# You are pretty or swole
		OR = {
			has_trait = beauty_good
			has_trait = physique_good
			has_trait = strong
		}

		# Safeguard trigger to keep out the uggos
		NOT = {
			has_trait = beauty_bad
		}

		# You have an available courtier who isn't married, isn't a child, isn't ace AND is butters compared to you
		# Translation: 'butters' means 'ugly'
		any_courtier_or_guest = {
			is_available_healthy_ai_adult = yes
			age >= 18
			NOT = {
				has_trait = beauty_good
			}
			is_married = no
			can_marry_trigger = yes
			NOR = {
				has_sexuality = asexual
				has_trait = celibate
				any_relation = {
					type = lover
					count = 0
				}
			}
		}
	}

	immediate = {
		random_courtier_or_guest = {
			limit = {
				is_available_healthy_ai_adult = yes
				NOT = {
					has_trait = beauty_good
				}
				is_married = no
				can_marry_trigger = yes
				NOT = {
					has_sexuality = asexual
					has_trait = celibate
				}
				any_relation = {
					type = lover
					count = 0
				}
			}
			save_scope_as = unloved_courtier
		}
	}

	# Compassionate but unable to relate

	option = {
		name = bp1_yearly.5100.a

		trigger = {
			has_trait = compassionate
		}

		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			content = miniscule_stress_impact_loss
			arrogant = minor_stress_impact_gain
			cynical = minor_stress_impact_gain
		}

		send_interface_toast = {
			title = bp1_yearly.5100.toast
			left_icon = root
			right_icon = scope:unloved_courtier
			scope:unloved_courtier = {
				add_opinion = {
					target = root
					modifier = hurt_opinion
					opinion = -20
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = arrogant
					has_trait = cynical
				}
			}
		}
	}

	# Arrogant and unable to relate

	option = {
		name = bp1_yearly.5100.b

		trigger = {
			OR = {
				has_trait = arrogant
				has_trait = arbitrary
				has_trait = sadistic
				has_trait = callous
			}
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			compassionate = minor_stress_impact_gain
			content = minor_stress_impact_gain
			gregarious = minor_stress_impact_gain
		}

		scope:unloved_courtier = {
			add_opinion = {
				target = root
				modifier = hurt_opinion
				opinion = -40
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = content
					has_trait = gregarious
					has_trait = humble
				}
			}
		}
	}

	# Play matchmaker

	option = {
		name = bp1_yearly.5100.c

		stress_impact = {
			callous = medium_stress_impact_gain
			shy = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			content = minor_stress_impact_gain
			deceitful = minor_stress_impact_gain
		}

		trigger_event = {
			id = bp1_yearly.5101
			days = { 1 2 }
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = shy
					has_trait = lazy
				}
			}
		}
	}

	# Comfort them

	option = {
		name = bp1_yearly.5100.d

		trigger = {
			NOT = {
				has_trait = compassionate
			}
		}

		stress_impact = {
			callous = medium_stress_impact_gain
			lazy = miniscule_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = callous
			}
		}
	}
}


#Finding a potential partner

bp1_yearly.5101 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5101.t
	desc = bp1_yearly.5101.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = personality_rational
	}
	right_portrait = {
		character = scope:unloved_courtier
		animation = admiration
	}

	# They should be...
	# Compassionate

	option = {
		name = bp1_yearly.5101.a

		add_character_flag = courtier_compassionate_flag

		stress_impact = {
			compassionate = miniscule_stress_impact_loss
			callous = minor_stress_impact_gain
			sadistic = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# Fair-minded

	option = {
		name = bp1_yearly.5101.b

		add_character_flag = courtier_just_flag

		stress_impact = {
			just = miniscule_stress_impact_loss
			arbitrary = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# A person of God

	option = {
		name = bp1_yearly.5101.c

		add_character_flag = courtier_zealous_flag

		stress_impact = {
			zealous = miniscule_stress_impact_loss
			cynical = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# ...super hot.

	option = {
		name = bp1_yearly.5101.d

		trigger = {
			has_trait = lustful
		}

		add_character_flag = courtier_peng_flag

		stress_impact = {
			lustful = medium_stress_impact_loss
		}

		ai_chance = {
			base = 100
		}
	}
	after = {
		trigger_event = {
			id = bp1_yearly.5102
			days = { 1 2 }
		}
	}
}


# Introduce the two of them

bp1_yearly.5102 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5102.t
	theme = friendly
	override_background = {
		reference = council_chamber
	}
	left_portrait = {
		character = root
		animation = scheme
	}
	right_portrait = {
		character = scope:unloved_courtier
		animation = ecstasy
	}
	lower_center_portrait = {
		character = scope:potential_lover
	}

	desc = {
		desc = bp1_yearly.5102.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = courtier_compassionate_flag
				}
				desc = bp1_yearly.5102.desc.compassionate
			}
			triggered_desc = {
				trigger = {
					has_character_flag = courtier_just_flag
				}
				desc = bp1_yearly.5102.desc.just
			}
			triggered_desc = {
				trigger = {
					has_character_flag = courtier_zealous_flag
				}
				desc = bp1_yearly.5102.desc.zealous
			}
			triggered_desc = {
				trigger = {
					has_character_flag = courtier_peng_flag
				}
				desc = bp1_yearly.5102.desc.peng
			}
		}
		desc = bp1_yearly.5102.desc.end
	}

	immediate = {
		#courtier is a man
		if = {
			limit = {
				scope:unloved_courtier = {
					is_female = no
				}
			}
			create_character = {
				gender_female_chance = 100
				random_traits_list = {
					count = 1
					honest = {}
					gregarious = {}
					trusting = {}
					generous = {}
					humble = {}
					calm = {}
					lustful = {}
					chaste = {}
					wrathful = {}
					arrogant = {}
					impatient = {}
					patient = {}
					ambitious = {}
					stubborn = {}
				}
				faith = root.faith
				culture = scope:unloved_courtier.culture
				location = root.capital_province
				age = scope:unloved_courtier.age
				save_scope_as = potential_lover
				### EK ADDITION
				after_creation = {
					ek_character_setup_effect = yes
					unmourned_blood_traits_effect = yes
				}
			}
			hidden_effect = {
				scope:potential_lover = {
					set_sexuality = bisexual
				}
			}
		}

		#courtier is a woman
		else_if = {
			limit = {
				scope:unloved_courtier = {
					is_female = yes
				}
			}
			create_character = {
				gender_female_chance = 0
				random_traits_list = {
					count = 1
					honest = {}
					gregarious = {}
					trusting = {}
					generous = {}
					humble = {}
					calm = {}
					lustful = {}
					chaste = {}
					wrathful = {}
					arrogant = {}
					impatient = {}
					patient = {}
					ambitious = {}
					stubborn = {}
				}
				faith = root.faith
				culture = scope:unloved_courtier.culture
				location = root.capital_province
				age = scope:unloved_courtier.age
				save_scope_as = potential_lover
				### EK ADDITION
				after_creation = {
					ek_character_setup_effect = yes
					unmourned_blood_traits_effect = yes
				}
			}
			hidden_effect = {
				scope:potential_lover = {
					set_sexuality = bisexual
				}
			}
		}

		#courtier exists
		else = {
			create_character = {
				gender_female_chance = 50
				random_traits_list = {
					count = 1
					honest = {}
					gregarious = {}
					trusting = {}
					generous = {}
					humble = {}
					calm = {}
					lustful = {}
					chaste = {}
					wrathful = {}
					arrogant = {}
					impatient = {}
					patient = {}
					ambitious = {}
					stubborn = {}
				}
				faith = root.faith
				culture = scope:unloved_courtier.culture
				location = root.capital_province
				age = scope:unloved_courtier.age
				save_scope_as = potential_lover
				### EK ADDITION
				after_creation = {
					ek_character_setup_effect = yes
					unmourned_blood_traits_effect = yes
				}
			}
			hidden_effect = {
				scope:potential_lover = {
					set_sexuality = bisexual
				}
			}
		}

		hidden_effect = {
			if = {
				limit = {
					root = {
						has_character_flag = courtier_peng_flag
					}
				}
				scope:potential_lover = {
					add_trait = beauty_good_2

					# Make sure they have 3 personality traits. Might as well be the fun one!
					add_trait = lustful
				}
			}
			else_if = {
				limit = {
					root = {
						has_character_flag = courtier_zealous_flag
					}
				}
				scope:potential_lover = {
					add_trait = zealous
				}
			}
			else_if = {
				limit = {
					root = {
						has_character_flag = courtier_just_flag
					}
				}
				scope:potential_lover = {
					add_trait = just
				}
			}
			else_if = {
				limit = {
					root = {
						has_character_flag = courtier_compassionate_flag
					}
				}
				scope:potential_lover = {
					add_trait = compassionate
				}
			}
		}
	}

	#You two have fun!
	option = {
		name = bp1_yearly.5102.a

		scope:unloved_courtier = {
			progress_towards_friend_effect = {
				CHARACTER = root
				OPINION = 0
				REASON = friend_found_partner
			}
		}

		add_courtier = scope:potential_lover

		random_list = {
			# they hit it off
			1 = {
				desc = bp1_yearly.5102.a.success

				send_interface_toast = {
					title = bp1_yearly.5102.a.success
					left_icon = root
					right_icon = scope:unloved_courtier
					scope:unloved_courtier = {
						set_relation_lover = {
							reason = lover_matchmade
							target = scope:potential_lover
							involved_character = root
						}
						add_opinion = {
							target = root
							modifier = grateful_opinion
							opinion = 40
						}
						add_opinion = {
							target = scope:potential_lover
							modifier = romance_opinion
							opinion = 50
						}
						random_secret = {
							limit = {
								secret_type = secret_lover
								secret_target = scope:potential_lover
							}
							save_scope_as = lover_secret
						}
					}
					scope:potential_lover = {
						show_as_tooltip = {
							set_relation_lover = {
								reason = lover_matchmade
								target = scope:unloved_courtier
								involved_character = root
							}
						}
						add_opinion = {
							target = scope:unloved_courtier
							modifier = romance_opinion
							opinion = 50
						}
					}
				}

		 		compatibility_modifier = {
					who = scope:unloved_courtier
					compatibility_target = scope:potential_lover
					multiplier = 2
					min = -30
					max = 30
				}

				create_character_memory = {
					type = match_made
							
					participants = {
						matchmaker = root
						lover = scope:potential_lover
					}
				}

				scope:unloved_courtier = {
					progress_towards_friend_effect = {
						CHARACTER = root
						OPINION = 0
						REASON = friend_found_partner
					}
				}
			}

			# they don't gel
			1 = {
				desc = bp1_yearly.5102.a.failure

				send_interface_toast = {
					title = bp1_yearly.5102.a.failure
					left_icon = root
					right_icon = scope:unloved_courtier
					scope:unloved_courtier = {
						add_opinion = {
							target = root
							modifier = grateful_opinion
							opinion = 20
						}
					}
					scope:unloved_courtier = {
						add_opinion = {
							target = scope:potential_lover
							modifier = awkward_opinion
							opinion = -10
						}
					}
					scope:potential_lover = {
						add_opinion = {
							target = scope:unloved_courtier
							modifier = awkward_opinion
							opinion = -10
						}
					}
				}
			}
		}

		stress_impact = {
			base = miniscule_stress_impact_loss
			compassionate = miniscule_stress_impact_loss
			gregarious = minor_stress_impact_loss
			callous = major_stress_impact_gain
			sadistic = major_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = callous
					has_trait = sadistic
				}
			}
		}
	}

	#On second thoughts, maybe not
	option = {
		name = bp1_yearly.5102.b

		scope:unloved_courtier = {
			add_opinion = {
				target = root
				modifier = disappointed_opinion
				opinion = -20
			}
		}

		scope:unloved_courtier = {
			progress_towards_rival_effect = {
				CHARACTER = root
				REASON = rival_unloved_courtier
				OPINION = 0
			}
		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			gregarious = major_stress_impact_gain
			shy = minor_stress_impact_loss
		}

		add_courtier = scope:potential_lover

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = compassionate
					has_trait = gregarious
				}
			}
		}
	}

	#Take them for yourself
	option = {
		name = bp1_yearly.5102.c

		trigger = {
			OR = {
				has_trait = lustful
				has_trait = rakish
				has_trait = seducer
			}
			can_set_relation_lover_trigger = { CHARACTER = scope:potential_lover }
		}

		scope:unloved_courtier = {
			add_opinion = {
				target = root
				modifier = emotionally_devastated_opinion
				opinion = -80
			}
			set_relation_rival = {
				target = root
				reason = rival_stole_potential_love_interest
			}
		}

		stress_impact = {
			compassionate = major_stress_impact_gain
			lustful = minor_stress_impact_loss
			content = minor_stress_impact_gain
		}

		add_courtier = scope:potential_lover

		set_relation_lover = { reason = lover_stole_match target = scope:potential_lover involved_character = scope:unloved_courtier }

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				has_trait = compassionate
			}
		}
	}

	after = {
		remove_character_flag = courtier_zealous_flag
		remove_character_flag = courtier_just_flag
		remove_character_flag = courtier_compassionate_flag
		remove_character_flag = courtier_peng_flag
		if = {
			limit = { exists = scope:lover_secret }
			scope:lover_secret = {
				reveal_to = root
			}
		}
	}
}


#####################################################
# Your Friend's Spouse Is Keeping Them Away From You
# by Nick Meredith
# bp1_yearly.5701
#####################################################

bp1_yearly.5701 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5701.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					NOT = {
						has_trait = temperate
					}
					drinks_alcohol_trigger = yes
				}
				desc = {
					desc = bp1_yearly.5701.desc
					desc = bp1_yearly.5701.desc.ladsladslads
					desc = bp1_yearly.5701.desc.ending
				}
			}
			desc = {
				desc = bp1_yearly.5701.desc
				desc = bp1_yearly.5701.desc.nodrinky
				desc = bp1_yearly.5701.desc.ending
			}
		}
	}
	theme = friendly
	left_portrait = {
		character = root
		animation = schadenfreude
	}
	right_portrait = {
		character = scope:married_friend
		animation = sadness
	}
	lower_center_portrait = {
		character = scope:friend_spouse
	}

	cooldown = { years = 10 }

	trigger = {

		# DLC Trigger
		has_bp1_dlc_trigger = yes

		# Standard trigger
		is_available_at_peace_adult = yes

		# You have an AI friend who is married
		any_relation = {
			type = friend
			is_married = yes
			is_ai = yes
			NOT = {
				is_spouse_of = root
			}
			any_spouse = {
				is_available_ai_adult = yes
				OR = {
					has_relation_rival = root
					reverse_opinion = {
						target = root
						value <= -50
					}
				}
			}
		}
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				is_married = yes
				is_ai = yes
				NOT = {
					is_spouse_of = root
				}
				any_spouse = {
					is_available_ai_adult = yes
					OR = {
						has_relation_rival = root
						reverse_opinion = {
							target = root
							value <= -50
						}
					}
				}
			}
			save_scope_as = married_friend

			random_spouse = {
				limit = {
					NOT = { this = root }
					is_available_ai_adult = yes
					OR = {
						has_relation_rival = root
						reverse_opinion = {
							target = root
							value <= -50
						}
					}
				}
				save_scope_as = friend_spouse
			}
		}
	}

	# They won't stop us being together!
	option = {
		name = bp1_yearly.5701.a

		trigger = {
			OR = {
				has_trait = vengeful
				has_trait = callous
				has_trait = arbitrary
				has_trait = sadistic
			}
		}

		start_scheme = {
			type = murder
			target_character = scope:friend_spouse
		}

		custom_tooltip = diplomacy_family.2250.b.tt
		hidden_effect = {
			random_scheme = {
				limit = {
					scheme_type = murder
					scheme_target_character = scope:friend_spouse
				}
				add_scheme_modifier = {
					type = extra_success_chance_modifier
				}
			}
		}

		stress_impact = {
			base = minor_stress_impact_loss
			content = medium_stress_impact_gain
			patient = major_stress_impact_gain
			trusting = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# Admonish the spouse
	option = {
		name = bp1_yearly.5701.b

		duel = {
			skill = intrigue
			value = scope:friend_spouse.intrigue
			49 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				desc = bp1_yearly.5701.tt.success
				send_interface_toast = {
					title = bp1_yearly.5701.tt.success
					left_icon = root
					right_icon = scope:married_friend

					scope:friend_spouse = {
						add_stress = major_stress_impact_gain
					}
					scope:married_friend = {
						add_opinion = {
							target = scope:friend_spouse
							modifier = annoyed_opinion
							opinion = -30
						}
					}
				}
			}
			49 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				desc = bp1_yearly.5701.tt.failure
				send_interface_toast = {
					title = bp1_yearly.5701.tt.failure
					left_icon = root
					right_icon = scope:married_friend

					scope:friend_spouse = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -30
						}
					}
					scope:married_friend = {
						add_opinion = {
							target = root
							modifier = annoyed_opinion
							opinion = -30
						}
					}
				}
			}
		}

		stress_impact = {
			calm = medium_stress_impact_gain
			patient = medium_stress_impact_gain
			stubborn = miniscule_stress_impact_loss
			impatient = miniscule_stress_impact_loss
			gregarious = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = patient
					has_trait = compassionate
					has_trait = calm
				}
			}
		}
	}

	# I'll have to grin and bear it
	option = {
		name = bp1_yearly.5701.c

		stress_impact = {
			greedy = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			callous = major_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = impatient
					has_trait = callous
					has_trait = wrathful
				}
			}
		}
	}
}

###############################################
# You ask a friend for help with skill
# by Nick Meredith
# bp1_yearly.5702
###############################################

scripted_effect skilful_friend_effect = {
	random_list = {
		10 = {
			trigger = {
				scope:skilful_friend = {
					diplomacy >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_diplomacy
		}
		10 = {
			trigger = {
				scope:skilful_friend = {
					martial >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_martial
		}
		10 = {
			trigger = {
				scope:skilful_friend = {
					stewardship >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_stewardship
		}
		10 = {
			trigger = {
				scope:skilful_friend = {
					intrigue >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_intrigue
		}
		10 = {
			trigger = {
				scope:skilful_friend = {
					learning >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_learning
		}
		10 = {
			trigger = {
				scope:skilful_friend = {
					prowess >= very_high_skill_rating
				}
			}
			add_character_flag = skilful_friend_prowess
		}
	}
}

scripted_trigger skilful_friend_trigger = {
	is_available_at_peace_adult = yes
	OR = {
		diplomacy >= very_high_skill_rating
		martial >= very_high_skill_rating
		stewardship >= very_high_skill_rating
		intrigue >= very_high_skill_rating
		learning >= very_high_skill_rating
		prowess >= very_high_skill_rating
	}
}

scripted_effect bp1_yearly_5702_skill_effect = {
	random_list = {
		30 = { #They teach you successfully
			modifier = {
				scope:skilful_friend = {
					$SKILL$ > 20
				}
				add = 15
			}
			modifier = {
				scope:skilful_friend = {
					$SKILL$ > 30
				}
				add = 25
			}

			desc = bp1_yearly.5702.a.tt.success

			send_interface_toast = {
				title = bp1_yearly.5702.a.tt.success
				left_icon = root
				right_icon = scope:skilful_friend

				add_$SKILL$_skill = 1
			}
		}
		50 = { #They don't teach you anything, but you appreciate the effort
			progress_towards_friend_effect = {
				CHARACTER = scope:skilful_friend
				OPINION = 0
				REASON = friend_skill_education
			}

			modifier = {
				root = {
					$SKILL$ > 20
				}
				add = 30
			}

			desc = bp1_yearly.5702.a.tt.neutral

			send_interface_toast = {
				title = bp1_yearly.5702.a.tt.neutral
				left_icon = root
				right_icon = scope:skilful_friend

				scope:skilful_friend = {
					add_opinion = {
						modifier = pleased_opinion
						opinion = 10
						target = root
					}
				}
			}
		}
		20 = { #They fail to teach you anything and it's frustrating for them

			modifier = {
				root = {
					$SKILL$ > 25
				}
				add = -30
			}

			desc = bp1_yearly.5702.a.tt.failure

			send_interface_toast = {
				title = bp1_yearly.5702.a.tt.failure
				left_icon = root
				right_icon = scope:skilful_friend

				scope:skilful_friend = {
					add_opinion = {
						modifier = annoyed_opinion
						opinion = -20
						target = root
					}
				}
			}
		}
	}
}

scripted_effect bp1_yearly_5702_skill_duel_effect = {
	duel = {
		skill = $SKILL$
		target = scope:skilful_friend

		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = 3.5
				min = -49
			}

			desc = bp1_yearly.5702.b.tt.success
			send_interface_toast = {
				title = bp1_yearly.5702.b.tt.success
				left_icon = root
				right_icon = scope:skilful_friend

				add_prestige = medium_prestige_value

				add_stress = medium_stress_loss
			}
		}

		50 = {
			compare_modifier = {
				value = scope:duel_value
				multiplier = -3.5
				min = -49
			}

			desc = bp1_yearly.5702.b.tt.failure
			send_interface_toast = {
				title = bp1_yearly.5702.b.tt.failure
				left_icon = root
				right_icon = scope:skilful_friend

				add_prestige = minor_prestige_loss

				add_stress = medium_stress_gain
			}
		}
	}
}

bp1_yearly.5702 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5702.t
	desc = {
		desc = bp1_yearly.5702.desc
		first_valid = {
			desc = {
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_diplomacy
					}
					desc = bp1_yearly.5702.diplomacy
				}
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_martial
					}
					desc = bp1_yearly.5702.martial
				}
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_stewardship
					}
					desc = bp1_yearly.5702.stewardship
				}
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_intrigue
					}
					desc = bp1_yearly.5702.intrigue
				}
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_learning
					}
					desc = bp1_yearly.5702.learning
				}
				triggered_desc = {
					trigger = {
						has_character_flag = skilful_friend_prowess
					}
					desc = bp1_yearly.5702.prowess
				}
			}
			desc = bp1_yearly.5702.fallback
		}
		desc = bp1_yearly.5702.ending
	}

	theme = friendly
	override_background = { reference = council_chamber }
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:skilful_friend
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_diplomacy
			}
			animation = chancellor
		}
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_martial
			}
			animation = marshal
		}
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_stewardship
			}
			animation = steward
		}
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_intrigue
			}
			animation = spymaster
		}
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_learning
			}
			animation = throne_room_writer
		}
		triggered_animation = {
			trigger = {
				has_character_flag = skilful_friend_prowess
			}
			animation = marshal
		}
		triggered_animation = {
			trigger = { always = yes }
			animation = personality_honorable
		}
	}

	cooldown = { years = 10 }

	trigger = {
		# DLC Trigger
		has_bp1_dlc_trigger = yes

		is_playable_character = yes

		any_relation = {
			type = friend
			skilful_friend_trigger = yes
		}

		is_available_at_peace_adult = yes
		
	}

	immediate = {
		random_relation = {
			type = friend
			limit = {
				skilful_friend_trigger = yes
			}
			save_scope_as = skilful_friend
		}
		skilful_friend_effect = yes
	}


	# Get help
	option = {
		name = bp1_yearly.5702.a

		if = {
			limit = { has_character_flag = skilful_friend_diplomacy }
			bp1_yearly_5702_skill_effect = { SKILL = diplomacy }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_martial }
			bp1_yearly_5702_skill_effect = { SKILL = martial }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_stewardship }
			bp1_yearly_5702_skill_effect = { SKILL = stewardship }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_intrigue }
			bp1_yearly_5702_skill_effect = { SKILL = intrigue }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_learning }
			bp1_yearly_5702_skill_effect = { SKILL = learning }
		}
		else = {
			bp1_yearly_5702_skill_effect = { SKILL = prowess }
		}

		stress_impact = {
			diligent = minor_stress_impact_loss
			content = medium_stress_impact_gain
			gregarious = miniscule_stress_impact_loss
			lazy = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# I reckon I'm as good as they are!
	option = {
		name = bp1_yearly.5702.b

		stress_impact = {
			ambitious = minor_stress_impact_loss
			arrogant = minor_stress_impact_loss
			humble = major_stress_impact_gain
			content = major_stress_impact_gain
			craven = medium_stress_impact_gain
		}

		if = {
			limit = { has_character_flag = skilful_friend_diplomacy }
			bp1_yearly_5702_skill_duel_effect = { SKILL = diplomacy }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_martial }
			bp1_yearly_5702_skill_duel_effect = { SKILL = martial }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_stewardship }
			bp1_yearly_5702_skill_duel_effect = { SKILL = stewardship }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_intrigue }
			bp1_yearly_5702_skill_duel_effect = { SKILL = intrigue }
		}
		else_if = {
			limit = { has_character_flag = skilful_friend_learning }
			bp1_yearly_5702_skill_duel_effect = { SKILL = learning }
		}
		else = {
			bp1_yearly_5702_skill_duel_effect = { SKILL = prowess }
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = humble
					has_trait = content
					has_trait = craven
				}
			}
		}
	}

	# I'll never reach their level of skill
	option = {
		name = bp1_yearly.5702.c

		stress_impact = {
			base = minor_stress_impact_gain
			ambitious = major_stress_impact_gain
			arrogant = major_stress_impact_gain
			greedy = medium_stress_impact_gain
			stubborn = medium_stress_impact_gain
			impatient = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = ambitious
					has_trait = arrogant
					has_trait = greedy
					has_trait = stubborn
					has_trait = impatient
				}
			}
		}
	}

	after = {
		remove_character_flag = skilful_friend_diplomacy
		remove_character_flag = skilful_friend_martial
		remove_character_flag = skilful_friend_stewardship
		remove_character_flag = skilful_friend_intrigue
		remove_character_flag = skilful_friend_learning
		remove_character_flag = skilful_friend_prowess
	}
}

##################################################
# Strange Bedfellows
# by Nick Meredith
# bp1_yearly.5703
##################################################

bp1_yearly.5703 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5703.t
	desc = bp1_yearly.5703.desc
	theme = lover_relation
	left_portrait = {
		character = root
		animation = fear
	}
	right_portrait = {
		character = scope:rival_lover
		animation = spymaster
	}
	override_background = { reference = bedchamber }

	cooldown = { years = 50 }

	trigger = {

		# DLC check.
		has_bp1_dlc_trigger = yes

		# Standard checks.
		is_valid_for_narrow_yearly_events = yes

		# Should have a rival who is also your lover and attracted to you
		any_relation = {
			type = lover
			has_relation_rival = root
			is_attracted_to_gender_of = root
		}

		# You are a man
		is_female = no
	}

	immediate = {
		random_relation = {
			type = rival
				limit = {
					has_relation_lover = root
				}
			save_scope_as = rival_lover
		}
	}

	# Nooo, leave lil ROOT.Char.GetName alone!
	option = {
		name = bp1_yearly.5703.a

		random_list = {
			50 = {
				modifier = { #Try and talk your way out of it
					add = 10
					diplomacy >= 15
				}
				modifier = { #Characters who are attracted to you are more likely to acquiesce
					add = 20
					attraction >= high_positive_attraction
				}
				modifier = { #Lustful characters, likewise
					add = 20
					scope:rival_lover = {
						has_trait = lustful
					}
				}

				desc = bp1_yearly.5703.a.tt.success
				send_interface_toast = {
					title = bp1_yearly.5703.a.tt.success
					left_icon = root
					right_icon = scope:rival_lover
					scope:rival_lover = {
						add_opinion = {
							modifier = romance_opinion
							opinion = 10
							target = root
						}
					}

					stress_impact = {
						base = minor_stress_impact_loss
					}
				}
			}

			30 = {

				increase_wounds_effect = { REASON = attacked }

				modifier = { #the chopper is forgiving
					add = -10
					scope:rival_lover = {
						has_trait = forgiving
					}
				}

				modifier = { #you bonked your sadistic rival? You bloody idiot
					add = 30
					scope:rival_lover = {
						has_trait = sadistic
					}
				}

				desc = bp1_yearly.5703.a.tt.failure
				send_interface_toast = {
					title = bp1_yearly.5703.a.tt.failure
					left_icon = root
					right_icon = scope:rival_lover
					stress_impact = {
						base = medium_stress_impact_gain
					}
				}
			}

			10 = {
				if = {
					limit = {
						age >= 12
					}
					add_trait = eunuch_1
				}
				else = {
					add_trait = beardless_eunuch
				}

				modifier = { #you bonked your sadistic rival? You bloody idiot
					add = 30
					scope:rival_lover = {
						has_trait = sadistic
					}
				}

				modifier = { #the chopper is forgiving
					add = -30
					scope:rival_lover = {
						has_trait = forgiving
					}
				}

				desc = bp1_yearly.5703.a.tt.criticalfailure
				send_interface_toast = {
					title = bp1_yearly.5703.a.tt.criticalfailure
					left_icon = root
					right_icon = scope:rival_lover
					stress_impact = {
						base = massive_stress_impact_gain
					}
				}
			}
		}

		stress_impact = {
			craven = minor_stress_impact_gain
			lustful = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = generous
				}
			}
		}
	}

	# ayy bby u wan sum more?
	option = {
		name = bp1_yearly.5703.b

		trigger = {
			NOT = {
				has_trait = seducer
			}
		}

		random_list = {
			10 = {
				modifier = { #Characters who are attracted to you are more likely to wan sum more
					add = 20
					attraction >= medium_positive_attraction
				}
				modifier = { #Characters who are very attracted to you are even more likely to wan sum more
					add = 30
					attraction >= high_positive_attraction
				}
				modifier = { #Lustful characters would love to continue to wan sum more
					add = 50
					scope:rival_lover = {
						has_trait = lustful
					}
				}
				modifier = { #Chaste characters do not wan sum more
					add = -50
					scope:rival_lover = {
						has_trait = chaste
					}
				}

				desc = bp1_yearly.5703.b.tt.success
				send_interface_toast = {
					title = bp1_yearly.5703.b.tt.success
					left_icon = root
					right_icon = scope:rival_lover
					stress_impact = {
						base = minor_stress_impact_loss
						lustful = major_stress_impact_loss
						rakish = major_stress_impact_loss
						arrogant = medium_stress_impact_loss
						trusting = minor_stress_impact_loss
					}
				}
			}

			10 = {
				if = {
					limit = {
						age >= 12
					}
					add_trait = eunuch_1
				}
				else = {
					add_trait = beardless_eunuch
				}

				desc = bp1_yearly.5703.b.tt.failure
				send_interface_toast = {
					title = bp1_yearly.5703.b.tt.failure
					left_icon = root
					right_icon = scope:rival_lover
					stress_impact = {
						base = massive_stress_impact_gain
						lustful = massive_stress_impact_gain
						rakish = massive_stress_impact_gain
						arrogant = major_stress_impact_gain
						trusting = major_stress_impact_gain
					}
				}
			}
		}

		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				OR = {
					has_trait = chaste
					has_trait = craven
				}
			}
		}
	}

	# Put that knife down and I will *prove* to you he's worth keeping!
	option = {
		name = bp1_yearly.5703.c

		trigger = {
			has_trait = seducer
		}

		had_sex_with_effect = {
			CHARACTER = scope:rival_lover
			PREGNANCY_CHANCE = seduce_pregnancy_chance
		}

		stress_impact = {
			seducer = medium_stress_impact_loss
			chaste = massive_stress_impact_gain
			lustful = medium_stress_impact_loss
			rakish = medium_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = generous
				}
			}
		}
	}
}

##################################################
# Scrambling for Answers
# by Nick Meredith
# bp1_yearly.5740
##################################################

bp1_yearly.5740 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5740.t
	desc = bp1_yearly.5740.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = shock
	}

	override_background = { reference = bedchamber }

	cooldown = { years = 100 }

	trigger = {

		# DLC check.
		has_bp1_dlc_trigger = yes

		# Standard checks.
		is_valid_for_narrow_yearly_events = yes

		# You are paranoid
		has_trait = paranoid

		# You are not a vegetarian
		NOT = {
			culture = { has_cultural_tradition = tradition_vegetarianism }
		}

		# You have a spouse
		any_spouse = {
			is_available_ai_adult = yes
		}

		# You have a friend
		any_relation = {
			type = friend
			is_available_ai_adult = yes
			NOT = {
				is_spouse_of = root
			}
		}
	}

	immediate = {
		play_music_cue = mx_cue_combat_2
		random_relation = {
			type = friend
			limit = {
				is_available_ai_adult = yes
				NOT = {
					is_spouse_of = root
				}
			}
			save_scope_as = egg_friend
		}
		random_spouse = {
			limit = {
				is_available_ai_adult = yes
			}
			save_scope_as = egg_spouse
		}
	}

	# What is the meaning of this?!
	option = {
		name = bp1_yearly.5740.a

		flavor = bp1_yearly.5740.a.tt

		trigger_event = {
			id = bp1_yearly.5741
			days = 1
		}

		stress_impact = {
			craven = minor_stress_impact_gain
			calm = minor_stress_impact_gain
			lazy = medium_stress_impact_gain
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = lazy
				}
			}
		}
	}

	# How strange. Oh well.
	option = {
		name = bp1_yearly.5740.b

		add_character_modifier = {
			modifier = sneaking_suspicion_modifier
			years = 10
		}

		stress_impact = {
			base = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# GUARDS!
	option = {
		name = bp1_yearly.5740.c

		trigger = {
			has_trait = wrathful
		}

		add_character_modifier = {
			modifier = busy_guards_modifier
			years = 10
		}

		stress_impact = {
			base = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = paranoid
					has_trait = generous
				}
			}
		}
	}
}

# You run down to the kitchens to investigate
bp1_yearly.5741 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5741.t
	desc = bp1_yearly.5741.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = stress
	}
	override_background = { reference = bp1_kitchen_western }

	# Another one?! Aaahhhh!
	option = {
		name = bp1_yearly.5741.a

		flavor = bp1_yearly.5741.a.tt

		trigger_event = {
			id = bp1_yearly.5742
			days = 1
		}

		stress_impact = {
			paranoid = miniscule_stress_impact_loss
			calm = medium_stress_impact_gain
			vengeful = miniscule_stress_impact_loss
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = calm
				}
			}
		}
	}

	# Mystery solved!
	option = {
		name = bp1_yearly.5741.b

		add_prestige = minor_prestige_gain

		add_character_modifier = {
			modifier = lacking_supplies_modifier
			years = 10
		}

		ai_chance = {
			base = 100
		}
	}
}

# Scramble down the stairs to the cellar to cool off
bp1_yearly.5742 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5742.t
	desc = bp1_yearly.5742.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = worry
	}
	override_background = { reference = bp1_wine_cellar }

	# How? HOW?!
	option = {
		name = bp1_yearly.5742.a

		trigger_event = {
			id = bp1_yearly.5743
			days = 1
		}

		stress_impact = {
			paranoid = miniscule_stress_impact_gain
			calm = medium_stress_impact_gain
			vengeful = miniscule_stress_impact_loss
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# Hey, two free eggs!
	option = {
		name = bp1_yearly.5742.b

		root.capital_county = {
			add_county_modifier = {
				modifier = lacking_poultry_modifier
				years = 20
			}
		}

		add_character_modifier = {
			modifier = optimist_modifier
			years = 20
		}

		stress_impact = {
			base = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}
}

# Return to your courtroom to confront them
bp1_yearly.5743 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5743.t
	desc = bp1_yearly.5743.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:egg_spouse
		animation = fear
	}
	lower_center_portrait = {
		character = scope:egg_friend
	}
	override_background = { reference = council_chamber }


	# IT WAS MY SPOUSE!
	option = {
		name = bp1_yearly.5743.a

		random_list = {
			# You 'correctly' guess the person
			# Except not really; the point is you never find out
			0 = {
				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.a.tt.success
			}

			# Your guess is incorrect
			1 = {
				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.a.tt.failure
			}
		}

		add_character_flag = egg_spouse_flag

		reverse_add_opinion = {
			target = scope:egg_spouse
			modifier = angry_opinion
			opinion = -30
		}

		trigger_event = {
			id = bp1_yearly.5744
			days = 1
		}

		stress_impact = {
			paranoid = miniscule_stress_impact_loss
			calm = medium_stress_impact_gain
			vengeful = miniscule_stress_impact_loss
			forgiving = medium_stress_impact_gain
		}

		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = forgiving
					has_trait = calm
				}
			}
		}
	}

	# IT WAS MY FRIEND!
	option = {
		name = bp1_yearly.5743.b

		random_list = {
			# You 'correctly' guess the person
			# Except not really; the point is you never find out
			0 = {
				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.a.tt.success
			}

			# Your guess is incorrect
			1 = {
				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.a.tt.failure
			}
		}

		add_character_flag = egg_friend_flag

		reverse_add_opinion = {
			target = scope:egg_friend
			modifier = angry_opinion
			opinion = -30
		}

		trigger_event = {
			id = bp1_yearly.5744
			days = 1
		}

		ai_chance = {
			base = 100
		}
	}

	# It was... it was all of you!
	option = {
		name = bp1_yearly.5743.c

		random_list = {
			# You 'correctly' guess the person
			# Except not really; the point is you never find out
			0 = {

				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.c.tt.success
			}

			# Your guess is incorrect
			1 = {

				show_chance = no
				desc = bp1_yearly.5743.a.tt.outcome
				custom_tooltip = bp1_yearly.5743.a.tt.failure
			}
		}

		every_courtier = {
			add_opinion = {
				target = root
				modifier = confused_opinion
				opinion = -20
			}

			custom = bp1_yearly.5743.c.tt
		}

		trigger_event = {
			id = bp1_yearly.5744
			days = 1
		}

		ai_chance = {
			base = 100
		}
	}
}

# You break down
bp1_yearly.5744 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5744.t
	desc = {
		desc = bp1_yearly.5744.start
		first_valid = {
			triggered_desc = {
				trigger = {
					has_character_flag = egg_spouse_flag
				}
				desc = bp1_yearly.5744.spouse
			}
			triggered_desc = {
				trigger = {
					has_character_flag = egg_friend_flag
				}
				desc = bp1_yearly.5744.spouse
			}
			triggered_desc = {
				trigger = {
					NOR = {
						has_character_flag = egg_spouse_flag
						has_character_flag = egg_friend_flag
					}
				}
				desc = bp1_yearly.5744.crowd
			}
		}
		desc = bp1_yearly.5744.end
	}
	theme = mental_break
	left_portrait = {
		character = root
		animation = grief
	}
	right_portrait = {
		character = scope:egg_spouse
		animation = worry
	}
	lower_center_portrait = {
		character = scope:egg_friend
	}
	override_background = { reference = council_chamber }


	# Perhaps it's time to give up?
	option = {
		name = bp1_yearly.5744.a

		add_prestige = minor_prestige_loss

		trigger_event = {
			id = bp1_yearly.5745
			days = 45
		}

		stress_impact = {
			base = minor_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	# I'll get them one day!
	option = {
		name = bp1_yearly.5744.b

		trigger_event = {
			id = bp1_yearly.5745
			days = 45
		}

		stress_impact = {
			base = minor_stress_impact_loss
		}

		add_character_modifier = {
			modifier = obsessively_neurotic_modifier
			years = 10
		}

		ai_chance = {
			base = 100
		}
	}
}

# You get another present in the aftermath
bp1_yearly.5745 = {
	type = character_event
	content_source = dlc_006
	title = bp1_yearly.5745.t
	desc = bp1_yearly.5745.desc
	theme = mental_break
	left_portrait = {
		character = root
		animation = shock
	}
	override_background = { reference = bedchamber }

	immediate = {
		play_music_cue = mx_cue_negative
	}

	# Another one?! Aaahhhh!
	option = {
		name = bp1_yearly.5745.a

		add_trait = lunatic_1

		ai_chance = {
			base = 100
		}
	}

	# It must be my wife's fault!
	option = {
		name = bp1_yearly.5745.b

		trigger = {
			has_character_flag = egg_friend_flag
		}

		add_trait = lunatic_1

		add_character_modifier = {
			modifier = unhappy_spouse_modifier
			years = 10
		}

		reverse_add_opinion = {
			target = scope:egg_spouse
			modifier = angry_opinion
			opinion = -50
		}

		stress_impact = {
			base = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
		}
	}

	# It must be my friend's fault!
	option = {
		name = bp1_yearly.5745.c

		trigger = {
			has_character_flag = egg_spouse_flag
		}

		add_trait = lunatic_1

		remove_relation_friend = scope:egg_friend

		stress_impact = {
			base = minor_stress_impact_loss
		}

		ai_chance = {
			base = 100
		}
	}

	# I can't engage with this any longer!
	option = {
		name = bp1_yearly.5745.d

		stress_impact = {
			base = major_stress_impact_gain
		}

		ai_chance = {
			base = 100
		}
	}

	after = {
		remove_character_flag = egg_spouse_flag
		remove_character_flag = egg_friend_flag
	}
}
