republic_governments = {

	pirate_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
			merchant_republic_government
			techno_republic_government
		}
		free_revoke_on_governments = { # Tribal vassals can have their titles revoked for free
			tribal_government
		}
		free_revoke_on_tiers = {
			BARON
		}
		frame_suffix = "_piraterepublic"
		title_prefix = "piraterep_"
		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
				}
			}
			holy_order = no
			OR = {
				any_demesne_title = { has_flag = force_pirate_republic_government }
				any_liege = { government = pirate_republic_government }
				AND = { # Custom start stuff
					OR = {
						primary_title = { title = d_med_pirates }
						any_liege = { primary_title = { title = d_med_pirates } }
					}
					has_game_started = no
				}
			}
			OR = {
				AND = {
					is_patrician = yes
					OR = {
						liege_before_war = {
							NOT = { character = PREV }
							government = pirate_republic_government
							NOT = {
								liege_before_war = {
									NOT = { character = PREV }
									government = pirate_republic_government
								}
							}
						}
						has_game_started = no
					}
				}
				AND = {
					has_game_started = yes
					is_merchant_republic = yes
				}
				AND = {
					capital_scope = { port = yes }
					capital_holding = { holding_type = city }
				}
				any_demesne_title = { has_flag = force_pirate_republic_government }
			}
		}

		color = { 30 180 220 }

		merchant_republic = yes

		allow_looting = yes
		free_levies_in_offensive_war = yes
		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		have_gender_laws = no
		uses_bride_price = yes
		uses_prestige_for_law_change = yes
		can_demand_religious_conversion = no
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		marriage_ignore_religion = yes

		landed_inheritance = no

		capital_move_delay = 600

		## Modifiers
		commander_limit = 2
		court_size_modifier = 3
		court_size_maintenance_cost_modifier = -0.2

		character_modifier = {
			stewardship = 1
			intrigue = 1
			global_levy_size = 0.2
			global_garrison_size = -0.1
			retinuesize_perc = 0.4
			levy_reinforce_rate = 0.1
			land_morale = -0.05
			monthly_character_prestige = 0.8
			monthly_character_piety = -0.1
			bloodline_effect_always_viking = 1 # Does nothing except for adding the effect in the government tooltip (it's actually handled via events and traits)
			church_opinion = -5
		}
	}

	techno_republic_government = {
		preferred_holdings = { CITY }
		allowed_holdings = {
			TRADE_POST
			CITY
			FAMILY_PALACE
			FORT
			HOSPITAL
		}
		allowed_holdings_culture = { # Will not get the wrong government type penalty for temples of the same culture
			TEMPLE
			TRIBAL
		}
		accepts_liege_governments = { # Accepts other republics and technocracies
			republic_government
			merchant_republic_government
			pirate_republic_government
			techno_feudal_government
		}
		free_revoke_on_governments = { # Tribal vassals can have their titles revoked for free
			tribal_government
		}
		free_revoke_on_tiers = {
			BARON
		}
		frame_suffix = "_technorepublic"
		title_prefix = "technorep_"
		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
				}
			}
			holy_order = no
			OR = {
				any_demesne_title = { has_flag = force_techno_republic_government }
				any_liege = { government = techno_republic_government }	
				any_liege = { government = techno_feudal_government }
			}
			OR = {
				is_patrician = yes
				higher_tier_than = BARON
			}
			OR = {
				AND = {
					is_patrician = yes
					OR = {
						liege_before_war = {
							NOT = { character = PREV }
							government = techno_republic_government
							NOT = {
								liege_before_war = {
									NOT = { character = PREV }
									government = techno_republic_government
								}
							}
						}
						has_game_started = no
					}
				}
				AND = {
					has_game_started = yes
					is_merchant_republic = yes
				}
				capital_holding = { holding_type = city }
				any_demesne_title = { has_flag = force_techno_republic_government }
			}
		}

		color = { 145 255 0 }

		merchant_republic = yes

		can_create_empires = no
		can_imprison_without_reason = no
		can_revoke_without_reason = no
		can_usurp_kingdoms_and_empires = no
		can_grant_kingdoms_and_empires_to_other_government = yes
		have_gender_laws = no
		uses_bride_price = yes
		can_demand_religious_conversion = no
		gets_religion_opinion_penalties = no
		gives_religion_opinion_penalties = no
		marriage_ignore_religion = yes

		can_build_tribal = no

		landed_inheritance = no

		capital_move_delay = 600

		## Modifiers
		commander_limit = 4
		court_size_modifier = 10
		court_size_maintenance_cost_modifier = -0.4

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

}