﻿### 招募十字军战士
recruit_crusader_knights_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp2_decision_struggle_opening.dds"
	}
	#decision_group_type = major

	desc = recruit_crusader_knights_decision_desc
	selection_tooltip = recruit_crusader_knights_decision_tooltip
	
	sort_order = 120

	is_shown = {
		# 仅限基督徒
		faith.religion = religion:christianity_religion
		# 要有武装朝圣信条
		faith = { has_doctrine = tenet_armed_pilgrimages }
		#Must be in the right area.
		capital_province = {
			OR = {
				geographical_region = world_middle_east
				geographical_region = world_africa_north
			}
		}
		#Must have the correct religion, and support from the rest of Catholicism.
		religion = { exists = var:variable_ghw_unlocked } #The era of the Crusades must have started.
		
		NOT = { house ?= { has_house_modifier = recruit_crusader_knights_modifier } }
	}
	is_valid = {
		# 未被绝罚
		# NOT = { has_trait = excommunicated }
		# 至少是国王
		highest_held_title_tier >= tier_kingdom
		prestige_level >= 2
		piety_level >= 3
		calc_true_if = {
			amount >= 3
			
			has_trait = crusader_king
			has_trait = faith_warrior
			culture = { has_innovation = innovation_desert_tactics }
			custom_description = {
				text = appoint_a_righteous_caliph_decision.control_one_holy_site
				faith = {
					any_holy_site = {
						count >= 1
						holder.top_liege = root
					}
				}
			}
			highest_held_title_tier >= tier_empire
			prestige_level >= 3
			piety_level >= 4
		}
	}

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

	effect = {
		custom_tooltip = recruit_crusader_knights_decision_tooltip
		house = {
			add_house_modifier = {
				modifier = recruit_crusader_knights_modifier
				years = 50
			}
		}
	}

	cost = {
		gold = {
			value = 0
			if = {
				limit = {
					has_treasury = no
				}
				add = 500
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					has_treasury = yes
				}
				add = 500
			}
		}
		piety = 500
	}

	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 18
		empire = 24
		hegemony = 48
	}

	ai_potential = {
		faith.religion = religion:christianity_religion
		highest_held_title_tier >= tier_kingdom
	}

	ai_will_do = {
		base = 100
	}
}

### 训练古拉姆骑兵
training_ghilman_cavalry_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_levy_outcasts.dds"
	}
	#decision_group_type = major

	desc = training_ghilman_cavalry_decision_desc
	selection_tooltip = training_ghilman_cavalry_decision_tooltip
	
	sort_order = 120

	is_shown = {
		# 仅限穆斯林
		faith.religion = religion:islam_religion
		# 首都在中东地区
		capital_province = {
			OR = {
				geographical_region = world_middle_east
				geographical_region = world_africa_north_east
			}
		}
		NOT = { house ?= { has_house_modifier = training_ghilman_cavalry_modifier } }
	}
	is_valid = {
		# 仅限穆斯林
		faith.religion = religion:islam_religion
		prestige_level >= 3
		# piety_level >= 2
		# 独立，或是帝国封臣
		OR = {
			top_liege = this
			top_liege = {
				highest_held_title_tier >= tier_kingdom
			}
		}
		# 拥有古拉姆革新
		OR = {
			culture = { has_innovation = innovation_ghilman }
			capital_county = { culture = { has_innovation = innovation_ghilman } }
			trigger_if = {
				limit = {
					NOR = {
						culture = { has_innovation = innovation_ghilman }
						capital_county = { culture = { has_innovation = innovation_ghilman } }
					}
				}
				custom_description = {
					text = training_ghilman_cavalry_decision.no_innovation
					always = no
				}
			}
		}
		# 是哈里发的封臣、领主或本人
		# OR = {
		# 	faith.religious_head = this
		# 	custom_description = {
		# 		text = training_ghilman_cavalry_decision.caliphal_liege
		# 		faith.religious_head = {
		# 			any_liege_or_above = { this = root }
		# 		}
		# 	}
		# 	custom_description = {
		# 		text = training_ghilman_cavalry_decision.caliphal_vassal
		# 		faith.religious_head = {
		# 			any_vassal_or_below = { this = root }
		# 		}
		# 	}
		# 	faith = {
		# 		has_doctrine = doctrine_no_head
		# 	}
		# }
	}

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

	effect = {
		# culture = {
		# 	if = {
		# 		limit = {
		# 			NOT = { has_innovation = innovation_ghilman }
		# 		}
		# 		add_innovation = innovation_ghilman
		# 	}
		# }
		if = {
			limit = {
				NOT = { culture = { has_innovation = innovation_ghilman } }
				capital_county = { culture = { has_innovation = innovation_ghilman } }
			}
			culture = { add_innovation = innovation_ghilman }
		}
		custom_tooltip = training_ghilman_cavalry_decision_tooltip
		house = {
			add_house_modifier = {
				modifier = training_ghilman_cavalry_modifier
				years = 50
			}
		}
	}

	cost = {
		gold = {
			value = 0
			if = {
				limit = {
					has_treasury = no
				}
				add = 500
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					has_treasury = yes
				}
				add = 500
			}
		}
		prestige = 500
	}

	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 9
		kingdom = 18
		empire = 24
		hegemony = 48
	}

	ai_potential = {
		faith.religion = religion:islam_religion
		highest_held_title_tier >= tier_duchy
	}

	ai_will_do = {
		base = 100
	}
}

### 恢复不死军
restore_the_immortals_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp3/fp3_decision_foundation.dds"
	}
	#decision_group_type = major

	desc = restore_the_immortals_decision_desc
	selection_tooltip = restore_the_immortals_decision_tooltip
	
	sort_order = 120

	is_shown = {
		# 完成荣耀传承第五个
		dynasty ?= {
			has_dynasty_perk = fp3_khvarenah_legacy_5
		}
		NOT = { house ?= { has_house_modifier = restore_the_immortals_modifier } }
	}
	is_valid = {
		prestige_level >= 4
		# 至少是王国
		highest_held_title_tier >= tier_kingdom
		# 祆教徒或伊朗人
		OR = {
			faith.religion = religion:zoroastrianism_religion
			culture = { has_cultural_pillar = heritage_iranian }
		}
	}

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

	effect = {
		if = {
			limit = {
				highest_held_title_tier >= tier_empire
				is_independent_ruler = yes
			}
			custom_tooltip = restore_the_immortals_decision_tooltip
		}
		else = {
			custom_tooltip = restore_the_immortals_decision_tooltip_zhayedan
			custom_tooltip = restore_the_immortals_decision_tooltip_empire
		}
		custom_tooltip = restore_the_immortals_decision_tooltip_pushtigban
		house = {
			add_house_modifier = {
				modifier = restore_the_immortals_modifier
				years = 50
			}
		}
	}

	cost = {
		gold = {
			value = 0
			if = {
				limit = {
					has_treasury = no
				}
				add = 500
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					has_treasury = yes
				}
				add = 500
			}
		}
		prestige = 500
	}

	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 0
		kingdom = 18
		empire = 24
		hegemony = 48
	}

	ai_potential = {
		faith.religion = religion:islam_religion
		highest_held_title_tier >= tier_duchy
	}

	ai_will_do = {
		base = 100
	}
}
