# Variables:
#  is_listed, boolean, decides if this diplomactic action type is listed in diplomatic view.
#  prerequisites, list, the technologies required to enable the player to send this diplomatic action.
#  requires_actor_peace, boolean, false by default, will require the actor to be at peace for this action to pass the possible check.
#  requires_alliance_vote, boolean, false by default, will require the alliance of the actor to vote for this action before passing it on to the recipient.
#  requires_actor_independence, boolean, true by default, will require the actor to be independent.
#  requires_recipient_independence, boolean, true by default, will require the recipient to be independent.
#  requires_actor_federation_leader, boolean, false by default, if the actor is in a federation, he has to be the leader of it.
#  requires_recipient_federation_leader, boolean, true by default, if the recipient is in a federation, he has to be the leader of it.
#  show_decline_to_alliance_members, boolean, false by default, will show your alliance members when you decline a proposal of this type.
#  should_show_accept_message, decides whether actor gets a response on acceptance (otherwise just on decline)
#  should_show_auto_accept_message_recipient, boolean, decides if the recipient gets a message showing the diplomatic action.
#  should_open_auto_accept_message_recipient, boolean, decides if the recipient automatically opens this message.
#  should_show_auto_accept_message_actor, boolean, decides if the actor gets a reply showing the diplomatic action.
#  should_notify_all_communications, boolean, decides if a message notification is sent to all countries who have communications with actor or recipient
#  AI_acceptance_base_value, default = 0
#  potential, trigger, root is actor, from is recipient, decides if the action is shown
#  possible, trigger, root is actor, from is recipient, decides if the action is still possible
#  proposable, trigger, root is actor, from is recipient, decides if the action is proposable


# Send an insult. Harms relations.
action_insult = {
	icon = "GFX_diplomacy_status_war"
	requires_recipient_independence = no
	requires_actor_independence = no
	auto_accepted = yes
	should_show_auto_accept_message_recipient = yes
	action_type = aggressive

	potential = {
		hidden_trigger = {
			from = {
				NOT = { is_country_type = mirrored_country }
			}
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_poor_or_worse_opinion"

			OR = {
				opinion_level = { who = from level <= poor }
				is_fallen_empire = yes
				from = { is_fallen_empire = yes }
				is_harming_relations_with = from
				from = { is_at_war_with = prev }
			}
		}

		custom_tooltip = {
			fail_text = "the_fe_is_busy_with_synth_queen"
			OR = {
				from = { is_fallen_empire = no }
				AND = {
					NOT = { has_global_flag = synth_queen_happened }
					from = {
						is_fallen_empire = yes
					}
				}
			}
		}
	}

	on_accept = {
		from = {
			add_trust = {
				amount = -5
				who = root
			}
		}
		if = {
			limit = {
				has_technology = tech_satisfying_insults
				NOT = { has_modifier = satisfying_insult_recently }
			}
			add_modifier = {
				modifier = satisfying_insult_recently
				years = 5
			}
			add_resource = { influence = 50}
			country_event = { id = fircon.20 days = 1800 }
			#### DPE
			set_timed_relation_flag = { flag = dpe_insult who = from days = 3 }
			from = { country_event = { id = dpe_hw_duel.1 } }
		}
	}
}
