﻿take_vows_interaction = {
	category = debug
	common_interaction = yes
	icon = legend
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes
	desc = force_vows_interaction_desc
	is_shown = {
		scope:recipient = {
			AND = {
				age < 16
				OR = {
					is_child_of = scope:actor
					is_courtier_of = scope:actor
				}
				is_married = no
				NOT = {
					has_trait = devoted
				}
			}
		}
	}
	on_accept = {
		scope:recipient = {
			if = {
				limit = {
					is_heir_of = scope:actor
				}
				add_opinion = {
					modifier = forced_heir_to_take_vows
					target = scope:actor
				}
			}
			else = {
				add_opinion = {
					modifier = demanded_taking_vows
					target = scope:actor
				}
			}
			add_trait = devoted
			if = {
				limit = {
					is_ruler = yes
				}
				depose = yes
			}
		}
		scope:actor = {
			add_piety = 50
			hidden_effect = {
				number_of_children_given_away_effect = yes
			}
			if = {
				limit = {
					scope:recipient = {
						is_heir_of = scope:actor
					}
				}
				add_stress = {
					add = major_stress_gain
				}
			}
		}
	}
	auto_accept = yes
	ai_will_do = 50
}

force_order_interaction = {
	category = debug
	common_interaction = yes
	icon = legend
	use_diplomatic_range = no
	ignores_pending_interaction_block = yes
	desc = force_vows_interaction_desc # You might want to update this DESC key for the new interaction
	is_shown = {
		scope:recipient = {
			AND = {
				age < 16
				OR = {
					is_child_of = scope:actor
					is_courtier_of = scope:actor
				}
				is_married = no
				NOT = {
					# This condition now checks if the recipient already has the order_member trait
					has_trait = order_member 
				}
			}
		}
	}
	on_accept = {
		scope:recipient = {
			if = {
				limit = {
					is_heir_of = scope:actor
				}
				add_opinion = {
					modifier = forced_heir_to_take_vows # You might want to create new opinion modifiers here
					target = scope:actor
				}
			}
			else = {
				add_opinion = {
					modifier = demanded_taking_vows # You might want to create new opinion modifiers here
					target = scope:actor
				}
			}
			# --- Trait Change Here ---
			add_trait = order_member 
			# -------------------------
			if = {
				limit = {
					is_ruler = yes
				}
				depose = yes
			}
		}
		scope:actor = {
			add_piety = 50
			hidden_effect = {
				number_of_children_given_away_effect = yes
			}
			if = {
				limit = {
					scope:recipient = {
						is_heir_of = scope:actor
					}
				}
				add_stress = {
					add = major_stress_gain
				}
			}
		}
	}
	auto_accept = yes
	ai_will_do = 50
}