﻿

tradition_angkorian_architecture = {
	category = realm

	layers = {
		4 = angkorian_architecture.dds
	}

	is_shown = {
		OR = {
			this = culture:khmer
			any_parent_culture_or_above = {
				this = culture:khmer
			}
		}
		NOT = { has_cultural_tradition = tradition_parochialism }
	}
	can_pick = {
		OR ={
			this = culture:khmer
			any_parent_culture_or_above = {
				this = culture:khmer
			}
		}
		NOT = { has_cultural_tradition = tradition_parochialism }
	}

	parameters = {
		#enable_baray_duchy_building = yes
		more_fervor_on_church_construction = yes
		prestige_from_temple_construction = yes
		build_bonuses_on_religious_traits = yes
	}
	character_modifier = {
		ai_zeal = 25
		church_holding_build_gold_cost = -0.1
		church_holding_holding_build_gold_cost = -0.1
	}

	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_spiritual = { is_in_list = traits }
						culture_pillar:ethos_stoic = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_communal_spiritual_or_stoic_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
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 100
		if = {
			limit = {
				scope:character = {
					government_has_flag = government_is_tribal
				}
			}
			multiply = 0
		}
	}
}


tradition_warrior_caste = {
	category = combat

	layers = {
		4 = warrior_caste.dds
	}

	can_pick = {

	}

	parameters = {
		#unlock_maa_khmer = yes
		prowess_from_religious_traits = yes
		culture_clergy_can_fight = yes
	}
	character_modifier = {
		prowess_per_piety_level = 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_spiritual = { is_in_list = traits }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_or_spiritual_desc
				}
			}
			if = {
				limit = {
					trigger_if = {
						limit = {
							scope:character = {
								is_ai = no
							}
						}
						NOT = {
							scope:character = {
								save_temporary_scope_as = culture_head_link
								faith = {
									any_faith_character = {
										count >= 15
										culture = scope:culture_head_link.culture
										prowess >= 10
										OR = {
											is_clergy = yes
											has_education_learning_trigger = yes
										}
									}
								}
							}
						}
					}
					trigger_else = {
						always = no
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_head_faith_clergy_prowess_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOR = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
					culture_pillar:ethos_spiritual = { is_in_list = traits }
				}
			}
			multiply = 0.25
		}
	}
}

tradition_tiger_sons = {
	category = societal

	layers = {
		4 = tiger_sons.dds
	}

	is_shown = {
		has_cultural_pillar = heritage_loloish
	}
	can_pick = {
		culture_not_pacifistic_trigger = yes
	}

	parameters = {
		#unlock_maa_luojuzi = 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
		can_duel_rivals = yes
	}

	character_modifier = {
		knight_limit = 2
		negate_prowess_penalty_add = 5 # Wounded knights fight better!
	}

	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 }
					}
				}
				add = {
					value = tradition_incompatible_ethos_penalty
					desc = not_bellicose_or_stoic_desc
				}
			}
			if = {
				limit = {
					NOT = {
						scope:character = {
							any_knight = {
								count >= 6
								prowess >= 12
							}
						}
					}
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = knights_with_prowess_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}
	ai_will_do = {
		value = 100
		if = {
			limit = {
				NOT = {
					culture_pillar:ethos_bellicose = { is_in_list = traits }
				}
			}
			multiply = 0.25
		}
	}
}
