﻿# 十字军战士
tradition_crusader_warrior = {
	category = regional

	layers = {
		0 = martial
		1 = mena
		4 = knight.dds #audacious_cadets.dds 
	}

	is_shown = {
		culture_head = {
			top_liege = { has_title = title:e_outremer }
			faith.religion = religion:christianity_religion
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
		culture_head = {
			top_liege = { has_title = title:e_outremer }
			faith.religion = religion:christianity_religion
		}
		custom_tooltip = {
			text = faith_not_allowed_holy_war_desc
			scope:character = {
				faith = {
					NOT = { has_doctrine_parameter = holy_wars_forbidden }	# Pacifists cannot Holy War
				}
			}
		}
	}
	
	parameters = {
		unlock_maa_outremer_infantry = yes
		unlock_maa_outremer_cavalry = yes

		# expensive_convert_to_local_culture = yes
		less_likely_to_culture_convert = yes
		harder_to_convert_character_faith = yes
		# harder_to_convert_county_faith = yes

		prowess_from_martial_education = yes
		ambitious_trait_more_common = yes
		zealous_trait_more_common = yes
		faith_warrior_traits_more_valued = yes

		no_limit_to_kingdom_level_holy_wars = yes
	}
	character_modifier = {
		heavy_cavalry_damage_mult = 0.2
		heavy_cavalry_max_size_add = 2
		heavy_infantry_damage_mult = 0.2
		heavy_infantry_max_size_add = 2

		# knight_effectiveness_mult = 0.25
		men_at_arms_maintenance = 0.25

		prowess_per_piety_level = 2
		different_faith_opinion = -25

		ai_zeal = 25
		ai_honor = -20
		ai_war_chance = 0.5
		ai_war_cooldown = -0.25
	}
	
	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
				}
			}

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

			if = {
				limit = {
					has_cultural_tradition = tradition_holyland_guardian
				}
				multiply = {
					value = 0.1
					desc = inspired_by_culture_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_holyland_guardian = {
	category = regional

	layers = {
		0 = learning
		1 = mena
		4 = temple.dds #cultivated_sophistication.dds
	}

	is_shown = {
		culture_head = {
			top_liege = { has_title = title:e_outremer }
			faith.religion = religion:christianity_religion
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
		culture_head = {
			top_liege = { has_title = title:e_outremer }
			faith.religion = religion:christianity_religion
		}
		custom_tooltip = {
			any_culture_county = {
				percent >= 0.2
				any_county_province = {
					has_holding_type = church_holding
				}
			}
			text = 20_percent_churches
		}
	}
	
	parameters = {
		extra_piety_from_temple_construction = yes
		prestige_from_temple_construction = yes
		renown_from_temple_construction = yes
		more_fervor_on_church_construction = yes
		build_bonuses_on_religious_traits = yes
	
		humble_trait_more_common = yes
		# stubborn_trait_more_common = yes
		diligent_trait_more_common = yes
	}
	character_modifier = {
		monthly_piety_from_buildings_mult = 0.25
		church_holding_build_gold_cost = 0.15
		holy_order_hire_cost_mult = -0.25
		defender_holding_advantage = 2

		same_faith_opinion = 10
	}
	
	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
								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_holyland_guardian }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}

			if = {
				limit = {
					has_cultural_tradition = tradition_crusader_warrior
				}
				multiply = {
					value = 0.1
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 100
		if = {
			limit = {
				scope:character = {
					government_has_flag = government_is_tribal
				}
			}
			multiply = 0
		}
	}
}

# 长生军
tradition_the_immortals = {
	category = regional

	layers = {
		0 = martial
		1 = indian
		4 = soldiers.dds
	}

	is_shown = {
		has_cultural_pillar = heritage_iranian
		culture_head = {
			top_liege = { has_title = title:h_dar_al_islam }
			faith.religion = religion:zoroastrianism_religion
		}
		NOR = { #Replaces Martial Admiration
			has_cultural_tradition = tradition_chanson_de_geste
			has_cultural_tradition = tradition_druzhina
			has_cultural_tradition = tradition_martial_admiration
			has_cultural_tradition = tradition_futuwaa
		}
	}
	can_pick = {
		has_cultural_pillar = heritage_iranian
		culture_head = {
			top_liege = { has_title = title:h_dar_al_islam }
			faith.religion = religion:zoroastrianism_religion
		}
		NOR = { #Replaces Martial Admiration
			has_cultural_tradition = tradition_chanson_de_geste
			has_cultural_tradition = tradition_druzhina
			has_cultural_tradition = tradition_martial_admiration
			has_cultural_tradition = tradition_futuwaa
		}
	}
	
	parameters = {
		unlock_maa_zhayedan = yes
		unlock_maa_asawira = yes
		unlock_maa_grivpanvar = yes
		unlock_maa_pushtigban = yes

		can_use_sparring_duel = yes
		martial_education_more_valued = yes
		prowess_traits_more_valued = yes
		blademaster_trait_bonuses = yes
		craven_and_content_traits_looked_down_upon = yes
		knights_slightly_more_prone_to_injury = yes
		unlock_horse_pastures_building = yes
	}
	character_modifier = {
		knight_limit = 4
		knight_effectiveness_mult = 0.25
		negate_prowess_penalty_add = 5
		accolade_glory_gain_mult = 0.25
	}
	
	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_courtly = { is_in_list = traits }
						culture_pillar:ethos_communal = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_courtly_or_communal_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_knight = {
								count >= 6
								prowess >= 12
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = knights_with_prowess_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_futuwaa }
				}
				multiply = {
					value = 0.5
					desc = inspired_by_culture_desc
				}
			}
			
			multiply = tradition_replacement_cost_if_relevant
		}
	}
	
	ai_will_do = {
		value = 400
		if = {
			limit = {
				NOT = {
					culture_has_heavy_cavalry_maa = yes
				}
			}
			multiply = 0.25
		}
	}
}

# 穆斯林战士/加齐 GHAZIS_GLOSS
tradition_muslim_warrior = {
	category = regional

	layers = {
		0 = martial
		1 = mena
		4 = soldiers.dds
	}
	
	#Can pick this if you have arabic heritage.
	is_shown = { #Replaces Warriors of the Dry
		has_cultural_pillar = heritage_arabic
		culture_head = {
			top_liege = { has_title = title:h_dar_al_islam }
			faith.religion = religion:islam_religion
		}
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
		culture_head = {
			top_liege = { has_title = title:h_dar_al_islam }
			faith.religion = religion:islam_religion
		}
		trigger_if = {
			limit = {
				OR = {
					NOT = { exists = scope:replacing }
					NOT = { scope:replacing = culture_tradition:tradition_warriors_of_the_dry }
				}
			}
			NOT = { has_cultural_tradition = tradition_warriors_of_the_dry } #To prevent stacking after hybridization
		}
	}
	
	parameters = {
		unlock_maa_mubarizun = yes
		unlock_maa_ghilman_cavalry = yes

		zealous_trait_more_common = yes
		desert_warrior_trait_more_common = yes
		dry_trait_bonuses = yes
		can_recruit_dry_specialist = yes

		prowess_from_religious_traits = yes
		culture_clergy_can_fight = yes
		# monastery_prowess_martial_bonus = yes
		# prowess_traits_more_valued = yes
		# blademaster_trait_bonuses = yes
		# blademaster_traits_more_common = yes
		better_knights_from_decision = yes
		unlock_horse_pastures_building = yes
	}
	character_modifier = {
		heavy_cavalry_damage_mult = 0.2
		heavy_cavalry_toughness_mult = 0.1
		heavy_cavalry_recruitment_cost_mult = -0.1
		#heavy_cavalry_maintenance_mult = -0.05
		heavy_infantry_damage_mult = 0.2
		heavy_infantry_toughness_mult = 0.1
		heavy_infantry_recruitment_cost_mult = -0.1
		#heavy_infantry__maintenance_mult = -0.05

		drylands_levy_size = 0.1
		desert_levy_size = 0.1
		drylands_supply_limit_mult = 0.25
		desert_supply_limit_mult = 0.25

		prowess_per_piety_level = 2
		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_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.3
							county_has_province_with_terrain = {
								terrain = drylands
								terrain = desert
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = dry_percentage_desc
				}
			}

			if = {
				limit = {
					culture_tradition_reduction_trigger = { TRADITION = tradition_mubarizuns }
				}
				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
							county_has_province_with_terrain = {
								terrain = drylands
								terrain = desert
							}
						}
					}
				}
			}
			multiply = 0
		}
	}
}
