#------------------------------------
#Decisions for Egypt by Herkles
#------------------------------------
political_actions = {
EGY_demand_suez = {#demand Suez
		icon = generic_political_discourse
		
		allowed = { 
			original_tag = EGY 
		}
		
		available = {
			date > 1937.01.01
			has_war = no
			is_subject = no
			OR = {
				GER = {
					owns_state = 753
				}
				DJI = {
					owns_state = 753
				}
			}
		}

		visible = {
			OR = {
				has_global_flag = AXIS_VICTORY
				is_ai = no
			}
		}


		fire_only_once = yes
		cost = 120

		ai_will_do = { factor = 25 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_demand_suez target: [From.GetName]"
			if = {
				limit = {
					GER = {
						owns_state = 753
						}
					}
				GER = { 
					country_event = {
						id = egy.198
						days = 5
					}
				}
			}
			if = {
				limit = {
					DJI = {
						owns_state = 753
						}
					}
				DJI = { 
					country_event = {
						id = egy.198
						days = 5
					}
				}
			}
		}
	}
}
EGY_cairo_pact_decisions = {#Cairo Pact stuff aka joining it
	EGY_ally_with_sudan_decision = {#ally with Sudan
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { SUD }
		target_root_trigger = { has_completed_focus = EGY_Victory_Levant }
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
			FROM = { same_government_type_as_ROOT = yes }
		}

		fire_only_once = yes
		cost = 50

		ai_will_do = { factor = 60 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_sudan_decision target: [From.GetName]"
			FROM = { country_event = egy.160 }
		}
	}
	EGY_ally_with_morroco_decision = {#ally with Morroco
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
			MOR = {
				has_socialist_government = no
				NOT = {
					has_government = national_populist
				}
			}
		}

		targets = { MOR }
		target_root_trigger = { has_completed_focus = EGY_gather_african_allies }
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 10

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_morroco_decision target: [From.GetName]"
			FROM = { country_event = egy.160 }
		}
	}
	
	EGY_ally_with_yemen_decision = {#ally with Yemen
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { YEM }
		target_root_trigger = { has_completed_focus = EGY_Victory_Levant }
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 10

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_yemen_decision target: [From.GetName]"
			FROM = { country_event = egy.160 }
		}
	}
	
	EGY_ally_with_muscat_decision = {#ally with Muscat
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { OMA }
		target_root_trigger = { has_completed_focus = EGY_Victory_Levant }
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 10

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_muscat_decision target: [From.GetName]"
			FROM = { country_event = egy.160 }
		}
	}
	
	EGY_ally_with_trucials_decision = {#ally with Trucial States
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { TRU }
		target_root_trigger = { has_completed_focus = EGY_Victory_Levant }
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 10

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_trucials_decision target: [From.GetName]"
			FROM = { country_event = egy.160 }
		}
	}

	EGY_ally_with_africa_decision = {#ally with Central Africa
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			551 = { is_controlled_by_ROOT_or_ally = yes }
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { CEA KBR HAU ZZB }
		target_root_trigger = { 
			has_completed_focus = EGY_gather_african_allies 
			if = {
				limit = { tag = CEA }
				CEA_has_bokassa = yes
			}
		}
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 10

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_africa_decision target: [From.GetName]"
			if = {
				limit = { tag = CEA }
				FROM = { country_event = cea.4 }
			}
			else = {
				FROM = { country_event = egy.160 }
			}
		}
	}
	


	EGY_ally_with_africa_decision_NFA = {
		name = EGY_ally_with_africa_decision
		icon = generic_political_discourse

		available = {
			at_peace_or_same_enemies_as_FROM = yes
		}

		visible = {
			551 = { is_controlled_by_ROOT_or_ally = yes }
			OR = {
				NOT = { country_exists = NFA }
				has_global_flag = NFA_has_collapsed_natives
			}
			country_exists = FROM
			FROM = { is_valid_peace_target = yes }
		}

		targets = { WAD NGR BFA MLI GNA MRT TUN ALG NER ERI }
		target_root_trigger = {
			has_completed_focus = EGY_gather_african_allies
			OR = {
				NOT = { country_exists = NFA }
				has_global_flag = NFA_has_collapsed_natives
			}
		}
		target_trigger = {
			FROM = { is_valid_peace_target = yes }
		}

		fire_only_once = yes
		cost = 5

		ai_will_do = { factor = 70 }

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_ally_with_africa_decision_NFA target: [From.GetName]"
			if = {
				limit = { tag = CEA }
				FROM = { country_event = cea.4 }
			}
			else = {
				FROM = { country_event = egy.160 }
			}
		}
	}
	EGY_press_ottoman_surrender = {
		icon = GFX_decision_generic_nationalism

		visible = {
			has_war_with = OTT
		}

		available = {
			NOT = {
				291 = { is_controlled_by = OTT }
				344 = { is_controlled_by = OTT }
				349 = { is_controlled_by = OTT }
				350 = { is_controlled_by = OTT }
				352 = { is_controlled_by = OTT }
				454 = { is_controlled_by = OTT }
				455 = { is_controlled_by = OTT }
				553 = { is_controlled_by = OTT }
				554 = { is_controlled_by = OTT }
				676 = { is_controlled_by = OTT }
				677 = { is_controlled_by = OTT }
				679 = { is_controlled_by = OTT }
				680 = { is_controlled_by = OTT }
				754 = { is_controlled_by = OTT }
				812 = { is_controlled_by = OTT }
				819 = { is_controlled_by = OTT }
				992 = { is_controlled_by = OTT }
				995 = { is_controlled_by = OTT }
			}
		}

		cost = 0
		fire_only_once = yes

		ai_will_do = {
			factor = 100
		}

		highlight_states = {
			highlight_state_targets = { state = 291 state = 344 state = 349 state = 350 state = 352 state = 454 state = 455 state = 553 state = 554 state = 676 state = 677 state = 679 state = 680 state = 754 state = 812 state = 819 state = 992 state = 995 }
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_press_ottoman_surrender"
			OTT = {
				country_event = cp.1
			}
		}
	}
}
EGY_egyptian_reforms_decisions = {#stuff related to the numerous and various reforms that Egypt is undergoing
	EGY_improve_literacy = {
		icon = generic_industry

		visible = {
			has_completed_focus = EGY_literacy_program
			has_idea = EGY_illiterate_populace
		}

		cost = 80
		days_remove = 240
		fire_only_once = yes

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove EGY_improve_literacy"
			swap_ideas = {
				remove_idea = EGY_illiterate_populace
				add_idea = EGY_illiterate_populace_2
			}
		}
		ai_will_do = {
			factor = 50
			modifier = {
				factor = 0
				has_political_power < 100
			}
		}
	}
	EGY_improve_literacy2 = {
		name = EGY_improve_literacy
		icon = generic_industry

		visible = {
			has_completed_focus = EGY_literacy_program
			has_idea = EGY_illiterate_populace_2
		}

		cost = 80
		days_remove = 240
		fire_only_once = yes

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove EGY_improve_literacy2"
			swap_ideas = {
				remove_idea = EGY_illiterate_populace_2
				add_idea = EGY_illiterate_populace_3
			}
		}
		ai_will_do = {
			factor = 50
			modifier = {
				factor = 0
				has_political_power < 100
			}
		}
	}
	EGY_improve_literacy3 = {
		name = EGY_improve_literacy
		icon = generic_industry

		visible = {
			has_completed_focus = EGY_literacy_program
			has_idea = EGY_illiterate_populace_3
		}

		cost = 80
		days_remove = 240
		fire_only_once = yes

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove EGY_improve_literacy3"
			swap_ideas = {
				remove_idea = EGY_illiterate_populace_3
				add_idea = EGY_illiterate_populace_4
			}
		}
		ai_will_do = {
			factor = 50
			modifier = {
				factor = 0
				has_political_power < 100
			}
		}
	}
	EGY_improve_literacy4 = {
		name = EGY_improve_literacy
		icon = generic_industry

		visible = {
			has_completed_focus = EGY_literacy_program
			has_idea = EGY_illiterate_populace_4
		}

		cost = 80
		days_remove = 240
		fire_only_once = yes

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove EGY_improve_literacy4"
			remove_ideas = EGY_illiterate_populace_4
		}
		ai_will_do = {
			factor = 50
			modifier = {
				factor = 0
				has_political_power < 100
			}
		}
	}
}

EGY_Integration = {
	EGY_Integrate_Syria = {
		icon = GFX_decision_infiltrate_state

		allowed = {
			tag = EGY
		}

		available = {
			FROM = {
				is_fully_controlled_by = ROOT
				compliance > 80
			}
		}

		visible = {
			FROM = {
				is_owned_and_controlled_by = ROOT
				NOT = { is_core_of = ROOT }
			}
		}

		on_map_mode = map_and_decisions_view
		cost = 25
		days_remove = 60
		fire_only_once = no

		state_target = yes
		targets = { 454 992 553 680 677 995 554 455 }
		target_trigger = {
			FROM = {
				is_owned_and_controlled_by = ROOT
				NOT = { is_core_of = ROOT }
			}
		}

		cancel_if_not_visible = yes
		cancel_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision cancelled EGY_Integrate_Syria target: [From.GetName]"
			add_political_power = 25
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove EGY_Integrate_Syria target: [From.GetName]"
			FROM = {
				if = {
					limit = { is_claimed_by = ROOT }
					remove_claim_by = ROOT
				}
				add_core_of = ROOT
			}
		}

		ai_will_do = {
			factor = 100
		}
	}
}

EGY_libyan_egyptian_unification_decisions = {
	EGY_promote_the_HIMT = {
		icon = GFX_decision_generic_political_discourse

		visible = {
			FROM = {
				exists = yes
				is_subject = no
				has_socialist_government = no
			}
		}

		cost = 25
		days_re_enable = 60
		cancel_if_not_visible = yes

		targets = { TRP LBA }
		target_root_trigger = { has_completed_focus = EGY_Libyan_Egyptian_Unification }
		target_trigger = {
			FROM = {
				is_subject = no
				has_socialist_government = no
			}
		}

		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_promote_the_HIMT target: [From.GetName]"
			FROM = {
				country_event = egy.188
				effect_tooltip = {
					add_popularity = {
						ideology = national_populist
						popularity = 0.10
					}
				}
			}
		}
	}
	EGY_pan_arabist_propaganda = {
		icon = GFX_decision_hol_radio_oranje

		visible = {
			FROM = {
				exists = yes
				is_subject = no
				has_socialist_government = no
			}
		}

		cost = 25
		days_re_enable = 30
		cancel_if_not_visible = yes

		targets = { TRP }
		target_root_trigger = { has_completed_focus = EGY_Libyan_Egyptian_Unification }
		target_trigger = {
			FROM = {
				is_subject = no
				has_socialist_government = no
			}
		}

		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_pan_arabist_propaganda target: [From.GetName]"
			FROM = {
				country_event = egy.189
				effect_tooltip = {
					add_popularity = {
						ideology = national_populist
						popularity = 0.06
					}
				}
			}
		}
	}
	TRP_pan_arabist_propaganda = {
		icon = GFX_decision_hol_radio_oranje

		allowed = { always = no } #manually activated

		visible = {
			country_exists = EGY
			EGY = { is_subject = no }
		}

		cost = 50
		selectable_mission = yes
		days_mission_timeout = 60
		cancel_if_not_visible = yes

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision TRP_pan_arabist_propaganda"
			add_popularity = {
				ideology = national_populist
				popularity = -0.07
			}
			EGY = { country_event = egy.197 }
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout TRP_pan_arabist_propaganda"
			add_popularity = {
				ideology = national_populist
				popularity = 0.02
			}
			hidden_effect = {
				country_event = { id = egy.192 days = 10 } #HIMT Coup in Tripoli
			}
		}
	}
	EGY_decry_tripolitanian_nationalism = {
		icon = GFX_decision_oppression

		visible = {
			FROM = {
				exists = yes
				is_subject = no
				has_socialist_government = no
			}
		}

		cost = 15
		days_re_enable = 30
		cancel_if_not_visible = yes

		targets = { TRP }
		target_root_trigger = { has_completed_focus = EGY_Libyan_Egyptian_Unification }
		target_trigger = {
			FROM = {
				is_subject = no
				has_socialist_government = no
			}
		}

		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_decry_tripolitanian_nationalism target: [From.GetName]"
			FROM = {
				country_event = egy.190
				effect_tooltip = {
					add_popularity = {
						ideology = national_populist
						popularity = 0.03
					}
				}
			}
		}
	}
	TRP_decry_tripolitanian_nationalism = {
		icon = GFX_decision_oppression

		allowed = { always = no } #manually activated

		visible = {
			country_exists = EGY
			EGY = { is_subject = no }
		}

		cost = 50
		selectable_mission = yes
		days_mission_timeout = 60
		cancel_if_not_visible = yes

		ai_will_do = {
			factor = 0
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision TRP_decry_tripolitanian_nationalism"
			add_popularity = {
				ideology = national_populist
				popularity = -0.05
			}
			EGY = { country_event = egy.197 }
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout TRP_decry_tripolitanian_nationalism"
			add_popularity = {
				ideology = national_populist
				popularity = 0.02
			}
			hidden_effect = {
				country_event = { id = egy.192 days = 10 } #HIMT Coup in Tripoli
			}
		}
	}
	EGY_propose_unification = {
		icon = GFX_decision_generic_form_nation

		available = {
			FROM = {
				has_government = national_populist
			}
		}

		visible = {
			FROM = {
				exists = yes
				is_subject = no
				has_socialist_government = no
			}
		}

		cost = 0
		fire_only_once = yes
		cancel_if_not_visible = yes

		targets = { TRP }
		target_root_trigger = { has_completed_focus = EGY_Libyan_Egyptian_Unification }
		target_trigger = {
			FROM = {
				is_subject = no
				has_socialist_government = no
			}
		}

		ai_will_do = {
			factor = 50
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision EGY_propose_unification target: [From.GetName]"
			FROM = { country_event = egy.194 }
		}
	}
}
