namespace = GMM_events
character_event = {
	id = GMM_events.0
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		OR = {
			father = { has_character_flag = surrogated_parent }
			mother = { has_character_flag = surrogated_parent }
		}
	}
	immediate = {
		father = {
			IF = {
				limit = { has_character_flag = surrogated_parent }
				character_event = { id = GMM_events.1 days = 7 }
			}
		}
		mother = {
			IF = {
				limit = { has_character_flag = surrogated_parent }
				character_event = { id = GMM_events.1 days = 7 }
			}
		}
	}
}
character_event = {
	id = GMM_events.1
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		any_spouse = {
			IF = {
				limit = {
					OR = {
						has_opinion_modifier = { modifier = opinion_bastard_spawn who = ROOT }
						has_opinion_modifier = { modifier = legitimized_bastard who = ROOT }
						has_opinion_modifier = { modifier = acknowledged_bastard who = ROOT }
						has_opinion_modifier = { modifier = opinion_unfaithful_husband who = ROOT }
						has_opinion_modifier = { modifier = opinion_unfaithful_wife who = ROOT }
						has_opinion_modifier = { modifier = opinion_furious who = ROOT }
					}
				}
				remove_opinion = { modifier = opinion_bastard_spawn who = ROOT }
				remove_opinion = { modifier = legitimized_bastard who = ROOT }
				remove_opinion = { modifier = acknowledged_bastard who = ROOT }
				remove_opinion = { modifier = opinion_unfaithful_husband who = ROOT }
				remove_opinion = { modifier = opinion_unfaithful_wife who = ROOT }
				remove_opinion = { modifier = opinion_furious who = ROOT }
			}
		}
		any_child = {
			IF = {
				limit = {
					has_opinion_modifier = { modifier = legitimized_bastard who = ROOT }
				}
				remove_opinion = { modifier = legitimized_bastard who = ROOT }
			}
		}
		FROM = {
			remove_trait = bastard
			remove_trait = legit_bastard
			IF = {
				limit = { NOT = { dynasty = ROOT } }
				dynasty = ROOT
			}
			IF = {
				limit = { ROOT = { is_female = no } }
				mother = { character_event = { id = GMM_events.3 } }
			}
			IF = {
				limit = { ROOT = { is_female = yes } }
				father = { character_event = { id = GMM_events.3 } }
			}
		}
		hidden_tooltip = {
			clr_character_flag = surrogated_parent
		}
	}
}
character_event = {
	id = GMM_events.2
	desc = EVTDESCGMM_events.2
	picture = GFX_evt_lovers
	is_triggered_only = yes

	trigger = {
		NOT = { trait = homosexual }
		any_lover = {
			OR = {
				AND = {
					is_female = no
					ROOT = { is_female = no }
				}
				AND = {
					is_female = yes
					ROOT = { is_female = yes }
				}
			}
		}
	}
	immediate = {
		IF = {
			limit = { NOT = { trait = homosexual } }
			add_trait = homosexual
		}
		any_lover = {
			limit = {
				NOT = { trait = homosexual }
				OR = {
					AND = {
						is_female = no
						ROOT = { is_female = no }
					}
					AND = {
						is_female = yes
						ROOT = { is_female = yes }
					}
				}
			}
			add_trait = homosexual
		}
	}
	option = {
		name = EVTOPTAGMM_events.2
	}
}
character_event = {
	id = GMM_events.3
	hide_window = yes
	is_triggered_only = yes

	immediate = {
		FROM = {
			any_spouse = {
				IF = {
					limit = {
						has_opinion_modifier = { modifier = slut_seductress who = ROOT }
					}
					remove_opinion = { modifier = slut_seductress who = ROOT }
				}
			}
		}
	}

}