﻿feudal_government = {
	create_cadet_branches = yes
	rulers_should_have_dynasty = yes
	dynasty_named_realms = yes
	royal_court = yes

	fallback = 1

	primary_holding = castle_holding
	required_county_holdings = { castle_holding city_holding church_holding }

	vassal_contract = {
		feudal_government_taxes
		feudal_government_levies
		special_contract
		religious_rights
		fortification_rights
		coinage_rights
		succession_rights
		war_declaration_rights
		council_rights
		title_revocation_rights
		jizya_special_rights
	}
	
	# Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player).
	flag = government_is_feudal
	color = hsv{ 0.67 1.00 0.78 }
}

clan_government = {
	primary_holding = castle_holding
	primary_heritages = { heritage_arabic heritage_iranian heritage_turkic }
	
	fallback = 2
	
	preferred_religions = { islam_religion }
	create_cadet_branches = yes
	rulers_should_have_dynasty = yes
	royal_court = yes

	valid_holdings = { castle_holding }
	required_county_holdings = { castle_holding city_holding church_holding }
	always_use_patronym = yes
	dynasty_named_realms = yes

	vassal_contract = {
		clan_government_obligations
		special_contract
		religious_rights
		war_declaration_rights
		council_rights
		title_revocation_rights
		jizya_special_rights
		iqta_special_rights
		ghazi_special_rights
		marriage_favor_rights
	}
	
	opinion_of_liege = {
		scope:vassal = {
			if = {
				limit = {
					NOT = {
						is_allied_to = scope:liege
					}
				}
				if = {
					limit = {
						is_powerful_vassal = yes
					}
					value = -30
				}
				else = {
					value = -15
				}
			}
		}
	}
	opinion_of_liege_desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:vassal = {
						NOT = {
							is_allied_to = scope:liege
						}
						is_powerful_vassal = yes
					}
				}
				desc = "GOVERNMENT_CLAN_NOT_ALLIED_POWERFUL"
			}
			triggered_desc = {
				trigger = {
					scope:vassal = {
						NOT = {
							is_allied_to = scope:liege
						}
						is_powerful_vassal = no
					}
				}
				desc = "GOVERNMENT_CLAN_NOT_ALLIED"
			}
		}
	}

	# Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player).
	flag = government_is_clan
	color = hsv{ 0.39 0.93 0.54 }
}

tribal_government = {
	rulers_should_have_dynasty = yes
	affected_by_development = no
	regiments_prestige_as_gold = yes
	supply_limit_mult_for_others = -0.5
	primary_holding = tribal_holding
	required_county_holdings = { tribal_holding }
	royal_court = yes

	valid_holdings = { castle_holding }

	prestige_opinion_override = { -10 0 3 5 10 20 }
	always_use_patronym = yes	

	vassal_contract = { 
		tribal_government_obligations 
		jizya_special_rights
		roman_contracts
	}
	
	character_modifier = {
		title_creation_cost_mult = -0.5
		army_maintenance_mult = -0.5

		feudal_government_vassal_opinion = -20
		clan_government_vassal_opinion = -20
		republic_government_vassal_opinion = -20
		
		character_travel_safety = 10
	
		ai_war_chance = 0.25
		monthly_prestige = 0.2
	}
	
	flag = government_can_raid_rule
	# Use flags instead of has_government for moddability if possible (i.e., wherever not visible to the player).
	flag = government_is_tribal
	color = hsv{ 0.02 0.75 0.36 }
}