﻿namespace = regula_curo_privignos_event

###Curo Privignos - Manage Stepchild -  Added by CashinCheckin
regula_curo_privignos_event.0001 = {
	type = character_event
	title = regula_curo_privignos_event.0001.t
	desc = {
		desc = regula_curo_privignos_event.0001.desc_start
		triggered_desc = {
			trigger = { exists = scope:father_stepchild }
			desc = regula_curo_privignos_event.0001.desc_father
		}
		desc = double_line_break
		triggered_desc = {
			trigger = { exists = scope:mother_stepchild }
			desc = regula_curo_privignos_event.0001.desc_mother
		}
		desc = regula_curo_privignos_event.0001.desc_end
	}
	theme = regula_theme
	override_background = {
		reference = council_chamber
	}

	right_portrait = {
		character = scope:recipient
    	animation = worry
	}

	left_portrait = {
		character = scope:recipient.mother
		animation = happiness
	}

	lower_center_portrait = scope:recipient.father

	immediate = {
		scope:recipient.father ?= {
			save_scope_as = father_stepchild
		}
		scope:recipient.mother ?= {
			save_scope_as = mother_stepchild
		}
	}

	# Bring the child into your dynasty
	option = {
		name = regula_curo_privignos_event.0001.a 
		custom_description_no_bullet = { text = regula_curo_privignos_added_to_dynasty }

		scope:recipient = {
			add_trait = regula_privignus_of_the_magister
			set_house = scope:actor.house
			set_character_faith = root.faith
			add_opinion = {
					modifier = regula_curo_privignos_added_to_dynasty
					target = scope:actor
			}
		}
		scope:actor = {
			add_prestige = -100
			add_dread = -10
			add_hook = {
				type = loyalty_hook
				target = scope:recipient
			}

			if = {
				limit = {
					NOT = { is_employer_of = scope:recipient }
				}
				add_courtier = scope:recipient
			}
		}
	}

	# "Ignore" child, allow them to grow under your care but nothing else
	option = {
		name = regula_curo_privignos_event.0001.b 
		custom_description_no_bullet = { text = regula_curo_privignos_ignored }
		scope:recipient = {
			add_trait = regula_privignus_of_the_magister
			add_opinion = {
					modifier = kindness_opinion
					target = scope:actor
					opinion = 30
			}
		}
		scope:actor = {
			add_hook = {
				type = loyalty_hook
				target = scope:recipient
			}

			if = {
				limit = {
					NOT = { is_employer_of = scope:recipient }
				}
				add_courtier = scope:recipient
			}
		}
	}

	# Drop them off at the convent
	option = {
		name = regula_curo_privignos_event.0001.c
		custom_description_no_bullet = { text = regula_curo_privignos_sent_to_convent }
		scope:recipient = {
			add_trait = devoted
			add_trait = regula_privignus_of_the_magister
			set_character_faith = root.faith
			move_to_pool = yes
			add_opinion = {
					modifier = regula_curo_privignos_sent_to_convent
					target = scope:actor
			}
			if = {
				limit = { exists = betrothed }
				break_betrothal = betrothed
			}
		}
	}

	# Test the loyalty of their mother
	option = {
		name = regula_curo_privignos_event.0001.d
		custom_description_no_bullet = { text = regula_curo_privignos_loyalty }
		add_internal_flag = dangerous

		trigger = {
			piety >= massive_piety_gain
		}

		show_as_unavailable = {
			always = yes
		}

		scope:recipient.mother = {
			add_piety = massive_piety_gain
			add_prestige = medium_prestige_loss
			add_dread = 10
			add_trait = loyal
			stress_impact = {
				compassionate = medium_stress_impact_gain
				cynical = minor_stress_impact_gain
				just = miniscule_stress_impact_gain
				zealous = medium_stress_impact_loss
				sadistic = minor_stress_impact_loss
				arbitrary = miniscule_stress_impact_loss
			}

		}
		scope:recipient = {
			death = {
				death_reason = death_murder_known
				killer = scope:recipient.mother
			}
		}
		scope:actor = {
			add_piety = massive_piety_loss
			add_prestige = medium_prestige_gain
			add_dread = 10
		}
		scope:actor.dynasty = {
			add_dynasty_prestige = 25
		}
	}

	# Pay some peasants to murder
	option = {
		name = regula_curo_privignos_event.0001.e
		custom_description_no_bullet = { text = regula_curo_privignos_peasant }
		add_internal_flag = dangerous

		trigger = {
			gold > medium_gold_value
		}

		show_as_unavailable = {
			always = yes
		}

		scope:recipient = {
			death = {
				death_reason = death_torn_to_pieces_by_mob
			}
		}
		scope:actor = {
			remove_short_term_gold = medium_gold_value
		}
	}

	# Cancel option
	option = {
		name = regula_curo_privignos_event.0001.f
	}
}
