﻿
###### intimidate SCHEME
start_intimidate_interaction = {
	icon = icon_intimidate  #ICON
	common_interaction = yes
	interface_priority = 10
	category = interaction_category_hostile

	ignores_pending_interaction_block = yes

	scheme = intimidate_scheme

	send_name = START_SCHEME

	is_shown = {
		scope:actor = {is_adult = yes}
		NOT = { scope:recipient = scope:actor }
		has_game_rule = cki_rule_intimidate_active
	}

	is_valid_showing_failures_only = {
		scope:actor = {
			can_start_scheme = {
				type = intimidate_scheme
				target_character = scope:recipient
			}
			OR = {
				prowess >= 10
				dread >= 20
			}
			NOR = {
				has_trait = incapable
				has_trait = weak
				has_trait = wounded_2
				has_trait = wounded_3
			}
		}
		scope:recipient = { 
			NOT = { 
				has_strong_hook = scope:actor 
				OR = {
					has_opinion_modifier = {target = scope:actor modifier = intimidate_scheme_failure_opinion}
					has_opinion_modifier = {target = scope:actor modifier = intimidate_scheme_success_opinion}
				}
			} 
		}
		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 = {
		triggered_desc = {
			trigger = {
				scope:actor = {
					can_start_scheme = {
						type = intimidate_scheme
						target_character = scope:recipient
					}
				}
			}
			desc = scheme_interaction_tt_intimidate_approved
		}
	}

	# Scheme Starter Packages
	options_heading = schemes.t.agent_packages
	send_options_exclusive = yes
	## Balanced agents.
	

	on_accept = {
		scope:actor = {
			stress_impact = {
				compassionate = major_stress_impact_gain
				honest = medium_stress_impact_gain
				just = medium_stress_impact_gain
				craven = major_stress_impact_gain
				arrogant = medium_stress_impact_loss
			}
		}
		scope:actor = {
			send_interface_toast = {
				type = event_toast_effect_neutral
				title = start_intimidate_interaction_notification

				left_icon = scope:actor					
				right_icon = scope:recipient
				# Balanced.
					begin_scheme_with_agents_effect = {
						SCHEME_TYPE = intimidate_scheme
						TARGET_TYPE = target_character
						TARGET_SCOPE = scope:recipient
						# Success.
						AGENT_1 = agent_muscle
						AGENT_2 = agent_thug
						AGENT_3 = agent_poet
						# Speed.
						AGENT_4 = agent_socialite
						AGENT_5 = agent_herald
					}
				
			}
		}
	}
	
	auto_accept = yes
	ai_targets = { 
		ai_recipients = neighboring_rulers
		ai_recipients = liege
		ai_recipients = vassals
		ai_recipients = peer_vassals

	}
	ai_frequency = 60

	ai_potential = {
		is_ruler = yes
		is_adult = yes
	}

	ai_will_do = {
		# They shouldn't always do this.
		base = -0

		# Obvious factor.
		opinion_modifier = {
			opinion_target = scope:recipient
			multiplier = -2
		}
		ai_value_modifier = { ai_honor = -1 }
		# Prowess
		modifier = {
			add = scope:actor.prowess
			multiplier = 2
		}
		# Traits.
		## Disloyal.
		modifier = {
			add = 30
			has_trait = disloyal
		}
		## Ambitious.
		modifier = {
			add = 20
			has_trait = ambitious
		}
		## Arrogant.
		modifier = {
			add = 35
			has_trait = arrogant
		}
		## Callous.
		modifier = {
			add = 25
			has_trait = callous
		}
		## Compassionate.
		modifier = {
			add = -50
			has_trait = compassionate
		}
		## Humble
		modifier = {
			add = -75
			has_trait = fickle
		}
		## Content.
		modifier = {
			add = -100
			has_trait = content
		}
		## Infertile
		modifier = {
			add = 20
			has_trait = infertile
		}
	}
}

