﻿#european_union
#rhineland

#restore_austria_hungary_decision = {
#	picture = {
#		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
#	}
#	desc = restore_austria_hungary_decision_desc
#	selection_tooltip = restore_austria_hungary_decision_tooltip
#	decision_group_type = major
#
#	ai_check_interval_by_tier = {
#		barony = 0
#		county = 0
#		duchy = 0
#		kingdom = 120
#		empire = 120
#		hegemony = 0
#	}
#
#	is_shown = {
#		is_ruler = yes
#		is_playable_character = yes
#		NOT = {
#			is_target_in_global_variable_list = {
#				name = unavailable_unique_decisions
#				target = flag:flag_restored_austria_hungary
#			}
#		}	
#		OR = {
#		}
#	}
#
#	is_valid = {
#		NOT = { has_title = title:e_europa }
#		has_title = title:k_austria
#		has_title = title:k_hungary
#		completely_controls_region = custom_alpine_france
#	}
#
#	is_valid_showing_failures_only = {
#		is_landed = yes
#		is_capable_adult = yes
#		is_imprisoned = no
#		top_liege = this
#		is_at_war = no
#	}
#
#	effect = {
#		custom_tooltip = restore_austria_hungary_decision_effect_tooltip
#		show_as_tooltip = {
#			restore_austria_hungary_decision_effect = yes
#		}
#		hidden_effect = {
#			restore_austria_hungary_decision_effect
#			add_to_global_variable_list = {
#				name = unavailable_unique_decisions
#				target = flag:flag_restored_austria_hungary
#			}
#			set_global_variable = {
#				name = flag_restored_austria_hungary
#				value = root
#			}
#		}
#	}
#
#	ai_potential = {
#		always = yes
#	}
#
#	ai_will_do = {
#		base = 100
#	}
#}

restore_poland_lithuania_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_destiny_goal.dds"
	}
	desc = restore_poland_lithuania_decision_desc
	selection_tooltip = restore_poland_lithuania_tooltip
	decision_group_type = major

	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 120
		empire = 120
		hegemony = 0
	}

	is_shown = {
		is_ruler = yes
		is_playable_character = yes
		OR = {
			has_title = title:k_poland
			has_title = title:k_lithuania
		}
		NOT = {
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_restored_poland_lithuania
			}
		}	
		NEOW_religion_is_broadly_christian_trigger = yes
	}

	is_valid = {
		has_title = title:k_poland
		has_title = title:k_lithuania
		prestige_level >= 3
	}

	is_valid_showing_failures_only = {
		is_landed = yes
		is_capable_adult = yes
		is_imprisoned = no
		top_liege = this
		is_at_war = no
	}

	effect = {
		custom_tooltip = restore_poland_lithuania_decision_effect_tooltip
		show_as_tooltip = {
			restore_poland_lithuania_decision_effect = yes
		}
		hidden_effect = {
			restore_poland_lithuania_decision_effect = yes
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_restored_poland_lithuania
			}
			set_global_variable = {
				name = flag_restored_poland_lithuania
				value = root
			}
		}
	}

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}

restore_polish_borders_decision = {
	decision_group_type = major
	is_shown = {
		has_title = title:k_poland
		is_ruler = yes
		is_playable_character = yes
		NOR = {
			title:k_poland = { OR = { is_de_jure_liege_or_above_target = title:d_lower_silesia is_de_jure_liege_or_above_target = title:d_upper_silesia } }
			title:k_poland = { is_de_jure_liege_or_above_target = title:d_lesser_poland }
			title:k_poland = { is_de_jure_liege_or_above_target = title:d_podkarpackie }
			title:k_poland = { is_de_jure_liege_or_above_target = title:d_masuria }
		}
	}
	is_valid = {
		custom_tooltip = {
		text = restore_polish_borders_decision_tt
			OR = {
				AND = { OR = { has_title = title:k_silesia completely_controls = title:k_silesia } NOT = { title:k_poland = { OR = { is_de_jure_liege_or_above_target = title:d_lower_silesia is_de_jure_liege_or_above_target = title:d_upper_silesia } } } }
				AND = { OR = { has_title = title:d_lesser_poland completely_controls = title:d_lesser_poland } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_lesser_poland } } }
				AND = { OR = { has_title = title:d_podkarpackie completely_controls = title:d_podkarpackie } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_podkarpackie} } }
				AND = { OR = { has_title = title:d_masuria completely_controls = title:d_masuria } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_masuria } } }
			}
		}
	}
	is_valid_showing_failures_only = {
		is_landed = yes
		is_capable_adult = yes
		is_imprisoned = no
		top_liege = this
		is_at_war = no
	}

	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds"
	}

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

		item = {
			value = restore_polish_borders_silesia
			is_valid = { custom_tooltip = { text = restore_polish_borders_silesia_custom OR = { has_title = title:k_silesia completely_controls = title:k_silesia } NOT = { title:k_poland = { OR = { is_de_jure_liege_or_above_target = title:d_lower_silesia is_de_jure_liege_or_above_target = title:d_upper_silesia } } } } }
			localization = restore_polish_borders_silesia
			icon = "gfx/interface/icons/message_feed/activity.dds"
			ai_chance = { value = 100 }
		}

		item = {
			value = restore_polish_borders_lesser_poland
			is_valid = { custom_tooltip = { text = restore_polish_borders_lesser_poland_custom OR = { has_title = title:d_lesser_poland completely_controls = title:d_lesser_poland } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_lesser_poland } } } }
			localization = restore_polish_borders_lesser_poland
			icon = "gfx/interface/icons/message_feed/activity.dds"
			ai_chance = { value = 100 }
		}

		item = {
			value = restore_polish_borders_podkarpackie
			is_valid = { custom_tooltip = { text = restore_polish_borders_podkarpackie_custom OR = { has_title = title:d_podkarpackie completely_controls = title:d_podkarpackie } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_podkarpackie} } } }
			localization = restore_polish_borders_podkarpackie
			icon = "gfx/interface/icons/message_feed/activity.dds"
			ai_chance = { value = 100 }
		}

		item = {
			value = restore_polish_borders_masuria
			is_valid = { custom_tooltip = { text = restore_polish_borders_masuria_custom OR = { has_title = title:d_masuria completely_controls = title:d_masuria } NOT = { title:k_poland = { is_de_jure_liege_or_above_target = title:d_masuria } } } }
			localization = restore_polish_borders_masuria
			icon = "gfx/interface/icons/message_feed/activity.dds"
			ai_chance = { value = 100 }
		}
	}

	effect = {
		if = {
			limit = { scope:restore_polish_borders_silesia = yes }
			if = {
				limit = { exists = title:k_silesia }
				destroy_title = title:k_silesia
			}
			title:d_lower_silesia = { set_de_jure_liege_title = title:k_poland }
			title:d_upper_silesia = { set_de_jure_liege_title = title:k_poland }
		}
		if = {
			limit = { scope:restore_polish_borders_lesser_poland = yes }
			title:d_lesser_poland = { set_de_jure_liege_title = title:k_poland }
		}
		if = {
			limit = { scope:restore_polish_borders_podkarpackie = yes }
			title:d_podkarpackie = { set_de_jure_liege_title = title:k_poland }
		}
		if = {
			limit = { scope:restore_polish_borders_masuria = yes }
			title:d_masuria = { set_de_jure_liege_title = title:k_poland }
		}
	}
	ai_check_interval = 0
}
