country_decisions = {

	sardinia_piedmont_nation = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { exists = SPI }
			government = monarchy
			OR = {
				tag = SAV
				tag = SAR
			}
			is_colonial_nation = no
			OR = {
				is_former_colonial_nation = no
				AND = {
					is_former_colonial_nation = yes
					ai = no
				}
			}
		}
		allow = {
			adm_tech = 15
			is_subject = no
			is_nomad = no
			is_at_war = no
			OR = {
				AND = {
					tag = SAR
					NOT = { exists = SAV }
				}
				AND = {
					tag = SAV
					NOT = { exists = SAR }
				}
			}
			owns_core_province = 102		# Nice
			owns_core_province = 103		# Piedmont
			owns_core_province = 127		# Sardinia
			owns_core_province = 205		# Savoie
			owns_core_province = 1875		# Cuneo	
		}
		effect = {
			change_tag = SPI
			if = {
				limit = {
					is_part_of_hre = yes
					is_elector = no
				}
				every_owned_province = {
					limit = {
						is_part_of_hre = yes
					}
					set_in_empire = no
				}
			}
			if = {
				limit = {
					NOT = {
						government_rank = 2
					}
				}
				set_government_rank = 2
			}
			set_capital = 103		# Piedmont
			add_prestige = 10
		}
		ai_will_do = {
			factor = 1
		}
	}
	
	sardinia_piedmont_nation_inherit = {
		major = yes
		potential = {
			normal_or_historical_nations = yes
			OR = {
				ai = no
				is_playing_custom_nation = no
			}
			NOT = { exists = SPI }
			government = monarchy
			OR = {
				AND = {
					tag = SAV
					SAR = { 
						ai = yes 
						was_player = no
					}
				}
				AND = {
					tag = SAR
					SAV = { 
						ai = yes 
						was_player = no 
					}
				}
			}
		}
		allow = {
			adm_tech = 15
			is_subject = no
			is_nomad = no
			is_at_war = no
			prestige = 75
			dip = 3
			adm = 3
			OR = {
				AND = {
					tag = SAR
					owns_core_province = 127			# Sardinia
					senior_union_with = SAV
					SAV = {
						owns_core_province = 103		# Piedmont
						NOT = { num_of_cities = 11 } #Original 6+5
					}
				}
				AND = {
					tag = SAV
					owns_core_province = 103			# Piedmont
					senior_union_with = SAR
					SAR = {
						owns_core_province = 127		# Sardinia
						NOT = { num_of_cities = 7 } #Original 2 + 5
					}
				}
			}
		}
		effect = {
			if = {
				limit = {
					tag = SAV
				}
				inherit = SAR
			}
			if = {
				limit = {
					tag = SAR
				}
				inherit = SAV
			}
			if = {
				limit = {
					is_part_of_hre = yes
					is_elector = no
				}
				every_owned_province = {
					limit = {
						is_part_of_hre = yes
					}
					set_in_empire = no
				}
			}
			if = {
				limit = {
					NOT = {
						government_rank = 2
					}
				}
				set_government_rank = 2
			}
			change_tag = SPI
			set_capital = 103	# Piedmont
			add_prestige = 25
		}
		ai_will_do = {
			factor = 1
		}
	}

}
