###########################
# Yemen Decisions
###########################
# By Beelzebub
###########################

YEM_rebel_category = {

	YEM_proclaim_kingdom = {

		icon = generic_prepare_civil_war

		allowed = {
			original_tag = YEM
		}

		available = {
			OR = {
				AND = {
					TUR = {
						has_war_with = EGY
					}
					is_subject_of = TUR
				}
			has_completed_focus = YEM_An_Early_Uprising
			}
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 0
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		war_with_on_complete = TUR

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_proclaim_kingdom"
			custom_effect_tooltip = YEM_rebel_tooltip
			if = {
				limit = { is_subject = yes }
				overlord = {
					set_autonomy = { target = YEM autonomy_state = autonomy_free }
				}
			}
			if = {
				limit = { is_in_faction = yes }
				leave_faction = yes
			}
			separate_peace_all_wars = yes
			hidden_effect = {
				complete_national_focus = YEM_Free_Kingdom
				remove_ideas = {
					YEM_Ottoman_Rule_weak
					YEM_Ottoman_Rule
					YEM_Anarchy
					YEM_Anarchy_2
				}
				country_event = {
					id = yemen.11 days = 1
				}
				TUR = {
					country_event = {
						id = yemen.46
						days = 1
					}
				}
				country_event = {
					id = yemen.50
					days = 120
				}
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_proclaim_kingdom"
			if = {
				limit = {
					EGY = {
						is_faction_leader = yes
						has_war_with = TUR
					}
				}
				EGY = {
					add_to_faction = YEM
				}
			}
		}
	}
	
	YEM_join_egypt = {
		icon = GFX_decision_generic_nationalism

		allowed = {
			original_tag = YEM
		}

		available = {
			EGY = {
				is_faction_leader = yes
			}
			OR = {
				AND = {
					has_war_with = TUR
					TUR = {
						has_war_with = EGY
					}
				}
				owns_state = 659 # Aden
			}
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 20
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_join_egypt"
			
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_join_egypt"
			EGY = {
				country_event = {
					id = sharedafrika.2
					days = 1
				}
			}
		}
	}
	
	YEM_join_iran = {
		icon = GFX_decision_generic_nationalism

		allowed = {
			original_tag = YEM
		}

		available = {
			PER = {
				is_faction_leader = yes
			}
			owns_state = 659 # Aden
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 20
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_join_iran"
			
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_join_iran"
			PER = {
				country_event = {
					id = sharedafrika.2
					days = 1
				}
			}
		}
	}
	
	YEM_join_the_turk = {
		icon = GFX_decision_generic_nationalism

		allowed = {
			original_tag = YEM
		}

		available = {
			TUR = {
				is_faction_leader = yes
			}
			owns_state = 659 # Aden
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 50
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_join_the_turk"
			
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_join_the_turk"
			TUR = {
				country_event = {
					id = sharedafrika.2
					days = 1
				}
			}
		}
	}
	
	YEM_join_the_entente = {
		icon = GFX_decision_generic_nationalism

		allowed = {
			original_tag = YEM
		}

		available = {
			ENT = {
				is_faction_leader = yes
			}
			owns_state = 659 # Aden
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 50
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_join_the_entente"
			
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_join_the_entente"
			country_event = {
				id = sharedafrika.9
				days = 0
			}
		}
	}
	
	YEM_join_the_reichspakt = {
		icon = GFX_decision_generic_nationalism

		allowed = {
			original_tag = YEM
		}

		available = {
			GER = {
				is_faction_leader = yes
			}
			owns_state = 659 # Aden
		}

		visible = {
			OR = {
				has_completed_focus = YEM_An_Early_Uprising
				has_completed_focus = YEM_Every_Yemen_a_Kingdom
			}
		}

		fire_only_once = yes

		cost = 50
		days_remove = 10

		ai_will_do = {
			factor = 100
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision YEM_join_the_reichspakt"
			
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove YEM_join_the_reichspakt"
			country_event = {
				id = sharedafrika.1
				days = 0
			}
		}
	}
}
