﻿#Hungary: historical re-settlement program.
promote_hungarian_settlement_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	desc = promote_hungarian_settlement_decision_desc
	selection_tooltip = promote_hungarian_settlement_decision_tooltip
	decision_group_type = major
	ai_goal = yes

	is_shown = {
		is_ruler = yes
		is_playable_character = yes
		game_start_date < 1066.1.1
		culture = { has_cultural_pillar = heritage_magyar }
		NOT = {  #Can only do it once.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_promoted_hungarian_settlement
			}
		}
		NOT = {  #Can only do either or.
			is_target_in_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_revived_magyar_paganism
			}
		}
		OR = {
			has_title = title:k_hungary
			has_title = title:e_carpathia
		}
		any_neighboring_top_liege_realm_owner = { #There are same reli neighboring Realms/Empires to take people from.
			religion = religion:christianity_religion
			count >= 2
		}
	}
	
	is_valid = {
		# Must be an Ecumenical Christian
		custom_description = {
  			text = promote_hungarian_settlement_decision_ecumenical_christian
			faith = { #Denomination of Faith must not be a heresy and must have some degree of control over its core regions.
				religion = religion:christianity_religion
				has_doctrine = special_doctrine_ecumenical_christian	
			}
		}
		
		#Must completely control the Carpathian Basin (Hungary De Jure)
		completely_controls = title:k_hungary

		# Capital is Hungarian culture group
		capital_province = { culture = { has_cultural_pillar = heritage_magyar } }
	}

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

	cost = {
		prestige = 2000
		piety = 500
	}

	effect = {
		show_as_tooltip = {
			promote_hungarian_settlement_decision_scripted_effect = yes
		}
		trigger_event = {
			id = east_europe.0030
		}
		root.dynasty = {
			add_dynasty_prestige = 500
		}
		add_trait = saint
		
		hidden_effect = {
			add_to_global_variable_list = {
				name = unavailable_unique_decisions
				target = flag:flag_promoted_hungarian_settlement
			}
		}
	}
	
	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 50
		ai_value_modifier = {
			ai_zeal = 1.0
			ai_greed = 1.0
		}
	}
}