﻿##############################
# RITUAL CULTURAL TRADITIONS #
##############################

tradition_monogamous = {
	category = ritual

	layers = {
		0 = learning
		1 = western
		4 = knight.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			trigger_if = {
				limit = {
					OR = {
						NOT = { exists = scope:replacing }
						NOR = {
							scope:replacing = culture_tradition:tradition_polygamous
							scope:replacing = culture_tradition:tradition_concubines
						}
					}
				}
				NOR = {
					culture_tradition:tradition_polygamous = { is_in_list = traits }
					culture_tradition:tradition_concubines = { is_in_list = traits }
				}
			}
		}
	}
	can_pick_for_hybridization = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			NOT = { # Only blocks polygamous to avoid duplicate warnings, but is blocked by concubines
				culture_tradition:tradition_polygamous = { is_in_list = traits }
			}
		}
	}
	
	parameters = {
		number_of_spouses = 1
		romance_scheme_bonus_vs_spouse = yes
	}
	
	character_modifier = {
		spouse_opinion = 10
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						scope:character.faith = {
							has_doctrine = doctrine_monogamy
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = cheaper_tradition_from_faith
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 0 }
}

tradition_polygamous = {
	category = ritual

	layers = {
		0 = diplo
		1 = mena
		4 = temple.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			trigger_if = {
				limit = {
					OR = {
						NOT = { exists = scope:replacing }
						NOR = {
							scope:replacing = culture_tradition:tradition_monogamous
							scope:replacing = culture_tradition:tradition_concubines
						}
					}
				}
				NOR = {
					culture_tradition:tradition_monogamous = { is_in_list = traits }
					culture_tradition:tradition_concubines = { is_in_list = traits }
				}
			}
		}
	}
	can_pick_for_hybridization = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			NOT = { # Only blocks concubines to avoid duplicate warnings, but is blocked by monogamous
				culture_tradition:tradition_concubines = { is_in_list = traits }
			}
		}
	}
	
	parameters = {
		number_of_spouses = 4
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_double_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						scope:character.faith = {
							OR = {
								has_doctrine = doctrine_polygamy
								has_doctrine = doctrine_concubines
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = cheaper_tradition_from_faith
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 0 }
}

tradition_concubines = {
	category = ritual

	layers = {
		0 = intrigue
		1 = indian
		4 = greeting.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			trigger_if = {
				limit = {
					OR = {
						NOT = { exists = scope:replacing }
						NOR = {
							scope:replacing = culture_tradition:tradition_monogamous
							scope:replacing = culture_tradition:tradition_polygamous
						}
					}
				}
				NOR = {
					culture_tradition:tradition_monogamous = { is_in_list = traits }
					culture_tradition:tradition_polygamous = { is_in_list = traits }
				}
			}
		}
	}
	can_pick_for_hybridization = {
		custom_tooltip = {
			text = only_one_marriage_tradition_allowed
			NOT = { # Only blocks monogamous to avoid duplicate warnings, but is blocked by polygamous
				culture_tradition:tradition_monogamous = { is_in_list = traits }
			}
		}
	}
	
	parameters = {
		number_of_spouses = 1
		number_of_consorts = 3
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_double_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						scope:character.faith = {
							OR = {
								has_doctrine = doctrine_polygamy
								has_doctrine = doctrine_concubines
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = cheaper_tradition_from_faith
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 0 }
}

tradition_sacred_mountains = {
	category = ritual

	layers = {
		0 = learning
		1 = mediterranean
		4 = mountain.dds
	}

	is_shown = {
		NOR = {
			has_cultural_pillar = heritage_somalian
			has_cultural_pillar = heritage_east_african
			has_cultural_pillar = heritage_tibetan
			has_cultural_pillar = heritage_qiangic
			any_culture_county = {
				title_province = {
					geographical_region = world_himalaya
				}
			}
			has_cultural_tradition = tradition_himalayan_settlers
		}
		scope:character = { government_has_flag = government_is_tribal }
	}
	can_pick = {
		custom_description = {
			text = culture_in_mountains_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = mountains
						terrain = desert_mountains
					}
				}
			}
		}
	}
	
	parameters = {
		piety_gain_on_building_complete_in_mountains = yes
	}
	province_modifier = {
		desert_mountains_tax_mult = 0.05
		mountains_tax_mult = 0.05
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								OR = {
									terrain = mountains
									terrain = desert_mountains
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = mountain_percentage_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = { culture_pillar:ethos_spiritual = { is_in_list = traits } }
			}
			multiply = 0.25
		}
		else_if = {
			limit = {
				scope:character ?= {
					piety_level >= 3
				}
			}
			multiply = scope:character.piety_level
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.3
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = mountains
									terrain = desert_mountains
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						OR = {
							terrain = mountains
							terrain = desert_mountains
						}
					}
				}
			}
			multiply = 2
		}
	}
}

tradition_sacred_groves = {
	category = ritual

	layers = {
		0 = learning
		1 = western
		4 = forest.dds
	}
	
	is_shown = {
		scope:character = { government_has_flag = government_is_tribal }
	}
	can_pick = {
		custom_description = {
			text = culture_in_forest_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = forest
						terrain = taiga
						terrain = jungle
					}
				}
			}
		}
	}
	
	parameters = {
		piety_gain_on_building_complete_in_forest_taiga = yes
	}
	province_modifier = {
		forest_tax_mult = 0.05
		taiga_tax_mult = 0.05
		jungle_tax_mult = 0.05
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								OR = {
									terrain = forest
									terrain = taiga
									terrain = jungle
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = forest_percentage_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = { culture_pillar:ethos_spiritual = { is_in_list = traits } }
			}
			multiply = 0.25
		}
		else_if = {
			limit = {
				scope:character ?= {
					piety_level >= 3
				}
			}
			multiply = scope:character.piety_level
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.3
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = forest
									terrain = taiga
									terrain = jungle
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						OR = {
							terrain = forest
							terrain = taiga
							terrain = jungle
						}
					}
				}
			}
			multiply = 4
		}
	}
}

tradition_culinary_art = {
	category = ritual

	layers = {
		0 = diplo
		1 = indian
		4 = food.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = culture_in_farmlands_or_floodplains_terrain_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = farmlands
						terrain = floodplains
					}
				}
			}
		}
	}
	
	parameters = {
		more_expensive_feasts = yes
		refined_feasts = yes
		renown_from_feasts = yes
		characters_are_better_food_tasters = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_courtly = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_courtly_communal_or_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							count >= 5
							any_county_province = {
								OR = {
									terrain = farmlands
									terrain = floodplains
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_in_farmlands_or_floodplains_terrain_count_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							count >= 2
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = farmlands
									terrain = floodplains
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_festivities = {
	category = ritual

	layers = {
		0 = diplo
		1 = indian
		4 = food.dds
	}
	
	parameters = {
		more_frequent_feasts = yes
		reveler_traits_more_common = yes
		reveler_traits_more_valued = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_courtly = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_courtly_communal_or_stoic_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								has_trait = lifestyle_reveler
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_reveler_lifestyle_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character ?= {
						has_trait = lifestyle_reveler
					}
				}
			}
			multiply = 0.5
		}
		else = {
			multiply = 2
		}
	}
}

tradition_sorcerous_metallurgy = {
	category = ritual

	layers = {
		0 = learning
		1 = mediterranean
		4 = tools.dds
	}

	is_shown = {
	}

	can_pick = {
		scope:character = {
			faith = {
				NOR = {
					has_doctrine_parameter = witchcraft_illegal
					has_doctrine_parameter = witchcraft_shunned
				}
			}
		}
	}

	parameters = {
		more_expensive_weapon_inspiration = yes
		improved_weapon_inspiration = yes
		building_barracks_piety_bonuses = yes
	}

	character_modifier = {
		prowess_per_piety_level = 2
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_or_communal_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								has_trait = witch
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = three_witch_rulers_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						has_trait = witch
					}
				}
			}
			multiply = 0.5
		}
		else = {
			multiply = 8
		}
	}
}

tradition_mystical_ancestors = {
	category = ritual

	layers = {
		0 = learning
		1 = mediterranean
		4 = philosopher.dds
	}

	is_shown = {
		any_parent_culture_or_above = {
			has_cultural_tradition = tradition_mystical_ancestors
		}
	}

	can_pick = { #Can pick if your culture has mystical ancestors in its history
		custom_tooltip = {
			text = any_ancestor_culture_was_mystical
			any_parent_culture_or_above = {
				has_cultural_tradition = tradition_mystical_ancestors
			}
		}
	}
	
	parameters = {
		cannot_disherit = yes
		landing_house_members_gives_renown = yes
		piety_penalty_for_revoking_titles_from_house_members = yes
	}

	character_modifier = {
		dynasty_opinion = 10
	}

	cost = {
		prestige = {
			add = {
				value = tradition_double_base_cost
				desc = BASE
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 1000 }
}

tradition_religion_blending = {
	category = ritual

	layers = {
		0 = diplo
		1 = mediterranean
		4 = temple.dds
	}
	
	is_shown = {
		NOT = {
			culture_tradition:tradition_steppe_tolerance = { is_in_list = traits }
		}
	}
	can_pick = {
		custom_tooltip = {
			text = rulers_following_different_faiths_trigger_desc
			scope:character = {
				any_vassal = {
					count >= 2
					culture = prev.culture
					NOT = { faith = prev.faith }
				}
			}
		}
	}
	
	parameters = {
		more_easily_converted = yes
	}

	character_modifier = {
		faith_creation_piety_cost_mult = -0.2
		faith_conversion_piety_cost_mult = -0.2
		ignore_opinion_of_different_faith = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_courtly = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_courtly_communal_or_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_vassal = {
								count >= 5
								culture = prev.culture
								NOT = { faith = prev.faith }
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_following_different_faiths_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_vassal = {
							count >= 5
							culture = prev.culture
							NOT = { faith = prev.faith }
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_religious_patronage = {
	category = ritual

	layers = {
		0 = steward
		1 = indian
		4 = temple.dds
	}
	
	can_pick = {
		custom_tooltip = {
			any_culture_county = {
				percent >= 0.2
				any_county_province = {
					has_holding_type = church_holding
				}
			}
			text = 20_percent_churches
		}
	}
	
	parameters = {
		extra_piety_from_temple_construction = yes
		renown_from_temple_construction = yes
		consolidate_rule_decision = yes
	}
	character_modifier = {
		monthly_piety_from_buildings_mult = 0.25
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_courtly = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_courtly_communal_or_spiritual_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								faith = scope:character.faith
								has_trait = zealous
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_same_faith_zealous_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	ai_will_do = {
		value = 100
		if = {
			limit = {
				scope:character = {
					government_has_flag = government_is_tribal
				}
			}
			multiply = 0
		}
	}
}

tradition_medicinal_plants = {
	category = ritual

	layers = {
		0 = learning
		1 = indian
		4 = forest.dds
	}
	
	parameters = {
		herbalist_traits_more_common = yes
		herbalist_trait_gives_bonuses = yes
	}

	character_modifier = {
		owned_hostile_scheme_success_chance_add = 5
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_stoic_or_bureaucratic_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								has_trait = lifestyle_herbalist
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_lifestyle_herbalist_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				scope:character ?= {
					NOT = {
						has_trait = lifestyle_herbalist
					}
				}
			}
			multiply = 0.75
		}
		else = {
			multiply = 4
		}
	}
}

tradition_sacred_hunts = {
	category = ritual

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = hunter.dds
	}
	
	can_pick = {
		culture_not_pacifistic_trigger = yes
		custom_tooltip = {
			text = cannot_have_tradition_vegetarianism
			NOT = { culture_tradition:tradition_vegetarianism = { is_in_list = traits } }
		}
	}
	
	parameters = {
		sacred_hunts = yes
		hunting_traits_more_pious = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_spiritual_or_stoic_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								has_trait = lifestyle_hunter
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_hunter_lifestyle_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOR = {
					culture_pillar:ethos_spiritual = { is_in_list = traits }
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
			}
			multiply = 0.5
		}
	}
}

tradition_faith_bound = {
	category = ritual

	layers = {
		0 = learning
		1 = indian
		4 = crown.dds
	}
	
	parameters = {
		same_faith_inheritance_only = yes
	}
	character_modifier = {
		opinion_of_different_faith = -10
		ai_zeal = 25
	}
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
							any_ruler = {
								culture = prev
								NOT = { THIS = scope:character }
								faith = scope:character.faith
								primary_title.tier >= tier_county
							}
						}
						NOT = {
							any_ruler = {
								percent >= 0.9
								culture = prev
								primary_title.tier >= tier_county
								faith = scope:character.faith
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_same_faith_desc
				}
			}
			if = {
				limit = {
					OR = {
						has_variable = defensive_traditionalist_discount
						has_variable = aggressive_traditionalist_discount
					}
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	ai_will_do = {
		value = 0
		if = {
			limit = {
				scope:character = {
					has_trait = zealous
				}
			}
			add = 100
		}
	}
}

tradition_by_the_sword = {
	category = ritual

	layers = {
		0 = learning
		1 = mena
		4 = swords.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = faith_not_allowed_holy_war_desc
			scope:character = {
				faith = {
					NOT = { has_doctrine_parameter = holy_wars_forbidden }	# Pacifists cannot Holy War
				}
			}
		}
	}
	
	parameters = {
		no_limit_to_kingdom_level_holy_wars = yes
		cb_lower_piety_level_requirement = yes
	}
	character_modifier = {
		diplomacy_per_piety_level = -1
		martial_per_piety_level = 1
		different_faith_opinion = -15
		monthly_piety_gain_mult = -0.2
		ai_zeal = 25
	}
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								faith = scope:character.faith
								has_trait = zealous
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_same_faith_zealous_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	ai_will_do = {
		value = 0
		if = {
			limit = {
				scope:character ?= {
					has_trait = zealous
					ai_has_warlike_personality = yes
					any_neighboring_top_liege_realm_owner = {
						count >= 2
						primary_title.tier >= tier_kingdom
						NOT = {
							faith = prev.faith
						}
					}
				}
			}
			add = 1000
		}
	}
}

tradition_language_scholars = {
	category = ritual

	layers = {
		0 = intrigue
		1 = indian
		4 = philosopher.dds
	}
	
	parameters = {
		piety_from_language_schemes = yes
		language_success_chance_per_piety_level = yes
		languages_speed_up_claims = yes
		rulers_want_to_learn_languages_of_coreligionists = yes
	}
	character_modifier = {
		learn_language_scheme_phase_duration_add = medium_scheme_phase_duration_bonus_value
	}
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bureaucratic_spiritual_or_egalitarian_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							piety_level >= 3
							num_of_known_languages >= 3
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = piety_level_kown_languages_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	ai_will_do = {
		value = 100
	}
}

# This is the free version of runestones.
tradition_runestones = {
	category = ritual

	layers = {
		0 = steward
		1 = western
		4 = runestone.dds
	}

	# Runestones are available in a slightly reduced form in the base title, so we let you access this tradition regardless of whether you have FP1 or not.
	is_shown = {
		has_cultural_pillar = heritage_north_germanic
	}
	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_fp1_northern_stories
			NOT = { culture_tradition:tradition_fp1_northern_stories = { is_in_list = traits } }
		}
	}
	
	parameters = {
		has_access_to_runestones = yes
	}

	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_or_bureaucratic_desc
				}
			}
			# Poet, Arrogant, or Journaller requirement.
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								OR = {
									has_trait = poet
									has_trait = arrogant
									has_trait = journaller
								}
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_lacks_storytelling_traits_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
	}
}

tradition_merciful_blindings = {
	category = ritual

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = tools.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_byzantine_succession
			NOT = { culture_tradition:tradition_byzantine_succession = { is_in_list = traits } }
		}
	}
	
	parameters = {
		can_blind_prisoners = yes
		merciful_blinding = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_spiritual = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_spiritual_or_courtly_desc
				}
			}
			if = {
				limit = {
					scope:character = {
						NOT = {
							any_prisoner = {
								scope:character = {
									OR = {
										has_banish_reason = prev
										has_execute_reason = prev
									}
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = no_prisoner_with_harsh_reason_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = { # Reduce chance of picking this if the culture has another use of prisoners already
				culture_tradition:tradition_talent_acquisition = { is_in_list = traits }
			}
			multiply = 0.5
		}
	}
}
