namespace = married_life

################################################
# Wife falls in love with your lover
################################################
# Wife falls in love with your lover
character_event = {
	id = married_life.1
	desc = EVTDESCmarried_life.1
	picture = GFX_evt_lovers
	
	only_women = yes
	
	trigger = {
		is_married = yes
		trait = homosexual
		spouse = {
			any_lover = {
				NOT = { character = ROOT }
				trait = homosexual
				is_alive = yes
				at_location = ROOT
			}
		}
		NOT = {
			has_character_flag = thelma
			has_character_flag = louise
		}
	}
	
	mean_time_to_happen = {
		months = 3
	}
	
	option = {
		name = EVTOPTAmarried_life.1
		set_character_flag = thelma
		spouse = {
			random_lover = {
				limit = {
					trait = homosexual
					NOT = { character = ROOT }
				}
				set_character_flag = louise
				add_lover = ROOT
			}
			hidden_tooltip = {
				character_event = { id = married_life.2 days = 14 }
			}
		}
	}
}
# Husband finds out
character_event = {
	id = married_life.2
	desc = EVTDESCmarried_life.2
	picture = GFX_evt_lovers
	
	is_triggered_only = yes
	
	option = { # Accept it.
		name = EVTOPTAmarried_life.2
		prestige = -20
		any_spouse = {
			limit = { has_character_flag = thelma }
			opinion = {
				modifier = opinion_grateful
				who = ROOT
				months = 12
			}
			random_lover = {
				limit = { has_character_flag = louise }
				opinion = {
					modifier = opinion_grateful
					who = ROOT
					months = 12
				}
			}
		}
	}
	option = { # Order them to stop.
		name = EVTOPTBmarried_life.2
		hidden_tooltip = {
			character_event = { id = married_life.3 days = 30 }
		}
		piety = 20
	}
	option = { # Divorce the spouse
		name = EVTOPTCmarried_life.2
		remove_spouse = spouse
		prestige = -20
	}
}
# Husband finds out they've fled!
character_event = {
	id = married_life.3
	desc = EVTDESCmarried_life.3
	picture = GFX_evt_bad_news
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTAmarried_life.3
		character_event = { id = married_life.4 tooltip = EVTTOOLTIPmarried_life.3 }
	}
}
# The wives drive their carriage over a cliff
character_event = {
	id = married_life.4
	desc = EVTDESCmarried_life.4
	picture = GFX_evt_carriage
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTAmarried_life.4
		any_spouse = {
			limit = { has_character_flag = thelma }
			death = { death_reason = death_suicide }
			random_lover = {
				limit = { has_character_flag = louise }
				death = { death_reason = death_suicide }
			}
		}
	}
}

################################################
# Wife thinks her son should get a county if the heir is not her child
################################################
# Wife thinks her son should get a county if the heir is not her child
character_event = {
	id = married_life.10
	desc = EVTDESCmarried_life.10
	picture = GFX_evt_quarrel
	
	capable_only = yes
	prisoner = no
	only_women = yes
	
	trigger = {
		num_of_children = 1
		is_married = yes
		is_pregnant = no
		spouse = { demesne_size = 3 }
		NOT = { has_character_flag = envious_mother }
		any_child = {
			is_female = no
			is_primary_heir = no
			is_alive = yes
			age = 15
			is_landed = no
			trait = content
		}
		NOT = { any_child = { is_primary_heir = yes } }
		NOT = { any_child = { has_character_flag = first_wife_son } }
	}
	
	mean_time_to_happen = {
		months = 320
		modifier = {
			factor = 0.25
			trait = envious
		}
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 2.0
			trait = slothful
		}
		modifier = {
			factor = 4.0
			trait = content
		}
	}
	
	option = { # Speak to husband
		name = EVTOPTAmarried_life.10
		ai_chance = { factor = 100 }
		set_character_flag = envious_mother
		any_child = {
			limit = { 
				is_female = no
				age = 15
				is_primary_heir = no
				is_landed = no
				trait = content
			}
			set_character_flag = first_wife_son
			character_event = { id = married_life.11 days = 2 tooltip = EVTTOOLTIPmarried_life.10 }
		}
	}
	option = { # Do nothing
		ai_chance = { factor = 0 }
		name = EVTOPTBmarried_life.10
	}
}
# Son informed
character_event = {
	id = married_life.11
	desc = EVTDESCmarried_life.11
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTAmarried_life.11
		father = { character_event = { id = married_life.12 days = 2 tooltip = EVTTOOLTIPmarried_life.11 } }
	}
}
# Husband informed
character_event = {
	id = married_life.12
	desc = EVTDESCmarried_life.12
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = { # Grant county
		name = EVTOPTAmarried_life.12
		random_demesne_title = {
			limit = {
				OR = {
					tier = baron
					tier = count
				}
				NOT = { location = { is_capital = yes } }
			}
			ROOT = {
				any_child = {
					limit = { has_character_flag = first_wife_son }
					grant_title = PREVPREV
				}
			}
		}
	}
	option = { # Say no
		name = EVTOPTBmarried_life.12
		FROM = {
			mother = {
				opinion = {
					who = ROOT
					modifier = opinion_very_disappointed
					years = 2
				}
			}
		}
		hidden_tooltip = {
			any_child = {
				limit = { has_character_flag = first_wife_son }
				character_event = { id = married_life.13 days = 2 }
			}
		}
	}
}
# Son informed he is not getting county
character_event = {
	id = married_life.13
	desc = EVTDESCmarried_life.13
	picture = GFX_evt_quarrel
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTAmarried_life.13
		FROM = {
			opinion = {
				who = ROOT
				modifier = opinion_disappointed
				years = 2
			}
		}
	}
}