﻿raid_supply_interaction = {
	icon = icon_raid_supply
	category = interaction_category_hostile
	common_interaction = yes

	send_name = START_SCHEME

	interface_priority = 10
	scheme = raid_supply
	ignores_pending_interaction_block = yes

	ai_targets = {
		ai_recipients = war_enemies
		max = 5
	}
	ai_frequency = 12

	is_shown = {
		scope:actor = {is_adult = yes}
		scope:actor = {
			is_ruler = yes
		}
		NOT = { scope:actor = scope:recipient }
		NOT = { scope:recipient = {is_courtier_of = scope:actor} }
		scope:actor = {is_at_war_with = scope:recipient}
		has_game_rule = cki_rule_warfare_active
	}
	

	is_valid_showing_failures_only = {
		scope:actor = {
			can_start_scheme = {
				type = raid_supply
				target_character = scope:recipient
			}
		}
		scope:actor = {is_at_war_with = scope:recipient}
		scope:recipient = {is_ruler=yes}
		#limit range for landless adventurers
		trigger_if = {
			limit = {
				scope:actor = {
					is_landless_adventurer = yes
				}
			}
			#Has to be used instead of diplo range checks in laamp to landed interactions
			ep3_laamp_diplo_range_trigger = {
				TARGET = scope:recipient
				LAAMP = scope:actor
			}
		}
	}

	desc = scheme_interaction_tt_raid_supply_approved

	on_accept = {
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = convert_interaction_notification

				left_icon = scope:actor					
				right_icon = scope:recipient

				begin_scheme_basic_effect = {
					SCHEME_TYPE = raid_supply
					TARGET_TYPE = target_character
					TARGET_SCOPE = scope:recipient
				}
			}
			stress_impact = {
				zealous = medium_stress_impact_loss
				honest = medium_stress_impact_gain
				cynical = medium_stress_impact_gain
			}
		}
	}
	
	ai_potential = {
		primary_title.tier >= tier_county
		is_at_war = yes
		NOR = {
			has_trait = lazy
			primary_title = {
				is_mercenary_company = yes
			}
		}
	}
	
	auto_accept = yes
	
	ai_will_do = {
		base = 50
		# Opinion
		opinion_modifier = {
			opinion_target = scope:recipient
			multiplier = -1
		}
		# Intrigue
		modifier = {
			add = scope:actor.intrigue
			multiplier = 2
		}
		# Martial
		modifier = {
			add = scope:actor.martial
		}
	}
}
