﻿##############################
# REGULA CULTURAL TRADITIONS #
##############################

tradition_famuli_warriors = {
	category = combat

	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					culture_head ?= {
						regula_female_blessing_active_trigger = yes
					}
				}
				desc = tradition_famuli_warriors_many_females_desc
			}
			desc = tradition_famuli_warriors_few_females_desc
		}
	}

	layers = {
		0 = martial
		1 = regula
		4 = famuli_warrior.dds
	}

	# Assumes player is a culture head, and has Regula religion
	# This is a fallback pick anyway, as you normally get this via the decision
	can_pick = {
		culture_head ?= {
			is_regula_trigger = yes
		}
		has_cultural_pillar = martial_custom_regula
	}

	parameters = {
		unlock_maa_famuli = yes
	}

	character_modifier = {
		advantage = 5
		movement_speed = 0.25
		retreat_losses = 0.30
		enemy_hard_casualty_modifier = 0.25
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			# Tradition is free if we already have the Famuli Martial Custom
			if = {
				limit = {
					has_cultural_pillar = martial_custom_regula
				}
				add = {
					value = -1000
					desc = has_famuli_custom_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	# AI will never take this on their own
	ai_will_do = {
		value = 0
	}
}

tradition_famuli_enslavers = {
	category = combat

	layers = {
		0 = intrigue
		1 = regula
		4 = famuli_enslavers.dds
	}

	can_pick = {
		NOT = { has_cultural_tradition = tradition_famuli_reavers } # No need for redundant traditions.
		culture_head ?= {
			is_regula_trigger = yes
			custom_tooltip = {
				text = require_enslaver_accolade_knight
				any_acclaimed_knight = {
					accolade = {
						has_accolade_type = regula_enslaver_attribute
					}
				}
			}
		}
	}

	parameters = {
		culture_increased_regula_raid_chance = yes
		culture_can_raid_at_sea_even_if_feudal_no_restrictions = yes
		culture_can_raid_over_land_even_if_feudal_no_restrictions = yes
	}

	character_modifier = {
		raid_speed = -0.20
		max_loot_mult = -0.25
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			# Famuli Warriors requirement
			if = {
				limit = {
					NOT = { has_cultural_tradition = tradition_famuli_warriors }
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_not_famuli_warriors_trigger_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 50
		if = {
			limit = { # Should be common if we have Famuli Warriors
				has_cultural_tradition = tradition_famuli_warriors
			}
			multiply = 5
		}
	}
}

tradition_famuli_reavers = {
	category = combat

	layers = {
		0 = intrigue
		1 = regula
		4 = regula_raid.dds
	}

	can_pick = {
		NOT = { has_cultural_tradition = tradition_famuli_enslavers	}  # No need for redundant traditions.
		culture_head = {
			is_regula_trigger = yes
			custom_tooltip = {
				text = require_enslaver_accolade_knight
				any_acclaimed_knight = {
					accolade = {
						has_accolade_type = regula_enslaver_attribute
					}
				}
			}
		}
	}

	parameters = {
		culture_increased_regula_raid_chance = yes
		culture_regula_coastal_conversion = yes
		can_travel_along_rivers = yes
		culture_can_raid_at_sea_even_if_feudal_no_restrictions = yes
	}

	character_modifier = {
		embarkation_cost_mult = -0.25
		naval_movement_speed_mult = 0.2
		raid_speed = -0.25
		max_loot_mult = -0.4
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			# Famuli Warriors requirement
			if = {
				limit = {
					NOT = { has_cultural_tradition = tradition_famuli_warriors }
				}
				add = {
					value = tradition_unfulfilled_criteria_penalty
					desc = culture_not_famuli_warriors_trigger_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	ai_will_do = {
		value = 50
		if = {
			limit = { # Should be common if we have Famuli Warriors
				has_cultural_tradition = tradition_famuli_warriors
			}
			multiply = 5
		}
	}
}

tradition_magistri_submission = {
	category = societal

	layers = {
		0 = learning
		1 = regula
		4 = magistri_submission.dds
	}

	# Assumes player is a culture head, and has Regula religion
	# This is a fallback pick anyway, as you normally get this via the decision
	can_pick = {
		culture_head ?= {
			is_regula_trigger = yes
		}
	}

	parameters = {
		content_trait_more_common = yes
		lustful_trait_more_common = yes	# From Carnalitas
		courtiers_less_likely_to_leave_same_culture_court = yes
		ai_doesnt_marry_outside_culture = yes
	}
	culture_modifier = {
		cultural_acceptance_gain_mult = -0.35
	}

	character_modifier = {
		# Less stress in life
		stress_gain_mult = -0.15
		stress_loss_mult = 0.15

		# Less likely to start wars
		ai_war_chance = -0.75
		ai_war_cooldown = 10

		# Make AI more subservient
		ai_boldness = -80
		ai_energy = -20
		ai_compassion = 30
		ai_sociability = 10
		ai_honor = 30
		ai_zeal = 50

		# Negatives due to having less agency
		knight_effectiveness_mult = -0.2
		prowess = -2
		enemy_hostile_scheme_success_chance_add = 20
		enemy_personal_scheme_success_chance_add = 20
	}

	county_modifier = {
		# Population is easier to control
		monthly_county_control_growth_add = 0.3
		development_growth_factor = 0.1
		county_opinion_add = 20
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			# Tradition is free if we already have the Regula religion
			if = {
				limit = {
					culture_head ?= {
						is_regula_trigger = yes
					}
				}
				add = {
					value = -1000
					desc = has_regula_custom_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	# AI will never take this on their own
	ai_will_do = {
		value = 0
	}
}

tradition_magister_bloodline = {
	category = ritual

	layers = {
		0 = learning
		1 = regula
		4 = magister_bloodline.dds
	}

	# Assumes player is a culture head, and has Regula religion
	can_pick = {
		culture_head ?= {
			is_regula_trigger = yes
		}
	}

	parameters = {
		cannot_disherit = yes
		familia_paelex_give_renown = yes
		piety_penalty_for_revoking_titles_from_house_members = yes
	}

	character_modifier = {
		dynasty_opinion = 10
	}

	cost = {
		prestige = {
			add = {
				value = tradition_base_cost
				desc = BASE
				format = "BASE_VALUE_FORMAT"
			}

			# Tradition is free if we already have the Regula religion
			if = {
				limit = {
					culture_head ?= {
						is_regula_trigger = yes
					}
				}
				add = {
					value = -1000
					desc = has_regula_custom_desc
				}
			}

			multiply = tradition_replacement_cost_if_relevant
		}
	}

	# AI will never take this on their own
	ai_will_do = {
		value = 0
	}
}
