﻿0s_burgundy_greater_decision = {
	picture = { 
		reference = "gfx/interface/illustrations/decisions/0s_burgundy_greater.dds" 
	}
	decision_group_type = major
	ai_check_interval = 120
	desc = 0s_burgundy_greater_decision_desc
	ai_goal = yes
	
	is_shown = {
		# ONLY visible if the first decision was taken
		is_target_in_global_variable_list = {
			name = unavailable_unique_decisions
			target = flag:flag_0s_burgundy_created
		}
		has_title = title:k_d_burgundy
		faith = faith:catholic
		highest_held_title_tier < tier_empire
		capital_province = { geographical_region = 0s_custom_burgundy }
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_0s_greater_burgundy_created
			}
		}
	}
	
	is_valid = {
		is_independent_ruler = yes
		root.culture = {
			has_innovation = innovation_rightful_ownership
		}
		highest_held_title_tier = tier_kingdom
		legitimacy_level >= 4
		prestige_level >= 5
		completely_controls_region = 0s_custom_burgundy
OR = {

custom_description = {
		text = 0s_burgundy_no_larger_neighbor_tt 
		NOT = {
			any_neighboring_top_liege_realm_owner = {
				realm_size > root.realm_size
			}
		}
	}

	custom_description = {
		text = 0s_burgundy_neighbor_distracted_tt
		any_neighboring_top_liege_realm_owner = {
			realm_size > root.realm_size
			is_at_war = yes
		}
	}
}
		custom_description = {
			text = 0s_burgundy_pope_requirement_tt
			exists = faith.religious_head
			OR = {
				faith.religious_head = {
					opinion = { 
						target = root 
						value >= very_high_positive_opinion 
					}
				}
				has_strong_usable_hook = faith.religious_head
			}
		}
	}
	
	is_valid_showing_failures_only = {
		is_landed = yes
		is_capable_adult = yes
		is_imprisoned = no
		is_at_war = no
	}
	
	cost = {
		gold = 5000
		prestige = 5000
	}
	
	effect = {
		show_as_tooltip = {
			0s_burgundy_greater_scripted_effect = yes
			custom_tooltip = 0s_burgundy_drift_julich_optional_tt
			custom_tooltip = 0s_burgundy_drift_upper_lorraine_optional_tt
		}
		if = {
			limit = { has_strong_usable_hook = faith.religious_head }
			faith.religious_head = {
				send_interface_toast = {
					type = event_toast_effect_bad
					title = 0s_greater_burgundy_decision
					left_icon = this
					use_hook = root
				}
			}
		}
		faith.religious_head = { save_scope_as = pope }
		root = { save_scope_as = decision_taker }
		trigger_event = 0s_burgundy_decision_event.0003
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_0s_greater_burgundy_created
			}
		}
			set_global_variable = {
				name = flag_0s_greater_burgundy_created
				value = root
			}
	}
	
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
