﻿ #######################
 # CREDITS TO BAO
 # BY SHATZI
 #######################

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


bao_tradition_breizh_laid = {
	category = regional

	layers = {
		4 = bao_tradition_breizh_laid.dds
	}

	is_shown = {
		has_cultural_pillar = heritage_brythonic
	}
	can_pick = {
		has_cultural_pillar = heritage_brythonic
		NOR = { #Replaces Martial Admiration
			has_cultural_tradition = tradition_chanson_de_geste
			has_cultural_tradition = tradition_druzhina
			has_cultural_tradition = tradition_martial_admiration
		}
	}

	parameters = {
		poet_trait_more_common = yes
		craven_and_content_traits_looked_down_upon = yes
 		#bao_craven_bad = yes
		knights_slightly_more_prone_to_injury = yes
		characters_are_better_court_poets = yes
		#bao_better_musicians = yes
		characters_are_better_court_musicians = yes # Also hooked in to increase the Feast opinion bonus
	}

	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 >= 3
								culture = prev
								primary_title.tier >= tier_county
								has_trait = poet
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = rulers_with_poet_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = { value = 0 }
}

bao_tradition_breizh_collective_lands = {
	category = regional

	layers = {
		4 = bao_tradition_breizh_collective_lands.dds
	}

	is_shown = {
		has_cultural_pillar = heritage_brythonic
	}
	can_pick = {
		has_cultural_pillar = heritage_brythonic
		NOT = { has_cultural_tradition = tradition_collective_lands }
	}


	county_modifier = {
		development_growth_factor = 0.1	
		monthly_county_control_decline_factor = -0.2
		build_speed = -0.05
		county_opinion_add = 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_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
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					scope:character = {
						OR = {
							has_trait = peasant_leader
							any_parent = {
								has_trait = peasant_leader
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}

bao_tradition_free_range = {
	category = regional

	layers = {
		4 = bao_tradition_free_range.dds
	}
	
	is_shown = {
		has_cultural_pillar = heritage_brythonic
	}
	can_pick = {
		NOT = { has_cultural_tradition = tradition_pastoralists }
	}
	
	parameters = {
		pastures_building_bonuses = yes
		bao_horse_gift = yes
		bao_free_ranges = yes
		unlock_maa_marc_hegion = yes
 #wip		bao_unlocks_late_game_tradition = yes
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}
			if = {
				limit = {
					NOR = {
						culture_pillar:ethos_bellicose = { is_in_list = traits }
						culture_pillar:ethos_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
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		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
		}
	}
}
