control_osel = {
	
	type = country

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

colonize_iceland = {
	
	type = country

	allow = {
		tag = DAN
		370 = { empty = yes }
		371 = { empty = yes }
		colonists = 1
		num_of_ports = 1
	}
	abort = {
		or = {
			not = { num_of_ports = 1 }
			and = {
				370 = { empty = no }
				371 = { empty = no }
				not = { owns = 370 }
				not = { owns = 371 }
			}
		}
	}
	success = {
		owns = 370
		owns = 371
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			adm = 7
		}
	}
	effect = {
		add_core = 370
		add_core = 371
	}
}

retake_scania = {
	
	type = country

	allow = {
		tag = DAN
		exists = SWE
		war_with = SWE
		SWE = { owns = 6 }
	}
	abort = {
		SWE = { not = { owns = 6 } }		# Conquered by someone else
		not = { owns = 6 }
	}
	success = {
		owns = 6
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 2
			is_monarch_leader = yes
		}
	}
	effect = {
		prestige = 0.05
	}
}

retake_halland = {
	
	type = country

	allow = {
		tag = DAN
		exists = SWE
		war_with = SWE
		SWE = { owns = 26 }
	}
	abort = {
		SWE = { not = { owns = 26 } }		# Conquered by someone else
		not = { owns = 26 }
	}
	success = {
		owns = 6
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 2
			is_monarch_leader = yes
		}
	}
	effect = {
		prestige = 0.05
	}
}

denmark_slesvig_holstein_relations = {
	
	type = country

	allow = {
		tag = DAN
		exists = SHL
		government = monarchy
		not = { war_with = SHL }
		not = { marriage_with = SHL }
		is_lesser_in_union = no
		is_subject = no
		SHL = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = SHL
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			SHL = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = SHL
		relation = { who = SHL value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = SHL value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = SHL value = -100 } }
		}
	}
	effect = {
		stability = 1
	}
}

denmark_oldenburg_relations = {
	
	type = country

	allow = {
		tag = DAN
		exists = OLD
		government = monarchy
		not = { war_with = OLD }
		not = { marriage_with = OLD }
		is_lesser_in_union = no
		is_subject = no
		OLD = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = OLD
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			OLD = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = OLD
		relation = { who = OLD value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = OLD value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = OLD value = -100 } }
		}
	}
	effect = {
		stability = 1
	}
}

vassalize_norway = {
	
	type = country

	allow = {
		tag = DAN
		exists = NOR
		is_subject = no
		is_lesser_in_union = no
		NOR	= {
			neighbour = this
			not = { vassal_of = DAN }
			not = { num_of_cities = this }
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			not = { exists = NOR }
			NOR = { is_lesser_in_union = yes }
			is_subject = yes
			is_lesser_in_union = yes
		}
	}
	success = {
		NOR = { vassal_of = DAN }
	}
	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 = {
		prestige = 0.1
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = NOR
		}
	}
}

annex_norway = {
	
	type = country

	allow = {
		tag = DAN
		is_subject = no
		is_lesser_in_union = no
		exists = NOR
		NOR = {
			vassal_of = DAN
			neighbour = this
			religion_group = this
			not = { num_of_cities = this }
			owns = 17		# Oslo, Akershus
		}
	}
	abort = {
		or = {
			not = { exists = NOR }
			NOR = { not = { religion_group = this } }
			is_subject = yes
			is_lesser_in_union = yes	
		}
	}
	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
		army_tradition = 0.1
	}
}

defend_denmark = {

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

danish_controlled_cot = {
	
	type = country

	allow = {
		tag = DAN
		not = { any_owned_province = { cot = yes } }
	}
	abort = {}
	success = {
		any_owned_province = { cot = yes }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			idea = national_trade_policy
		}	
	}
	effect = {
		merchants = 5
		treasury = 50
	}
}
