political_actions = {

	#EGY annex south sudan
	eoanb_decision_EGY_take_south_sudan = {

		icon = generic_political_discourse

		available = {
			any_state = {
				is_owned_and_controlled_by = FROM
				is_claimed_by = ROOT
				any_neighbor_state = {
					is_fully_controlled_by = ROOT
				}
			}
			tag = EGY
		}
		allowed = { tag = EGY }
		visible = {
			TAG = EGY
			NOT = { has_war_with = FROM }
			FROM={
				any_owned_state = {
					is_claimed_by = ROOT
					any_neighbor_state = {
						is_fully_controlled_by = ROOT
					}
					OR = {
						state = 832
						state = 833
						state = 834
						state = 845
					}
				}
			}
			date < 1900.01.01
		}

		target_trigger = {
			FROM = {
				is_neighbor_of = ROOT
			}
			NOT = {
				is_subject_of = ROOT
			}
		}

		fire_only_once = yes

		cost = 25

		complete_effect = {
			declare_war_on = {
				target = FROM
				type = annex_everything
			}
		}

		ai_will_do = {
			base = 1
		}
	}
}

afr_suez_construction = {
	
	#Dedicate Military Forces as Workers
	EGY_dedicate_military_workers = {
		icon = generic_construction

		allowed = { always = yes }

		available = {
			has_manpower > 999
		}

		visible = {
			check_variable = {
				var = EGY.suez_inprogress_total
				value = EGY.suez_progress_max
				compare = less_than
			}
			has_country_flag = suez_constructor_flag
			NOT = {has_global_flag = SUEZ_CANAL_BUILT}
		}

		cost = 0

		days_remove = 240
		days_re_enable = 10

		cancel_trigger = {
			check_variable = {
				var = EGY.suez_progress
				value = EGY.suez_progress_max
				compare = greater_than_or_equals
			}
		}

		modifier = {
			political_power_gain = -0.05
		}

		complete_effect = {
			##increase suez progress
			add_manpower = -1000
			add_to_variable = { EGY.suez_inprogress = 1 }
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_1
		}

		remove_effect = {
			##increase suez progress
			if = { 
				limit = {
					check_variable = {
						var = EGY.suez_progress
						value = EGY.suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = { EGY.suez_progress = 1 }
				add_to_variable = { suez_investment = 1 }
				clamp_variable = {
					var = EGY.suez_progress
					min = 0
					max = EGY.suez_progress_max
				}
			}
			add_to_variable = { EGY.suez_inprogress = -1 }
			add_manpower = 900
		}
		

		ai_will_do = {
			base = 1000
			modifier = {
				factor = 0
				has_manpower < 5000
			}
			modifier = {
				factor = 0.1
				NOT = {
					OR = {
						has_government = autocracy
						has_government = chauvinist_populism
						has_government = radical_democracy
					}
				}
			}
		}
	}

	EGY_corvee_workers_alexandria = {
		icon = generic_construction
		fixed_random_seed = no
		available = {
			check_variable = {
				var = suez_inprogress_total
				value = suez_progress_max
				compare = less_than
			}
			447={
				state_population > 9999
			}
			has_stability > 0.20
			NOT={has_country_flag= EGY_corvee_suez_disabled}
		}
		allowed = { 
			TAG = EGY
		}
		visible={
			NOT={has_country_flag= EGY_corvee_suez_disabled}
			has_country_flag = suez_constructor_flag
			tag = EGY
			NOT = {has_global_flag = SUEZ_CANAL_BUILT}
		}
		cost = 0
		ai_will_do = {
			factor = 100
		}
		modifier = {
			political_power_gain = -0.02
			stability_factor = -0.025
		}
		days_remove = 240
		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}
		remove_effect = {
			##increase suez progress
			if = {
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = {suez_progress = 2}
				add_to_variable = {suez_investment = 2}
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
			}
			add_to_variable = {suez_inprogress = -2}
			447={
				add_manpower = 9000
			}
		}
		complete_effect = {
			##increase suez progress
			
			447={
				add_manpower = -10000
				EGY_corvee_random_effects = yes
			}
			add_to_variable = {suez_inprogress = 2}
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_2
		}
	}
	EGY_corvee_workers_aswan = {
		icon = generic_construction
		fixed_random_seed = no
		available = {
			check_variable = {
				var = suez_inprogress_total
				value = suez_progress_max
				compare = less_than
			}
			456={
				state_population > 9999
			}
			has_stability > 0.2
			NOT={has_country_flag= EGY_corvee_suez_disabled}
		}
		allowed = { 
			TAG = EGY
		}
		visible={
			NOT={has_country_flag= EGY_corvee_suez_disabled}
			has_country_flag = suez_constructor_flag
			tag = EGY
			NOT = {has_global_flag = SUEZ_CANAL_BUILT}
		}
		cost = 0
		ai_will_do = {
			factor = 100
		}
		modifier = {
			political_power_gain = -0.02
			stability_factor = -0.025
		}
		days_remove = 240
		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}
		remove_effect = {
			##increase suez progress
			if = { 
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = {suez_progress = 2}
				add_to_variable = {suez_investment = 2}
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
			}
			add_to_variable = {suez_inprogress = -2}
			456={
				add_manpower = 9000
			}
		}
		complete_effect = {
			##increase suez progress
			456={
				add_manpower = -10000
				EGY_corvee_random_effects = yes
			}
			add_to_variable = {suez_inprogress = 2}
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_2
		}
	}
	EGY_corvee_workers_cairo = {
		icon = generic_construction
		fixed_random_seed = no
		available = {
			check_variable = {
				var = suez_inprogress_total
				value = suez_progress_max
				compare = less_than
			}
			446={
				state_population > 9999
			}
			has_stability > 0.2
			NOT={has_country_flag= EGY_corvee_suez_disabled}
		}
		allowed = { 
			TAG = EGY
		}
		visible={
			NOT={has_country_flag= EGY_corvee_suez_disabled}
			has_country_flag = suez_constructor_flag
			tag= EGY
			NOT = {has_global_flag = SUEZ_CANAL_BUILT}
		}
		cost = 0
		ai_will_do = {
			factor = 100
		}
		modifier = {
			political_power_gain = -0.02
			stability_factor = -0.025
		}
		days_remove = 240
		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}
		remove_effect = {
			##increase suez progress
			if = {
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = {suez_inprogress = -2}
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
			}
			add_to_variable = {suez_progress = 2}
			add_to_variable = {suez_investment = 2}
			446={
				add_manpower = 9000
			}
		}
		complete_effect = {
			##increase suez progress
			446={
				add_manpower = -10000
				EGY_corvee_random_effects = yes
			}
			add_to_variable = {suez_inprogress = 2}
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_2
		}
	}

	#Dedicate Industrial Power
	EGY_dedicate_industrial_power = {
		icon = generic_construction

		allowed = { always = yes }

		available = {
			num_of_civilian_factories_available_for_projects > 1
		}

		visible = {
			has_country_flag = suez_constructor_flag
			NOT = { has_global_flag = SUEZ_CANAL_BUILT }
			check_variable = {
				var = EGY.suez_inprogress_total
				value = EGY.suez_progress_max
				compare = less_than
			}
		}

		custom_cost_trigger = {
			set_temp_variable = {
				amount_of_money_to_check = 1
			}
			has_specific_amount_of_money_with_inflation_included = yes
		}
		custom_cost_text = eoanb_money_cost_text

		days_remove = 240
		days_re_enable = 10

		cancel_trigger = {
			check_variable = {
				var = EGY.suez_progress
				value = EGY.suez_progress_max
				compare = greater_than_or_equals
			}
		}

		modifier = {
			civilian_factory_use = 2
		}

		complete_effect = {
			set_temp_variable = { money_to_gain = -1 }
			add_money_with_inflation_included_with_tooltip_effect = yes
			##increase suez progress
			add_to_variable = { EGY.suez_inprogress = 2 }
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_2
		}

		remove_effect = {
			##increase suez progress
			if = {
				limit = {
					check_variable = {
						var = EGY.suez_progress
						value = EGY.suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = { EGY.suez_progress = 2 }
				add_to_variable = { suez_investment = 2 }
				clamp_variable = {
					var = EGY.suez_progress
					min = 0
					max = EGY.suez_progress_max
				}
			}
			add_to_variable = { EGY.suez_inprogress = -2 }
		}

		ai_will_do = {
			base = 100
		}
	}

	#Build Access Routes to the Suez Canal Sites
	EGY_prepare_the_site = {
		icon = generic_construction

		available = {
			has_manpower > 999
		}

		allowed = { 
			tag = EGY
		}

		visible = {
			NOT = { has_country_flag = suez_constructor_flag }
			has_country_flag = suez_contributor_flag
		}

		fire_only_once = yes

		custom_cost_trigger = {
			set_temp_variable = {
				amount_of_money_to_check = 1
			}
			has_specific_amount_of_money_with_inflation_included = yes
		}
		custom_cost_text = eoanb_money_cost_text

		days_remove = 100

		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}

		complete_effect = {
			set_temp_variable = { money_to_gain = -1 }
			add_money_with_inflation_included_with_tooltip_effect = yes
			##increase suez progress
			add_manpower = -1000
			add_to_variable = { EGY.suez_inprogress = 2 }
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_2
		}

		remove_effect = {
			##increase suez progress
			if = {
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = { EGY.suez_progress = 2 }
				add_to_variable = { suez_investment = 2 }
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
				749 = {
					add_building_construction = {
						type = infrastructure
						level = 1
						instant_build = yes
					}
				}
			}
			add_to_variable = { EGY.suez_inprogress = -2 }
			add_manpower = 900
		}

		ai_will_do = {
			base = 1000
		}
	}

	#Build Port Said (northern harbour)
	EGY_build_northern_harbor = {
		icon = naval_base

		available = {
			has_manpower > 3999
			check_variable = {
				var = suez_inprogress_total
				value = suez_progress_max
				compare = less_than
			}
		}

		allowed = { 
			tag = EGY
		}

		visible = {
			has_country_flag = suez_constructor_flag
			has_variable = suez_progress
			NOT = { has_global_flag = SUEZ_CANAL_BUILT }
		}

		fire_only_once = yes

		custom_cost_trigger = {
			set_temp_variable = {
				amount_of_money_to_check = 2
			}
			has_specific_amount_of_money_with_inflation_included = yes
		}
		custom_cost_text = eoanb_money_cost_text

		days_remove = 480

		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}

		complete_effect = {
			set_temp_variable = { money_to_gain = -2 }
			add_money_with_inflation_included_with_tooltip_effect = yes
			##increase suez progress
			add_manpower = -4000
			add_to_variable = { EGY.suez_inprogress = 5 }
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_5
		}

		remove_effect = {
			##increase suez progress
			if = { 
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = { EGY.suez_progress = 5 }
				add_to_variable = { suez_investment = 5 }
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
			}
			set_victory_points = {
				province = 12049
				value = 3
			}
			749 = {
				add_building_construction = {
					type = naval_base
					level = 2
					province = 12049
					instant_build = yes
				}
			}
			add_to_variable = { EGY.suez_inprogress = -5 }
			add_manpower = 3600
			hidden_effect = {
				set_province_name = { id = 12049 name = "Port Said" }
			}
		}

		ai_will_do = {
			base = 1000
		}
	}

	#Build Port Tawfiq (southern harbour)
	EGY_build_southern_harbor = {
		icon = naval_base

		available = {
			has_manpower > 3999
			check_variable = {
				var = suez_inprogress_total
				value = suez_progress_max
				compare = less_than
			}
		}

		allowed = { 
			tag = EGY
		}

		visible = {
			has_country_flag = suez_constructor_flag
			has_variable = suez_progress
			NOT = { has_global_flag = SUEZ_CANAL_BUILT }
		}

		fire_only_once = yes

		custom_cost_trigger = {
			set_temp_variable = {
				amount_of_money_to_check = 1.5
			}
			has_specific_amount_of_money_with_inflation_included = yes
		}
		custom_cost_text = eoanb_money_cost_text

		days_remove = 480

		cancel_trigger = {
			check_variable = {
				var = suez_progress
				value = suez_progress_max
				compare = greater_than_or_equals
			}
		}

		complete_effect = {
			set_temp_variable = { money_to_gain = -1.5 }
			add_money_with_inflation_included_with_tooltip_effect = yes
			##increase suez progress
			add_manpower = -4000
			add_to_variable = { EGY.suez_inprogress = 5 }
			set_variable = { EGY.suez_inprogress_total = EGY.suez_progress }
			add_to_variable = { EGY.suez_inprogress_total = EGY.suez_inprogress }
			custom_effect_tooltip = EGY_suez_construct_5
		}
		
		remove_effect = {
			##increase suez progress
			if = { 
				limit = {
					check_variable = {
						var = suez_progress
						value = suez_progress_max
						compare = less_than
					}
				}
				add_to_variable = { EGY.suez_progress = 5 }
				add_to_variable = { suez_investment = 5 }
				clamp_variable = {
					var = suez_progress
					min = 0
					max = suez_progress_max
				}
			}
			set_victory_points = {
				province = 4073
				value = 2
			}
			749 = {
				add_building_construction = {
					type = naval_base
					level = 1
					province = 4073
					instant_build = yes
				}
			}
			add_to_variable = { EGY.suez_inprogress = -5 }
			add_manpower = 3600
			hidden_effect = {
				set_province_name = { id = 4073 name = "Port Tawfiq" }
			}
		}
		
		ai_will_do = {
			base = 1000
		}
	}

	#Declare the Suez Canal Open
	EGY_open_the_canal = {
		icon = canal

		available = {
			custom_trigger_tooltip = {
				tooltip = suez_canal_completed_trigger_tt
				check_variable = {
					var = EGY.suez_progress
					value = EGY.suez_progress_max
					compare = greater_than_or_equals
				}
			}
		}

		allowed = { 
			tag = EGY
		}

		visible = {
			#
		}

		fire_only_once = yes

		cost = 0

		complete_effect = {
			set_global_flag = SUEZ_CANAL_BUILT
			news_event = { id = afr_EGY_vic.20 days = 3 }
		}

		ai_will_do = {
			base = 1000
		}
	}

	FRA_suez_processing_of_the_report = {
		icon = GFX_decision_administration
		allowed = {
			tag = FRA
		}
		available = {
			has_country_flag = suez_contributor_flag
		}
		visible = {
			EGY = { has_variable = suez_progress }
		}
		fire_only_once = yes
		cost = 0
		days_remove = 582
		remove_effect = {
			FRA = { country_event = { id = afr_EGY_vic.22 days = 1 } }
		}
	}
	EGY_block_the_canal = {
		icon = generic_operation
		allowed = { always = yes }
		available = {
			controls_state = 749
			NOT={has_global_flag = SUEZ_CANAL_BLOCKED}
		}
		visible={
			owns_state = 749
			has_global_flag = SUEZ_CANAL_BUILT
		}
		cost = 10
		ai_will_do = {
			factor = 0
		}
		days_remove = 240
		remove_effect = {
			##block the canal
			set_global_flag = SUEZ_CANAL_BLOCKED
		}
	}
	EGY_un_block_the_canal = {
		icon = canal
		allowed = { always = yes }
		available = {
			controls_state = 749
			has_global_flag = SUEZ_CANAL_BLOCKED
		}
		visible={
			owns_state = 749
			has_global_flag = SUEZ_CANAL_BUILT
		}
		cost = 10
		ai_will_do = {
			factor = 0
		}
		days_remove = 240
		remove_effect = {
			##block the canal
			clr_global_flag = SUEZ_CANAL_BLOCKED
		}
		modifier = {
			civilian_factory_use = 2
		}
	}
	EGY_invite_ETH_to_invest = {
		icon = generic_operation
		available = {
			has_country_flag = suez_constructor_flag
			
		}
		allowed = { 
			TAG = EGY
		}
		visible={
			has_country_flag = ETH_EGY_alliance
			NOT = {has_global_flag = SUEZ_CANAL_BUILT}
			check_variable = {
				var = EGY.suez_inprogress_total
				value = EGY.suez_progress_max
				compare = less_than
			}
		}
		cost = 10
		ai_will_do = {
			factor = 100
		}
		#days_remove = 240
		complete_effect = {
			##increase suez progress
			#set_global_flag = SUEZ_CANAL_BUILT ##WHAT THE FUCK COGG, WHY ARE YOU INSTANTLY FINISHING THE CANAL FROM INVITING ETH?
			ETH = { news_event ={id = afr_EGY_vic.26}}
		}
	}

}

eoanb_category_diplomatic_actions={
	EGY_ETH_war_for_gedaref={
		allowed = { tag = EGY }    
		available = {                          
			controls_state = 817
		}
		activation = { 
			always = no # activate via event
		}
		is_good = yes
		days_mission_timeout = 150  
		timeout_effect = {
			white_peace = ETH
			add_political_power = -50
		}
		complete_effect = {
			white_peace = ETH
			transfer_state = 817
		}
	}
}