namespace = everpreg_dt

# based off the carnelitas script written by Luther Slade and Cheri

#
# 0001. seed dt traits for all characters
# 0002. seed dt traits for this character
# 0003. initialize newborn children with inactive dt traits
# 0004. activate gender appropriate dt traits when a child comes of age
#

#
# 0001. seed dt traits for all characters
#

everpreg_dt.0001 = {
	type = empty
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled_true
	}

	immediate = {
		every_living_character = {
			trigger_event = { id = everpreg_dt.0002 }
		}
	}
}

#
# 0002. seed dt traits for this character
#

everpreg_dt.0002 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled_true
		NOT = { has_character_flag = everpreg_dt_traits_seeded }
	}

	immediate = {
		everpreg_seed_dt_traits_effect = yes
		if = {
			limit = { age >= 18 }
			everpreg_activate_gender_specific_dt_traits_effect = yes
		}
	}
}

#
# 0003. initialize newborn children with inactive dt traits
#

everpreg_dt.0003 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled_true
	}

	immediate = {
		scope:child = {
			everpreg_make_all_dt_traits_inactive_effect = yes
			everpreg_seed_dt_traits_effect = yes
		}
	}
}

#
# 0004. activate gender appropriate dt traits when a child comes of age
#

everpreg_dt.0004 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled_true
	}

	immediate = {
		everpreg_activate_gender_specific_dt_traits_effect = yes
	}
}