republic_mechanic = {
	basic_reform = yes
	republican_name = yes
	royal_marriage = no
	republic = yes
	duration = 4
	has_term_election = yes
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}

	modifiers = {
		burghers_influence_modifier = 0.15
		vaisyas_influence_modifier = 0.15
		max_absolutism = -40
	}

	valid_for_nation_designer = no
}

#Oligarchy vs Merchant Class vs Noble Elite

oligarchy_reform = {
	icon = "people_walking"
	allow_normal_conversion = yes
	duration = 4
	legacy_equivalent = oligarchic_republic
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	potential = {
		NOT = { culture_group = latin }
		NOT = { has_reform = crown_colony_government }
		NOT = { has_reform = private_enterprise_colony_government }
		NOT = { has_reform = self_governing_colony_government }
	}
	nation_designer_trigger = {
		NOT = { culture_group = latin }
	}
	modifiers = {
		burghers_loyalty_modifier = 0.05
		global_tax_modifier = 0.05
		global_unrest = -0.5
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	ai = {
		factor = 0.5 #generic
	}
}

signoria_reform = {
	icon = "signoria_reform"
	allow_normal_conversion = yes
	duration = 12
	legacy_equivalent = signoria
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	royal_marriage = yes
	potential = {
		culture_group = latin
	}
	nation_designer_trigger = {
		culture_group = latin
	}
	modifiers = {
		global_tax_modifier = 0.15
		max_absolutism = 10
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		enables_nepotism = yes
	}
	ai = {
		factor = 10
	}
}

protectorate_parliament_reform = {
	icon = "protectorate_parliament_reform"
	allow_normal_conversion = no
	potential = {
		has_reform = protectorate_parliament_reform
	}
	lock_level_when_selected = yes
	valid_for_new_country = no
	valid_for_nation_designer = no
	nation_designer_cost = 15
	legacy_equivalent = protectorate_parliament_legacy
	modifiers = {
		global_autonomy = -0.05
		land_morale = 0.1
		max_absolutism = 20
		republican_tradition = -0.5
	}

	conditional = {
		allow = {
			has_dlc = "Common Sense"
			NOT = { has_dlc = "Domination" }
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}
	conditional = {
		allow = {
			has_dlc = "Domination"
		}
		has_parliament = yes
		custom_attributes = {
			english_parliament = yes
		}
	}
	has_term_election = no
	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		cannot_become_dictatorship = yes
	}
}

prussian_republic_reform = {
	icon = "prussian_monarchy"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_reform = prussian_republic_reform
			AND = {
				tag = PRU
				NOT = { map_setup = map_setup_random }
			}
			AND = {
				tag = GER
				NOT = { map_setup = map_setup_random }
				OR = {
					has_reform = prussian_monarchy
					have_had_reform = prussian_monarchy
					have_had_reform = prussian_republic_reform
					have_had_reform = prussian_theocratic_reform
					is_hegemon_of_type = military_hegemon
					development_in_provinces = {
						value = 500
						culture = prussian
					}
				}
			}
			AND = {
				is_playing_custom_nation = yes
				OR = {
					has_reform = prussian_republic_reform
					have_had_reform = prussian_monarchy
					have_had_reform = prussian_monarchy_base
					have_had_reform = prussian_republic_reform
					have_had_reform = prussian_theocratic_reform
				}
			}
			has_unlocked_government_reform = {
				government_reform = prussian_republic_reform
			}
		}
	}
	trigger = {
		OR = {
			religion = protestant
			religion = reformed
			religion = hussite
			religion = anglican
			AND = {
				is_playing_custom_nation = yes
				OR = {
					hidden_trigger = {
						has_reform = prussian_republic_reform
					}
					have_had_reform = prussian_monarchy
					have_had_reform = prussian_monarchy_base
					have_had_reform = prussian_republic_reform
					have_had_reform = prussian_theocratic_reform
				}
			}
			has_unlocked_government_reform = {
				government_reform = prussian_republic_reform
			}
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 100
	legacy_equivalent = prussian_republic
	
	modifiers = {
		war_exhaustion = -0.02
		monthly_militarized_society = 0.05
		global_autonomy = -0.075
		republican_tradition = -0.5
		max_absolutism = 30
		governing_capacity_modifier = -0.5
	}
	
	conditional = {
		allow = { has_dlc = "Rights of Man" }
		government_abilities = {
			militarization_mechanic
		}
	}
	
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		generals_become_rulers = yes
	}
	
	has_term_election = no
}

merchants_reform = {
	icon = "politician"
	allow_normal_conversion = yes
	modifiers = {
		max_absolutism = -10
		merchants = 1
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	legacy_equivalent = merchant_republic
	potential = {
		NOT = {
			AND = {
				tag = VEN
				NOT = { map_setup = map_setup_random }
			}
		}
		NOT = { has_reform = crown_colony_government }
		NOT = { has_reform = private_enterprise_colony_government }
		NOT = { has_reform = self_governing_colony_government }
	}
	trigger = {
		OR = {
			has_reform = merchants_reform
			crown_stronger_than_estate = { estate = all }
		}
	}
	boost_income = yes
	duration = 4
	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}
	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
	}
	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
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		is_merchant_republic = yes
		elections_increase_factions_influence = yes
	}
	ai = {
		factor = 0.75 #generic
		
		modifier = {
			factor = 0
			num_of_cities = 11
		}
		
		modifier = {
			factor = 0
			capital_scope = { has_port = no }
		}
		
		modifier = {
			factor = 0
			NOT = {
				capital_scope = { province_has_center_of_trade_of_level = 1 }
			}
		}
		
		modifier = {
			factor = 0
			is_subject = yes
		}
	}
}

venice_merchants_reform = {
	icon = "trading_city"
	allow_normal_conversion = yes
	modifiers = {
		max_absolutism = -10
		merchants = 1
		yearly_corruption = -0.1
		monarch_lifespan = 0.25
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	legacy_equivalent = venetian_merchant_republic
	potential = {
		NOT = { map_setup = map_setup_random }
		OR = {
			tag = VEN
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = venice_merchants_reform
			}
		}
	}
	boost_income = yes
	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}
	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
	}
	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
	}
	conditional = {
		allow = {
			has_dlc = "Winds of Change"
		}
		government_abilities = {
			council_of_ten
		}
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		lottery_election = yes
		election_on_death = yes
		is_merchant_republic = yes
		elections_increase_factions_influence = yes
		bonus_stats_for_elected_ruler = yes
	}
	has_term_election = no
}

pirate_republic_reform = {
	icon = "pirate_republic"
	allow_normal_conversion = no
	legacy_equivalent = pirate_republic
	lock_level_when_selected = yes
	modifiers = {
		republican_tradition = -1
		max_absolutism = -10
		naval_forcelimit_modifier = 0.5
		capture_ship_chance = 0.33
		state_governing_cost = 0.75
		may_perform_slave_raid_on_same_religion = yes
		allowed_marine_fraction = 0.5
	}
	trigger = {
		OR = {
			has_government_attribute = is_pirate_republic_reform
			crown_stronger_than_estate = { estate = all }
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	can_form_trade_league = no
	
	nation_designer_trigger = {
		OR = {
			has_dlc = "Lions of the North"
			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 = aboriginal_tech }
		NOT = { technology_group = mesoamerican }
	}

	removed_effect = {
		clr_country_flag = pirate_mutineer_council
	}
	
	potential = {
		has_reform = pirate_republic_reform
		OR = {
			has_dlc = "Lions of the North"
			has_dlc = "Golden Century"
		}
	}
	
	factions_frame = 9
	factions = {
		pr_buccaneers
		pr_smugglers
		pr_captains
	}
	
	duration = 4
	
	custom_attributes = {
		locked_government_type = yes
		force_admiral_leader = yes
		is_pirate_republic_reform = yes
		elections_increase_factions_influence = yes
		cannot_become_dictatorship = yes
	}
	
}

noble_elite_reform = {
	icon = "nobleman"
	allow_normal_conversion = yes
	legacy_equivalent = noble_republic
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	potential = {
		NOT = { has_reform = crown_colony_government }
		NOT = { has_reform = private_enterprise_colony_government }
		NOT = { has_reform = self_governing_colony_government }
	}
	modifiers = {
		army_tradition = 0.5
		max_absolutism = 20
		nobles_influence_modifier = 0.05
		maratha_exclusive_influence_modifier = 0.05
		rajput_exclusive_influence_modifier = 0.05
	}
	duration = 8

	custom_attributes = {
		enables_plutocratic_idea_group = no
		enables_aristocratic_idea_group = yes
	}
	ai = {
		factor = 0.5 #generic
	}
}

presidential_despot_reform = {
	allow_normal_conversion = no
	dictatorship = yes
	is_eligible_for_hre_emperor = no
	lock_level_when_selected = yes
	icon = "parliament_hall"
	potential = {
		has_reform = presidential_despot_reform
	}
	valid_for_nation_designer = no
	legacy_equivalent = republican_dictatorship

	modifiers = {
		global_autonomy = -0.075
		land_morale = 0.1
		max_absolutism = 40
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	has_term_election = no
}

military_dictatorship_reform = {
	allow_normal_conversion = no
	lock_level_when_selected = yes
	icon = "parliament_hall"
	potential = {
		has_reform = military_dictatorship_reform
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 25
	legacy_equivalent = military_dictatorship
	has_term_election = no
	modifiers = {
		global_autonomy = -0.075
		land_morale = 0.1
		max_absolutism = 30
	}
	custom_attributes = {
		generals_become_rulers = yes
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
}

revolutionary_republic_reform = {
	allow_normal_conversion = no
	lock_level_when_selected = yes
	icon = "revolutionary_republic"
	potential = {
		has_reform = revolutionary_republic_reform
	}
	legacy_equivalent = revolutionary_republic
	valid_for_new_country = no
	duration = 4
	valid_for_nation_designer = no
	republican_name = yes
	royal_marriage = no
	uses_revolutionary_zeal = yes
	revolutionary = yes

	modifiers = {
		tolerance_heretic = 2
		land_morale = 0.1
		global_autonomy = -0.2
		max_revolutionary_zeal = 50
		max_absolutism = 40
		papal_influence = -100
		allowed_rev_guard_fraction = 0.2	
	}
	fixed_rank = 3
	effect = {
		custom_tooltip = break_every_non_rev_republic_alliance_tt
		hidden_effect = {
			every_ally = {
				limit = {
					NOT = { government = republic }
					is_revolutionary = no
				}
				ROOT = { break_alliance = PREV }
			}
		}
	}

	custom_attributes = {
		cannot_ally_non_republics_or_non_rev = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		locked_government_type = yes
	}

	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
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_iran_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_iran_flag
				restore_country_name = yes
				override_country_name = IRAN_STRING
				set_country_flag = is_iran_flag
			}
		}
	}
}

junior_revolutionary_republic_reform = {
	allow_normal_conversion = no
	lock_level_when_selected = yes
	icon = "revolutionary_republic"
	potential = {
		has_reform = junior_revolutionary_republic_reform
	}
	legacy_equivalent = revolutionary_republic
	valid_for_new_country = no
	duration = 4
	valid_for_nation_designer = no
	republican_name = yes
	royal_marriage = no
	uses_revolutionary_zeal = yes
	revolutionary = yes
	revolutionary_client_state = yes # Used By Revolutionary Client State

	modifiers = {
		tolerance_heretic = 2
		land_morale = 0.1
		global_autonomy = -0.2
		max_revolutionary_zeal = 25
		max_absolutism = 40
		papal_influence = -100
		allowed_rev_guard_fraction = 0.2
	}
	fixed_rank = 2
	effect = {
		custom_tooltip = break_every_non_rev_republic_alliance_tt
		hidden_effect = {
			every_ally = {
				limit = {
					NOT = { government = republic }
					is_revolutionary = no
				}
				ROOT = { break_alliance = PREV }
			}
		}
	}

	custom_attributes = {
		cannot_ally_non_republics_or_non_rev = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		locked_government_type = yes
	}

	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
			}
			if = {
				limit = {
					has_country_flag = is_revolutionary_iran_flag
					is_revolutionary = no
				}
				clr_country_flag = is_revolutionary_iran_flag
				restore_country_name = yes
				override_country_name = IRAN_STRING
				set_country_flag = is_iran_flag
			}
		}
	}

	conditional = {
		allow = {
			has_dlc = "Rights of Man"
		}
		factions = {
			rr_jacobins
			rr_royalists
			rr_girondists
		}
	}
}

peasants_republic = {
	allow_normal_conversion = yes
	icon = "peasant_republic"
	potential = {
		OR = {
			has_country_flag = great_peasants_war_peasant_republic
			has_reform = peasants_republic
			have_had_reform = peasants_republic
			have_had_reform = stateless_society
		}
	}
	trigger = {
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 20
	legacy_equivalent = peasants_republic_legacy
	modifiers = {
		production_efficiency = 0.1
		land_morale = 0.05
		max_absolutism = -10
	}
	effect = {
		hidden_effect = {
			if = {
				limit = {
					has_global_flag = great_peasants_war_flag
					is_part_of_hre = yes
				}
				1 = {
					change_variable = {
						which = GPW_counting_variable
						value = 2
					}
				}
			}
		}
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		disables_estate_nobles = yes
		is_peasants_republic = yes
	}
	duration = 4
}

ikko_ikki_republic_reform = {
	icon = "peasants"
	allow_normal_conversion = yes
	potential = {
		NOT = { tag = PAP }
		OR = {
			culture_group = japanese_g
			have_had_reform = ikko_ikki_republic_reform
		}
	}
	trigger = {
		religion_group = eastern
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	valid_for_nation_designer = yes
	nation_designer_trigger = {
		culture_group = japanese_g
		religion_group = eastern
	}
	nation_designer_cost = 20
	modifiers = {
		yearly_harmony = 0.25
		yearly_karma_decay = 0.002
		tolerance_own = 1
		production_efficiency = 0.1
		land_morale = 0.05
		global_missionary_strength = 0.02
	}
	effect = {
		hidden_effect = {
			set_country_flag = ikko_ikki_peasants_flag
		}
	}
	removed_effect = {
		hidden_effect = {
			clr_country_flag = ikko_ikki_peasants_flag
		}
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		disables_estate_nobles = yes
		is_peasants_republic = yes
	}
	duration = 4
}

kongsi_federation = {
	allow_normal_conversion = yes
	icon = "peasant_republic"
	potential = {
		OR = {
			tag = LFA
			have_had_reform = kongsi_federation
		}
	}
	trigger = {
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 20
	nation_designer_trigger = {
		primary_culture = hakka
		technology_group = chinese
	}
	modifiers = {
		production_efficiency = 0.1
		republican_tradition = 0.5
		max_absolutism = -10
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		allow_draft_transport_ships = yes
		disables_estate_nobles = yes
	}
	duration = 4
}

free_city = {
	icon = "free_city"
	allow_normal_conversion = no
	potential = {
		has_reform = free_city
	}
	legacy_equivalent = imperial_city
	valid_for_nation_designer = yes
	lock_level_when_selected = yes
	nation_designer_cost = 40
	nation_designer_trigger = {
		capital_scope = { is_part_of_hre = yes }
		NOT = { num_custom_nation_provinces = 2 }
	}

	free_city = yes
	modifiers = {
		trade_efficiency = 0.1
		development_cost = -0.2
		diplomatic_upkeep = 1
		burghers_influence_modifier = 0.1
	}
	fixed_rank = 1

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	duration = 4
}

trading_city = {
	icon = "trading_city"
	allow_normal_conversion = no
	potential = {
		has_reform = trading_city
	}
	valid_for_nation_designer = no
	legacy_equivalent = trading_city_legacy
	boost_income = yes
	lock_level_when_selected = yes
	is_trading_city = yes
	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}
	modifiers = {
		global_trade_power = 0.1
		max_absolutism = 20
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		elections_increase_factions_influence = yes
	}

	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 = merchants_reform # 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 = merchants_reform # For trade cities this is their fallback government if they get more than 1 provinces
	}
	duration = 4
}

ambrosian_republic = {
	icon = "ambrosian_republic"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_reform = ambrosian_republic
			have_had_reform = ambrosian_republic
		}
	}
	legacy_equivalent = ambrosian_republic_legacy
	valid_for_nation_designer = yes
	nation_designer_cost = 25
	modifiers = {
		global_tax_modifier = 0.1
		land_morale = 0.05
		governing_capacity = 50
		max_absolutism = 10
	}
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	duration = 4
}

veche_republic = {
	icon = "russian_principality"
	allow_normal_conversion = yes
	potential = {
		NOT = { has_reform = great_veche_republic }
		NOT = { have_had_reform = great_veche_republic }
		OR = {
			culture_group = east_slavic
			has_reform = veche_republic
		}
	}
	legacy_equivalent = veche_republic_legacy
	nation_designer_trigger = {
		culture_group = east_slavic
	}
	modifiers = {
		merchants = 1
		governing_capacity = 100
		max_absolutism = 10
		has_streltsy = yes
		allowed_streltsy_fraction = 0.1
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 40

	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}
	boost_income = yes
	fixed_rank = 1

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		elections_increase_factions_influence = yes
	}
	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 = "Res Publica"
			has_dlc = "Mare Nostrum"
		}
		can_use_trade_post = yes
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
			NOT = { has_dlc = "Res Publica" }
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = {
			NOT = { has_dlc = "Mare Nostrum" }
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = { 
			OR = {
				has_dlc = "Third Rome" 
				has_dlc = "Domination"
			}
		}
		government_abilities = {
			russian_mechanic
		}
		custom_attributes = {
			weaker_russian_ability = yes
		}
	}
	duration = 6
}

great_veche_republic = {
	icon = "king"
	allow_normal_conversion = yes
	potential = {
		culture_group = east_slavic
		religion = orthodox
		OR = {
			AND = {
				tag = RUS
				NOT = { map_setup = map_setup_random }
			}
			AND = {
				tag = UKR
				NOT = { map_setup = map_setup_random }
			}
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = great_veche_republic
			}
		}
	}
	fixed_rank = 3
	valid_for_nation_designer = yes
	nation_designer_cost = 40

	nation_designer_trigger = {
		culture_group = east_slavic
		religion = orthodox
	}

	modifiers = {
		global_manpower_modifier = 0.2
		merchants = 1
		max_absolutism = 20
		governing_capacity = 350
		has_streltsy = yes
		allowed_streltsy_fraction = 0.2
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}
	conditional = {
		allow = { 
			has_dlc = "Third Rome" 
			NOT = { has_dlc = "Domination" }
		}
		government_abilities = {
			russian_mechanic
		}
	}
	conditional = {
		allow = { has_dlc = "Domination" }
		government_abilities = {
			russian_mechanic
			russian_modernization_mechanic
		}
	}
	duration = 6
}

great_russian_republic_reform = {
	icon = "organized_military_staff"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_reform = great_russian_republic_reform
			have_had_reform = great_russian_republic_reform
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = great_russian_republic_reform
			}
		}
	}
	fixed_rank = 3
	valid_for_nation_designer = yes
	nation_designer_cost = 40

	modifiers = {
		global_manpower_modifier = 0.2
		merchants = 2
		governing_capacity = 350
		yearly_absolutism = 0.5
		global_autonomy = -0.05
		embracement_cost = -0.5
		max_absolutism = 50
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	conditional = {
		allow = {
			has_dlc = "Mare Nostrum"
		}
		can_form_trade_league = yes
		trade_city_reform = trading_city
	}

	conditional = {
		allow = { has_dlc = "Third Rome" }
		claim_states = yes
	}
	conditional = {
		allow = { has_dlc = "Domination" }
		government_abilities = {
			russian_rule_mechanic
		}
	}
	duration = 6
}

american_republic = {
	icon = "parliament"
	allow_normal_conversion = yes
	potential = {
		has_dlc = "American Dream"
		OR = {
			AND = {
				OR = {
					tag = USA
					primary_culture = american
				}
				NOT = { map_setup = map_setup_random }
			}
			has_reform = american_republic
		}
	}
	trigger = {
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 15
	nation_designer_trigger = {
		has_dlc = "American Dream"
	}
	legacy_equivalent = american_republic_legacy
	modifiers = {
		war_exhaustion = -0.04
		stability_cost_modifier = -0.1
		max_absolutism = 20
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		disables_estate_nobles = yes
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}
	duration = 4
	
	#New in MMETR mod - Presidential Doctrines for USA automatically without new Tier 19 reform
	government_abilities = {
		presidential_doctrines_mechanic
	}
}

federal_republic = {
	icon = "constitution"
	allow_normal_conversion = yes
	potential = {
		has_dlc = "American Dream"
		OR = {
			AND = {
				tag = USA
				NOT = { map_setup = map_setup_random }
			}
			has_reform = federal_republic
		}
	}
	trigger = {
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	legacy_equivalent = federal_republic_legacy
	valid_for_nation_designer = yes
	nation_designer_cost = 15
	nation_designer_trigger = {
		has_dlc = "American Dream"
	}
	modifiers = {
		diplomatic_reputation = 1
		global_spy_defence = 0.1
		max_absolutism = 10
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		disables_estate_nobles = yes
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
		custom_attributes = {
			blocked_call_diet = yes
		}
	}
	duration = 4
	
	#New in MMETR mod - Presidential Doctrines for USA automatically without new Tier 19 reform
	government_abilities = {
		presidential_doctrines_mechanic
	}
}

colonial_government = {
	icon = "peasants"
	valid_for_nation_designer = no
	lock_level_when_selected = yes
	allow_normal_conversion = no
	fixed_rank = 1
	potential = {
		is_colonial_nation = yes
		NOT = { has_reform = crown_colony_government }
		NOT = { has_reform = private_enterprise_colony_government }
		NOT = { has_reform = self_governing_colony_government }
		NOT = { is_subject_of_type = crown_colony }
		NOT = { is_subject_of_type = private_enterprise }
		NOT = { is_subject_of_type = self_governing_colony }
	}
	legacy_equivalent = colonial_government_legacy
	modifiers = {
		global_autonomy = -0.05
		recover_army_morale_speed = 0.02
		embracement_cost = -0.1
		governing_capacity = 100
		max_absolutism = 40
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}
	duration = 4
}

crown_colony_government = {
	icon = "crown_colony_government"
	valid_for_nation_designer = no
	lock_level_when_selected = yes
	allow_normal_conversion = no
	fixed_rank = 1
	potential = {
		is_colonial_nation = yes
		OR = {
			has_reform = crown_colony_government
			has_reform = private_enterprise_colony_government
			has_reform = self_governing_colony_government
		}
	}
	trigger = {
		is_subject_of_type = crown_colony
	}
	legacy_equivalent = colonial_government_legacy
	modifiers = {
		recover_army_morale_speed = 0.02
		embracement_cost = -0.1
		governing_capacity = 100
		max_absolutism = 40
	}
	effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	duration = 4
}

private_enterprise_colony_government = {
	icon = "private_enterprise_colony_government"
	valid_for_nation_designer = no
	lock_level_when_selected = yes
	allow_normal_conversion = no
	fixed_rank = 1
	potential = {
		is_colonial_nation = yes
		OR = {
			has_reform = crown_colony_government
			has_reform = private_enterprise_colony_government
			has_reform = self_governing_colony_government
		}
	}
	trigger = {
		is_subject_of_type = private_enterprise
	}
	legacy_equivalent = colonial_government_legacy
	modifiers = {
		global_ship_trade_power = 0.2
		embracement_cost = -0.1
		merchants = 1
		production_efficiency = 0.05
		max_absolutism = 40
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = self_governing_colony }
				add_government_reform = self_governing_colony_government
			}
		}
	}
	duration = 4
}

self_governing_colony_government = {
	icon = "self_governing_colony_government"
	valid_for_nation_designer = no
	lock_level_when_selected = yes
	allow_normal_conversion = no
	fixed_rank = 1
	potential = {
		is_colonial_nation = yes
		OR = {
			has_reform = crown_colony_government
			has_reform = private_enterprise_colony_government
			has_reform = self_governing_colony_government
		}
	}
	trigger = {
		is_subject_of_type = self_governing_colony
	}
	legacy_equivalent = colonial_government_legacy
	modifiers = {
		build_cost = -0.1
		development_cost = -0.1
		embracement_cost = -0.1
		state_maintenance_modifier = -0.25
		max_absolutism = 40
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		enables_estate_nobles = yes
		enables_estate_burghers = yes
	}
	effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			if = {
				limit = { is_subject_of_type = crown_colony }
				add_government_reform = crown_colony_government
			}
			if = {
				limit = { is_subject_of_type = private_enterprise }
				add_government_reform = private_enterprise_colony_government
			}
		}
	}
	duration = 4
}

trade_company_government = {
	icon = "paper_with_seal"
	lock_level_when_selected = yes
	allow_normal_conversion = no
	potential = {
		OR = {
			has_reform = trade_company_government
			have_had_reform = trade_company_government
		}
	}
	modifiers = {
		tolerance_heathen = 1
		tolerance_of_heathens_capacity = 1
		production_efficiency = 0.1
		governing_capacity = 50
		global_manpower_modifier = 0.1
		naval_forcelimit_modifier = 0.1
	}
	nation_designer_cost = 60
	valid_for_nation_designer = yes
	boost_income = yes
	duration = 4
	factions = {
		mr_aristocrats
		mr_traders
		mr_guilds
	}

	custom_attributes = {
		locked_government_type = yes
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		enables_estate_burghers = yes
		is_merchant_republic = yes
		elections_increase_factions_influence = yes
	}
	conditional = {
		allow = {
			has_dlc = "Leviathan"
		}
		allow_draft_transport_ships = yes
	}
	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
	}
	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
	}

}

english_parliamentary_republic_government = {
	icon = "house_of_lords"
	lock_level_when_selected = yes
	allow_normal_conversion = no
	potential = {
		has_dlc = "Domination"
		culture_group = british
	}
	nation_designer_cost = 20
	nation_designer_trigger = {
		culture_group = british
	}
	valid_for_nation_designer = yes
	modifiers = {
		num_of_parliament_issues = 1
		republican_tradition = 0.25
		max_absolutism = 5
	}
	duration = 5
	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	
	conditional = {
		allow = {
			has_dlc = "Common Sense"
			NOT = { has_dlc = "Domination" }
		}
		has_parliament = yes
	}
	conditional = {
		allow = {
			has_dlc = "Domination"
		}
		has_parliament = yes
		custom_attributes = {
			english_parliament = yes
		}
	}
}

civic_republicanism_government = {
	icon = "parliament"
	valid_for_nation_designer = no
	allow_normal_conversion = no
	potential = {
		has_dlc = "Domination"
		NOT = { has_reform = crown_colony_government }
		NOT = { has_reform = private_enterprise_colony_government }
		NOT = { has_reform = self_governing_colony_government }
	}
	modifiers = {
		candidate_random_bonus = 1
		all_estate_influence_modifier = -0.05
		max_terms = 2
	}
	trigger = {
		custom_trigger_tooltip = {
			tooltip = "NEEDS_REGULAR_ELECTIONS"
			has_government_attribute = has_term_election
		}
	}

	conditional = {
		allow = { has_dlc = "Domination" }
		custom_attributes = {
			enables_plutocratic_idea_group = yes
			enables_aristocratic_idea_group = no
			has_limited_terms = yes
			has_candidate_bonus = yes
		}
	}

	conditional = {
		allow = { NOT = { has_dlc = "Domination" } }
		custom_attributes = {
			enables_plutocratic_idea_group = yes
			enables_aristocratic_idea_group = no
		}
	}
	effect = {
		hidden_effect = {
			set_variable = {
				which = election_term
				value = 1
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			set_variable = {
				which = election_term
				value = 1
			}
		}
		clr_ruler_focus_modifiers = yes
	}
	post_removed_effect = {
		clr_ruler_focus_modifiers = yes
	}
	duration = 5
}

calvinist_republic_government = {
	icon = "calvinism"
	allow_normal_conversion = no
	potential = {
		has_dlc = "Domination"
		religion = reformed
	}
	trigger = {
		religion = reformed 
		NOT = { total_development = 400 }
	}
	nation_designer_cost = 50
	valid_for_nation_designer = no
	nation_designer_trigger = {
		religion = reformed 
		NOT = { total_development = 400 }
	}
	modifiers = {
		monthly_fervor_increase = 0.1
		tolerance_own = 1 
		own_territory_dice_roll_bonus = 1
	}

	custom_attributes = {
		enables_plutocratic_idea_group = no
		enables_divine_idea_group = yes
	}
	duration = 4
}

dutch_republic = {
	icon = "dutch_republic"
	allow_normal_conversion = yes
	potential = {
		OR = {
			AND = {
				OR = {
					primary_culture = dutch
					primary_culture = frisian
					primary_culture = flemish
				}
				NOT = { map_setup = map_setup_random }
			}
			has_reform = dutch_republic
		}
	}
	legacy_equivalent = dutch_republic_legacy
	valid_for_nation_designer = yes
	nation_designer_cost = 40
	royal_marriage = yes

	modifiers = {
		heavy_ship_power = 0.1
		trade_efficiency = 0.1
		reduced_liberty_desire_on_other_continent = 10
		max_absolutism = 10
		has_voc_indiamen = yes
		allowed_voc_indiamen_fraction = 0.2
	}

	removed_effect = {
		if = {
			# Monarchs seize power
			limit = { government = monarchy }
			country_event = { id = dutch_republic.33 }
		}
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
		has_dutch_election = yes
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Res Publica"
				has_dlc = "Winds of Change"
			}
		}

		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
			}
		}
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
	}
	duration = 4
}


cossacks_reform = {
	icon = "horde_riding"
	legacy_equivalent = cossacks_legacy_reform
	allow_normal_conversion = yes
	potential = {
		OR = {
			AND = {
				tag = ZAZ
				NOT = { map_setup = map_setup_random }
			}
			has_reform = cossacks_reform
			have_had_reform = cossacks_reform
		}
	}
	trigger = {
		is_not_blocked_by_estate_privilege = { estate = estate_nobles }
	}
	
	raze_province = yes
	government_abilities = {
		cossacks_mechanic
	}

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

	nation_designer_trigger = {
		any_owned_province = {
			has_terrain = steppe
		}
	}

	custom_attributes = {
		enables_plutocratic_idea_group = yes
		enables_aristocratic_idea_group = no
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 60

	modifiers = {
		cavalry_power = 0.2
		cavalry_cost = -0.2
		cav_to_inf_ratio = 0.25
		governing_capacity = 50
		allowed_cossack_fraction = 0.25
	}

	conditional = {
		allow = {
			has_dlc = "The Cossacks"
		}
		custom_attributes = {
			enables_estate_cossacks = yes
		}
	}
	custom_attributes = {
		enables_horde_idea_group = yes
		disables_estate_nobles = yes
	}

	duration = 4
}

city_alliance_reform = {
	icon = "land_christian_sun_reform"
	allow_normal_conversion = no
	potential = {
		religion = nahuatl
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 30
	modifiers = {
		global_unrest = -1
		reduced_liberty_desire = 5
	}
	effect = {
		hidden_effect = {
			remove_country_modifier = the_fifth_sun
		}
	}
	removed_effect = {
		hidden_effect = {
			remove_country_modifier = the_fifth_sun
		}
	}
	
	government_abilities = {
		blood_gathering_mechanic
	}
}

#Republican Virtues

republican_authoritarianism_reform = {
	icon = "merchant"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		global_unrest = -1
		max_absolutism = 5
	}
	ai = {
		factor = 1
	}
}

nepotism_reform = {
	icon = "man_and_children"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		NOT = { has_reform = signoria_reform }
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	trigger = {
		NOT = { 
			OR = {
				has_reform = venice_merchants_reform 
				has_government_attribute = has_dutch_election
				has_reform = presidential_despot_reform
				has_reform = military_dictatorship_reform
				has_reform = admiralty_reform
				has_reform = military_rulership_reform
				has_reform = prussian_republic
				has_reform = prussian_republic_reform
			}
		}
	}
	modifiers = {
		candidate_random_bonus = 1
	}

	custom_attributes = {
		enables_nepotism = yes
	}
	ai = {
		factor = 1
	}
}

republicanism_reform = {
	icon = "assembly_hall"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		republican_tradition = 0.2
	}
	ai = {
		factor = 1.5
	}
}

democratic_values_reform = {
	icon = "equal_electorate_reform"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		global_trade_goods_size_modifier = 0.05
		maratha_muslim_influence_modifier = 0.1
		rajput_muslim_influence_modifier = 0.1
		burghers_influence_modifier = 0.1
		burghers_loyalty_modifier = 0.05
		vaisyas_non_muslim_influence_modifier = 0.1
		may_recruit_female_generals = yes
		female_advisor_chance = 0.25
	}
	ai = {
		factor = 1
	}
}

aristocratic_values_reform = {
	icon = "politeia"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		global_manpower_modifier = 0.1
		nobles_influence_modifier = 0.1
		maratha_exclusive_influence_modifier = 0.1
		rajput_exclusive_influence_modifier = 0.1
		nobles_loyalty_modifier = 0.05
		maratha_exclusive_loyalty_modifier = 0.05
		rajput_exclusive_loyalty_modifier = 0.05
	}
	ai = {
		factor = 1
	}
}

religious_values_reform = {
	icon = "religious_leader"
	allow_normal_conversion = yes
	potential = {
		NOT = {
			has_government_attribute = is_pirate_republic_reform
		}
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		missionaries = 1
		
		brahmins_hindu_influence_modifier = 0.1
		brahmins_hindu_loyalty_modifier = 0.05

		church_influence_modifier = 0.1
		church_loyalty_modifier = 0.05
	}
	ai = {
		factor = 1
	}
}

council_of_captains_reform = {
	icon = "council_of_captains"
	allow_normal_conversion = yes
	legacy_equivalent = oligarchic_republic
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_reform = the_pirate_ways_reform
			}
			custom_trigger_tooltip = {
				tooltip = had_the_pirate_ways_reform_tt
				had_country_flag = {
					flag = has_the_pirate_ways_reform
					days = 3650
				}
			}
		}
	}
	modifiers = {
		pr_captains_influence = 0.1
		privateer_efficiency = 0.33
	}
	ai = {
		factor = 2.5
	}
}

articles_of_agreement_reform = {
	icon = "articles_of_agreement"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_reform = the_pirate_ways_reform
			}
			custom_trigger_tooltip = {
				tooltip = had_the_pirate_ways_reform_tt
				had_country_flag = {
					flag = has_the_pirate_ways_reform
					days = 3650
				}
			}
		}
	}
	modifiers = {
		pr_buccaneers_influence = 0.1
		republican_tradition = 0.5
		global_sailors_modifier = 0.1
	}
	ai = {
		factor = 2.5
	}
}

smugglers_haven_reform = {
	icon = "smugglers_haven"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_reform = the_pirate_ways_reform
			}
			custom_trigger_tooltip = {
				tooltip = had_the_pirate_ways_reform_tt
				had_country_flag = {
					flag = has_the_pirate_ways_reform
					days = 3650
				}
			}
		}
	}
	modifiers = {
		pr_smugglers_influence = 0.1
		global_foreign_trade_power = 0.3
	}
	ai = {
		factor = 2.5
	}
}

the_pirate_ways_reform = {
	icon = "sailors"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		privateer_efficiency = 0.25
		land_morale = 0.1
		naval_morale = 0.1
		naval_maintenance_modifier = -0.10
		republican_tradition = 1
	}
	effect = {
		custom_tooltip = break_every_non_pirate_alliance_tt
		custom_tooltip = blocks_other_reforms_for_this_level_for_10_years_tt
		hidden_effect = {
			every_ally = {
				limit = {
					NOT = { has_government_attribute = is_pirate_republic_reform }
				}
				ROOT = { break_alliance = PREV }
			}
			clr_country_flag = has_the_pirate_ways_reform
			set_country_flag = has_the_pirate_ways_reform
		}
	}
	custom_attributes = {
		cannot_ally_non_pirates = yes
	}
	ai = {
		factor = 1
	}
}

liberte_reform = {
	icon = "liberte_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		rr_girondists_influence = 0.1
		num_accepted_cultures = 2
		promote_culture_cost = -0.75
	}
	ai = {
		factor = 2.5
	}
}

egalite_reform = {
	icon = "egalite_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		rr_jacobins_influence = 0.1
		republican_tradition = 0.25
		legitimacy = 1
		advisor_pool = 1
	}
	ai = {
		factor = 2.5
	}
}

fraternite_reform = {
	icon = "fraternite_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		rr_royalists_influence = 0.1
		culture_conversion_cost = -0.2
		harsh_treatment_cost = -0.25
		reform_progress_growth = 0.1
	}
	ai = {
		factor = 2.5
	}
}

#Frequency of Elections / Consolidation of Power

frequent_elections_reform = {
	icon = "ballot_box"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	trigger = {
		OR = {
			custom_trigger_tooltip = {
				tooltip = "NEEDS_REGULAR_ELECTIONS"
				has_government_attribute = has_term_election
			}
			has_reform = lottery_reform
		}
	}
	modifiers = {
		max_absolutism = -10
		election_cycle = -1
	}
	ai = {
		factor = 1
	}
}

consolidation_of_power_reform = {
	icon = "constitution"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		max_absolutism = 10
		election_cycle = 1
		max_terms = 1
	}
	effect = {
		hidden_effect = {
			
		}
	}
	custom_attributes = {
		reelection_depowers_estates = yes
	}
}

lottery_reform = {
	icon = "paper_with_seal_3"
	allow_normal_conversion = yes
	potential = {
		is_colonial_nation = no
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	trigger = {
		NOT = { 
			OR = {
				has_reform = venice_merchants_reform 
				has_government_attribute = has_dutch_election
				has_reform = presidential_despot_reform
				has_reform = military_dictatorship_reform
				has_reform = admiralty_reform
				has_reform = military_rulership_reform
				has_reform = prussian_republic
				has_reform = prussian_republic_reform
			}
		}
	}
	modifiers = {
		monarch_lifespan = 0.25
	}
	custom_attributes = {
		lottery_election = yes
		election_on_death = yes
		bonus_stats_for_elected_ruler = yes
	}
	has_term_election = no
	ai = {
		factor = 1
	}
}

force_reelection_reform = {
	icon = "paper_with_seal"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	trigger = {
		custom_trigger_tooltip = {
			tooltip = "NEEDS_REGULAR_ELECTIONS"
			has_government_attribute = has_term_election
		}
	}
	modifiers = {
		max_absolutism = -10
		yearly_corruption = -0.1
	}
	custom_attributes = {
		can_force_election = yes
	}
}

devotee_to_the_people_reform = {
	icon = "revolutionary_republic"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
		OR = {
			has_reform = venice_merchants_reform 
			has_government_attribute = has_dutch_election
			has_reform = presidential_despot_reform
			has_reform = military_dictatorship_reform
			has_reform = admiralty_reform
			has_reform = military_rulership_reform
			has_reform = prussian_republic
			has_reform = prussian_republic_reform
		}
	}
	trigger = {
		OR = {
			has_reform = venice_merchants_reform 
			has_government_attribute = has_dutch_election
			has_reform = presidential_despot_reform
			has_reform = military_dictatorship_reform
			has_reform = admiralty_reform
			has_reform = military_rulership_reform
			has_reform = prussian_republic
			has_reform = prussian_republic_reform
		}
	}
	modifiers = {
		max_absolutism = -10
		years_of_nationalism = -5
		republican_tradition = 0.1
	}
}

consolidate_power_in_doge_reform = {
	icon = "consolidate_power_in_doge_reform"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_reform = venice_merchants_reform
			has_reform = merchants_reform
			has_reform = veche_republic
			has_reform = great_veche_republic
		}
	}
	trigger = {
		OR = {
			has_reform = venice_merchants_reform
			has_reform = merchants_reform
			has_reform = veche_republic
			has_reform = great_veche_republic
		}
	}
	modifiers = {
		governing_capacity = 250
	}
	has_term_election = no
	ai = {
		factor = 10
		modifier = {
			factor = 0
			NOT = {
				num_of_cities = 25
			}
		}
	}
}

consolidate_power_in_cities_reform = {
	icon = "consolidate_power_in_cities_reform"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_reform = merchants_reform
			has_reform = veche_republic
			has_reform = great_veche_republic
		}
	}
	trigger = {
		OR = {
			has_reform = merchants_reform
			has_reform = veche_republic
			has_reform = great_veche_republic
		}
	}
	modifiers = {
		diplomatic_upkeep = 1
		global_foreign_trade_power = 0.1
	}
	has_term_election = yes
	is_eligible_for_hre_emperor = no
	duration = 4
	ai = {
		factor = 10
		modifier = {
			factor = 0
			num_of_cities = 25
		}
	}
}

legislative_assembly_reform = {
	icon = "legislative_assembly_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		yearly_revolutionary_zeal = 1.5
	}
	custom_attributes = {
		can_force_election = yes
	}
	ai = {
		factor = 10
	}
}

national_constituent_reform = {
	icon = "national_constituent_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		improve_relation_modifier = 0.15
		diplomatic_upkeep = 1
		reelection_cost = -0.15
	}
	ai = {
		factor = 10
	}
}

national_assembly_reform = {
	icon = "national_assembly"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		candidate_random_bonus = 2
	}
	custom_attributes = {
		elections_increase_factions_influence = yes
	}
	ai = {
		factor = 2
	}
}

#Religion within Republic
establish_religious_institution_for_pirates_reform = {
	icon = "religious_leader"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {	
		OR = {
			NOT = { has_estate = estate_church }
			crown_stronger_than_estate = { estate = estate_church }
			has_reform = establish_religious_institution_for_pirates_reform
		}
	}
	modifiers = {
		tolerance_own = 2
		max_absolutism = -15
	}
	custom_attributes = {
		enables_estate_church = yes
	}
	effect = {
		change_estate_land_share = {
			estate = estate_church
			share = 20
		}
	}
	ai = {
		factor = 2.5
	}
}

crew_before_faith_reform = {
	icon = "pirate_crew"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_church
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_church
			}
		}
	}
	modifiers = {
		pr_buccaneers_influence = 0.1
		war_exhaustion = -0.1
	}
	ai = {
		factor = 2.5
	}
}

respect_for_the_sea_reform = {
	icon = "great_sea"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_church
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_church
			}
		}
	}
	modifiers = {
		global_unrest = -1
		navy_tradition = 0.5
		pr_captains_influence = 0.1
	}
	ai = {
		factor = 2.5
	}
}

relgious_freedom_reform = {
	icon = "partial_secularisation_reform"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_church
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_church
			}
		}
	}
	modifiers = {
		development_cost = -0.05
		tolerance_heathen = 1
		tolerance_heretic = 1
		pr_smugglers_influence = 0.1
	}
	ai = {
		factor = 2.5
	}
}

#Federalism vs Unitarianism vs Confederacy

provincial_governments_reform = {
	icon = "landscape"
	allow_normal_conversion = yes
	modifiers = {
		state_maintenance_modifier = -0.25
		global_prosperity_growth = 0.5
	}
	ai = {
		factor = 1
	}
}

administrative_divisions_reform = {
	icon = "map"
	allow_normal_conversion = yes
	modifiers = {
		governing_capacity = 250
	}
	ai = {
		factor = 1
		modifier = {
			factor = 0
			has_reform = free_city
		}
		modifier = {
			factor = 0.5
			NOT = {
				any_owned_province = {
					is_territorial_core = root
				}
			}
		}
		modifier = {
			factor = 2.5
			num_of_owned_provinces_with = {
				value = 10
				is_territorial_core = root
			}
		}
		modifier = {
			factor = 0.25
			OR = {
				has_reform = merchants_reform
				has_reform = venice_merchants_reform
			}
		}
	}
}

union_of_states_reform = {
	icon = "constitution"
	allow_normal_conversion = yes
	potential = {
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	modifiers = {
		global_trade_power = 0.1
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	trigger = {
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	boost_income = yes
	ai = {
		factor = 1
		modifier = {
			factor = 1.5
			trade_income_percentage = 0.35
		}
		modifier = {
			factor = 2
			OR = {
				has_reform = merchants_reform
				has_reform = venice_merchants_reform
			}
		}
		modifier = {
			factor = 0
			NOT = { num_of_cities = 2 }
			is_part_of_hre = yes
		}
	}
}

cultural_administration_reform = {
	icon = "conciliarism_reform"
	allow_normal_conversion = yes
	modifiers = {
		num_accepted_cultures = 2
		promote_culture_cost = -0.5
	}
	ai = {
		factor = 1
		modifier = {
			factor = 0.25
			NOT = {
				any_owned_province = {
					has_owner_accepted_culture = no
					has_owner_culture = no
				}
			}
		}
	}
}

#Parliamentary vs Presidential

# parliamentary_reform defined in common file

presidential_reform = {
	icon = "man_on_podium"
	allow_normal_conversion = yes
	modifiers = {
		embracement_cost = -0.1
		max_absolutism = 5
	}
	ai = {
		factor = 1
		modifier = {
			factor = 0
			has_reform = free_city
		}
		modifier = {
			factor = 0.1
			NOT = { num_of_cities = 2 }
		}
	}
}

estate_council_reform = {
	icon = "council"
	allow_normal_conversion = yes
	modifiers = {
		all_estate_loyalty_equilibrium = 0.1
		max_absolutism = -25
	}
	potential = {
		is_revolutionary = no
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	trigger = {
		has_any_estates = yes
	}
	custom_attributes = {
		diet_increases_not_influence = yes
		elections_influence_estates = yes
		republican_tradition_from_diets = yes
	}
	ai = {
		factor = 1
		modifier = {
			factor = 0
			has_reform = free_city
		}
		modifier = {
			factor = 0.1
			NOT = { num_of_cities = 2 }
		}
	}
}

attorney_general_reform = {
	icon = "three_classes_reform"
	allow_normal_conversion = yes
	modifiers = {
		same_culture_advisor_cost = -0.15
	}
	custom_attributes = {
		#seizing_land_no_rebels = yes
		republican_tradition_from_advisors = yes
		can_not_seize_land = yes
	}
	ai = {
		factor = 1
		modifier = {
			factor = 0
			has_reform = free_city
		}
		modifier = {
			factor = 0.1
			NOT = { num_of_cities = 2 }
		}
	}
}

imperial_diplomacy_reform = {
	icon = "king"
	allow_normal_conversion = yes
	potential = {
		has_reform = free_city
	}
	modifiers = {
		diplomatic_reputation = 2
		diplomatic_upkeep = 1
	}
	effect = {
		emperor = {
			add_opinion = {
				who = root
				modifier = opinion_imperial_diplomacy
			}
		}
	}
	removed_effect = {
		emperor = {
			remove_opinion = {
				who = root
				modifier = opinion_imperial_diplomacy
			}
		}
	}
	ai = {
		factor = 1.5
	}
}

municipal_self_defense_reform = {
	icon = "soldiers_7"
	allow_normal_conversion = yes
	potential = {
		has_reform = free_city
	}
	modifiers = {
		land_forcelimit_modifier = 0.25
		global_manpower = 5
	}
	ai = {
		factor = 1.5
	}
}

feuillant_reform = {
	icon = "feuillant_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		stability_cost_modifier = -0.1
		republican_tradition = -0.1
	}

	ai = {
		factor = 0
	}

	conditional = {
		allow = { has_dlc = "Res Publica" }
		duration = 4
		has_term_election = yes
		is_eligible_for_hre_emperor = no
		states_general_mechanic = {
			revolutionaries = {
				land_morale = 0.1
				republican_tradition = 0.1
				yearly_revolutionary_zeal = 0.25
			}

			monarchists = {
				diplomatic_reputation = 1
				manpower_recovery_speed = 0.1
				global_unrest = -1
			}
		}
	}
}

two_chamber_reform = {
	icon = "parliament_hall"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		free_policy = 1
		republican_tradition = 0.15
	}
	
	ai = {
		factor = 1
	}
}


#Consolidation of Power

broaden_executive_powers_reform = {
	icon = "castle"
	allow_normal_conversion = yes
	modifiers = {
		stability_cost_modifier = -0.15
		all_power_cost = -0.02
	}
	ai = {
		factor = 1
	}
}

devolution_of_powers_reform = {
	icon = "generic_people"
	allow_normal_conversion = yes
	modifiers = {
		advisor_pool = 2
		global_autonomy = -0.05
	}
	ai = {
		factor = 1.5
	}
}

power_to_the_raiders_reform = {
	icon = "sea_raiders"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_buccaneers_influence = 0.1
		allowed_marine_fraction = 0.25
		global_sailors_modifier = 0.25
	}
	ai = {
		factor = 2.5
	}
}

power_to_the_captains_reform = {
	icon = "pirate_queen"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_captains_influence = 0.1
		heavy_ship_power = 0.1
		movement_speed_in_fleet_modifier = 1
	}
	ai = {
		factor = 2.5
	}
}

power_to_the_smugglers_reform = {
	icon = "blackmailing"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_smugglers_influence = 0.1
		merchants = 1
		ship_power_propagation = 0.25
	}
	ai = {
		factor = 2.5
	}
}

consolidate_power_to_the_ruler_reform = {
	icon = "nobleman"
	allow_normal_conversion = yes
	potential = {
		NOT = { has_government_attribute = is_pirate_republic_reform }
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		yearly_absolutism = 2
		max_absolutism = 25
		reelection_cost = -0.1
	}
	custom_attributes = {
		absolutism_reduction_on_ruler_death = yes
		reelection_increases_absolutism = yes
	}
	effect = {
		hidden_effect = {
			set_variable = {
				which = election_term
				value = 1
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			set_variable = {
				which = election_term
				value = 1
			}
		}
	}
	ai = {
		factor = 0
	}
}

consolidate_power_into_different_candidates_reform = {
	icon = "dutch_republic"
	allow_normal_conversion = yes
	potential = {
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	trigger = {
		custom_trigger_tooltip = {
			tooltip = "NEEDS_REGULAR_ELECTIONS"
			has_government_attribute = has_term_election
		}
	}
	modifiers = {
		max_absolutism = -20
		election_cycle = -1
		candidate_random_bonus = 1
	}
	ai = {
		factor = 0
	}
}

pirate_king_reform = {
	icon = "pirate_king"
	allow_normal_conversion = yes
	legacy_equivalent = pirate_kingdom
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_captains_influence = 0.1
		harsh_treatment_cost = -0.2
		leader_naval_fire = 1
	}
	custom_attributes = {
		admirals_become_rulers = yes
	}
	has_term_election = no
	ai = {
		factor = 2.5
	}
}

war_against_the_world_doctrine_reform = {
	icon = "war_against_the_world"
	allow_normal_conversion = yes
	legacy_equivalent = war_against_the_world_government
	disallowed_trade_goods = { slaves }
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_buccaneers_influence = 0.1
		years_of_nationalism = -5
		global_ship_recruit_speed = -0.15
	}
	custom_attributes = {
		gives_war_against_the_world_tooltip_dummy = yes
	}
	ai = {
		factor = 2.5
	}
}

black_market_consortium_reform = {
	icon = "black_market_consortium"
	allow_normal_conversion = yes
	legacy_equivalent = black_market_consortium_government
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		pr_smugglers_influence = 0.1
	}
	conditional = {
		allow = {
			has_dlc = "Res Publica"
		}
		can_use_trade_post = yes
	}
	boost_income = yes
	ai = {
		factor = 2.5
	}
}

absolute_president_reform = {
	icon = "king"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		all_power_cost = -0.05
		election_cycle = 1
	}
	ai = {
		factor = 2
	}
}

revolutionary_council_reform = {
	icon = "revolutionary_council_reform"
	allow_normal_conversion = yes
	potential = {
		has_dlc = "Emperor"
		is_revolutionary = yes
	}
	modifiers = {
		max_revolutionary_zeal = 10
		election_cycle = -1
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
	}
	ai = {
		factor = 2
	}
}

#Economical Matters
empowered_quartermasters_reform = {
	icon = "merchant"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {	
		OR = {
			NOT = { has_estate = estate_burghers }
			crown_stronger_than_estate = { estate = estate_burghers }
			has_reform = empowered_quartermasters_reform
		}
	}
	modifiers = {
		naval_maintenance_modifier = -0.15
		max_absolutism = -15
	}
	effect = {
		change_estate_land_share = {
			estate = estate_burghers
			share = 20
		}
	}
	custom_attributes = {
		enables_estate_burghers = yes
	}
	ai = {
		factor = 1
	}
}

open_naval_services_reform = {
	icon = "merchant_ship"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_burghers
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_burghers
			}
		}
	}
	modifiers = {
		pr_buccaneers_influence = 0.1
		global_ship_cost = -0.05
		global_ship_repair = 0.15
	}
	effect = {
		hidden_effect = {
			every_owned_province = {
				if = {
					limit = {
						trade_goods = naval_supplies
					}
					add_province_modifier = { 
						name = naval_supplies_bonus_prod
						duration = -1
						hidden = yes
					}
				}
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			every_owned_province = {
				limit = {
					has_province_modifier = naval_supplies_bonus_prod
				}
				remove_province_modifier = naval_supplies_bonus_prod
			}
		}
	}
	custom_attributes = {
		extra_trade_goods_from_naval_supplies = yes
	}
	ai = {
		factor = 1
	}
}

master_smugglers_reform = {
	icon = "black_army_reform"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_burghers
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_burghers
			}
		}
	}
	modifiers = {
		pr_smugglers_influence = 0.1
		mercenary_cost = -0.2
	}
	custom_attributes = {
		mercs_do_not_cost_army_professionalism = yes
	}
	ai = {
		factor = 1
	}
}

cutthroat_approach_reform = {
	icon = "pirate_republic"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {
		if = {
			limit = {
				has_government_attribute = enables_estate_burghers
			}
			can_swap_out_of_estate_granting_reform = {
				estate = estate_burghers
			}
		}
	}
	modifiers = {
		naval_tradition_from_battle = 0.5
		prestige_from_naval = 0.5
		capture_ship_chance = 0.33
		pr_captains_influence = 0.1
	}
	conditional = {
		allow = { has_dlc = "Golden Century" }
		custom_attributes = {
			flagship_bounty_hunter = yes
		}
	}
	ai = {
		factor = 1
	}
}

#Administration

political_principle_reform = {
	icon = "paper_with_seal_3"
	allow_normal_conversion = yes
	modifiers = {
		possible_adm_policy = 1
	}
}

moral_principle_reform = {
	icon = "parliament_hall"
	allow_normal_conversion = yes
	modifiers = {
		possible_dip_policy = 1
	}
}

stability_principle_reform = {
	icon = "soldiers_6"
	allow_normal_conversion = yes
	modifiers = {
		possible_mil_policy = 1
	}
}

enlightened_principle_reform = {
	icon = "enlightenment"
	allow_normal_conversion = yes
	trigger = {
		OR = {
			full_idea_group = innovativeness_ideas
			has_institution = enlightenment
		}
	}
	modifiers = {
		years_of_nationalism = -10
	}
}

military_principle_reform = {
	icon = "soldiers_3"
	allow_normal_conversion = yes
	modifiers = {
		republican_tradition = -0.5
		max_absolutism = 10
		years_of_nationalism = -5
	}
	custom_attributes = {
		winning_wars_gives_rt = yes
	}
}

revolutionary_principle_reform = {
	icon = "revolutionary_republic"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		rr_girondists_influence = 0.1
		land_morale = 0.1
		global_manpower_modifier = 0.15
	}
	ai = {
		factor = 2
	}
}

equality_principle_reform = {
	icon = "equal_electorate_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		tolerance_heretic = 2
		tolerance_heathen = 2
		rr_jacobins_influence = 0.1
	}
	ai = {
		factor = 2
	}
}

imperial_principle_reform = {
	icon = "imperial_nobility_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		rr_royalists_influence = 0.1
		ae_impact = -0.1
		province_warscore_cost = -0.1
	}
	ai = {
		factor = 2
	}
}

#Electorate

landholders_reform = {
	icon = "dutch_flag"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		manpower_recovery_speed = 0.1
	}
	ai = {
		factor = 1
	}
}

citizenry_reform = {
	icon = "people_walking"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	modifiers = {
		land_morale = 0.1
	}
	ai = {
		factor = 1.5
	}
}

admiralty_reform = {
	icon = "admiralty_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = no
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	trigger = {
		num_of_ports = 1
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	modifiers = {
		leader_naval_fire = 1
		naval_tradition_from_battle = 1
		republican_tradition = -0.5
		max_absolutism = 10
	}
	custom_attributes = {
		admirals_become_rulers = yes
		cannot_become_dictatorship = yes
	}
	has_term_election = no
	
	ai = {
		factor = 0
	}
}

military_rulership_reform = {
	icon = "soldiers_2"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = no
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	modifiers = {
		leader_land_shock = 1
		army_tradition = 0.5
		republican_tradition = -0.5
		max_absolutism = 10
	}
	custom_attributes = {
		generals_become_rulers = yes
	}
	has_term_election = no
	
	ai = {
		factor = 0
	}
}

dynastic_rulership_reform = {
	icon = "king"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = no
	}
	modifiers = {
		diplomatic_reputation = 2
		republican_tradition = -0.25
	}
	queen = yes
	royal_marriage = yes
	custom_attributes = {
		election_on_death = yes
	}
	has_term_election = no
	
	ai = {
		factor = 0
	}
}

rule_through_plunder_reform = {
	icon = "rioting_burning_2"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		loot_amount = 1
		land_attrition = -0.05
	}
	raze_province = yes
	
	ai = {
		factor = 0
	}
}

equal_electorate_reform = {
	icon = "equal_electorate_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		global_unrest = -2
		global_tax_modifier = 0.1
		female_advisor_chance = 0.33
		rr_jacobins_influence = 0.1
	}
	
	ai = {
		factor = 1
	}
}

three_classes_reform = {
	icon = "three_classes_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		core_creation = -0.1
		rr_girondists_influence = 0.1
	}
	
	ai = {
		factor = 1
	}
}

military_electorate_reform = {
	icon = "military_dictatorship_reform"
	allow_normal_conversion = yes
	potential = {
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		leader_land_fire = 1
		army_tradition = 0.25
		rr_royalists_influence = 0.1
	}
	custom_attributes = {
		generals_become_rulers = yes
		has_term_election = no
	}
	
	ai = {
		factor = 1
	}
}

#Office Selection Method

appointment_by_committee_reform = {
	icon = "politician"
	allow_normal_conversion = yes
	modifiers = {
		advisor_pool = 1
		advisor_cost = -0.05
	}
}

bureaucratic_aparatus_reform = {
	icon = "map_2"
	allow_normal_conversion = yes
	modifiers = {
		min_autonomy_in_territories = -0.10
	}
}

universal_suffrage_reform = {
	icon = "paper_with_seal"
	allow_normal_conversion = yes
	modifiers = {
		free_dip_policy = 1
	}
	ai = {
		factor = 1
	}
}

pirate_representation_reform = {
	icon = "council"
	allow_normal_conversion = yes
	potential = {
		has_government_attribute = is_pirate_republic_reform
	}
	trigger = {	
		if = {
			limit = { has_dlc = "Common Sense" }
			OR = {
				NOT = { has_estate = estate_nobles }
				crown_stronger_than_estate = { estate = estate_nobles }
				has_reform = pirate_representation_reform
			}
		}
	}
	modifiers = {
		republican_tradition = 0.5
		max_absolutism = -15
	}
	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
	}

	ai = {
		factor = 0
	}
}

#Question of Dictatorship

pirates_become_republic_reform = {
	icon = "parliament_highlighted"
	allow_normal_conversion = yes
	
	potential = {
		has_reform = pirate_republic_reform
	}
	effect = {
		remove_government_reform = pirate_republic_reform
		set_country_flag = populists_in_government
	}
	ai = {
		factor = 0
	}
}

seize_executive_power_reform = {
	icon = "king_2_highlighted"
	allow_normal_conversion = yes

	trigger = {
		NOT = { has_government_attribute_short_desc = locked_government_type }
		stability = 2
	}

	modifiers = {
	}
	effect = {
		if = {
			limit = { has_government_attribute = states_general_mechanic }
			set_country_flag = had_states_general_mechanic
		}
		set_country_flag = populists_in_government
		add_stability = -3
		change_government = monarchy
		if = {
			limit = {
				tag = AVE
			}
			hidden_effect = {
				country_event = {
					id = flavor_gbr.20
				}
			}
		}
		if = {
			limit = { has_country_flag = had_states_general_mechanic }
			country_event = { id = dutch_republic.33 }
			clr_country_flag = had_states_general_mechanic
		}
	}
	ai = {
		factor = 0
	}
}

proclaim_divine_guidance_reform = {
	icon = "religious_leader_highlighted"
	allow_normal_conversion = yes
	trigger = {
		NOT = { has_government_attribute_short_desc = locked_government_type }
		stability = 2
	}
	modifiers = {
	}
	effect = {
		set_country_flag = populists_in_government
		add_stability = -3
		change_government = theocracy
		if = {
			limit = {
				tag = AVE
			}
			hidden_effect = {
				country_event = {
					id = flavor_gbr.20
				}
			}
		}
	}
	ai = {
		factor = 0
	}
}

strengthen_executive_powers_reform = {
	icon = "queen"
	allow_normal_conversion = yes
	potential = { 
		is_revolutionary = no 
	}
	modifiers = {
		max_absolutism = 25
	}
}

reinforce_republican_values_reform = {
	icon = "parliament_hall"
	allow_normal_conversion = yes
	modifiers = {
		free_adm_policy = 1
		reelection_cost = -0.1
	}
}

federal_senate_reform = {
	icon = "judge"
	allow_normal_conversion = yes
	potential = {
		NOT = { has_government_attribute = is_pirate_republic_reform }
	}
	modifiers = {
		expand_administration_cost = -1
		candidate_random_bonus = 1
	}

	conditional = {
		allow = {
			OR = {
				has_dlc = "Common Sense"
				has_dlc = "Domination"
			}
		}
		has_parliament = yes
		custom_attributes = {
			halved_parliament_bribes = yes
		}
	}
}

president_for_life_reform = {
	icon = "man_on_podium"
	allow_normal_conversion = yes
	has_term_election = no
	potential = { 
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		republican_tradition = -0.5
		monarch_admin_power = 1
		monarch_military_power = 1
	}
}

unified_piratical_confederacy_reform = {
	icon = "pirate_council"
	allow_normal_conversion = yes
	potential = { 
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		state_governing_cost = -0.5
		pr_buccaneers_influence = 0.1
	}
}

scourge_of_the_seven_sea_reform = {
	icon = "pirate_ship"
	allow_normal_conversion = yes
	potential = { 
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		max_absolutism = 20
		naval_tradition_from_battle = 1
		army_tradition_from_battle = 1
		pr_captains_influence = 0.1
	}
	custom_attributes = {
		raiding_increases_pp = yes
		winning_battles_increases_legitimacy = yes
	}
}

neutral_ground_reform = {
	icon = "neutral_ground"
	allow_normal_conversion = yes
	potential = { 
		has_government_attribute = is_pirate_republic_reform
	}
	modifiers = {
		diplomatic_reputation = 2
		improve_relation_modifier = 0.15
		pr_smugglers_influence = 0.1
	}
	custom_attributes = {
		vassals_can_hoist_the_black_flag = yes
		pirate_vassal_bonus = yes
	}
}

government_for_people_reform = {
	icon = "government_for_people_reform"
	allow_normal_conversion = yes
	potential = { 
		is_revolutionary = yes
		has_dlc = "Emperor"
	}
	modifiers = {
		max_revolutionary_zeal = 20
	}
}

become_rev_empire_reform = {
	icon = "become_rev_empire_reform"
	allow_normal_conversion = yes

	potential = { 
		is_revolutionary = yes
	}
	
	trigger = {
		has_reform = revolutionary_republic_reform
		if = {
			limit = {
				has_dlc = "Rights of Man"
			}
			faction_influence = {
				faction = rr_royalists
				influence = 75
			}
		}
		else = {
			NOT = { republican_tradition = 40 }
		}
	}

	modifiers = {
	}
	effect = {
		if = {
			limit = { has_government_attribute = states_general_mechanic }
			set_country_flag = had_states_general_mechanic
		}
		set_country_flag = populists_in_government
		hidden_effect = {
			change_government = monarchy
			if = {
				limit = {
					tag = AVE
				}
				hidden_effect = {
					country_event = {
						id = flavor_gbr.20
					}
				}
			}
		}
		add_government_reform = revolutionary_empire_reform
		if = {
			limit = { has_country_flag = had_states_general_mechanic }
			country_event = { id = dutch_republic.33 }
			clr_country_flag = had_states_general_mechanic
		}
	}
	ai = {
		factor = 0
	}
}

millenarian_theocracy_reform = {
	icon = "rioting_burning_2"
	allow_normal_conversion = yes
	has_term_election = no
	potential = {
		religion = catholic
		has_ruler = "Girolamo Savonarola"
		OR = {
			tag = LAN
			tag = TUS
		}
	}
	trigger = {
		religion = catholic
		has_ruler = "Girolamo Savonarola"
		OR = {
			tag = LAN
			tag = TUS
		}
	}
	modifiers = {
		devotion = 1
		tolerance_own = 2
		global_missionary_strength = 0.02
		max_absolutism = 40
	}
	custom_attributes = {
		election_on_death = yes
	}
	ai = {
		factor = 10
	}
}

ven_promissione_ducale_reform = {
	icon = "ven_promissione_ducale_reform"
	allow_normal_conversion = yes
	potential = {
		OR = {
			has_unlocked_government_reform = {
				government_reform = ven_promissione_ducale_reform
			}
			have_had_reform = ven_promissione_ducale_reform
		}
	}
	trigger = {
		is_or_was_tag = { tag = VEN }
		government = republic
	}
	modifiers = {
		yearly_corruption = -0.25
		candidate_random_bonus = 1
		monthly_authority_power = 0.1

	}
	ai = {
		factor = 10
	}
}