﻿####################
# ADOPTION INTERACTIONS
####################

namespace = adoption

# Adoption accepted
adoption.0001 = {
	type = letter_event
	opening = {
		desc = adoption.0001.opening
	}
	desc = adoption.0001.desc
	sender = scope:recipient

	option = {
		name = adoption.0001.a
		play_music_cue = "mx_cue_touching_moment"
		adopt_effect = {
			CHILD = scope:recipient
			ADOPTER = scope:actor
		}
		create_character_memory = {
			type = adopted_a_child
			participants = {
				child = scope:recipient
			}
		}
		scope:recipient = {
			create_character_memory = {
				type = was_adopted
				participants = {
					parent = scope:actor
				}
			}

			#Enters into blood brotherhood family bond
			if = {
				limit = {
					any_parent = {
						has_blood_brother = yes
					}
				}
				every_parent = {
					limit = {
						has_blood_brother = yes	
					}
					random_relation = {
						type = blood_brother
						save_scope_as = other_blood_brother
					}
				}
				mpo_blood_brother_new_family_member_opinion_effect = yes
			}
		}
	}
}

# Adventurer Adoption accepted
adoption.0002 = {
	type = letter_event
	opening = {
		desc = adoption.0001.opening
	}
	desc = adoption.0002.desc
	sender = scope:recipient

	option = {
		name = adoption.0002.a
		play_music_cue = "mx_cue_touching_moment"
		adventurer_adopt_effect = {
			CHILD = scope:recipient
			ADOPTER = scope:actor
		}
		set_designated_heir = scope:recipient
		create_character_memory = {
			type = adventurer_family_adopted
			participants = {
				adoptee = scope:recipient
			}
		}
		scope:new_memory = {
			set_variable = {
				name = adopted_dynasty
				value = scope:actor.dynasty
			}
		}
		scope:recipient = {
			create_character_memory = {
				type = was_adventurer_family_adopted
				participants = {
					adopter = scope:actor
				}
			}
			scope:new_memory = {
				set_variable = {
					name = adopted_dynasty
					value = scope:actor.dynasty
				}
			}
		}
	}

	after = {
		if = {
			limit = { exists = var:adopted_dynasty } # Error suppression 
		}
	}
}
