feudal_governments = {


	chinese_imperial_government = {
		offmap_power = offmap_china
		preferred_holdings = { CASTLE }
		allowed_holdings = {
			CASTLE
			CITY
			FORT
			HOSPITAL
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			dynasty_government
			despotic_government
			caste_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			confucian_bureaucracy
		}
		free_revoke_on_tiers = {
			duke king
		}
		frame_suffix = "_chineseimperial"
		title_prefix = "chineseimperial_"
		potential = {
		NOT = {	has_landed_title = e_china_west_governor }
		NOT = {	has_landed_title = k_taoist }
		NOT = {	has_landed_title = k_confucianism }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		OR = {
			is_offmap_tag = offmap_china
			AND = {
			tier = EMPEROR
			primary_title = { has_title_flag = pretender_chinese_empire }
			OR = {
				culture_group = chinese_group
				religion = confucianism
				has_character_flag = chinese_imperial_government_preserve #keeps government when player is given culture change opton
			}
			}
			}
			is_patrician = no
		}
		
		color = { 118 255 163 }

		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			confucian_bureaucracy
			general_government
			chinese_temple
		}
		forced_contract = {
			confucian_bureaucracy
			general_government
			chinese_temple
		}
		capital_move_delay = 200
		
		can_usurp_kingdoms_and_empires = no
		can_create_empires = no
		can_demand_religious_conversion = no
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no
		can_grant_kingdoms_and_empires_to_other_government_group = yes
		free_retract_vassalage = yes
		
		can_grant_kingdoms_and_empires_to_other_government = yes
		
		vassal_limit = 10
		
		character_modifier = {
			monthly_character_piety = 1
		}
	}
		
	governor_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE
			CITY
			FORT
			HOSPITAL
		}
		ignore_in_vassal_limit_calculation = {
			confucian_bureaucracy
			general_government
		}
		forced_contract = {
			confucian_bureaucracy
			general_government
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_governor"
		title_prefix = "governor_"
		potential = {
			has_landed_title = e_china_west_governor
			is_patrician = no
		}
		
		capital_move_delay = 120
		
		color = { 106 208 189 }
		
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no

		can_imprison_without_reason = no
		can_revoke_without_reason = no
		
		can_build_tribal = no
		
		have_gender_laws = no

		aggression = 0 # AI only attacks by script
#		can_create_kingdoms = no
		can_create_empires = no
		can_demand_religious_conversion = no
		can_inherit = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government_group = yes
	}
	
	general_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			CITY
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_governor"
		title_prefix = "governor_"
		potential = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = {	has_landed_title = e_china_west_governor }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = { any_liege = { government = corps_government } }
		}
		
		capital_move_delay = 600
		
		color = { 126 188 208 }
		
		gets_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no

		can_imprison_without_reason = no
		can_revoke_without_reason = no
		
		can_build_tribal = no
		
		have_gender_laws = no

		aggression = 0 # AI only attacks by script
		can_create_kingdoms = no
		can_create_empires = no
		can_demand_religious_conversion = no
		can_inherit = no
	}
	
	chinese_feudal_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_chineseimperial"
		title_prefix = "chinesefeudal_"
		potential = {
		NOT = {	has_landed_title = e_china_west_governor }
		NOT = {	has_landed_title = k_taoist }
	    NOT = {	has_landed_title = k_confucianism }
		NOT = { any_liege = { government = corps_government } }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
			OR = {
			culture_group = chinese_group
			religion = confucianism
			}
			mercenary = no
			holy_order = no
			is_patrician = no
		}
		
		capital_move_delay = 600
		
		color = { 116 208 139 }
		
        dukes_called_kings = yes
		free_retract_vassalage = yes
        barons_need_dynasty = no
#		uses_prestige_for_law_change = yes
		allow_title_revokation = yes
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
#		have_gender_laws = no
#		allows_matrilineal_marriage = no
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no
		
	}

	theocratic_feudal_government = {
		preferred_holdings = { CASTLE TEMPLE }
		allowed_holdings = { 
			CASTLE 
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			theocracy_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			dynasty_government
			despotic_government
			caste_government
			pharaoh_government
			parish_government
			holy_pharaoh
			chinese_imperial_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_theocraticfeudal"
		potential = {
			NOT = {	religion_group = muslim	}
			OR = {
				culture_group = tibetan_group
				capital_scope = { culture_group = tibetan_group }
			}
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
			NOT = { any_liege = { government = corps_government } }
			is_patrician = no
		}
		
		color = { 126 108 69 }
		
		uses_piety_for_law_change = yes
		dukes_called_kings = yes
		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 600
	}
	
	imperial_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		forced_contract = {
			military_government
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			despotic_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			military_government
		}
        free_revoke_on_tiers = {
            duke
#			king
        }
        frame_suffix = "_imperial"
		title_prefix = "imperial_"
		potential = {
			OR = { 
		    has_landed_title = e_byzantium
			has_landed_title = e_macedonian
			AND = {
			has_landed_title = e_romania
			has_law = ze_administration_laws_2
			}
			AND = {
			has_landed_title = e_roman_empire
			has_law = ze_administration_laws_2
			}  
			AND = {
			tier = EMPEROR
			has_law = ze_administration_laws_2
			NOT = { culture_group = iranian }
#			NOT = { culture_group = altaic }
			NOT = { culture_group = arabic }
			NOT = { capital_scope = { region = world_steppe } }
			NOT = { capital_scope = { region = world_middle_east } }
			NOT = { capital_scope = { region = world_india } }
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
			}
			}
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
		}
		
		capital_move_delay = 600
		
		color = { 176 52 253 }
		
        dukes_called_kings = yes
        barons_need_dynasty = no
		can_grant_kingdoms_and_empires_to_other_government = yes

#		ignore_in_vassal_limit_calculation = {
#			tribal_government
#		}
	}
	
	military_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			principate_government
			tyrant_government
			despotic_government
			dynasty_government
			viceroy_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
        frame_suffix = "_military"
		title_prefix = "military_"
		potential = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
		}
		
		capital_move_delay = 600
		
		color = { 160 10 150 }#{ 128 28 108 }
		
        dukes_called_kings = no
        barons_need_dynasty = no
		can_create_kingdoms = no
		can_usurp_kingdoms_and_empires = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		
	}
	
	
	principate_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			CITY
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			imperial_government
			military_government
			viceroy_government
			tyrant_government
			corps_government
			merchant_republic_government
			republic_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_tyrant"
		title_prefix = "tyrant_"
		potential = {
			tier = EMPEROR
			NOT = { has_law = ze_administration_laws_2 }
			OR = { 
			culture = carthage
			culture = roman
			culture = greek
			AND = {
			has_landed_title = e_romania
			NOT = { has_law = ze_administration_laws_2 }
			} 
			AND = {
			has_landed_title = e_roman_empire
			NOT = { has_law = ze_administration_laws_2 }
			}  
			}
			NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_macedonian } 
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
#			NOT = { capital_scope = { region = world_middle_east } }
#			NOT = { has_law = ze_administration_laws_1 }
			NOT = { capital_scope = { culture_group = east_african } }			
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 188 38 68 }
		
		can_grant_kingdoms_and_empires_to_other_government = yes
#		can_imprison_without_reason = no
#		can_revoke_without_reason = no
		
	}
		
	tyrant_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			CITY
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			corps_government
			merchant_republic_government
			republic_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_tyrant"
		title_prefix = "tyrant_"
		potential = {
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			NOT = { tier = EMPEROR }
			OR = { 
			culture = carthage
			culture = roman
			culture = greek
			}
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
#			NOT = { capital_scope = { region = world_middle_east } }
			NOT = { has_law = ze_administration_laws_1 }
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian }
			NOT = { capital_scope = { culture_group = east_african } }			
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 160 6 0 }
		
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
		
	}
	
	dynasty_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			despotic_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		forced_contract = {
			viceroy_government
		}
		free_revoke_on_governments_culture = { # Tribal vassals of other religions can have their titles revoked for free
			viceroy_government
		}
#        free_revoke_on_tiers = {
#            king
#        }
        frame_suffix = "_dynasty"
		title_prefix = "dynasty_"
		potential = {
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			OR =  {
			has_landed_title = e_persia
			has_landed_title = e_aryan
			AND = {
			tier = EMPEROR
			has_law = ze_administration_laws_2
			}
			}
			OR = {			
			has_landed_title = e_persia
			has_landed_title = e_aryan
			capital_scope = { region = world_middle_east }
			capital_scope = { region = world_steppe }
			capital_scope = { region = world_india }
		    culture_group = iranian
#			culture_group = altaic
			culture_group = arabic
			}
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
#			NOT = { capital_scope = { culture_group = east_african } }
#			NOT = { culture_group = east_african }
#			NOT = { capital_scope = { culture_group = east_african } }
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian } 
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 118 255 163 }
		
		uses_decadence = yes
        dukes_called_kings = yes
		free_retract_vassalage = yes
        barons_need_dynasty = no
		uses_prestige_for_law_change = yes
		allow_title_revokation = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
#		have_gender_laws = no
#		allows_matrilineal_marriage = no
		
	}
	
	viceroy_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		forced_contract = {
			despotic_government
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			principate_government
			tyrant_government
			despotic_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
        frame_suffix = "_dynasty"
		title_prefix = "viceroy_"
		potential = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 131 206 20 }
		
        dukes_called_kings = no
        barons_need_dynasty = no
		can_create_kingdoms = no
		can_usurp_kingdoms_and_empires = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		
	}
	
	despotic_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			dynasty_government
			caste_government
			corps_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		frame_suffix = "_despotic"
		potential = {
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			NAND = { 
			tier = EMPEROR
			has_law = ze_administration_laws_2
			}
			NAND = { 
			tier = EMPEROR
			OR = { 
			culture = carthage
			culture = roman
			culture = greek
			}
			}
			OR = { 
#			capital_scope = { region = world_middle_east }
		    has_law = ze_administration_laws_1
			AND = { 
			OR = { 
		    culture_group = iranian
			culture_group = altaic
			culture_group = arabic
			culture = georgian
			culture = armenian
			culture = assyria
			}
			OR = { 
			NOT = { capital_scope = { region = world_europe } }
			capital_scope = { region = world_europe_south_east_anatolia }
			}
			}
#			AND = { 
#			capital_scope = { region = world_india }
#			NOT = { capital_scope = { culture_group = indo_aryan_group } }
#			NOT = { capital_scope = { culture_group = dravidian_group } }
#			NOT = { capital_scope = { religion = hindu } }
#			}
			}
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
			NOT = { culture_group = east_african }
			NOT = { capital_scope = { culture_group = east_african } }
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian } 
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 201 179 36 }#{ 0 100 200 }
		
        dukes_called_kings = yes
		free_retract_vassalage = yes
        barons_need_dynasty = no
#		uses_prestige_for_law_change = yes
		allow_title_revokation = yes
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
#		have_gender_laws = no
#		allows_matrilineal_marriage = no
		
	}
	
	caste_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			dynasty_government
			despotic_government
			corps_government
			theocracy_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
#		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
#			tribal_government
#		}
        frame_suffix = "_caste"
		potential = {
			NOT = { controls_religion = yes }
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			OR = { 
			culture_group = indo_aryan_group
			culture_group = dravidian_group
			religion = hindu
			capital_scope = { culture_group = indo_aryan_group }
			capital_scope = { culture_group = dravidian_group }
			capital_scope = { religion = hindu }
			}
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian } 
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		color = { 0 0 255 }
		
		capital_move_delay = 600
		
		uses_decadence = yes
        dukes_called_kings = yes
		free_retract_vassalage = yes
        barons_need_dynasty = no
		uses_piety_for_law_change = yes
		allow_title_revokation = yes
		have_gender_laws = no
		allows_matrilineal_marriage = no
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
		
#		ignore_in_vassal_limit_calculation = {
#			tribal_government
#		}
	}
	
	corps_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			despotic_government
			dynasty_government
			caste_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		forced_contract = {
			corps_government
		}
        frame_suffix = "_corps"
		potential = {
		    OR = {
			mercenary = yes
			holy_order = yes
			any_liege = { government = corps_government }
			}
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian }
			NOT = {	has_landed_title = e_china_west_governor }
			NOT = {	has_landed_title = k_han }
			NOT = {	has_landed_title = k_dao }
			is_patrician = no
			NOT = { controls_religion = yes }
		}
		
		capital_move_delay = 600
		
		color = { 20 20 20 }
		
		have_gender_laws = no
        dukes_called_kings = no
        barons_need_dynasty = no
		can_create_kingdoms = no
		can_usurp_kingdoms_and_empires = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		
		demesne_size= 5
		
	}
	
	pharaoh_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		can_build_tribal = no
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			dynasty_government
			despotic_government
			caste_government
			corps_government
			theocracy_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			theocracy_government feudal_government despotic_government pharaoh_government parish_government muslim_government corps_government tribal_government tyrant_government republic_government merchant_republic_government
		}
        free_revoke_on_tiers = {
            duke
            king
        }
		frame_suffix = "_pharaoh"
		title_prefix = "pharaoh_"
		potential = {
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			NAND = {
			tier = EMPEROR
			has_law = ze_administration_laws_2
			}
			OR = {
			AND = {
			culture_group = east_african
			OR = { 
			NOT = { capital_scope = { region = world_europe } }
			capital_scope = { region = world_europe_south_east_anatolia }
			has_law = ze_administration_laws_1
			}
			}
			AND = {
			capital_scope = { culture_group = east_african }
			OR = { 
			NOT = { capital_scope = { region = world_europe } }
			capital_scope = { region = world_europe_south_east_anatolia }
			has_law = ze_administration_laws_1
			}
			}
			}
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
			NOT = { has_landed_title = e_persia } 
			NOT = { has_landed_title = e_aryan } 
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian } 
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NOT = {	religion_group = muslim	}
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		capital_move_delay = 600
		
		color = { 207 145 90 }
		
        dukes_called_kings = yes
		free_retract_vassalage = yes
        barons_need_dynasty = no
		uses_piety_for_law_change = yes
		allow_title_revokation = yes
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes
		
#		ignore_in_vassal_limit_calculation = {
#			theocracy_government
#		}
	}

	muslim_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			imperial_government
			military_government
			despotic_government
			caste_government
			corps_government
		}
		free_revoke_on_tiers = {
			duke
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_iqta"
		potential = {
			NAND = {
				controls_religion = yes
				NOT = { religion_group = muslim }
				NOT = { religion = norse_pagan_reformed }
			}
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
			religion_group = muslim
			mercenary = no
			holy_order = no
			is_patrician = no
		}
		
		color = { 10 138 57 }
		
		uses_decadence = yes
		uses_piety_for_law_change = yes
		
		dukes_called_kings = yes
		barons_need_dynasty = yes
		have_gender_laws = no
		allows_matrilineal_marriage = no
		free_retract_vassalage = yes
		
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes

		free_levies_in_offensive_war = yes # Took away the hardcoded stuff for muslims where they could raise levies without pissing off vassals if in an offensive war.

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
	}
		

	feudal_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		vassal_call_to_arms = {
			feudal_government
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			muslim_government
			imperial_government
			military_government
			viceroy_government
			principate_government
			tyrant_government
			dynasty_government
			despotic_government
			caste_government
			pharaoh_government
			parish_government
			holy_pharaoh
			theocratic_feudal_government
			chinese_imperial_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		potential = {
			NAND = {
			controls_religion = yes
			NOT = { religion_group = muslim }
			NOT = { religion = norse_pagan_reformed }
			}
			NAND = {
			top_liege = { government = imperial_government }
			is_vice_royalty = yes
			}
			NAND = {
			top_liege = { government = dynasty_government }
			is_vice_royalty = yes
			}
			NAND = {
			tier = EMPEROR
			has_law = ze_administration_laws_2
			}
#			NAND = { 
#			capital_scope = { region = world_india }
#			NOT = { capital_scope = { culture_group = indo_aryan_group } }
#			NOT = { capital_scope = { culture_group = dravidian_group } }
#			NOT = { capital_scope = { religion = hindu } }
#			}
			NOT = { culture_group = indo_aryan_group }
			NOT = { culture_group = dravidian_group }
			NOT = { religion = hindu }
			NOT = { capital_scope = { culture_group = indo_aryan_group } }
			NOT = { capital_scope = { culture_group = dravidian_group } }
			NOT = { capital_scope = { religion = hindu } }
#			NOT = { capital_scope = { region = world_middle_east } }
		    NOT = { has_law = ze_administration_laws_1 }
		    NAND = { 
			OR = { 
			culture_group = iranian
#			culture_group = altaic
			culture_group = arabic
			culture = georgian
			culture = armenian
			culture = assyria
			culture_group = east_african
			capital_scope = { culture_group = east_african }
			}
			OR = { 
			NOT = { capital_scope = { region = world_europe } }
			capital_scope = { region = world_europe_south_east_anatolia }
			has_law = ze_administration_laws_1
			}
			}
			NOT = { capital_scope = { culture_group = east_african } }	
			NOT = { culture = greek }
			NOT = { culture = roman }
			NOT = { culture = carthage }
            NOT = { has_landed_title = e_byzantium } 
			NOT = { has_landed_title = e_roman_empire } 
			NOT = { has_landed_title = e_macedonian } 
			NOT = {	religion_group = muslim	}
			NOT = { any_liege = { government = corps_government } }
			mercenary = no
			holy_order = no
			is_patrician = no
			NOT = { culture_group = tibetan_group }
			NOT = { capital_scope = { culture_group = tibetan_group } }
			NAND = { 
				tier = EMPEROR
				primary_title = { has_title_flag = pretender_chinese_empire }
				OR = {
					culture = khitan
					culture = tangut
					culture = jurchen
					has_character_flag = chinese_imperial_government_preserve
				}
			}
			NOT = {	culture_group = chinese_group }
			NOT = {	religion = confucianism }
			NOT = {	has_landed_title = e_china_west_governor }
			NOT = {	has_landed_title = k_taoist }
			NOT = {	has_landed_title = k_confucianism }
			NAND = {
			OR = {
			top_liege = { government = chinese_imperial_government }
			top_liege = { has_landed_title = e_china_west_governor }
			}
			is_vice_royalty = yes
			}
		}
		
		color = { 91 133 207 }
		
		dukes_called_kings = yes
		barons_need_dynasty = yes
		
		can_be_granted_kingdoms_and_empires_by_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 600
	}

	
}