﻿rtr_imprison_decline_effect = {
		if = {
			limit = { scope:hook = yes }
			scope:actor = { use_hook = scope:recipient }
		}
		illegal_imprisonment_dread_effect = yes
		imprison_court_chaplain_consequences_effect = yes
		imprison_HoF_consequences_effect = yes
		scope:recipient = {
			if = {
				limit = {
					is_a_faction_member = yes
					liege = scope:actor
				}
				joined_faction = { save_scope_as = retaliating_faction }
			}
		}
		imprison_character_effect = {
			TARGET = scope:recipient
			IMPRISONER = scope:actor
		}
		# If they recently revoked your title, or asked for your excommunication, they become your rival
		imprison_attempt_escalates_rivalry_effect = yes
		scope:actor = {
			trigger_event = char_interaction.0231
			if = {
				limit = {
					has_imprisonment_reason = scope:recipient
				}
				stress_impact = {
					compassionate = minor_stress_impact_gain
					forgiving = minor_stress_impact_gain
				}
			}
			else = {
				stress_impact = {
					just = medium_stress_impact_gain
					compassionate = medium_stress_impact_gain
				}
				if = {
					limit = { exists = scope:retaliating_faction}
					scope:retaliating_faction = {
						imprisonment_retribution_start_faction_war_if_valid = yes
					}
				}
			}
		}
		if = {
			limit = {
				scope:actor = { has_character_flag = flag_hostile_actions_disabled_delay }
			}
			scope:actor = { remove_character_flag = flag_hostile_actions_disabled_delay }
		}

		# If we're a clan this interaction affects unity
		if = { # If you don't have an imprisonment reason, and the target is landed, you lose more unity
			limit = {
				NOT = { scope:actor = { has_imprisonment_reason = scope:recipient } }
				scope:recipient = { is_landed_or_landless_administrative = yes }
			}
			add_clan_unity_interaction_effect = {
				CHARACTER = scope:actor
				TARGET = scope:recipient
				VALUE = major_unity_loss
				DESC = clan_unity_imprison.desc
				REVERSE_NON_HOUSE_TARGET = no
			}
		}
		else_if = { # If you don't have an imprisonment reason, and the target is unlanded, you lose slightly less unity
			limit = {
				NOT = { scope:actor = { has_imprisonment_reason = scope:recipient } }
				scope:recipient = { is_landed_or_landless_administrative = no }
			}
			add_clan_unity_interaction_effect = {
				CHARACTER = scope:actor
				TARGET = scope:recipient
				VALUE = medium_unity_loss
				DESC = clan_unity_imprison.desc
				REVERSE_NON_HOUSE_TARGET = no
			}
		}
		else = { # If you have a valid reason, you lose only a tiny bit of unity (criminal or not, they are still family)
			add_clan_unity_interaction_effect = {
				CHARACTER = scope:actor
				TARGET = scope:recipient
				VALUE = minor_unity_loss
				DESC = clan_unity_imprison.desc
				REVERSE_NON_HOUSE_TARGET = no
			}
		}

		# Harrying logic.
		scope:actor = {
			if = {
				limit = {
					character_is_valid_for_harrying_of_the_north_trigger = yes
					scope:recipient = {
						character_is_valid_for_harrying_of_the_north_trigger = yes
						is_important_or_vip_struggle_character = yes
					}
					culture != scope:recipient.culture
				}
				global_var:harrying_of_the_north = { save_scope_as = story }
				if = {
					limit = {
						character_is_valid_norman_for_harrying_of_the_north_trigger = yes
						scope:recipient = { character_is_valid_anglo_saxon_for_harrying_of_the_north_trigger = yes }
					}
					ep3_increase_pacification_effect = { AMOUNT = harrying_minor_increase_value }
				}
				else_if = {
					limit = {
						character_is_valid_anglo_saxon_for_harrying_of_the_north_trigger = yes
						scope:recipient = { character_is_valid_norman_for_harrying_of_the_north_trigger = yes }
					}
					ep3_increase_resistance_effect = { AMOUNT = harrying_minor_increase_value }
				}
			}
		}
		
}