#############################
# REALM CULTURAL TRADITIONS #
#############################

tradition_court_eunuchs = {
	category = realm

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = ceremony.dds
	}

	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_byzantine_succession
			NOT = { culture_tradition:tradition_byzantine_succession = { is_in_list = traits } }
		}
		custom_tooltip = {
			scope:character = {
				OR = {
					any_courtier = { is_eunuch_trigger = yes }
					any_vassal = { is_eunuch_trigger = yes }
					any_councillor = { is_eunuch_trigger = yes }
				}
			}
			text = no_eunuch_in_realms
		}
	}
	
	parameters = {
		can_castrate_prisoners = yes
		eunuch_trait_bonuses = yes
		can_appoint_chief_eunuch = yes
		family_castration = 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_councillor = { is_eunuch_trigger = yes }
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = no_eunuch_councillors_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_court_eunuchs }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_councillor = { is_eunuch_trigger = yes }
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_legalistic = {
	category = realm

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

	is_shown = { # strict laws are heavily tied to the Religion during this era
		scope:character.faith = {
			OR = {
				has_doctrine = doctrine_spiritual_head
				has_doctrine = doctrine_temporal_head
			}
		}
	}
	
	parameters = {
		cheaper_to_change_laws = yes
		just_trait_more_common = yes
		just_trait_gives_bonuses = yes
		vassals_more_likely_accept_punishments = yes
		legalistic_administrator_bonuses = yes
		legalistic_internal_yurt_unlock = yes
	}
	character_modifier = {
		title_creation_cost_mult = -0.3
		vassal_limit = 30
		monthly_prestige_gain_per_dread_mult = -0.01
		tyranny_gain_mult = 0.25
		tax_slot_add  = 1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_egalitarian_or_courtly_desc
				}
			}
			if = {
				limit = {
					NOT = {
						has_innovation = innovation_baliffs
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = lacks_baliffs_innovation_desc
				}
			}
			if = {
				limit = {
					NOT = {
						has_innovation = innovation_development_02
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = lacks_development_02_innovation_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_legalistic }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				scope:character = {
					any_vassal = {
						count < 30
					}
				}
			}
			multiply = 0.5
		}
		if = {
			limit = {
				NOR = {
					has_innovation = innovation_baliffs
					has_innovation = innovation_development_02
				}
			}
			multiply = 0.25
		}
	}
}

tradition_republican_legacy = {
	category = regional

	layers = {
		0 = steward
		1 = mediterranean
		4 = laurel.dds
	}

	is_shown = {
		OR ={
			this = culture:roman
			any_parent_culture_or_above = {
				this = culture:roman
			}
		}
		NOT = { has_cultural_tradition = tradition_parochialism }
	}
	can_pick = {
		OR ={
			this = culture:roman
			any_parent_culture_or_above = {
				this = culture:roman
			}
		}
		NOT = { has_cultural_tradition = tradition_parochialism }
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		can_make_republican_vassals = yes
		unlock_innovation_pike_columns = yes
		city_buildings_more_powerful = yes
		city_buildings_less_control = yes
		republican_vassals_pay_more = yes
		more_parochial_vassals = yes
		next_level_cities = yes
	}
	character_modifier = {
		city_holding_build_gold_cost = -0.05
		city_holding_holding_build_gold_cost = -0.05
		barons_and_minor_landholders_opinion = -20
		parochial_opinion = -20
		parochial_tax_contribution_mult = 0.1
		parochial_levy_contribution_mult = 0.1
	}
	
	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_sub_realm_county = {
								percent >= 0.9
								culture = scope:character.culture
								any_county_province = {
									has_holding_type = city_holding
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = 90_percent_cities_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_republican_legacy }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.15
							culture = scope:character.culture
							any_county_province = {
								has_holding_type = city_holding
							}
						}
					}
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_vassal = {
							primary_title.tier > tier_county
							government_has_flag = government_is_special_republic
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_hereditary_hierarchy = {
	category = realm

	layers = {
		0 = diplo
		1 = western
		4 = king.dds
	}
	
	can_pick = {
		scope:character = {
			government_has_flag = government_is_feudal
		}
	}
	
	parameters = {
		poorly_educated_leaders_distrusted = yes
		loyal_trait_more_valued = yes
	}
	character_modifier = {
		castle_holding_holding_build_gold_cost = -0.05
		feudal_government_tax_contribution_mult = 0.1
		long_reign_bonus_mult = 0.25
		tyranny_loss_mult = -0.5
	}
	
	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_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_courtly_or_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							primary_title.tier >= tier_kingdom
							any_vassal = {
								count >= 10
								primary_title.tier >= tier_county
								government_has_flag = government_is_feudal
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = king_with_vassals_desc
				}
			}
			if = {
				limit = {
					OR = {
						has_variable = defensive_traditionalist_discount
						has_variable = aggressive_traditionalist_discount
					}
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_hereditary_hierarchy }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOT = {
					scope:character.primary_title.tier >= tier_kingdom
				}
			}
			multiply = 0
		}
	}
}

tradition_esteemed_hospitality = {
	category = realm

	layers = {
		0 = diplo
		1 = mena
		4 = greeting.dds
	}
	
	is_shown = {
	}
	can_pick = {
	}
	
	parameters = {
		courtiers_and_guests_less_likely_to_join_schemes = yes
		cheaper_guest_recruitment = yes
		cheaper_court_positions = yes
		more_hostage_acceptance = yes
	}
	character_modifier = {
		courtier_and_guest_opinion = 10
		owned_personal_scheme_success_chance_add = 5
	}
	
	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 = {
						has_cultural_pillar = heritage_iranian 
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = iranian_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_esteemed_hospitality }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				culture_pillar:ethos_bellicose = { is_in_list = traits }
			}
			multiply = 0
		}
	}
}

tradition_gardening = {
	category = realm

	layers = {
		0 = steward
		1 = mediterranean
		4 = garden_architects.dds
	}

	can_pick = {
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		enable_garden_duchy_building = yes
		can_appoint_court_gardener = yes
		can_recruit_gardeners = 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 >= 10
							any_county_province = {
								OR = {
									has_building_or_higher = orchards_01
									has_building_or_higher = plantations_01
									has_building_or_higher = cereal_fields_01
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = gardening_buildings_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_gardening }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOT = {
					culture_pillar:ethos_courtly = { is_in_list = traits }
				}
			}
			multiply = 0
		}
	}
}

tradition_tribe_unity = {
	category = realm

	layers = {
		0 = martial
		1 = mena
		4 = crown.dds
	}
	
	is_shown = { #Replaced by Strong Kinship
		NOR = {
			this = culture:gaelic
			this = culture:scottish
			any_parent_culture_or_above = {
				OR = {
					this = culture:gaelic
					this = culture:scottish
				}
			}
		}
	}
	can_pick = {
		custom_tooltip = {
			text = requires_tribal_or_clan_government_trigger
			scope:character = {
				OR = {
					government_has_flag = government_is_clan
					government_has_flag = government_is_tribal
				}
			}
		}
	}
	
	parameters = {
		bonuses_from_patriarch_matriarch_trait = yes
		cultural_house_personal_scheme_success_chance = yes
		landing_house_members_give_prestige = yes
		penalty_for_revoking_titles_from_house_members = yes
		loyal_trait_more_valued = yes
		tribal_holding_stationed_bonus = yes
	}
	character_modifier = {
		dynasty_house_opinion = 10
		opinion_of_liege = -5
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { 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_communal_spiritual_or_stoic_desc
				}
			}
			if = {
				limit = {
					exists = scope:character.house
					NOT = {
						scope:character.house = {
							any_house_member = {
								count >= 3
								has_relation_friend = scope:character
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = house_friends_desc
				}
			}
			if = {
				limit = {
					has_variable = defensive_traditionalist_discount
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_tribe_unity }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				NOT = {
					scope:character = {
						OR = {
							government_has_flag = government_is_clan
							government_has_flag = government_is_tribal
							government_has_flag = government_is_administrative
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_astute_diplomats = {
	category = realm

	layers = {
		0 = diplo
		1 = western
		4 = diplomat.dds
	}
	
	parameters = {
		cannot_attack_allies = yes
		cannot_attack_truces = yes
		facilitate_alliance_acceptance = yes
		facilitate_white_peace = yes
		extra_language_cap_2 = yes
		astute_diplomat_bonus = yes
		unlocks_purchase_truce = yes
		cultrad_unlocks_t4_bounties_for_whispers = 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 = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_astute_diplomats }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 100 }
}

tradition_collective_lands = {
	category = realm

	layers = {
		0 = learning
		1 = indian
		4 = farmland.dds
	}

	can_pick = {
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		grants_to_lowborns_bonuses = yes
		collective_lands_farms_bonuses = yes
		peasant_leader_is_inherited = yes
	}
	county_modifier = {
		development_growth_factor = 0.1
		monthly_county_control_growth_factor = -0.2
		build_speed = 0.2
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_egalitarian_or_stoic_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 2
								culture = prev
								primary_title.tier >= tier_county
								has_trait = peasant_leader
							}
						}
					}
					trigger_else = {
						always = yes
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_peasant_leader_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_collective_lands }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 800
		if = {
			limit = {
				NOT = {
					scope:character = {
						OR = {
							has_trait = peasant_leader
							any_parent = {
								has_trait = peasant_leader
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_female_only_inheritance = {
	category = realm

	layers = {
		0 = learning
		1 = indian
		4 = crown.dds
	}

	is_shown = {
		NOT = { has_game_rule = inversed_gender_equality }
	}
	
	can_pick = {
		custom_tooltip = {
			NOT = { has_cultural_tradition = tradition_nubian_warrior_queens }
			OR = {
				has_cultural_pillar = heritage_senegambian
				has_cultural_pillar = heritage_akan
				has_cultural_pillar = heritage_west_african
				has_cultural_pillar = heritage_yoruba
				any_parent_culture_or_above = {
					OR = {
						this = culture:nubian
						this = culture:daju
					}
				}
				scope:character.faith = {
					has_doctrine_parameter = female_dominated_law
				}
			}
			text = tradition_female_only_inheritance_requirements
		}
		scope:character = {
			primary_title = {
				NOR = {
					has_title_law = male_only_law
					has_title_law = male_preference_law
				}
			}
			NOR = {
				has_realm_law = male_only_law
				has_realm_law = male_preference_law
			}
		}
	}
	
	parameters = {
		female_only_inheritance = yes
		female_preference_inheritance = yes
	}
	character_modifier = {
		opinion_of_female_rulers = 10
		opinion_of_male_rulers = -10
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						has_game_rule = inversed_gender_equality
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_egalitarian_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								is_female = yes
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = five_female_rulers_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_female_only_inheritance }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 25
		if = {
			limit = {
				NOT = {
					scope:character = {
						is_female = yes
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_equal_inheritance = {
	category = realm

	layers = {
		0 = diplo
		1 = western
		4 = crown.dds
	}

	can_pick = {
		NOR = {
			has_cultural_tradition = tradition_nubian_warrior_queens
			has_cultural_tradition = tradition_nubian_warrior_kings
		}
	}
	
	parameters = {
		gender_equal_inheritance = yes
	}
	doctrine_character_modifier = {
		name = tradition_equal_inheritance_name
		doctrine = doctrine_gender_male_dominated
		opinion_of_female_rulers = 10
	}
	doctrine_character_modifier = {
		name = tradition_equal_inheritance_name
		doctrine = doctrine_gender_female_dominated
		opinion_of_male_rulers = 10
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_egalitarian_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NAND = {
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								is_male = yes
							}
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								is_female = yes
							}
						}
					}
					trigger_else = {
						always = yes
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = three_gender_rulers_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_equal_inheritance }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 25
		if = {
			limit = {
				NOR = {
					scope:character = {
						is_female = yes
						faith = {
							has_doctrine_parameter = male_dominated_law
						}
					}
					scope:character = {
						is_male = yes
						faith = {
							has_doctrine_parameter = female_dominated_law
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_roman_legacy = {
	category = realm

	layers = {
		0 = martial
		1 = mediterranean
		4 = laurel.dds
	}

	is_shown = {
		OR = {
			has_cultural_pillar = heritage_byzantine
			has_cultural_pillar = heritage_caucasian
		}
		#replaced by new Byzantine traditions
		has_ep3_dlc_trigger = no
	}
	can_pick = {
	}
	
	parameters = {
		unlock_maa_cataphract = yes
	}
	province_modifier = {
	}
	character_modifier = {
		levy_size = -0.25
		men_at_arms_recruitment_cost = -0.15
		men_at_arms_maintenance = -0.15
		levy_reinforcement_rate = -0.25
		heavy_infantry_max_size_add = 2
		heavy_cavalry_max_size_add = 2
	}
	
	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_egalitarian = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_egalitarian_or_courtly_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							count >= 50
							any_county_province = {
								geographical_region = custom_eastern_roman_empire
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_in_roman_empire_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_roman_legacy }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
	}
}

tradition_metal_craftsmanship = {
	category = realm

	layers = {
		0 = steward
		1 = mediterranean
		4 = tools.dds
	}
	
	parameters = {
		better_armory_buildings = yes
		better_blacksmith_buildings = yes
		next_level_smiths = yes
		metalworkers_internal_yurt_unlock = yes
		nomadic_metal_artifact_unlock = yes
	}
	character_modifier = {
		maa_toughness_mult = 0.1
		army_maintenance_mult = 0.1
		levy_toughness = 2
		nomadic_horde_toughness_mult = 0.1
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_bureaucratic_or_stoic_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							count >= 1
							any_county_province = {
								has_any_special_mine_trigger = yes
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = has_a_special_mine_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_metal_craftsmanship }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 400
		if = {
			limit = {
				NOT = {
					any_culture_county = {
						count >= 1
						any_county_province = {
							has_building_or_higher = blacksmiths_01
						}
					}
				}
			}
			multiply = 0.25
		}
		else_if = {
			limit = {
				any_culture_county = {
					count >= 8
					any_county_province = {
						has_building_or_higher = blacksmiths_01
					}
				}
			}
			multiply = 2
		}
	}
}

tradition_family_entrepreneurship = {
	category = realm

	layers = {
		0 = steward
		1 = indian
		4 = noble.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = not_numerous_close_family_desc
			scope:character = {
				any_close_family_member = {
					count >= 10
					is_alive = yes
				}
			}
		}
	}
	
	parameters = {
		close_family_better_councillors = yes
		close_family_better_court_positions = yes
		penalty_for_revoking_titles_from_close_family = yes
	}
	character_modifier = {
		close_relative_opinion = 5
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_or_courtly_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							scope:character = {
								any_close_family_member = {
									percent > 0.5
									save_temporary_opinion_value_as = { name = target_opinion target = scope:character }		
									scope:target_opinion >= 80
								}
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = not_strong_opinion_close_family_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_family_entrepreneurship }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOR = {
					has_cultural_pillar = heritage_west_african
					has_cultural_pillar = heritage_central_african
					has_cultural_pillar = heritage_chinese
					has_cultural_pillar = heritage_indo_aryan
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				scope:character = {
					any_close_family_member = {
						count < 15
					}
				}
			}
			multiply = 0.25
		}
	}
}

tradition_wedding_ceremonies = {
	category = realm

	layers = {
		0 = diplo
		1 = indian
		4 = greeting.dds
	}
	
	parameters = {
		better_spouses = yes
		marriage_acceptance_bonus = yes
		cannot_divorce = yes
		adulterer_fornicator_penalties = yes
		hostile_scheme_success_chance_vs_spouse_penalty = 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 = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						any_ruler = {
							count >= 5
							primary_title.tier >= tier_county
							culture = prev
							has_trait = adulterer
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_adulterer_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_wedding_ceremonies }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		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 }
				}
			}
			multiply = 0
		}
	}
}

tradition_culture_blending = {
	category = realm
	
	layers = {
		0 = learning
		1 = indian
		4 = conversation.dds
	}
	
	is_shown = {
		has_dlc_feature = hybridize_culture
	}
	
	parameters = {
		cheaper_to_hybridize = yes
		learns_more_languages = yes
	}
	culture_modifier = {
		cultural_acceptance_gain_mult = 0.25
	}
	character_modifier = {
		max_learn_language_schemes_add = 1
		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_communal = { is_in_list = traits }
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_or_egalitarian_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_sub_realm_county = {
								percent >= 0.3
								NOT = { culture = root }
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = multiple_cultures_in_realm_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_culture_blending }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				is_divergent_culture = no
			}
			multiply = 0
		}
	}
}

tradition_isolationist = {
	category = realm

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = noble.dds
	}
	
	parameters = {
		courtiers_less_likely_to_leave_same_culture_court = yes
		dislikes_marrying_outside_of_culture = yes
		ai_doesnt_marry_outside_culture = yes
		less_likely_to_culture_convert = yes
		less_plague_spread_culture = yes
		cultrad_unlocks_t3_strengthen_sentries = yes
		cultrad_unlocks_t3_redouble_guards = yes
	}
	culture_modifier = {
		cultural_acceptance_gain_mult = -0.35
	}
	character_modifier = {
		diplomatic_range_mult = -0.25
		same_culture_opinion = 5
		
		ai_war_chance = -0.5
		ai_war_cooldown = 5
	}
	county_modifier = {
		monthly_county_control_growth_add = 0.5
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { 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_communal_spiritual_or_stoic_desc
				}
			}
			if = {
				limit = {
					scope:character = {
						any_sub_realm_county = {
							culture = scope:character.culture
							any_neighboring_county = {
								NOT = {
									culture = scope:character.culture
								}
								culture = {
									cultural_acceptance = { target = scope:character.culture value >= 40 }
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = non_tolerated_cultures_desc
				}
			}
			if = {
				limit = {
					OR = {
						has_variable = defensive_traditionalist_discount
						has_variable = aggressive_traditionalist_discount
					}
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_isolationist }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					is_divergent_culture = yes
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				culture_pillar:ethos_egalitarian = { is_in_list = traits }
			}
			multiply = 0
		}
	}
}

tradition_fervent_temple_builders = {
	category = realm

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

	can_pick = {
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		more_fervor_on_church_construction = yes
		prestige_from_temple_construction = yes
		build_bonuses_on_religious_traits = yes
		temple_next_level = yes
		tribals_can_into_temples = yes
	}
	character_modifier = {
		ai_zeal = 25
		church_holding_build_gold_cost = 0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { 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_communal_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
								faith = scope:character.faith
								has_trait = zealous
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_same_faith_zealous_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_fervent_temple_builders }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				culture_pillar:ethos_spiritual = { is_in_list = traits }
			}
			multiply = 4
		}
		if = {
			limit = {
				scope:character ?= {
					government_has_flag = government_is_tribal
					primary_title.tier >= tier_kingdom
					piety_level >= 3
				}
			}
			multiply = 4
		}

	}
}

tradition_agrarian = {
	category = realm

	layers = {
		0 = steward
		1 = indian
		4 = farmland.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = culture_in_farmlands_or_floodplains_terrain_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = farmlands
						terrain = floodplains
					}
				}
			}
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		content_trait_more_common = yes
		martial_education_worse_outcomes = yes
		hard_working_traits_more_valued = yes
	}
	character_modifier = {
		men_at_arms_recruitment_cost = 0.25
		prowess = -2
		floodplains_travel_danger = floodplains_medium_danger_reduction
	}
	county_modifier = {
		farmlands_development_growth_factor = 0.3
		farmlands_construction_gold_cost = -0.1
		floodplains_development_growth_factor = 0.3
		floodplains_construction_gold_cost = -0.1
		farmlands_levy_size = 0.1
		floodplains_levy_size = 0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			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
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_agrarian }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 400
		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
		}
		if = {
			limit = {
				scope:character = {
					government_has_flag = government_is_tribal
				}
			}
			multiply = 0
		}
	}
}

tradition_pastoralists = {
	category = realm

	layers = {
		0 = steward
		1 = mena
		4 = horses.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = culture_in_plains_or_steppe_terrain_desc
			any_culture_county = {
				percent >= 0.4
				any_county_province = {
					OR = {
						terrain = plains
						terrain = steppe
						geographical_region = world_steppe
					}
				}
			}
		}
	}
	
	parameters = {
		pastures_building_bonuses = yes
		farm_estates_pastures_unlock = yes
		better_herders_pasturalists = yes
	}
	character_modifier = {
		negate_health_penalty_add = 0.15
		prowess = 1
		plains_fertility_growth_mult = low_culture_county_fertility_value_mult
		steppe_fertility_growth_mult = low_culture_county_fertility_value_mult
		drylands_fertility_growth_mult = low_culture_county_fertility_value_mult
		desert_fertility_growth_mult = low_culture_county_fertility_value_mult
	}
	
	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_stoic = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_stoic_or_communal_desc
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.6
							any_county_province = {
								OR = {
									terrain = plains
									terrain = steppe
									geographical_region = world_steppe
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_in_plains_or_steppe_terrain_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_pastoralists }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.6
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = plains
									terrain = steppe
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_parochialism = {
	category = realm

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = city.dds
	}

	is_shown = { #Replaced by tradition_republican_legacy
		NOT = { has_cultural_tradition = tradition_republican_legacy }
		NOR ={
			this = culture:roman
			any_parent_culture_or_above = {
				this = culture:roman
			}
		}
	}
	can_pick = {
		NOR ={
			this = culture:roman
			any_parent_culture_or_above = {
				this = culture:roman
			}
		}
		NOT = { has_cultural_tradition = tradition_republican_legacy }
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		city_buildings_more_powerful = yes
		city_buildings_less_control = yes
		more_parochial_vassals = yes
		next_level_cities = yes
	}
	character_modifier = {
		city_holding_build_gold_cost = -0.05
		city_holding_holding_build_gold_cost = -0.05
		barons_and_minor_landholders_opinion = -20
		parochial_opinion = -20
		parochial_tax_contribution_mult = 0.1
		parochial_levy_contribution_mult = 0.1
	}
	
	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_sub_realm_county = {
								percent >= 0.9
								culture = scope:character.culture
								any_county_province = {
									has_holding_type = city_holding
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = 90_percent_cities_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_parochialism }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.15
							culture = scope:character.culture
							any_county_province = {
								has_holding_type = city_holding
							}
						}
					}
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_vassal = {
							primary_title.tier > tier_county
							government_has_flag = government_is_special_republic
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_ruling_caste = {
	category = realm

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = king.dds
	}
	
	parameters = {
		peasant_and_populist_factions_less_common = yes
		expensive_convert_to_local_culture = yes
		less_likely_to_promote_culture = yes
	}
	culture_modifier = {
		cultural_acceptance_gain_mult = -0.25
	}
	character_modifier = {
		dread_per_tyranny_add = 0.3
		dread_decay_mult = -0.3
		revolting_siege_morale_loss_mult = 0.25
	}
	
	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 = {
						any_councillor = {
							NOR = {
								culture = scope:character.culture
								is_spouse_of = scope:character # Might be hard to have the right culture for the Spouse; but we can remove this helper if needed
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = has_other_cultures_in_council_desc
				}
			}
			if = {
				limit = {
					has_variable = aggressive_traditionalist_discount
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_ruling_caste }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { 
		value = 50
		if = {
			limit = {
				scope:character.dread < 25
			}
			multiply = 0.5
		}
		if = {
			limit = {
				scope:character.tyranny < 25
			}
			multiply = 0.5
		}
	}
}

tradition_staunch_traditionalists = {
	category = realm

	layers = {
		0 = intrigue
		1 = western
		4 = king.dds
	}
	
	is_shown = {
		has_dlc_feature = hybridize_culture
	}
	can_pick = {
		NOT = {
		has_cultural_tradition = tradition_fp3_fierce_independence
		}
	}
	
	parameters = {
		stubborn_trait_more_common = yes
		expensive_convert_to_local_culture = yes
		harder_to_hybridize = yes
		less_likely_to_culture_convert = yes
	}
	character_modifier = {
		controlled_province_advantage = 5
		monthly_county_control_growth_add = 0.3
		cultural_head_fascination_mult = -0.05
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_communal = { 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_communal_spiritual_or_stoic_desc
				}
			}
			if = {
				limit = {
					scope:character = {
						any_sub_realm_county = {
							NOT = {
								culture = scope:character.culture
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = has_other_cultures_in_realm_desc
				}
			}
			if = {
				limit = {
					OR = {
						has_variable = defensive_traditionalist_discount
						has_variable = aggressive_traditionalist_discount
					}
				}
				add = {
					value = traditionalist_discount
					desc = traditionalist_discount_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_staunch_traditionalists }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 50
		if = {
			limit = {
				NOT = {
					is_divergent_culture = yes
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				culture_pillar:ethos_egalitarian = { is_in_list = traits }
			}
			multiply = 0
		}
	}
}

tradition_hill_dwellers = {
	category = realm

	layers = {
		0 = steward
		1 = indian
		4 = desert_mountains.dds
	}

	is_shown = { #Cannot be picked if you have access to Highland Farming
		NOT = { has_cultural_tradition = tradition_amharic_highlanders }
		NOR = {
			this = culture:ethiopian
			any_parent_culture_or_above = {
				this = culture:ethiopian
			}
		}
	}
	can_pick = {
		custom_description = {
			text = culture_in_hills_desc
			any_culture_county = {
				any_county_province = {
					terrain = hills
				}
			}
		}
	}
	
	parameters = {
		hill_farms_building_bonuses = yes
		hills_hunt_success_chance = yes
		windmills_hill_farms_unlock = yes
	}
	character_modifier = {
		hills_travel_danger = hills_medium_danger_reduction
		hills_fertility_growth_mult = low_culture_county_fertility_value_mult
	}
	county_modifier = {
		hills_development_growth_factor = 0.2
	}
	province_modifier = {
		hills_construction_gold_cost = -0.1
		hills_holding_construction_gold_cost = -0.1
		hills_fertility_growth_add = 0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								terrain = hills
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = hill_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_hill_dwellers }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.2
							culture = scope:character.culture
							any_county_province = {
								terrain = hills
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						terrain = hills
					}
				}
			}
			multiply = 8
		}
	}
}

tradition_forest_folk = {
	category = realm

	layers = {
		0 = steward
		1 = mena
		4 = forest.dds
	}

	is_shown = {
		NOR = { #These cultures instead get Forest Wardens Tradition
			has_cultural_pillar = heritage_balto_finnic
			has_cultural_pillar = heritage_volga_finnic
			has_cultural_pillar = heritage_ugro_permian
			has_cultural_pillar = heritage_baltic
			has_cultural_tradition = tradition_forest_wardens
		}
	}
	can_pick = {
		custom_description = {
			text = culture_in_forest_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = forest
						terrain = taiga
					}
				}
			}
		}
	}
	
	parameters = {
		logging_camps_building_bonuses = yes
		forest_hunt_success_chance = yes
		watermills_forestries_unlock = yes		
	}
	character_modifier = {
		forest_travel_danger = forest_medium_danger_reduction
		taiga_travel_danger = taiga_medium_danger_reduction
		forest_fertility_growth_mult = medium_culture_county_fertility_value_mult
		taiga_fertility_growth_mult = medium_culture_county_fertility_value_mult
	}
	county_modifier = {
		forest_development_growth_factor = 0.15
		taiga_development_growth_factor = 0.15
	}
	province_modifier = {
		forest_construction_gold_cost = -0.1
		taiga_construction_gold_cost = -0.1
		forest_holding_construction_gold_cost = -0.1
		taiga_holding_construction_gold_cost = -0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								OR = {
									terrain = forest
									terrain = taiga
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = forest_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_forest_folk }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.2
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = forest
									terrain = taiga
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						OR = {
							terrain = forest
							terrain = taiga
						}
					}
				}
			}
			multiply = 8
		}
	}
}

tradition_mountain_homes = {
	category = realm

	layers = {
		0 = steward
		1 = mena
		4 = mountain.dds
	}
	
	is_shown = {
		NOR = { #This is replaced by Himalayan Settlers, Mountaineer Ruralism and Mountain Herding. 
			has_cultural_tradition = tradition_himalayan_settlers
			has_cultural_tradition = tradition_mountaineer_ruralism
			has_cultural_pillar = heritage_arabic
			has_cultural_pillar = heritage_berber
			has_cultural_pillar = heritage_tibetan
			has_cultural_pillar = heritage_qiangic
			has_cultural_pillar = heritage_west_slavic
			any_culture_county = {
				title_province = {
					geographical_region = world_himalaya
				}
			}
		}
	}
	can_pick = {
		custom_description = {
			text = culture_in_mountains_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = mountains
						terrain = desert_mountains
					}
				}
			}
		}
	}

	parameters = {
		quarries_building_bonuses = yes
		prestige_gain_on_building_complete_in_mountains = yes
		mountains_hunt_success_chance = yes
	}
	character_modifier = {
		mountains_travel_danger = mountains_medium_danger_reduction
		desert_mountains_travel_danger = desert_mountains_medium_danger_reduction
		mountains_fertility_growth_mult = high_culture_county_fertility_value_mult
		desert_mountains_fertility_growth_mult = high_culture_county_fertility_value_mult
	}
	county_modifier = {
		mountains_development_growth_factor = 0.2
		desert_mountains_development_growth_factor = 0.35
	}
	province_modifier = {
		mountains_construction_gold_cost = -0.1
		desert_mountains_construction_gold_cost = -0.1
		mountains_holding_construction_gold_cost = -0.1
		desert_mountains_holding_construction_gold_cost = -0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			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
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_mountain_homes }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.2
							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 = 8
		}
	}
}

tradition_dryland_dwellers = {
	category = realm

	layers = {
		0 = steward
		1 = mena
		4 = desert.dds
	}
	
	can_pick = {
		custom_description = {
			text = culture_in_dryland_desc
			any_culture_county = {
				any_county_province = {
					OR = {
						terrain = drylands
						terrain = desert
					}
				}
			}
		}
		custom_tooltip = { #FP3 addition
			text = cannot_have_tradition_irrigation_experts
			NOT = { culture_tradition:tradition_fp3_irrigation_experts = { is_in_list = traits } }
		}
	}
	
	parameters = {
		plantations_building_bonuses = yes
		drylands_hunt_success_chance = yes
	}
	character_modifier = {
		desert_travel_danger = desert_medium_danger_reduction
		drylands_travel_danger = drylands_medium_danger_reduction
		desert_mountains_travel_danger = desert_mountains_medium_danger_reduction
		drylands_fertility_growth_mult = medium_culture_county_fertility_value_mult
		desert_fertility_growth_mult = medium_culture_county_fertility_value_mult
	}
	county_modifier = {
		desert_development_growth_factor = 0.35
		drylands_development_growth_factor = 0.15
	}
	province_modifier = {
		desert_construction_gold_cost = -0.1
		drylands_construction_gold_cost = -0.1
		desert_holding_construction_gold_cost = -0.1
		drylands_holding_construction_gold_cost = -0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								OR = {
									terrain = drylands
									terrain = desert
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = dry_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_dryland_dwellers }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.2
							culture = scope:character.culture
							any_county_province = {
								OR = {
									terrain = drylands
									terrain = desert
								}
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						OR = {
							terrain = drylands
							terrain = desert
						}
					}
				}
			}
			multiply = 8
		}
	}
}

tradition_jungle_dwellers = {
	category = realm

	layers = {
		0 = steward
		1 = indian
		4 = jungle.dds
	}
	
	is_shown = {
		NOR = {
			has_cultural_pillar = heritage_akan
			has_cultural_pillar = heritage_yoruba
			has_cultural_tradition = tradition_hidden_cities
		}
	}
	can_pick = {
		custom_description = {
			text = culture_in_jungle_desc
			any_culture_county = {
				any_county_province = {
					terrain = jungle
				}
			}
		}
	}
	
	parameters = {
		outposts_building_bonuses = yes
		jungle_hunt_success_chance = yes
	}
	character_modifier = {
		jungle_travel_danger = jungle_medium_danger_reduction
	}
	county_modifier = {
		jungle_development_growth_factor = 0.25
	}
	province_modifier = {
		jungle_construction_gold_cost = -0.1
		jungle_holding_construction_gold_cost = -0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								terrain = jungle
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = jungle_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_jungle_dwellers }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.2
							culture = scope:character.culture
							any_county_province = {
								terrain = jungle
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						terrain = jungle
					}
				}
			}
			multiply = 8
		}
	}
}

tradition_wetlanders = {
	category = realm

	layers = {
		0 = diplo
		1 = western
		4 = svamp.dds
	}
	
	can_pick = {
		custom_tooltip = {
			text = culture_in_wetlands_desc
			any_culture_county = {
				any_county_province = {
					terrain = wetlands
				}
			}
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		peat_quarries_building_bonuses = yes
		wetlands_hunt_success_chance = yes
	}
	character_modifier = {
		wetlands_advantage = 10
		wetlands_travel_danger = wetlands_high_danger_reduction
		floodplains_travel_danger = floodplains_high_danger_reduction
	}
	county_modifier = {
		wetlands_development_growth_factor = 0.25
	}
	province_modifier = {
		wetlands_construction_gold_cost = -0.15
		wetlands_holding_construction_gold_cost = -0.15
		wetlands_levy_size = 0.1
		wetlands_supply_limit_mult = 0.25
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							count >= 3
							any_county_province = {
								terrain = wetlands
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_in_wetlands_count_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_wetlanders }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							count >= 3
							culture = scope:character.culture
							any_county_province = {
								terrain = wetlands
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						terrain = wetlands
					}
				}
			}
			multiply = 8
		}
	}
}

tradition_hidden_cities = {
	category = realm

	layers = {
		0 = steward
		1 = mena
		4 = city2.dds
	}

	is_shown = {
		OR = {
			has_cultural_pillar = heritage_akan
			has_cultural_pillar = heritage_yoruba
		}
		NOT = { has_cultural_tradition = tradition_jungle_dwellers }
	}
	can_pick = {
		custom_description = {
			text = culture_in_jungle_desc
			any_culture_county = {
				any_county_province = {
					terrain = jungle
				}
			}
		}
	}
	
	parameters = {
		tribal_holding_fort_level_in_jungle_bonus = yes
		castle_holding_fort_level_in_jungle_bonus = yes
	}
	character_modifier = {
		jungle_travel_danger = jungle_high_danger_reduction
	}
	county_modifier = {
		jungle_development_growth_factor = 0.35
	}
	province_modifier = {
		jungle_construction_gold_cost = -0.1
		jungle_holding_construction_gold_cost = -0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {	culture_pillar:ethos_bureaucratic = { is_in_list = traits }	}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_inventive_desc
				}
			}	
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								terrain = jungle
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = jungle_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_hidden_cities }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant		
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					any_culture_county = {
						percent >= 0.3
						any_county_province = {
							terrain = jungle
						}
					}
				}
			}
			multiply = 0
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							culture = scope:character.culture
							any_county_province = {
								has_holding_type = city_holding 
								terrain = jungle
							}
						}
					}
				}
			}
			multiply = 0.25
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						terrain = wetlands
					}
				}
			}
			multiply = 8
		}

	}
}

tradition_ancient_miners = {
	category = realm

	is_shown = {
		always = no
	}
	
	layers = {
		0 = martial
		1 = mediterranean
		4 = tools.dds
	}
	
	parameters = {
		ancient_miners_quarries_building_bonuses = yes
		can_build_quarries_everywhere = yes 		# actually can be built everywhere
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_ancient_miners }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 400
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							culture = scope:character.culture
							any_county_province = {
								terrain = hills
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_castle_keepers = {
	category = realm

	layers = {
		0 = martial
		1 = western
		4 = city.dds
	}
	
	can_pick = {
		custom_tooltip = {
			scope:character = {
				OR = {
					government_has_flag = government_is_feudal
					government_has_flag = government_is_clan
				}
			}
			text = must_be_feudal_or_clan
		}
		custom_tooltip = {
			text = cannot_have_tradition_city_keepers
			NOT = {
				culture_tradition:tradition_city_keepers = { is_in_list = traits }
			}
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		castle_fortifications_increase = yes
		castle_grant_prestige = yes
		architect_trait_prestige = yes
		ai_more_likely_to_castle = yes
		ai_more_likely_to_fortify = yes
	}
	character_modifier = {
		castle_holding_holding_build_speed = 0.1
		castle_holding_holding_build_gold_cost = 0.2
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirements.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_stoic_or_bureaucratic_desc
				}
			}
			# Requires battlements innovation.
			if = {
				limit = {
					NOT = { has_innovation = innovation_battlements }
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = lacks_battlements_innovation_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_castle_keepers }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { 
		value = 800 
		if = {
			limit = {
				NOT = { has_innovation = innovation_battlements }
			}
			multiply = 0
		}
		if = {
			limit = {
				scope:character = { ai_boldness >= 0 }
			}
			multiply = 0.25
		}
	}
}

tradition_city_keepers = {
	category = realm

	layers = {
		0 = steward
		1 = mediterranean
		4 = city.dds
	}
	
	can_pick = {
		trigger_if = {
			limit = { has_ep3_dlc_trigger = yes }
			custom_tooltip = {
				scope:character = {
					OR = {
						government_has_flag = government_is_feudal
						government_has_flag = government_is_clan #Update for FP3
						government_has_flag = government_is_administrative
					}
				}
				text = must_be_feudal_clan_or_admin
			}
		}
		trigger_else = {
			custom_tooltip = {
				scope:character = {
					OR = {
						government_has_flag = government_is_feudal
						government_has_flag = government_is_clan #Update for FP3
					}
				}
				text = must_be_feudal_or_clan
			}
		}
		custom_tooltip = {
			text = cannot_have_tradition_castle_keepers
			NOT = {
				culture_tradition:tradition_castle_keepers = { is_in_list = traits }
			}
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		next_level_guild_halls = yes
		city_buildings_more_county_opinion = yes
		ai_more_likely_to_city = yes
		architect_trait_prestige = yes
		watermills_windmills_cities = yes
	}
	character_modifier = {
		city_holding_build_speed = -0.25
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirements.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bureaucratic_courtly_or_egalitarian_desc
				}
			}
			# Requires communal government innovation.
			if = {
				limit = {
					NOT = { has_innovation = innovation_development_02 }
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = lacks_development_02_innovation_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_city_keepers }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { 
		value = 400
		add = {
			value = scope:character.ai_sociability
			divide = 2
		}
		if = {
			limit = {
				NOT = { has_innovation = innovation_development_02 }
			}
			multiply = 0
		}
	}
}

tradition_maritime_mercantilism = {
	category = realm

	layers = {
		0 = diplo
		1 = mediterranean
		4 = ship.dds
	}
	
	can_pick = {
		custom_description = {
			text = culture_on_coast_desc
			any_culture_county = {
				any_county_province = {
					is_coastal = yes
				}
			}
		}
	}
	
	parameters = {
		next_level_trade_ports = yes
		maritime_mercantilism_coastal_holdings = yes
		maritime_mercantilism_avaricious_bonus = yes
	}
	character_modifier = {
		republic_government_vassal_opinion = 10
		sea_travel_danger = low_sea_danger_reduction
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_egalitarian_stoic_or_bureaucratic_desc
				}
			}
			# Coastal requirement.
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							any_county_province = {
								is_coastal = yes
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = coastal_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_maritime_mercantilism }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				scope:character = {
					any_sub_realm_county = {
						percent >= 0.6
						any_county_province = {
							is_coastal = yes
						}
					}
				}
			}
			add = 50
		}
		if = { # Make stacking a bit more common
			limit = {
				OR = {
					culture_tradition:tradition_seafaring = { is_in_list = traits }
					culture_tradition:tradition_fishermen = { is_in_list = traits }
				}
			}
			multiply = 2
		}
		if = {
			limit = {
				NOT = {
					scope:character = {
						any_sub_realm_county = {
							percent >= 0.3
							any_county_province = {
								is_coastal = yes
							}
						}
					}
				}
			}
			multiply = 0
		}
		else_if = {
			limit = {
				any_culture_county = {
					percent >= 0.6
					any_county_province = {
						is_coastal = yes
					}
				}
			}
			multiply = 2
		}
	}
}

tradition_monastic_communities = {
	category = realm

	layers = {
		0 = intrigue
		1 = mediterranean
		4 = temple.dds
	}
	
	can_pick = {
		scope:character = {
			faith = {
				has_doctrine_parameter = take_vows_active
			}
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
	}
	
	parameters = {
		temperate_trait_more_common = yes # Synergy with Monastic Doctrines
		temperate_trait_bonuses = yes
		devoted_trait_bonuses = yes
		monastic_expectations = yes
		next_level_monasteries = yes
		monastic_monastery_learning_bonus = yes
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			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
				}
			}
			# Piety level requirement.
			if = {
				limit = {
					NOT = { scope:character.piety_level >= high_piety_level }
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = lacks_high_piety_level_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_monastic_communities }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = { has_cultural_pillar = heritage_goidelic }
			}
			multiply = 0
		}
		if = {
			limit = {
				culture_pillar:ethos_spiritual = { is_in_list = traits }
			}
			multiply = 2
		}
		if = {
			limit = {
				scope:character ?= {
					piety_level >= 3
				}
			}
			multiply = scope:character.piety_level
		}
	}
}

tradition_brewery = {
	category = realm

	layers = {
		0 = diplo
		1 = western
		4 = food.dds
	}
	
	parameters = {
		allows_vineyards = yes
		allows_brewery = yes
		brewery_farming_bonus = yes
	}
	
	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 = {
							count >= 5
							any_county_province = {
								OR = {
									has_building_or_higher = farm_estates_01
									has_building_or_higher = cereal_fields_01
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_in_farm_or_mansion_count_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_brewery }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 10
	}
}
