is_christian_faith = {
	group = "special"
	
	is_available_on_create = {
		has_doctrine = special_doctrine_is_christian_faith
	}

	special_doctrine_is_christian_faith = {
		parameters = {
			# Since doctrines cannot modify other faith's views of us, only our view of others, all Christian faiths are given this special doctrine which makes them friendlier to Faiths with the Christian Syncretism tenet.
			hostility_override_tenet_christian_syncretism = 2
			christian_syncretic_recipient_opinion_active = yes
			opinion_of_christian_syncretic_actor_opinion_active = 30
			# We don't localise these because Adoptionists are supposed to be a bit of a surprise.
			hostility_override_special_doctrine_adoptionist_school_felicitous_doctrine = 3
			hostility_override_special_doctrine_adoptionist_school_radical_doctrine = 3
		}
	}
}

is_islamic_faith = {
	group = "special"
	
	is_available_on_create = {
		has_doctrine = special_doctrine_is_islamic_faith
	}

	special_doctrine_is_islamic_faith = {
		parameters = {
			# Since doctrines cannot modify other faith's views of us, only our view of others, all Islamic faiths are given this special doctrine which makes them friendlier to Faiths with the Christian Syncretism tenet.
			hostility_override_tenet_islamic_syncretism = 2
			islamic_syncretic_recipient_opinion_active = yes
			opinion_of_islamic_syncretic_actor_opinion_active = 30
		}
	}
}

is_jewish_faith = {
	group = "special"
	
	is_available_on_create = {
		has_doctrine = special_doctrine_is_jewish_faith
	}

	special_doctrine_is_jewish_faith = {
		parameters = {
			# Since doctrines cannot modify other faith's views of us, only our view of others, all Jewish faiths are given this special doctrine which makes them friendlier to Faiths with the Christian Syncretism tenet.
			hostility_override_tenet_jewish_syncretism = 2
			jewish_syncretic_recipient_opinion_active = yes
			opinion_of_jewish_syncretic_actor_opinion_active = 30
		}
	}
}

is_eastern_faith = {
	group = "special"
	
	is_available_on_create = {
		has_doctrine = special_doctrine_is_eastern_faith
	}

	special_doctrine_is_eastern_faith = {
		parameters = {
			# Since doctrines cannot modify other faith's views of us, only our view of others, all Eastern faiths are given this special doctrine which makes them friendlier to Faiths with the Eastern Syncretism tenet.
			hostility_override_tenet_eastern_syncretism = 1
			eastern_syncretic_recipient_opinion_active = yes
			opinion_of_eastern_syncretic_actor_opinion_active = 30
		}
	}
}

is_gnostic_faith = {
	group = "special"
	
	is_available_on_create = {
		has_doctrine = special_doctrine_is_gnostic_faith
	}

	special_doctrine_is_gnostic_faith = {
		parameters = {
			hostility_override_tenet_gnosticism = 0
			hostility_override_special_doctrine_is_gnostic_faith = 0
			granting_titles_gives_stress = yes
		}

		traits = {
			virtues = { temperate }
			sins = { gluttonous }
		}

		character_modifier = {
			learning = 2
			stewardship = -2
		}
	}
}

heresy_hostility = {
	group = "not_creatable"
	is_available_on_create = {
		has_doctrine = heresy_hostility_doctrine
	}
	heresy_hostility_doctrine = {
		parameters = {
			hostility_same_religion = 2
		}
	}
}

nudity_doctrine = {
	group = "special"
	is_available_on_create = {
		has_doctrine = special_doctrine_naked_priests
	}

	special_doctrine_naked_priests = {
		parameters = {
			naked_priests_active = yes
		}
	}
}

unreformed_faith = {
	group = "not_creatable"
	is_available_on_create = {
		# Goes away on reformation
		always = no
	}
	unreformed_faith_doctrine = {
		visible = no
		parameters = {
			# unreformed = yes also serves as the basis for the unreformed_syncretic tenet.
			unreformed = yes
			hostility_override_tenet_unreformed_syncretism = 2
			unreformed_syncretic_recipient_opinion_active = yes
			opinion_of_unreformed_syncretic_actor_opinion_active = 30
			conquest_cb_enabled = yes
			faith_can_raid = yes
		}

		character_modifier = {
			monthly_prestige_gain_mult = 0.2
			clan_government_vassal_opinion = -20
			feudal_government_vassal_opinion = -20
			republic_government_vassal_opinion = -20
		}
	}
	west_african_unreformed_faith_doctrine = {
		visible = no
		parameters = {
			# unreformed = yes also serves as the basis for the unreformed_syncretic tenet.
			unreformed = yes
			hostility_override_tenet_unreformed_syncretism = 2
			unreformed_syncretic_recipient_opinion_active = yes
			opinion_of_unreformed_syncretic_actor_opinion_active = 30
			conquest_cb_enabled = yes
			faith_can_raid = yes
		}

		character_modifier = {
			monthly_prestige_gain_mult = 0.1
		}
	}
}

divine_destiny = {
	group = "special"
	is_available_on_create = {
		has_doctrine = divine_destiny_doctrine
	}
	divine_destiny_doctrine = {
		piety_cost = {
			value = faith_doctrine_cost_low
		}
		parameters = {
			divine_destiny_holy_war_cost_reduction = yes
		}
	}
}

adoptionist_school = {
	group = "special"
	
	is_available_on_create = {
		# Removed on reformation.
		always = no
	}

	special_doctrine_adoptionist_school_elipandic_doctrine = {
		parameters = {
			# Elipandics only think other ecumenicals are astray rather than hostile.
			## We can't localise the actual parameter due to structural shenanigans, so we make a dummy one.
			hostility_override_special_doctrine_is_christian_faith = 1
			adoptionists_like_ecumenism = yes
			# ... note that they're only thought of as hostile, unlike the other two schools, who are regarded as evil.
			adoptionists_are_unilateral_hostile = yes
			# Removed on reformation.
			adoptionist_school_removed_on_reformation = yes
			# Adoptionists convert other Christians faster.
			adoptionists_attractively_intuitive_theology = yes
		}
		character_modifier = { learning_per_piety_level = 1 }
		traits = {
			virtues = { stubborn }
		}
	}

	special_doctrine_adoptionist_school_felicitous_doctrine = {
		parameters = {
			# Felicians only think other ecumenicals are astray rather than hostile.
			## We can't localise the actual parameter due to structural shenanigans, so we make a dummy one.
			hostility_override_special_doctrine_is_christian_faith = 1
			adoptionists_like_ecumenism = yes
			# ... other Christians think they're evil, though.
			adoptionists_are_unilateral_evil = yes
			# Removed on reformation.
			adoptionist_school_removed_on_reformation = yes
			# Adoptionists convert other Christians faster.
			adoptionists_attractively_intuitive_theology = yes
		}
		character_modifier = { intrigue_per_piety_level = 1 }
		traits = {
			virtues = { deceitful }
		}
	}

	special_doctrine_adoptionist_school_radical_doctrine = {
		parameters = {
			# Radicals hate & are hated by everyone.
			hostility_override_special_doctrine_is_christian_faith = 3
			adoptionists_are_mutual_evil = yes
			# Removed on reformation.
			adoptionist_school_removed_on_reformation = yes
			# Adoptionists convert other Christians faster.
			adoptionists_attractively_intuitive_theology = yes
		}
		character_modifier = {
			advantage_against_coreligionists = 5
			# And, if you're gonna build a fundamentalist movement...
			ai_war_chance = 1
			ai_war_cooldown = -0.5
		}
		traits = {
			virtues = { arrogant }
		}
	}
}
not_allowed_to_hof = {
	group = "special"

	is_available_on_create = {
		# Removed on reformation.
		always = no
	}
	
	special_doctrine_not_allowed_to_hof = {
		name = {
			first_valid = {
				triggered_desc = {
					trigger = {
						religion_tag = judaism_religion
					}
					desc = prophecy_of_malachi_name
				}
				desc = special_doctrine_not_allowed_to_hof_name
			}
		}

		desc = {
			first_valid = {
				triggered_desc = {
					trigger = {
						religion_tag = judaism_religion
					}
					desc = prophecy_of_malachi_desc
				}
				desc = special_doctrine_not_allowed_to_hof_desc
			}
		}
		parameters = {
			block_from_create_hof_parameter = yes
		}
	}
}

#Game rule only
full_tolerance = {
	group = "special"
	is_available_on_create = {
		has_doctrine = special_doctrine_full_tolerance
	}
	
	special_doctrine_full_tolerance = {
		parameters = {
			hostility_override_special_doctrine_full_tolerance = 0
		}
	}
}


has_jizya_doctrine = {
	group = "special"

	is_available_on_create = {
		OR = {
			has_doctrine = special_doctrine_jizya
			has_doctrine = special_doctrine_is_islamic_faith
		}
	}


	special_doctrine_jizya = {
		character_modifier = {
			domain_tax_different_faith_mult = 0.2
			levy_reinforcement_rate_same_faith = 0.25
			levy_reinforcement_rate_different_faith = -0.25
		}

		parameters = {
			unlock_jizya_contract = yes
		}
	}
}

#NEOW visible virtue doctrines

anglican_virtues = {
	group = "special"

	is_available_on_create = {
			has_doctrine = special_doctrine_english_anglican
	}

	special_doctrine_english_anglican = {
		traits = {
			virtues = { just = 2 brave = 2 }
			sins = { arbitrary = 2 craven = 2 }
		}
	}
}

novelist_virtues = {
	group = "special"

	is_available_on_create = {
		OR = {
			has_doctrine = special_doctrine_aslan
			has_doctrine = special_doctrine_numenor
			has_doctrine = special_doctrine_charlemagne
			has_doctrine = special_doctrine_dracula
			has_doctrine = special_doctrine_reason_and_progress
			has_doctrine = special_doctrine_simurghi
			has_doctrine = special_doctrine_rocambolist
			has_doctrine = special_doctrine_absurdist
		}
	}

		special_doctrine_aslan = {
			traits = {
				virtues = { humble forgiving }
				sins = { arrogant vengeful }
			}
		}

		special_doctrine_numenor = {
			traits = {
				virtues = { generous gregarious }
				sins = { greedy shy }
			}
		}

		special_doctrine_charlemagne = {
			traits = {
				virtues = { ambitious honest }
				sins = { content deceitful }
			}
		}

		special_doctrine_dracula = {
			traits = {
				virtues = { callous vengeful }
				sins = { compassionate forgiving }
			}
		}

		special_doctrine_reason_and_progress = {
			traits = {
				virtues = { diligent ambitious }
				sins = { lazy content }
			}
		}
		special_doctrine_simurghi = {
			traits = {
				virtues = { temperate honest }
				sins = { gluttonous deceitful }
			}
		}
		special_doctrine_rocambolist = {
			traits = {
				virtues = { gregarious deceitful }
				sins = { shy honest }
			}
		}
		special_doctrine_absurdist = {
			traits = {
				virtues = { cynical ambitious }
				sins = { zealous content }
			}
		}
}

thelema_virtues = {
	group = "special"

	is_available_on_create = {
		OR = {
			has_doctrine = special_doctrine_base_thelema
			has_doctrine = special_doctrine_old_thelema
		}
	}

		special_doctrine_base_thelema = {
			traits = {
				virtues = { loyal }
				sins = { disloyal }
			}
		}

		special_doctrine_old_thelema = {
			traits = {
				virtues = { ambitious }
				sins = { content }
			}
		}
}

estatist_virtues = {
	group = "special"

	is_available_on_create = {
		has_doctrine = special_doctrine_liberty
	}

		special_doctrine_liberty = {
			traits = {
				virtues = { forgiving compassionate }
				sins = { vengeful sadistic }
			}
		}

		special_doctrine_equality = {
			traits = {
				virtues = { compassionate humble }
				sins = { sadistic arrogant }
			}
		}

		special_doctrine_fraternity = {
			traits = {
				virtues = { trusting gregarious }
				sins = { paranoid shy }
			}
		}
}