#Adjacency rules are special rules for adjacencies
#If smbd who is at war fights over canal/strait it is considered closed
#Enemy status is considered if any of sides controlling the chanel is at war with country
#Friend status is considered non of sides controlling the chanel is at war with country and one of controllers is ally of giving military access
#Every one else is considered as neutral according to canal/strait
#Military access considered as being friend
#Rules needs linking from the straits that are affected by the rule ( adjacency_rule_id )

#Name is how you refer to the rule in adjecencies.csv

#Suez Canal
adjacency_rule = {
	name = "SUEZ_CANAL"

	contested =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	
	required_provinces = { 12049 1155 4073 9947 }

	is_disabled = {
		#Add a flag and a yearly event checking opinion of owner here later, if opinion > 0, let ROOT pass, otherwise not
		OR = {
			has_global_flag = SUEZ_CANAL_BLOCKED
			has_country_flag = SUEZ_CANAL_BLOCKED_FOR_COUNTRY
			NOT = { has_global_flag = SUEZ_CANAL_BUILT }
		}
		tooltip = disable_suez_canal_tt
	}
		
	icon = 12049
	offset = { 1 0 -6 }
}

#nicaragua canal, historicaly never completed but both could have been, and will may be in the future
adjacency_rule = {
	name = "NICARAGUA_CANAL"

	contested =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	
	required_provinces = { 1988 12738 13722 }

	is_disabled = {
		#Add a flag and a yearly event checking opinion of owner here later, if opinion > 0, let ROOT pass, otherwise not
		OR = {
			has_global_flag = NICARAGUA_CANAL_BLOCKED
			has_country_flag = NICARAGUA_CANAL_BLOCKED_FOR_COUNTRY
			NOT = { has_global_flag = NICARAGUA_CANAL_BUILT }
		}
		tooltip = disable_nicaragua_canal_tt
	}
		
	icon = 13139
	offset = { 1 0 -6 }
}

#Gibraltar Strait
adjacency_rule = {
	name = "GIBRALTAR_STRAIT"

	contested =
	{
		army = no
		navy = no
		submarine = yes
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = yes
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	
	required_provinces = { 4135 13720 }
	
	icon = 5407	
	offset = { -31.0 0.0 -2.0 }
}

#Øresund - (Østersøen <-> Kattegat/Skagerak/Nordsøen)
adjacency_rule = {
	name = "DANISH_BELTS_STRAIT"

	contested =
	{
		army = no
		navy = no
		submarine = yes
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	
	required_provinces = { 6287 3277 3325 3260 }
	
	icon = 2382
	offset = { -15 0 22 }
}

#Panama Canal
adjacency_rule = {
	name = "PANAMA_CANAL"

	contested =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = no
		navy = no
		submarine = no
		trade = yes
	}
	
	required_provinces = { 4624 7617 }

	is_disabled = {
		OR = {
			has_global_flag = PANAMA_CANAL_BLOCKED
			has_country_flag = PANAMA_CANAL_BLOCKED_FOR_COUNTRY
			NOT = { has_global_flag = PANAMA_CANAL_BUILT }
		}
		tooltip = disable_panama_canal_tt
	}
		
	icon = 7617
	offset = { -3 0 -2 }
}

#Turkish Straits
adjacency_rule = {
	name = "BOSPHORUS_STRAIT"

	contested =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = no
		navy = no
		submarine = no
		trade = yes
	}
	
	required_provinces = { 9833 11829 }
	
	icon = 9833
	offset = { -2 0 -9 }
}

#Kiel Canal
adjacency_rule = {
	name = "KIEL_CANAL"

	contested =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	enemy =
	{
		army = no
		navy = no
		submarine = no
		trade = no
	}
	friend =
	{
		army = yes
		navy = yes
		submarine = yes
		trade = yes
	}
	neutral =
	{
		army = no
		navy = no
		submarine = no
		trade = yes
	}
	
	required_provinces = { 6389 317 3231 3368 }
	
	is_disabled = {
		OR = {
			has_global_flag = KIEL_CANAL_BLOCKED
			has_country_flag = KIEL_CANAL_BLOCKED_FOR_COUNTRY
			NOT = { has_global_flag = KIEL_CANAL_BUILT }
		}
		tooltip = disable_kiel_canal_tt
	}
		
	icon = 6389
	offset = { 5 0 -6 }
}

#Bridge across Bosphorus
#BOSPHORUS_BRIDGE = {
#	is_disabled = {
#		NOT = { has_global_flag = BOSPHORUS_BRIDGE_BUILT }
#		tooltip = disable_bosphorus_bridge_tt
#	}
#}