﻿hi_become_saoshyant_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_foundation.dds"
	}

	desc = become_saoshyant_decision_desc
	selection_tooltip = become_saoshyant_decision_tooltip
	confirm_text = become_saoshyant_decision_confirm

	decision_group_type = major
	sort_order = 100 #FP3 change; this is an extremely epic decision, we want it to appear on top. 

	ai_check_interval = 120

	is_shown = {
		title:e_persia = { is_titular = yes } # modded
		is_ruler = yes
		is_landed = yes
		faith.religion = faith:mazdayasna.religion
		NOT = {  #Can only do it once.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_became_saoshyant
			}
		}
	}

	is_valid = {
		piety_level >= very_high_piety_level
		# has_title = title:e_persia
		# completely_controls = title:e_persia
		highest_held_title_tier = tier_empire # modded
		completely_controls_region = special_historicinvasions_persia_region # modded
	}

	is_valid_showing_failures_only = {
		is_capable_adult = yes
		is_imprisoned = no
		is_independent_ruler = yes
		is_at_war = no
	}


	effect = {
		show_as_tooltip = {
			become_saoshyant_decision_effect = yes
		}
		trigger_event = {
			id = middle_east_decisions.0011
		}
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_became_saoshyant
			}
		}
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}

hi_end_bugged_mongol_empire_story_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_major_religion.dds"
	}
	decision_group_type = major

	is_shown = {
		is_ai = no
		exists = global_var:mongol_empire_has_spawned
		exists = global_var:mongol_story_has_ended
		title:e_mongol_empire = { is_titular = no } # but the mongol empire still has de jure land
	}

	is_valid = {
		custom_tooltip = {
			text = hi_not_ai_text
			is_ai = no
		}
		custom_tooltip = {
			text = hi_mongol_empire_has_spawned_text
			exists = global_var:mongol_empire_has_spawned
		}
		custom_tooltip = {
			text = hi_mongol_story_has_ended_text
			exists = global_var:mongol_story_has_ended
		}
		custom_tooltip = {
			text = hi_mongol_empire_has_de_jure_land_text
			title:e_mongol_empire = { is_titular = no }
		}
	}

	cost = {}

	effect = {
		hi_end_bugged_mongol_empire_story_effect = yes
	}

	ai_check_interval = 0
}