republic_governments = {

	merchant_republic_government = {
		preferred_holdings = {
			CITY
		}
		allowed_holdings = {
			TRADE_POST
			CITY
			CASTLE
			FAMILY_PALACE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		accepts_liege_governments = { # Accepts other republics
			republic_government
		}
		accepts_liege_governments_culture = {
			feudal_government
			muslim_government
			bogomilist_government
			imperial_government
			muslim_imperial_government
			imperial_bogomilist_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}

		frame_suffix = "_merchantrepublic"
		title_prefix = "city_"

		color = { 250 0 0 }

		potential = {
			# Patrician and Doge requirements
			OR = {
				# Doge requirements
				# Does not require being a patrician, to allow creation of new Merchant Republics
				AND = {
					# Must always be coastal
					capital_scope = { is_coastal = yes }

					# Require at least one province and be Duke tier or higher
					higher_real_tier_than = COUNT
					num_of_count_titles >= 1

					# MR can't be under MR
					trigger_if = {
						limit = { independent = no }

						liege_before_war = {
							is_merchant_republic = no
						}
					}
				}

				# Patrician requirements
				AND = {
					is_patrician = yes

					OR = {
						has_game_started = no

						# Liege must be MR
						liege_before_war = {
							is_merchant_republic = yes

							# MR can't be under MR
							trigger_if = {
								limit = { independent = no }

								liege_before_war = {
									is_merchant_republic = no
								}
							}
						}
					}
				}
			}

			could_be_temporal_religious_head_trigger = yes
		}

		allows_matrilineal_marriage = no
		can_build_tribal = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		have_gender_laws = no
		landed_inheritance = no
		merchant_republic = yes
		uses_bride_price = yes

		capital_move_delay = 600

		## Modifiers
		court_size_modifier = 5
		court_size_maintenance_cost_modifier = -0.05
	}

	republic_government = {
		preferred_holdings = {
			CITY
		}
		allowed_holdings = {
			CITY
			CASTLE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for tribes of the same culture
			TRIBAL
		}
		accepts_liege_governments = { # Accepts other republics
			merchant_republic_government
		}
		accepts_liege_governments_culture = {
			feudal_government
			muslim_government
			bogomilist_government
			imperial_government
			muslim_imperial_government
			imperial_bogomilist_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}

		frame_suffix = "_republic"
		title_prefix = "city_"

		color = { 209 125 130 }

		potential = {
			# Necessary to keep Merchant Republics from reverting on some successions
			NOT = { is_government_potential = merchant_republic_government }
			could_be_temporal_religious_head_trigger = yes
		}

		can_build_tribal = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no

		capital_move_delay = 600

		## Modifiers
		court_size_modifier = 5
	}

	confucian_bureaucracy = {
		offmap_power = offmap_china
		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
		}
		forced_contract = {
			feudal_government
			muslim_government
			theocratic_feudal_government
			chinese_imperial_government
			theocracy_government
			tribal_government
			merchant_republic_government
			republic_government
		}
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}

		frame_suffix = "_confucian"
		color = { 94 187 185 }

		potential = {
			is_offmap_tag = offmap_china
		}

		can_create_empires = no
		can_create_kingdoms = no
		can_build_tribal = no
		can_demand_religious_conversion = no
		can_imprison_without_reason = no
		can_inherit = no
		can_revoke_without_reason = no
		gets_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no

		capital_move_delay = 600
		aggression = 0 # AI only attacks by script

		## Modifiers
		court_size_modifier = 10
	}
}