﻿# Generous Motherhood
# Vanilla on_actions with an effect block are extended through on_actions = { }, as advised in
# common/on_action/_on_actions.info.

# Root is the mother, scope:child the newborn (once per child: twins fire it twice)
on_birth_mother = {
	on_actions = { gm_on_birth_mother }
}

gm_on_birth_mother = {
	events = {
		gm_motherhood.0001
	}
}

# Gives the trait to the mothers of a new game. Saves started without the mod catch up through
# the yearly pulse below.
on_game_start_after_lobby = {
	on_actions = { gm_on_game_start_after_lobby }
}

gm_on_game_start_after_lobby = {
	effect = {
		every_living_character = {
			limit = { is_female = yes }
			gm_sync_trait_effect = yes
		}
	}
}

# Catches births this mod did not see (saves started without it, children created by script)
random_yearly_everyone_pulse = {
	on_actions = { gm_yearly_everyone_pulse }
}

gm_yearly_everyone_pulse = {
	trigger = { is_female = yes }
	effect = {
		gm_sync_trait_effect = yes
	}
}
