
# 要求改信（无回复事件）
bce_demand_conversion_vassal_ruler_interaction = {
	category = interaction_category_religion
	icon = religious
	notification_text = LIEGE_DEMAND_CONVERSION

	ai_maybe = yes
	ai_min_reply_days = 4
	ai_max_reply_days = 9
	can_send_despite_rejection = yes
	ai_accept_negotiation = yes
	popup_on_receive = yes

	hidden = yes

	desc = {
		desc = ask_for_conversion_interaction_desc
		desc = line_break
		triggered_desc = {
			trigger = {
				NOT = { scope:recipient = { is_imprisoned_by = scope:actor } }
			}
			desc = might_ask_for_something_in_return_warning
		}
		triggered_desc = {
			trigger = {
				scope:actor = {
					refusing_conversion_is_crime_trigger = {
						CHARACTER = scope:recipient
					}
				}
			}
			desc = demand_conversion_vassal_ruler_is_crime
		}
	}

	on_decline_summary = stop_attacker_vassal_war_decline_summary

	is_shown = {
		scope:recipient = {
			OR = {
				target_is_liege_or_above = scope:actor
				is_tributary_of = scope:actor
			}
			faith != scope:actor.faith
			is_ai = yes
			is_ruler = yes
		}
	}


	cooldown_against_recipient = { years = 15 }

	is_valid_showing_failures_only = {
		valid_demand_conversion_conditions_trigger = yes
		trigger_if = {
			limit = {
				scope:actor.domicile ?= {
					domicile_uses_culture_and_faith = yes
				}
				scope:recipient = {
					is_ruler = yes
					OR = {
						government_has_flag = government_is_nomadic
						government_has_flag = government_is_herder
					}
				}
			}
			custom_tooltip = {
				text = nomads_must_inspire_tt
				NOT = {
					scope:recipient = {
						OR = {
							government_has_flag = government_is_nomadic
							government_has_flag = government_is_herder
						}
					}
				}
			}
		}
	}

	auto_accept = {
		custom_description = {
			text = "spending_hook"
			subject = scope:actor
			object = scope:recipient
			scope:hook = yes
			scope:actor = { has_strong_hook = scope:recipient }
			NOT = { scope:recipient = { has_character_flag = ai_will_not_convert } }
		}
	}

	on_send = {
	}

	cost = {
		influence = {
			value = 0
			if = {
				limit = { scope:influence_send_option = yes }
				add = scope:actor.medium_influence_value
				desc = INFLUENCE_INTERACTION_ACCEPTANCE_SEND_OPTION
			}
		}
	}

	on_accept = {
		scope:actor = {
			trigger_event = bce_religious_interaction.2002
		}
		demand_conversion_vassal_ruler_interaction_effect = yes

		# If we're a clan this interaction affects unity
		accept_faith_conversion_add_clan_unity_effect = yes

		# If character is converting to the state faith, we add influence
		state_faith_conversion_add_piety_effect = yes

		scope:actor = {
			if = {
				limit = {
					any_character_struggle = {
						involvement = involved
						has_struggle_phase_parameter = piety_from_converting_involved_rulers
						is_secondary_character_involvement_involved_trigger = {
							CHAR = scope:recipient
						}
					}
				}
				add_piety = medium_piety_gain
			}
		}
	}

	on_decline = {
		scope:recipient = {
			scope:actor = {
				trigger_event = {
					id = bce_religious_interaction.2003
				}
			}
			custom_tooltip = demand_conversion_vassal_ruler_does_not_convert
			show_as_tooltip = {
				#Negative opinions
				add_opinion = {
					modifier = demanded_my_conversion_opinion
					target = scope:actor
					opinion = -10
				}
				scope:actor = {
					if = {
						limit = {
							refusing_conversion_is_crime_trigger = {
								CHARACTER = scope:recipient
							}
						}
						custom_tooltip = action_can_lawfully_imprison_label
					}
				}
				# If appropriate, give 'em piety.
				give_piety_for_clinging_to_state_faith_effect = yes
			}
		}

		# If we're a clan this interaction affects unity
		refuse_faith_conversion_add_clan_unity_effect = yes
	}

	# Use hook
	send_option = {
		is_valid = {
			scope:actor = {
				has_usable_hook = scope:recipient
			}
			NOT = {
				scope:recipient = { is_imprisoned_by = scope:actor }
			}
		}
		flag = hook
		localization = SCHEME_HOOK
	}
	should_use_extra_icon = {
		scope:actor = { has_usable_hook = scope:recipient }
	}
	extra_icon = "gfx/interface/icons/character_interactions/hook_icon.dds"

	send_option = { # EP3 Influence
		is_shown = { # Actor must have a government that uses influence
			scope:actor = {
				government_has_flag = government_has_influence
			}
		}
		is_valid = {
			# Actor has enough influence
			scope:actor = { influence >= medium_influence_value }
			# Both characters are within the same top realm
			custom_tooltip = {
				text = not_same_realm_tt
				scope:recipient.top_liege = scope:actor.top_liege
			}
		}
		flag = influence_send_option
		localization = TRADE_INFLUENCE_FOR_BETTER_AI_ACCEPTANCE
	}
	send_options_exclusive = no

	ai_will_do = 0
	ai_accept = {
		base = 0
		# Increase base chance
		modifier = {
			add = 50
			desc = EDUCATE_CHILD_ACTOR_IS_MY_LIEGE
		}
		religion_demand_conversion_default_modifier = yes

		modifier = {
			desc = might_ask_for_something_in_return_warning_line_break
			add = 0
		}
	}
}