﻿##########################
# Christian Faith Tenets #
##########################
tenet_rite = {
	icon = core_tenet_rite

	is_shown = {
		# Filter out religions that use a branch system.
		NOR = {
			religion = religion:islam_religion
			religion = religion:zoroastrianism_religion
		}
		# We also only want people with existing spiritual HoFs.
		exists = religious_head
		has_doctrine_parameter = spiritual_head_of_faith
	}

	can_pick = {
		# Must have a theocratic HoF.
		custom_description = {
			text = doctrine_requires_theocratic_head_of_faith_trigger
			doctrine:doctrine_spiritual_head = { is_in_list = selected_doctrines }
		}
		# !!! SECTION NOTE !!!
		## We check for tenets rather than doctrine parameters here because doctrine parameters cannot be checked in the selected_doctrines list, so we maintain such throughout the section for consistency.
		# Some tenet/doctrine configurations are mutually exclusive.
		## Pacifists vs. war-mongers.
		custom_description = {
			text = incompatible_tenet_shared_hof_pacifists_vs_warmongers
			NOR = {
				# Either you're trying to be pacifist and your HoF hates it...
				AND = {
					OR = {
						doctrine:tenet_dharmic_pacifism = { is_in_list = selected_doctrines }
						doctrine:tenet_pacifism = { is_in_list = selected_doctrines }
					}
					religious_head.faith = {
						OR = {
							has_doctrine = tenet_armed_pilgrimages
							has_doctrine = tenet_struggle_submission
							has_doctrine = tenet_warmonger
							has_doctrine = tenet_pursuit_of_power
						}
					}
				}
				# ... or your HoF is and hates your warmongering.
				AND = {
					OR = {
						doctrine:tenet_armed_pilgrimages = { is_in_list = selected_doctrines }
						doctrine:tenet_struggle_submission = { is_in_list = selected_doctrines }
						doctrine:tenet_warmonger = { is_in_list = selected_doctrines }
						doctrine:tenet_pursuit_of_power = { is_in_list = selected_doctrines }
					}
					religious_head.faith = {
						OR = {
							has_doctrine = tenet_dharmic_pacifism
							has_doctrine = tenet_pacifism
						}
					}
				}
			}
		}
		## Criminal witches vs. adorcists.
		custom_description = {
			text = incompatible_tenet_shared_hof_criminal_witches_vs_adorcists
			NOR = {
				# Either you're big on possessions but your HoF hates witchcraft...
				AND = {
					doctrine:tenet_adorcism = { is_in_list = selected_doctrines }
					religious_head.faith = { has_doctrine = doctrine_witchcraft_crime }
				}
				# ... or you hate witchcraft but your HoF likes possessions.
				AND = {
					doctrine:doctrine_witchcraft_crime = { is_in_list = selected_doctrines }
					religious_head.faith = { has_doctrine = tenet_adorcism }
				}
			}
		}
		## Hedonists vs. ascetics.
		custom_description = {
			text = incompatible_tenet_shared_hof_hedonists_vs_ascetics
			NOR = {
				# Either you like to indulge but your HoF believes less is more...
				AND = {
					doctrine:tenet_hedonistic = { is_in_list = selected_doctrines }
					religious_head.faith = { has_doctrine = tenet_asceticism }
				}
				# ... or your HoF throws constant wild parties whilst you prefer to sit and chill.
				AND = {
					doctrine:tenet_asceticism = { is_in_list = selected_doctrines }
					religious_head.faith = { has_doctrine = tenet_hedonistic }
				}
			}
		}
		## Cannibals vs. non-cannibals of any kind.
		custom_description = {
			text = incompatible_tenet_shared_hof_cannibals_vs_non_cannibals
			NOR = {
				# Cannibal-you doesn't get why your non-cannibal HoF freaks out when you offer them a hand...
				AND = {
					doctrine:tenet_ritual_cannibalism = { is_in_list = selected_doctrines }
					NOT = {
						religious_head.faith = { has_doctrine = tenet_ritual_cannibalism }
					}
				}
				# ... or cannibal-HoF thinks you need to chill the hell out whilst they eat this dude.
				AND = {
					religious_head.faith = { has_doctrine = tenet_ritual_cannibalism }						
					NOT = {
						doctrine:tenet_ritual_cannibalism = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		# Some tenet/doctrine configurations are unilaterally exclusive.
		## HumSac/GruFes are disliked by anyone who doesn't also actively believe in such.
		custom_description = {
			text = incompatible_tenet_shared_hof_world_vs_humsac_grufes
			# Your HoF will not put up with your HumSackery if they don't also go in for it.
			trigger_if = {
				limit = {
					OR = {
						doctrine:tenet_gruesome_festivals = { is_in_list = selected_doctrines }
						doctrine:tenet_human_sacrifice = { is_in_list = selected_doctrines }
					}
				}
				NOR = {
					religious_head.faith = { has_doctrine = tenet_gruesome_festivals }
					religious_head.faith = { has_doctrine = tenet_human_sacrifice }
				}
			}
		}
		## Monogamy doesn't like polygamy.
		custom_description = {
			text = incompatible_tenet_shared_hof_monogamy_vs_polygamy
			# Monogamous HoFs do not appreciate polygamy.
			trigger_if = {
				limit = {
					NOT = { doctrine:doctrine_monogamy = { is_in_list = selected_doctrines } }
				}
				NOT = {
					religious_head.faith = { has_doctrine = doctrine_monogamy }
				}
			}
		}
		## All lesser variations of incest don't like unrestricted incest.
		custom_description = {
			text = incompatible_tenet_shared_hof_world_vs_unrestricted_incest
			# Non-incestual HoFs really take issue with unrestricted incest.
			trigger_if = {
				limit = {
					doctrine:doctrine_consanguinity_unrestricted = { is_in_list = selected_doctrines }
				}
				religious_head.faith = { has_doctrine = doctrine_consanguinity_unrestricted }
			}
		}
	}

	piety_cost = {
		value = faith_tenet_cost_low
	}

	parameters = {
		maintains_head_of_faith_on_creation = yes
		# For loc:
		ecumenical_christians_keep_ecumenism = yes
		# And finally, you and your old faith see each other as astray.
		## Please note, unlike other hostility overrides, this is _bilateral_, not unilateral.
		same_hof_hostility_override = 1
	}

	character_modifier = {
		faith_creation_piety_cost_mult = -0.25
		opinion_of_same_faith = 5
		religious_head_opinion = -10
	}
}