feudal_governments = {

	sisterhood_government = {
		preferred_holdings = { TEMPLE }
		allowed_holdings = {
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_religion = {  #Will not get the wrong government type penalty for the same religion
			CASTLE
			TRIBAL
		}
		builds_with_piety = {
			TRIBAL
		}
		accepts_liege_governments = {
			feudal_government
			muslim_government
			theocracy_government
			theocratic_feudal_government
			chinese_imperial_government
			order_government
			nunorder_government
			missionary_government
			warorder_government
		}
		free_revoke_on_governments = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}
		free_revoke_on_tiers = {
			BARON
		}

		forced_contract = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}

		frame_suffix = "_sisorder"
		title_prefix = "sisorder_"

		potential = {
			NOT = { is_government_potential = dummy_government }
			has_game_rule = { name = sco_rule_hoextra value = on }
			is_female = yes
			controls_religion = no
			OR = {
				holy_order = yes
				any_demesne_title = { has_flag = force_sis_government }
				any_liege = {
					OR = {
						holy_order = yes
						government = order_government
						government = sisterhood_government
						government = warorder_government
					}
					religion = ROOT
				}
			}
			NAND = {
				tier = BARON
				capital_holding = { holding_type = temple }
			}
			OR = {
				AND = {
					OR = {
						religion_group = zoroastrian_group
						religion = bon_reformed
						religion = hellenic_pagan_reformed
						religion = zun_pagan_reformed
						religion = west_african_pagan_reformed
						religion = tengri_pagan_reformed
					}
					religion_allows_female_temple_holders = yes
				}
				AND = {
					OR = {
						has_religion_feature = religion_matriarchal
						has_religion_feature = religion_equal
					}
					OR = {
						has_religion_feature = religion_astrology
						has_religion_feature = religion_haruspicy
						has_religion_feature = religion_harems
						has_religion_feature = religion_holy_family
						has_polygamy = yes
						has_concubinage = yes
					}
					NOR = {
						has_religion_feature = religion_syncretic
						has_religion_feature = religion_ritual_sacrifice
						has_religion_feature = religion_cosmopolitan
					}
					OR = {
						has_religion_feature = religion_theocratic_head
						has_autocephaly = yes
					}
				}
			}
			OR = {
				capital_holding = { holding_type = temple }
				AND = { 
					capital_holding = { OR = { holding_type = castle holding_type = tribal } }
					capital_scope = { religion = ROOT }
					NOT = {	any_liege = { government = warorder_government religion = ROOT } }
				}
				any_demesne_title = { has_flag = force_sis_government }
			}
			NAND = {
				OR = {
					is_government_potential = merchant_republic_government
					is_government_potential = pirate_republic_government
					is_government_potential = techno_republic_government
				}
				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 = { 230 160 230 }

		allow_looting = yes
		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		dukes_called_kings = yes
		barons_need_dynasty = yes
		have_gender_laws = no
		uses_piety_for_law_change = 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
		max_consorts = 3
		men_can_take_consorts = no
		women_can_take_consorts = yes
		
		## Modifiers
		commander_limit = 4
		court_size_modifier = 5

		character_modifier = {
			fertility = 0.2
			monthly_character_piety = 0.1
			global_revolt_risk = -0.02
			female_opinion = 5
			church_opinion = 10
		}
	}
	
	nunorder_government = {
		preferred_holdings = { TEMPLE }
		allowed_holdings = {
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_religion = {  #Will not get the wrong government type penalty for the same religion
			CASTLE
			TRIBAL
		}
		builds_with_piety = {
			TRIBAL
		}
		accepts_liege_governments = {
			feudal_government
			muslim_government
			theocracy_government
			theocratic_feudal_government
			chinese_imperial_government
			order_government
			sisterhood_government
			missionary_government
			warorder_government
		}
		free_revoke_on_governments = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}
		free_revoke_on_tiers = {
			BARON
		}

		forced_contract = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}

		frame_suffix = "_nunorder"
		title_prefix = "nunorder_"

		potential = {
			NOT = { is_government_potential = dummy_government }
			has_game_rule = { name = sco_rule_hoextra value = on }
			is_female = yes
			controls_religion = no
			OR = {
				holy_order = yes
				any_demesne_title = { has_flag = force_sis_government }
				any_liege = {
					OR = {
						holy_order = yes
						government = order_government
						government = nunorder_government
						government = warorder_government
					}
					religion = ROOT
				}
			}
			NAND = {
				tier = BARON
				capital_holding = { holding_type = temple }
			}
			OR = {
				AND = {
					OR = {
						religion_group = christian
						religion_group = indian_group
					}
					religion_allows_female_temple_holders = yes
				}
				AND = {
					OR = {
						has_religion_feature = religion_matriarchal
						has_religion_feature = religion_equal
					}
					OR = {
						has_religion_feature = religion_proselytizing
						has_religion_feature = religion_dogmatic
						has_religion_feature = religion_beatification
						has_religion_feature = religion_monastic
					}
					NOR = {
						has_religion_feature = religion_syncretic
						has_religion_feature = religion_ritual_sacrifice
						has_religion_feature = religion_cosmopolitan
					}
					OR = {
						has_religion_feature = religion_theocratic_head
						has_autocephaly = yes
					}
				}
			}
			OR = {
				capital_holding = { holding_type = temple }
				AND = { 
					capital_holding = { OR = { holding_type = castle holding_type = tribal } }
					capital_scope = { religion = ROOT }
					NOT = {	any_liege = { government = warorder_government religion = ROOT } }
				}
				any_demesne_title = { has_flag = force_sis_government }
			}
			NAND = {
				OR = {
					is_government_potential = merchant_republic_government
					is_government_potential = pirate_republic_government
					is_government_potential = techno_republic_government
				}
				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 = { 180 220 220 }

		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		dukes_called_kings = yes
		barons_need_dynasty = yes
		have_gender_laws = no
		uses_piety_for_law_change = 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

		## Modifiers
		commander_limit = 4
		
		character_modifier = {
			temple_tax_modifier = 0.1
			monthly_character_piety = 0.25
			global_revolt_risk = -0.04
			female_opinion = 5
			rel_head_opinion = 5
			church_opinion = 10
		}
	}

	missionary_government = {
		preferred_holdings = { TEMPLE }
		allowed_holdings = {
			TEMPLE
			FORT
			HOSPITAL
		}
		allowed_holdings_religion = {  #Will not get the wrong government type penalty for the same religion
			CITY
			TRIBAL
		}
		builds_with_piety = {
			TRIBAL
		}
		accepts_liege_governments = {
			feudal_government
			muslim_government
			theocracy_government
			theocratic_feudal_government
			chinese_imperial_government
			order_government
			sisterhood_government
			nunorder_government
			warorder_government
		}
		free_revoke_on_governments = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}
		free_revoke_on_tiers = {
			BARON
		}

		forced_contract = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}

		frame_suffix = "_missionary"
		title_prefix = "missionary_"

		potential = {
			NOT = { is_government_potential = dummy_government }
			OR = {
				has_game_rule = { name = sco_rule_hoextra value = on }
				has_game_started = no # Precautions for pre-placed titles of this government
			}
			controls_religion = no
			NOR = { #Added so they can have custom holy order vassals
				holy_order = yes
				any_demesne_title = { has_flag = force_order_government }
				any_demesne_title = { has_flag = force_sis_government }
				any_demesne_title = { has_flag = force_missionary_guard_government }
				any_demesne_title = { has_flag = force_warorder_government }
			}
			OR = {
				any_demesne_title = { has_flag = force_missionary_government }
				any_liege = {
					government = missionary_government
					religion = ROOT
				}
				AND = {
					has_game_started = no
					any_demesne_title = { title = d_benedictine_priory }
				}
			}
			NAND = {
				tier = BARON
				capital_holding = { holding_type = temple }
			}
			OR = {
				OR = {						
					religion_group = christian
					religion_group = muslim
					religion_group = jewish_group
					religion_group = indian_group
					religion_group = zoroastrian_group
					religion = bon_reformed
					religion = hellenic_pagan_reformed
					religion = zun_pagan_reformed
					religion = west_african_pagan_reformed
					religion = tengri_pagan_reformed
				}
				AND = {
					OR = {
						has_religion_feature = religion_proselytizing
						has_religion_feature = religion_dogmatic
						has_religion_feature = religion_beatification
						has_religion_feature = religion_monastic
						has_religion_feature = religion_peaceful
						has_religion_feature = religion_cosmopolitan
					}
					NOR = {
						has_religion_feature = religion_syncretic
						has_religion_feature = religion_ritual_sacrifice
					}
				}
			}
			OR = {
				capital_holding = { holding_type = temple }
				AND = { 
					capital_holding = { OR = { holding_type = city holding_type = tribal } }
					capital_scope = { religion = ROOT }
				}
			}
			NAND = {
				OR = {
					is_government_potential = merchant_republic_government
					is_government_potential = pirate_republic_government
					is_government_potential = techno_republic_government
				}
				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 = { 255 70 0 }

		allow_looting = yes
		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		dukes_called_kings = yes
		barons_need_dynasty = no
		have_gender_laws = no
		uses_piety_for_law_change = 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

		## Modifiers
		commander_limit = 3
		
		character_modifier = {
			diplomacy = 2
			city_tax_modifier = 0.1
			temple_tax_modifier = 0.1
			build_time_city_modifier = -0.1
			build_time_temple_modifier = -0.1
			culture_flex = -0.8
			rel_head_opinion = 5
			church_opinion = 10
		}
	}

	missionary_guard_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = {
			CASTLE
			TRIBAL
			FORT
			HOSPITAL
		}
		builds_with_prestige = {
			TRIBAL
		}
		accepts_liege_governments = {
			feudal_government
			muslim_government
			theocracy_government
			theocratic_feudal_government
			chinese_imperial_government
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}

		frame_suffix = "_missionaryguard"

		potential = {
			NOT = { is_government_potential = dummy_government }
			has_game_rule = { name = sco_rule_hoextra value = on }
			controls_religion = no
			OR = {
				primary_title = { has_flag = force_missionary_guard_government }
				AND = {
					has_game_started = no
					any_demesne_title = { title = c_benedictine_guard }
				}
			}
			#any_liege = {
			#	government = missionary_government
			#	religion = ROOT
			#}
			#OR = {
			#	capital_holding = { OR = { holding_type = castle holding_type = tribal } }
			#	is_landed = no
			#}
		}

		color = { 90 130 130 }

		allow_looting = yes
		can_create_empires = no
		can_create_kingdoms = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		dukes_called_kings = no
		barons_need_dynasty = no
		have_gender_laws = no
		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

		## Modifiers
		commander_limit = 4
		
		character_modifier = {
			martial = 2
			combat_rating = 5
			global_levy_size = 0.1
			land_morale = 0.1
		}
	}

	warorder_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = {
			CASTLE
			TRIBAL
			FORT
			HOSPITAL
		}
		builds_with_prestige = {
			TRIBAL
		}
		accepts_liege_governments = {
			feudal_government
			muslim_government
			theocracy_government
			theocratic_feudal_government
			chinese_imperial_government
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
		}

		free_revoke_on_governments = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}
		free_revoke_on_tiers = {
			BARON
		}

		forced_contract = {
			order_government
			sisterhood_government
			nunorder_government
			missionary_government
			warorder_government
		}

		frame_suffix = "_warorder"
		title_prefix = "order_"

		potential = {
			NOT = { is_government_potential = dummy_government }
			has_game_rule = { name = sco_rule_hoextra value = on }
			controls_religion = no
			NOR = { #Added so they can have custom holy order vassals
				any_demesne_title = { has_flag = force_order_government }
				any_demesne_title = { has_flag = force_sis_government }
				any_demesne_title = { has_flag = force_missionary_government }
				any_demesne_title = { has_flag = force_missionary_guard_government }
			}
			OR = {
				any_demesne_title = { has_flag = force_warorder_government }
				any_liege = {
					government = warorder_government
					religion = ROOT
				}
			}
			OR = {
				OR = {						
					religion_group = christian
					religion_group = muslim
					religion_group = jewish_group
					religion_group = zoroastrian_group
					religion = norse_pagan_reformed
					religion = baltic_pagan_reformed
					religion = finnish_pagan_reformed
					religion = slavic_pagan_reformed
					religion = aztec_reformed
					religion = hellenic_pagan_reformed
					religion = zun_pagan_reformed
					religion = west_african_pagan_reformed
					religion = tengri_pagan_reformed
				}
				AND = {
					OR = {
						has_religion_feature = religion_proselytizing
						has_religion_feature = religion_dogmatic
						has_religion_feature = religion_warlike
						has_religion_feature = religion_defensive
						has_religion_feature = religion_adventuring
						has_religion_feature = religion_seafaring
						has_religion_feature = religion_relentless
						has_religion_feature = religion_ritual_sacrifice
					}
					NOR = {
						has_religion_feature = religion_syncretic
						has_religion_feature = religion_cosmopolitan
						has_religion_feature = religion_peaceful
					}
				}
			}
			capital_holding = { OR = { holding_type = castle holding_type = tribal } }
		}

		color = { 60 0 190 }

		allow_looting = yes
		free_levies_in_offensive_war = yes
		can_create_empires = no
		dukes_called_kings = yes
		barons_need_dynasty = yes
		have_gender_laws = no
		uses_prestige_for_law_change = 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

		## Modifiers
		commander_limit = 6
		
		character_modifier = {
			martial = 2
			combat_rating = 10
			global_levy_size = 0.2
			levy_reinforce_rate = 0.25
			global_tax_modifier = -0.1
			infidel_opinion = -10
			rel_head_opinion = 5
		}
	}

	imperial_pretender_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
			pirate_republic_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_romanimperial"
		potential = {
			independent = yes
			primary_title = {
				OR = { # Important places for the empire, might need a trim
					#Italy
					title = k_romagna
					title = d_latium
					title = d_ferrara
					title = k_italy
					title = d_lombardia
					title = d_toscana
					title = k_naples
					title = k_sicily
					title = d_sicily
					title = d_capua
					#Germany
					title = k_carinthia
					title = d_friuli
					#France
					title = k_france
					title = d_valois
					title = k_aquitaine
					title = d_aquitaine
					title = k_burgundy
					title = d_provence
					#Iberia
					title = k_valencia
					title = d_valencia
					title = k_aragon
					title = d_aragon
					title = d_barcelona
					title = k_portugal
					#England
					title = k_england
					title = d_bedford
					title = d_somerset
					title = d_lancaster
					title = d_canterbury
					title = d_hereford
					title = d_somerset
					title = k_wales
					title = d_gwynedd
					title = 
					#Greece - Byzantium
					title = k_thrace
					title = d_thrace
					title = k_byzantium
					title = d_thessalonika
					title = d_athens
					title = k_epirus
					title = k_cyprus
					#Anatolia
					title = k_trebizond
					title = d_trebizond
					title = k_anatolia
					title = d_anatolia
					title = d_nikaea
					#Balkans
					title = k_croatia
					title = d_croatia
					title = k_dacia
					title = d_wallachia
					#Levant
					title = k_israel
					title = k_jerusalem
					title = d_jerusalem
					title = k_egypt
					title = d_alexandria
					title = d_cairo
					title = k_antioch
					title = k_syria
					title = d_antioch
					#Carthage
					title = k_africa
					title = d_tunis
				}
			}
			OR = {
				has_game_rule = { name = sco_rule_gvimpretender value = title }
				AND = {
					has_game_rule = { name = sco_rule_gvimpretender value = heritage }
					OR = {
						culture_group = byzantine
						culture_group = latin
						religion_group = christian
						religion = hellenic_pagan
						religion = hellenic_pagan_reformed
					}
				}
			}
			is_patrician = no
		}
		
		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
		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
		commander_limit = 5
		court_size_modifier = 10
	}

	techno_feudal_government = {
		preferred_holdings = { CASTLE }
		allowed_holdings = { 
			CASTLE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty
			CITY
			TRIBAL
		}
		accepts_liege_governments = { # Gets the wrong religion modifier instead
			feudal_government
			muslim_government
			theocratic_feudal_government
			chinese_imperial_government
			techno_republic_government
		}
		free_revoke_on_governments = { # Tribal vassals can have their titles revoked for free
			tribal_government
		}

		frame_suffix = "_technofeudal"
		#title_prefix = "technofeudal_"

		potential = {
			OR = {
				controls_religion = no
				religion_group = muslim
				has_religion_feature = religion_temporal_head
				AND = {
					religion = norse_pagan_reformed
					has_religion_features = no # Old saves, and campaigns without HF, need the Fylkirate to continue working
				}
			}
			is_patrician = no
			OR = {
				any_demesne_title = { has_flag = force_techno_feudal_government }
				any_liege = {
					OR = {
						government = techno_feudal_government
						government = techno_republic_government
					}
				}
			}
			OR = {
				capital_holding = { holding_type = castle }
				AND = {
					capital_holding = { holding_type = tribal } # no cities or else no techno republic vassals
					capital_scope = { culture = ROOT }
				}
				any_demesne_title = { has_flag = force_techno_feudal_government }
			}
		}
		
		color = { 80 200 80 }
		
		dukes_called_kings = yes
		barons_need_dynasty = yes
		can_create_empires = no
		have_gender_laws = no
		can_demand_religious_conversion = no
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		marriage_ignore_religion = yes

		can_build_tribal = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 600

		## Modifiers
		commander_limit = 5
		court_size_modifier = 12
		court_size_maintenance_cost_modifier = -0.4

		character_modifier = {
			stewardship = 1
			learning = 2
			global_garrison_size = 0.2
			retinuesize_perc = 0.4
			global_levy_size = -0.1
			city_tax_modifier = -0.2
			city_vassal_tax_modifier = -0.2
			monthly_character_prestige = 0.8
			tech_growth_modifier = 0.2
			religion_flex = -0.8
			church_opinion = -5
			town_opinion = 10
		}
}