###########################
# NEOW CULTURAL TRADITIONS 
###########################

#######################
# Generic
#######################

tradition_british_palace_politics = {
	category = regional

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

	is_shown = {
			OR = {
				has_cultural_pillar = heritage_anglo_frisian
				has_cultural_pillar = heritage_scottish
				this = culture:prytoneg
					any_parent_culture_or_above = {
					this = culture:prytoneg
				}
			}
			scope:character = {
				OR = {
					has_title = title:e_brittania
				}
			}
		# 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_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
		vengeful_trait_more_common = yes
		vengeful_positive_forgiving_negative = yes
		rivalries_more_common = yes
		hostile_action_vs_rival_bonuses = yes		
		bonuses_from_patriarch_matriarch_trait = yes
		landing_house_members_gives_renown = yes
		penalty_for_revoking_titles_from_house_members = yes
		loyal_trait_more_common = yes
	}
	character_modifier = {
		dynasty_house_opinion = 15
		opinion_of_liege = -10
		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
		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
		tyranny_gain_mult = 0.5
		accolade_glory_gain_mult = 0.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_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 = {
					has_government = administrative_government
				}
			}
			multiply = 2
		}
	}
}

tradition_swords_of_freedom = {
	category = regional

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

	is_shown = {
		OR = {
			this = culture:kuhjung
			any_parent_culture_or_above = {
				this = culture:kuhjung
			}
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
	}
	
	parameters = {
		unlock_maa_kuhjung = yes
		unlock_powder_magazines = yes
		strong_traits_more_common = yes
	}
	character_modifier = {
		maa_damage_mult = 0.05
		men_at_arms_limit = 1
		county_opinion_add = -10
	}
	
	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_british_meritocracy = { # Offshoot of tradition_philosopher_culture
	category = societal

	layers = {
		0 = learning
		1 = western
		4 = beacon_of_learning.dds
	}
	
	is_shown = {
		has_fp3_dlc_trigger = yes
		OR = {
			has_cultural_pillar = heritage_anglo_frisian
			has_cultural_pillar = heritage_brythonic
		}
		NOT = { has_cultural_tradition = tradition_philosopher_culture } # Replaces Philosopher Culture
	}

	can_pick = {
		custom_description = {
			text = culture_not_bellicose
			NOT = {
				culture_pillar:ethos_bellicose = { is_in_list = traits }
			}
		}
		OR = {
			has_cultural_pillar = heritage_anglo_frisian
			has_cultural_pillar = heritage_brythonic
		}	
		NOT = { has_cultural_tradition = tradition_warrior_culture }
		NOT = { has_cultural_tradition = tradition_philosopher_culture }
	}
	can_pick_for_hybridization = {
		custom_tooltip = {
			text = no_warrior_culture
			NOT = { # Only blocks polygamous to avoid duplicate warnings, but is blocked by concubines
				culture_tradition:tradition_warrior_culture = { is_in_list = traits }
			}
		}
		custom_tooltip = {
			text = no_philosopher_culture
			NOT = { # Only blocks polygamous to avoid duplicate warnings, but is blocked by concubines
				culture_tradition:tradition_philosopher_culture = { is_in_list = traits }
			}
		}
	}
	
	parameters = {
		#pensive_trait_more_common = yes
		#rowdy_trait_less_common = yes
		innovation_from_learning_traits = yes
		can_appoint_court_scholar = yes
		guardian_education_better_outcomes = yes
	}

	character_modifier = {
		stress_gain_mult = 0.25
		monthly_lifestyle_xp_gain_mult = 0.2
		learning_per_fame_level = 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 = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 5
								culture = prev
								primary_title.tier >= tier_county
								has_trait = scholar
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_scholar_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_fp3_beacon_of_learning }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 200
		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_defiant = { # defiant
	category = societal
	
	layers = {
		0 = diplo
		1 = western
		4 = crown.dds
	}
	
	is_shown = {
		OR = {
			has_cultural_pillar = heritage_french
			has_cultural_pillar = heritage_mosellic
			has_cultural_pillar = heritage_west_germanic
			this = culture:rottisch
			this = culture:rhinelander
			any_parent_culture_or_above = {
				OR = {
					this = culture:rottisch
					this = culture:rhinelander
				}
			}
		}
	}
	
	parameters = {
		can_use_conquest_cbs = yes
		cb_lower_prestige_level_requirement = yes
		cheaper_cbs = yes
	}

	character_modifier = {
		dread_gain_mult = -0.5
		tyranny_gain_mult = 0.5
		monthly_piety_gain_mult = 0.2
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 0
	}
}

tradition_creaght = {
	category = societal

	layers = {
		0 = steward
		1 = western
		4 = horses.dds
	}
	
	can_pick = {
		culture_not_pacifistic_trigger = yes
		custom_tooltip = {
			text = cannot_have_tradition_vegetarianism
			NOT = { culture_tradition:tradition_vegetarianism = { is_in_list = traits } }	
			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 = {
		more_frequent_hunts = yes
		hunting_traits_more_valued = yes
		hunting_traits_more_common = yes
		always_unlock_legendary_hunting_lodge = yes
		pastures_building_bonuses = yes
		farm_estates_pastures_unlock = yes
		better_herders_pasturalists = yes
	}
	
	character_modifier = {
		negate_health_penalty_add = 0.15
		character_travel_speed_mult = 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
							county_has_province_with_terrain = {
								terrain = plains
								terrain = steppe
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}


tradition_landstinget = {
	category = regional

	layers = {
		0 = learning
		1 = western
		4 = council.dds
	}

	is_shown = {
		has_cultural_pillar = heritage_north_germanic
	}
	can_pick = {
		has_cultural_pillar = heritage_north_germanic
	}

	parameters = {
		scandinavian_elective_enabled = yes
		trait_county_opinion_modifiers = yes
		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_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_sub_realm_county = {
								county_opinion < 0
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = counties_with_low_county_opinion_desc
				}
			}

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

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 200
		if = {
			limit = {
				OR = {
					culture_tradition:tradition_the_witenagemot = { is_in_list = traits }
					culture_tradition:tradition_fp3_jirga = { is_in_list = traits }
				}
			}
			multiply = 0
		}
	}
}


#tradition_british_armoires = {
#	category = regional
#
#	layers = {
#		0 = martial
#		1 = western
#		4 = bow.dds
#	}
#
#	is_shown = {
#		OR = {
#			has_cultural_pillar = heritage_anglo_frisian
#			has_cultural_pillar = heritage_brythonic
#		}
#	}
#	can_pick = {
#		OR = {
#			has_cultural_pillar = heritage_anglo_frisian
#			has_cultural_pillar = heritage_brythonic
#		}
#	}
#	
#	character_modifier = {
#		archers_max_size_add = 2
#	}
#	
#	parameters = {
#		unlock_maa_handgonners = yes
#	}
#	
#	cost = {
#		prestige = {
#			add = {
#				value = tradition_base_cost
#				desc = BASE
#				format = "BASE_VALUE_FORMAT"
#			}
#			# Ethos requirement.
#			if = {
#				limit = {
#					NOR = {
#						culture_pillar:ethos_stoic = { is_in_list = traits }
#						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
#					}
#				}
#				add = {
#					value = tradition_incompatible_ethos_penalty
#					desc = not_stoic_or_bureaucratic_desc
#				}
#			}
#			# Certain number of archer MaA requirement.
#			if = {
#				limit = {
#					scope:character = {
#						number_maa_soldiers_of_base_type = {
#							type = archers
#							# Remember to sync the below with longbow_competitions_minimum_archer_maa_value.
#							value < 1200
#						}
#					}
#				}
#				add = {
#					value = tradition_unfulfilled_criteria_penalty
#					desc = culture_head_lacks_archer_maa_desc
#				}
#			}
#			
#			multiply = tradition_replacement_cost_if_relevant
#		}
#	}
#	
#	ai_will_do = {
##		value = 800
#		if = {
#			limit = {
#				OR = {
#					culture_has_pikemen_maa = yes
#					culture_has_heavy_cavalry_maa = yes
#				}
#			}
#			multiply = 0
#		}
#	}
#}

tradition_life_is_just_a_joke = {
	category = societal

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

	parameters = {
		life_is_a_joke_trait_same_culture_opinion = yes
	}

	character_modifier = {
		stress_gain_mult = -0.1
		monthly_prestige_gain_mult = 0.05
	}
	
	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
	}
}