﻿
mass_convert_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm_zemalgo.dds"
	}
	
	decision_group_type = mass_convert_category
	sort_order = 10
	
	ai_check_interval = 0
	
	is_shown = {
		is_landed = yes
		highest_held_title_tier >= tier_county
	}
	
	is_valid_showing_failures_only = {
		is_alive = yes
	}
	
	is_valid = {
		trigger_if = {
			limit = { scope:convert_all_religion = yes }
			custom_description = {
				text = mass_convert_req_faith_counties
				subject = root
				any_sub_realm_county = { NOT = { faith = root.faith } }
			}
		}
		trigger_else_if = {
			limit = { scope:convert_all_culture = yes }
			custom_description = {
				text = mass_convert_req_culture_counties
				subject = root
				any_sub_realm_county = { NOT = { culture = root.culture } }
			}
		}
		trigger_else = {
			custom_description = {
				text = mass_convert_must_select_option
				subject = root
				always = no
			}
		}
	}
	
	cost = {
		piety = {
			value = 0
			if = {
				limit = { scope:convert_all_religion = yes }
				add = mass_convert_religion_cost_value
			}
		}
		gold = {
			value = 0
			if = {
				limit = {
					scope:convert_all_culture = yes
					has_treasury = no
				}
				add = mass_convert_culture_cost_value
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					scope:convert_all_culture = yes
					has_treasury = yes
				}
				add = mass_convert_culture_cost_value
			}
		}
	}
	widget = {
		gui = "decision_view_widget_option_list_generic"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_CONVERSION_TYPE"
		show_from_start = yes
		item = {
			value = convert_all_religion
			
			is_shown = {
				is_landed = yes
			}
			

			current_description = mass_convert_all_religion_desc
			localization = mass_convert_all_religion
			icon = "gfx/interface/icons/message_feed/religious.dds"
			ai_chance = { value = 100 }
		}
		item = {
			value = convert_all_culture
			
			is_shown = {
				is_landed = yes
			}
			

			current_description = mass_convert_all_culture_desc
			localization = mass_convert_all_culture
			icon = "gfx/interface/icons/message_feed/culture.dds"
			ai_chance = { value = 100 }
		}
	}
	
	effect = {
		if = {
			limit = { scope:convert_all_religion = yes }
			
			custom_tooltip = mass_convert_religion_tooltip
			every_sub_realm_county = {
				limit = {
					NOT = { faith = root.faith }
				}
				set_county_faith = root.faith
			}
			send_interface_message = {
				type = event_generic_good_text
				title = mass_convert_religion_message_title
				desc = mass_convert_religion_message_desc
				left_icon = root
			}
		}
		if = {
			limit = { scope:convert_all_culture = yes }
			
			if = {
				limit = { has_treasury = yes }
				custom_tooltip = mass_convert_culture_tooltip_treasury
			}
			else = {
				custom_tooltip = mass_convert_culture_tooltip_gold
			}
			every_sub_realm_county = {
				limit = {
					NOT = { culture = root.culture }
				}
				set_county_culture = root.culture
			}
			send_interface_message = {
				type = event_generic_good_text
				title = mass_convert_culture_message_title
				desc = mass_convert_culture_message_desc
				left_icon = root
			}
		}
	}
	
	ai_potential = {
		always = no
	}
	
	ai_will_do = {
		base = 0
	}
}
