scripted_diplomatic_actions = {
	cw_embargo = {
		icon = 25
		allowed = {		#The country making the diplomatic request
			always = yes
		}
		visible = {		#The target country
			NOT = { has_dlc = "By Blood Alone" }
			NOT = { ROOT = { is_puppet_of = PREV } }
			NOT = { is_puppet_of = ROOT }
			NOT = { ROOT = { is_puppet_of = FROM } }
			NOT = {
				is_in_array = {
					array = ROOT.embargoed_countries
					value = FROM.id
				}			
			}
		}
		selectable = {
			NOT = { is_puppet_of = ROOT }
			NOT = { is_in_faction_with = ROOT }
			NOT = { has_idea = closed_economy }
			hidden_trigger = {
				ROOT = { NOT = { has_country_flag = did_diplomatic_action } }		#Used to suspend request spam by AI
			}
		}
		can_be_accepted = {
			always = yes
		}
		can_be_sent = {
			always = yes
		}

		send_description = CW_EMBARGO_LOC
		accept_title = CW_EMBARGO_INITIATED_TITLE
		accept_description = CW_EMBARGO_INITIATED_DESC
		
		cost = 50

		requires_acceptance = no

		on_sent_effect = {
			if = {
				limit = {
					ROOT = { is_ai = yes }
				}
				ROOT = { set_country_flag = { flag = did_diplomatic_action_embargo value = 1 days = 45 } }
			}		
		}
		complete_effect = {
			cw_impose_embargo_diplomacy = yes
		}
		ai_desire = {
			base = 0
			modifier = {
				ROOT = { has_country_flag = did_diplomatic_action_embargo }
				add = -500
			}
			modifier = {
				is_major = yes
				add = -900
			}			
			modifier = {
				ROOT = { has_opinion = { target = PREV value < -50 } }
				add = 100
			}			
			modifier = {		#We dont trade with our enemies
				has_war_with = ROOT
				add = 1000
			}			
			modifier = {		#Retaliate with a counter embargo
				ROOT = { is_in_array = { array = FROM.embargoed_countries value = ROOT.id } }
				add = 100
			}
			modifier = {
				var:ROOT.faction_leader = {
					any_of_scopes = {
						array = THIS.embargoed_countries
						tag = FROM
					}
				}
				add = 50
			}
			modifier = {		#Under embargo of overlord so we embargo too
				var:ROOT.overlord = {
					PREV = {
						is_in_array = {
							array = PREV.embargoed_countries
							value = THIS.id
						}
					}
				}
				add = -1000
			}			
		}
	}
	cw_cancel_embargo = {
		icon = 25
		allowed = {		#The country making the diplomatic request
			always = yes
		}
		visible = {		#The target country
			is_in_array = {
				array = ROOT.embargoed_countries
				value = FROM.id
			}
		}
		selectable = {
			custom_trigger_tooltip = {
				tooltip = "CW_CHECK_IS_EMBARGOED_BY_US"
			}			
			hidden_trigger = {
				OR = {
					is_ai = no
					always = yes
					AND = {
						is_ai = yes
						NOT = {  ROOT = { has_opinion = { target = FROM value > 0 } } }
					}
				}
			}
		}
		can_be_accepted = {
			always = yes
		}
		can_be_sent = {
			always = yes
		}

		send_description = CW_CANCEL_EMBARGO_LOC
		accept_title = CW_CANCEL_EMBARGO_INITIATED_TITLE
		accept_description = CW_CANCEL_EMBARGO_INITIATED_DESC
		
		cost = 100

		requires_acceptance = no

		on_sent_effect = {
			if = {
				limit = {
					ROOT = { is_ai = yes }
				}
				ROOT = { set_country_flag = { flag = did_diplomatic_action value = 1 days = 45 } }
			}		
		}
		complete_effect = {
			cw_remove_embargo_diplomacy = yes
		}
		ai_desire = {
			modifier = {
				ROOT = {
					has_country_flag = did_diplomatic_action
				}
				add = -1000
			}		
			modifier = {
				ROOT = { has_opinion = { target = PREV value > 10 } }
				add = 100
			}
			modifier = {		#We dont trade with our enemies
				ROOT = { has_war_with = PREV }
				add = -1000
			}
			modifier = {		#Under embargo of overlord so we embargo too
				var:ROOT.overlord = {
					PREV = {
						is_in_array = {
							array = PREV.embargoed_countries
							value = THIS.id
						}
					}
				}
				add = -1000
			}
		}
	}
}