﻿interactive_help_house_member_interaction = {
	common_interaction = yes
	interface_priority = 67
	category = interaction_category_diplomacy
	interface = interfere_in_war
	special_interaction = interfere_in_war_interaction
	popup_on_receive = yes
	desc = interactive_help_house_member_interaction_desc
	icon = alliance
	greeting = positive
	notification_text = join_war_interaction_notification
	is_shown = {
		NOT = {
			has_game_rule = help_house_member_miv_disabled
		}
		scope:recipient = {
			is_at_war = yes
			house = scope:actor.house
			NOR = {
				this = scope:actor
				is_at_war_with = scope:actor
			}
			any_character_war = {
				is_war_leader = prev
			}
			is_ai = yes
		}
	}
	can_be_picked = {
		exists = scope:target
		scope:target = {
			# recipient is war leader
			is_war_leader = scope:recipient
		}
	}
	on_accept = {
		scope:target ?= {
			hidden_effect = {
				set_called_to = scope:actor
			}
			if = {
				limit = {
					is_attacker = scope:recipient
				}
				add_attacker = scope:actor
				scope:target.casus_belli.primary_defender = {
					add_opinion = {
						modifier = angry_opinion
						target = scope:actor
						opinion = -25
					}
				}
				if = {
					limit = {
						OR = {
							scope:actor = {
								any_home_court_hostage = {
									warden ?= {
										is_defender_in_war = scope:target
									}
								}
							}
							scope:target = {
								any_war_defender = {
									any_warden_hostage = {
										home_court ?= scope:actor
									}
								}
							}
						}
					}
					custom_tooltip = hostage_execution_warning_tt
				}
			}
			else = {
				add_defender = scope:actor
				scope:target.casus_belli.primary_attacker = {
					add_opinion = {
						modifier = angry_opinion
						target = scope:actor
						opinion = -25
					}
				}
				if = {
					limit = {
						OR = {
							scope:actor = {
								any_home_court_hostage = {
									warden ?= {
										is_attacker_in_war = scope:target
									}
								}
							}
							scope:target = {
								any_war_attacker = {
									any_warden_hostage = {
										home_court ?= scope:actor
									}
								}
							}
						}
					}
					custom_tooltip = hostage_execution_warning_tt
				}
			}
		}
		scope:recipient = {
			add_opinion = {
				modifier = grateful_opinion
				target = scope:actor
				opinion = 10
			}
		}
	}
	on_decline = {
		scope:actor = {
			trigger_event = char_interaction.0236
		}
	}
	auto_accept = yes
	ai_accept = {
		base = 100		# everyone wants help
	}
}
