﻿
mass_convert_targeted_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm_zemalgo.dds"
	}

	decision_group_type = mass_convert_category
	sort_order = 20

	ai_check_interval = 0

	is_shown = {
		is_landed = yes
		highest_held_title_tier >= tier_county
	}

	is_valid_showing_failures_only = {
		is_alive = yes
	}

	widget = {
		gui = "decision_view_widget_option_list_generic"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_TARGETED_CONVERSION_TYPE"
		show_from_start = yes

		item = {
			value = targeted_convert_religion
			is_shown = { is_landed = yes }
			current_description = {
				first_valid = {
					triggered_desc = {
						trigger = { always = yes }
						desc = targeted_convert_religion_option_desc
					}
				}
			}
			localization = targeted_convert_religion_option
			icon = "gfx/interface/icons/message_feed/religious.dds"
			ai_chance = { value = 0 }
		}

		item = {
			value = targeted_convert_culture
			is_shown = { is_landed = yes }
			current_description = {
				first_valid = {
					triggered_desc = {
						trigger = { always = yes }
						desc = targeted_convert_culture_option_desc
					}
				}
			}
			localization = targeted_convert_culture_option
			icon = "gfx/interface/icons/message_feed/culture.dds"
			ai_chance = { value = 0 }
		}
	}

	effect = {
		if = {
			limit = { scope:targeted_convert_religion = yes }
			
			custom_tooltip = mass_convert_targeted_effect_tooltip_faith
			
			hidden_effect = {
				clear_variable_list = mc_potential_counties_faith
				remove_character_flag = mass_convert_targeted_culture
				add_character_flag = { flag = mass_convert_targeted_religion days = 30 }
				every_sub_realm_county = {
					set_variable = mass_convert_sub_realm
					if = {
						limit = { NOT = { faith = root.faith } }
						root = { add_to_variable_list = { name = mc_potential_counties_faith target = prev } }
						set_variable = mass_convert_potential
					}
				}
				root = {
					set_variable = { name = show_mass_convert_faith_window value = yes }
					set_variable = { name = mc_total_cost_faith value = 0 }
				}
			}
		}
		if = {
			limit = { scope:targeted_convert_culture = yes }
			
			custom_tooltip = mass_convert_targeted_effect_tooltip_culture
			
			hidden_effect = {
				clear_variable_list = mc_potential_counties_culture
				remove_character_flag = mass_convert_targeted_religion
				add_character_flag = { flag = mass_convert_targeted_culture days = 30 }
				every_sub_realm_county = {
					set_variable = mass_convert_sub_realm
					if = {
						limit = { NOT = { culture = root.culture } }
						root = { add_to_variable_list = { name = mc_potential_counties_culture target = prev } }
						set_variable = mass_convert_potential
					}
				}
				root = {
					set_variable = { name = show_mass_convert_culture_window value = yes }
					set_variable = { name = mc_total_cost_culture value = 0 }
				}
			}
		}
	}

	ai_potential = { always = no }
	ai_will_do = { base = 0 }
}
