feudal_governments = {

	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
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			bureaucratic_government
			ghazi_government
			mormon_government
			theocratic_feudal_government
			#military_governorate
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		potential = {
			OR = {
				controls_religion = no
				religion = americanist
				religion = cetic
				religion = consumerist
				religion = monetarist
				religion = rust_cultist
				religion = imamite
				religion = revivalist
				religion = alawiyya
				religion = qingzhen
				religion = nazarene
				religion = exovedate
				religion = nousthreskeia
				religion = sol_invicta
				religion = patria_grande
				religion = atomicist
				religion = celeste
				religion = true_cross
				religion = glorian
				religion = navegante
				#religion_group = pagan_group
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = rust_cultist
						religion = americanist
						religion = consumerist
						religion = monetarist
						religion = imamite
						religion = revivalist
						religion = alawiyya
						religion = qingzhen
						religion = nazarene
						religion = exovedate
						religion = nousthreskeia
						religion = sol_invicta
						religion = patria_grande
						religion = atomicist
						religion = celeste
						religion = true_cross
						religion = glorian
						religion = navegante
					}
					has_religion_features = no # Old saves, and campaigns without HF, need the Fylkirate to continue working
				}
			}
			NOT = { is_government_potential = bureaucratic_government }
			NOT = { is_government_potential = ghazi_government }
			NOT = { is_government_potential = roman_imperial_government }
			NOT = { is_government_potential = mex_imperial_government }
			NOT = { is_government_potential = mormon_government }
			NOT = { is_government_potential = order_government }
			#NOT = { is_government_potential = colonial_government }
			NOT = { is_government_potential = military_governorate }
			NOT = { is_government_potential = open_range_feudalism_government }
			NOT = { has_character_flag = ORF_embrace }
			NOT = { is_government_potential = theocratic_feudal_government }
			#Removed Chinese Imperial stuff
			is_patrician = no
		}
		
		color = { 91 133 207 }
		
		dukes_called_kings = yes
		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 600
		
		## Modifiers
		court_size_modifier = 10
	}
	
	ghazi_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
			theocratic_feudal_government
			bureaucratic_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"
		title_prefix = "ghazi_government_"
		potential = {
			NAND = {
				controls_religion = yes
				religion = orientalist
			}
			NAND = {
				controls_religion = yes
				religion = traditionalist
			}

			OR = { 
				religion = traditionalist
				religion = revivalist
				religion = orientalist
				religion = misrist
				religion = alawiyya
			}
			NOT = { is_government_potential = colonial_government }
			NOT = { is_government_potential = roman_imperial_government }
			NOT = { is_government_potential = order_government }
			NOT = { is_government_potential = military_governorate }
			NOT = { is_government_potential = open_range_feudalism_government }
			NOT = { is_government_potential = mex_imperial_government }
			is_patrician = no
		}
		
		color = { 0 204 0 }
		
		uses_piety_for_law_change = yes
		
		have_gender_laws = no
		allows_matrilineal_marriage = no
		free_retract_vassalage = 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
		}
		capital_move_delay = 600

		## Modifiers
		court_size_modifier = 10
	}

	mormon_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
			theocratic_feudal_government
			bureaucratic_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 = "_mormon"
		title_prefix = "mormon_government_"
		potential = {
			OR = {
				controls_religion = no
				religion = cetic
				religion = imamite
				religion = americanist
				religion = consumerist
				religion = monetarist
				religion = rust_cultist
				religion = revivalist
				religion = alawiyya
				religion = qingzhen
				religion = nazarene
				religion = exovedate
				religion = nousthreskeia
				religion = sol_invicta
				religion = patria_grande
				religion = atomicist
				religion = celeste
				religion = true_cross
				religion = glorian
				religion_group = latter_day_saints
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = rust_cultist
						religion = americanist
						religion = consumerist
						religion = monetarist
						religion = imamite
						religion = revivalist
						religion = alawiyya
						religion = qingzhen
						religion = nazarene
						religion = exovedate
						religion = nousthreskeia
						religion = sol_invicta
						religion = patria_grande
						religion = atomicist
						religion = celeste
						religion = true_cross
						religion = glorian
					}
					has_religion_features = no # Old saves, and campaigns without HF, need the Fylkirate to continue working
				}
			}
			religion_group = latter_day_saints
			NOT = { religion = neogodbeite }
			NOT = { is_government_potential = mex_imperial_government }
			NOT = { is_government_potential = colonial_government }
			NOT = { is_government_potential = roman_imperial_government }
			NOT = { is_government_potential = order_government }
			NOT = { is_government_potential = military_governorate }
			is_patrician = no
		}
		
		color = { 0 0 204 }
		
#		uses_decadence = yes
		uses_piety_for_law_change = yes
		
		have_gender_laws = no
		allows_matrilineal_marriage = yes
		free_retract_vassalage = yes

		free_levies_in_offensive_war = no # 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
		}
		capital_move_delay = 600

		## Modifiers
		court_size_modifier = 10
	}

	bureaucratic_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
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			theocratic_feudal_government
			mormon_government
			#military_governorate
		}
		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 = "_bureaucratic"
		title_prefix = "bureaucracy_"
		potential = {
			OR = {
				controls_religion = no
				religion = cetic
				religion = imamite
				religion = americanist
				religion = consumerist
				religion = monetarist
				religion = rust_cultist
				religion = revivalist
				religion = alawiyya
				religion = qingzhen
				religion = nazarene
				religion = exovedate
				religion = nousthreskeia
				religion = sol_invicta
				religion = patria_grande
				religion = atomicist
				religion = celeste
				religion = true_cross
				religion = glorian
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = rust_cultist
						religion = americanist
						religion = consumerist
						religion = monetarist
						religion = imamite
						religion = revivalist
						religion = alawiyya
						religion = qingzhen
						religion = nazarene
						religion = exovedate
						religion = nousthreskeia
						religion = sol_invicta
						religion = patria_grande
						religion = atomicist
						religion = celeste
						religion = true_cross
						religion = glorian
					}
					has_religion_features = no # Old saves, and campaigns without HF, need the Fylkirate to continue working
				}
			}
			OR = {
				religion = cetic
				religion = qingzhen
				religion = imamite
				AND = {
					culture_group = californian
					NOT = {
						religion = nazarene
					}
				}
				AND = {
					religion = nazarene
					controls_religion = no
				}
			}
			NOT = {
				primary_title = {
					has_title_flag = devolved_bureaucracy
				}
			}
			is_patrician = no
			NOT = { is_government_potential = colonial_government }
			NOT = { is_government_potential = mex_imperial_government }
			NOT = { is_government_potential = roman_imperial_government }
			NOT = { is_government_potential = order_government }
			NOT = { is_government_potential = military_governorate }
		}
		
		color = { 145 10 15 }
		
		uses_piety_for_law_change = yes
		
		dukes_called_kings = yes
		barons_need_dynasty = yes
		free_retract_vassalage = yes
		
		#No free levies in offensive war
		
		can_build_tribal = no
		
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 200
		
		## Modifiers
		court_size_modifier = 10
	}
	
	theocratic_feudal_government = { #Given to Gaian feudal rulers
		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
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			bureaucratic_government
			theocracy_government
			feudal_government
			#military_governorate
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_theocraticfeudal"
		potential = {
			OR = {
				controls_religion = no
				religion = americanist
				religion = consumerist
				religion = monetarist
				religion = rust_cultist
				religion = imamite
				religion = revivalist
				religion = alawiyya
				religion = qingzhen
				religion = nazarene
				religion = exovedate
				religion = nousthreskeia
				religion = sol_invicta
				religion = patria_grande
				religion = atomicist
				religion = celeste
				religion = true_cross
				religion = glorian
				#religion_group = pagan_group
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = rust_cultist
						religion = americanist
						religion = consumerist
						religion = monetarist
						religion = imamite
						religion = revivalist
						religion = alawiyya
						religion = qingzhen
						religion = nazarene
						religion = exovedate
						religion = nousthreskeia
						religion = sol_invicta
						religion = patria_grande
						religion = atomicist
						religion = celeste
						religion = true_cross
						religion = glorian
					}
					has_religion_features = no # Old saves, and campaigns without HF, need the Fylkirate to continue working
				}
			}
			NOT = {	religion = cetic }
			OR = {
				AND = {
					religion = gaian
					higher_tier_than = BARON
				}
			}
			NOT = { is_government_potential = roman_imperial_government }
			NOT = { is_government_potential = order_government }
			NOT = { is_government_potential = colonial_government }
			NOT = { is_government_potential = military_governorate }
			NOT = { is_government_potential = mex_imperial_government }
			is_patrician = no
		}
		
		color = { 0 88 38 }
		
		uses_piety_for_law_change = yes
		dukes_called_kings = yes
		barons_need_dynasty = yes
		can_usurp_kingdoms_and_empires = no
		can_grant_kingdoms_and_empires_to_other_government = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		free_retract_vassalage = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
			theocracy_government
		}
		capital_move_delay = 600
		## Modifiers
		court_size_modifier = 10
	}
	
	#deleted these
		
	order_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = {
			CASTLE
			TEMPLE
			TRIBAL
			FORT
			HOSPITAL
		}
		accepts_liege_governments = {
			feudal_government
			bureaucratic_government
			theocracy_government
			theocratic_feudal_government
			#military_governorate
		}
		free_revoke_on_governments = {
			order_government
		}
		free_revoke_on_tiers = {
			BARON
		}

		forced_contract = {
			order_government
		}

		frame_suffix = "_order"
		title_prefix = "order_"

		potential = {
			OR = {
				holy_order = yes
				AND = {
					any_liege = {
						holy_order = yes
						religion = ROOT
					}
					ai = yes
					NAND = { 
						is_government_potential = merchant_republic_government 
						is_government_potential = colonial_government 
						is_government_potential = military_governorate 
						OR = {
							tier = DUKE
							is_patrician = yes
						}
						any_demesne_province = {
							any_province_holding = {
								OR = {
									AND = {
										tier = BARON
										holding_type = family_palace
									}
									AND = {
										NOT = {
											tier = BARON
										}
										holding_type = city
									}
								}
							}
						}
					}
				}
			}
		}

		color = { 169 169 169 }

		have_gender_laws = no
		can_create_kingdoms = no
		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		dukes_called_kings = yes
		barons_need_dynasty = yes
		can_usurp_kingdoms_and_empires = no
		can_grant_kingdoms_and_empires_to_other_government = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		can_inherit = no
		free_retract_vassalage = yes
	}
	
	roman_imperial_government = {
		preferred_holdings = { CASTLE CITY }
		allowed_holdings = {
			CASTLE
			CITY
			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
			republic_government
			merchant_republic_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_usaimperial"
		potential = {
			OR = { 
				AND = { 
					is_save_game = no
					has_game_started = no
					primary_title = { 
						title = e_usa
					}
				}
				AND = { 
					primary_title = { 
						title = e_usa
						has_law = succ_byzantine_elective
					}
				}
			}
			is_patrician = no
			NOT = { religion = mormon }
			NOT = { religion = woolleyite }
			NOT = { religion = strangite }
			NOT = { is_government_potential = military_governorate }
		}
		
		color = { 143 12 125 }

		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 2000
		
		can_usurp_kingdoms_and_empires = no
		can_imprison_without_reason = no
		can_create_empires = no
		vassal_government_opinion_penalties = no
		can_grant_kingdoms_and_empires_to_other_government_group = yes
		can_be_granted_kingdoms_and_empires_by_other_government = no
		free_retract_vassalage = yes
		## Modifiers
		court_size_modifier = 15
	}
	
	open_range_feudalism_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE 
			FORT
			HOSPITAL
			TRIBAL
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			bureaucratic_government
			theocratic_feudal_government

		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_orf"
		potential = {
			OR = {
				has_character_flag = ORF_embrace
				OR = {
					capital_scope = {
						region = custom_range_range
					}
					culture = altiplanense
					culture = bravo
					culture = neomexicano
					culture_group = starfolk
					culture = arixan
					culture = comanche
					culture = sioux
					culture = crow
				}
				AND = {
					has_game_started = no
					is_save_game = no
					OR = {
						has_landed_title = d_oklahoma
						has_landed_title = d_chisholm
						has_landed_title = c_panhandle
						has_landed_title = d_verdigris
						has_landed_title = k_platte
						has_landed_title = d_kansas
						has_landed_title = c_rushmore
						has_landed_title = c_bismarck
					}
				}
			}
			NOT = { has_character_flag = ORF_reject }
			is_patrician = no
			NOT = { is_government_potential = mormon_government }
			NOT = { is_government_potential = mex_imperial_government }
			NOT = { is_government_potential = bureaucratic_government }
			NOT = { is_government_potential = theocratic_feudal_government }
		}
		
		character_modifier = {
			short_reign_length = -1
		}	
		
		color = { 204 79 45 }
		
		barons_need_dynasty = yes
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_build_tribal = no
		
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 600
		
		## Modifiers
		court_size_modifier = 10
		#min_vassal_tax = -0.5
		#max_vassal_tax = -0.1
		#max_vassal_levy = -0.7
		#min_vassal_levy = -0.2
	}
	
	mex_imperial_government = {
		preferred_holdings = { CITY 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
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			republic_government
			merchant_republic_government
			mex_imperial_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		free_revoke_on_tiers = {
			duke
			king
		}
		frame_suffix = "_meximperial"
		title_prefix = "mex_"
		potential = {
			NAND = {
				religion = mormon
				religion = woolleyite
				religion = strangite
				is_government_potential = military_governorate
			}
			OR = {
				primary_title = {
					OR = {
					title = e_mexico
					title = k_mexico
					}	
				}
				top_liege = {
					primary_title = { 
					OR = {
					title = e_mexico
					title = k_mexico
						}
					}
				}
			}
			is_patrician = no
			is_theocracy = no
			}
		
		color = { 0 104 71 }
		
		dukes_called_kings = yes
		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 2000
		
		can_usurp_kingdoms_and_empires = no
		can_imprison_without_reason = no
		can_create_empires = no
		vassal_government_opinion_penalties = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		can_grant_kingdoms_and_empires_to_other_government_group = yes
		can_be_granted_kingdoms_and_empires_by_other_government = no
		free_retract_vassalage = yes
		## Modifiers
		court_size_modifier = 15
		commander_limit = 11
	}

	new_brazil_government = {
		preferred_holdings = { CITY 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
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			republic_government
			merchant_republic_government
			open_range_feudalism_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		free_revoke_on_tiers = {
			DUKE
			KING
		}

		frame_suffix = "_newbrazil"
		potential = {
			AND = {
				culture_group = portuguese
				OR = {
					has_landed_title = e_new_brazil
					top_liege = {
						has_landed_title = e_new_brazil
					}
				}
			}
		}
		
		color = { 255 255 0 }
		
		barons_need_dynasty = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 200
		
		can_usurp_kingdoms_and_empires = no
		can_imprison_without_reason = no
		can_create_empires = no
		vassal_government_opinion_penalties = no
		can_grant_kingdoms_and_empires_to_other_government = no
		can_be_granted_kingdoms_and_empires_by_other_government = no
		free_retract_vassalage = yes

		## Modifiers
		court_size_modifier = 10
		commander_limit = 6
		vassal_limit = 10
	}
}
