﻿# "Appeal to the Old Blood" — the Sasanian petitions a living Iranic/Caucasian house head.
he_petition_house_interaction = {
	category = interaction_category_diplomacy
	icon = alliance
	desc = he_petition_house_interaction_desc
	use_diplomatic_range = no

	# Available once the Sasanian is a landed ruler in the Iranian lands.
	is_shown = {
		scope:actor = {
			he_is_sasanian_trigger = yes
			is_landed = yes
			he_in_persia_region_trigger = yes
		}
		scope:recipient != scope:actor
		scope:recipient = { he_is_petitionable_house_head_trigger = yes }
	}
	is_valid_showing_failures_only = {
		scope:recipient = { is_alive = yes }
	}

	on_accept = {
		hidden_effect = { he_house_accept_effect = yes }
		scope:actor = { trigger_event = he_reconquest.0011 }
	}
	on_decline = {
		# a devout Muslim house refuses hard (and exposes you); others merely decline for now
		if = {
			limit = { scope:recipient = { faith = { religion_tag = islam_religion } } }
			hidden_effect = { he_house_hard_reject_effect = yes }
			scope:actor = { trigger_event = he_reconquest.0013 }
		}
		else = {
			hidden_effect = { he_house_soft_reject_effect = yes }
			scope:actor = { trigger_event = he_reconquest.0012 }
		}
	}

	# The sympathy score, inline. >= 0 : the house accepts.
	ai_accept = {
		base = -10
		modifier = { add = 50  desc = he_ai_open_zoroastrian_tt  scope:recipient = { faith = faith:mazdayasna } }
		modifier = {
			add = 40  desc = he_ai_zoroastrian_tt
			scope:recipient = { faith = { religion_tag = zoroastrianism_religion } NOT = { faith = faith:mazdayasna } }
		}
		modifier = { add = 12  desc = he_ai_christian_tt  scope:recipient = { faith = { religion_tag = christianity_religion } } }
		modifier = { add = -25 desc = he_ai_muslim_tt     scope:recipient = { faith = { religion_tag = islam_religion } } }
		modifier = { add = 15  desc = he_ai_heritage_tt   scope:recipient = { culture = { has_cultural_pillar = heritage_iranian } } }
		modifier = { add = 20  desc = he_ai_holds_persia_tt scope:actor = { has_title = title:k_persia } }
		modifier = { add = 10  desc = he_ai_is_king_tt     scope:actor = { highest_held_title_tier >= tier_kingdom } }
		modifier = { add = 6   desc = he_ai_at_war_tt      scope:actor = { any_character_war = { count >= 1 } } }
	}
	ai_will_do = { base = 0 }
}
