﻿# Generous Motherhood

# Children needed to reach the full growth (twice the vanilla maximum bust, see common/genes/gm_genes_special.txt)
gm_births_for_full_growth = 12

# Children this woman gave birth to, including those who died since.
# Twins count as two. Stillbirths end the pregnancy without creating a child, so they don't count.
gm_birth_count = {
	value = 0
	every_child = {
		even_if_dead = yes
		add = 1
	}
}

# Strength of gm_gene_bust_growth: grows by the same step with each child, 1 from the 12th on
gm_bust_growth_strength = {
	value = gm_birth_count
	divide = gm_births_for_full_growth
	max = 1
}

### Trait (common/traits/gm_traits.txt)

# Births needed for the trait (level 1)
gm_births_for_trait = 3

# XP of gm_nourishing_mother per child born, then 100 (a full bar) from the 12th:
# levels at 24 / 48 / 72 / 100 XP = 3 / 6 / 9 / 12 births
gm_trait_xp_per_birth = 8

gm_trait_xp_target = {
	value = gm_birth_count
	multiply = gm_trait_xp_per_birth
	if = {
		limit = { gm_birth_count >= gm_births_for_full_growth }
		value = 100
	}
	max = 100
}

# 0 without the trait, then 1 to 4
gm_trait_level = {
	value = 0
	if = {
		limit = { has_trait = gm_nourishing_mother }
		add = 1
	}
	if = {
		limit = { has_trait_xp = { trait = gm_nourishing_mother value >= 48 } }
		add = 1
	}
	if = {
		limit = { has_trait_xp = { trait = gm_nourishing_mother value >= 72 } }
		add = 1
	}
	if = {
		limit = { has_trait_xp = { trait = gm_nourishing_mother value >= 100 } }
		add = 1
	}
}

### Level-up popup (gm_motherhood.0100)

# Orders her children youngest first
gm_youngest_first_order = {
	value = 1000
	subtract = age
}

# Orders her bed partners: the player looking at the popup, then her primary spouse, then other spouses
gm_bed_partner_order = {
	value = 0
	if = {
		limit = { this = root }
		add = 4
	}
	if = {
		limit = {
			exists = scope:gm_mother.primary_spouse
			this = scope:gm_mother.primary_spouse
		}
		add = 2
	}
	if = {
		limit = { is_spouse_of = scope:gm_mother }
		add = 1
	}
}

# Orders the level 3 and 4 extras (gm_fill_scene_with_court_effect): the court musician, the court
# chaplain, then her siblings, eldest first
gm_scene_extra_order = {
	value = age
	if = {
		limit = {
			exists = scope:gm_musician
			this = scope:gm_musician
		}
		add = 2000
	}
	else_if = {
		limit = {
			exists = scope:gm_chaplain
			this = scope:gm_chaplain
		}
		add = 1000
	}
}

# Multiplies the weight of every complicated outcome in pregnancy.0001 (events/pregnancy_events.txt):
# -20% per level, so -80% at level 4
gm_pregnancy_complication_factor = {
	value = 1
	if = {
		limit = { has_trait = gm_nourishing_mother }
		subtract = {
			value = gm_trait_level
			multiply = 0.2
		}
	}
}
