scripted_diplomatic_actions = {
	eoanbdiplo_designate_rival_action = {
		allowed = {}
		
		selectable = {
			ROOT = {
				NOT = { has_country_flag = eoanb_diplo_designate_rival_recent }
				has_war = no
			}
			NOT = { is_ally_with = ROOT }
			OR = {
				ROOT = {
					has_opinion = {
						target = PREV
						value < 50
					}
				}
				custom_trigger_tooltip = {
					tooltip = eoanbdiplo_has_rivaled_us_tt
					check_variable = { rival_country = ROOT.id }
				}
			}
		}
		
		visible = {
			NOT = { check_variable = { ROOT.rival_country = THIS.id } }
		}
		
		cost = 50
		icon = 3
		requires_acceptance = no
		show_acceptance_on_action_button = no
		
		complete_effect = {
			ROOT = {
				set_variable = { rival_country = FROM.id }
				set_country_flag = {
					flag = eoanb_diplo_designate_rival_recent
					days = 730
				}
				if = {
					limit = { NOT = { has_idea = generic_rival_modifier } }
					add_ideas = generic_rival_modifier
				}
			}
		}
		
		can_be_accepted = { always = no }
		send_description = eoanbdiplo_rival_action_target_sent
		receive_description = eoanbdiplo_rival_action_target_recieved
		
		ai_desire = {
			base = 0
		}
	}
	
	eoanbdiplo_remove_rival_action = {
		allowed = {}
		
		visible = {
			check_variable = { ROOT.rival_country = THIS.id }
		}
		
		cost = 5
		icon = 3
		requires_acceptance = no
		show_acceptance_on_action_button = no
		
		complete_effect = {
			ROOT = {
				if = {
					limit = {
						OR = {
							has_idea = generic_rival_modifier
							has_idea = eoanbdiplomacy_rival_war
						}
					}
					remove_ideas_with_trait = generic_rival_modifier
					remove_ideas_with_trait = eoanbdiplomacy_rival_war
				}
				clear_variable = rival_country
			}
		}
		
		can_be_accepted = { always = no }
		send_description = eoanbdiplo_clear_rival_action_target_sent
		receive_description = eoanbdiplo_clear_rival_action_target_recieved
		
		ai_desire = {
			base = 0
		}
	}
}