
# 批量要求改信——无回复事件
bce_mod_mass_convert_subjects_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_personal_religious.dds"
	}
	desc = {
        first_valid = {
            triggered_desc = {
                trigger = {
                    has_global_variable = bce_no_send_interface
                }
                desc = bce_mod_mass_convert_subjects_decision_no_desc
            }
            desc = bce_mod_mass_convert_subjects_decision_yes_desc
        }
    }
	decision_group_type = admin
	is_shown = {
		OR = {
			any_vassal = {
				NOT = { vassal_contract_has_flag = religiously_protected }
				root = {
					is_character_interaction_potentially_accepted = {
						recipient = prev
						interaction = bce_demand_conversion_vassal_ruler_interaction
					}
				}
			}
			any_vassal_or_below = {
				NOT = { vassal_contract_has_flag = religiously_protected }
				exists = liege
				NOT = {
					liege = root # filter for indirect vassals, so ones we are not the liege of
				}
				root = {
					is_character_interaction_potentially_accepted = {
						recipient = prev
						interaction = bce_demand_conversion_vassal_ruler_interaction
					}
				}
			}
			any_tributary = {
				root = {
					is_character_interaction_potentially_accepted = {
						recipient = prev
						interaction = bce_demand_conversion_vassal_ruler_interaction
					}
				}
			}
			any_courtier = {
				root = {
					is_character_interaction_potentially_accepted = {
						recipient = prev
						interaction = ask_for_conversion_courtier_interaction
					}
				}
			}
			AND = {
				exists = house
				house = {
					any_house_member = {
						root = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = demand_conversion_interaction
							}
						}
					}
				}
			}
		}
	}

	widget = {
		gui = "decision_view_widget_decision_option_list_controller"
		controller = decision_option_list_controller

		item = {
			value = mod_convert_direct_vassals
			localization = mod_convert_direct_vassals_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = mod_convert_indirect_vassals
			localization = mod_convert_indirect_vassals_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = mod_convert_tributaries
			localization = mod_convert_tributaries_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = mod_convert_courtiers
			localization = mod_convert_courtiers_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = mod_convert_house
			localization = mod_convert_house_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = bce_all_send_interfece
			localization = bce_all_send_interfece_loc
			ai_chance = { value = 0 } # unused
		}
		item = {
			value = bce_whether_send_interfece
			localization = bce_whether_send_interfece_loc
			ai_chance = { value = 0 } # unused
		}


	}


	effect = {

		if = {
			limit = {
				or = {
					scope:mod_convert_direct_vassals = yes
					scope:bce_all_send_interfece = yes
				}
			}
			every_vassal = {
				# direct vassals
				limit = { NOT = { vassal_contract_has_flag = religiously_protected } }
				if = {
					limit = {
						root = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = bce_demand_conversion_vassal_ruler_interaction
							}
						}
					}
					run_interaction = {
						interaction = bce_demand_conversion_vassal_ruler_interaction
						actor = root
						recipient = this
						# execute_threshold = decline # does what is written in on_accept, so everyone would accept this way
						send_threshold = decline # send the request and then AI will decide like normal
					}
				}
			}
		}
		if = {
			limit = {
				or = {
					scope:mod_convert_indirect_vassals = yes
					scope:bce_all_send_interfece = yes
				}
			}
			every_vassal_or_below = {
				# all vassals
				limit = { NOT = { vassal_contract_has_flag = religiously_protected } }
				if = {
					limit = {
						exists = liege
						NOT = {
							liege = root # filter for indirect vassals, so ones we are not the liege of
						}
						root = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = bce_demand_conversion_vassal_ruler_interaction
							}
						}
					}
					run_interaction = {
						interaction = bce_demand_conversion_vassal_ruler_interaction
						actor = root
						recipient = this
						send_threshold = decline # send the request and then AI will decide like normal
					}
				}
			}
		}
		if = {
			limit = {
				or = {
					scope:mod_convert_tributaries = yes
					scope:bce_all_send_interfece = yes
				}
			}
			every_tributary = {
				if = {
					limit = {
						root = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = bce_demand_conversion_vassal_ruler_interaction
							}
						}
					}
					run_interaction = {
						interaction = bce_demand_conversion_vassal_ruler_interaction
						actor = root
						recipient = this
						send_threshold = decline # send the request and then AI will decide like normal
					}
				}
			}
		}
		if = {
			limit = {
				or = {
					scope:mod_convert_courtiers = yes
					scope:bce_all_send_interfece = yes
				}
			}
			every_courtier = {
				if = {
					limit = {
						root = {
							is_character_interaction_potentially_accepted = {
								recipient = prev
								interaction = ask_for_conversion_courtier_interaction
							}
						}
					}
					run_interaction = {
						interaction = ask_for_conversion_courtier_interaction
						actor = root
						recipient = this
						send_threshold = decline # send the request and then AI will decide like normal
					}
				}
			}
		}
		if = {
			limit = {
				or = {
					scope:mod_convert_house = yes
					scope:bce_all_send_interfece = yes
				}
			}
			if = {
				limit = {
					exists = house
				}
				house = {
					every_house_member = {
						if = {
							limit = {
								root = {
									is_character_interaction_potentially_accepted = {
										recipient = prev
										interaction = demand_conversion_interaction
									}
								}
							}
							run_interaction = {
								interaction = demand_conversion_interaction
								actor = root
								recipient = this
								send_threshold = decline # send the request and then AI will decide like normal
							}
						}
					}
				}
			}
		}
		if = {
			limit = { scope:bce_whether_send_interfece = yes }

			if = {
				limit = { NOT = { has_global_variable = bce_no_send_interface } }
				set_global_variable = bce_no_send_interface
			}
			else = {
				remove_global_variable = bce_no_send_interface
			}
		}

	}


	ai_will_do = 0
}