defaults_reform = {
	valid_for_new_country = yes
	allow_convert = yes
	rulers_can_be_generals = yes
	heirs_can_be_generals = yes
	fixed_rank = 0
	republican_name = no
	militarised_society = no
	government_abilities = { }
	claim_states = no
	religion = no
	republic = no
	dictatorship = no
	is_elective = no
	queen = no
	heir = no
	has_parliament = no
	has_devotion = no
	has_meritocracy = no
	allow_force_tributary = yes
	duration = 0
	election_on_death = no
	monarchy = no
	tribal = no
	different_religion_acceptance = 0
	different_religion_group_acceptance = 0
	boost_income = no
	monastic = no
	can_use_trade_post = no
	native_mechanic = no
	can_form_trade_league = no
	free_city = no
	is_trading_city = no
	trade_city_reform = ""
	maintain_dynasty = no
	allow_migration = no
	nation_designer_trigger = { }
	nation_designer_cost = 0
	papacy = no
	has_harem = no
	has_pashas = no
	allow_vassal_war = no
	allow_vassal_alliance = no
	min_autonomy = 0
	factions_frame = 2
	factions = { }
	foreign_slave_rulers = no
	royal_marriage = yes
	nomad = no
	raze_province = no
	assimilation_cultures = { }
	states_general_mechanic = { }
	valid_for_nation_designer = yes
	allow_normal_conversion = yes
	force_conversion_gives_global_holy_war_released_modifier = no
	start_territory_to_estates = 0.8
	has_term_election = no
	force_admiral_leader = no
	admirals_become_rulers = no
	generals_become_rulers = no
	allow_banners = no
	uses_revolutionary_zeal = no
	revolutionary = no
	revolutionary_client_state = no
	allow_draft_transport_ships = no
	free_concentrate_development = no
	disallowed_trade_goods = {}
	can_customise_heir = yes
	allow_cawa = no
	can_change_primary_culture = yes
}

# legacy governments

despotic_monarchy = {
	# government mechanics flags go here
	icon = "crown"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	monarchy = yes
	modifiers = {
    	governing_capacity = 50
		global_unrest = -1
		unjustified_demands = -0.1
		max_absolutism = 5
	}
	ai = {
		factor = 1
	}
}

persian_empire = {
	icon = "liberte_reform"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_nation_designer = yes
	potential = {
		OR = {
			tag = PER
			was_tag = PER
			has_reform = persian_empire_reform
		}
		AND = {
			religion = zoroastrian
		    culture_group = iranian
				}
	}
	monarchy = yes
	nation_designer_cost = 100
	modifiers = {
		vassal_income = 0.25
		governing_capacity = 100
		max_absolutism = 10
		monarch_admin_power = 2
		global_autonomy = -0.05
	}
	ai = {
		factor = 5
	}
}

feudal_monarchy = {
	icon = "castle"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	monarchy = yes
	modifiers = {
		governing_capacity = 100
		global_manpower_modifier = 0.1
		vassal_income = 0.25
	}
	ai = {
		factor = 2
		modifier = {
			factor = 0
			NOT = {
				has_idea_group = aristocracy_ideas
				has_reform = feudal_monarchy
			}
		}
	}
}

####################################
#
#Monarchies
#
####################################

administrative_monarchy = {
	# government mechanics flags go here
	icon = "paper_with_seal"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	monarchy = yes
	modifiers = {
    	governing_capacity = 150
		production_efficiency = 0.1
		global_tax_modifier = 0.05
		global_autonomy = -0.025
	}
	ai = {
		factor = 1
		modifier = {
			factor = 3
			has_idea_group = economic_ideas
		}
		modifier = {
			factor = 3
			has_idea_group = trade_ideas
		}
	}
}

constitutional_monarchy = {
	# government mechanics flags go here
	icon = "constitution"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	monarchy = yes
	modifiers = {
    	governing_capacity = 150
		years_of_nationalism = -5
		legitimacy = 1
		global_autonomy = -0.075
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}

	ai = {
		factor = 1
		modifier = {
			factor = 2
			has_idea_group = humanist_ideas
		}
		modifier = {
			factor = 2
			has_idea_group = innovativeness_ideas
		}
	}
}


enlightened_despotism = {
	# government mechanics flags go here
	icon = "paper_with_seal_3"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	monarchy = yes
	modifiers = {
    	governing_capacity = 150
		num_accepted_cultures = 2
		global_manpower_modifier = 0.1
		global_autonomy = -0.075
		max_absolutism = 10
	}
	ai = {
		factor = 5
	}
}

holy_state_legacy = {
	icon = "religious_leader"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_trigger = {
		religion = catholic
	}
	monarchy = yes
	modifiers = {
    	governing_capacity = 100
		cb_on_religious_enemies = yes
		manpower_recovery_speed = 0.15
		global_autonomy = -0.2
	}
}

revolutionary_empire = {
	# government mechanics flags go here
	icon = "rioting_burning"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	monarchy = yes
	revolutionary = yes
	modifiers = {
    	governing_capacity = 150
		global_manpower_modifier = 0.25
		land_morale = 0.10
		global_autonomy = -0.2
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = {
					has_country_flag = is_revolutionary_china_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_china_flag
				restore_country_name = yes
				override_country_name = CHINA_STRING
				set_country_flag = is_china_flag
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_turkey_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_turkey_flag
				restore_country_name = yes
				override_country_name = TURKEY_STRING
				set_country_flag = is_turkey_flag
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_gurkani_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_gurkani_flag
				restore_country_name = yes
				override_country_name = GURKANI_EMPIRE_STRING
				set_country_flag = is_gurkani_flag
			}
		}
	}

	ai = {
		factor = 0
	}
}

####################################
#
#Republics
#
####################################

merchant_republic = {
	# government mechanics flags go here
	icon = "politician"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	duration = 4

	republican_name = yes
	royal_marriage = no

	boost_income = yes

	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}

	republic = yes

	modifiers = {
		merchants = 1
		caravan_power = 0.33
		max_absolutism = -50
    	governing_capacity = 150
	}

	conditional = {
		allow = {
			has_dlc = "Res Publica"
			NOT = { has_dlc = "Mare Nostrum" }
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city_legacy
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
			has_dlc = "Mare Nostrum"
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = trading_city_legacy
	}
	
	custom_attributes = {
		is_merchant_republic = yes
	}

	ai = {
		factor = 0
	}
}

venetian_merchant_republic = {
	# government mechanics flags go here
	icon = "politician"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	has_term_election = no

	republican_name = yes
	royal_marriage = no

	boost_income = yes

	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}

	republic = yes

	modifiers = {
		merchants = 1
		caravan_power = 0.33
		max_absolutism = -50
    	governing_capacity = 150
	}

	conditional = {
		allow = {
			has_dlc = "Res Publica"
			NOT = { has_dlc = "Mare Nostrum" }
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city_legacy
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
			has_dlc = "Mare Nostrum"
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = trading_city_legacy
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		lottery_election = yes
		election_on_death = yes
		is_merchant_republic = yes
	}

	ai = {
		factor = 0
	}
}

oligarchic_republic = {
	# government mechanics flags go here
	icon = "nobleman"
	allow_normal_conversion = yes
	legacy_government = yes
	duration = 4
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 0

	republican_name = yes
	royal_marriage = no
	
	republic = yes
	modifiers = {
		global_tax_modifier = 0.05
		stability_cost_modifier = -0.05
		global_autonomy = -0.025
		max_absolutism = -40
    	governing_capacity = 100
	}

	ai = {
		factor = 0
	}
}

prussian_republic = {
	icon = "prussian_monarchy"
	allow_normal_conversion = yes
	republic = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 100
	has_term_election = no
	republican_name = yes
	royal_marriage = no
	
	nation_designer_trigger = {
		primary_culture =  prussian
	}
	
	trigger = {
		OR = {
			is_playing_custom_nation = yes
			religion = protestant
			religion = reformed
		}
	}
	
	modifiers = {
		war_exhaustion = -0.02
		global_unrest = -2
		global_autonomy = -0.075
		republican_tradition = -0.5
		governing_capacity_modifier = -0.5
	}
	
	conditional = {
		allow = { has_dlc = "Rights of Man" }
		militarised_society = yes
	}
	
	custom_attributes = {
		generals_become_rulers = yes
	}
}

signoria = {
	icon = "man_and_children"
	allow_normal_conversion = yes
	legacy_government = yes
	duration = 12
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_trigger = {
		culture_group = latin
	}
	nation_designer_cost = 0
	republican_name = yes
	royal_marriage = yes

	republic = yes
	modifiers = {
		global_tax_modifier = 0.05
		stability_cost_modifier = -0.05
		global_autonomy = -0.025
		max_absolutism = -30
    	governing_capacity = 100
	}
	
	custom_attributes = {
		enables_nepotism = yes
	}
}

pirate_republic = {
	icon = "trading_city" # should have a unique icon
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	duration = 4
	
	republican_name = yes
	royal_marriage = no
	
	republic = yes
	can_form_trade_league = no

	nation_designer_trigger = {
		has_dlc = "Golden Century"
		capital_scope = {
			has_port = yes
			OR = {
				province_is_on_an_island = yes
				region = maghreb_region
			}
		}
		NOT = { technology_group = andean }
		NOT = { technology_group = north_american }
		NOT = { technology_group = south_american }
		NOT = { technology_group = mesoamerican }
	}
	
	potential = {	
		has_dlc = "Golden Century"
	}
	
	factions_frame = 9
	factions = {
		pr_buccaneers
		pr_smugglers
		pr_captains
	}
	
	modifiers = {
		republican_tradition = -1
		max_absolutism = -50
		naval_forcelimit_modifier = 0.5
		capture_ship_chance = 0.33
		may_perform_slave_raid_on_same_religion = yes
	}
	
	custom_attributes = {
		force_admiral_leader = yes
	}
	
	ai = {
		factor = 0
	}
}

pirate_kingdom = {
	icon = "trading_city" # should have a unique icon
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	has_term_election = no
	
	
	republican_name = yes
	royal_marriage = no
	
	republic = yes
	
	potential = {	
		has_dlc = "Golden Century"
	}
	
	nation_designer_trigger = {
		capital_scope = {
			has_port = yes
			OR = {
				province_is_on_an_island = yes
				region = maghreb_region
			}
		}
	}
	
	factions_frame = 9
	factions = {
		pr_buccaneers
		pr_smugglers
		pr_captains
	}
	
	modifiers = {
		republican_tradition = -1
		max_absolutism = -50
		naval_forcelimit_modifier = 0.5
		capture_ship_chance = 0.33
		pr_captains_influence = 0.1
		harsh_treatment_cost = -0.2
		leader_naval_fire = 1
		may_perform_slave_raid_on_same_religion = yes
	}
	
	custom_attributes = {
		admirals_become_rulers = yes
	}
	
	ai = {
		factor = 0
	}
}

war_against_the_world_government = {
	icon = "trading_city" # should have a unique icon
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	duration = 4
	disallowed_trade_goods = { slaves }
	
	republican_name = yes
	royal_marriage = no
	
	republic = yes
	
	potential = {	
		has_dlc = "Golden Century"
	}
	
	factions_frame = 9
	factions = {
		pr_buccaneers
		pr_smugglers
		pr_captains
	}
	
	modifiers = {
		republican_tradition = -1
		max_absolutism = -50
		naval_forcelimit_modifier = 0.5
		capture_ship_chance = 0.33
		pr_buccaneers_influence = 0.1
		years_of_nationalism = -5
		global_manpower_modifier = 0.1
		may_perform_slave_raid_on_same_religion = yes
	}
	
	custom_attributes = {
		force_admiral_leader = yes
	}
	
	ai = {
		factor = 0
	}
}

black_market_consortium_government = {
	icon = "trading_city" # should have a unique icon
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	duration = 4
	
	republican_name = yes
	royal_marriage = no
	
	republic = yes
	
	nation_designer_trigger = {
		capital_scope = {
			has_port = yes
			OR = {
				province_is_on_an_island = yes
				region = maghreb_region
			}
		}
	}
	
	factions_frame = 9
	factions = {
		pr_buccaneers
		pr_smugglers
		pr_captains
	}
	
	modifiers = {
		republican_tradition = -1
		max_absolutism = -50
		naval_forcelimit_modifier = 0.5
		capture_ship_chance = 0.33
		pr_smugglers_influence = 0.1
		global_foreign_trade_power = 0.3
		may_perform_slave_raid_on_same_religion = yes
	}
	
	custom_attributes = {
		force_admiral_leader = yes
	}
	
	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	boost_income = yes
	
	ai = {
		factor = 0
	}
}

noble_republic = {
	# government mechanics flags go here
	icon = "paper_money_map"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	duration = 4

	republican_name = yes
	royal_marriage = yes

	monarchy = yes
	modifiers = {
   		governing_capacity = 100
		tolerance_heretic = 1
		land_morale = 0.1
		max_absolutism = -40
	}

	ai = {
		factor = 0
	}
}


administrative_republic = {
	# government mechanics flags go here
	icon = "paper_with_seal"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	duration = 5

	republican_name = yes
	royal_marriage = no


	republic = yes
	modifiers = {
    	governing_capacity = 150
		years_of_nationalism = -5
		production_efficiency = 0.1
		global_autonomy = -0.05
		max_absolutism = -30
	}

	ai = {
		factor = 1
		modifier = {
			factor = 0
			NOT = {
				AND = {
					has_reform = merchant_republic
					capital_scope = { has_port = no }
				}
				AND = {
					has_reform = republican_dictatorship
					NOT = { dip = 4 }
					NOT = { adm = 4 }
					NOT = { mil = 4 }
				}
			}
		}
	}
}

military_dictatorship = {
	icon = "paper_with_seal_3"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	has_term_election = no
	
	republican_name = yes
	royal_marriage = no
	republic = yes

	modifiers = {
		global_autonomy = -0.075
		land_morale = 0.1
	}
	custom_attributes = {
		generals_become_rulers = yes
	}
}

protectorate_parliament_legacy = {
	icon = "parliament_hall"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	has_term_election = no
	
	republican_name = yes
	royal_marriage = no
	republic = yes
	
	modifiers = {
		global_autonomy = -0.05
		land_morale = 0.05
		max_absolutism = -20
	}
	conditional = {
		allow = { has_dlc = "Common Sense" }
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}
	has_term_election = no
}


republican_dictatorship = {
	# government mechanics flags go here
	icon = "paper_with_seal_3"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	has_term_election = no


	republican_name = yes
	royal_marriage = no


	dictatorship = yes
	modifiers = {
    	governing_capacity = 150
		global_autonomy = -0.075
		tolerance_heathen = 1
		land_morale = 0.1
	}

	ai = {
		factor = 1
		modifier = {
			factor = 0
			NOT = {
				AND = {
					has_reform = merchant_republic
					capital_scope = { has_port = no }
				}
				has_reform = administrative_republic
				has_reform = constitutional_republic
			}
		}
		modifier = {
			factor = 0
			NOT = {
				AND = {
					dip = 5
					adm = 5
					mil = 5
				}
			}
		}
	}
}

constitutional_republic = {
	# government mechanics flags go here
	icon = "constitution"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no
	duration = 5

	republican_name = yes
	royal_marriage = no

	republic = yes
	modifiers = {
    	governing_capacity = 150
		production_efficiency = 0.1
		trade_efficiency = 0.1
		global_autonomy = -0.075
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}

	ai = {
		factor = 1
		modifier = {
			factor = 0
			NOT = {
				has_reform = administrative_republic
				AND = {
					has_reform = merchant_republic
					capital_scope = { has_port = no }
				}
				AND = {
					has_reform = republican_dictatorship
					NOT = { dip = 4 }
					NOT = { adm = 4 }
					NOT = { mil = 4 }
				}
			}
		}
	}
}

revolutionary_republic = {
	# government mechanics flags go here
	icon = "rioting_burning"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	duration = 4

	republican_name = yes
	royal_marriage = no
	revolutionary = yes

    fixed_rank = 3
	republic = yes
	modifiers = {
    	governing_capacity = 150
		tolerance_heretic = 2
		land_morale = 0.1
		global_autonomy = -0.2
	}

	conditional = {
		allow = {
			has_dlc = "Rights of Man"
		}
		factions = {
			rr_jacobins
			rr_royalists
			rr_girondists
		}
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = {
					has_country_flag = is_revolutionary_china_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_china_flag
				restore_country_name = yes
				override_country_name = CHINA_STRING
				set_country_flag = is_china_flag
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_turkey_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_turkey_flag
				restore_country_name = yes
				override_country_name = TURKEY_STRING
				set_country_flag = is_turkey_flag
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_gurkani_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_gurkani_flag
				restore_country_name = yes
				override_country_name = GURKANI_EMPIRE_STRING
				set_country_flag = is_gurkani_flag
			}
		}
	}


	ai = {
		factor = 0
	}
}

bureaucratic_despotism = {
	# government mechanics flags go here
	icon = "parliament"
	allow_normal_conversion = yes
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = no

	republican_name = yes
	royal_marriage = no

	republic = yes
	modifiers = {
    	governing_capacity = 150
		global_autonomy = -0.075
			stability_cost_modifier = -0.20
	}

	ai = {
		factor = 0
	}
}

####################################
#
#Religious Governments
#
####################################


theocratic_government = {
	# government mechanics flags go here
	icon = "religious_leader"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes

	rulers_can_be_generals = no

	valid_for_nation_designer = yes
	nation_designer_cost = 0

	royal_marriage = no

	different_religion_acceptance = -20
	different_religion_group_acceptance = -50

	religion = yes
	modifiers = {
    	governing_capacity = 150
		tolerance_own = 2
		tolerance_heretic = -1
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}

		has_devotion = yes
	}

	ai = {
		factor = 0
	}
}

monastic_order_government = {
	# government mechanics flags go here
	icon = "reform_soldiers"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	rulers_can_be_generals = yes

	royal_marriage = no
	
	rulers_can_be_generals = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 10

	different_religion_acceptance = -20
	different_religion_group_acceptance = -50

    fixed_rank = 1
	religion = yes
	monastic = yes
	modifiers = {
    	governing_capacity = 150
		tolerance_own = 1
		fort_maintenance_modifier = -0.2
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}

		has_devotion = yes
	}

	ai = {
		factor = 0
	}
}

holy_state_theocracy = {
	icon = "religious_leader"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_trigger = {
		religion = catholic
	}
	religion = yes
	monastic = yes
	modifiers = {
    	governing_capacity = 100
		# cb_on_religious_enemies = yes
		manpower_recovery_speed = 0.15
		global_autonomy = -0.2
	}
	
	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}

		has_devotion = yes
	}
}

papal_government = {
	# government mechanics flags go here
	icon = "pope"
	allow_normal_conversion = no
	allow_convert = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	rulers_can_be_generals = no
	papacy = yes

	royal_marriage = no

	different_religion_acceptance = -20
	different_religion_group_acceptance = -50

    fixed_rank = 2
	religion = yes
	monastic = yes
	modifiers = {
    	governing_capacity = 50
		tolerance_own = 1
		prestige_per_development_from_conversion = 0.33
		global_autonomy = -0.05
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}

		has_devotion = yes
	}

	ai = {
		factor = 0
	}
}

steppe_horde_legacy = {
	# government mechanics flags go here
	icon = "tribal_council"
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	allow_normal_conversion = no
	allow_convert = no
	tribal = yes
	nomad = yes
	raze_province = yes

	nation_designer_cost = 0
	nation_designer_trigger = {
		technology_group = nomad_group
	}

	monarchy = yes
	start_territory_to_estates = 0.5
	modifiers = {
    	governing_capacity = 50
		global_manpower_modifier = 0.2
		land_forcelimit_modifier = 0.2
		loot_amount = 0.50
		global_institution_spread = -0.15
		reinforce_cost_modifier = -0.5
		cav_to_inf_ratio = 0.25
		movement_speed = 0.2
	}
	ai = {
		factor = 0
	}
}

great_mongol_state_legacy = {
	# government mechanics flags go here
	icon = "tribal_council"
	legacy_government = yes
	valid_for_new_country = yes
	valid_for_nation_designer = yes
	allow_normal_conversion = no
	allow_convert = no
	tribal = yes
	nomad = yes
	raze_province = yes

	nation_designer_cost = 0
	nation_designer_trigger = {
		technology_group = nomad_group
	}

	monarchy = yes
	start_territory_to_estates = 0.5
	modifiers = {
		horde_unity = 1
    	governing_capacity = 50
		global_manpower_modifier = 0.2
		land_forcelimit_modifier = 0.2
		loot_amount = 0.50
		reinforce_cost_modifier = -0.5
		cav_to_inf_ratio = 0.25
		movement_speed = 0.2
	}
	conditional = {
		allow = { has_dlc = "Mandate of Heaven" }
		allow_banners = yes
	}
	ai = {
		factor = 0
	}
}

tribal_despotism_legacy = {
	# government mechanics flags go here
	icon = "king_2"
	legacy_government = yes
	valid_for_new_country = yes
	allow_normal_conversion = no
	tribal = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 0


	monarchy = yes
	modifiers = {
    	governing_capacity = 50
		core_creation = -0.1
		global_unrest = -1
		diplomatic_upkeep = -1
		global_institution_spread = -0.05
	}
	ai = {
		factor = 0
	}
}

tribal_kingdom_legacy = {
	# government mechanics flags go here
	icon = "shaman"
	legacy_government = yes
	valid_for_new_country = yes
	allow_normal_conversion = no
	tribal = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 0

	monarchy = yes
	modifiers = {
		vassal_income = 0.20
		stability_cost_modifier = -0.1
		diplomatic_upkeep = -1
		global_institution_spread = -0.025
	}
	ai = {
		factor = 0
	}
}

tribal_federation_legacy = {
	# government mechanics flags go here
	icon = "soldiers_2"
	allow_normal_conversion = no
	legacy_government = yes
	allow_convert = no
	tribal = yes

	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_cost = 20

	monarchy = yes
	modifiers = {
		years_of_nationalism = -5
		cav_to_inf_ratio = 0.25
		province_warscore_cost = -0.10
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		government_abilities = {
			tribal_federation_mechanic
		}
	}
	ai = {
		factor = 0
	}
}

tribal_democracy_legacy = {
	# government mechanics flags go here
	icon = "assembly_hall"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	tribal = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 0

	republic = yes
	modifiers = {
		global_unrest = -1
		stability_cost_modifier = -0.15
		diplomatic_upkeep = -1
		global_institution_spread = -0.05
	}
	ai = {
		factor = 0
	}
}

native_council_legacy = {
	# government mechanics flags go here
	icon = "shaman"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = no
	native_mechanic = yes
	allow_migration = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 0
	nation_designer_trigger = {
		OR = {
			technology_group = north_american
			technology_group = south_american
		}
		capital_scope = {
			OR = {
				continent = north_america
				continent = south_america
				continent = new_world
			}
		}
	}

    fixed_rank = 1
	modifiers = {
		stability_cost_modifier = -0.33
		land_maintenance_modifier = -0.25
		diplomatic_upkeep = -1
		global_institution_spread = -0.025
	}
	ai = {
		factor = 0
	}
}

siberian_native_council = {
	# government mechanics flags go here
	icon = "shaman"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = yes
	allow_convert = no
	native_mechanic = no
	allow_migration = yes

	valid_for_nation_designer = yes
	nation_designer_cost = -10

    fixed_rank = 1
	modifiers = {
		stability_cost_modifier = -0.33
		global_institution_spread = -0.2
	}
	ai = {
		factor = 0
	}
}

##########################################
#
#Unique Governments for special countries
#
##########################################

#Somewhat special for Austria
austrian_archduchy = {
	icon = "king"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_nation_designer = yes
	potential = {
		OR = {
			tag = HAB
			was_tag = HAB
			has_reform = austrian_archduchy_reform
		}
	}
	monarchy = yes
	nation_designer_cost = 5
	modifiers = {
		governing_capacity = 100
		prestige = 0.5
		liberty_desire_from_subject_development = -0.33
	}
	ai = {
		factor = 5
	}
}

#Special for England
english_monarchy_legacy = {
	# government mechanics flags go here
	icon = "british_queen"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = no

	valid_for_nation_designer = yes
	nation_designer_cost = 15
	nation_designer_trigger = {
		has_dlc = "Common Sense"
	}

	monarchy = yes
	start_territory_to_estates = 0.3
	modifiers = {
		legitimacy = 0.5
		global_unrest = -1
		global_autonomy = -0.05
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}
	ai = {
		factor = 5
	}
}

#Special for Mamluks
mamluk_government_legacy = {
	# government mechanics flags go here
	icon = "muslim"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = no

	heir = no
	queen = no

	valid_for_nation_designer = yes
	nation_designer_cost = 60

	monarchy = yes
	modifiers = {
		num_accepted_cultures = 3
		global_autonomy = -0.025
		monarch_admin_power = 2
		same_culture_advisor_cost = -0.25
		promote_culture_cost = -0.5
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		government_abilities = {
			mamluk_mechanic
		}
		foreign_slave_rulers = yes
	}
	ai = {
		factor = 5
	}
}

#Special for Persia, Ardabil, Oman and Rassids
feudal_theocracy_legacy = { #Imamates, Sheikdoms
	# government mechanics flags go here
	icon = "muslim"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = no

	valid_for_nation_designer = yes
	nation_designer_cost = 60

	monarchy = yes
	modifiers = {
		missionaries = 1
		global_missionary_strength = 0.01
		tolerance_own = 1
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		government_abilities = {
			feudal_theocracy_mechanic
		}
	}
	ai = {
		factor = 5
	}
}


#Special for Poland
elective_monarchy_legacy = {
	# government mechanics flags go here
	allow_normal_conversion = no
	legacy_government = yes
	icon = "crown"

	valid_for_new_country = no
	allow_convert = no
	valid_for_nation_designer = yes
	nation_designer_cost = 10
	nation_designer_trigger = {
		has_dlc = "Res Publica"
	}

	monarchy = yes
	modifiers = {
		vassal_income = 0.25
		global_unrest = -1
		global_autonomy = -0.025
		max_absolutism = -30
	}

	conditional = {
		allow = { has_dlc = "Res Publica" }
		is_elective = yes
	}
	ai = {
		factor = 5
	}
}

#Special for HRE free cities
imperial_city = {
	# government mechanics flags go here
	icon = "judge"
	allow_normal_conversion = no
	legacy_government = yes

	free_city = yes

	valid_for_new_country = no
	allow_convert = no
	duration = 4

	republican_name = yes
	royal_marriage = no

	valid_for_nation_designer = yes
	nation_designer_cost = 40
	nation_designer_trigger = {
		has_dlc = "Common Sense"
		capital_scope = { is_part_of_hre = yes }
		NOT = { num_custom_nation_provinces = 2 }
	}


    fixed_rank = 1
	republic = yes
	modifiers = {
		trade_efficiency = 0.1
		development_cost = -0.1
		max_absolutism = -20
	}
	ai = {
		factor = 5
	}
}

# Special City States
trading_city_legacy = {
	# government mechanics flags go here
	icon = "judge"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	valid_for_nation_designer = no

	duration = 4

	republican_name = yes
	royal_marriage = no

	is_trading_city = yes

	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}

    fixed_rank = 1
	republic = yes
	modifiers = {
		global_trade_power = 0.1
		max_absolutism = -20
	}

	conditional = {
		allow = {
			has_dlc = "Res Publica"
			NOT = { has_dlc = "Mare Nostrum" }
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
		}
		can_form_trade_league = yes
		trade_city_reform = merchant_republic # For trade cities this is their fallback government if they get more than 1 provinces
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
			has_dlc = "Mare Nostrum"
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = merchant_republic # For trade cities this is their fallback government if they get more than 1 provinces
	}
	ai = {
		factor = 0
	}
}

#Special for Milan
ambrosian_republic_legacy = {
	# government mechanics flags go here
	icon = "judge"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = yes

	duration = 4

	republican_name = yes
	royal_marriage = no

	valid_for_nation_designer = yes
	nation_designer_cost = 10

	republic = yes
	modifiers = {
		governing_capacity = 100
		global_tax_modifier = 0.10
		land_morale = 0.05
		max_absolutism = -30
	}
	ai = {
		factor = 5
	}
}

# Special for the Dutch
dutch_republic_legacy = {
	# government mechanics flags go here
	icon = "dutch_flag"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no

	duration = 4

	allow_convert = no

	republican_name = no
	royal_marriage = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 40
	nation_designer_trigger = {
		has_dlc = "Res Publica"
	}

	republic = yes
	modifiers = {
		governing_capacity = 100
		heavy_ship_power = 0.10
		trade_efficiency = 0.10
		global_autonomy = -0.05
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}

		states_general_mechanic = {
			statists = {
				naval_forcelimit_modifier = 0.10
				global_trade_power = 0.05
				republican_tradition = 1
			}

			orangists = {
				land_forcelimit_modifier = 0.25
				stability_cost_modifier = -0.10
				republican_tradition = -1
			}
		}
	}

	ai = {
		factor = 5
	}
}

# China
celestial_empire_legacy = {
	# government mechanics flags go here
	allow_normal_conversion = no
	legacy_government = yes
	monarchy = yes
	icon = "crown"
	maintain_dynasty = yes

	allow_force_tributary = no

	valid_for_new_country = no
	valid_for_nation_designer = no
	allow_convert = no
	start_territory_to_estates = 0.9
	nation_designer_trigger = {
		culture_group = east_asian
		technology_group = chinese
		capital_scope = {
			OR = {
				region = north_china_region
				region = xinan_region
				region = south_china_region
			}
		}
	}
	factions = {
		temples
		enuchs
		bureaucrats
	}

    fixed_rank = 3
	modifiers = {
		prestige = 0.5
		embracement_cost = 0.1
		governing_capacity = 250
	}

	conditional = {
		allow = { has_dlc = "Mandate of Heaven" }
		has_meritocracy = yes
		factions = {}
	}

	ai = {
		factor = 5
	}
}


# Ottoman Empire
ottoman_government_legacy = {
	# government mechanics flags go here
	allow_normal_conversion = no
	icon = "crown"
	legacy_government = yes
	monarchy = yes
	maintain_dynasty = yes
	valid_for_new_country = no
	allow_convert = no
	valid_for_nation_designer = yes
	nation_designer_cost = 20
	nation_designer_trigger = {
		religion_group = muslim
	}


	modifiers = {
		governing_capacity = 250
		unjustified_demands = -0.1
		legitimacy = 0.5
		max_absolutism = 5
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		has_harem = yes
		has_pashas = yes
	}

	ai = {
		factor = 5
	}
}

prussian_monarchy_legacy = {
	# government mechanics flags go here
	allow_normal_conversion = no
	icon = "crown"
	legacy_government = yes
	valid_for_new_country = no
	allow_convert = no

	potential = {
		OR = {
			is_playing_custom_nation = yes
			religion = protestant
			religion = reformed
		}
	}

	valid_for_nation_designer = yes
	nation_designer_cost = 100

	monarchy = yes
	modifiers = {
		war_exhaustion = -0.02
		global_unrest = -2
		global_autonomy = -0.075
		max_absolutism = 10
		monarch_military_power = 3
		governing_capacity_modifier = -0.5
	}

	conditional = {
		allow = { has_dlc = "Rights of Man" }
		militarised_society = yes
	}

	ai = {
		factor = 5
	}
}

iqta_legacy = {
	# government mechanics flags go here
	allow_normal_conversion = no
	icon = "muslim"
	legacy_government = yes
	queen = no

	valid_for_new_country = no
	allow_convert = no
	valid_for_nation_designer = yes
	nation_designer_cost = 10
	nation_designer_trigger = {
		religion_group = muslim
	}

	monarchy = yes
	modifiers = {
		governing_capacity = 100
		vassal_income = 0.33
		global_tax_modifier = 0.05
		global_autonomy = -0.025
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		government_abilities = {
			iqta_mechanic
		}
	}

	ai = {
		factor = 5
	}
}

daimyo_legacy = {
	# government mechanics flags go here
	icon = "crown"
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	maintain_dynasty = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 0
	nation_designer_trigger = {
		culture_group = japanese_g
		technology_group = chinese
		capital_scope = { region = japan_region }
	}

    fixed_rank = 1
	monarchy = yes
	modifiers = {
		land_morale = 0.10
		infantry_power = 0.10
	}

	ai = {
		factor = 5
	}
}

indian_sultanate_legacy = {
	# government mechanics flags go here
	icon = "crown"
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	valid_for_nation_designer = yes
	nation_designer_cost = 0
	nation_designer_trigger = {
		capital_scope = {
			superregion = india_superregion
		}
		religion_group = muslim
	}

	monarchy = yes
	modifiers = {
		tolerance_heathen = 3
	}

	conditional = {
		allow = { has_dlc = "Cradle of Civilization" }
		government_abilities = {
			iqta_mechanic
		}
	}

	ai = {
		factor = 5
	}
}

shogunate_legacy = {
	# government mechanics flags go here
	icon = "crown"
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	maintain_dynasty = yes

	allow_vassal_war = yes
	allow_vassal_alliance = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 50
	nation_designer_trigger = {
		culture_group = japanese_g
		technology_group = chinese
		capital_scope = { region = japan_region }
		owns = 1020
	}

    fixed_rank = 2
	monarchy = yes
	modifiers = {
		governing_capacity = 100
		diplomats = 1
		envoy_travel_time = -0.25
		max_absolutism = 5
	}
	can_change_primary_culture = no

	ai = {
		factor = 5
	}
}

indep_daimyo_legacy = {
	# government mechanics flags go here
	icon = "crown"
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	maintain_dynasty = yes

	valid_for_nation_designer = yes
	nation_designer_cost = 0
	nation_designer_trigger = {
		culture_group = japanese_g
		technology_group = chinese
		capital_scope = { region = japan_region }
	}

	monarchy = yes
	modifiers = {
		governing_capacity = -150
		land_morale = 0.1
		infantry_power = 0.1
	}

	ai = {
		factor = 5
	}
}

colonial_government_legacy = {
	# government mechanics flags go here
	icon = "peasants"
	legacy_government = yes
	allow_normal_conversion = no

	duration = 8

	valid_for_new_country = no
	valid_for_nation_designer = no
	allow_convert = no

	republican_name = yes
	royal_marriage = no

    fixed_rank = 1
	republic = yes
	modifiers = {
		governing_capacity = 100
		global_autonomy = -0.05
		recover_army_morale_speed = 0.02
		embracement_cost = -0.1
	}

	ai = {
		factor = 0
	}
}


american_republic_legacy = {
	# government mechanics flags go here
	icon = "constitution"
	legacy_government = yes
	duration = 4
	allow_normal_conversion = no

	republican_name = yes
	royal_marriage = no
	valid_for_new_country = no
	allow_convert = no
	valid_for_nation_designer = yes
	nation_designer_cost = 15
	nation_designer_trigger = {
		has_dlc = "American Dream"
	}

	republic = yes
	modifiers = {
		war_exhaustion = -0.02
		stability_cost_modifier = -0.1
		global_autonomy = -0.15
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}
		has_parliament = yes
	}

	ai = {
		factor = 5
	}
}

federal_republic_legacy = {
	# government mechanics flags go here
	icon = "parliament"
	legacy_government = yes
	duration = 4
	allow_normal_conversion = no

	republican_name = yes
	royal_marriage = no

	valid_for_new_country = no
	allow_convert = no
	valid_for_nation_designer = yes
	nation_designer_cost = 15
	nation_designer_trigger = {
		has_dlc = "American Dream"
	}

	republic = yes
	modifiers = {
		diplomatic_reputation = 1
		global_spy_defence = 0.10
		global_autonomy = -0.15
		max_absolutism = -30
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
		}
		has_parliament = yes
	}

	ai = {
		factor = 5
	}
}


peasants_republic_legacy = {
	# government mechanics flags go here
	icon = "fist_in_air"
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	valid_for_nation_designer = yes
	nation_designer_cost = 20

	duration = 5

	republican_name = yes
	royal_marriage = no

	republic = yes
	modifiers = {
		governing_capacity = 50
		production_efficiency = 0.1
		land_morale = 0.05
		global_autonomy = -0.05
		max_absolutism = -50
	}

	ai = {
		factor = 0
	}
}

veche_republic_legacy = {
	# government mechanics flags go here
	icon = "merchant"
	legacy_government = yes
	republic = yes
	duration = 4
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	boost_income = yes
	
	republican_name = yes
	royal_marriage = no

	valid_for_nation_designer = yes
	nation_designer_cost = 40

	nation_designer_trigger = {
		culture_group = east_slavic
	}

	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}

    fixed_rank = 1
	modifiers = {
		governing_capacity = 150
		merchants = 1
		max_absolutism = -50
	}

	conditional = {
		allow = {
			has_dlc = "Res Publica"
			NOT = { has_dlc = "Mare Nostrum" }
			NOT = { has_dlc = "Third Rome" }
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
			NOT = { has_dlc = "Third Rome" }
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Third Rome" }
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = {
			has_dlc = "Third Rome"
			NOT = { has_dlc = "Mare Nostrum" }
			NOT = { has_dlc = "Res Publica" }
		}
		government_abilities = {
			russian_mechanic
		}
	}
	conditional = {
		allow = {
			has_dlc = "Third Rome"
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
		}
		government_abilities = {
			russian_mechanic
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = {
			has_dlc = "Third Rome"
			NOT = { has_dlc = "Mare Nostrum" }
			has_dlc = "Res Publica"
		}
		government_abilities = {
			russian_mechanic
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Third Rome"
			has_dlc = "Mare Nostrum"
			has_dlc = "Res Publica"
		}
		government_abilities = {
			russian_mechanic
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}

	ai = {
		factor = 0
	}
}

principality_legacy = {
	# government mechanics flags go here
	icon = "crown"
	legacy_government = yes
	monarchy = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	valid_for_nation_designer = yes
	nation_designer_cost = 5
	nation_designer_trigger = {
		culture_group = east_slavic
		religion = orthodox
	}

    fixed_rank = 1
	modifiers = {
		governing_capacity = 150
		global_unrest = -1
		global_tax_modifier = 0.05
	}

	conditional = {
		allow = { has_dlc = "Third Rome" }
		government_abilities = {
			russian_mechanic
		}
	}

	ai = {
		factor = 5
	}
}

tsardom_legacy = {
	# government mechanics flags go here
	icon = "king"
	monarchy = yes
	legacy_government = yes
	allow_normal_conversion = no

	valid_for_new_country = no
	allow_convert = no

	valid_for_nation_designer = yes
	nation_designer_cost = 40

	nation_designer_trigger = {
		culture_group = east_slavic
		religion = orthodox
	}

    fixed_rank = 3
	modifiers = {
		governing_capacity = 300
		global_manpower_modifier = 0.20
		yearly_absolutism = 0.5
		global_autonomy = -0.05
	}

	conditional = {
		allow = { has_dlc = "Third Rome" }
		government_abilities = {
			russian_mechanic
		}
		claim_states = yes
	}

	ai = {
		factor = 5
	}
}

cossacks_legacy_reform = {
	# government mechanics flags go here
	icon = "chieftain"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 60


	republic = yes
	modifiers = {
   		governing_capacity = 50
		cavalry_power = 0.2
		cavalry_cost = -0.2
		cav_to_inf_ratio = 0.2
	}

	conditional = {
		allow = { has_dlc = "The Cossacks" }
		government_abilities = {
			cossacks_mechanic
		}
	}

	conditional = {
		allow = { has_dlc = "Origins" }
		custom_attributes = {
			has_itinerant_capital = yes
		}
	}

	ai = {
		factor = 5
	}
}

united_cantons_legacy = {
	# government mechanics flags go here
	icon = "trading_city"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 40


	republic = yes
	modifiers = {
   		governing_capacity = -150
		possible_dip_policy = 1	
		mercenary_manpower = 0.5
	}

	ai = {
		factor = 5
	}
}

sacred_kingdom_legacy = {
	# government mechanics flags go here
	icon = "divine_guidance_reform"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 10
	nation_designer_trigger = {
		NOT = { religion_group = christian }
		NOT = { religion_group = muslim }
		NOT = { religion_group = jewish_group }
	}


	republic = yes
	modifiers = {
		tolerance_own = 2
		max_absolutism = 25
		legitimacy = 0.5
	}

	ai = {
		factor = 5
	}
}
sacred_kingdom = {
	icon = "divine_guidance_reform"
	allow_normal_conversion = yes
	lock_level_when_selected = yes
	potential = {
		has_dlc = "Origins"
		religion_group = pagan
	}
	trigger = {
		OR = {
			NOT = { has_institution = enlightenment }	#Why should any enlightened person ever want to support this system?
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = sacred_kingdom
			}
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 10
	nation_designer_trigger = {
		religion_group = pagan
	}
	legacy_equivalent = sacred_kingdom_legacy
	maintain_dynasty = yes
	
	removed_effect = {
		if = {
			limit = {
				NOT = { has_institution = enlightenment }
			}
			add_stability = -2
		}
	}

	modifiers = {
		tolerance_own = 2
		max_absolutism = 25
		legitimacy = 0.5
	}
}

negusa_nagast_legacy = {
	icon = "chieftain"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 40


	republic = yes
	modifiers = {
		move_capital_cost_modifier = -0.75
		global_unrest = -1
		stability_cost_modifier = -0.1
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		custom_attributes = {
			has_itinerant_capital = yes
		}
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		allow_cawa = yes
	}

	ai = {
		factor = 5
	}
}
negusa_nagast = {
	icon = "chieftain"
	allow_normal_conversion = yes
	lock_level_when_selected = yes
	potential = {
		OR = {
			have_had_reform = negusa_nagast
			tag = ETH
		}
	}
	trigger = {
		OR = {
			have_had_reform = negusa_nagast
			tag = ETH
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	legacy_equivalent = negusa_nagast_legacy

	modifiers = {
		move_capital_cost_modifier = -0.75
		global_unrest = -1
		stability_cost_modifier = -0.1
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		custom_attributes = {
			has_itinerant_capital = yes
		}
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		allow_cawa = yes
	}
}

solomonic_empire_legacy = {
	# government mechanics flags go here
	icon = "king"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 50
	fixed_rank = 3


	republic = yes
	modifiers = {
		tolerance_own = 2
		max_absolutism = 20
		global_unrest = -2
		amount_of_cawa = 1
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		allow_cawa = yes
	}

	ai = {
		factor = 5
	}
}
solomonic_empire = {
	icon = "king"
	allow_normal_conversion = yes
	lock_level_when_selected = yes
	potential = {
		OR = {
			have_had_reform = solomonic_empire
			has_country_flag = unlocked_solomid_empire_reform
		}
	}
	trigger = {
		OR = {
			have_had_reform = solomonic_empire
			has_country_flag = unlocked_solomid_empire_reform
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 50
	legacy_equivalent = solomonic_empire_legacy
	fixed_rank = 3

	modifiers = {
		tolerance_own = 2
		max_absolutism = 20
		global_unrest = -2
		amount_of_cawa = 1
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		allow_cawa = yes
	}
}

matrilineal_system_legacy = {
	# government mechanics flags go here
	icon = "british_queen"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	modifiers = {
		heir_chance = -0.5
		female_advisor_chance = 0.5
		legitimacy = 1
	}
}
matrilineal_system = {
	icon = "british_queen"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = matrilineal_system_legacy
	potential = {
		OR = {
			primary_culture = nubian
			have_had_reform = matrilineal_system
		}
	}
	trigger = {
		OR = {
			primary_culture = nubian
			have_had_reform = matrilineal_system
		}
	}
	modifiers = {
		heir_chance = -0.5
		female_advisor_chance = 0.5
		legitimacy = 1
	}
}

tribal_confederacy_legacy = {
	# government mechanics flags go here
	icon = "native_settle_down_reform"
	allow_normal_conversion = no
	lock_level_when_selected = yes
	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	modifiers = {
		nobles_influence_modifier = 0.15
		nobles_loyalty_modifier = 0.1
		global_unrest = -1
		max_absolutism = -20
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		custom_attributes = {
			has_internal_tribes = yes
			locked_government_type = yes
		}
	}

	effect = {
		hidden_effect = {
			if = {
				limit = {
					has_dlc = "Origins"
				}
				set_estate_privilege = estate_nobles_decentralized_tribe
			}
		}
	}
}
tribal_confederacy = {
	icon = "native_settle_down_reform"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	lock_level_when_selected = yes
	nation_designer_cost = 30
	legacy_equivalent = tribal_confederacy_legacy

	potential = {
		have_had_reform = tribal_confederacy
		NOT = { has_country_flag = centralized_tribes_level_3 }	#Already centralized the tribes
	}

	modifiers = {
		nobles_influence_modifier = 0.15
		nobles_loyalty_modifier = 0.1
		global_unrest = -1
		max_absolutism = -20
	}

	conditional = {
		allow = {
			has_dlc = "Origins"
		}
		custom_attributes = {
			has_internal_tribes = yes
			locked_government_type = yes
		}
	}

	effect = {
		hidden_effect = {
			if = {
				limit = {
					has_dlc = "Origins"
				}
				set_estate_privilege = estate_nobles_decentralized_tribe
			}
		}
	}

	ai = {
		factor = 0
	}
}

mossi_federal_kingdom_legacy = {
	# government mechanics flags go here
	icon = "native_war_band_reform"
	allow_normal_conversion = no
	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	potential = {
		OR = {
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = mossi_federal_kingdom
			}
			AND = {
				has_country_flag = msi_mossi_kingdom_event
				tag = MSI
			}
		}
	}

	modifiers = {
		nobles_influence_modifier = 0.15
		nobles_loyalty_modifier = 0.1
		global_unrest = -1
		max_absolutism = -20
	}

	conditional = {
		allow = {
			OR = {
				has_dlc = "Origins"
				has_dlc = "Cradle of Civilization"
			}
		}
		custom_attributes = {
			has_federal_kingdoms = yes
		}
	}

	conditional = {
		allow = {
			has_dlc = "Cradle of Civilization"
		}
		government_abilities = {
			tribal_federation_mechanic
		}
	}
}
mossi_federal_kingdom = {
	icon = "native_war_band_reform"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = tribal_confederacy_legacy

	potential = {
		OR = {
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = mossi_federal_kingdom
			}
			AND = {
				has_country_flag = msi_mossi_kingdom_event
				tag = MSI
			}
		}
	}

	modifiers = {
		nobles_influence_modifier = 0.15
		nobles_loyalty_modifier = 0.1
		global_unrest = -1
		max_absolutism = -20
	}

	effect = {
		if = {
			limit = {
				has_country_flag = msi_unlocked_perma_reward
			}
			remove_country_modifier = msi_centralization_focus
			add_country_modifier = {
				name = msi_federal_kingdom_focus
				duration = -1
				desc = msi_federal_kingdom_focus_desc
			}
		}
	}

	removed_effect = {
		if = {
			limit = {
				has_country_flag = msi_unlocked_perma_reward
			}
			remove_country_modifier = msi_federal_kingdom_focus
			add_country_modifier = {
				name = msi_centralization_focus
				duration = -1
				desc = msi_centralization_focus_desc
			}
		}
	}

	conditional = {
		allow = {
			OR = {
				has_dlc = "Origins"
				has_dlc = "Cradle of Civilization"
			}
		}
		custom_attributes = {
			has_federal_kingdoms = yes
		}
	}

	conditional = {
		allow = {
			has_dlc = "Cradle of Civilization"
		}
		government_abilities = {
			tribal_federation_mechanic
		}
	}

	ai = {
		factor = 1
	}
}

musa_rule_legacy = {
	# government mechanics flags go here
	icon = "chieftain"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	modifiers = {
		advisor_pool = 1
		stability_cost_modifier = -0.05
		legitimacy = 0.5
	}
}
musa_rule = {
	icon = "chieftain"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = musa_rule_legacy
	potential = {
		OR = {
			tag = MAL
			have_had_reform = musa_rule
		}
	}
	trigger = {
		OR = {
			tag = MAL
			have_had_reform = musa_rule
		}
	}
	modifiers = {
		advisor_pool = 1
		stability_cost_modifier = -0.05
		legitimacy = 0.5
	}

	ai = {
		factor = 1
	}
}

great_man_legacy = {
	# government mechanics flags go here
	icon = "chieftain"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	modifiers = {
		leader_cost = -0.1
		production_efficiency = 0.1
	}
}
great_man = {
	icon = "chieftain"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = great_man_legacy
	potential = {
		OR = {
			AND = {
				religion = shamanism
				capital_scope = {
					has_terrain = jungle
				}
			}
			have_had_reform = great_man
		}
	}
	trigger = {
		OR = {
			AND = {
				religion = shamanism
				capital_scope = {
					has_terrain = jungle
				}
			}
			have_had_reform = great_man
		}
	}
	modifiers = {
		leader_cost = -0.1
		production_efficiency = 0.1
	}

	ai = {
		factor = 1
	}
}

shaka_regime_legacy = {
	# government mechanics flags go here
	icon = "chieftain"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30

	modifiers = {
		monarch_military_power = 2
		global_unrest = -2
		war_exhaustion = -0.02
		governing_capacity_modifier = -0.5
	}

	conditional = {
		allow = {
			has_dlc = "Rights of Man"
		}
		militarised_society = yes
	}
}
shaka_regime = {
	icon = "chieftain"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = shaka_regime_legacy
	potential = {
		OR = {
			tag = ZUL
			have_had_reform = shaka_regime
		}
	}
	trigger = {
		OR = {
			tag = ZUL
			have_had_reform = shaka_regime
		}
	}
	modifiers = {
		monarch_military_power = 2
		global_unrest = -2
		war_exhaustion = -0.02
		governing_capacity_modifier = -0.5
	}

	conditional = {
		allow = {
			has_dlc = "Rights of Man"
		}
		militarised_society = yes
	}

	ai = {
		factor = 1
	}
}

feudal_tribe_legacy = {
	# government mechanics flags go here
	icon = "tribal_civil_society"
	allow_normal_conversion = no

	legacy_government = yes
	valid_for_new_country = no

	valid_for_nation_designer = yes
	nation_designer_cost = 30
	potential = {
	}
	trigger = {
	}
	modifiers = {
		vassal_income = 0.1
		global_tax_modifier = 0.1
	}

	conditional = {
		allow = { 
			has_dlc = "Mandate of Heaven"
		}
		custom_attributes = {
			has_tributaries = yes
		}
	}
}
feudal_tribe = {
	icon = "tribal_civil_society"
	allow_normal_conversion = yes
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	legacy_equivalent = feudal_tribe_legacy
	lock_level_when_selected = yes
	potential = {
	}
	trigger = {
	}
	modifiers = {
		vassal_income = 0.1
		global_tax_modifier = 0.1
	}

	conditional = {
		allow = { 
			has_dlc = "Mandate of Heaven"
		}
		custom_attributes = {
			has_tributaries = yes
		}
	}

	ai = {
		factor = 0
	}
}