﻿jochid_restore_golden_horde_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}

	desc = gediminid_establish_plc_decision_desc
	selection_tooltip = gediminid_establish_plc_decision_tooltip
	decision_group_type = major

	ai_check_interval = 60

	is_shown = {
		is_ruler = yes
		is_landed = yes
		exists = dynasty
		exists = title:e_blue_horde
		exists = title:e_white_horde
		exists = title:e_golden_horde
		capital_province = { geographical_region = special_jochid_conquest_region_de_jure }
		title:e_golden_horde = {
			is_title_created = no
			is_titular = yes
		}
		is_target_in_global_variable_list = {
			name = historicinvasions_story_ended
			target = flag:jochid_story_ended
		}
		NOT = {	# only once
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:jochid_restore_golden_horde_decision
			}
		}
	}

	is_valid = {
		OR = {
			has_primary_title = title:e_blue_horde
			has_primary_title = title:e_white_horde
		}
		title:e_blue_horde = { title_held_years >= 30 }
		title:e_white_horde = { title_held_years >= 30 }
		completely_controls_region = special_jochid_conquest_region_de_jure
	}

	is_valid_showing_failures_only = {
		NOT = { has_trait = incapable }
		is_imprisoned = no
		is_independent_ruler = yes
	}

	cost = { # lower cost for AI
		gold = {
			value = 50
			if = {
				limit = { is_ai = no }
				add = 700
			}
		}
		prestige = {
			value = 100
			if = {
				limit = { is_ai = no }
				add = 2400
			}
		}
		piety = {
			value = 25
			if = {
				limit = { is_ai = no }
				add = 275
			}
		}
	}

	effect = {
		custom_tooltip = golden_horde_when_more_than_x_counties_within
		jochid_restore_golden_horde_decision_effect = yes
	}

	ai_potential = {
		primary_title.tier = tier_empire
		OR = {
			has_primary_title = title:e_blue_horde
			has_primary_title = title:e_white_horde
		}
	}

	ai_will_do = { base = 100 }
}