﻿# Generous Motherhood
#
# One trait with four levels, kept in step with the bust gene: the XP is 8 per child born and 100
# from the 12th (gm_trait_xp_target in common/script_values/gm_values.txt), so the levels are
# reached at 3 / 6 / 9 / 12 births (24 / 48 / 72 / 100 XP). The trait is added at the 3rd birth
# and never removed.
# Every level is a track tier, so that the trait window numbers them 1 to 4 (tiers are the only
# marks on the bar). Tiers add up (checked in game), so each one only lists the increment.
#
# Pregnancy complications (events/pregnancy_events.txt) and the children's Mother's Milk modifier
# (common/modifiers/gm_modifiers.txt) read the level through gm_trait_level.

gm_nourishing_mother = {
	category = fame
	valid_sex = female
	shown_in_ruler_designer = no

	# Cumulative totals wanted per level (1 / 2 / 3 / 4):
	#   attraction and child opinion  +5 / +10 / +20 / +40
	#   fertility                     +5% / +10% / +15% / +20%
	#   years of fertility            +1 / +2 / +4 / +8
	#   monthly prestige              0 / +0.25 / +0.75 / +1.5
	#   diplomacy                     +1 / +2 / +4 / +8
	#   dynasty and county opinion    0 / 0 / +5 / +15
	track = {
		# Level 1: Milk Blossom (3 births)
		24 = {
			attraction_opinion = 5
			child_opinion = 5
			fertility = 0.05
			years_of_fertility = 1
			diplomacy = 1
		}
		# Level 2: Fountain of Life (6 births)
		48 = {
			attraction_opinion = 5
			child_opinion = 5
			fertility = 0.05
			years_of_fertility = 1
			monthly_prestige = 0.25
			diplomacy = 1
		}
		# Level 3: Bosom of the Realm (9 births)
		72 = {
			attraction_opinion = 10
			child_opinion = 10
			fertility = 0.05
			years_of_fertility = 2
			monthly_prestige = 0.5
			diplomacy = 2
			dynasty_opinion = 5
			county_opinion_add = 5
		}
		# Level 4: Mother of Plenty (12 births)
		100 = {
			attraction_opinion = 20
			child_opinion = 20
			fertility = 0.05
			years_of_fertility = 4
			monthly_prestige = 0.75
			diplomacy = 4
			dynasty_opinion = 10
			county_opinion_add = 10
		}
	}

	# gfx/interface/icons/traits/gm_nourishing_mother.dds, same icon for every level.
	# For one icon per level, use an icon = { first_valid = { triggered_desc ... } } block on
	# has_trait_xp (thresholds 48 / 72 / 100), like vanilla tourney_participant.
	icon = gm_nourishing_mother.dds

	name = {
		first_valid = {
			# Without a character: the family name, which the trait window also shows in brackets
			# after the level name (TRAIT_NAME_WITH_BASE)
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_gm_nourishing_mother
			}
			triggered_desc = {
				trigger = {
					exists = this
					has_trait_xp = { trait = gm_nourishing_mother value >= 100 }
					faith = { religion = { is_in_family = rf_abrahamic } }
				}
				desc = trait_gm_nourishing_mother_4
			}
			triggered_desc = {
				trigger = {
					exists = this
					has_trait_xp = { trait = gm_nourishing_mother value >= 100 }
				}
				desc = trait_gm_nourishing_mother_4_goddess
			}
			triggered_desc = {
				trigger = {
					exists = this
					has_trait_xp = { trait = gm_nourishing_mother value >= 72 }
				}
				desc = trait_gm_nourishing_mother_3
			}
			triggered_desc = {
				trigger = {
					exists = this
					has_trait_xp = { trait = gm_nourishing_mother value >= 48 }
				}
				desc = trait_gm_nourishing_mother_2
			}
			desc = trait_gm_nourishing_mother_1
		}
	}

	desc = {
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { exists = this } }
				desc = trait_gm_nourishing_mother_1_desc
			}
			triggered_desc = {
				trigger = { has_trait_xp = { trait = gm_nourishing_mother value >= 100 } }
				desc = trait_gm_nourishing_mother_4_character_desc
			}
			triggered_desc = {
				trigger = { has_trait_xp = { trait = gm_nourishing_mother value >= 72 } }
				desc = trait_gm_nourishing_mother_3_character_desc
			}
			triggered_desc = {
				trigger = { has_trait_xp = { trait = gm_nourishing_mother value >= 48 } }
				desc = trait_gm_nourishing_mother_2_character_desc
			}
			desc = trait_gm_nourishing_mother_1_character_desc
		}
	}
}
