#######################
# CULTURAL TRADITIONS #
#######################

######################
# EP3 Traditions 	 #
######################

tradition_ep3_indomitable_azatani = {
	category = regional

	layers = {
		0 = martial
		1 = mena
		4 = indomitable_azatani.dds 
	}

	is_shown = {
		OR = {
			this = culture:armenian
			any_parent_culture_or_above = {
				this = culture:armenian
			}
		}
		# DLC check.
		has_ep3_dlc_trigger = yes
		NOT = {
			has_cultural_tradition = tradition_horse_breeder
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
		trigger_if = {
			limit = {
				OR = {
					NOT = { exists = scope:replacing }
					NOT = { scope:replacing = culture_tradition:tradition_horse_breeder }
				}
			}
			NOT = { has_cultural_tradition = tradition_horse_breeder } #To prevent stacking after hybridization
		}
	}
	
	parameters = {
		unlock_maa_ayrudzi = yes
		house_hostility_more_common = yes
		vassals_more_likely_to_refuse_demands = yes
	}
	character_modifier = {
		light_cavalry_maintenance_mult = -0.15
		heavy_cavalry_maintenance_mult = -0.15
		archer_cavalry_maintenance_mult = -0.15
		light_cavalry_damage_add = 4
		heavy_cavalry_damage_add = 20
	}
	
	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 = {
					scope:character = {
						NOR = { # Culture Head need to have a 8 sized regiment of either Light/Heavy/Archer Cavalry
							number_maa_soldiers_of_base_type = {
								type = light_cavalry
								value >= 800
							}
							number_maa_soldiers_of_base_type = {
								type = heavy_cavalry
								value >= 400
							}
							number_maa_soldiers_of_base_type = {
								type = archer_cavalry
								value >= 800
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_head_cavalry_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = { # Reduce chance slightly if the culture has access to other "cavalry" types
				OR = {
					has_innovation = innovation_war_camels
					has_innovation = innovation_elephantry
				}
			}
			multiply = 0.4
		}
		else_if = {
			limit = {
				scope:character ?= {
					ai_has_warlike_personality = yes
				}
			}
			multiply = 4
		}
	}
}

tradition_ep3_audacious_cadets = {
	category = regional

	layers = {
		0 = martial
		1 = western
		4 = audacious_cadets.dds 
	}

	is_shown = {
		OR = {
			this = culture:norman
			any_parent_culture_or_above = {
				this = culture:norman
			}
		}
		# DLC check.
		has_ep3_dlc_trigger = yes
		NOT = {
			has_cultural_tradition = tradition_swords_for_hire
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
		trigger_if = {
			limit = {
				OR = {
					NOT = { exists = scope:replacing }
					NOT = { scope:replacing = culture_tradition:tradition_swords_for_hire }
				}
			}
			NOT = { has_cultural_tradition = tradition_swords_for_hire } #To prevent stacking after hybridization
		}
	}
	
	parameters = {
		unlock_maa_conrois = yes
		unlock_voluntary_laampdom = yes
		much_more_likely_to_be_laamps = yes
		ambitious_trait_more_common = yes
		wanderers_gain_extra_combat_skills = yes
		mercenary_courtiers_gain_extra_skills = yes
		more_likely_to_leave_court = yes
	}
	character_modifier = {
		heavy_cavalry_damage_add = 20
		heavy_cavalry_pursuit_add = 20
		heavy_cavalry_max_size_add = 2
		siege_phase_time = -0.1
		ai_honor = -20
		ai_war_chance = 0.5
		ai_war_cooldown = -0.25
		same_culture_mercenary_hire_cost_mult = -0.15
		character_travel_speed_mult = 0.1
		character_travel_safety_mult = 0.1
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_desc
				}
			}
			if = {
				limit = {
					scope:character = {
						NOR = { # Culture Head need to have a 8 sized regiment of either Light/Heavy/Archer Cavalry
							number_maa_soldiers_of_base_type = {
								type = heavy_cavalry
								value >= 400
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_head_heavy_cavalry_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = {
				NOT = {
					culture_has_heavy_cavalry_maa = yes
				}
			}
			multiply = 0.25
		}
		else_if = {
			limit = {
				scope:character ?= {
					ai_has_warlike_personality = yes
				}
			}
			multiply = 4
		}
	}
}

tradition_ep3_imperial_tagmata = {
	category = regional

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

	is_shown = {
		OR = {
			this = culture:greek
			any_parent_culture_or_above = {
				this = culture:greek
			}
			has_cultural_pillar = heritage_byzantine
		}
		# DLC check.
		has_ep3_dlc_trigger = yes
		NOT = {
			has_cultural_tradition = tradition_roman_legacy
		}
	}
	can_pick = {
	}
	
	parameters = {
		unlock_maa_cataphract = yes
		unlock_maa_akritai = yes
		unlock_maa_ballistrai = yes
		unlock_maa_skoutatoi = yes
		frontier_themes_borrow_neighbor_troops = yes
	}
	character_modifier = {
		heavy_cavalry_max_size_add = 2
		counter_efficiency = 0.1
		knight_effectiveness_mult = -0.25
		men_at_arms_title_limit = 1
	}
	
	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_bellicose = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_or_bureaucratic_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_held_title = {
								tier = tier_county
								count >= 8
								any_county_province = {
									has_building_or_higher = stables_01
								}
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = domain_counties_with_stables_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 400
		if = {
			limit = { # Admin should be more into this
				scope:character = {
					government_allows = administrative
				}
			}
			multiply = 2
		}
		else_if = {
			limit = {
				scope:character ?= {
					ai_has_warlike_personality = yes
				}
			}
			multiply = 4
		}
	}
}

tradition_ep3_roman_ceremonies = {
	category = regional

	layers = {
		0 = diplo
		1 = mediterranean
		4 = roman_ceremonies.dds
	}

	is_shown = {
		OR = {
			this = culture:greek
			any_parent_culture_or_above = {
				this = culture:greek
			}
			has_cultural_pillar = heritage_byzantine
			scope:character = {
				OR = {
					has_title = title:e_byzantium
					has_title = title:e_roman_empire
				}
			}
		}
		# DLC check.
		has_ep3_dlc_trigger = yes
		NOT = {
			has_cultural_tradition = tradition_byzantine_succession
		}
	}
	can_pick = {
	}
	
	parameters = {
		holds_triumphs = yes
		hosts_chariot_races = yes
		children_can_be_born_in_the_purple = yes
		# We use the co-emperors parameter for most things...
		unlock_co_emperors = yes
		# ... which means the junior emperor parameter is _mostly_ just here for the loc.
		unlock_junior_emperors = yes
		#byzantine_faction_preffered_claimants = yes
	}
	county_modifier = {
		county_opinion_add = -10
	}
	
	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_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
				}
			}
			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
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = { # Admin should be more into this
				scope:character = {
					government_allows = administrative
				}
			}
			multiply = 2
		}
	}
}

tradition_ep3_palace_politics = {
	category = regional

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

	is_shown = {
		OR = {
			this = culture:greek
			any_parent_culture_or_above = {
				this = culture:greek
			}
			has_cultural_pillar = heritage_byzantine
			scope:character = {
				OR = {
					has_title = title:e_byzantium
					has_title = title:e_roman_empire
				}
			}
		}
		# DLC check.
		has_ep3_dlc_trigger = yes
		NOT = {
			has_cultural_tradition = tradition_byzantine_succession
		}
	}
	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_court_eunuchs
			NOT = { culture_tradition:tradition_court_eunuchs = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cannot_have_tradition_merciful_blindings
			NOT = { culture_tradition:tradition_merciful_blindings = { is_in_list = traits } }
		}
	}
	
	parameters = {
		unlock_maa_varangian_guards = yes
		unlock_akolouthos = yes
		reduced_bodyguard_aptitude = yes
		can_blind_prisoners = yes
		can_castrate_prisoners = yes
		eunuch_trait_bonuses = yes
		can_appoint_chief_eunuch = yes
		family_castration = yes
		ambitious_trait_more_common = yes
		physical_disfigurement_blocks_inheritance = yes #Actually only blocks claimants and reduce score in elective. Also includes infertility for tooltip reasons.
		cultrad_unlocks_t2_countermeasures = yes
		palace_politics_trait_bonuses = yes
		palace_politics_trait_maluses = yes
	}
	character_modifier = {
		monthly_court_grandeur_change_mult = 0.2
		political_scheme_phase_duration_add = minor_scheme_phase_duration_bonus_value
		personal_scheme_phase_duration_add = minor_scheme_phase_duration_bonus_value
	}
	
	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_courtly = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bureaucratic_courtly_or_spiritual_desc
				}
			}
			if = {
				limit = {
					has_dlc_feature = royal_court
					OR = {
						scope:character = { has_royal_court = no }
						NOT = {
							scope:character = {
								court_grandeur_current_level >= very_high_court_grandeur_level
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_head_court_grandeur_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = { # Admin should be more into this
				scope:character = {
					government_allows = administrative
				}
			}
			multiply = 2
		}
	}
}

tradition_ep3_cultivated_sophistication = {
	category = societal

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

	is_shown = {
		# DLC check.
		has_ep3_dlc_trigger = yes
	}
	can_pick = {
		custom_tooltip = {
			text = must_have_administrative_government_tt
			scope:character = { government_allows = administrative }
		}
	}
	
	parameters = {
		less_likely_to_culture_convert = yes
		other_cultures_more_likely_to_hybridize = yes
		estate_building_upgrade_development_gain = yes
		allows_noble_family_adoption = yes
	}
	character_modifier = {
		monthly_influence_mult = 0.1
		diplomatic_range_mult = 0.2
		#cultural_head_fascination_mult = -0.10
	}
	
	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_courtly = { is_in_list = traits }
						culture_pillar:ethos_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bureaucratic_courtly_or_spiritual_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							exists = capital_county
							capital_county = {
								tier = tier_county
								development_level >= 30
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = capital_province_development_level_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		if = {
			limit = { # Admin should be more into this
				OR = {
					this = culture:greek
					any_parent_culture_or_above = {
						this = culture:greek
					}
					has_cultural_pillar = heritage_byzantine
				}
			}
			multiply = 2
		}
	}
}
