﻿recruit_from_nomadic_capital_decision = {
	ai_check_interval = 12
	picture = {
		reference = "gfx/interface/illustrations/activity_splash_screens/tour_arrival_tribal_welcome.dds"
	}
	sort_order = 100
	decision_group_type = nomad_minor
	
	cooldown = { years = 2 }

	is_shown = {
		government_has_flag = government_is_nomadic
		exists = domicile
	}

	is_valid = {
	}

	is_valid_showing_failures_only = {
	}

	desc = recruit_from_nomadic_capital_decision_desc

	cost = {
		herd = {
			value = domicile.minor_herd_value
		}
	}

	widget = {
		gui = "decision_view_widget_option_list_generic"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_NOMAD_COURTIER_DECISION_NEXT_STEP_BUTTON"

		item = {
			value = recruit_hunters_decision
			current_description = recruit_hunters_decision
			localization = recruit_hunters_decision
			icon = "gfx/interface/icons/regimenttypes/armenian_archers.dds"
			ai_chance = {
				value = 100
			}
		}

		item = {
			value = recruit_knights_decision
			current_description = recruit_knights_decision
			localization = recruit_knights_decision
			icon = "gfx/interface/icons/casus_bellis/migration_cb.dds"
			is_valid = {
				domicile ?= {
					has_domicile_building_or_higher = character_warfare_yurt_03
				}
			}
			ai_chance = {
				value = 100
			}
		}

		item = {
			value = recruit_commanders_decision
			current_description = recruit_commanders_decision
			localization = recruit_commanders_decision
			icon = "gfx/interface/icons/regimenttypes/kheshig.dds"
			is_valid = {
				domicile ?= {
					has_domicile_building_or_higher = character_warfare_yurt_03
				}
			}
			ai_chance = {
				value = 100
			}
		}

		item = {
			value = recruit_shepherds_decision
			current_description = recruit_shepherds_decision
			localization = recruit_shepherds_decision
			icon = "gfx/interface/icons/government_types/herder_government.dds"
			ai_chance = {
				value = 0
			}
		}

		item = {
			value = recruit_brides_decision
			current_description = recruit_brides_decision
			localization = recruit_brides_decision
			is_valid = {
				custom_tooltip = {
					text = faith_dominant_gender_male_or_equal_tt
					faith_dominant_gender_male_or_equal = yes
				}
			}
			icon = "gfx/interface/icons/marriage.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						is_male = yes
						is_married = no
					}
					add = 100
				}
			}
		}

		item = {
			value = recruit_husbands_decision
			current_description = recruit_husbands_decision
			localization = recruit_husbands_decision
			is_valid = {
				custom_tooltip = {
					text = faith_dominant_gender_female_or_equal_tt
					faith_dominant_gender_female_or_equal = yes
				}
			}
			icon = "gfx/interface/icons/marriage.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						is_female = yes
						is_married = no
					}
					add = 100
				}
			}
		}
	}

	effect = {
		custom_tooltip = recruit_from_nomadic_capital_decision_tooltip
		hidden_effect = {
			if = {
				limit = { scope:recruit_hunters_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = nomadic_hunter_template
				}
			}
			else_if = {
				limit = { scope:recruit_commanders_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = nomadic_commander_template
				}
			}
			else_if = {
				limit = { scope:recruit_shepherds_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = seasoned_pastor_character
				}
			}
			else_if = {
				limit = { scope:recruit_brides_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = nomadic_bride_template
				}
			}
			else_if = {
				limit = { scope:recruit_husbands_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = nomadic_husband_template
				}
			}
			else_if = {
				limit = { scope:recruit_knights_decision = yes }
				recruit_three_nomadic_capital_characters_effect = {
					NOMAD_TEMPLATE_CHARACTER = nomadic_knight_template
				}
			}
		}
		close_view = {
			view = decisions
			player = root
		}
	}
	
	ai_potential = {
		government_has_flag = government_is_nomadic
		exists = domicile
		OR = {
			AND = {
				is_at_war = no
				any_courtier = {
					count < 10
				}
			}
			NOT = { exists = cp:councillor_kurultai_1 }
			NOT = { exists = cp:councillor_kurultai_2 }
			NOT = { exists = cp:councillor_kurultai_3 }
			NOT = { exists = cp:councillor_kurultai_4 }
		}
	}
	
	ai_will_do = { base = 100 }
}

summon_fair_courtiers_decision = {
	ai_check_interval = 48
	picture = {
		 reference = "gfx/interface/illustrations/event_scenes/mpo_city_steppe.dds"
	}
	sort_order = 100
	decision_group_type = courtier
	
	cooldown = { years = 2 }

	is_shown = {
		always = no
		#any_sub_realm_barony = {
		#	title_province = {
		#		has_building = pleasure_dome
		#	}
		#}
	}

	is_valid_showing_failures_only = {
		is_available = yes
	}

	desc = summon_fair_courtiers_decision_desc

	cost = {
		prestige = {
			value = minor_prestige_value
		}
	}

	widget = {
		gui = "decision_view_widget_option_list_generic"
		controller = decision_option_list_controller
		decision_to_second_step_button = "CHOOSE_SUMMON_FAIR_COURTIERS_DECISION_NEXT_STEP_BUTTON"

		item = {
			value = summon_maidens_decision
			current_description = summon_maidens_decision
			localization = summon_maidens_decision
			icon = "gfx/interface/icons/traits/beauty_good_2.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						is_male = yes
						is_married = no
					}
					add = 100
				}
			}
		}

		item = {
			value = call_men_decision
			current_description = call_men_decision
			localization = call_men_decision
			icon = "gfx/interface/icons/traits/beauty_good_2.dds"
			ai_chance = {
				value = 0
				if = {
					limit = {
						is_female = yes
						is_married = no
					}
					add = 100
				}
			}
		}
	}

	effect = {
		custom_tooltip = summon_fair_courtiers_decision_tooltip
		hidden_effect = {
			if = {
				limit = { scope:summon_maidens_decision = yes }
				summon_three_fair_courtiers_effect = {
					NOMAD_TEMPLATE_CHARACTER = beautiful_maiden_character
				}
			}
			else_if = {
				limit = { scope:call_men_decision = yes }
				summon_three_fair_courtiers_effect = {
					NOMAD_TEMPLATE_CHARACTER = beautiful_man_character
				}
			}
		}
		close_view = {
			view = decisions
			player = root
		}
	}
	
	ai_potential = {
		any_courtier = {
			count < 10
		}
	}
}
