﻿faiths_are_in_orthodox_christianity_group = {
	OR = {
		$FAITH_1$ = faith:orthodox
		$FAITH_1$ = faith:iconoclast
		$FAITH_1$ = faith:bogomilist
		$FAITH_1$ = faith:paulician
		# $FAITH_1$ = faith:bosnian_church # needed to avoid errors
	}
	OR = {
		$FAITH_2$ = faith:orthodox
		$FAITH_2$ = faith:iconoclast
		$FAITH_2$ = faith:bogomilist
		$FAITH_2$ = faith:paulician
		# $FAITH_2$ = faith:bosnian_church # needed to avoid errors
		$FAITH_2$ = faith:cainitism
	}
}

is_valid_heresy = {
	#The origin faith can never be its own heresy.
	NOT = { $ORIGIN_FAITH$ = $HERETICAL_FAITH$}

	#Depending on the origin faith's religion/religion group, there may have additional requirements for a heresy to be considered valid.
	OR = {
		#For Christian Faiths, the origin and heretical faiths must not both be Ecumenical (excepting the faiths which aren't technically ecumenical).
		AND = {
			religion_tag = christianity_religion
			NAND = {
				$ORIGIN_FAITH$ = {
					has_doctrine = special_doctrine_ecumenical_christian
					OR = {
						this = faith:insular_celtic
						# this = faith:bosnian_church # needed to avoid errors
					}
				}
				$HERETICAL_FAITH$ = {
					has_doctrine = special_doctrine_ecumenical_christian
					OR = {
						this = faith:insular_celtic
						# this = faith:bosnian_church # needed to avoid errors
					}
				}
			}
		}
		#No special requirements for Muslims, Jews, Yazidis, or Zoroastrians.
		religion_tag = islam_religion
		religion_tag = judaism_religion
		religion_tag = zoroastrianism_religion
		#Eastern Faiths can shift and spread amongst each other.
		AND = {
			OR = {
				religion_tag = buddhism_religion
				religion_tag = hinduism_religion
				religion_tag = jainism_religion
				religion_tag = dualism_religion
			}		
		}
		#No special requirements for Pagan religions.
		has_doctrine = pagan_hostility_doctrine
	}
}