﻿### EK NOTE: changed some uses of age with ek_human_age_equivalent
marriage_interaction_on_accept_effect = {
	#Use hook
	if = {
		limit = { always = scope:hook }
		scope:actor = {
			use_hook = scope:recipient
		}
		#To make sure betrothals can't be broken if a hook was used
		if = {
			limit = {
				OR = {
					scope:secondary_actor = { is_adult = no }
					scope:secondary_recipient = { is_adult = no }
				}
			}
			scope:secondary_actor = {
				set_variable = {
					name = hook_used_for_betrothal
					value = scope:secondary_recipient
				}
			}
		}
	}
	
	#Penalties for marrying a lowborn
	scope:actor = {
		if = {
			limit = {
				this = scope:secondary_actor # We check that you're marrying them yourself
				scope:secondary_recipient = { is_lowborn = yes }
			}
			# Vassal dispositions get aggy.
			## Actual effect applied in the on_marriage on_action.
			show_as_tooltip = {
				vassals_dislike_marry_lowborn_effect = {
					SPOUSE = scope:secondary_recipient
					RULER = scope:actor
				}
			}
			#Legitimacy loss for marrying a lowborn
			if = {
				limit = {
					is_valid_for_legitimacy_change = yes
					NOT = { has_variable = lowborn_legitimacy_cooldown }
					OR = {
						NOT = { exists = primary_spouse }
						primary_spouse ?= scope:secondary_recipient
					}
				}
				if = {
					limit = { is_ai = no }
					send_interface_toast = {
						type = event_toast_effect_good
						title = married_lowborn_toast
						left_icon = scope:actor
						add_legitimacy = {
							#EK EDIT: Less legitimacy penalty for marrying lowborns.
							#value = medium_legitimacy_loss
							value = minor_legitimacy_loss
							multiply = scope:actor.primary_title.tier
						}
					}
				}
				else = { # To avoid destroying polygamy AIs
					send_interface_toast = {
						type = event_toast_effect_good
						title = married_lowborn_toast
						left_icon = scope:actor
						add_legitimacy = { value = minor_legitimacy_loss }
					}
					hidden_effect = {
						set_variable = {
							name = lowborn_legitimacy_cooldown
							years = 10
						}
					}
				}
			}
		}
		if = {
			limit = {
				this = scope:secondary_recipient # We check that you're marrying them yourself
				scope:secondary_actor = { is_lowborn = yes }
			}
			# Vassal dispositions get aggy.
			## Actual effect applied in the on_marriage on_action.
			show_as_tooltip = {
				vassals_dislike_marry_lowborn_effect = {
					SPOUSE = scope:secondary_actor
					RULER = scope:actor
				}
			}
			#Legitimacy loss for marrying a lowborn
			if = {
				limit = {
					is_valid_for_legitimacy_change = yes
					NOT = { has_variable = lowborn_legitimacy_cooldown }
					OR = {
						NOT = { exists = primary_spouse }
						primary_spouse ?= scope:secondary_actor
					}
				}
				if = {
					limit = { is_ai = no }
					send_interface_toast = {
						type = event_toast_effect_good
						title = married_lowborn_toast
						left_icon = scope:actor
						add_legitimacy = {
							#EK EDIT: Less legitimacy penalty for marrying lowborns.
							#value = medium_legitimacy_loss
							value = minor_legitimacy_loss
							multiply = scope:actor.primary_title.tier
						}
					}
				}
				else = { # To avoid destroying polygamy AIs
					send_interface_toast = {
						type = event_toast_effect_good
						title = married_lowborn_toast
						left_icon = scope:actor
						add_legitimacy = { value = minor_legitimacy_loss }
					}
					hidden_effect = {
						set_variable = {
							name = lowborn_legitimacy_cooldown
							years = 10
						}
					}
				}
			}
		}
		else = { # If they're not a lowborn AND you and the recipient are both Nomad we may give you some Legitimacy
			if = {
				limit = {
					is_valid_for_nomadic_legitimacy_change = yes
					scope:recipient = { government_has_flag = government_is_nomadic }
					mpo_lower_nomad_authority_trigger = { CHARACTER = scope:recipient } # Only if recipient has higher Dominance than you
				}
				add_legitimacy = medium_legitimacy_gain
			}
		}
	}
	
	#No longer Herder
	if = {
		limit = {
			scope:secondary_recipient = {
				is_landed = yes
				government_has_flag = government_is_herder
			}
		}
		scope:actor = {
			switch = {
				trigger = has_government
				feudal_government = {
					scope:secondary_recipient = { change_government = feudal_government }
				}
				tribal_government = {
					scope:secondary_recipient = { change_government = tribal_government }
				}
				clan_government = {
					scope:secondary_recipient = { change_government = clan_government }
				}
				nomad_government = {
					scope:secondary_recipient = { change_government = nomad_government }
				}
				administrative_government = {
					scope:secondary_recipient = { change_government = administrative_government }
				}
				landless_adventurer_government = {
					scope:secondary_recipient = { change_government = landless_adventurer_government }
				}
			}
		}
	}

	#No longer concubine
	if = {
		limit = {
			scope:secondary_recipient = { is_concubine = yes }
		}
		scope:secondary_recipient = {
			random_consort = {
				limit = {
					any_concubine = { this = scope:secondary_recipient }
				}
				remove_concubine = scope:secondary_recipient
			}
		}
	}
	if = {
		limit = {
			scope:secondary_actor = { is_concubine = yes }
		}
		scope:secondary_actor = {
			random_consort = {
				limit = {
					any_concubine = { this = scope:secondary_actor }
				}
				remove_concubine = scope:secondary_actor
			}
		}
	}
	# A Grand Wedding was promised
	if = {
		limit = {
			scope:grand_wedding_promise = yes
		}
		set_grand_wedding_betrothal_variables = {
			SPOUSE_1 = scope:secondary_actor
			SPOUSE_2 = scope:secondary_recipient
			HOST = scope:actor
			PROMISEE = scope:recipient
		}
	}

	#Marriage notification events
	hidden_effect = {
		scope:actor = {
			if = {
				limit = { NOT = { this = scope:recipient } }
				trigger_event = marriage_interaction.0010
			}
			else = { #In my own court
				if = {
					limit = { #Betrothal?
						OR = {
							scope:secondary_actor = { is_adult = no }
							scope:secondary_recipient = { is_adult = no }
							scope:secondary_actor = { has_been_promised_grand_wedding = yes }
							scope:secondary_recipient = { has_been_promised_grand_wedding = yes }
						}
					}
					send_interface_toast = {
						type = event_toast_effect_good
						title = arrange_marriage_interaction_accept_betrothal_toast
						left_icon = scope:secondary_actor
						right_icon = scope:secondary_recipient
						custom_tooltip  = arrange_marriage_interaction_accept_betrothal_toast_desc
					}
				}
				else = {
					send_interface_toast = {
						type = event_toast_effect_good
						title = arrange_marriage_interaction_accept_toast
						left_icon = scope:secondary_actor
						right_icon = scope:secondary_recipient
						custom_tooltip  = arrange_marriage_interaction_accept_toast_desc
					}
				}
			}
		}

		# Apply any relevant opinion penalties for relatives of spouse.
		scope:secondary_actor = {
			if = { # Polygamy
				limit = {
					any_consort = {
						count >= 2
					}
				}
				every_consort = {
					# If the spouse themselves does not believe in polygamy...
					limit = {
						NOR = {
							culture = { has_cultural_tradition = tradition_polygamous }
							faith = { has_doctrine = doctrine_polygamy }
							faith = { has_doctrine = doctrine_concubines }
						}
					}

					#... then family members who also do not believe in polygamy aren't happy about having a relative forced into polygamous union with you.
					every_close_family_member = {
						if = {
							limit = { 
								NOR = {
									culture = { has_cultural_tradition = tradition_polygamous }
									faith = { has_doctrine = doctrine_polygamy }
									faith = { has_doctrine = doctrine_concubines }
								}
							}
							add_opinion = {
								target = scope:secondary_actor
								modifier = relative_in_blasphemous_union_opinion
							}
						}
					}

					# NOTE: Spouse's own opinions handled in the 'on_marriage' code on_action inside of marriage_concubinage.txt, and are not included here.
				}
			}
		}
		scope:secondary_recipient = {
			if = { #Same-sex relations
				limit = {
					allowed_to_marry_same_sex_trigger = no
					sex_same_as = scope:secondary_actor
				}
				every_close_family_member = {
					if = {
						limit = { 
							allowed_to_marry_same_sex_trigger = no
						}
						add_opinion = {
							target = scope:secondary_actor
							modifier = relative_in_blasphemous_union_opinion
						}
					}
				}
			}
		}
		# Courtly vassals like grand weddings
		scope:secondary_actor = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = courtly
					}
				}
				if = {
					limit = {
						has_been_promised_grand_wedding = yes
					}
					every_vassal = {
						limit = {
							has_vassal_stance = courtly
						}
						add_opinion = {
							target = scope:secondary_actor
							modifier = prestigious_wedding_opinion
						}
					}
				}
			}
		}
		scope:secondary_recipient = {
			if = {
				limit = {
					any_vassal = {
						has_vassal_stance = courtly
					}
				}
				if = {
					limit = {
						has_been_promised_grand_wedding = yes
					}
					every_vassal = {
						limit = {
							has_vassal_stance = courtly
						}
						add_opinion = {
							target = scope:secondary_recipient
							modifier = prestigious_wedding_opinion
						}
					}
				}
			}
		}
	}

	###MANAGEMENT SCRIPT FOR VARIOUS EVENTS/CONTENT###
	
	#If your spouse councillor had boosted the chance of marriage, remove modifier
	if = {
		limit = {
			scope:secondary_actor = {
				has_character_modifier = heir_easier_to_marry_off_modifier
			}
			scope:actor = { player_heir = scope:secondary_actor }
		}
		scope:secondary_actor = {
			remove_character_modifier = heir_easier_to_marry_off_modifier
		}
	}
	if = {
		limit = {
			scope:secondary_actor = {
				is_child_of = scope:actor
				has_character_modifier = child_easier_to_marry_off_modifier
			}
		}
		scope:secondary_actor = {
			remove_character_modifier = child_easier_to_marry_off_modifier
		}
	}

	#AI Break up consideration after marriage
	scope:secondary_recipient = { 
		if = {
			limit = {
				is_adult = yes
				is_ai = yes
			}
			scope:secondary_actor = { save_scope_as = new_spouse_secondary_actor }
			trigger_event = lover.0205
		}
	}
	scope:secondary_actor = {
		if = {
			limit = {
				is_adult = yes
				is_ai = yes
			}
			scope:secondary_recipient = { save_scope_as = new_spouse_secondary_recipient }
			trigger_event = lover.0205
		}
	}

	# Struggle parameters

	#interfaith wedding costs piety
	if = {
		limit = {
			scope:secondary_actor = {
				NOT = { faith = scope:secondary_recipient.faith }
			}
			scope:actor ={
				any_character_struggle = {
					has_struggle_phase_parameter = interfaith_marriages_between_involved_characters_costs_piety
				}
			}
		}
		scope:actor = {
			add_piety = major_piety_loss
		}
	}
	#interfaith wedding provides piety
	if = {
		limit = {
			scope:secondary_actor = {
				NOT = { faith = scope:secondary_recipient.faith }
			}
			scope:actor ={
				any_character_struggle = {
					has_struggle_phase_parameter = interfaith_marriages_between_involved_characters_gives_piety
				}
			}
		}
		scope:actor = {
			add_piety = medium_piety_gain
		}
	}

	#other stuff 
	#Khurramites and Mazdakists gain piety from marrying lowborn
	if = {
		limit = {
			scope:secondary_recipient = {
				is_lowborn = yes 
			}
			scope:actor.faith = {
				has_doctrine = tenet_communal_possessions 
			}
		}
		scope:actor = {
			add_piety = medium_piety_gain
		}
	}
}

concubine_on_accept_effect = {
	scope:recipient = {
		trigger_event = marriage_interaction.0040
		if = {
			# Victim is angry for being forced into concubinage.
			limit = {
				OR = {
					has_trait = celibate
					is_imprisoned = yes
				}
			}
			release_from_prison = yes
			add_opinion = {
				target = scope:actor
				modifier = forced_me_concubine_marriage_opinion
			}

			# Family members of victim are also angry that you've forced them into concubinage.
			every_close_family_member = {
				if = {
					limit = { 
						NOT = { this = scope:actor } # Don't hate yourself.
					}
					add_opinion = {
						target = scope:actor
						modifier = forced_family_concubine_marriage_opinion
					}
					hidden_effect = {
						send_interface_message = {
							type = msg_family_became_concubine
							title = msg_close_family_member_taken_as_concubine_title
							right_icon = scope:actor
							left_icon = scope:secondary_actor
							show_as_tooltip = { scope:actor = { make_concubine = scope:secondary_actor } }
						}
					}

					# Family members are even *more* angry if they don't believe in concubines/polyamory (different from polygamy). Also if they don't accept same-sex relationships
					if = {
						limit = { 
							OR = {
								NOT = { faith = { has_doctrine = doctrine_concubines } }
								NOT = { faith = { has_doctrine = tenet_polyamory } }
								AND = {
									allowed_to_marry_same_sex_trigger = no
									scope:recipient = { sex_same_as = scope:secondary_actor }
								}
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = relative_in_blasphemous_union_opinion
						}
					}
				}
			}	

			# Not up to them anymore...
			if = {
				limit = { has_trait = celibate }
				remove_trait = celibate
			}			
					
			# Spouses, if any exist, are also furious.
			if = {
				limit = {
					is_married = yes
				}
				every_spouse = {
					show_as_tooltip = {
						add_opinion = {
							target = scope:actor
							modifier = forced_spouse_concubine_marriage_opinion
						}
						divorce = scope:recipient # no additional opinion hit, no scripted effect
					}
					trigger_event = marriage_interaction.0041
				}
			}
					
			# Stealing concubines pisses the former concubinist off.
			if = {
				limit = {
					is_concubine = yes
				}
				this.concubinist = {
					show_as_tooltip = {
						add_opinion = {
							target = scope:secondary_actor
							modifier = stole_concubine_opinion
						}
						remove_concubine = scope:recipient # no additional opinion hit, no scripted effect
					}
					trigger_event = marriage_interaction.0041
				}
			}

			# Break any betrothals which may exist (without additional opinion penalties).
			if = {
				limit = { exists = betrothed }
				betrothed = { trigger_event = marriage_interaction.0041 }
				break_betrothal = betrothed
			}

			# Having concubines means they're now no longer yours.
			if = {
				limit = { number_of_concubines > 0	}
				every_concubine = {
					scope:recipient = {
						remove_concubine = prev
					}
				}
			}
		}
	}

	# Send us a notification about what we just did.
	scope:secondary_actor = {
		hidden_effect = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = msg_concubine_taken_title
				right_icon = scope:recipient
				make_concubine = scope:recipient
			}
		}
	}
}


#This effect has some small differences to the previous one since this one involves one extra person (the one you give a concubine to)
concubine_offer_on_accept_effect = {
	scope:secondary_actor = {
		trigger_event = marriage_interaction.0040
		if = {
			# Victim is angry for being forced into concubinage.
			limit = {
				is_imprisoned = yes
			}
			add_character_flag = {
				flag = block_release_from_prison_event
				days = 3
			}
			release_from_prison = yes
			add_opinion = {
				target = scope:actor
				modifier = forced_me_concubine_marriage_opinion
			}

			# Family members of victim are also angry that you've forced them into concubinage.
			every_close_family_member = {
				if = {
					limit = { 
						NOT = { this = scope:actor } # Don't hate yourself.
					}
					add_opinion = {
						target = scope:actor
						modifier = forced_family_concubine_marriage_opinion
					}
					hidden_effect = {
						send_interface_message = {
							type = msg_family_became_concubine
							title = msg_close_family_member_taken_as_concubine_title
							right_icon = scope:actor
							left_icon = scope:secondary_actor
							show_as_tooltip = { scope:actor = { make_concubine = scope:secondary_actor } }
						}
					}

					# Family members are even *more* angry if they don't believe in concubines/polyamory (different from polygamy). Also if they don't accept same-sex relationships
					if = {
						limit = { 
							OR = {
								NOT = { faith = { has_doctrine = doctrine_concubines } }
								NOT = { faith = { has_doctrine = tenet_polyamory } }
								AND = {
									allowed_to_marry_same_sex_trigger = no
									scope:recipient = { sex_same_as = scope:secondary_actor }
								}
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = relative_in_blasphemous_union_opinion
						}
					}
				}
			}
					
			# Spouses, if any exist, are also furious.
			if = {
				limit = {
					is_married = yes
					#A check to make sure you haven't somehow married them during the consideration time
					NOT = { any_spouse = { this = scope:recipient } }
				}
				every_spouse = {
					add_opinion = {
						target = scope:actor
						modifier = forced_spouse_concubine_marriage_opinion
					}
					divorce = scope:secondary_actor # no additional opinion hit, no scripted effect
					save_scope_value_as = { # For tooltips in the coming event
						name = was_spouse
						value = yes
					}
					trigger_event = marriage_interaction.0043
				}
			}
					
			# Stealing concubines pisses the former concubinist off.
			if = {
				limit = {
					is_concubine = yes
					#A check to make sure you haven't somehow gotten them as concubine during the consideration time
					NOT = { any_consort = { this = scope:recipient } }
				}
				this.concubinist = {
					if = {
						limit = {
							NOT = {
								this = scope:actor
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = stole_concubine_opinion
						}
						remove_concubine = scope:secondary_actor # no additional opinion hit, no scripted effect
						save_scope_value_as = { # For tooltips in the coming event
							name = was_concubine
							value = yes
						}
						trigger_event = marriage_interaction.0043
					}
					else = {
						remove_concubine = scope:secondary_actor # no additional opinion hit, no scripted effect
					}
				}
			}

			# Break any betrothals which may exist (without additional opinion penalties).
			if = {
				limit = {
					exists = betrothed
					#A check to make sure you haven't somehow gotten betrothed to them during the consideration time
					NOT = { betrothed = scope:recipient }
				}
				betrothed = { trigger_event = marriage_interaction.0043 }
				break_betrothal = betrothed
			}

			# Having concubines means they're now no longer yours.
			if = {
				limit = { number_of_concubines > 0	}
				every_concubine = {
					scope:secondary_actor = {
						remove_concubine = prev
					}
				}
			}
		}
		if = {
			limit = {
				is_concubine_of = scope:actor
			}
			scope:actor = {
				remove_concubine = scope:secondary_actor
			}
		}
		remove_character_flag = has_been_offered_as_concubine
	}

	# Send us a notification about what we just did. If the secondary_actor somehow ended up as a consort (spouse/concubine) or betrothed to recipient during the consideration time of this request we'll send a message about that instead (should only happen to AI tho)
	if = {
		limit = { #Invalidation message
			scope:secondary_actor = {
				OR = {
					any_consort = { count >= 1 }
					exists = betrothed
				}
			}
		}
		scope:secondary_actor = {
			# If they've somehow already become entangled with the recipient we tell this
			if = {
				limit = {
					OR = {
						is_consort_of = scope:recipient
						AND = {
							exists = betrothed
							betrothed = scope:recipient
						}
					}
				}
				scope:recipient = {
					save_scope_as = spouse
				}
			}
			# Else, if they've married or gotten betrothed to someone else, we say this
			else_if = {
				limit = {
					exists = betrothed
				}
				betrothed = {
					save_scope_as = spouse
				}
			}
			else = {
				random_consort = {
					limit = {
						this = scope:secondary_actor.primary_spouse
					}
					alternative_limit = {
						always = yes
					}
					save_scope_as = spouse
				}
			}
		}
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = msg_concubine_offered_invalidated_title
				right_icon = scope:recipient
				left_icon = scope:secondary_actor
				if = {
					limit = {
						scope:secondary_actor = { is_consort_of = scope:spouse }
					}
					custom_tooltip = msg_concubine_offered_invalidated_consort
				}
				else = {
					custom_tooltip = msg_concubine_offered_invalidated_betrothed
				}
			}
		}
		scope:recipient = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = msg_concubine_offered_invalidated_recipient_title
				right_icon = scope:actor
				left_icon = scope:secondary_actor
				if = {
					limit = {
						scope:secondary_actor = { is_consort_of = scope:spouse }
					}
					custom_tooltip = msg_concubine_offered_invalidated_consort
				}
				else = {
					custom_tooltip = msg_concubine_offered_invalidated_betrothed
				}
			}
		}
	}
	else = { #Proper notification
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = msg_concubine_offered_title
				right_icon = scope:recipient
				left_icon = scope:secondary_actor
				scope:recipient = {
					make_concubine = scope:secondary_actor
					if = { #Scale opinion gain a bit depending on how cool the concubine is
						limit = {
							scope:secondary_actor = {
								OR = {
									has_trait = beauty_good_2
									has_trait = beauty_good_3
									num_of_good_genetic_traits > 1
									has_relation_lover = scope:recipient
									has_relation_soulmate = scope:recipient
								}
								trigger_if = {
									limit = {
										is_female = yes
									}
									ek_human_age_equivalent < define:NChildbirth|MAX_FEMALE_REPRODUCTION_AGE #EK EDIT, equivalent age
								}
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = grateful_opinion
							opinion = 40
						}
					}
					else_if = {
						limit = {
							scope:secondary_actor = {
								OR = {
									is_lowborn = no
									has_trait = beauty_good_1
									num_of_good_genetic_traits > 0
									has_relation_friend = scope:recipient
									has_relation_best_friend = scope:recipient
								}
								trigger_if = {
									limit = {
										is_female = yes
									}
									ek_human_age_equivalent < define:NChildbirth|MAX_FEMALE_REPRODUCTION_AGE #EK EDIT, equivalent age
								}
							}
						}
						add_opinion = {
							target = scope:actor
							modifier = grateful_opinion
							opinion = 30
						}
					}
					else = {
						add_opinion = {
							target = scope:actor
							modifier = grateful_opinion
							opinion = 20
						}
					}
				}
			}
		}
	}
}

#This effect has some small differences AGAIN to the previous one since this one has some roles reversed
demand_concubine_interaction_on_accept_effect = {
	scope:secondary_actor = {
		trigger_event = marriage_interaction.0040
		if = {
			# Victim is angry for being forced into concubinage.
			limit = {
				is_imprisoned = yes
			}
			add_character_flag = {
				flag = block_release_from_prison_event
				days = 3
			}
			release_from_prison = yes
			add_opinion = {
				target = scope:actor
				modifier = forced_me_concubine_marriage_opinion
			}
		}
		
		# Family members of victim are also angry that you've forced them into concubinage.
		every_close_family_member = {
			if = {
				limit = { 
					NOT = { this = scope:actor } # Don't hate yourself.
				}
				add_opinion = {
					target = scope:actor
					modifier = forced_family_concubine_marriage_opinion
				}
				hidden_effect = {
					send_interface_message = {
						type = msg_family_became_concubine
						title = msg_close_family_member_taken_as_concubine_title
						right_icon = scope:actor
						left_icon = scope:secondary_actor
						show_as_tooltip = { scope:actor = { make_concubine = scope:secondary_actor } }
					}
				}

				# Family members are even *more* angry if they don't believe in concubines/polyamory (different from polygamy). Also if they don't accept same-sex relationships
				if = {
					limit = { 
						OR = {
							NOT = { faith = { has_doctrine = doctrine_concubines } }
							NOT = { faith = { has_doctrine = tenet_polyamory } }
							AND = {
								allowed_to_marry_same_sex_trigger = no
								scope:recipient = { sex_same_as = scope:secondary_actor }
							}
						}
					}
					add_opinion = {
						target = scope:actor
						modifier = relative_in_blasphemous_union_opinion
					}
				}
			}
		}
				
		# Spouses, if any exist, are also furious.
		if = {
			limit = {
				is_married = yes
				#A check to make sure you haven't somehow married them during the consideration time
				NOT = { any_spouse = { this = scope:actor } }
			}
			every_spouse = {
				if = {
					limit = {
						NOT = {
							this = scope:recipient
						}
					}
					add_opinion = {
						target = scope:actor
						modifier = forced_spouse_concubine_marriage_opinion
					}
				}
				divorce = scope:secondary_actor # no additional opinion hit, no scripted effect
				save_scope_value_as = { # For tooltips in the coming event
					name = was_spouse
					value = yes
				}
			}
		}
				
		# Stealing concubines pisses the former concubinist off.
		if = {
			limit = {
				is_concubine = yes
				#A check to make sure you haven't somehow gotten them as concubine during the consideration time
				NOT = { any_consort = { this = scope:actor } }
			}
			this.concubinist = {
				if = {
					limit = {
						NOT = {
							this = scope:recipient
						}
					}
					add_opinion = {
						target = scope:actor
						modifier = stole_concubine_opinion
					}
				}
				remove_concubine = scope:secondary_actor # no additional opinion hit, no scripted effect
			}
		}

		# Break any betrothals which may exist (without additional opinion penalties).
		if = {
			limit = {
				exists = betrothed
				#A check to make sure you haven't somehow gotten betrothed to them during the consideration time
				NOT = { betrothed = scope:actor }
			}
			break_betrothal = betrothed
		}

		# Having concubines means they're now no longer yours.
		if = {
			limit = { number_of_concubines > 0	}
			every_concubine = {
				scope:secondary_actor = {
					remove_concubine = prev
				}
			}
		}
		
		if = {
			limit = {
				is_concubine_of = scope:recipient
			}
			scope:recipient = {
				remove_concubine = scope:secondary_actor
			}
		}
		remove_character_flag = has_been_offered_as_concubine
	}

	# Send us a notification about what we just did.
	scope:actor = {
		send_interface_toast = {
			type = event_toast_effect_neutral
			title = msg_concubine_offered_reversed_title
			right_icon = scope:recipient
			left_icon = scope:secondary_actor
			scope:actor = {
				make_concubine = scope:secondary_actor
				if = { #Scale opinion gain a bit depending on how cool the concubine is
					limit = {
						scope:secondary_actor = {
							OR = {
								has_trait = beauty_good_2
								has_trait = beauty_good_3
								num_of_good_genetic_traits > 1
								has_relation_lover = scope:actor
								has_relation_soulmate = scope:actor
							}
							trigger_if = {
								limit = {
									is_female = yes
								}
								age < define:NChildbirth|MAX_FEMALE_REPRODUCTION_AGE
							}
						}
					}
					add_opinion = {
						target = scope:recipient
						modifier = grateful_opinion
						opinion = 40
					}
				}
				else_if = {
					limit = {
						scope:secondary_actor = {
							OR = {
								is_lowborn = no
								has_trait = beauty_good_1
								num_of_good_genetic_traits > 0
								has_relation_friend = scope:actor
								has_relation_best_friend = scope:actor
							}
							trigger_if = {
								limit = {
									is_female = yes
								}
								age < define:NChildbirth|MAX_FEMALE_REPRODUCTION_AGE
							}
						}
					}
					add_opinion = {
						target = scope:recipient
						modifier = grateful_opinion
						opinion = 30
					}
				}
				else = {
					add_opinion = {
						target = scope:recipient
						modifier = grateful_opinion
						opinion = 20
					}
				}
			}
		}
	}
}

divorce_effect = {
	$DIVORCER$ = {
		if = {
			limit = {
				any_spouse = {
					this = $DIVORCEE$
				}
			}
			divorce = $DIVORCEE$
		}
		# EK EDIT: only give opinion hit if culture doesn't fully accept divorce
		# reverse_add_opinion = {
		# 	modifier = divorced_me_opinion
		# 	target = $DIVORCEE$
		# }
		if = {
			limit = {
				$DIVORCEE$ = { 
					NOT = {
						culture = { has_cultural_parameter = free_divorce }
					}
				}
			}
			reverse_add_opinion = {
				modifier = divorced_me_opinion
				target = $DIVORCEE$
			}
		}
	}
	# Opinion hit
	# EK EDIT: same as above
		# $DIVORCEE$ = {
	# 	every_close_or_extended_family_member = {
	# 		limit = { NOT = { this = $DIVORCER$ } } # don't hate yourself just because of some incest
	# 		custom = all_family_members
			
	# 		add_opinion = {
	# 			modifier = divorced_close_kin
	# 			target = $DIVORCER$
	# 		}
	# 	}
	# }
	if = {
		limit = {
			$DIVORCEE$ = { 
				NOT = {
					culture = { has_cultural_parameter = free_divorce }
				}
			}
		}
		$DIVORCEE$ = {
			every_close_or_extended_family_member = {
				limit = { NOT = { this = $DIVORCER$ } } # don't hate yourself just because of some incest
				custom = all_family_members
				
				add_opinion = {
					modifier = divorced_close_kin
					target = $DIVORCER$
				}
			}
		}
	}

	if = {
		limit = {
			$DIVORCER$ = {
				has_character_modifier = rejected_from_marriage_bed_modifier
			}
		}
		$DIVORCER$ = { remove_character_modifier = rejected_from_marriage_bed_modifier }
	}
	if = {
		limit = {
			$DIVORCEE$ = {
				has_character_modifier = rejected_from_marriage_bed_modifier
			}
		}
		$DIVORCEE$ = { remove_character_modifier = rejected_from_marriage_bed_modifier }
	}
	#EK TODO COMP 1-13: check how this works with Lilmoth tradition
	if = {
		limit = { $DIVORCER$ = { has_relation_lover = $DIVORCEE$ } }
		lover_breakup_effect = {
			BREAKER = $DIVORCER$
			LOVER = $DIVORCEE$
		}			
	}
}

less_verbose_divorce_effect = {
	$DIVORCER$ = {
		if = {
			limit = {
				any_spouse = {
					this = $DIVORCEE$
				}
			}
			divorce = $DIVORCEE$
		}
		
		hidden_effect = {
			reverse_add_opinion = {
				modifier = divorced_me_opinion
				target = $DIVORCEE$
			}
		}
	}
	hidden_effect = {
		# Opinion hit
		$DIVORCEE$ = {
			every_close_or_extended_family_member = {
				limit = { NOT = { this = $DIVORCER$ } } # don't hate yourself just because of some incest
				custom = all_family_members
				add_opinion = {
					modifier = divorced_close_kin
					target = $DIVORCER$
				}
			}
		}

		if = {
			limit = {
				$DIVORCER$ = {
					has_character_modifier = rejected_from_marriage_bed_modifier
				}
			}
			$DIVORCER$ = { remove_character_modifier = rejected_from_marriage_bed_modifier }
		}
		if = {
			limit = {
				$DIVORCEE$ = {
					has_character_modifier = rejected_from_marriage_bed_modifier
				}
			}
			$DIVORCEE$ = { remove_character_modifier = rejected_from_marriage_bed_modifier }
		}
	}
	#EK TODO COMP 1-13: check how this works with Lilmoth tradition
	if = {
		limit = { $DIVORCER$ = { has_relation_lover = $DIVORCEE$ } }
		lover_breakup_effect = {
			BREAKER = $DIVORCER$
			LOVER = $DIVORCEE$
		}			
	}	
}

marriage_soulmate_exclusivity_confrontation_effect = {
	$SPOUSE_1$ = { add_to_temporary_list = new_spouses }
	$SPOUSE_2$ = { add_to_temporary_list = new_spouses }

	every_in_list = {
		list = new_spouses
		limit = {
			any_relation = {
				type = soulmate
				NOT = { is_in_list = new_spouses }
			}
		}
		add_character_flag = {
			flag = can_be_confronted_about_lover_exclusivity
			days = 1825
		}
	}
}

# CHARACTER = character we check for if they should send a message
# SPOUSE = the spouse in this divorce
# scope:reason = flag:script or flag:faith
send_divorce_notifications_effect = {
	$CHARACTER$ = {
		if = {
			limit = {
				is_ai = no
			}
			switch = {
				trigger = scope:reason
				flag:script = {
					send_interface_message = {
						type = msg_divorce
						left_icon = $SPOUSE$
					}
				}
				flag:faith = {
					send_interface_message = {
						type = msg_spouse_invalidated
						left_icon = $SPOUSE$
					}
				}
			}
		}
		else_if = {
			limit = {
				any_heir_title = {
					exists = holder
					holder = { is_ai = no }
				}
			}
			every_heir_title = {
				limit = {
					exists = holder
					holder = { is_ai = no }
				}
				holder = {
					if = {
						limit = {
							NOT = { is_in_list = had_notification_sent } 
						}
						add_to_list = had_notification_sent
						switch = {
							trigger = scope:reason
							flag:script = {
								send_interface_message = {
									type = msg_divorce_player_heir
									left_icon = $CHARACTER$
									right_icon = $SPOUSE$
								}
							}
							flag:faith = {
								send_interface_message = {
									type = msg_spouse_invalidated_player_heir
									left_icon = $CHARACTER$
									right_icon = $SPOUSE$
								}
							}
						}
					}
				}
			}
		}
	}
}

# CHARACTER = character we check for if they should send a message
# BETROTHED = the other person in the betrothal
# scope:reason = flag:timeout, flag:death, flag:faith, or flag:script
send_break_betrothal_notifications_effect = {
	$CHARACTER$ = {
		if = {
			limit = {
				is_ai = no
			}
			switch = {
				trigger = scope:reason
				flag:script = {
					send_interface_message = {
						type = msg_break_betrothal
						left_icon = $BETROTHED$
					}
				}
				flag:faith = {
					send_interface_message = {
						type = msg_betrothal_invalidated
						left_icon = $BETROTHED$
					}
				}
				# flag:death is hanlded by normal death management events
				# flag:timeout is hanlded by caller separately
			}
		}
		else_if = {
			limit = {
				any_heir_title = {
					exists = holder
					holder = { is_ai = no }
				}
			}
			every_heir_title = {
				limit = {
					holder = { is_ai = no }
				}
				holder = {
					if = {
						limit = {
							NOT = { is_in_list = had_notification_sent }
						}
						add_to_list = had_notification_sent
						switch = {
							trigger = scope:reason
							flag:script = {
								send_interface_message = {
									type = msg_break_betrothal_player_heir
									left_icon = $CHARACTER$
									right_icon = $BETROTHED$
								}
							}
							flag:faith = {
								send_interface_message = {
									type = msg_betrothal_invalidated_player_heir
									left_icon = $CHARACTER$
									right_icon = $BETROTHED$
								}
							}
							# flag:death is hanlded by normal death management events
							# flag:timeout is hanlded by caller separately
						}
					}
				}
			}
		}
	}
}



# When you take spouses/concubines whose Faith does not permit that union, they will gain opinion penalties.
# This effect adds/updates/replaces/removes those opinion penalties, as approprite to the current situation.
update_active_consort_opinion_effect = {

	# If we currently have any existing consort opinion modifiers, check if they should be downgraded from permanent modifiers to decaying modifiers.
	downgrade_invalid_consort_opinions_effect = { PARTNER = $PARTNER$ }

	if = {
		# If this opinion change was triggered by being divorced/set-aside, we may still technically be married/joined to PARTNER at this moment, but we won't be very shortly and should skip this step.
		limit = {
			NOR = {
				exists = scope:is_being_divorced
				exists = scope:is_being_set_aside
			}
		}

		# Oterwise, apply any new consort opinion effects that are applicable.
		if = {
			# Characters who do not believe in concubinage, but are forced into it, have the harshest opinion penalties.
			limit = {
				is_concubine_of = $PARTNER$
				NOT = { faith = { has_doctrine = doctrine_concubines }}
				NOT = { culture = { has_cultural_tradition = tradition_concubines } }
			}
			if = {
				# Harshest opinion penalty if they are a concubine but believe in monogamy
				limit = { faith = { has_doctrine = doctrine_monogamy }}
				add_opinion = {
					target = $PARTNER$
					modifier = concubine_with_monogamous_faith_opinion
				}
			}
			else_if = {
				# Lesser-but-still-harsh opinion penalty if they are a concubine but believe in polygamy
				limit = {
					OR = {
						culture = { has_cultural_tradition = tradition_polygamous }
						faith = { has_doctrine = doctrine_polygamy }
					}
				}
				add_opinion = {
					target = $PARTNER$
					modifier = concubine_with_polygamous_faith_opinion
				}
			}
		}
		else_if = {
			# Characters who are legitimate spouses of their partner, but do not approve of their partner's other spouses/concubines, will have milder opinion penalties.
			limit = {
				is_spouse_of = $PARTNER$
				$PARTNER$ = { any_consort = { count >= 2 }}
				NOT = { faith = { has_doctrine = doctrine_concubines }}
				NOT = { faith = { has_doctrine = tenet_polyamory }}
				NOT = { culture = { has_cultural_tradition = tradition_concubines } }
			}
			if = {
				limit = {
					$PARTNER$ = { any_concubine = { count >= 1 }}
				}
				add_opinion = {
					target = $PARTNER$
					modifier = spouse_does_not_believe_in_concubines_opinion
				}
				#Remove the opinion modifier if you flip-flop and go get concubines after getting rid of them all...
				remove_opinion = {
					target = $PARTNER$
					modifier = spouse_does_not_believe_in_former_concubines_opinion
				}
			}
			else_if = {
				limit = {
					NOR = { 
						culture = { has_cultural_tradition = tradition_polygamous }
						faith = { has_doctrine = doctrine_polygamy }
					}
				}
				add_opinion = {
					target = $PARTNER$
					modifier = polygamous_marriage_opinion
				}
			}
		}
		#Same-sex not accepted penalty
		if = {
			limit = {
				allowed_to_marry_same_sex_trigger = no
				sex_same_as = $PARTNER$
			}
			add_opinion = {
				target = $PARTNER$
				modifier = same_sex_with_no_acceptance_opinion
			}
		}
	}
}

# Checks if we have any permanent opinion modifiers which are no longer applicable. If so, downgrade them to decaying opinion modifiers.
downgrade_invalid_consort_opinions_effect = {
	if = {
		limit = {
			has_opinion_modifier = {
				modifier = concubine_with_monogamous_faith_opinion
				target = $PARTNER$
			}
			OR = {
				# We are no longer a concubine of PARTNER...
				NOT = { is_concubine_of = $PARTNER$ }
				# ...or will no longer be a concubine of them.
				trigger_if = {
					limit = { exists = scope:is_being_set_aside}
					scope:is_being_set_aside = this
				}

				# Or, our Faith has changed to permit us being a concubine.
				faith = { has_doctrine = doctrine_concubines }
			}
		}
		remove_opinion = {
			modifier = concubine_with_monogamous_faith_opinion
			target = $PARTNER$
		}
		add_opinion = {
			modifier = formerly_concubine_with_monogamous_faith_opinion
			target = $PARTNER$
		}
	}

	if = {
		limit = {
			has_opinion_modifier = {
				modifier = concubine_with_polygamous_faith_opinion
				target = $PARTNER$
			}
			OR = {
				# We are no longer a concubine of PARTNER...
				NOT = { is_concubine_of = $PARTNER$ }
				# ...or will no longer be a concubine of them.
				trigger_if = {
					limit = { exists = scope:is_being_set_aside}
					scope:is_being_set_aside = this
				}

				# Or, our Faith has changed to permit us being a concubine.
				faith = { has_doctrine = doctrine_concubines }
			}
		}
		remove_opinion = {
			modifier = concubine_with_polygamous_faith_opinion
			target = $PARTNER$
		}
		add_opinion = {
			modifier = formerly_concubine_with_polygamous_faith_opinion
			target = $PARTNER$
		}
	}

	if = {
		limit = {
			has_opinion_modifier = {
				modifier = spouse_does_not_believe_in_concubines_opinion
				target = $PARTNER$
			}
			OR = {
				# We are no longer married to PARTNER...
				NOT = { is_spouse_of = $PARTNER$ }
				# ...or will no longer be married to them.
				trigger_if = {
					limit = { exists = scope:is_being_divorced}
					scope:is_being_divorced = this
				}

				# Or, the offending relationship no longer exists.
				$PARTNER$ = { any_concubine = {	count = 0 }}
				AND = {
					# The last remaining concubine is being set aside, leaving none.
					exists = scope:is_being_set_aside
					$PARTNER$ = { any_concubine = { count = 1 }}
				}

				# Or, our Faith has changed to permit the relationship.
				faith = { has_doctrine = doctrine_concubines }
				faith = { has_doctrine = tenet_polyamory }
			}
		}
		remove_opinion = {
			modifier = spouse_does_not_believe_in_concubines_opinion
			target = $PARTNER$
		}
		add_opinion = {
			modifier = spouse_does_not_believe_in_former_concubines_opinion
			target = $PARTNER$
		}
	}

	if = {
		limit = {
			has_opinion_modifier = {
				modifier = polygamous_marriage_opinion
				target = $PARTNER$
			}
			OR = {
				# We are no longer married to PARTNER...
				NOT = { is_spouse_of = $PARTNER$ }
				# ...or will no longer be married to them.
				trigger_if = {
					limit = { exists = scope:is_being_divorced}
					scope:is_being_divorced = this
				}

				# Or, the offending relationship no longer exists.
				$PARTNER$ = { any_spouse = { count = 1 }}
				AND = {
					# One of the 2 remaining spouses will be divorced next tick, leaving only 1.
					exists = scope:is_being_divorced 
					$PARTNER$ = { any_spouse = { count = 2 }}
				}

				# Or, our Faith has changed to permit the relationship.
				faith = { has_doctrine = doctrine_concubines }
				culture = { has_cultural_tradition = tradition_polygamous }
				faith = { has_doctrine = doctrine_polygamy }
				faith = { has_doctrine = tenet_polyamory }
			}
		}
		remove_opinion = {
			modifier = polygamous_marriage_opinion
			target = $PARTNER$
		}
		add_opinion = {
			modifier = former_polygamous_marriage_opinion
			target = $PARTNER$
		}
	}

	if = {
		limit = {
			has_opinion_modifier = {
				modifier = same_sex_with_no_acceptance_opinion
				target = $PARTNER$
			}
			OR = {
				# We are no partner of PARTNER...
				NOT = { is_consort_of = $PARTNER$ }
				# ...or will no longer be married to them
				trigger_if = {
					limit = { exists = scope:is_being_divorced}
					scope:is_being_divorced = this
				}
				# ...or will no longer be a concubine of them
				trigger_if = {
					limit = { exists = scope:is_being_set_aside}
					scope:is_being_set_aside = this
				}

				# Or, the offending relationship no longer exists.
				sex_opposite_of = $PARTNER$

				# Or, our Faith has changed to permit the relationship.
				allowed_to_marry_same_sex_trigger = yes
			}
		}
		remove_opinion = {
			modifier = same_sex_with_no_acceptance_opinion
			target = $PARTNER$
		}
		add_opinion = {
			modifier = former_same_sex_with_no_acceptance_opinion
			target = $PARTNER$
		}
	}
}

##### EP2 - You promised a Grand Wedding and failed to deliver it
break_grand_wedding_betrothal_effect = {
	# Uniform the scopes between breaking a betrothal with the interaction and saying no at the altar
	if = {
		limit = {
			exists = scope:spouse_1
			exists = scope:spouse_2
		}
		scope:spouse_1 = { save_scope_as = rejecting_betrothed }
		scope:spouse_2 = { save_scope_as = rejected_betrothed }
		root = { save_scope_as = actor }
	}
	scope:rejecting_betrothed.var:promised_grand_wedding_by ?= {
		save_scope_as = promising_host
	}
	# Save the offended party
	scope:rejected_betrothed = {
		if = {
			limit = {
				matchmaker = {
					NOT = { this = scope:rejected_betrothed }
				}
			}
			matchmaker = { save_scope_as = rejected_betrothal_owner }
		}
		else = { #The betrothed accepted the wedding for themselves
			save_scope_as = rejected_betrothal_owner
		}
	}
	# First of all, the betrothal is broken
	scope:rejecting_betrothed = {
		break_betrothal = scope:rejected_betrothed
	}
	# If an alliance was connected to this, the alliance is broken
	if = {
		limit = {
			yields_alliance = {
				candidate = scope:rejecting_betrothed
				target = scope:rejected_betrothal_owner
				target_candidate = scope:rejected_betrothed
			}
		}
		break_alliance = scope:rejected_betrothal_owner
	}
	# Opinion hit if there were no legitimate reason
	scope:rejected_betrothed = {
		if = {
			limit = {
				is_eunuch_trigger = no
				scope:rejecting_betrothed = { is_eunuch_trigger = no }
				NOR = {
					scope:rejecting_betrothed = {
						allowed_to_marry_same_sex_trigger = no
						sex_same_as = scope:rejected_betrothed
					}
					AND = {
						allowed_to_marry_same_sex_trigger = no
						sex_same_as = scope:rejecting_betrothed
					}
				}
			}
			add_opinion = {
				target = scope:actor
				modifier = broke_betrothal_grand_wedding_opinion
				opinion = -50
			}
			
			if = {
				limit = {
					scope:rejecting_betrothed = {
						NOT = { this = scope:actor }
					}
				}
				
				add_opinion = {
					target = scope:rejecting_betrothed
					modifier = broke_betrothal_grand_wedding_opinion
					opinion = -50
				}
			}
			if = {
				limit = {
					NOT = { this = scope:rejected_betrothal_owner }
				}
				scope:rejected_betrothal_owner = {
					add_opinion = {
						target = scope:actor
						modifier = broke_betrothal_grand_wedding_opinion
						opinion = -50
					}
						
					if = {
						limit = {
							scope:rejecting_betrothed = {
								NOT = { this = scope:actor }
							}
						}
						
						add_opinion = {
							target = scope:rejecting_betrothed
							modifier = broke_betrothal_grand_wedding_opinion
							opinion = -50
						}
					}
				}
			}
		}
	}
	# Regular Break Betrothal has a standard loss of prestige, but we need more
	add_prestige_level = -1
	if = {
		limit = {
			OR = {
				scope:rejected_betrothed = { highest_held_title_tier = tier_empire }
				scope:rejected_betrothal_owner = { highest_held_title_tier = tier_empire }
			}
			
		}
		add_prestige = monumental_prestige_loss
	}

	else_if = {
		limit = {
			OR = {
				scope:rejected_betrothed = { highest_held_title_tier = tier_kingdom }
				scope:rejected_betrothal_owner = { highest_held_title_tier = tier_kingdom }
			}
		}
		add_prestige = massive_prestige_loss
	}

	else_if = {
		limit = {
			OR = {
				scope:rejected_betrothed = { highest_held_title_tier = tier_duchy }
				scope:rejected_betrothal_owner = { highest_held_title_tier = tier_duchy }
			}
		}
		add_prestige = major_prestige_loss
	}

	else_if = {
		limit = {
			OR = {
				scope:rejected_betrothed = { highest_held_title_tier = tier_county }
				scope:rejected_betrothal_owner = { highest_held_title_tier = tier_county }
			}
		}
		add_prestige = medium_prestige_loss
	}

	else_if = {
		limit = {
			OR = {
				scope:rejected_betrothed = { highest_held_title_tier = tier_barony }
				scope:rejected_betrothal_owner = { highest_held_title_tier = tier_barony }
			}
		}
		add_prestige = minor_prestige_loss
	}
	else = { add_prestige = miniscule_prestige_loss }
	# Start a Feud, if possible!
	if = {
		limit = {
			has_dlc_feature = friends_and_foes
			exists = scope:rejected_betrothal_owner.house.house_head
			exists = scope:rejecting_betrothed.house.house_head
			NOT = { scope:rejected_betrothal_owner.house = scope:rejecting_betrothed.house }
		}
		scope:rejected_betrothal_owner.house.house_head = {
			if = { 
				limit = { this = scope:rejected_betrothed } # Rejected betrothed is also House Head
				house_feud_start_effect = {
					# Feuding House Head
					ACTOR = scope:rejected_betrothal_owner.house.house_head
					# Target House Head
					TARGET = scope:rejecting_betrothed.house.house_head
					# Feud Reason
					REASON = head_broke_gw_betrothal
					# House Member attacker if relevant 
					ATTACKER = scope:rejecting_betrothed
					# House Member victim if relevant
					VICTIM = scope:rejected_betrothed
				}
			}
			else = {
				house_feud_start_effect = {
					# Feuding House Head
					ACTOR = scope:rejected_betrothal_owner.house.house_head
					# Target House Head
					TARGET = scope:rejecting_betrothed.house.house_head
					# Feud Reason
					REASON = family_broke_gw_betrothal
					# House Member attacker if relevant 
					ATTACKER = scope:rejecting_betrothed
					# House Member victim if relevant
					VICTIM = scope:rejected_betrothed
				}
			}
		}
	}
	# If you say no at the altar, there are some extra consequences
	if = {
		limit = {
			scope:rejecting_betrothed = { has_character_flag = grand_wedding_said_no }
		}
		scope:rejecting_betrothed = {
			ek_give_nickname_effect = { NICKNAME = nick_the_naysayer } #EK EDIT
			if = {
				limit = {
					NOT = { this = scope:actor }
				}
				reverse_add_opinion = {
					target = scope:actor
					modifier = challenged_authority_opinion
				}
			}
		}
	}
	# Finally, the promise is wiped off
	scope:rejecting_betrothed = {
		var:promised_grand_wedding_by = {
			remove_variable = promised_grand_wedding_marriage_countdown
		}
		remove_variable = promised_grand_wedding_by
	}
	scope:rejected_betrothed = {
		remove_variable = promised_grand_wedding_by
	}
}
