﻿namespace = bp2_yearly

####
# bp2_yearly.8000 - Your hostage learns your court language!
# bp2_yearly.8010 - A kid makes fun of your stupid accent
# bp2_yearly.8020 - Childhood event, play with toys :D
# bp2_yearly.8030 - You raid a holding, wanna steal some toys?
# bp2_yearly.8040 - You and crush are now adults, maybe become something more?
# bp2_yearly.8050-8065 - Hostage identity crisis story cycle
# bp2_yearly.8070 - Play with your favourite toy
# bp2_yearly.8071 - 8070 follow-up
# bp2_yearly.8080 - Send your ward in to sing your praises
# bp2_yearly.8090 - Take the toy test to become a reincarnation
# bp2_yearly.8100 - You develop feelings for another kid, is this a crush?
# bp2_yearly.8110 - Sacred childbirth, people want to pamper you
# bp2_yearly.8120 - Sacred childbirth, offer to take care of your pregnant spouse
####

##################################################
# Your hostage learns your court language
# by James Beaumont
# 8000
##################################################
scripted_trigger bp2_yearly_8000_valid_educator = {
	knows_court_language_of = root
	is_available_ai = yes
}

bp2_yearly.8000 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8000.t
	desc = {
		#Standard intro
		desc = bp2_yearly.8000.desc.intro
		first_valid = { # Determine who they learned the language from
			#Court tutor
			triggered_desc = {
				trigger = {
					scope:tutor = {
						has_court_position = court_tutor_court_position
					}
				}
				desc = bp2_yearly.8000.desc.tutor
			}
			#Court chaplain
			triggered_desc = {
				trigger = {
					scope:tutor = {
						has_council_position = councillor_court_chaplain
					}
				}
				desc = bp2_yearly.8000.desc.chaplain
			}
			#Guardian
			triggered_desc = {
				trigger = {
					scope:tutor = {
						has_relation_ward = scope:hostage
					}
				}
				desc = bp2_yearly.8000.desc.guardian
			}
		}
	}
	theme = education
	left_portrait = {
		character = root
		animation = happy_teacher
	}
	right_portrait = {
		character = scope:hostage
		animation = personality_bold
	}
	lower_right_portrait = {
		character = scope:tutor
	}
	trigger = {
		has_bp2_dlc_trigger = yes
		#Standard checks
		is_available_adult = yes
		has_royal_court = yes
		#Do you have a hostage?
		OR = {
			any_child = {
				NOT = { knows_court_language_of = root }
				child_not_infant_trigger = yes
			}
			any_warden_hostage = {
				NOT = { knows_court_language_of = root }
				child_not_infant_trigger = yes
				save_temporary_scope_as = hostage_temp #Only checked vs other guardian
			}
		}
		#Is there a valid tutor?
		OR = {
			AND = {
				exists = court_position:court_tutor_court_position
				court_position:court_tutor_court_position = {
					bp2_yearly_8000_valid_educator = yes
				}
			}
			AND = {
				exists = cp:councillor_court_chaplain
				cp:councillor_court_chaplain = {
					bp2_yearly_8000_valid_educator = yes
				}
			}
			scope:hostage_temp ?= {
				any_relation = {
					type = guardian
					NOT = {
						this = root
					}
					bp2_yearly_8000_valid_educator = yes
				}
			}
		}
	}
	weight_multiplier = {
		base = 1
		modifier = {
			# More likely for bambinos
			any_warden_hostage = {
				NOT = {
					knows_court_language_of = root
				}
				child_not_infant_trigger = yes
			}
			add = 2
		}
	}
	immediate = {
		play_music_cue = "mx_cue_low_key_positive"
		random_list = {
			66 = {
				trigger = {
					any_warden_hostage = {
						NOT = { knows_court_language_of = root }
						child_not_infant_trigger = yes
						save_temporary_scope_as = hostage_temp #Only checked vs other guardian
					}
					OR = {
						AND = {
							exists = court_position:court_tutor_court_position
							court_position:court_tutor_court_position = {
								bp2_yearly_8000_valid_educator = yes
							}
						}
						AND = {
							exists = cp:councillor_court_chaplain
							cp:councillor_court_chaplain = {
								bp2_yearly_8000_valid_educator = yes
							}
						}
						scope:hostage_temp = {
							any_relation = {
								type = guardian
								NOT = {
									this = root
								}
								bp2_yearly_8000_valid_educator = yes
							}
						}
					}
				}
				random_warden_hostage = {
					limit = {
						NOT = { knows_court_language_of = root }
						child_not_infant_trigger = yes
					}
					weight = {
						base = 1
						modifier = {
							add = 2
							child_not_infant_trigger = yes
						}
					}
					save_scope_as = hostage
				}
			}
			33 = {
				trigger = {
					any_child = {
						NOT = { knows_court_language_of = root }
						child_not_infant_trigger = yes
					}
				}
				random_child = {
					limit = {
						NOT = { knows_court_language_of = root }
						child_not_infant_trigger = yes
					}
					weight = {
						base = 1
						modifier = {
							add = 2
							this = root.player_heir
						}
						modifier = {
							add = 2
							child_not_infant_trigger = yes
						}
					}
					save_scope_as = hostage
				}
			}
		}
		random_list = {
			50 = {
				trigger = {
					exists = court_position:court_tutor_court_position
					court_position:court_tutor_court_position = {
						bp2_yearly_8000_valid_educator = yes
					}
				}
				court_position:court_tutor_court_position = {
					save_scope_as = tutor
				}
			}
			50 = {
				trigger = {
					exists = cp:councillor_court_chaplain
					cp:councillor_court_chaplain = {
						bp2_yearly_8000_valid_educator = yes
					}
				}
				cp:councillor_court_chaplain = {
					save_scope_as = tutor
				}
			}
			50 = {
				trigger = {
					scope:hostage = {
						any_relation = {
							type = guardian
							bp2_yearly_8000_valid_educator = yes
						}
					}
				}
				scope:hostage = {
					random_relation = {
						type = guardian
						limit = {
							bp2_yearly_8000_valid_educator = yes
						}
						save_scope_as = tutor
					}
				}
			}
		}
		# Find a valid target to learn the court language from
		hidden_effect = {
			# Prioritise root
			if = {
				limit = {
					has_court_language_of_culture = root.culture
				}
				root = { save_scope_as = language_target }
			}
			# Otherwise, target tutor
			else_if = {
				limit = {
					exists = court_position:court_tutor_court_position
					has_court_language_of_culture = court_position:court_tutor_court_position.culture
				}
				court_position:court_tutor_court_position = { save_scope_as = language_target }
			}
			# Failing that, find a courtier
			else_if = {
				limit = {
					any_courtier_or_guest = { root = { has_court_language_of_culture = prev.culture } }
				}
				random_courtier_or_guest = {
					limit = {
						root = { has_court_language_of_culture = prev.culture }
					}
					save_scope_as = language_target
				}
			}
			# You somehow have nobody in your court who natively speaks your court language (Seljuks, for example)
			else_if = {
				limit = {
					any_pool_character = {
						province = root.location
						root = { has_court_language_of_culture = prev.culture }
					}
				}
				random_pool_character = {
					province = root.location
					limit = {
						root = { has_court_language_of_culture = prev.culture }
					}
					save_scope_as = language_target
				}
			}
			# You don't even have any pool characters who speak it, create a new person from thin air
			else = {
				if = { # Try to get an extant culture; no medieval Romans appearing out of nowhere
					limit = {
						any_culture_global = {
							exists = culture_head
							root = { has_court_language_of_culture = prev }
						}
					}
					random_culture_global = {
						limit = {
							exists = culture_head
							root = { has_court_language_of_culture = prev }
						}
						save_scope_as = language_culture
					}
				}
				else = { # If literally nobody else exists, fine. Grab a Roman if you really have to.
					random_culture_global = {
						limit = {
							root = { has_court_language_of_culture = prev }
						}
						save_scope_as = language_culture
					}
				}
				create_character = {
					dynasty = none
					template = court_linguist_cheap_template
					culture = scope:language_culture
					faith = root.faith
					location = root.capital_province
					save_scope_as = language_target
				}
			}
		}
	}
	# Excellent, I will encourage this!
	option = {
		name = bp2_yearly.8000.a
		custom_tooltip = {
			text = tutor_child_in_language_tt
			scope:hostage = {
				add_character_modifier = {
					modifier = close_tutelage
					years = 3
				}
				start_scheme = {
					type = learn_language
					target = scope:language_target
				}
				random_scheme = {
					limit = {
						scheme_type = learn_language
						scheme_target = scope:language_target
					}
					add_scheme_modifier = {
						type = close_tutelage_scheme
					}
				}
			}
		}
		add_prestige = minor_prestige_gain
		add_character_modifier = {
			modifier = close_tutelage_tutor
			years = 5
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:hostage
			REASON = friend_language_tutor
			OPINION = default_friend_opinion
		}
		stress_impact = {
			base = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			arbitrary = minor_stress_impact_gain
			callous = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			patient = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			modifier = {
				OR = {
					has_trait = lazy
					has_trait = callous
					has_trait = impatient
				}
				factor = 0
			}
		}
	}
	# That's nice
	option = {
		name = bp2_yearly.8000.c
		scope:hostage = {
			add_opinion = {
				modifier = pleased_opinion
				opinion = 15
				target = root
			}
		}
		scope:tutor = {
			add_opinion = {
				modifier = pleased_opinion
				opinion = 10
				target = root
			}
		}
		custom_tooltip = {
			text = child_learning_language_tt
			scope:hostage = {
				start_scheme = {
					type = learn_language
					target = scope:language_target
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

##################################################
# Your liege's hostage is obsessed with your accent
# by James Beaumont
# 8010
##################################################
scripted_trigger bp2_yearly_8010_valid_educator = {
	liege ?= {
		has_royal_court = yes
		save_temporary_scope_as = my_liege
	}
	# Your language is not your liege's language
	NOT = { culture = { has_same_culture_language = scope:my_liege.culture } }
	# You do speak either your liege's court language
	knows_court_language_of = scope:my_liege
	is_available_adult = yes
}
scripted_trigger bp2_yearly_8010_valid_child = {
	liege ?= {
		has_royal_court = yes
		save_temporary_scope_as = my_liege
	}
	# AI only
	is_available_ai = yes
	# Doesn't speak your language
	NOT = { knows_language_of_culture = root.culture }
	can_start_scheme = {
		type = learn_language
		target = root
	}
	# DOES speak liege's language
	knows_court_language_of = scope:my_liege
	child_not_infant_trigger = yes
	# Make sure they're actually at the liege's court
	location = scope:my_liege.location
}

bp2_yearly.8010 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8010.t
	desc = bp2_yearly.8010.desc
	theme = education
	left_portrait = {
		character = root
		animation = stressed_teacher
	}
	right_portrait = {
		character = scope:child
		animation = laugh
	}
	cooldown = {
		years = 4
	}
	trigger = {
		has_bp2_dlc_trigger = yes
		is_ruler = yes
		is_landed = yes
		is_independent_ruler = no
		bp2_yearly_8010_valid_educator = yes
		liege ?= {
			has_royal_court = yes
			OR = {
				any_child = {
					bp2_yearly_8010_valid_child = yes
				}
				any_relation = {
					type = ward
					bp2_yearly_8010_valid_child = yes
				}
				any_warden_hostage = {
					bp2_yearly_8010_valid_child = yes
				}
			}
		}
	}
	immediate = {
		liege = {
			random_list = {
				50 = {
					trigger = {
						any_child = {
							bp2_yearly_8010_valid_child = yes
						}
					}
					random_child = {
						limit = {
							bp2_yearly_8010_valid_child = yes
						}
						save_scope_as = child
					}
				}
				50 = {
					trigger = {
						any_relation = {
							type = ward
							bp2_yearly_8010_valid_child = yes
						}
					}
					random_relation = {
						type = ward
						limit = {
							bp2_yearly_8010_valid_child = yes
						}
						save_scope_as = child
					}
				}
				50 = {
					trigger = {
						any_warden_hostage = {
							bp2_yearly_8010_valid_child = yes
						}
					}
					random_warden_hostage = {
						limit = {
							bp2_yearly_8010_valid_child = yes
						}
						save_scope_as = child
					}
				}
			}
		}
	}
	#Let me teach you my language, smelly child
	option = {
		name = bp2_yearly.8010.a
		flavor = bp2_yearly.8010.a.tt
		add_learning_lifestyle_xp = minor_lifestyle_xp #Tutoring
		duel = {
			skill = learning
			value = medium_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:child
					title = bp2_yearly.8010.a.success
					progress_towards_friend_effect = {
						REASON = friend_gave_a_good_lesson
						CHARACTER = scope:child
						OPINION = default_friend_opinion
					}
					custom_tooltip = {
						text = tutor_child_in_native_language_tt
						scope:child = {
							add_character_modifier = {
								modifier = close_tutelage
								years = 3
							}
							start_scheme = {
								type = learn_language
								target = root
							}
							random_scheme = {
								limit = {
									scheme_type = learn_language
									scheme_target = root
								}
								add_scheme_modifier = {
									type = close_tutelage_scheme
								}
							}
						}
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:child
					title = bp2_yearly.8010.a.failure
					stress_impact = {
						base = minor_stress_impact_gain
						arrogant = minor_stress_impact_gain
						vengeful = minor_stress_impact_gain
						patient = minor_stress_impact_loss
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_energy = 0.5
				ai_vengefulness = -1
			}
		}
	}
	#Make fun of the kid back
	option = {
		name = bp2_yearly.8010.b
		scope:child = {
			stress_impact = {
				base = minor_stress_impact_gain
				arrogant = medium_stress_impact_gain
				vengeful = minor_stress_impact_gain
				forgiving = minor_stress_impact_loss
			}
		}
		random = {
			chance = 25
			progress_towards_rival_effect = {
				REASON = rival_humiliated_a_child
				CHARACTER = scope:child
				OPINION = default_rival_opinion
			}
		}
		stress_impact = {
			arrogant = medium_stress_impact_loss
			vengeful = minor_stress_impact_loss
			patient = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_rationality = -0.5
				ai_vengefulness = 1
			}
		}
	}
	#Invent a secret language with the kid!
	option = {
		name = bp2_yearly.8010.d
		flavor = bp2_yearly.8010.d.tt
		trigger = {
			has_trait = eccentric
		}
		add_learning_lifestyle_xp = minor_lifestyle_xp
		set_relation_friend = {
			reason = friend_secret_language
			target = scope:child
		}
		stress_impact = {
			eccentric = major_stress_impact_loss
			arrogant = medium_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -2
				ai_energy = 1
				ai_vengefulness = -1
			}
		}
	}
}

##################################################
# Childhood event, play with toys :D
# by James Beaumont
# 8020
##################################################
bp2_yearly.8020 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8020.t
	desc = bp2_yearly.8020.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = personality_content
	}
	right_portrait = {
		character = scope:other_child
		animation = chess_cocky
	}
	trigger = {
		has_bp2_dlc_trigger = yes
		is_available = yes
		child_not_infant_trigger = yes
		suitable_same_realm_child = yes
	}
	cooldown = {
		years = 4
	}
	immediate = {
		save_scope_as = child
		location.county = {
			save_scope_as = capital_county_scope
		}
		add_suitable_same_realm_children_to_list = yes
		random_in_list = {
			list = suitable_same_realm_children
			limit = {
				OR = {
					has_relation_friend = root
					has_relation_potential_friend = root
					is_sibling_of = root
					has_relation_potential_friend = root
					is_hostage_of = root.location.county.holder
				}
			}
			alternative_limit = {
				always = yes
			}
			weight = {
				base = 1
				modifier = {
					add = 10
					is_of_major_interest_to_root_trigger = yes
				}
				modifier = {
					add = 5
					is_of_minor_interest_to_root_trigger = yes
				}
			}
			save_scope_as = other_child
		}
	}
	#Race on stilts!
	option = {
		name = bp2_yearly.8020.a
		hidden_effect = {
			set_variable = {
				name = 8020_played_on_stilts
				days = 3
			}
		}
		duel = {
			skill = prowess
			value = high_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				custom_tooltip = {
					text = bp2_yearly.8020.a.win
					trigger_event = bp2_yearly.8021
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				custom_tooltip = {
					text = bp2_yearly.8020.a.lose
					trigger_event = bp2_yearly.8022
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			athletic = minor_stress_impact_loss
			# I hate competition :C
			pensive = minor_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 0.5
				ai_energy = 1
				ai_vengefulness = 1
			}
		}
	}
	#Let's play Teetotum
	option = {
		name = bp2_yearly.8020.b
		hidden_effect = {
			set_variable = {
				name = 8020_played_teetotum
				days = 3
			}
		}
		random_list = {
			50 = {
				custom_tooltip = {
					text = bp2_yearly.8020.a.win
					trigger_event = bp2_yearly.8021
				}
			}
			50 = {
				custom_tooltip = {
					text = bp2_yearly.8020.a.lose
					trigger_event = bp2_yearly.8022
				}
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			arbitrary = minor_stress_impact_loss
			# Gambling is a sin!
			zealous = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -0.5
				ai_rationality = -0.5
				ai_zeal = -0.5
			}
		}
	}
	#How about we just play with puppets?
	option = {
		name = bp2_yearly.8020.c
		trigger = {
			OR = {
				has_trait = humble
				has_trait = pensive
			}
		}
		progress_towards_friend_effect = {
			REASON = friend_played_together
			CHARACTER = scope:other_child
			OPINION = default_friend_opinion
		}
		stress_impact = {
			base = minor_stress_impact_loss
			humble = major_stress_impact_loss
			pensive = major_stress_impact_loss
			arrogant = medium_stress_impact_gain
			vengeful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_energy = -1
				ai_vengefulness = -1
			}
		}
	}
}

# Follow-up, you win!
bp2_yearly.8021 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8021.t
	desc = {
		desc = bp2_yearly.8021.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_on_stilts
				}
				desc = bp2_yearly.8021.desc.stilts
			}
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_teetotum
				}
				desc = bp2_yearly.8021.desc.teetotum
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_on_stilts
				}
				desc = bp2_yearly.8021.desc.stilts.outro
			}
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_teetotum
				}
				desc = bp2_yearly.8021.desc.teetotum.outro
			}
		}
	}
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:other_child
		animation = anger
	}
	#Rub it in
	option = {
		name = bp2_yearly.8021.a
		add_prestige = minor_prestige_gain
		if = {
			limit = {
				can_set_relation_victim_trigger = { CHARACTER = scope:other_child }
			}
			set_relation_victim = scope:other_child
		}
		stress_impact = {
			base = medium_stress_impact_loss
			humble = medium_stress_impact_gain
			content = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_honor = -0.5
				ai_vengefulness = 1
			}
		}
	}
	#Console them for losing
	option = {
		name = bp2_yearly.8021.b
		progress_towards_friend_effect = {
			REASON = friend_played_together
			CHARACTER = scope:other_child
			OPINION = default_friend_opinion
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_sociability = 1
				ai_vengefulness = -1
			}
		}
	}
	#Trick em into thinking they owe you
	option = {
		name = bp2_yearly.8021.c
		trigger = {
			has_trait = deceitful
		}
		add_hook = {
			target = scope:other_child
			type = indebted_hook
		}
		stress_impact = {
			base = minor_stress_impact_loss
			ambitious = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -1
				ai_boldness = 0.5
				ai_greed = 0.5
				ai_vengefulness = 1
			}
		}
	}
}

# Follow-up, you lose!
bp2_yearly.8022 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8021.t
	override_background = { reference = garden }
	desc = {
		desc = bp2_yearly.8021.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_on_stilts
				}
				desc = bp2_yearly.8021.desc.stilts
			}
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_teetotum
				}
				desc = bp2_yearly.8021.desc.teetotum
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_on_stilts
				}
				desc = bp2_yearly.8022.desc.stilts.outro
			}
			triggered_desc = {
				trigger = {
					has_variable = 8020_played_teetotum
				}
				desc = bp2_yearly.8022.desc.teetotum.outro
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					has_variable = 8022_rubbed_it_in
				}
				desc = bp2_yearly.8022.desc.rubbed_it_in
			}
			desc = bp2_yearly.8022.desc.normal_child
		}
	}
	theme = friendly
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:other_child
		animation = happiness
	}
	immediate = {
		if = {
			limit = {
				scope:other_child = {
					ai_vengefulness > ai_honor
				}
			}
			set_variable = {
				name = 8022_rubbed_it_in
				days = 3
			}
		}
	}
	#Stop it stop it stop it!
	option = {
		name = {
			text = bp2_yearly.8022.a
		}
		name = {
			text = bp2_yearly.8022.a.mean
			trigger = {
				exists = var:8022_rubbed_it_in
			}
		}
		if = {
			limit = {
				exists = var:8022_rubbed_it_in
			}
			if = {
				limit = {
					can_set_relation_bully_trigger = { CHARACTER = root }
				}
				set_relation_bully = scope:other_child
			}
			stress_impact = {
				base = minor_stress_impact_gain
			}
		}
		else = {
			stress_impact = {
				arrogant = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_honor = -0.5
				ai_vengefulness = 1
			}
		}
	}
	#Have them locked up!
	option = {
		name = bp2_yearly.8022.b
		trigger = {
			has_trait = vengeful
			scope:other_child.liege = root
		}
		add_dread = medium_dread_gain
		imprison_character_effect = {
			TARGET = scope:other_child
			IMPRISONER = root
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			ambitious = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = -1
				ai_vengefulness = 1
			}
		}
	}
	#We should play again sometime!
	option = {
		name = bp2_yearly.8022.c
		trigger = {
			has_trait = forgiving
		}
		progress_towards_friend_effect = {
			REASON = friend_played_together
			CHARACTER = scope:other_child
			OPINION = default_friend_opinion
		}
		stress_impact = {
			base = minor_stress_impact_loss
			ambitious = minor_stress_impact_loss
			humble = medium_stress_impact_gain
			content = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_sociability = 1
				ai_vengefulness = -1
			}
		}
	}
}


##################################################
# You raid a holding, wanna steal some toys?
# by James Beaumont
# 8030
##################################################
bp2_yearly.8031 = {	#Hidden event: do I get a doll?
	hidden = yes
	scope = army

	trigger = {
		has_bp2_dlc_trigger = yes
		#You must be leading your own forces.
		scope:raider = {
			is_at_location = scope:barony.title_province
			any_courtier_or_guest = {
				count >= 2
				OR = {
					is_child_of = scope:raider
					is_hostage_of = scope:raider
				}
				is_adult = no
			}
			NOT = {
				has_character_flag = bp2_8030_doll
			}
		}
	}

	immediate = {
		random = {
			chance = 14
			scope:raider = {
				trigger_event = bp2_yearly.8030
			}
		}
	}
}
bp2_yearly.8030 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8030.t
	desc = bp2_yearly.8030.desc
	theme = battle
	override_background = { reference = burning_building }
	left_portrait = {
		character = root
		animation = anger
	}
	lower_right_portrait = {
		character = scope:child_1
	}
	lower_center_portrait = {
		character = scope:child_2
	}
	immediate = {
		add_character_flag = { flag = bp2_8030_doll }
		random_courtier_or_guest = {
			limit = {
				OR = {
					is_child_of = root
					is_hostage_of = root
				}
				is_adult = no
			}
			weight = {
				base = 1
				modifier = {
					factor = 10
					is_child_of = root
				}
			}
			save_scope_as = child_1
		}
		random_courtier_or_guest = {
			limit = {
				OR = {
					is_child_of = root
					is_hostage_of = root
				}
				is_adult = no
				NOT = {
					this = scope:child_1
				}
			}
			weight = {
				base = 1
				modifier = {
					factor = 10
					is_hostage_of = root
				}
			}
			save_scope_as = child_2
		}
	}
	#I will take the toy for bambini #1
	option = {
		name = bp2_yearly.8030.a
		custom_tooltip = bp2_yearly.8030.a.tt
		progress_towards_friend_effect = {
			REASON = friend_gift
			CHARACTER = scope:child_1
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}
	#I will take the toy for babber #2
	option = {
		name = bp2_yearly.8030.b
		custom_tooltip = bp2_yearly.8030.b.tt
		progress_towards_friend_effect = {
			REASON = friend_gift
			CHARACTER = scope:child_2
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	#I am a raider and I do not want this event firing every bloody time
	option = {
		name = bp2_yearly.8030.c
		custom_tooltip = bp2_yearly.8030.c.tt
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -0.5
				ai_honor = -0.2
			}
		}
	}
	
}



##################################################
# Your crush has become an adult, become lovers?
# by James Beaumont
# 8040
##################################################
scripted_effect bp2_yearly_8040_marriage_effect = {
	if = {
		limit = {
			scope:crushee = { is_male = yes }
			OR = {
				scope:crush = { is_ai = yes }
				scope:crushee = { is_ai = no }
			}
		}
		scope:crushee = {
			marry = scope:crush
		}
	}
	else = {
		scope:crushee = {
			marry_matrilineal = scope:crush
		}
	}
	scope:crushee = {
		set_relation_soulmate = {
			target = scope:crush
			copy_reason = crush
		}
	}
}
bp2_yearly.8040 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8040.t
	desc = {
		desc = bp2_yearly.8040.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:crush.location = root.location
				}
				desc = bp2_yearly.8040.desc.mid.same_location
			}
			desc = bp2_yearly.8040.desc.mid.different_location
		}
		desc = bp2_yearly.8040.desc.outro
	}
	theme = love
	left_portrait = {
		character = root
		animation = flirtation
	}
	right_portrait = {
		character = scope:crush
		animation = personality_honorable
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		is_available_adult = yes
		any_memory = {
			has_memory_type = developed_crush
			NOT = { has_variable = bp2_yearly_8040 }
			exists = memory_participant:new_relation
			memory_participant:new_relation = {
				# Only grown-ups please
				is_physically_able_adult = yes
				# Make sure you haven't become lovers/soulmates in the meantime
				NOR = {
					has_relation_lover = root
					has_relation_soulmate = root
				}
				# Make sure the crush still has a gender you're into and vice-versa
				save_temporary_scope_as = crush_memory_temp
					matching_gender_and_sexuality_trigger = {
					CHARACTER_1 = root
					CHARACTER_2 = scope:crush_memory_temp
				}
			}
		}
	}
	immediate = {
		random_memory = {
			limit = {
				has_memory_type = developed_crush
				NOT = { has_variable = bp2_yearly_8040 }
				exists = memory_participant:new_relation
				memory_participant:new_relation = {
					is_physically_able_adult = yes
					NOR = {
						has_relation_lover = root
						has_relation_soulmate = root
					}
				}
			}
			save_scope_as = crush_memory
			memory_participant:new_relation = { save_scope_as = crush }
			set_variable = bp2_yearly_8040
		}
		save_scope_as = crushee
	}
	#I must make my feelings known!
	option = {
		name = bp2_yearly.8040.a
		custom_tooltip = {
			text = bp2_yearly_8040_confess_crush
			scope:crush = {
				trigger_event = {
					id = bp2_yearly.8041
					days = 2
				}
			}
		}
		ai_chance = {
			base = 100
			#AGOT Added, from below
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = 0.5
			}
			modifier = {
				factor = 0
				OR = {
					would_be_sinful_adulterer_trigger = yes
					relation_with_character_is_sodomy_in_faith_trigger = {
						CHARACTER = scope:crush
						FAITH = root.faith
					}
				}
				has_trait = zealous
			}
			modifier = {
				factor = 0
				might_cheat_on_every_partner_trigger = no
			}
			#AGOT Disabled, cannot be below factor 0
			#ai_value_modifier = {
			#	ai_boldness = 0.5
			#	ai_sociability = 0.5
			#}
		}
	}
	#A childish infatuation, only this, and nothing more.
	option = {
		name = bp2_yearly.8040.b
		ai_chance = {
			#AGOT Modified, prevent multiple ai chance 0 options
			#base = 100
			base = 101
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
		}
	}
	#We were MEANT to be together!
	option = {
		name = bp2_yearly.8040.c
		trigger = {
			has_trait = impatient
			can_marry_character_trigger = {
				CHARACTER = scope:crush
			}
			scope:crush = {
				can_marry_character_trigger = {
					CHARACTER = root
				}
				OR = {
					# I'm a player and I make my own choices
					is_ai = no
					# I'm not beholden to any players
					NOT = {
						any_close_or_extended_family_member = { is_ai = no }
					}
				}
			}
		}
		set_variable = {
			name = bp2_yearly_8040_marriage
			years = 3
		}
		hidden_effect = {
			scope:crush = {
				trigger_event = {
					id = bp2_yearly.8041
					days = 2
				}
			}
		}
		show_as_tooltip = {
			random_list = {
				50 = {
					show_chance = no
					desc = bp2_yearly.8040.if_accepts
					bp2_yearly_8040_marriage_effect = yes
				}
			}
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					would_be_sinful_adulterer_trigger = yes
					relation_with_character_is_sodomy_in_faith_trigger = {
						CHARACTER = scope:crush
						FAITH = root.faith
					}
				}
				has_trait = zealous
			}
			modifier = {
				factor = 0
				might_cheat_on_every_partner_trigger = no
			}
			ai_value_modifier = {
				ai_boldness = 2
				ai_sociability = 0.5
			}
		}
	}
}

# Crush is given your offer of lurve
bp2_yearly.8041 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8041.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:crushee.location = root.location
				}
				desc = bp2_yearly.8041.desc.intro.same_location
			}
			desc = bp2_yearly.8041.desc.intro.different_location
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:crushee.location = root.location
					scope:crushee = { has_variable = bp2_yearly_8040_marriage }
				}
				desc = bp2_yearly.8041.desc.mid.same_location_marriage
			}
			triggered_desc = {
				trigger = {
					NOT = { scope:crushee.location = root.location }
					scope:crushee = { has_variable = bp2_yearly_8040_marriage }
				}
				desc = bp2_yearly.8041.desc.mid.different_location_marriage
			}
			triggered_desc = {
				trigger = {
					scope:crushee.location = root.location
				}
				desc = bp2_yearly.8041.desc.mid.same_location_lovers
			}
			triggered_desc = {
				trigger = {
					NOT = { scope:crushee.location = root.location }
				}
				desc = bp2_yearly.8041.desc.mid.different_location_lovers
			}
		}
	}
	theme = love
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:crushee
		animation = flirtation
	}
	#Yes! Yes! A thousand times, yes!
	option = {
		name = bp2_yearly.8041.a
		if = {
			limit = {
				scope:crushee = {
					has_variable = bp2_yearly_8040_marriage
				}
			}
			show_as_tooltip = {
				bp2_yearly_8040_marriage_effect = yes
			}
		}
		else = {
			show_as_tooltip = {
				scope:crushee = {
					set_relation_lover = {
						target = scope:crush
						copy_reason = crush
					}
				}
			}
		}
		hidden_effect = {
			scope:crushee = {
				trigger_event = {
					id = bp2_yearly.8042
					days = 2
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				opinion = {
					target = root
					value >= high_positive_opinion
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value >= low_positive_trait_compatibility
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value >= medium_positive_trait_compatibility
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value >= high_positive_trait_compatibility
				}
			}
			modifier = {
				factor = 0
				OR = {
					would_be_sinful_adulterer_trigger = yes
					relation_with_character_is_sodomy_in_faith_trigger = {
						CHARACTER = scope:crushee
						FAITH = root.faith
					}
				}
				has_trait = zealous
			}
			modifier = {
				factor = 0
				might_cheat_on_every_partner_trigger = no
			}
		}
	}
	#Like eww
	option = {
		name = bp2_yearly.8041.b
		custom_tooltip = {
			text = bp2_yearly_8042_rejection
			scope:crushee = {
				trigger_event ={
					id = bp2_yearly.8043
					days = 2
				}
			}
		}
		ai_chance = {
			base = 10
			modifier = {
				add = 10
				opinion = {
					target = root
					value <= 0
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value <= low_negative_trait_compatibility
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value <= medium_negative_trait_compatibility
				}
			}
			modifier = {
				add = 10
				trait_compatibility = {
					target = root
					value <= high_negative_trait_compatibility
				}
			}
		}
	}
}

# Crushee informed of new lover relationship
bp2_yearly.8042 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8042.t
	desc = {
		desc = bp2_yearly.8042.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:crush.location = root.location
				}
				desc = bp2_yearly.8042.desc.mid.same_location
			}
			desc = bp2_yearly.8042.desc.mid.different_location
		}
		desc = bp2_yearly.8042.desc.outro
	}
	theme = love
	left_portrait = {
		character = root
		animation = flirtation_left
	}
	right_portrait = {
		character = scope:crush
		animation = flirtation
	}
	#Nice
	option = {
		name = bp2_yearly.8042.a
		if = {
			limit = {
				has_variable = bp2_yearly_8040_marriage
			}
			bp2_yearly_8040_marriage_effect = yes
		}
		else = {
			set_relation_lover = {
				target = scope:crush
				copy_reason = crush
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

# Crushee informed of rejection
bp2_yearly.8043 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8043.t
	desc = bp2_yearly.8043.desc
	theme = love
	left_portrait = {
		character = root
		animation = shame
	}
	right_portrait = {
		character = scope:crush
		animation = eyeroll
	}
	#Maybe I need to try harder
	option = {
		name = bp2_yearly.8043.a
		trigger = {
			scope:crush = { is_ai = yes }
		}
		if = {
			limit = {
				has_variable = bp2_yearly_8040_marriage
			}
			start_scheme = {
				type = courting
				target = scope:crush
			}
			custom_tooltip = learn_language_with_bonus_tt
			hidden_effect = {
				random_scheme = {
					limit = {
						scheme_type = courting
						scheme_target = scope:crush
					}
					add_scheme_modifier = { type = crush_bonus }
				}
			}
		}
		else = {
			start_scheme = {
				type = seduce
				target = scope:crush
			}
			custom_tooltip = learn_language_with_bonus_tt
			hidden_effect = {
				random_scheme = {
					limit = {
						scheme_type = seduce
						scheme_target = scope:crush
					}
					add_scheme_modifier = { type = crush_bonus }
				}
			}
		}
		stress_impact = {
			compassionate = minor_stress_impact_gain
			trusting = minor_stress_impact_gain
			gallant = minor_stress_impact_gain
			chaste = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				# Good people respect when someone says no
				ai_compassion = 1
				ai_honor = 1
				ai_energy = -0.5
			}
		}
	}
	#Alas, t'was not meant to be
	option = {
		name = bp2_yearly.8043.b
		stress_impact = {
			arrogant = minor_stress_impact_gain
			lustful = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_honor = -1
				ai_energy = 0.5
			}
		}
	}
}

##################################################
# Hostage identity crisis story cycle
# by James Beaumont
# 8050-8065
##################################################

#Fired from: on_character_faith_change, on_character_culture_change, on_set_relation_friend or on_set_relation_rival

bp2_yearly.8050 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8050.t
	desc = {
		desc = bp2_yearly.8050.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					has_relation_friend = scope:hostage
				}
				desc = bp2_yearly.8050.desc.mid.friendship
			}
			triggered_desc = {
				trigger = {
					any_child = {
						has_relation_friend = scope:hostage
					}
				}
				desc = bp2_yearly.8050.desc.mid.childhood_friendship
			}
			triggered_desc = {
				trigger = {
					scope:hostage = {
						OR = {
							has_relation_rival = father
							has_relation_rival = mother
						}
					}
				}
				desc = bp2_yearly.8050.desc.mid.hatred
			}
			triggered_desc = {
				trigger = {
					OR = {
						AND = {
							# Is the father the dominant marriage partner?
							scope:hostage.father = { matrilinear_marriage = no }
							scope:hostage = { NOT = { culture = father.culture } }
							culture = scope:hostage.culture
						}
						AND = {
							scope:hostage.mother = { matrilinear_marriage = yes }
							scope:hostage = { NOT = { culture = mother.culture } }
							culture = scope:hostage.culture
						}
					}
				}
				desc = bp2_yearly.8050.desc.mid.culture
			}
			triggered_desc = {
				trigger = {
					OR = {
						AND = {
							scope:hostage.father = { matrilinear_marriage = no }
							scope:hostage = { NOT = { faith = father.faith } }
							faith = scope:hostage.faith
						}
						AND = {
							scope:hostage.mother = { matrilinear_marriage = yes }
							scope:hostage = { NOT = { faith = mother.faith } }
							faith = scope:hostage.faith
						}
					}
				}
				desc = bp2_yearly.8050.desc.mid.faith
			}
			triggered_desc = {
				trigger = {
					number_of_personality_traits_in_common = {
						target = scope:hostage
						value >= 1
					}
				}
				desc = bp2_yearly.8050.desc.mid.traits
			}
		}
		desc = bp2_yearly.8050.desc.outro
	}
	theme = hostage
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	# Don't do this every time you have a hostage
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		scope:hostage = { child_not_infant_trigger = yes }
	}
	immediate = {
		# Grab some people for loc purposes
		if = {
			limit = {
				any_child = {
					has_relation_friend = scope:hostage
				}
			}
			random_child = {
				limit = {
					has_relation_friend = scope:hostage
				}
				save_scope_as = hostage_friend
			}
		}
		if = {
			limit = {
				scope:hostage = {
					exists = father
					has_relation_rival = father
				}
			}
			scope:hostage.father = { save_scope_as = hated_parent }
		}
		else_if = {
			limit = {
				scope:hostage = {
					exists = mother
					has_relation_rival = mother
				}
			}
			scope:hostage.mother = { save_scope_as = hated_parent }
		}
		else_if = {
			limit = {
				exists = scope:hostage.father
				scope:hostage.father = { matrilinear_marriage = no }
				scope:hostage = { NOT = { culture = father.culture } }
				culture = scope:hostage.culture
			}
			scope:hostage.father = { save_scope_as = hated_parent }
		}
		else_if = {
			limit = {
				exists = scope:hostage.mother
				scope:hostage.mother = { matrilinear_marriage = yes }
				scope:hostage = { NOT = { culture = mother.culture } }
				culture = scope:hostage.culture
			}
			scope:hostage.mother = { save_scope_as = hated_parent }
		}
		else_if = {
			limit = {
				exists = scope:hostage.father
				scope:hostage.father = { matrilinear_marriage = no }
				scope:hostage = { NOT = { faith = father.faith } }
				faith = scope:hostage.faith
			}
			scope:hostage.father = { save_scope_as = hated_parent }
		}
		else_if = {
			limit = {
				exists = scope:hostage.mother
				scope:hostage.mother = { matrilinear_marriage = yes }
				scope:hostage = { NOT = { faith = mother.faith } }
				faith = scope:hostage.faith
			}
			scope:hostage.mother = { save_scope_as = hated_parent }
		}
	}
	#Yes, you are my nephew of course
	option = {
		name = bp2_yearly.8050.a
		custom_tooltip = {
			text = bp2_start_loyalty_story_cycle
			create_story = {
				type = bp2_hostage_loyalty
			}
			random_owned_story = {
				limit = {
					story_type = bp2_hostage_loyalty
				}
				set_variable = {
					name = hostage_target
					value = scope:hostage
				}
				set_variable = {
					name = theon_points
					value = 0
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = 0.5
			}
		}
	}
	#You are not of *my* great dynasty
	option = {
		name = bp2_yearly.8050.b
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = -0.5
				ai_sociability = -0.5
			}
		}
	}
}

# Hostage confesses to spying on you
bp2_yearly.8051 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8051.t
	desc = bp2_yearly.8051.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:hostage
		animation = shame
	}
	cooldown = { years = 10 }
	trigger = {
		has_bp2_dlc_trigger = yes
		scope:hostage = {
			OR = {
				ai_boldness > ai_honor
				ai_vengefulness > ai_honor
			}
		}
	}
	#I forgive you
	option = {
		name = bp2_yearly.8051.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		scope:hostage = {
			add_opinion = {
				modifier = merciful_opinion
				target = root
			}
		}
		add_character_modifier = {
			modifier = bp2_security_compromised
			years = 10
		}
		stress_impact = {
			vengeful = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_compassion = 0.5
				ai_vengefulness = -1
			}
		}
	}
	#You will not be allowed to write your parents ever again
	option = {
		name = bp2_yearly.8051.b
		reverse_add_opinion = {
			modifier = angry_opinion
			target = scope:hostage
			opinion = -35
		}
		stress_impact = {
			forgiving = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
			}
		}
	}
	#Get in my prison, you brat
	option = {
		name = bp2_yearly.8051.c
		trigger = {
			has_trait = vengeful
		}
		custom_tooltip = invalidates_hostage_tt
		rightfully_imprison_character_effect = {
			TARGET = scope:hostage
			IMPRISONER = root
		}
		stress_impact = {
			vengeful = minor_stress_impact_loss
			wrathful = minor_stress_impact_loss
			forgiving = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 2
			}
		}
	}
}

# Your biological children are mistreating the hostage
bp2_yearly.8052 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8052.t
	desc = bp2_yearly.8052.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = anger
	}
	right_portrait = {
		character = scope:hostage
		animation = sadness
	}
	lower_right_portrait = {
		character = scope:mean_child
	}
	cooldown = { years = 5 }
	override_background = { reference = bp2_courtyard }
	trigger = {
		has_bp2_dlc_trigger = yes
		any_child = {
			ai_vengefulness > ai_compassion
			child_not_infant_trigger = yes
			OR = {
				trait_compatibility = {
					target = scope:hostage
					value <= medium_positive_trait_compatibility
				}
				# Rather confusingly, this checks if the Hostage is a victim of the child
				has_relation_victim = scope:hostage
				opinion = {
					target = scope:hostage
					value <= 0
				}
			}
		}
	}
	immediate = {
		random_child = {
			limit = {
				ai_vengefulness > ai_compassion
				child_not_infant_trigger = yes
				OR = {
					trait_compatibility = {
						target = scope:hostage
						value <= medium_positive_trait_compatibility
					}
					# Rather confusingly, this checks if the Hostage is a victim of the child
					has_relation_victim = scope:hostage
					opinion = {
						target = scope:hostage
						value <= 0
					}
				}
			}
			save_scope_as = mean_child
		}
	}
	#Stop being mean
	option = {
		name = bp2_yearly.8052.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:mean_child
			REASON = rival_chastised_child
			OPINION = default_rival_opinion
		}
		stress_impact = {
			vengeful = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_compassion = 0.5
				ai_vengefulness = -1
			}
		}
	}
	#Stop being a baby and fight back
	option = {
		name = bp2_yearly.8052.b
		scope:hostage = {
			duel = {
				skill = prowess
				target = scope:mean_child
				# Success.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = 3.5
						min = -49
					}
					send_interface_toast = {
						left_icon = root
						right_icon = scope:hostage
						title = bp2_yearly.8052.b.success
						custom_tooltip = {
							text = bp2_make_hostage_more_loyal
							scope:hostage_story = {
								change_variable = {
									name = theon_points
									add = 1
								}
							}
						}
					}
				}
				# Failure.
				50 = {
					compare_modifier = {
						value = scope:duel_value
						multiplier = -3.5
						min = -49
					}
					send_interface_toast = {
						left_icon = root
						right_icon = scope:hostage
						title = bp2_yearly.8052.b.failure
						custom_tooltip = {
							text = bp2_make_hostage_less_loyal
							scope:hostage_story = {
								change_variable = {
									name = theon_points
									add = -2
								}
							}
						}
					}
				}
			}
		}
		stress_impact = {
			arrogant = minor_stress_impact_gain
			family_first = major_stress_impact_gain
			eccentric = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 0.5
				ai_rationality = -1
				ai_compassion = -1
			}
		}
	}
	#It has nothing to do with me
	option = {
		name = bp2_yearly.8052.c
		stress_impact = {
			compassionate = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = -1
				ai_compassion = -1
			}
		}
	}
}

# Your hostage shouts your house motto while playing
bp2_yearly.8053 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8053.t
	desc = bp2_yearly.8053.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:hostage
		animation = ecstasy
	}
	cooldown = { years = 5 }
	override_background = { reference = bp2_courtyard }
	weight_multiplier = {
		base = 1
		modifier = {
			factor = 0.1
			scope:hostage = { # Shouldn't be *impossible* for non-martial genders to want to play soldier, but less likely
				NOT = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = root } }
			}
		}
	}
	#What an excellent development
	option = {
		name = bp2_yearly.8053.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_loss }
		stress_impact = {
			wrathful = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_vengefulness = -1
			}
		}
	}
	#That is OUR motto, not yours
	option = {
		name = bp2_yearly.8053.b
		custom_tooltip = {
			text = bp2_make_hostage_less_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = -2
				}
			}
		}
		dynasty = { add_dynasty_prestige = minor_dynasty_prestige_gain }
		stress_impact = {
			arrogant = minor_stress_impact_loss
			family_first = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 0.5
				ai_rationality = -1
				ai_compassion = -1
			}
		}
	}
}

# Hostage asks for a story about your ancestors
bp2_yearly.8054 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8054.t
	desc = bp2_yearly.8054.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = thinking
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	cooldown = { years = 5 }
	override_background = { reference = study }
	#A story of my ancestors ye shall have
	option = {
		name = bp2_yearly.8054.a
		trigger = {
			NOT = { house.house_founder = root }
		}
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.5
				ai_rationality = 1
			}
		}
	}
	#May I impress you with a story about me instead?
	option = {
		name = bp2_yearly.8054.b
		duel = {
			skill = diplomacy
			target = scope:hostage
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:hostage
					title = bp2_yearly.8054.b.success
					custom_tooltip = {
						text = bp2_make_hostage_more_loyal
						scope:hostage_story = {
							change_variable = {
								name = theon_points
								add = 1
							}
						}
					}
					progress_towards_friend_effect = {
						CHARACTER = scope:hostage
						REASON = friend_good_story
						OPINION = default_friend_opinion
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:hostage
					title = bp2_yearly.8054.b.failure
					custom_tooltip = {
						text = bp2_make_hostage_less_loyal
						scope:hostage_story = {
							change_variable = {
								name = theon_points
								add = -1
							}
						}
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_honor = -0.5
				ai_rationality = -0.5
			}
		}
	}
	#Did I ever tell you I killed a dragon?
	option = {
		name = bp2_yearly.8054.c
		trigger = {
			has_trait = eccentric
			NOT = { has_trait = honest }
		}
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:hostage
			REASON = friend_good_story
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 1
				ai_honor = -0.5
				ai_rationality = -2
			}
		}
	}
}

# Low compatibility, hostage kinda hates you
bp2_yearly.8055 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8055.t
	desc = bp2_yearly.8055.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:hostage
		animation = anger
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		trait_compatibility = {
			target = scope:hostage
			value <= low_negative_trait_compatibility
		}
		NOT = {
			has_relation_friend = scope:hostage
		}
	}
	#I-I can change!
	option = {
		name = bp2_yearly.8055.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:hostage
			opinion = 25
		}
		add_character_modifier = {
			modifier = changing_habits
			years = 10
		}
		stress_impact = {
			base = minor_stress_impact_gain
			lazy = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			impatient = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
			patient = minor_stress_impact_loss
			fickle = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 0.5
				ai_honor = 0.5
				ai_rationality = 1
			}
		}
	}
	#I don't live to impress impudent brats like you
	option = {
		name = bp2_yearly.8055.b
		stress_impact = {
			fickle = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_vengefulness = 0.5
				ai_honor = -0.5
				ai_rationality = -0.5
			}
		}
	}
	#Why don't *you* try changing
	option = {
		name = bp2_yearly.8055.c
		trigger = {
			has_trait = stubborn
		}
		duel = {
			skill = diplomacy
			target = scope:hostage
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:hostage
					title = bp2_yearly.8055.c.success
					custom_tooltip = {
						text = bp2_make_hostage_more_loyal
						scope:hostage_story = {
							change_variable = {
								name = theon_points
								add = 1
							}
						}
					}
					scope:hostage = {
						reverse_add_opinion = {
							modifier = grateful_opinion
							target = scope:hostage
							opinion = 25
						}
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:hostage
					title = bp2_yearly.8055.c.failure
					custom_tooltip = {
						text = bp2_make_hostage_less_loyal
						scope:hostage_story = {
							change_variable = {
								name = theon_points
								add = -1
							}
						}
					}
				}
			}
		}
		stress_impact = {
			fickle = minor_stress_impact_gain
			patient = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 2
				ai_honor = -0.5
				ai_rationality = -0.5
			}
		}
	}
}

# High compatibility, hostage just likes you :D
bp2_yearly.8056 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8056.t
	desc = bp2_yearly.8056.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		trait_compatibility = {
			target = scope:hostage
			value >= high_positive_trait_compatibility
		}
		NOT = { has_relation_rival = scope:hostage }
	}
	#Lovely
	option = {
		name = bp2_yearly.8056.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:hostage
			opinion = 25
		}
		ai_chance = {
			base = 1
		}
	}
	#You're the only one that *gets* me
	option = {
		name = bp2_yearly.8056.b
		trigger = {
			has_trait = eccentric
		}
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 2
				}
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:hostage
			REASON = friend_deep_understanding
			OPINION = default_friend_opinion
		}
		stress_impact = {
			eccentric = minor_stress_impact_loss
		}
		ai_chance = {
			base = 1000
		}
	}
}

# Your kid gets along with the hostage
bp2_yearly.8057 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8057.t
	desc = bp2_yearly.8057.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	lower_right_portrait = {
		character = scope:nice_child
	}
	cooldown = { years = 5 }
	override_background = { reference = bp2_courtyard }
	trigger = {
		has_bp2_dlc_trigger = yes
		any_child = {
			is_ai = yes
			child_not_infant_trigger = yes
			OR = {
				trait_compatibility = {
					target = scope:hostage
					value <= medium_positive_trait_compatibility
				}
				opinion = {
					target = scope:hostage
					value >= high_positive_opinion
				}
			}
			# It should be somewhat novel to see these kids getting along
			NOT = { has_relation_friend = scope:hostage }
			NOT = { has_relation_rival = scope:hostage }
		}
	}
	immediate = {
		random_child = {
			limit = {
				is_ai = yes
				child_not_infant_trigger = yes
				OR = {
					trait_compatibility = {
						target = scope:hostage
						value <= medium_positive_trait_compatibility
					}
					opinion = {
						target = scope:hostage
						value >= high_positive_opinion
					}
				}
				NOT = { has_relation_friend = scope:hostage }
				NOT = { has_relation_rival = scope:hostage }
			}
			save_scope_as = nice_child
		}
	}
	#Love that for you king
	option = {
		name = bp2_yearly.8057.a
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 1
				}
			}
		}
		ai_chance = {
			base = 100
		}
	}
	#I think I see a budding companionship!
	option = {
		name = bp2_yearly.8057.b
		trigger = {
			has_trait = trusting
		}
		custom_tooltip = {
			text = bp2_make_hostage_more_loyal
			scope:hostage_story = {
				change_variable = {
					name = theon_points
					add = 2
				}
			}
		}
		scope:hostage = {
			set_relation_friend = {
				target = scope:nice_child
				reason = friend_played_together
			}
		}
		stress_impact = {
			shy = minor_stress_impact_loss
			trusting = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
		}
	}
}

# Positive hostage outcome, hostage calls you dad/mum
bp2_yearly.8060 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8060.t
	desc = bp2_yearly.8060.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	cooldown = { years = 5 }
	immediate = {
		root = { save_scope_as = new_parent }
		save_scope_as = warden
		scope:hostage.home_court = { save_scope_as = home_court }
	}
	# Yes, I *am* your mummy ^_^
	option = {
		name = bp2_yearly.8060.a
		hidden_effect = {
			if = {
				limit = {
					scope:hostage.house = scope:hostage.father.house
				}
				scope:hostage.father = {
					trigger_event = {
						id = bp2_yearly.8065
						days = 3
					}
				}
			}
			if = {
				limit = {
					scope:hostage.house = scope:hostage.mother.house
				}
				scope:hostage.mother = {
					trigger_event = {
						id = bp2_yearly.8065
						days = 3
					}
				}
			}
		}
		adopt = scope:hostage
		scope:hostage = { set_house = root.house }
		trigger_event = bp2_hostage_system.0400
		dynasty = { add_dynasty_prestige = medium_dynasty_prestige_gain }
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_boldness = 1
				ai_vengefulness = -0.5
				ai_honor = -0.5
				ai_rationality = -1 # Upsetting the hostage's "real" parents is not a rational thing to do
			}
		}
	}
	# You're my child, but you won't inherit
	option = {
		name = bp2_yearly.8060.b
		hidden_effect = {
			if = {
				limit = {
					scope:hostage.house = scope:hostage.father.house
				}
				scope:hostage.father = {
					trigger_event = {
						id = bp2_yearly.8065
						days = 3
					}
				}
			}
			if = {
				limit = {
					scope:hostage.house = scope:hostage.mother.house
				}
				scope:hostage.mother = {
					trigger_event = {
						id = bp2_yearly.8065
						days = 3
					}
				}
			}
		}
		adopt = scope:hostage
		scope:hostage = { set_house = root.house }
		scope:hostage = { add_trait = disinherited }
		dynasty = { add_dynasty_prestige = medium_dynasty_prestige_gain }
		trigger_event = bp2_hostage_system.0400
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = 1
				ai_boldness = 1
				ai_vengefulness = -0.5
				ai_honor = -0.5
				ai_rationality = -1 # Upsetting the hostage's "real" parents is not a rational thing to do
			}
		}
	}
	# No no, I am just your auntie
	option = {
		name = bp2_yearly.8060.c
		add_hook = {
			type = hostage_loyalty
			target = scope:hostage
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_honor = 1
				ai_boldness = -0.5
			}
		}
	}
}

# Positive hostage outcome, hostage loves you :D
bp2_yearly.8061 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8061.t
	desc = bp2_yearly.8061.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:hostage
		animation = admiration
	}
	cooldown = { years = 5 }
	# Love that for me
	option = {
		name = bp2_yearly.8061.a
		if = {
			limit = {
				can_add_hook = {
					type = hostage_loyalty
					target = scope:hostage
				}
			}
			add_hook = {
				type = hostage_loyalty
				target = scope:hostage
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

# Negative hostage outcome, they hate your guts and everything you stand for
bp2_yearly.8063 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8063.t
	desc = bp2_yearly.8063.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = shock
	}
	right_portrait = {
		character = scope:hostage
		animation = anger
	}
	cooldown = { years = 5 }
	# Hate that for me
	option = {
		name = bp2_yearly.8063.a
		scope:hostage = {
			set_relation_rival = {
				target = root
				reason = rival_manipulated_me
			}
		}
		ai_chance = {
			base = 100
		}
	}
}

# Hostage's "real" parents react to you adopting their kid
bp2_yearly.8065 = {
	type = letter_event
	opening = bp2_yearly.8065.t
	desc = bp2_yearly.8065.desc
	sender = scope:hostage
	# gfdi
	option = {
		name = bp2_yearly.8065.a
		show_as_tooltip = {
			scope:new_parent = { adopt = scope:hostage }
		}
		dynasty = { add_dynasty_prestige = medium_dynasty_prestige_loss }
	}
}

##################################################
# You're a kid and you get super into playing with a certain toy
# by James Beaumont
# 8070-8071
##################################################
bp2_yearly.8070 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8070.t
	desc = {
		desc = bp2_yearly.8070.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = var:into_horses
				}
				desc = bp2_yearly.8070.desc.mid.horses
			}
			triggered_desc = {
				trigger = {
					exists = var:into_puppets
				}
				desc = bp2_yearly.8070.desc.mid.puppets
			}
			triggered_desc = {
				trigger = {
					exists = var:into_board_games
				}
				desc = bp2_yearly.8070.desc.mid.board_game
			}
			triggered_desc = {
				trigger = {
					exists = var:into_spinning_tops
				}
				desc = bp2_yearly.8070.desc.mid.teetotum
			}
			triggered_desc = {
				trigger = {
					exists = var:into_marbles
				}
				desc = bp2_yearly.8070.desc.mid.marbles
			}
		}
		desc = bp2_yearly.8070.desc.outro
	}
	theme = friendly
	override_background = { reference = relaxing_room }

	left_portrait = {
		character = root
		triggered_animation = {
			trigger = { exists = var:into_horses }
			animation = child_hobby_horse
		}
		animation = ecstasy
	}
	right_portrait = {
		character = scope:other_child
		animation = admiration
	}
	# Only once per childhood tack sa mycket
	cooldown = { years = 16 }
	trigger = {
		has_bp2_dlc_trigger = yes
		child_not_infant_trigger = yes
		age < 16
		is_available = yes
		location.county.holder = {
			any_courtier_or_guest = {
				child_not_infant_trigger = yes
				age < 16
				is_available_ai_child = yes
			}
		}
	}
	immediate = {
		hidden_effect = { # Determine your favourite toy
			random_list = {
				20 = {
					modifier = {
						add = martial
					}
					modifier = {
						has_trait = rowdy
						add = 10
					}
					set_variable = {
						name = into_horses
						weeks = 2
					}
				}
				20 = {
					modifier = {
						add = intrigue
					}
					modifier = {
						has_trait = bossy
						add = 10
					}
					set_variable = {
						name = into_puppets
						weeks = 2
					}
				}
				20 = {
					modifier = {
						add = learning
					}
					modifier = {
						has_trait = pensive
						add = 10
					}
					set_variable = {
						name = into_board_games
						weeks = 2
					}
				}
				20 = {
					modifier = {
						add = stewardship
					}
					modifier = {
						has_trait = curious
						add = 10
					}
					set_variable = {
						name = into_spinning_tops
						weeks = 2
					}
				}
				20 = {
					modifier = {
						add = diplomacy
					}
					modifier = {
						has_trait = charming
						add = 10
					}
					set_variable = {
						name = into_marbles
						weeks = 2
					}
				}
			}
			location.county.holder = {
				random_courtier_or_guest = {
					limit = {
						child_not_infant_trigger = yes
						age < 16
						is_ai = yes
					}
					weight = {
						base = 1
						modifier = {
							add = 10
							is_of_major_interest_to_root_trigger = yes
						}
						modifier = {
							add = 5
							is_of_minor_interest_to_root_trigger = yes
						}
					}
					save_scope_as = other_child
				}
			}
		}
	}
	# I'd like to play alone
	option = {
		name = bp2_yearly.8070.a
		if = {
			limit = {
				exists = var:into_horses
			}
			create_character_memory = {
				type = favourite_toy_horse
				participants = {
					other_child = root
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_puppets
			}
			create_character_memory = {
				type = favourite_toy_puppet
				participants = {
					other_child = root
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_board_games
			}
			create_character_memory = {
				type = favourite_toy_board_game
				participants = {
					other_child = root
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_spinning_tops
			}
			create_character_memory = {
				type = favourite_toy_spinning_top
				participants = {
					other_child = root
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_marbles
			}
			create_character_memory = {
				type = favourite_toy_marbles
				participants = {
					other_child = root
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			pensive = medium_stress_impact_loss
			shy = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = -1
			}
		}
	}
	# I'll play against other child
	option = {
		name = bp2_yearly.8070.b
		if = {
			limit = {
				exists = var:into_horses
			}
			create_character_memory = {
				type = favourite_toy_horse
				participants = {
					other_child = scope:other_child
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_puppets
			}
			create_character_memory = {
				type = favourite_toy_puppet
				participants = {
					other_child = scope:other_child
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_board_games
			}
			create_character_memory = {
				type = favourite_toy_board_game
				participants = {
					other_child = scope:other_child
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_spinning_tops
			}
			create_character_memory = {
				type = favourite_toy_spinning_top
				participants = {
					other_child = scope:other_child
				}
			}
		}
		else_if = {
			limit = {
				exists = var:into_marbles
			}
			create_character_memory = {
				type = favourite_toy_marbles
				participants = {
					other_child = scope:other_child
				}
			}
		}
		duel = {
			skill = diplomacy
			value = medium_skill_rating
			# Success.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = 3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:other_child
					title = bp2_yearly.8070.b.success
					progress_towards_friend_effect = {
						CHARACTER = scope:other_child
						REASON = friend_played_together
						OPINION = default_friend_opinion
					}
				}
			}
			# Failure.
			50 = {
				compare_modifier = {
					value = scope:duel_value
					multiplier = -3.5
					min = -49
				}
				send_interface_toast = {
					left_icon = root
					right_icon = scope:other_child
					title = bp2_yearly.8070.b.failure
					reverse_add_opinion = {
						modifier = angry_opinion
						target = scope:other_child
						opinion = -15
					}
				}
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			pensive = medium_stress_impact_gain
			shy = medium_stress_impact_gain
			charming = medium_stress_impact_loss
			curious = medium_stress_impact_loss
			gregarious = medium_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_boldness = 0.5
				ai_sociability = 1
			}
		}
	}
}

# Adulthood follow-up, take up your old hobby?
bp2_yearly.8071 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8071.t
	desc = {
		desc = bp2_yearly.8071.desc.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						has_memory_type = favourite_toy_horse
					}
				}
				desc = bp2_yearly.8071.desc.mid.horses
			}
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						has_memory_type = favourite_toy_puppet
					}
				}
				desc = bp2_yearly.8071.desc.mid.puppets
			}
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						has_memory_type = favourite_toy_board_game
					}
				}
				desc = bp2_yearly.8071.desc.mid.board_games
			}
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						has_memory_type = favourite_toy_spinning_top
					}
				}
				desc = bp2_yearly.8071.desc.mid.spinning_top
			}
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						has_memory_type = favourite_toy_marbles
					}
				}
				desc = bp2_yearly.8071.desc.mid.marbles
			}
		}
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						NOT = { memory_participant:other_child = root }
						memory_participant:other_child = { is_alive = yes }
					}
				}
				desc = bp2_yearly.8071.desc.mid.other_child_alive
			}
			triggered_desc = {
				trigger = {
					scope:toy_memory = {
						NOT = { memory_participant:other_child = root }
						memory_participant:other_child = { is_alive = no }
					}
				}
				desc = bp2_yearly.8071.desc.mid.other_child_dead
			}
		}
		desc = bp2_yearly.8071.desc.outro
	}
	theme = friendly
	left_portrait = {
		character = root
		animation = thinking
	}
	lower_right_portrait = {
		trigger = {
			scope:toy_memory = {
				NOT = { memory_participant:other_child = root }
			}
		}
		character = scope:other_child
	}
	# Should only fire once, but just in case
	cooldown = { years = 10 }
	trigger = {
		has_bp2_dlc_trigger = yes
		any_memory = {
			OR = {
				has_memory_type = favourite_toy_horse
				has_memory_type = favourite_toy_puppet
				has_memory_type = favourite_toy_board_game
				has_memory_type = favourite_toy_spinning_top
				has_memory_type = favourite_toy_marbles
			}
			NOT = {
				exists = var:bp2_yearly_8071
			}
		}
		is_available_adult = yes
	}
	immediate = {
		hidden_effect = {
			random_memory = {
				limit = {
					OR = {
						has_memory_type = favourite_toy_horse
						has_memory_type = favourite_toy_puppet
						has_memory_type = favourite_toy_board_game
						has_memory_type = favourite_toy_spinning_top
						has_memory_type = favourite_toy_marbles
					}
					NOT = {
						exists = var:bp2_yearly_8071
					}
				}
				set_variable = {
					name = bp2_yearly_8071
				}
				memory_participant:other_child = { save_scope_as = other_child }
				save_scope_as = toy_memory
			}
		}
	}
	# I should pick this up again
	option = {
		name = {
			trigger = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_puppet
				}
			}
			text = bp2_yearly.8071.a.puppet
		}
		name = {
			trigger = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_spinning_top
				}
			}
			text = bp2_yearly.8071.a.gambler
		}
		name = {
			trigger = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_marbles
				}
			}
			text = bp2_yearly.8071.a.marbles
		}
		name = bp2_yearly.8071.a
		if = {
			limit = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_horse
				}
			}
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
					trait = tourney_participant
					track = horse
					value = tournament_hastiludes_xp_gain_minor_value
				}
			}
			else = {
				add_trait = tourney_participant
				add_trait_xp = {
					trait = tourney_participant
					track = horse
					value = tournament_hastiludes_xp_gain_minor_value
				}
			}
		}
		else_if = {
			limit = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_puppet
				}
			}
			add_intrigue_lifestyle_perk_points = 1
		}
		else_if = {
			limit = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_board_game
				}
			}
			if = {
				limit = {
					has_trait = tourney_participant
				}
				add_trait_xp = {
					trait = tourney_participant
					track = wit
					value = tournament_hastiludes_xp_gain_minor_value
				}
			}
			else = {
				add_trait = tourney_participant
				add_trait_xp = {
					trait = tourney_participant
					track = wit
					value = tournament_hastiludes_xp_gain_minor_value
				}
			}
		}
		else_if = {
			limit = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_spinning_top
				}
			}
			add_stewardship_lifestyle_perk_points = 1
		}
		else_if = {
			limit = {
				scope:toy_memory = {
					has_memory_type = favourite_toy_marbles
				}
			}
			add_diplomacy_lifestyle_perk_points = 1
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
			}
		}
	}
	# I should try to reconnect with my friend!
	option = {
		name = bp2_yearly.8071.b
		trigger = {
			scope:toy_memory = {
				NOT = { memory_participant:other_child = root }
				memory_participant:other_child = { is_alive = yes }
				memory_participant:other_child = { is_ai = yes }
				memory_participant:other_child = {
					NOT = {
						has_relation_friend = root
						has_relation_rival = root
					}
				}
			}
		}
		progress_towards_friend_effect = {
			CHARACTER = scope:toy_memory.memory_participant:other_child
			REASON = friend_reconnected_childhood
			OPINION = default_friend_opinion
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	# I've moved on. We’re all different people all through our lives, and that’s okay.
	option = {
		name = bp2_yearly.8071.c
		add_character_modifier = {
			modifier = building_new_skills
			years = 10
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				# Negative rationality and positive compassion used here to represent sentimentality
				ai_rationality = 1
				ai_compassion = -0.5
			}
		}
	}
}

##################################################
# Use your ward in a romance/seduction scheme
# by James Beaumont
# 8080
##################################################
bp2_yearly.8080 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8080.t
	desc = bp2_yearly.8080.desc
	theme = romance_scheme
	left_portrait = {
		character = root
		animation = thinking
	}
	lower_left_portrait = {
		character = scope:ward
	}
	right_portrait = {
		character = scope:target
		animation = admiration
	}
	cooldown = { years = 10 }
	trigger = {
		has_bp2_dlc_trigger = yes
		NOT = { has_variable = scheme_event_active_flag }
		any_relation = {
			type = ward
			is_available_ai_child = yes
			child_not_teen_trigger = yes # Teens feel weird for this one
		}
	}
	immediate = {
		set_variable = scheme_event_active_flag
		random_relation = {
			type = ward
			limit = {
				is_available_ai_child = yes
				child_not_teen_trigger = yes
			}
			save_scope_as = ward
		}
	}
	# Come here child, impress my scheme target
	option = {
		name = bp2_yearly.8080.a
		random_list = {
			50 = {
				modifier = {
					add = ai_compassion
				}
				modifier = {
					add = 25
					scope:ward = {
						opinion = {
							target = root
							value >= high_positive_opinion
						}
					}
				}
				modifier = {
					add = 15
					scope:ward = {
						opinion = {
							target = root
							value >= medium_positive_opinion
						}
					}
				}
				modifier = {
					add = 5
					scope:ward = {
						opinion = {
							target = root
							value >= low_positive_opinion
						}
					}
				}
				show_chance = no
				desc = bp2_yearly.8080.a.likes.tt
				show_as_tooltip = {
					scope:scheme = {
						add_scheme_modifier = {
							type = good_child_wingman
						}
					}
				}
				hidden_effect = {
					trigger_event = {
						id = bp2_yearly.8081
						days = 2
					}
				}
			}
			50 = {
				modifier = {
					add = 25
					scope:ward = {
						opinion = {
							target = root
							value <= high_negative_opinion
						}
					}
				}
				modifier = {
					add = 15
					scope:ward = {
						opinion = {
							target = root
							value <= medium_negative_opinion
						}
					}
				}
				modifier = {
					add = 5
					scope:ward = {
						opinion = {
							target = root
							value <= low_negative_opinion
						}
					}
				}
				show_chance = no
				desc = bp2_yearly.8080.a.dislikes.tt
				show_as_tooltip = {
					scope:scheme = {
						add_scheme_modifier = {
							type = bad_child_wingman
						}
					}
				}
				hidden_effect = {
					trigger_event = {
						id = bp2_yearly.8082
						days = 2
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
				ai_compassion = 1
			}
		}
	}
	# No, a child cannot be trusted in matters of love
	option = {
		name = bp2_yearly.8080.b
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_sociability = -1
				ai_compassion = -1
			}
		}
	}
	after = {
		remove_variable = scheme_event_active_flag
	}
}

# Follow-up, kid goes great! :D
bp2_yearly.8081 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8081.t
	desc = bp2_yearly.8081.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = flirtation_left
	}
	lower_left_portrait = {
		character = scope:ward
	}
	right_portrait = {
		character = scope:target
		animation = flirtation
	}
	option = {
		name = bp2_yearly.8081.a
		scope:scheme = {
			add_scheme_modifier = {
				type = good_child_wingman
			}
		}
	}
}

# Follow-up, kid goes great! :D
bp2_yearly.8082 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8082.t
	desc = bp2_yearly.8082.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = shock
	}
	lower_left_portrait = {
		character = scope:ward
	}
	right_portrait = {
		character = scope:target
		animation = anger
	}
	# Oh well
	option = {
		name = bp2_yearly.8082.a
		scope:scheme = {
			add_scheme_modifier = {
				type = bad_child_wingman
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
				ai_compassion = 1
				ai_vengefulness = -1
			}
		}
	}
	# You stupid child!
	option = {
		name = bp2_yearly.8082.b
		trigger = {
			has_trait = vengeful
		}
		progress_towards_rival_effect = {
			CHARACTER = scope:ward
			REASON = rival_badmouthed_to_lover
			OPINION = default_rival_opinion
		}
		stress_impact = {
			base = major_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_compassion = -1
				ai_vengefulness = 1
			}
		}
	}
}

##################################################
# Monks give you the toy test
# by James Beaumont
# 8090
##################################################
scripted_effect bp2_yearly_8090_become_reincarnation_effect = {
	set_variable = {
		name = reincarnation_of
		value = scope:ancestor
	}
	add_trait = reincarnation
}

bp2_yearly.8090 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8090.t
	desc = bp2_yearly.8090.desc
	theme = faith
	left_portrait = {
		character = root
		animation = thinking
	}
	lower_left_portrait = {
		character = scope:ancestor
	}
	right_portrait = {
		character = scope:monk
		animation = stressed_teacher
	}
	override_background = {
		trigger = {
			OR = {
				#AGOT Modified
				# faith = { religion = religion:hinduism_religion }
				# faith = { religion = religion:jainism_religion }
				# faith = { religion = religion:buddhism_religion }
				faith = { has_doctrine = tenet_reincarnation }
			}
		}
		reference = bp2_study_indian
	}
	cooldown = { years = 25 }
	trigger = {
		has_bp2_dlc_trigger = yes
		is_ruler = yes
		faith = { has_doctrine_parameter = reincarnation_events_active }
		NOT = { # You're not already a reincarnation
			has_trait = reincarnation
		}
		age >= 4 # You're at least somewhat capable of making decisions
		age < 16 # Older Teenagers don't play with toys, generally
		any_ancestor = {
			even_if_dead = yes
			is_alive = no
			any_memory = {
				OR = {
					has_memory_type = favourite_toy_horse
					has_memory_type = favourite_toy_puppet
					has_memory_type = favourite_toy_board_game
					has_memory_type = favourite_toy_spinning_top
					has_memory_type = favourite_toy_marbles
				}
			}
		}
	}
	immediate = {
		if = {
			limit = {
				cp:councillor_court_chaplain = { faith = root.faith }
			}
			cp:councillor_court_chaplain = { save_scope_as = monk }
		}
		else = {
			create_character = {
				template = default_mystic_character
				location = root.location
				culture = root.location.county.culture
				faith = root.faith
				save_scope_as = monk
			}
		}
		random_ancestor = {
			even_if_dead = yes
			limit = {
				is_alive = no
				any_memory = {
					OR = {
						has_memory_type = favourite_toy_horse
						has_memory_type = favourite_toy_puppet
						has_memory_type = favourite_toy_board_game
						has_memory_type = favourite_toy_spinning_top
						has_memory_type = favourite_toy_marbles
					}
				}
			}
			save_scope_as = ancestor
			random_memory = {
				limit = {
					OR = {
						has_memory_type = favourite_toy_horse
						has_memory_type = favourite_toy_puppet
						has_memory_type = favourite_toy_board_game
						has_memory_type = favourite_toy_spinning_top
						has_memory_type = favourite_toy_marbles
					}
				}
				save_scope_as = ancestor_memory
			}
		}
	}
	# I pick the horsey!
	option = {
		name = bp2_yearly.8090.a
		trigger = {
			NOT = { has_trait = eccentric }
		}
		custom_tooltip = ancestor_horse_guess_tt
		hidden_effect = {
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_horse
					}
				}
				trigger_event = {
					id = bp2_yearly.8091
					days = 1
				}
			}
			else = {
				trigger_event = {
					id = bp2_yearly.8092
					days = 1
				}
			}
			create_character_memory = {
				type = favourite_toy_horse
				participants = {
					other_child = root
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
			}
		}
	}
	# I pick the puppets!
	option = {
		name = bp2_yearly.8090.b
		trigger = {
			NOT = { has_trait = eccentric }
		}
		custom_tooltip = ancestor_puppet_guess_tt
		hidden_effect = {
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_puppet
					}
				}
				trigger_event = {
					id = bp2_yearly.8091
					days = 1
				}
			}
			else = {
				trigger_event = {
					id = bp2_yearly.8092
					days = 1
				}
			}
			create_character_memory = {
				type = favourite_toy_puppet
				participants = {
					other_child = root
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_vengefulness = 1
			}
		}
	}
	# I pick the board game!
	option = {
		name = bp2_yearly.8090.c
		trigger = {
			NOT = { has_trait = eccentric }
		}
		custom_tooltip = ancestor_board_games_guess_tt
		hidden_effect = {
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_board_game
					}
				}
				trigger_event = {
					id = bp2_yearly.8091
					days = 1
				}
			}
			else = {
				trigger_event = {
					id = bp2_yearly.8092
					days = 1
				}
			}
			create_character_memory = {
				type = favourite_toy_board_game
				participants = {
					other_child = root
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
	# I pick the spinning top!
	option = {
		name = bp2_yearly.8090.d
		trigger = {
			NOT = { has_trait = eccentric }
		}
		custom_tooltip = ancestor_spinning_tops_guess_tt
		hidden_effect = {
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_spinning_top
					}
				}
				trigger_event = {
					id = bp2_yearly.8091
					days = 1
				}
			}
			else = {
				trigger_event = {
					id = bp2_yearly.8092
					days = 1
				}
			}
			create_character_memory = {
				type = favourite_toy_spinning_top
				participants = {
					other_child = root
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_energy = 1
			}
		}
	}
	# I pick the marbles!
	option = {
		name = bp2_yearly.8090.e
		trigger = {
			NOT = { has_trait = eccentric }
		}
		custom_tooltip = ancestor_marbles_guess_tt
		hidden_effect = {
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_marbles
					}
				}
				trigger_event = {
					id = bp2_yearly.8091
					days = 1
				}
			}
			else = {
				trigger_event = {
					id = bp2_yearly.8092
					days = 1
				}
			}
			create_character_memory = {
				type = favourite_toy_marbles
				participants = {
					other_child = root
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	# None of them
	option = {
		name = bp2_yearly.8090.f
		trigger = {
			has_trait = eccentric
		}
		custom_tooltip = ancestor_nothing_guess_tt
		hidden_effect = {
			trigger_event = {
				id = bp2_yearly.8091
				days = 1
			}
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_horse
					}
				}
				create_character_memory = {
					type = favourite_toy_horse
					participants = {
						other_child = root
					}
				}
			}
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_puppet
					}
				}
				create_character_memory = {
					type = favourite_toy_puppet
					participants = {
						other_child = root
					}
				}
			}
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_board_game
					}
				}
				create_character_memory = {
					type = favourite_toy_board_game
					participants = {
						other_child = root
					}
				}
			}
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_spinning_top
					}
				}
				create_character_memory = {
					type = favourite_toy_spinning_top
					participants = {
						other_child = root
					}
				}
			}
			if = {
				limit = {
					scope:ancestor_memory = {
						has_memory_type = favourite_toy_marbles
					}
				}
				create_character_memory = {
					type = favourite_toy_marbles
					participants = {
						other_child = root
					}
				}
			}
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = -1
			}
		}
	}
}

# Ding ding! Right answer!
bp2_yearly.8091 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8091.t
	desc = bp2_yearly.8091.desc
	theme = faith
	override_background = {
		trigger = {
			OR = {
				#AGOT Modified
				# faith = { religion = religion:hinduism_religion }
				# faith = { religion = religion:jainism_religion }
				# faith = { religion = religion:buddhism_religion }
				faith = { has_doctrine = tenet_reincarnation }
			}
		}
		reference = bp2_study_indian
	}
	left_portrait = {
		character = root
		animation = happiness
	}
	lower_left_portrait = {
		character = scope:ancestor
	}
	right_portrait = {
		character = scope:monk
		animation = happy_teacher
	}
	option = {
		name = {
			text = bp2_yearly.8091.a
		}
		name = {
			text = bp2_yearly.8091.a.knew_them
			trigger = {
				scope:ancestor = { is_close_or_extended_family_of = root }
			}
		}
		bp2_yearly_8090_become_reincarnation_effect = yes
	}
}

# X wrong answer
bp2_yearly.8092 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8092.t
	desc = bp2_yearly.8092.desc
	theme = faith
	override_background = {
		trigger = {
			OR = {
				#AGOT Modified
				# faith = { religion = religion:hinduism_religion }
				# faith = { religion = religion:jainism_religion }
				# faith = { religion = religion:buddhism_religion }
				faith = { has_doctrine = tenet_reincarnation }
			}
		}
		reference = bp2_study_indian
	}
	left_portrait = {
		character = root
		animation = crying
	}
	lower_left_portrait = {
		character = scope:ancestor
	}
	right_portrait = {
		character = scope:monk
		animation = eyeroll
	}
	option = {
		name = bp2_yearly.8092.a
	}
}

##################################################
# Feelings develop for another kid, is this a crush?
# by James Beaumont
# 8100
##################################################
bp2_yearly.8100 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8100.t
	desc = bp2_yearly.8100.desc
	theme = friendly
	left_portrait = {
		character = root
		animation = happiness
	}
	right_portrait = {
		character = scope:potential_crush
		animation = love
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		# One can only have so many crushes
		num_of_relation_crush < 1
		OR = {
			suitable_crush_same_court_child = yes
			any_vassal = {
				save_good_crush_character_trigger_check = yes
			}
			any_vassal = {
				any_child = {
					save_good_crush_character_trigger_check = yes
				}
			}
		}
		child_not_infant_trigger = yes
	}
	immediate = {
		play_music_cue = "mx_cue_touching_moment"
		add_similar_age_same_court_children_to_list = yes
		every_vassal = {
			limit = { save_good_crush_character_trigger_check = yes }
			add_to_list = similar_age_same_court_children
		}
		every_vassal = {
			limit = {
				any_child = {
					save_good_crush_character_trigger_check = yes
				}	
			}
			every_child = {
				limit = {
					save_good_crush_character_trigger_check = yes
				}
				add_to_list = similar_age_same_court_children
			}
		}
		random_in_list = {
			list = similar_age_same_court_children
			limit = {
				save_temporary_scope_as = temp_crush
				OR = {
					matching_gender_and_sexuality_trigger = {
						CHARACTER_1 = root
						CHARACTER_2 = scope:temp_crush
					}
					AND = {
						has_sexuality = asexual
						root = {
							OR = {
								is_attracted_to_gender_of = scope:temp_crush
								has_sexuality = asexual
							}
						}
					}
					AND = {
						root = { has_sexuality = asexual }
						OR = {
							is_attracted_to_gender_of = root
							has_sexuality = asexual
						}
					}
				}
			}
			save_scope_as = potential_crush
		}
	}
	# It must have been love!
	option = {
		name = bp2_yearly.8100.a
		set_relation_crush = {
			target = scope:potential_crush
			reason = crush_tumbled_down_hill
		}
		stress_impact = {
			shy = minor_stress_impact_gain
			pensive = minor_stress_impact_gain
			rowdy = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}
		ai_chance = {
			base = 50
		}
	}
	# But it's over now.
	option = {
		name = bp2_yearly.8100.b
		set_relation_victim = {
			target = scope:potential_crush
			reason = bully_tumbled_down_hill
		}
		if = {
			limit = {
				NOR = {
					has_trait = gregarious
					has_trait = forgiving
					has_trait = charming
					has_trait = compassionate
					has_trait = lustful
				}
			}
			stress_impact = {
				base = medium_stress_impact_loss
				vengeful = minor_stress_impact_loss
				wrathful = minor_stress_impact_loss
			}
		}
		else = {
			stress_impact = {
				gregarious = minor_stress_impact_gain
				forgiving = minor_stress_impact_gain
				charming = minor_stress_impact_gain
				compassionate = minor_stress_impact_gain
				lustful = minor_stress_impact_gain
			}
		}
		ai_chance = {
			base = 50
		}
	}
	# It must have been good, but I lost it somehow
	option = {
		name = bp2_yearly.8100.c
		stress_impact = {
			shy = minor_stress_impact_loss
			gregarious = minor_stress_impact_gain
			lustful = minor_stress_impact_gain
			vengeful = minor_stress_impact_gain
			wrathful = minor_stress_impact_gain
			stubborn = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			modifier = {
				factor = 0
				OR = {
					has_trait = lustful
					has_trait = gregarious
				}
			}
		}
	}
}

##################################################
# Sacred childbirth, everyone is wanting to take care of you!
# by James Beaumont
# 8110
##################################################
bp2_yearly.8110 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8110.t
	desc = bp2_yearly.8110.desc
	theme = faith
	left_portrait = {
		character = root
		animation = pregnant
	}
	right_portrait = {
		character = scope:caretaker_1
		animation = admiration
	}
	lower_right_portrait = {
		character = scope:caretaker_2
	}
	lower_center_portrait = {
		character = scope:caretaker_3
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		is_ruler = yes
		is_landed = yes
		is_pregnant = yes
		has_trait = pregnant
		exists = cp:councillor_court_chaplain
		cp:councillor_court_chaplain = {
			faith = {
				has_doctrine_parameter = piety_from_childbirth_active
			}
		}
		any_courtier_or_guest = {
			count >= 2
			faith = { has_doctrine_parameter = piety_from_childbirth_active }
		}
	}
	immediate = {
		cp:councillor_court_chaplain = {
			save_scope_as = caretaker_1
		}
		if = {
			limit = {
				any_spouse = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
				}
			}
			random_spouse = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
				}
				save_scope_as = caretaker_2
			}
		}
		else = {
			random_courtier_or_guest = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
				}
				save_scope_as = caretaker_2
			}
		}
		if = {
			limit = {
				any_relation = {
					type = lover
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
					NOT = { this = scope:caretaker_2 }
				}
			}
			random_relation = {
				type = lover
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
					NOT = { this = scope:caretaker_2 }
				}
				save_scope_as = caretaker_3
			}
		}
		else_if = {
			limit = {
				any_relation = {
					type = friend
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
					NOT = { this = scope:caretaker_2 }
				}
			}
			random_relation = {
				type = friend
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
					NOT = { this = scope:caretaker_2 }
				}
				save_scope_as = caretaker_3
			}
		}
		else = {
			random_courtier_or_guest = {
				limit = {
					faith = {
						has_doctrine_parameter = piety_from_childbirth_active
					}
					NOT = { this = scope:caretaker_1 }
					NOT = { this = scope:caretaker_2 }
				}
				weight = {
					base = 1
					modifier = {
						add = ai_compassion
					}
				}
				save_scope_as = caretaker_3
			}
		}
	}
	# Thank you all!
	option = {
		name = bp2_yearly.8110.a
		add_piety = minor_piety_gain
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:caretaker_1
			opinion = 5
		}
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:caretaker_2
			opinion = 5
		}
		reverse_add_opinion = {
			modifier = grateful_opinion
			target = scope:caretaker_3
			opinion = 5
		}
		stress_impact = {
			base = major_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_honor = 1
				ai_energy = -0.5
			}
		}
	}
	# You may take care of me, chaplain
	option = {
		name = bp2_yearly.8110.b
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_2
			opinion = -15
		}
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_3
			opinion = -15
		}
		add_piety = major_piety_gain
		stress_impact = {
			base = medium_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 0.5
			}
		}
	}
	# You may take care of me, husband and or wife
	option = {
		name = bp2_yearly.8110.c
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_1
			opinion = -15
		}
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_3
			opinion = -15
		}
		add_piety = minor_piety_gain
		if = {
			limit = {
				NOT = {
					has_relation_lover = scope:caretaker_2
				}
			}
			progress_towards_lover_effect = {
				CHARACTER = scope:caretaker_2
				REASON = lover_pregnancy_care
				OPINION = default_lover_opinion
			}
		}
		else = {
			reverse_add_opinion = {
				modifier = grateful_opinion
				target = scope:caretaker_2
				opinion = 15
			}
		}
		stress_impact = {
			base = medium_stress_impact_loss
			lustful = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
			}
		}
	}
	# You know what I need
	option = {
		name = bp2_yearly.8110.d
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_1
			opinion = -15
		}
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:caretaker_2
			opinion = -15
		}
		if = {
			limit = {
				NOR = {
					has_relation_lover = scope:caretaker_3
					has_relation_friend = scope:caretaker_3
				}
			}
			progress_towards_friend_effect = {
				CHARACTER = scope:caretaker_3
				REASON = friend_pregnancy_care
				OPINION = default_lover_opinion
			}
		}
		else = {
			reverse_add_opinion = {
				modifier = grateful_opinion
				target = scope:caretaker_3
				opinion = 15
			}
		}
		stress_impact = {
			base = massive_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
				ai_rationality = -0.5
			}
		}
	}
}


##################################################
# Sacred childbirth, offer to care for your pregnant spouse
# by James Beaumont
# 8120
##################################################
bp2_yearly.8120 = {
	type = character_event
	content_source = dlc_009
	title = bp2_yearly.8120.t
	desc = bp2_yearly.8120.desc
	theme = faith
	left_portrait = {
		character = root
		animation = admiration
	}
	right_portrait = {
		character = scope:spouse
		animation = pregnant
	}
	cooldown = { years = 5 }
	trigger = {
		has_bp2_dlc_trigger = yes
		faith = {
			has_doctrine_parameter = piety_from_childbirth_active
		}
		any_consort = {
			is_pregnant = yes
			# Do you *know* they're pregnant?
			has_trait = pregnant
			is_ai = yes
			location = root.location
		}
		# Don't do it if you're also pregnant (same-sex marriage edge-case)
		is_pregnant = no
	}
	immediate = {
		random_consort = {
			limit = {
				is_pregnant = yes
				has_trait = pregnant
				is_ai = yes
				location = root.location
			}
			save_scope_as = spouse
		}
	}
	# I'll help, sure.
	option = {
		name = bp2_yearly.8120.a
		add_piety = massive_piety_gain
		if = {
			limit = {
				NOT = {
					has_relation_lover = scope:spouse
				}
			}
			scope:spouse = {
				add_stress = major_stress_loss
				progress_towards_lover_effect = {
					CHARACTER = root
					REASON = lover_pregnancy_care
					OPINION = default_lover_opinion
				}
			}
		}
		else = {
			scope:spouse = {
				add_stress = major_stress_loss
			}
			reverse_add_opinion = {
				modifier = grateful_opinion
				target = scope:spouse
				opinion = 15
			}
		}
		add_character_modifier = {
			modifier = lifting_the_burden_modifier
			years = 2
		}
		stress_impact = {
			base = medium_stress_impact_gain
			diligent = minor_stress_impact_loss
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = 1
				ai_honor = 1
				ai_energy = 1
			}
		}
	}
	# Not my problem lmao
	option = {
		name = bp2_yearly.8120.b
		reverse_add_opinion = {
			modifier = disappointed_opinion
			target = scope:spouse
			opinion = -15
		}
		add_piety = minor_piety_loss
		stress_impact = {
			sadistic = minor_stress_impact_loss
			callous = minor_stress_impact_loss
			disloyal = minor_stress_impact_loss
			loyal = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			diligent = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_zeal = -1
				ai_energy = -0.5
				ai_compassion = -0.5
			}
		}
	}
	# Perhaps I can help you relieve stress in other ways
	option = {
		name = bp2_yearly.8120.c
		trigger = {
			has_trait = lustful
			scope:spouse = {
				is_attracted_to_gender_of = root
				opinion = {
					target = root
					value >= low_positive_opinion
				}
			}
		}
		if = {
			limit = {
				NOT = {
					has_relation_lover = scope:spouse
				}
			}
			scope:spouse = {
				add_stress = major_stress_loss
				progress_towards_lover_effect = {
					CHARACTER = root
					REASON = lover_pregnancy_care
					OPINION = default_lover_opinion
				}
			}
		}
		else = {
			scope:spouse = {
				add_stress = major_stress_loss
			}
			reverse_add_opinion = {
				modifier = grateful_opinion
				target = scope:spouse
				opinion = 15
			}
		}
		stress_impact = {
			base = minor_stress_impact_loss
			diligent = minor_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_sociability = 1
				ai_energy = -0.5
			}
		}
	}
}
