###########################
# FP1 CULTURAL TRADITIONS 
###########################

#######################
# Norse Specific
#######################

tradition_fp1_coastal_warriors = {
	category = combat

	layers = {
		0 = martial
		1 = western
		4 = viking.dds
	}
	
	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		NOT = { has_cultural_tradition = tradition_hird }
		has_cultural_pillar = heritage_north_germanic
	}

	can_pick = {
		# Must be of a suitable heritage.
		custom_tooltip = {
			text = northern_germanic_heritage_trigger
			has_cultural_pillar = heritage_north_germanic
		}
		# And have a coastal presence.
		custom_description = {
			text = culture_on_coast_desc
			any_culture_county = {
				has_coastal_province = yes
			}
		}
		# Shouldn't be combined with the following traditions:
		custom_tooltip = {
			text = cannot_have_tradition_warrior_culture
			NOT = { culture_tradition:tradition_warrior_culture = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cannot_have_tradition_seafaring
			NOT = { culture_tradition:tradition_seafaring = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cultrad_not_nomadic_government_type
			scope:character = {
				NOT = {
					government_has_flag = government_is_nomadic
				}
			}
		}
		custom_tooltip = {
			text = cannot_have_tradition_maritime_way_of_life
			NOT = { culture_tradition:tradition_maritime_way_of_life = { is_in_list = traits } }
		}
	}
	
	parameters = {
		unlock_maa_bondi = yes
		unlock_maa_vigmen = yes
		unlock_maa_varangian_veterans = yes
		unlock_maa_huscarls = yes
		strong_traits_more_valued = yes
		strong_traits_more_common = yes
		trade_ports_stationed_maa_bonus = yes
		trade_ports_enabled_for_tribals = yes
		unlock_voluntary_laampdom = yes
		more_likely_to_be_laamps = yes
	}

	character_modifier = {
		sea_travel_danger = medium_sea_danger_reduction
		coastal_sea_travel_danger = medium_sea_danger_reduction
		taiga_provisions_use_mult = -0.1
		forest_provisions_use_mult = -0.1
	}
	
	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = culture_not_bellicose
				}
			}
			# Gotta be a heavily coastal culture not to get a surcharge.
			if = {
				limit = {
					NOT = {
						any_culture_county = {
							percent >= 0.3
							has_coastal_province = yes
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = coastal_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_fp1_coastal_warriors }
				}
				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.3
							has_coastal_province = yes
						}
					}
				}
			}
			multiply = 0
		}
	}
}

tradition_fp1_performative_honour = {
	category = societal

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

	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		has_cultural_pillar = heritage_north_germanic
	}
	
	can_pick = {
		# Must be of a suitable heritage.
		custom_tooltip = {
			text = northern_germanic_heritage_trigger
			has_cultural_pillar = heritage_north_germanic
		}
		# Shouldn't be combined with the following traditions:
		custom_tooltip = {
			text = cannot_have_tradition_fp1_trials_by_combat
			NOT = { culture_tradition:tradition_fp1_trials_by_combat = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cannot_have_tradition_fp1_the_right_to_prove
			NOT = { culture_tradition:tradition_fp1_the_right_to_prove = { is_in_list = traits } }
		}
	}
	
	parameters = {
		has_access_to_shieldmaidens = yes
		has_access_to_trials_by_combat = yes
		craven_trait_costs_prestige = yes
		weak_traits_looked_down_upon = yes
	}

	character_modifier = {
		knight_limit = 1
		accolade_glory_gain_mult = 0.1
	}
	
	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOT = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_courtier = {
								count >= 5
								prowess >= 10
								is_adult = yes
								NOT = { can_be_knight_trigger = { ARMY_OWNER = prev } }
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = courtiers_with_prowess_who_cant_be_knight_desc
				}
			}

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

	ai_will_do = { value = 100 }
}

tradition_fp1_northern_stories = {
	category = societal

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

	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		has_cultural_pillar = heritage_north_germanic
	}
	
	can_pick = {
		# Must be of a suitable heritage.
		custom_tooltip = {
			text = northern_germanic_heritage_trigger
			has_cultural_pillar = heritage_north_germanic
		}
		# Shouldn't be combined with the following traditions:
		custom_tooltip = {
			text = cannot_have_tradition_runestones
			NOT = { culture_tradition:tradition_runestones = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cannot_have_tradition_poetry
			NOT = { culture_tradition:tradition_poetry = { is_in_list = traits } }
		}
		custom_tooltip = {
			text = cannot_have_tradition_storytellers
			NOT = { culture_tradition:tradition_storytellers = { is_in_list = traits } }
		}
	}
	
	parameters = {
		has_access_to_runestones = yes
		poet_trait_gives_bonuses = yes
		poet_trait_more_common = yes
		better_ward_education = yes
		tells_stories = yes
		better_court_poets = yes
	}

	character_modifier = {
		owned_scheme_secrecy_add  = -15
		owned_legend_spread_mult = 0.1
	}
	
	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_or_bureaucratic_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								has_trait = lifestyle_poet
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_poet_desc
				}
			}

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

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

tradition_fp1_trials_by_combat = {
	category = societal

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

	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		has_cultural_pillar = heritage_north_germanic
	}
	
	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_fp1_performative_honour
			NOT = { culture_tradition:tradition_fp1_performative_honour = { is_in_list = traits } }
		}
	}
	
	parameters = {
		has_access_to_trials_by_combat = yes
		blademaster_traits_give_learning = yes
		craven_trait_costs_prestige = yes
	}

	character_modifier = {
		knight_limit = 1
		accolade_glory_gain_mult = 0.1
	}
	
	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bureaucratic = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
						culture_pillar:ethos_courtly = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_stoic_or_courtly_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							any_ruler = {
								count >= 3
								culture = prev
								primary_title.tier >= tier_county
								OR = {
									has_trait = education_martial_4
									has_trait = education_martial_5
								}
								learning >= 10
							}
						}
					}
					trigger_else_if = {
						limit = {
							scope:character = {
								OR = {
									has_trait = education_martial_4
									has_trait = education_martial_5
								}
								learning >= 10
							}
						}
						always = no
					}
					trigger_else_if = {
						limit = {
							scope:character.culture = {
								OR = {
									has_cultural_pillar = heritage_brythonic
									has_cultural_pillar = heritage_central_germanic
									has_cultural_pillar = heritage_frankish
									has_cultural_pillar = heritage_goidelic
									has_cultural_pillar = heritage_iberian
									has_cultural_pillar = heritage_latin
									has_cultural_pillar = heritage_west_germanic
								}
							}
						}
						always = no
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_martial_edu_and_learning_desc
				}
			}

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

tradition_fp1_the_right_to_prove = {
	category = societal

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

	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
	}
	
	can_pick = {
		custom_tooltip = {
			text = cannot_have_tradition_fp1_performative_honour
			NOT = { culture_tradition:tradition_fp1_performative_honour = { is_in_list = traits } }
		}
	}
	
	parameters = {
		has_access_to_shieldmaidens = yes
	}

	character_modifier = {
		knight_limit = -2
		knight_effectiveness_mult = 0.25
	}
	
	cost = {
		prestige = {
			# Base cost.
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			# Ethos requirement.
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }

						# Egalitarian, provided you're moving *up* the scale. Somewhat less so when moving down.
						culture_pillar:ethos_egalitarian = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_egalitarian_or_communal_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_courtier = {
								count >= 5
								prowess >= 10
								is_adult = yes
								NOT = { can_be_knight_trigger = { ARMY_OWNER = prev } }
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = courtiers_with_prowess_who_cant_be_knight_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_fp1_the_right_to_prove }
				}
				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_courtier = {
							count >= 5
							prowess >= 10
							is_adult = yes
							NOT = { can_be_knight_trigger = { ARMY_OWNER = prev } }
						}
					}
				}
			}
			multiply = 0
		}
	}
}
