﻿#Events for birth on actions

namespace = birth

#BIRTH: Mother: Child dies (no child created)
birth.3001 = {
	type = character_event
	id_override_priority = 100
	title = birth.3001.t
	desc = birth.3001.desc_other_child
	theme = death
	override_background = { reference = bedchamber}
	left_portrait = {
		character = root
		animation = grief
		outfit_tags = { nightgown }
	}
	right_portrait = {
		character = scope:father
		trigger = {
			exists = scope:father
		}
		animation = disbelief
	}

	trigger = {
		is_pregnant = yes
	}

	immediate = {
		play_music_cue = mx_cue_death
		create_character_memory = {
			type = child_stillborn
			participants = {
				mother = root
			}
		}
		if = {
			limit = { NOT = { exists = scope:dummy_gender } }
			dummy_male = { save_scope_as = dummy_gender }
		}
		hidden_effect = {
			end_pregnancy = yes
		}
		set_variable = {
			name = had_miscarriage
			value = scope:dummy_gender
			days = 90
		}
		if = {
			limit = {
				exists = scope:father
				scope:father = {
					is_alive = yes
				}
			}
			scope:father = {
				trigger_event = birth.3002
			}
		}
		custom_tooltip = birth.3001.a.tt
		pregnancy_cleanup_effect = yes
	}

	#NO NAMING WIDGET

	option = {
		name = birth.3001.a
		pam_childbirth_spiritual_fulfillment_penalty_effect = yes
		stress_and_fulfillment_impact = {
			base = medium_stress_impact_gain
			compassionate = medium_stress_impact_gain
			callous = medium_stress_impact_loss
			family_first = minor_stress_impact_gain
		}
		
		save_scope_value_as = {
			name = skip_depression_check
			value = flag:yes
		}
		if = {
			limit = { ai_compassion >= high_positive_compassion }
			add_trait_force_tooltip = depressed_1
			hidden_effect = {
				trigger_event = {
					id = lmf_birth.1102
					days = { 180 1095 }
				}
			}
		}
		else_if = {
			limit = { ai_compassion > high_negative_compassion }
			add_trait_force_tooltip = depressed_1
			hidden_effect = {
				trigger_event = {
					id = lmf_birth.1102
					days = { 60 180 }
				}
			}
		}
		trigger_event = {
			id = lmf_birth.1100
			days = { 3 7 }
		}
	}
}

