# -*- ck2.governments -*-

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
			muslim_merchant_republic_government
			bogomilist_merchant_republic_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_"
		potential = {
			NOT = { religion_group = muslim }
			OR = {
				NOT = { religion = bogomilist }
				d_bogomilist = { has_flag = bogomilist_formalized }
			}
			OR = {
				controls_religion = no
				religion_group = muslim
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = aztec_reformed
					}
					has_religion_features = no
				}
				religion = paulician
				religion = waldensian
				religion = yazidi
			}
			#is_female = no
			OR = {
				AND = {
					is_patrician = yes
					OR = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
							NOT = {
								liege_before_war = {
									NOT = { character = PREV }
									is_merchant_republic = yes
								}
							}
						}
						has_game_started = no
					}
				}
				AND = {
					OR = {
						AND = {
							has_game_started = yes
							is_merchant_republic = yes
						}
						capital_scope = { port = yes }
					}
					higher_real_tier_than = count
					any_demesne_province = {
						always = yes
					}
					NOT = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
						}
					}
				}
			}
		}

		color = { 250 0 0 }

		merchant_republic = yes

		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		have_gender_laws = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		allows_matrilineal_marriage = no
		uses_bride_price = yes

		can_build_tribal = no

		landed_inheritance = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 1

		## Modifiers
		court_size_modifier = 5
		court_size_maintenance_cost_modifier = -0.05
	}
	
	bogomilist_merchant_republic_government = {
		preferred_holdings = { CITY }
		allowed_holdings = {
			TRADE_POST
			CITY
			CASTLE
			TEMPLE
			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
			muslim_merchant_republic_government
			bogomilist_merchant_republic_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_"
		potential = {
			NOT = { religion_group = muslim }
			religion = bogomilist
			NOT = { d_bogomilist = { has_flag = bogomilist_formalized } }
			OR = {
				controls_religion = no
				religion_group = muslim
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = aztec_reformed
					}
					has_religion_features = no
				}
				religion = paulician
				religion = waldensian
				religion = yazidi
			}
			#is_female = no
			OR = {
				AND = {
					is_patrician = yes
					OR = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
							NOT = {
								liege_before_war = {
									NOT = { character = PREV }
									is_merchant_republic = yes
								}
							}
						}
						has_game_started = no
					}
				}
				AND = {
					OR = {
						AND = {
							has_game_started = yes
							is_merchant_republic = yes
						}
						capital_scope = { port = yes }
					}
					higher_real_tier_than = count
					any_demesne_province = {
						always = yes
					}
					NOT = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
						}
					}
				}
			}
		}

		color = { 250 0 0 }

		merchant_republic = yes

		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		have_gender_laws = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		allows_matrilineal_marriage = no
		uses_bride_price = yes

		can_build_tribal = no

		landed_inheritance = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 1

		## Modifiers
		court_size_modifier = 5
		court_size_maintenance_cost_modifier = -0.05
	}
	
	muslim_merchant_republic_government = {
		preferred_holdings = { CITY }
		allowed_holdings = {
			TRADE_POST
			CITY
			CASTLE
			TEMPLE
			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
			merchant_republic_government
			bogomilist_merchant_republic_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 = "_muslim_merchantrepublic"
		title_prefix = "city_"
		potential = {
			religion_group = muslim
			OR = {
				NOT = { religion = bogomilist }
				d_bogomilist = { has_flag = bogomilist_formalized }
			}
			OR = {
				controls_religion = no
				religion_group = muslim
				has_religion_feature = religion_temporal_head
				AND = {
					OR = {
						religion = norse_pagan_reformed
						religion = aztec_reformed
					}
					has_religion_features = no
				}
				religion = paulician
				religion = waldensian
				religion = yazidi
			}
			#is_female = no
			OR = {
				AND = {
					is_patrician = yes
					OR = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
							NOT = {
								liege_before_war = {
									NOT = { character = PREV }
									is_merchant_republic = yes
								}
							}
						}
						has_game_started = no
					}
				}
				AND = {
					OR = {
						AND = {
							has_game_started = yes
							is_merchant_republic = yes
						}
						capital_scope = { port = yes }
					}
					higher_real_tier_than = count
					any_demesne_province = {
						always = yes
					}
					NOT = {
						liege_before_war = {
							NOT = { character = PREV }
							is_merchant_republic = yes
						}
					}
				}
			}
		}

		color = { 50 205 50 }
		
		uses_piety_for_law_change = yes

		merchant_republic = yes

		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		have_gender_laws = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		allows_matrilineal_marriage = no
		uses_bride_price = yes
		can_be_granted_kingdoms_and_empires_by_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

		landed_inheritance = no
		
		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 1

		## 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
			muslim_merchant_republic_government
			bogomilist_merchant_republic_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_"
		potential = {
			NAND = {
				controls_religion = yes
				NOT = { religion_group = muslim }
			}
			NOR = {
				is_government_potential = merchant_republic_government
				is_government_potential = muslim_merchant_republic_government
				is_government_potential = bogomilist_merchant_republic_government
			}
			holy_order = no
		}

		color = { 209 125 130 }

		can_imprison_without_reason = no
		can_revoke_without_reason = no

		can_build_tribal = no

		ignore_in_vassal_limit_calculation = {
			tribal_government
		}
		capital_move_delay = 1

		## 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
			bogomilist_government
			muslim_government
			theocracy_government
			merchant_republic_government
			muslim_merchant_republic_government
			bogomilist_merchant_republic_government
			republic_government
			tribal_government
			imperial_government
			muslim_imperial_government
			bogomilist_imperial_government
			theocratic_feudal_government
			theocratic_imperial_government
			chinese_imperial_government
		}
		gets_religion_opinion_penalties = no
		vassal_government_opinion_penalties = no
		free_revoke_on_governments_religion = { # Tribal vassals of other religions can have their titles revoked for free
			tribal_government
		}
		frame_suffix = "_confucian"
		potential = {
			is_offmap_tag = offmap_china
		}
		
		color = { 94 187 185 }
		
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		
		can_build_tribal = no
		
		capital_move_delay = 1
		
		aggression = 0 # AI only attacks by script
		can_create_kingdoms = no
		can_create_empires = no
		can_demand_religious_conversion = no
		can_inherit = no
		
		## Modifiers
		court_size_modifier = 10
	}
}
