kingdom_of_castille_and_leon = {
	icon = castille_leon
	allow_normal_conversion = yes
	potential = {
		OR = {
			tag = CAS
			tag = LON
			has_reform = kingdom_of_castille_and_leon
		}
	}
	trigger = {
		has_reform = kingdom_of_castille_and_leon
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	modifiers = {
		rural_goods_produced_modifier = -0.10
		global_manpower_modifier = 0.05
		nobles_influence_modifier = 0.05
	}
	ai = {
		factor = 100
	}
}

crown_of_castille = {
	icon = castille_isabelle
	allow_normal_conversion = yes
	potential = {
		OR = {
			tag = CAS
			tag = SPA
			has_reform = crown_of_castille
		}
	}
	trigger = {
		has_reform = crown_of_castille
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 10
	modifiers = {
		diplomatic_upkeep = 1
	}
	custom_attributes = {
		enables_trade_princes = yes #1 Merchant if you got a aragonese of catalan vassal
	}
	effect = {
		hidden_effect = {
			ge_country_trade_princes_update = yes
		}
	}
	removed_effect = {
		hidden_effect = {
			remove_country_modifier = Trade_Princes
		}
	}
	ai = {
		factor = 101
	}
}

hispanic_kingdom = {
	icon = spain_charles
	allow_normal_conversion = yes
	potential = {
		NOT = { has_dlc = "Domination"}
		OR = {
			tag = SPA
			has_reform = hispanic_kingdom
		}
	}
	trigger = {
		has_reform = hispanic_kingdom
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 25
	modifiers = {
		tolerance_own = 1
		governing_capacity = 100
	}
	effect = {
		hidden_effect = {
			every_owned_province = {
				ge_Crown_Of_Aragon_province_update = yes
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			every_owned_province = {
				remove_province_modifier = Crown_Of_Aragon
			}
		}
	}
	custom_attributes = {
		enables_crown_of_aragon = yes #25% Autonomy in Aragonese Provinces
	}
	ai = {
		factor = 102
	}
}

iberian_enlightened_despotism_reform = {
	icon = spain_bourbon
	allow_normal_conversion = yes
	potential = {
		NOT = { has_dlc = "Domination"}
		OR = {
			tag = SPA
			has_reform = iberian_enlightened_despotism_reform
			have_had_reform = iberian_enlightened_despotism_reform
		}
	}
	trigger = {
		absolutism = 50
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 70
	modifiers = {
		max_absolutism = 5
		build_cost = -0.15
		prestige = 1
		governing_capacity = 150
	}
	custom_attributes = {
		enables_royal_council = yes
	}
	effect = {
		hidden_effect = {
			country_event = { 
				id = reform_me_events.52
				days = 1
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			ge_country_royal_council_remove = yes
		}
	}
	ai = {
		factor = 103
	}
}

kingdom_of_portugal = {
	icon = kingdom_of_portugal
	allow_normal_conversion = yes
	potential = {
		OR = {
			tag = POR
			has_reform = kingdom_of_portugal
		}
	}
	trigger = {
		NOT = { is_year = 1481 }
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 20
	modifiers = {
		min_autonomy = 10
		papal_influence = 1.0
		land_morale = 0.05
	}
	ai = {
		factor = 100
	}
}

kingdom_of_portugal_and_azures = {
	icon = portuguese_thassalocracy
	allow_normal_conversion = yes
	potential = {
		OR = {
			tag = POR
			has_reform = kingdom_of_portugal_and_azures
		}
	}
	trigger = {
		is_year = 1481
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 25
	modifiers = {
		global_autonomy = -0.025
		trade_steering = 0.10
		navy_tradition = 1
		trade_deals_slots = 1
	}
	ai = {
		factor = 101
	}
}

portuguese_empire_reform = {
	icon = king
	allow_normal_conversion = yes
	potential = {
		OR = {
			tag = POR
			has_reform = portuguese_empire_reform
		}
	}
	trigger = {
		OR = {
			has_reform = portuguese_empire_reform
			AND = {
				has_reform = kingdom_of_portugal_and_azures
				absolutism = 50
			}
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 60
	modifiers = {
		trade_efficiency = 0.10
		num_accepted_cultures = 2
		trade_company_investment_cost = -0.25
		navy_tradition = 1
		trade_deals_slots = 2
	}
	custom_attributes = {
		enables_kingdom_of_brazil = yes
	}
	effect = {
		hidden_effect = {
			every_subject_country = {
				ge_country_kingdom_of_brazil_update = yes
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			every_subject_country = {
				remove_country_modifier = Kingdom_Of_Brazil
			}
		}
	}
	ai = {
		factor = 102
	}
}

crown_of_aragon = {
	icon = aragon_alfonso
	allow_normal_conversion = yes
	effect = {
	}
	potential = {
		OR = {
			tag = ARA
			has_reform = crown_of_aragon
		}
	}
	trigger = {
		has_reform = crown_of_aragon
	}
	effect = {
		hidden_effect = {
			every_owned_province = {
				ge_aragon_crown_union_province_update = yes
			}
		}
	}
	removed_effect = {
		hidden_effect = {
			every_owned_province = {
				remove_province_modifier = Kingdom_of_Aragon
				remove_province_modifier = Principality_Of_Catalonia
				remove_province_modifier = City_Of_Valencia
				remove_province_modifier = Kingdom_Of_Sicily
			}
		}
	}
	valid_for_nation_designer = yes
	nation_designer_cost = 0
	modifiers = {
		min_autonomy = 10
		global_unrest = -1
	}
	custom_attributes = {
		enables_aragon_crown_union = yes
	}
	ai = {
		factor = 100
	}
}



consulate_of_the_sea_GE = {
	icon = GE_trader
	allow_normal_conversion = yes
	valid_for_nation_designer = no
	potential = {
		has_reform = consulate_of_the_sea_GE
	}
	modifiers = {
		merchants = 1
		galley_power = 0.20
		global_trade_power = 0.15
		global_sailors_modifier = 0.15
		naval_forcelimit_modifier = 0.20
		trade_deals_slots = 1
	}
	ai = {
		factor = 10
	}
}

portuguese_cortes_reform = {
	icon = assembly_hall
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Burgher_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Burgher_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			tag = POR
			primary_culture = portugese
			has_reform = portuguese_cortes_reform
		}
	}
	trigger = {
		OR = {
			tag = POR
			primary_culture = portugese
			has_reform = portuguese_cortes_reform
		}
	}
	modifiers = {
		legitimacy = 0.5
	}
	custom_attributes = {
		enables_cortes = yes #pseudoparliament
	}#fixdis every option is the same
	ai = {
		factor = 100
	}
}

portugese_marines_reform = {
	icon = "soldiers_5"
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Royal_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Royal_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			primary_culture = portugese
			has_reform = portugese_marines_reform
		}
	}
	trigger = {
		OR = {
			has_reform = kingdom_of_portugal_and_azures
			has_reform = portuguese_empire_reform
		}
	}
	modifiers = {
		discipline = 0.025
		shock_damage_received = -0.05
		fire_damage_received = -0.05
	}
	ai = {
		factor = 100
	}
}

respect_union_reform = {
	icon = Spanish_Crown
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Noble_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Noble_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			tag = CAS
			tag = SPA
			tag = ARA
			has_reform = respect_union_reform
		}
	}
	modifiers = {
		diplomatic_upkeep = 1
		num_accepted_cultures = 1
	}
	ai = {
		factor = 10
	}
}

casa_de_contraction_reform = {
	icon = casa_de_contraction
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Burgher_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Burgher_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			tag = CAS
			tag = SPA
			has_reform = casa_de_contraction_reform
		}
	}
	trigger = {
		OR = {
			tag = CAS
			tag = SPA
			has_reform = casa_de_contraction_reform
		}
	}
	modifiers = {
		global_ship_trade_power = 0.2
		global_colonial_growth = 10
	}
	ai = {
		factor = 100
	}
}

casa_de_india_reform = {
	icon = casa_de_india
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Burgher_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Burgher_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			has_reform = casa_de_india_reform
			primary_culture = portugese
		}
	}
	trigger = {
		OR = {
			has_reform = casa_de_india_reform
			primary_culture = portugese
		}
	}
	modifiers = {
		global_prov_trade_power_modifier = 0.15
		plantage_goods_produced_modifier = 0.15
		trade_deals_slots = 1
	}
	ai = {
		factor = 100
	}
}

trade_princes_reform = {
	icon = GE_trader
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Burgher_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Burgher_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			tag = ARA
			primary_culture = aragonese
			accepted_culture = aragonese
			primary_culture = catalan
			accepted_culture = catalan
			has_reform = trade_princes_reform
		}
	}
	trigger = {
		OR = {
			tag = ARA
			primary_culture = aragonese
			accepted_culture = aragonese
			primary_culture = catalan
			accepted_culture = catalan
			has_reform = trade_princes_reform
		}
	}
	modifiers = {
		placed_merchant_power = 5
		merchants = 1
		burghers_loyalty_modifier = 0.05
		trade_deals_slots = 1
	}
	can_use_trade_post = yes
	ai = {
		factor = 100
	}
}

jinetes_reform = {
	icon = spain_jinite
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Noble_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Noble_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			has_reform = kingdom_of_castille_and_leon
			has_reform = crown_of_castille
		}
	}
	trigger = {
		OR = {
			has_reform = kingdom_of_castille_and_leon
			has_reform = crown_of_castille
		}
	}
	modifiers = {
		cavalry_power = 0.15
		cavalry_cost = -0.10
		cavalry_flanking = 0.5
	}
	ai = {
		factor = 100
	}
}

miquelet_militia_reform = {
	icon = spain_tercio
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Burgher_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Burgher_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			has_reform = hispanic_kingdom
		}
	}
	trigger = {
		has_reform = hispanic_kingdom
	}
	modifiers = {
		infantry_cost = -0.10
		infantry_power = 0.05
	}
	ai = {
		factor = 100
	}
}

royal_ordinances_reform = {
	icon = king
	allow_normal_conversion = yes
	effect = {
		change_variable = {
			which = Royal_Influence
			value = 1
		}
	}
	removed_effect = {
		change_variable = {
			which = Royal_Influence
			value = -1
		}
	}
	potential = {
		OR = {
			has_reform = iberian_enlightened_despotism_reform
		}
	}
	trigger = {
		has_reform = iberian_enlightened_despotism_reform
	}
	modifiers = {
		mil_tech_cost_modifier = -0.15
		artillery_cost = -0.10
		drill_gain_modifier = 0.25
	}
	ai = {
		factor = 100
	}
}