merchants_reform = {
	icon = "politician"
	allow_normal_conversion = yes
	modifiers = {
		max_absolutism = -10
		merchants = 1
		trade_deals_slots = 1
		monthly_liberalism = 0.2
	}
	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
		locked_government_type = yes
	}
	government_abilities = {
		liberalism_mechanic
	}
	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
	lock_level_when_selected = yes
	modifiers = {
		max_absolutism = -10
		merchants = 1
		yearly_corruption = -0.1
		monarch_lifespan = 0.25
		trade_deals_slots = 2
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
		venetian_government_mechanic
	}
	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 = {
		locked_government_type = yes
		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
	removed_effect = {
		remove_country_modifier = venetian_government_stato_mar_modifier
		remove_country_modifier = venetian_government_carnevale_venezia_modifier
		remove_country_modifier = venetian_government_stato_tera_modifier
	}
}





peasants_republic = {
	allow_normal_conversion = yes
	icon = "peasant_republic"
	potential = {
		OR = {
			has_country_flag = great_peasants_war_peasant_republic
			have_had_reform = peasants_republic
			have_had_reform = stateless_society
			has_reform = peasants_republic
		}
	}
	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
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}
	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
}

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
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}
	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
		trade_deals_slots = 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
		monthly_liberalism = 0.1
	}
	government_abilities = {
		liberalism_mechanic
	}

	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
		monthly_liberalism = 0.1
	}
	government_abilities = {
		liberalism_mechanic
	}
	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
			culture_group = slavic
			AND = {
				is_playing_custom_nation = yes
				have_had_reform = veche_republic
			}
		}
	}
	legacy_equivalent = veche_republic_legacy
	nation_designer_trigger = {
		OR = {
			culture_group = east_slavic
			culture_group = slavic
		}
	}
	modifiers = {
		merchants = 1
		governing_capacity = 100
		max_absolutism = 10
		has_streltsy = yes
		allowed_streltsy_fraction = 0.1
		trade_deals_slots = 1
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}
	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 = "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"
		}
		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 = {
		OR = {
			culture_group = east_slavic
			culture_group = 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 = {
		OR = {
			culture_group = east_slavic
			culture_group = 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
		trade_deals_slots = 1
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}
	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
		trade_deals_slots = 1
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}

	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 }
			}
			AND = {
				is_playing_custom_nation = yes
				have_had_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
		monthly_liberalism = 0.3
	}
	government_abilities = {
		liberalism_mechanic
	}

	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
}

federal_republic = {
	icon = "constitution"
	allow_normal_conversion = yes
	potential = {
		has_dlc = "American Dream"
		OR = {
			AND = {
				tag = USA
				NOT = { map_setup = map_setup_random }
			}
			AND = {
				is_playing_custom_nation = yes
				have_had_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
		monthly_liberalism = 0.3
	}
	government_abilities = {
		liberalism_mechanic
	}

	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
}

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 }
			}
			AND = {
				is_playing_custom_nation = yes
				have_had_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
		trade_deals_slots = 1
		monthly_liberalism = 0.2
	}
	government_abilities = {
		liberalism_mechanic
	}

	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
	government_abilities = {
		liberalism_mechanic
	}
	modifiers = {
		cavalry_power = 0.2
		cavalry_cost = -0.2
		cav_to_inf_ratio = 0.25
		governing_capacity = 50
		allowed_cossack_fraction = 0.25
		monthly_liberalism = 0.2
	}

	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
}

#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" }
		}
	}
	effect = {
		change_variable = {
			which = Populist_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Populist_Influence
			value = -1
		}
	}
	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
			}
		}
	}
	effect = {
		change_variable = {
			which = Oliarch_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Oliarch_Influence
			value = -1
		}
	}
	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" }
		}
	}
	effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = -1
		}
	}
	modifiers = {
		republican_tradition = 0.2
	}
	ai = {
		factor = 1.5
	}
}

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
	}
}

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
		}
	}
	effect = {
		change_variable = {
			which = Populist_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Populist_Influence
			value = -1
		}
	}
	modifiers = {
		max_absolutism = -10
		monthly_liberalism = 0.1
		election_cycle = -1
	}
	government_abilities = {
		liberalism_mechanic
	}
	ai = {
		factor = 1
	}
}

consolidation_of_power_reform = {
	icon = "constitution"
	allow_normal_conversion = yes
	potential = {
		OR = {
			is_revolutionary = no
			NOT = { has_dlc = "Emperor" }
		}
	}
	effect = {
		change_variable = {
			which = Oliarch_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Oliarch_Influence
			value = -1
		}
	}
	modifiers = {
		max_absolutism = 10
		election_cycle = 1
		max_terms = 1
	}
	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
			}
		}
	}
	effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = -1
		}
	}
	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
	}
}

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
	effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = -1
		}
	}
	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 = {
		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
	}
}

#Federalism vs Unitarianism vs Confederacy

provincial_governments_reform = {
	icon = "landscape"
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Populist_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Populist_Influence
			value = -1
		}
	}
	modifiers = {
		state_maintenance_modifier = -0.25
		global_prosperity_growth = 0.5
	}
	ai = {
		factor = 1
	}
}

administrative_divisions_reform = {
	icon = "map"
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Oliarch_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Oliarch_Influence
			value = -1
		}
	}
	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 }
	}
	effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = -1
		}
	}
	modifiers = {
		global_trade_power = 0.1
		trade_deals_slots = 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
		}
	}
}

#Parliamentary vs Presidential

# parliamentary_reform defined in common file

presidential_reform = {
	icon = "man_on_podium"
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Populist_Influence
			value = 1
		}
		hidden_effect = {
			country_event = { 
				id = reform_me_events.204
				days = 1
			}
		}
	}
	removed_effect = {
		change_variable = {
			which = Populist_Influence
			value = -1
		}
		hidden_effect = {
			remove_country_modifier = GE_Presidential_Adm
			remove_country_modifier = GE_Presidential_Dip
			remove_country_modifier = GE_Presidential_Mil
		}
	}
	modifiers = {
		embracement_cost = -0.1
		max_absolutism = 5
	}
	custom_attributes = {
		enables_presidental_authority = yes #-15% stabcost at 4 adm, +1 diprep at 4 dip, +25 reinforce speed at 4 mil
	}
	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
	effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Plutocrat_Influence
			value = -1
		}
	}
	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
	effect = {
		change_variable = {
			which = Populist_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Populist_Influence
			value = -1
		}
	}
	potential = {
		has_reform = free_city
	}
	modifiers = {
		land_forcelimit_modifier = 0.25
		global_manpower = 5
	}
	ai = {
		factor = 1.5
	}
}
