control_scania = {
	
	type = country

	allow = {
		tag = SWE
		exists = DAN
		war_with = DAN
		DAN = { owns = 6 }
		is_lesser_in_union = no
		is_subject = no
	}
	abort = {
		or = {
			and = {
				DAN = { not = { owns = 6 } }		# Conquered by someone else
				not = { owns = 6 }
			}
			is_lesser_in_union = yes
			is_subject = yes
		}
	}
	success = {
		owns = 6
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 5
			year = 1658
		}
	}
	effect = {
		prestige = 0.05
	}
}

control_halland = {
	
	type = country

	allow = {
		tag = SWE
		exists = DAN
		war_with = DAN
		DAN = { owns = 26 }
		is_lesser_in_union = no
		is_subject = no
	}
	abort = {
		or = {
			and = {
				DAN = { not = { owns = 26 } }		# Conquered by someone else
				not = { owns = 26 }
			}
		}
		is_lesser_in_union = yes
		is_subject = yes
	}
	success = {
		owns = 26
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 5
			year = 1645
		}
	}
	effect = {
		prestige = 0.05
	}
}

control_estonia = {
	
	type = country

	allow = {
		tag = SWE
		not = { owns = 36 }
		not = { owns = 37 }
		is_subject = no
		is_lesser_in_union = no
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes	
		}
	}
	success = {
		owns = 36
		owns = 37
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 5
			year = 1561
		}
	}
	immediate = {
		add_temp_claim = 36
		add_temp_claim = 37
	}
	abort_effect = {
		remove_temp_claim = 36
		remove_temp_claim = 37
	}
	effect = {
		add_core = 36
		add_core = 37
	}
}

control_latvia = {
	
	type = country

	allow = {
		tag = SWE
		owns = 37
		not = { owns = 38 }
		not = { owns = 39 }
		is_subject = no
		is_lesser_in_union = no
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes		
		}
	}
	success = {
		owns = 38
		owns = 39
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
	}
	immediate = {
		add_temp_claim = 38
		add_temp_claim = 39
	}
	abort_effect = {
		remove_temp_claim = 38
		remove_temp_claim = 39
	}
	effect = {
		add_core = 38
		add_core = 39
	}
}

swedish_pommerania = {
	
	type = country

	allow = {
		tag = SWE
		owns = 6
		not = { owns = 47 }
		is_subject = no
		is_lesser_in_union = no
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes
		}
	}
	success = {
		owns = 47
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 5
			year = 1649
		}
	}
	immediate = {
		add_temp_claim = 47
	}
	abort_effect = {
		remove_temp_claim = 47
	}
	effect = {
		prestige = 0.1
		add_core = 47
	}
}

control_gotland = {
	
	type = country

	allow = {
		tag = SWE
		not = { owns = 25 }
		25 = { owner = { alliance_with = this } }
		is_subject = no
		is_lesser_in_union = no
	}
	abort = {
		or = {
			is_lesser_in_union = yes
			is_subject = yes		
		}
	}
	success = {
		owns = 25
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 5
			year = 1645
		}
	}
	immediate = {
		add_temp_claim = 25
	}
	abort_effect = {
		remove_temp_claim = 25
	}
	effect = {
		prestige = 0.05
		add_core = 25
	}
}

vassalize_norway_swe = {
	
	type = country

	allow = {
		tag = SWE
		exists = NOR
		is_subject = no
		is_lesser_in_union = no
		NOR = {
			neighbour = this
			not = { vassal_of = SWE }
			not = { num_of_cities = this }
			is_lesser_in_union = no
			owns = 17
			is_subject = no
		}
	}
	abort = {
		or = {
			not = { exists = NOR }
			NOR = { is_lesser_in_union = yes }
			is_lesser_in_union = yes
			is_subject = yes			
		}
	}
	success = {
		NOR = { vassal_of = SWE }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = NOR value = 0 } }
		}
	}
	immediate = {
		casus_belli = {
			type = cb_vassalize_mission
			months = 120
			target = NOR
		}
	}
	abort_effect = {
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = NOR
		}
	}
	effect = {
		army_tradition = 0.2
		infamy = -2
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = NOR
		}
	}
}

annex_norway_swe = {
	
	type = country

	allow = {
		tag = SWE
		is_subject = no
		is_lesser_in_union = no
		exists = NOR
		NOR = {
			religion_group = this
			vassal_of = SWE
			neighbour = this
			not = { num_of_cities = this }
			owns = 17		# Oslo, Akershus
		}
	}
	abort = {
		or = {
			not = { exists = NOR }
			is_lesser_in_union = yes
			is_subject = yes
			NOR = { not = { religion_group = this } }
		}
	}
	success = {
		not = { exists = NOR }
		owns = 17
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			relation = { who = NOR value = 100 }
		}
		modifier = {
			factor = 2
			relation = { who = NOR value = 200 }
		}
	}
	immediate = {
		add_temp_claim = 17
	}
	abort_effect = {
		remove_temp_claim = 17
	}
	effect = {
		stability = 3
	}
}

no_territory_to_denmark = {

	type = country
	
	allow = {
		tag = SWE
		exists = DAN
		war_with = DAN
		sweden = { owned_by = DAN }
	}
	abort = {
		not = { war_with = DAN }
	}
	success = {
		not = { war_with = DAN }
		not = { sweden = { owned_by = DAN } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}	
	}
	effect = {
		stability = 2
		war_exhaustion = -5
	}
}

reconquer_finland = {

	type = country
	
	allow = {
		tag = SWE
		is_subject = no
		is_lesser_in_union = no
		or = {
			exists = MOS
			exists = RUS
		}
		or = {
			war_with = MOS
			war_with = RUS
		}
		or = {
			MOS = {
				or = {
					controls = 19
					controls = 27
					controls = 28
					controls = 29
					controls = 30
					controls = 31
					controls = 32
				}
			}
			RUS = {
				or = {
					controls = 19
					controls = 27
					controls = 28
					controls = 29
					controls = 30
					controls = 31
					controls = 32			
				}
			}
			finland = { owned_by = MOS }
			finland = { owned_by = RUS }
		}
	}
	abort = {
		or = {
			and = {
				not = { war_with = MOS }
				not = { war_with = RUS }
			}
			is_lesser_in_union = yes
			is_subject = yes	
		}
	}
	success = {
		not = { war_with = MOS }
		not = { war_with = RUS }
		not = { finland = { owned_by = MOS } }
		not = { finland = { owned_by = RUS } }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}	
	}
	effect = {
		stability = 2
		infamy = -10
	}
}

swedish_control_of_cot = {
	
	type = country

	allow = {
		tag = SWE
		not = { num_of_cots = 1 }
		treasury = 250
	}
	abort = {}
	success = {
		num_of_cots = 1
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			idea = national_trade_policy
		}	
	}
	effect = {
		merchants = 5
		treasury = 50
	}
}

swedish_colony_in_north_america = {
	
	type = country

	allow = {
		tag = SWE
		year = 1600
		eastern_north_america = {
			has_discovered = this
			empty = yes
		}
		not = {
			eastern_north_america = {
				owned_by = this
			}
		}
		colonists = 1
	}
	abort = {
		not = { eastern_north_america = { empty = yes }	}
		not = { eastern_north_america = { owned_by = this }	}
	}
	success = {
		eastern_north_america = { owned_by = this }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			idea = land_of_opportunity
		}
		modifier = {
			factor = 2
			idea = colonial_ventures
		}
	}
	effect = {
		prestige = 0.1
		colonists = 2
	}
}

fortify_the_eastern_border = {
	
	type = country

	allow = {
		tag = SWE
		land_tech = 16
		owns = 30
		owns = 31
		30 = {
			has_building = fort1
			not = { has_building = fort2 }
		}
		31 = {
			has_building = fort1
			not = { has_building = fort2 }
		}
		or = {
			MOS = { neighbour = this }
			RUS = { neighbour = this }
		}
	}
	abort = {
		MOS = { not = { neighbour = this } }
		RUS = { not = { neighbour = this } }
	}
	success = {
		30 = { has_building = fort2 }
		31 = { has_building = fort2 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = RUS value = 0 } }
		}
	}
	effect = {
		army_tradition = 0.4
		stability = 1
	}
}

colonize_lapland = {
	
	type = country

	allow = {
		tag = SWE
		18 = { empty = yes }
	}
	abort = {
		18 = { empty = no }
		not = { owns = 18 }
	}
	success = {
		owns = 18
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			colonists = 1
		}
		modifier = {
			factor = 5
			year = 1640
		}
	}
	effect = {
		add_core = 18
	}
}

# Tåget över Bält
control_jylland = {

	type = country
	
	allow = {
		tag = SWE
		exists = DAN
		war_with = DAN
		not = { denmark = { owned_by = this } }
		not = { controls = 15 }
	}
	abort = {
		not = { war_with = DAN }
	}
	success = {
		controls = 15
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}	
	}
	effect = {
		infamy = -1
		army_tradition = 0.1
	}
}
