sane_take_holy_vows_decision = {

	picture = "gfx/interface/illustrations/decisions/decision_major_religion.dds"
	ai_check_interval = 180
	is_shown = {
		NOT = {has_trait = order_member}
		is_capable_adult_ai = yes
		is_landed = no
		is_house_head = no
		faith = {has_doctrine_parameter = clergy_can_fight} ## Will be able to become a commander/knight.
		OR = { ## Gender Eligibility
			AND = {
				is_male = yes
				faith = {
					OR = {
						has_doctrine_parameter = clergy_must_be_male
						has_doctrine_parameter = clergy_can_be_either_gender
					}
				}
			}
			AND = {
				is_female = yes
				faith = {
					OR = {
						has_doctrine_parameter = clergy_must_be_female
						has_doctrine_parameter = clergy_can_be_either_gender
					}
				}
			}
		}
		OR = { ## Marriage Eligibility
			is_married = no	
			faith = { has_doctrine_parameter = clergy_can_marry }
		}
	}
	
	is_valid = {
		NOT = { ## We don't want characters with realistic heir potential to take the vows
			any_held_title = {
				place_in_line_of_succession = {
					target = root
						value <=3
				}
			}
		}
		NOR = { ## Not excommunicated or head of faith, and needs to be knight eligible afterwards
			has_trait = excommunicated
			prowess < 6
			faith.religious_head = this
		}
	}
		
	effect = {
		add_trait = order_member ## Welcome to holy knighthood
		every_player = {
			limit = {
				OR = { ## Tell family their daughter is holier than thou
					this = root.mother
					this = root.father
					house = root.house
				}
			}
			send_interface_message = {
				title = sane_holy_vows.t
				desc = sane_holy_vows.desc
				type = event_prowess_good_desc
				right_icon = root
			}
		}
	}
	
	ai_will_do = {
		base = 0

		modifier = {
			add = 10
			num_virtuous_traits >= 1 ## Only give any weight if character has at least 1 Virtuous trait
		}
		modifier = {
			add = -9
			num_sinful_traits >= 1 ## Greatly reduce chances for every Sinful trait
		}
		modifier = {
			add = 10
			has_trait = zealous ## Fanatic
		}
		modifier = {
			factor = 10 ## Much virtue, good very.
			num_virtuous_traits >= 2
		}
		modifier = {
			factor = 0.2 ## Much sin, but hope not lost entirely.
			num_sinful_traits >=2
		}
		modifier = {
			factor = 2 ## Am getting old.
			AND = {
				age > 20
				is_married = no
			}
		}
	}
}