﻿# On actions for child birth and pregnancy notification events, triggered automatically by the game

# called for the mother when a pregnancy reaches the "revealed" status
# scope:mother is the pregnant mother
# scope:father is the assumed father
# scope:real_father is the biological father
on_pregnancy_mother = {
	on_actions = {
		BWLAG_on_pregnancy_mother_flag
		BWLAG_on_pregnancy_mother_baby_weight
	}
}

BWLAG_on_pregnancy_mother_flag = {
	trigger = {
		NOT = { has_character_flag = BWLAG_has_been_pregnant }
	}
	effect = {
		add_character_flag = BWLAG_has_been_pregnant
	}
}

BWLAG_on_pregnancy_mother_baby_weight = {
	effect = {
		if = {
			limit = {
				has_character_flag = BWLAG_has_been_pregnant_in_the_last_2_years
			}
			remove_character_flag = BWLAG_has_been_pregnant_in_the_last_2_years
		}
		add_character_flag = {
			flag = BWLAG_has_been_pregnant_in_the_last_2_years
			years = 2
		}
		change_current_weight = 6
		trigger_event = {
			id = BWLaG_maintenance.0001
			days = 30
		}
	}
}

# Empty scope
on_game_start = {
	on_actions = {
		BWLAG_on_game_start
	}
}

BWLAG_on_game_start = {
	effect = {
		every_living_character = {
			limit = {
				is_female = yes
				any_child = {
					count >= 1
				}
			}
			add_character_flag = BWLAG_has_been_pregnant
		}
	}
}