﻿
### Birth trigger list


birth_will_happen_as_usual_trigger = {
	OR = {
		has_character_flag = birth_will_go_smoothly
		has_character_flag = birth_child_will_become_sickly
		has_character_flag = birth_mother_will_become_ill
	}
}

allow_naming_on_birth_of_child_trigger = {
	save_temporary_scope_as = naming_parent
	exists = $CHILD$
	is_ai = no
	is_close_family_of = $CHILD$
	OR = {
		#I am the only player parent of child
		NOT = {
			$CHILD$ = {
				any_parent = {
					is_ai = no
					NOT = { this = scope:naming_parent }
				}
			}
		}
		#I am the best player to name this child
		AND = {
			$CHILD$ = { #There are two player parents
				exists = father
				exists = mother
				NOT = { any_parent = { is_ai = yes } }
			}
			OR = {
				AND = { #They are of my dynasty, not theirs
					dynasty = $CHILD$.dynasty
					$CHILD$ = {
						any_parent = {
							NOT = { this = scope:naming_parent }
							NOT = { dynasty = $CHILD$.dynasty }
						}
					}
				}
				AND = { #I am their mother, and parents are of same dynasty/neither has baby's dynasty
					$CHILD$ = { mother = { this = scope:naming_parent } }
					OR = {
						$CHILD$.mother.dynasty = $CHILD$.father.dynasty
						NOR = {
							$CHILD$.mother.dynasty = $CHILD$.dynasty
							$CHILD$.father.dynasty = $CHILD$.dynasty
						}
					}
				}
			}
		}
	}
}

