add_namespace = Algeria
add_namespace = alg
add_namespace = ALG
add_namespace = algeria_elections
add_namespace = alg_reform
add_namespace = ALG_presidency
add_namespace = ALG_black_spring
add_namespace = algeria
add_namespace = algeria_reforms
add_namespace = ALG_bouteflika
add_namespace = ALG_maghreb_invite
add_namespace = AlgeriaPoliticalEvents
add_namespace = Algeria_events
add_namespace = AlgeriaFocus
add_namespace = AlgeriaFocusNews
add_namespace = AlgeriaInvestment
add_namespace = AlgeriaFocusEvents
add_namespace = algeria_sahar
add_namespace = alg_politics
add_namespace = ALG_2014_oil_crash
add_namespace = ALG_2019_hirak_victory
add_namespace = ALG_2019_military_rule
add_namespace = ALG_hirak_reforms
add_namespace = ALG_hirak_crackdown
add_namespace = algeria_tebboune
add_namespace = ALG_terror
add_namespace = algeria_news
add_namespace = nuclear_algeria
add_namespace = algerian_focus
add_namespace = algeria_policy
add_namespace = fra_colonial
add_namespace = algeria_disaster
add_namespace = alg_mufti
add_namespace = algeria_gspc
add_namespace = alg_generals
add_namespace = ALG_bouteflika_resigns
add_namespace = ALG_interim_president
add_namespace = ALG_hirak
add_namespace = alg_news_non_aligned
add_namespace = algeria_morocco
add_namespace = ALG_morocco
add_namespace = alg_general
add_namespace = algeria_intro
add_namespace = alg_resistance
add_namespace = ALG_flavor_event
add_namespace = algerian_event
add_namespace = ALG_pulse
add_namespace = algeria_invest
add_namespace = algerian
add_namespace = AlgeriaElections
add_namespace = ALG_FIS
add_namespace = ALG_faction
add_namespace = alg_politics_news
add_namespace = alg_crackdown
add_namespace = ALG_tamazgha
add_namespace = ALG_auto
add_namespace = ALG_fln
add_namespace = ALG_ethnic_data
add_namespace = alg_ethnicity
add_namespace = alg_ethnic
add_namespace = alg_deep_state
add_namespace = alg_deep_state_news
add_namespace = alg_cabinet

### CABINET OVERVIEW EVENT ###
country_event = {
	id = alg_cabinet.1
	title = alg_cabinet.1.t
	desc = alg_cabinet.1.d
	picture = GFX_romanian_parliament
	is_triggered_only = yes

	option = {
		name = alg_cabinet.1.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.1.a executed"
		custom_effect_tooltip = ALG_cabinet_reviewed_tt
	}
}

### PRIME MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.10
	title = alg_cabinet.10.t
	desc = alg_cabinet.10.d
	picture = GFX_political_deal
	is_triggered_only = yes

	# Ahmed Ouyahia - Technocrat
	option = {
		name = alg_cabinet.10.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.10.a executed"
		trigger = { NOT = { has_country_flag = ALG_pm_ouyahia } }
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		custom_effect_tooltip = ALG_appoint_ouyahia_tt
		ALG_appoint_pm_ouyahia = yes
		add_political_power = 25
	}

	option = {
		name = alg_cabinet.10.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.10.b executed"
		trigger = { NOT = { has_country_flag = ALG_pm_sellal } }
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power > 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_sellal_tt
		ALG_appoint_pm_sellal = yes
		add_stability = 0.02
	}

	option = {
		name = alg_cabinet.10.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.10.c executed"
		trigger = { NOT = { has_country_flag = ALG_pm_djerad } }
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_djerad_tt
		ALG_appoint_pm_djerad = yes
		add_to_variable = { deep_state_power = -2 }
		custom_effect_tooltip = deep_state_power_decreased_2_tt
	}

	option = {
		name = alg_cabinet.10.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.10.e executed"
		trigger = {
			NOT = { has_country_flag = ALG_pm_benbitour }
			check_variable = { deep_state_power < 15 }
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 100
			}
		}
		custom_effect_tooltip = ALG_appoint_benbitour_tt
		ALG_appoint_pm_benbitour = yes
		add_to_variable = { deep_state_power = -3 }
		custom_effect_tooltip = deep_state_power_decreased_3_tt
		add_stability = -0.02
	}

	option = {
		name = alg_cabinet.10.o
		log = "[GetDateText]: [This.GetName]: alg_cabinet.10.o executed"
		ai_chance = { base = 0 }
		country_event = alg_cabinet.1000
	}

	# Abdelmalek Sellal - Loyalist
	# Abdelaziz Djerad - Reformist
	# Ahmed Benbitour - Independent
	# Next
}
country_event = {
	id = alg_cabinet.1000
	title = alg_cabinet.1000.t
	desc = alg_cabinet.1000.d
	picture = GFX_political_deal
	is_triggered_only = yes

	# Noureddine Bedoui - Loyalist
	option = {
		name = alg_cabinet.1000.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.1000.a executed"
		trigger = { NOT = { has_country_flag = ALG_pm_bedoui } }
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power > 15 }
			}
		}
		custom_effect_tooltip = ALG_appoint_bedoui_pm_tt
		ALG_appoint_pm_bedoui = yes
		add_stability = 0.01
	}

	option = {
		name = alg_cabinet.1000.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.1000.b executed"
		trigger = { NOT = { has_country_flag = ALG_pm_tebboune } }
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_tebboune_tt
		ALG_appoint_pm_tebboune = yes
	}

	option = {
		name = alg_cabinet.1000.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.1000.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_pm_tt
	}

	# Abdelmadjid Tebboune - Reformist
	# Keep current
}

### DEFENSE MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.20
	title = alg_cabinet.20.t
	desc = alg_cabinet.20.d
	picture = GFX_turkmen_karakalpak_army
	is_triggered_only = yes

	immediate = {
		# Check if deep state will react
		if = {
			limit = { check_variable = { ALG_mod_deep_state > 70 } }
			set_country_flag = ALG_mod_change_triggers_ds
		}
	}

	# Ahmed Gaid Salah - Deep State Military
	option = {
		name = alg_cabinet.20.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.20.a executed"
		trigger = { NOT = { has_country_flag = ALG_mod_gaaid_salah } }
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				check_variable = { deep_state_power > 15 }
			}
		}
		custom_effect_tooltip = ALG_appoint_gaaid_salah_tt
		ALG_appoint_mod_gaaid_salah = yes
		add_to_variable = { deep_state_power = 3 }
		custom_effect_tooltip = deep_state_power_increased_3_tt
	}

	option = {
		name = alg_cabinet.20.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.20.b executed"
		trigger = { check_variable = { deep_state_power < 15 } }
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_civilian_mod_tt
		ALG_appoint_mod_civilian = yes
		add_to_variable = { deep_state_power = -3 }
		custom_effect_tooltip = deep_state_power_decreased_3_tt
		add_stability = -0.03
		if = {
			limit = { has_country_flag = ALG_mod_change_triggers_ds }
			country_event = { id = alg_cabinet.25 days = 7 }
		}
	}

	option = {
		name = alg_cabinet.20.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.20.c"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 15 }
			}
		}
		custom_effect_tooltip = ALG_appoint_reformist_mod_tt
		ALG_appoint_mod_reformist = yes
		if = {
			limit = { has_country_flag = ALG_mod_change_triggers_ds }
			add_to_variable = { deep_state_power = 2 }
			custom_effect_tooltip = deep_state_power_increased_2_tt
		}
	}

	option = {
		name = alg_cabinet.20.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.20.e"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 20 }
			}
			modifier = {
				add = 1
				has_war_support > 0.50
			}
		}
		custom_effect_tooltip = ALG_appoint_hardliner_mod_tt
		ALG_appoint_mod_mediene = yes
		add_to_variable = { deep_state_power = 2 }
		custom_effect_tooltip = deep_state_power_increased_2_tt
		add_war_support = 0.03
	}

	option = {
		name = alg_cabinet.20.f
		log = "[GetDateText]: [This.GetName]: alg_cabinet.20.f"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_mod_tt
	}

	# Civilian Defense Expert
	# Reformist General
	# Hardline General
	# Keep current
}

# Deep State Reaction to Defense Minister Change
country_event = {
	id = alg_cabinet.25
	title = alg_cabinet.25.t
	desc = alg_cabinet.25.d
	picture = GFX_Military_Reform
	is_triggered_only = yes

	immediate = { clr_country_flag = ALG_mod_change_triggers_ds }

	option = {
		name = alg_cabinet.25.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.25.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 20 }
			}
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = ALG_ds_accepts_mod_change_tt
		add_to_variable = { deep_state_power = 2 }
		custom_effect_tooltip = deep_state_power_increased_2_tt
	}

	option = {
		name = alg_cabinet.25.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.25.b executed"
		trigger = { has_political_power > 50 }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
		}
		custom_effect_tooltip = ALG_ds_appeased_tt
		add_political_power = -50
	}
}

### INTERIOR MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.30
	title = alg_cabinet.30.t
	desc = alg_cabinet.30.d
	picture = GFX_timor_election
	is_triggered_only = yes

	# Security Hardliner
	option = {
		name = alg_cabinet.30.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.30.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 15 }
			}
		}
		custom_effect_tooltip = ALG_appoint_hardliner_moi_tt
		ALG_appoint_moi_hardliner = yes
		add_stability = 0.02
		add_to_variable = { deep_state_power = 1 }
		custom_effect_tooltip = deep_state_power_increased_1_tt
	}

	option = {
		name = alg_cabinet.30.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.30.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_reformist_moi_tt
		ALG_appoint_moi_reformist = yes
		add_to_variable = { deep_state_power = -1 }
		custom_effect_tooltip = deep_state_power_decreased_1_tt
	}

	option = {
		name = alg_cabinet.30.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.30.c executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_technocrat_moi_tt
		ALG_appoint_moi_technocrat = yes
	}

	option = {
		name = alg_cabinet.30.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.30.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_moi_tt
	}

	# Reformist Administrator
	# Loyalist Technocrat
	# Keep current
}

### FOREIGN AFFAIRS MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.40
	title = alg_cabinet.40.t
	desc = alg_cabinet.40.d
	picture = GFX_EST_ParliamentElections
	is_triggered_only = yes

	# Pro-Western Diplomat
	option = {
		name = alg_cabinet.40.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.40.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_completed_focus = ALG_open_to_west
			}
			modifier = {
				add = 1
				has_opinion = { target = USA value > 25 }
			}
		}
		custom_effect_tooltip = ALG_appoint_prowestern_mofa_tt
		ALG_appoint_mofa_prowestern = yes
		if = {
			limit = { country_exists = USA }
			USA = {
				add_opinion_modifier = {
					target = ROOT
					modifier = ALG_prowestern_minister
				}
			}
		}
		if = {
			limit = { country_exists = FRA }
			FRA = {
				add_opinion_modifier = {
					target = ROOT
					modifier = ALG_prowestern_minister
				}
			}
		}
	}

	option = {
		name = alg_cabinet.40.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.40.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_completed_focus = ALG_egypt_algiers_axis
			}
		}
		custom_effect_tooltip = ALG_appoint_panarab_mofa_tt
		ALG_appoint_mofa_panarab = yes
		if = {
			limit = { country_exists = EGY }
			EGY = {
				add_opinion_modifier = {
					target = ROOT
					modifier = ALG_panarab_minister
				}
			}
		}
		if = {
			limit = { country_exists = SAU }
			SAU = {
				add_opinion_modifier = {
					target = ROOT
					modifier = ALG_panarab_minister
				}
			}
		}
	}

	option = {
		name = alg_cabinet.40.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.40.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_completed_focus = ALG_align_with_russia
			}
			modifier = {
				add = 1
				has_war = no
			}
		}
		custom_effect_tooltip = ALG_appoint_nonaligned_mofa_tt
		ALG_appoint_mofa_nonaligned = yes
	}

	option = {
		name = alg_cabinet.40.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.40.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_mofa_tt
	}

	# Pan-Arab Nationalist
	# Non-Aligned Veteran
	# Keep current
}

### FINANCE MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.50
	title = alg_cabinet.50.t
	desc = alg_cabinet.50.d
	picture = GFX_internal_faction_money
	is_triggered_only = yes

	# Free Market Economist
	option = {
		name = alg_cabinet.50.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.50.a executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_freemarket_mof_tt
		ALG_appoint_mof_freemarket = yes
		add_ideas = ALG_economic_liberalization
	}

	option = {
		name = alg_cabinet.50.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.50.b executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_statist_mof_tt
		ALG_appoint_mof_statist = yes
	}

	option = {
		name = alg_cabinet.50.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.50.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		custom_effect_tooltip = ALG_appoint_bureaucrat_mof_tt
		ALG_appoint_mof_bureaucrat = yes
	}

	option = {
		name = alg_cabinet.50.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.50.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_mof_tt
	}

	# State Interventionist
	# Loyal Bureaucrat
	# Keep current
}

### ENERGY MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.60
	title = alg_cabinet.60.t
	desc = alg_cabinet.60.d
	picture = GFX_internal_faction_energy
	is_triggered_only = yes

	# Sonatrach Insider
	option = {
		name = alg_cabinet.60.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.60.a executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_sonatrach_moe_tt
		ALG_appoint_moe_sonatrach = yes
		add_resource = {
			type = oil
			amount = 5
			state = 381
		}
	}

	option = {
		name = alg_cabinet.60.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.60.b executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_international_moe_tt
		ALG_appoint_moe_international = yes
	}

	option = {
		name = alg_cabinet.60.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.60.c executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_loyal_moe_tt
		ALG_appoint_moe_loyal = yes
	}

	option = {
		name = alg_cabinet.60.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.60.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_moe_tt
	}

	# International Energy Expert
	# Loyal Administrator
	# Keep current
}

### JUSTICE MINISTER SELECTION ###
country_event = {
	id = alg_cabinet.70
	title = alg_cabinet.70.t
	desc = alg_cabinet.70.d
	picture = GFX_tanzania_parliament
	is_triggered_only = yes

	option = {
		name = alg_cabinet.70.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.70.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_independent_moj_tt
		ALG_appoint_moj_independent = yes
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		add_stability = -0.01
	}

	option = {
		name = alg_cabinet.70.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.70.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 15 }
			}
			modifier = {
				add = 1
				has_war_support > 0.50
			}
		}
		custom_effect_tooltip = ALG_appoint_security_moj_tt
		ALG_appoint_moj_security = yes
		add_to_variable = { deep_state_power = 1 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_1_tt
		add_stability = 0.01
	}

	option = {
		name = alg_cabinet.70.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.70.c executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_loyalist_moj_tt
		ALG_appoint_moj_loyalist = yes
	}

	option = {
		name = alg_cabinet.70.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.70.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_moj_tt
	}
}

### INTELLIGENCE CHIEF SELECTION ###
country_event = {
	id = alg_cabinet.80
	title = alg_cabinet.80.t
	desc = alg_cabinet.80.d
	picture = GFX_CAN_withdraw_security_bid
	is_triggered_only = yes

	immediate = {
		if = {
			limit = { check_variable = { ALG_drs_deep_state > 80 } }
			set_country_flag = ALG_drs_change_triggers_ds
		}
	}

	option = {
		name = alg_cabinet.80.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.80.a executed"
		trigger = { NOT = { has_country_flag = ALG_drs_tartag } }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 15 }
			}
		}
		custom_effect_tooltip = ALG_appoint_tartag_tt
		ALG_appoint_drs_tartag = yes
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_3_tt
	}

	option = {
		name = alg_cabinet.80.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.80.b executed"
		trigger = { NOT = { has_country_flag = ALG_drs_mediene } }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 20 }
			}
		}
		custom_effect_tooltip = ALG_appoint_mediene_tt
		ALG_appoint_drs_mediene = yes
		add_to_variable = { deep_state_power = 5 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
	}

	option = {
		name = alg_cabinet.80.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.80.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_appoint_loyalist_drs_tt
		ALG_appoint_drs_loyalist = yes
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		if = {
			limit = { has_country_flag = ALG_drs_change_triggers_ds }
			country_event = { id = alg_cabinet.85 days = 7 }
		}
	}

	option = {
		name = alg_cabinet.80.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.80.e executed"
		ai_chance = { base = 0 }
		country_event = alg_cabinet.800
	}
}
country_event = {
	id = alg_cabinet.800
	title = alg_cabinet.800.t
	desc = alg_cabinet.800.d
	picture = GFX_CAN_withdraw_security_bid
	is_triggered_only = yes

	option = {
		name = alg_cabinet.800.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.800.a"
		trigger = { check_variable = { deep_state_power < 10 } }
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_civilian_drs_tt
		ALG_appoint_drs_civilian = yes
		add_to_variable = { deep_state_power = -5 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_decreased_5_tt
		add_stability = -0.05
		if = {
			limit = { has_country_flag = ALG_drs_change_triggers_ds }
			country_event = { id = alg_cabinet.85 days = 7 }
		}
	}

	option = {
		name = alg_cabinet.800.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.800.b"
		trigger = { check_variable = { deep_state_power < 15 } }
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_appoint_reformist_drs_tt
		ALG_appoint_drs_reformist = yes
		add_to_variable = { deep_state_power = -3 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_decreased_3_tt
		if = {
			limit = { has_country_flag = ALG_drs_change_triggers_ds }
			country_event = { id = alg_cabinet.85 days = 7 }
		}
	}

	option = {
		name = alg_cabinet.800.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.800.c"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_keep_current_drs_tt
	}
}

country_event = {
	id = alg_cabinet.85
	title = alg_cabinet.85.t
	desc = alg_cabinet.85.d
	picture = GFX_CAN_withdraw_security_bid
	is_triggered_only = yes

	immediate = { clr_country_flag = ALG_drs_change_triggers_ds }

	option = {
		name = alg_cabinet.85.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.85.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				check_variable = { deep_state_power > 20 }
			}
		}
		custom_effect_tooltip = ALG_intelligence_network_resists_tt
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_3_tt
		add_stability = -0.03
	}

	option = {
		name = alg_cabinet.85.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.85.b executed"
		trigger = { has_political_power > 75 }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 150
			}
		}
		custom_effect_tooltip = ALG_intelligence_network_appeased_tt
		add_political_power = -75
		add_to_variable = { ALG_drs_loyalty = 5 }
		clamp_variable = { var = ALG_drs_loyalty min = 0 max = 100 }
		ALG_calculate_cabinet_stats = yes
	}
}

### CABINET RESHUFFLE ###
country_event = {
	id = alg_cabinet.100
	title = alg_cabinet.100.t
	desc = alg_cabinet.100.d
	picture = GFX_comittee_genoc_research
	is_triggered_only = yes

	option = {
		name = alg_cabinet.100.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.100.a executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_loyalist_cabinet_tt
		ALG_apply_loyalist_cabinet = yes
		add_stability = 0.05
		add_to_variable = { deep_state_power = 1 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_1_tt
	}

	option = {
		name = alg_cabinet.100.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.100.b executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_technocrat_cabinet_tt
		ALG_apply_technocrat_cabinet = yes
		add_political_power = 50
	}

	option = {
		name = alg_cabinet.100.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.100.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				check_variable = { deep_state_power < 10 }
			}
		}
		custom_effect_tooltip = ALG_reform_cabinet_tt
		ALG_apply_reform_cabinet = yes
		add_to_variable = { deep_state_power = -5 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_decreased_5_tt
		add_stability = -0.03
	}

	option = {
		name = alg_cabinet.100.e
		log = "[GetDateText]: [This.GetName]: alg_cabinet.100.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power < 50
			}
		}
		add_political_power = 100
	}
}

### DEMAND LOYALTY ###
country_event = {
	id = alg_cabinet.110
	title = alg_cabinet.110.t
	desc = alg_cabinet.110.d
	picture = GFX_alg_president
	is_triggered_only = yes

	option = {
		name = alg_cabinet.110.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.110.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
			modifier = {
				add = 1
				check_variable = { ALG_cabinet_competence < 50 }
			}
		}
		custom_effect_tooltip = ALG_force_loyalty_tt
		random_list = {
			70 = {
				ALG_increase_all_loyalty = yes
				custom_effect_tooltip = ALG_loyalty_accepted_tt
			}
			30 = {
				ALG_increase_all_loyalty = yes
				subtract_from_variable = { ALG_cabinet_competence = 5 }
				clamp_variable = { var = ALG_cabinet_competence min = 0 max = 100 }
				ALG_calculate_cabinet_stats = yes
				custom_effect_tooltip = ALG_loyalty_resignation_tt
			}
		}
	}

	option = {
		name = alg_cabinet.110.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.110.b executed"
		trigger = { has_political_power > 50 }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 200
			}
			modifier = {
				add = 1
				check_variable = { ALG_cabinet_competence > 70 }
			}
		}
		custom_effect_tooltip = ALG_buy_loyalty_tt
		add_political_power = -50
		ALG_increase_all_loyalty = yes
	}

	option = {
		name = alg_cabinet.110.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.110.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability > 0.60
			}
		}
		custom_effect_tooltip = ALG_back_down_loyalty_tt
		ALG_decrease_all_loyalty = yes
		add_stability = -0.02
	}
}

### CABINET DISLOYALTY CRISIS ###
country_event = {
	id = alg_cabinet.200
	title = alg_cabinet.200.t
	desc = alg_cabinet.200.d
	picture = GFX_ivory_coast_protest_supressed
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_variable = ALG_cabinet_loyalty
		OR = {
			check_variable = { ALG_pm_loyalty < 30 }
			check_variable = { ALG_mod_loyalty < 30 }
			check_variable = { ALG_drs_loyalty < 30 }
		}
		NOT = { has_country_flag = cabinet_crisis_cooldown }
		NOT = { has_idea = ALG_military_junta_1 }
	}

	immediate = {
		set_country_flag = { flag = cabinet_crisis_cooldown days = 180 value = 1 }
	}

	option = {
		name = alg_cabinet.200.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.200.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability > 0.50
			}
			modifier = {
				add = 1
				has_political_power > 50
			}
		}
		custom_effect_tooltip = ALG_dismiss_disloyal_tt
		if = {
			limit = { check_variable = { ALG_pm_loyalty < 30 } }
			country_event = { id = alg_cabinet.10 days = 1 }
		}
		if = {
			limit = { check_variable = { ALG_mod_loyalty < 30 } }
			add_to_variable = { deep_state_power = 3 }
			clamp_variable = { var = deep_state_power min = 0 max = 30 }
			custom_effect_tooltip = deep_state_power_increased_3_tt
		}
		if = {
			limit = { check_variable = { ALG_drs_loyalty < 30 } }
			add_to_variable = { deep_state_power = 5 }
			clamp_variable = { var = deep_state_power min = 0 max = 30 }
		}
		add_stability = -0.05
	}

	option = {
		name = alg_cabinet.200.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.200.b"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = ALG_negotiate_disloyal_tt
		add_political_power = -75
		if = {
			limit = { check_variable = { ALG_pm_loyalty < 30 } }
			add_to_variable = { ALG_pm_loyalty = 20 }
		}
		if = {
			limit = { check_variable = { ALG_mod_loyalty < 30 } }
			add_to_variable = { ALG_mod_loyalty = 15 }
		}
		if = {
			limit = { check_variable = { ALG_drs_loyalty < 30 } }
			add_to_variable = { ALG_drs_loyalty = 10 }
		}
		clamp_variable = { var = ALG_pm_loyalty min = 0 max = 100 }
		clamp_variable = { var = ALG_mod_loyalty min = 0 max = 100 }
		clamp_variable = { var = ALG_drs_loyalty min = 0 max = 100 }
		ALG_calculate_cabinet_stats = yes
	}

	option = {
		name = alg_cabinet.200.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.200.c"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power < 50
			}
		}
		custom_effect_tooltip = ALG_ignore_disloyal_tt
		ALG_decrease_all_loyalty = yes
		add_stability = -0.05
	}
}

### DEEP STATE PRESSURE ON CABINET ###
country_event = {
	id = alg_cabinet.201
	title = alg_cabinet.201.t
	desc = alg_cabinet.201.d
	picture = GFX_protests_kazakhstan_2
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_variable = ALG_cabinet_deep_state_influence
		check_variable = { deep_state_power > 15 }
		check_variable = { ALG_cabinet_deep_state_influence < 50 }
		NOT = { has_country_flag = ds_cabinet_pressure_cooldown }
		NOT = { has_idea = ALG_military_junta_1 }
	}

	immediate = {
		set_country_flag = { flag = ds_cabinet_pressure_cooldown days = 180 value = 1 }
	}

	option = {
		name = alg_cabinet.201.a
		log = "[GetDateText]: [This.GetName]: alg_cabinet.201.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
			modifier = {
				add = 1
				has_political_power < 25
			}
		}
		custom_effect_tooltip = ALG_accept_ds_pressure_tt
		ALG_increase_deep_state_influence_cabinet = yes
		add_to_variable = { deep_state_power = 2 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_2_tt
		add_stability = 0.01
	}

	option = {
		name = alg_cabinet.201.b
		log = "[GetDateText]: [This.GetName]: alg_cabinet.201.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability > 0.60
			}
		}
		custom_effect_tooltip = ALG_resist_ds_pressure_tt
		add_stability = -0.05
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_3_tt
		subtract_from_variable = { ALG_mod_loyalty = 10 }
		subtract_from_variable = { ALG_drs_loyalty = 15 }
		clamp_variable = { var = ALG_mod_loyalty min = 0 max = 100 }
		clamp_variable = { var = ALG_drs_loyalty min = 0 max = 100 }
		ALG_calculate_cabinet_stats = yes
	}

	option = {
		name = alg_cabinet.201.c
		log = "[GetDateText]: [This.GetName]: alg_cabinet.201.c executed"
		trigger = { has_political_power > 50 }
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 150
			}
		}
		custom_effect_tooltip = ALG_compromise_ds_pressure_tt
		add_political_power = -50
		add_to_variable = { ALG_pm_deep_state = 5 }
		add_to_variable = { ALG_moi_deep_state = 5 }
		clamp_variable = { var = ALG_pm_deep_state min = 0 max = 100 }
		clamp_variable = { var = ALG_moi_deep_state min = 0 max = 100 }
		ALG_calculate_cabinet_stats = yes
		add_to_variable = { deep_state_power = 1 }
		clamp_variable = { var = deep_state_power min = 0 max = 30 }
		custom_effect_tooltip = deep_state_power_increased_1_tt
	}
}
### GRADUAL GROWTH EVENTS ###
country_event = {
	id = alg_deep_state.1
	is_triggered_only = yes
	hidden = yes

	trigger = {
		tag = ALG
		has_variable = deep_state_power
		NOT = { has_country_flag = deep_state_frozen }
		NOT = { has_idea = ALG_military_junta_1 }
	}

	immediate = {
		add_to_variable = { deep_state_power = 1 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		log = "[GetDateText]: [This.GetName]: alg_deep_state.1 executed"
	}
}

### THRESHOLD EVENTS ###

# Low Influence (5-10)
country_event = {
	id = alg_deep_state.5
	title = alg_deep_state.5.t
	desc = alg_deep_state.5.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 5 }
		NOT = { has_country_flag = deep_state_stage_1 }
	}

	immediate = { set_country_flag = deep_state_stage_1 }

	option = {
		name = alg_deep_state.5.a
		log = "[GetDateText]: [This.GetName]: alg_deep_state.5.a executed"
		custom_effect_tooltip = deep_state_growing_tt
		custom_effect_tooltip = deep_state_stage_1_tt
	}
}

# Medium Influence (10-15)
country_event = {
	id = alg_deep_state.10
	title = alg_deep_state.10.t
	desc = alg_deep_state.10.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 10 }
		NOT = { has_country_flag = deep_state_stage_2 }
	}

	immediate = { set_country_flag = deep_state_stage_2 }

	option = {
		name = alg_deep_state.10.a # Let them operate
		log = "[GetDateText]: [This.GetName]: alg_deep_state.10.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = deep_state_power_increased_2_tt
		custom_effect_tooltip = deep_state_let_operate_tt
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.10
		}
		add_to_variable = { deep_state_power = 2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
	}

	option = {
		name = alg_deep_state.10.b # Reassert civilian control
		log = "[GetDateText]: [This.GetName]: alg_deep_state.10.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 100
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_3_tt
		custom_effect_tooltip = deep_state_civilian_control_tt
		add_stability = -0.05
		add_to_variable = { deep_state_power = -3 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
	}
}

# High Influence (15-20)
country_event = {
	id = alg_deep_state.15
	title = alg_deep_state.15.t
	desc = alg_deep_state.15.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 15 }
		NOT = { has_country_flag = deep_state_stage_3 }
	}

	immediate = { set_country_flag = deep_state_stage_3 }

	option = {
		name = alg_deep_state.15.a # Accept military oversight
		log = "[GetDateText]: [This.GetName]: alg_deep_state.15.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = deep_state_power_increased_3_tt
		custom_effect_tooltip = deep_state_accept_oversight_tt
		if = {
			limit = { NOT = { has_idea = ALG_deep_state_oversight } }
			add_ideas = ALG_deep_state_oversight
		}
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
	}

	option = {
		name = alg_deep_state.15.b # Push back against the generals
		log = "[GetDateText]: [This.GetName]: alg_deep_state.15.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 100
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_5_tt
		custom_effect_tooltip = deep_state_push_back_tt
		add_stability = -0.08
		add_political_power = -50
		add_to_variable = { deep_state_power = -5 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
	}
}

# Critical Influence (20+) - الدولة العميقة
country_event = {
	id = alg_deep_state.20
	title = alg_deep_state.20.t
	desc = alg_deep_state.20.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 20 }
		NOT = { has_country_flag = deep_state_stage_4 }
	}

	immediate = { set_country_flag = deep_state_stage_4 }

	option = {
		name = alg_deep_state.20.a # The Generals hold the real power
		log = "[GetDateText]: [This.GetName]: alg_deep_state.20.a executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = deep_state_generals_power_tt
		custom_effect_tooltip = deep_state_critical_warning_tt
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.20
		}
		add_stability = -0.05
		add_war_support = 0.05
		# Upgrade from oversight to control
		if = {
			limit = { has_idea = ALG_deep_state_oversight }
			swap_ideas = {
				remove_idea = ALG_deep_state_oversight
				add_idea = ALG_deep_state_control
			}
		}
		else_if = {
			limit = { NOT = { has_idea = ALG_deep_state_control } }
			add_ideas = ALG_deep_state_control
		}
	}
}

### RANDOM DEEP STATE EVENTS ###

# Military Contract Corruption
country_event = {
	id = alg_deep_state.101
	title = alg_deep_state.101.t
	desc = alg_deep_state.101.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 8 }
		NOT = { has_country_flag = alg_corruption_event_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_corruption_event_cooldown days = 90 value = 1 }
	}

	option = {
		name = alg_deep_state.101.a # Turn a blind eye
		log = "[GetDateText]: [This.GetName]: alg_deep_state.101.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power < 50
			}
		}
		custom_effect_tooltip = deep_state_power_increased_2_tt
		custom_effect_tooltip = deep_state_corruption_ignored_tt
		add_to_variable = { deep_state_power = 2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_political_power = 25
	}

	option = {
		name = alg_deep_state.101.b # Investigate the corruption
		log = "[GetDateText]: [This.GetName]: alg_deep_state.101.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		custom_effect_tooltip = deep_state_corruption_investigated_tt
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = -0.03
	}
}

# Intelligence Services Overreach
country_event = {
	id = alg_deep_state.102
	title = alg_deep_state.102.t
	desc = alg_deep_state.102.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 12 }
		NOT = { has_idea = ALG_surveillance_state_1 }
		NOT = { has_country_flag = alg_surveillance_event_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_surveillance_event_cooldown days = 365 value = 1 }
	}

	option = {
		name = alg_deep_state.102.a # Grant expanded surveillance powers
		log = "[GetDateText]: [This.GetName]: alg_deep_state.102.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = deep_state_power_increased_3_tt
		custom_effect_tooltip = deep_state_surveillance_granted_tt
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_ideas = ALG_surveillance_state_1
	}

	option = {
		name = alg_deep_state.102.b # Maintain constitutional limits
		log = "[GetDateText]: [This.GetName]: alg_deep_state.102.b executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		custom_effect_tooltip = deep_state_surveillance_denied_tt
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = 0.02
	}
}

# General Challenges Civilian Authority
country_event = {
	id = alg_deep_state.103
	title = alg_deep_state.103.t
	desc = alg_deep_state.103.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 18 }
		NOT = { has_country_flag = alg_general_challenge_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_general_challenge_cooldown days = 180 value = 1 }
	}

	option = {
		name = alg_deep_state.103.a # Back down
		log = "[GetDateText]: [This.GetName]: alg_deep_state.103.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.30
			}
		}
		custom_effect_tooltip = deep_state_power_increased_4_tt
		custom_effect_tooltip = deep_state_backed_down_tt
		add_to_variable = { deep_state_power = 4 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = -0.05
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.15
		}
	}

	option = {
		name = alg_deep_state.103.b # Dismiss the general
		log = "[GetDateText]: [This.GetName]: alg_deep_state.103.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability > 0.60
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_5_tt
		custom_effect_tooltip = deep_state_general_dismissed_tt
		add_to_variable = { deep_state_power = -5 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = -0.10
		army_experience = -25
	}

	option = {
		name = alg_deep_state.103.c # Compromise with the general
		log = "[GetDateText]: [This.GetName]: algeria_power_balance.b executed"
		trigger = {
			has_political_power > 75
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 150
			}
		}
		custom_effect_tooltip = deep_state_compromise_tt
		add_political_power = -75
		add_stability = -0.02
	}
}
# Economic Interests of the Generals
country_event = {
	id = alg_deep_state.104
	title = alg_deep_state.104.t
	desc = alg_deep_state.104.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 10 }
		NOT = { has_country_flag = alg_economic_generals_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_economic_generals_cooldown days = 180 value = 1 }
	}

	option = {
		name = alg_deep_state.104.a # Allow military business interests
		log = "[GetDateText]: [This.GetName]: alg_deep_state.104.a executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = deep_state_power_increased_2_tt
		custom_effect_tooltip = deep_state_economic_allowed_tt
		add_to_variable = { deep_state_power = 2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_offsite_building = {
			type = industrial_complex
			level = 1
		}
	}

	option = {
		name = alg_deep_state.104.b # Block military economic expansion
		log = "[GetDateText]: [This.GetName]: alg_deep_state.104.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_1_tt
		custom_effect_tooltip = deep_state_economic_blocked_tt
		add_to_variable = { deep_state_power = -1 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_political_power = -25
	}
}

# Media Pressure from Military
country_event = {
	id = alg_deep_state.105
	title = alg_deep_state.105.t
	desc = alg_deep_state.105.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 14 }
		NOT = { has_country_flag = alg_media_pressure_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_media_pressure_cooldown days = 200 value = 1 }
	}

	option = {
		name = alg_deep_state.105.a # Allow military to control narrative
		log = "[GetDateText]: [This.GetName]: alg_deep_state.105.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = deep_state_power_increased_2_tt
		custom_effect_tooltip = deep_state_media_controlled_tt
		add_to_variable = { deep_state_power = 2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_war_support = 0.05
	}

	option = {
		name = alg_deep_state.105.b # Defend press freedom
		log = "[GetDateText]: [This.GetName]: alg_deep_state.105.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_war_support < 0.20
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		custom_effect_tooltip = deep_state_press_freedom_tt
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = -0.03
		add_political_power = 20
	}
}

# Retired Generals in Politics
country_event = {
	id = alg_deep_state.106
	title = alg_deep_state.106.t
	desc = alg_deep_state.106.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 7 }
		NOT = { has_country_flag = alg_retired_generals_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_retired_generals_cooldown days = 365 value = 1 }
	}

	option = {
		name = alg_deep_state.106.a # Welcome their expertise
		log = "[GetDateText]: [This.GetName]: alg_deep_state.106.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power < 50
			}
		}
		custom_effect_tooltip = deep_state_power_increased_3_tt
		custom_effect_tooltip = deep_state_generals_welcomed_tt
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_political_power = 50
		add_stability = 0.02
	}

	option = {
		name = alg_deep_state.106.b # Enforce separation from politics
		log = "[GetDateText]: [This.GetName]: alg_deep_state.106.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		custom_effect_tooltip = deep_state_generals_barred_tt
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_stability = -0.02
	}
}

# Loyalty of Provincial Commanders
country_event = {
	id = alg_deep_state.107
	title = alg_deep_state.107.t
	desc = alg_deep_state.107.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 16 }
		NOT = { has_country_flag = alg_provincial_commanders_cooldown }
	}

	immediate = {
		set_country_flag = { flag = alg_provincial_commanders_cooldown days = 270 value = 1 }
	}

	option = {
		name = alg_deep_state.107.a # Reward their loyalty to the state
		log = "[GetDateText]: [This.GetName]: alg_deep_state.107.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_2_tt
		custom_effect_tooltip = deep_state_loyalty_rewarded_tt
		add_to_variable = { deep_state_power = -2 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_political_power = -50
		army_experience = 15
	}

	option = {
		name = alg_deep_state.107.b # Let the deep state handle promotions
		log = "[GetDateText]: [This.GetName]: alg_deep_state.107.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power < 50
			}
		}
		custom_effect_tooltip = deep_state_power_increased_3_tt
		custom_effect_tooltip = deep_state_promotions_controlled_tt
		add_to_variable = { deep_state_power = 3 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		army_experience = 25
	}
}

# Foreign Power Offers Support Against Deep State
country_event = {
	id = alg_deep_state.108
	title = alg_deep_state.108.t
	desc = alg_deep_state.108.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 20 }
		NOT = { has_country_flag = alg_foreign_support_cooldown }
		OR = {
			has_opinion = {
				target = FRA
				value > 50
			}
			has_opinion = {
				target = USA
				value > 50
			}
		}
	}

	immediate = {
		set_country_flag = { flag = alg_foreign_support_cooldown days = 365 value = 1 }
	}

	option = {
		name = alg_deep_state.108.a # Accept foreign assistance
		log = "[GetDateText]: [This.GetName]: alg_deep_state.108.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 200
			}
		}
		custom_effect_tooltip = deep_state_power_decreased_4_tt
		custom_effect_tooltip = deep_state_foreign_help_tt
		add_to_variable = { deep_state_power = -4 }
		clamp_variable = {
			var = deep_state_power
			min = 0
			max = 30
		}
		add_political_power = -100
		add_opinion_modifier = {
			target = FRA
			modifier = ALG_accepted_foreign_intervention
		}
	}

	option = {
		name = alg_deep_state.108.b # Refuse foreign interference
		log = "[GetDateText]: [This.GetName]: alg_deep_state.108.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = deep_state_foreign_refused_tt
		add_stability = 0.03
		add_war_support = 0.02
	}
}

### DEEP STATE COUP EVENT (Maximum Power) ###
country_event = {
	id = alg_deep_state.200
	title = alg_deep_state.200.t
	desc = alg_deep_state.200.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		check_variable = { deep_state_power > 28 }
		NOT = { has_country_flag = deep_state_coup_fired }
	}

	immediate = { set_country_flag = deep_state_coup_fired }

	option = {
		name = alg_deep_state.200.a # The military takes control
		log = "[GetDateText]: [This.GetName]: alg_deep_state.200.a executed"
		custom_effect_tooltip = deep_state_coup_tt
		custom_effect_tooltip = deep_state_military_control_tt
		set_politics = {
			ruling_party = nationalist
			elections_allowed = no
		}
		add_stability = -0.15
		add_war_support = 0.10
		# Remove previous deep state ideas and add junta
		if = {
			limit = { has_idea = ALG_deep_state_oversight }
			remove_ideas = ALG_deep_state_oversight
		}
		if = {
			limit = { has_idea = ALG_deep_state_control }
			remove_ideas = ALG_deep_state_control
		}
		if = {
			limit = { NOT = { has_idea = ALG_military_junta_1 } }
			add_ideas = ALG_military_junta_1
		}
		set_variable = { deep_state_power = 30 }
		set_temp_variable = { rul_party_temp = 22 }
		change_ruling_party_effect = yes
		# News event for other countries
		hidden_effect = {
			news_event = { id = alg_deep_state_news.1 days = 1 }
			country_event = { id = alg_deep_state.201 days = 3 }
		}
	}
}

### COUP RESISTANCE EVENT (Optional - if player wants to fight) ###
country_event = {
	id = alg_deep_state.201
	title = alg_deep_state.201.t
	desc = alg_deep_state.201.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	option = {
		name = alg_deep_state.201.a # Attempt to resist the coup
		log = "[GetDateText]: [This.GetName]: alg_deep_state.201.a executed"
		trigger = {
			has_political_power > 200
			has_stability > 0.3
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				add = 2
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = deep_state_resist_coup_tt
		add_political_power = -200
		random_list = {
			40 = {
				custom_effect_tooltip = deep_state_resist_success_tt
				remove_ideas = ALG_military_junta_1
				add_ideas = ALG_post_coup_recovery
				set_variable = { deep_state_power = 15 }
				add_stability = -0.15
				clr_country_flag = deep_state_coup_fired
				clr_country_flag = alg_civil_war_risk
				set_politics = {
					ruling_party = democratic
					elections_allowed = yes
				}
				set_temp_variable = { rul_party_temp = 2 }
				change_ruling_party_effect = yes
			}
			60 = {
				custom_effect_tooltip = deep_state_resist_failed_tt
				add_stability = -0.20
				add_war_support = -0.10
				# Civil war potential
				set_country_flag = alg_civil_war_risk
				country_event = { id = alg_deep_state.202 days = 30 }
			}
		}
	}

	option = {
		name = alg_deep_state.201.b # Accept military rule
		log = "[GetDateText]: [This.GetName]: alg_deep_state.201.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = deep_state_accept_junta_tt
	}
}
# Civil War Breaks Out After Failed Coup Resistance
country_event = {
	id = alg_deep_state.202
	title = alg_deep_state.202.t
	desc = alg_deep_state.202.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_country_flag = alg_civil_war_risk
	}

	immediate = { clr_country_flag = alg_civil_war_risk }

	option = {
		name = alg_deep_state.202.a # The country descends into chaos
		log = "[GetDateText]: [This.GetName]: alg_deep_state.202.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				add = 2
				has_war_support > 0.50
			}
		}
		custom_effect_tooltip = alg_civil_war_erupts_tt
		add_stability = -0.15
		add_war_support = -0.10
		start_civil_war = {
			ideology = democratic
			size = 0.3
		}
	}

	option = {
		name = alg_deep_state.202.b # Negotiate to prevent bloodshed
		log = "[GetDateText]: [This.GetName]: alg_deep_state.202.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 200
			}
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = alg_civil_war_averted_tt
		add_political_power = -150
		add_stability = -0.05
		set_variable = { deep_state_power = 20 }
	}
}

### POST-COUP EVENTS ###
# Junta Consolidates Power
country_event = {
	id = alg_deep_state.210
	title = alg_deep_state.210.t
	desc = alg_deep_state.210.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_idea = ALG_military_junta_1
		NOT = { has_country_flag = junta_consolidated }
	}

	immediate = { set_country_flag = junta_consolidated }

	option = {
		name = alg_deep_state.210.a
		log = "[GetDateText]: [This.GetName]: alg_deep_state.210.a executed"
		custom_effect_tooltip = deep_state_junta_consolidates_tt
		add_stability = 0.05
		add_political_power = 100
	}
}

# International Reaction to Coup
country_event = {
	id = alg_deep_state.211
	title = alg_deep_state.211.t
	desc = alg_deep_state.211.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_idea = ALG_military_junta_1
		NOT = { has_country_flag = international_coup_reaction }
	}

	immediate = { set_country_flag = international_coup_reaction }

	option = {
		name = alg_deep_state.211.a # Ignore international criticism
		log = "[GetDateText]: [This.GetName]: alg_deep_state.211.a executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = deep_state_ignore_international_tt
		add_opinion_modifier = {
			target = FRA
			modifier = ALG_military_coup_opinion
		}
		add_opinion_modifier = {
			target = USA
			modifier = ALG_military_coup_opinion
		}
	}

	option = {
		name = alg_deep_state.211.b # Promise transition to democracy
		log = "[GetDateText]: [This.GetName]: alg_deep_state.211.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.30
			}
		}
		custom_effect_tooltip = deep_state_promise_democracy_tt
		add_timed_idea = {
			idea = ALG_promised_elections
			days = 730
		}
	}
}
# The Promised Elections
country_event = {
	id = alg_deep_state.220
	title = alg_deep_state.220.t
	desc = alg_deep_state.220.d
	picture = GFX_alg_deep_state
	is_triggered_only = yes

	option = {
		name = alg_deep_state.220.a
		log = "[GetDateText]: [This.GetName]: alg_deep_state.220.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		custom_effect_tooltip = deep_state_elections_held_tt
		set_variable = { deep_state_power = 10 }
		if = {
			limit = { has_idea = ALG_military_junta_1 }
			remove_ideas = ALG_military_junta_1
		}
		add_stability = 0.10
		add_opinion_modifier = { target = FRA modifier = ALG_fulfilled_election_promise }
		add_opinion_modifier = { target = USA modifier = ALG_fulfilled_election_promise }
	}

	option = {
		name = alg_deep_state.220.b
		log = "[GetDateText]: [This.GetName]: alg_deep_state.220.b executed"
		ai_chance = { base = 1 }
		add_stability = -0.10
		add_political_power = 50
		add_opinion_modifier = { target = FRA modifier = ALG_broke_election_promise }
		add_opinion_modifier = { target = USA modifier = ALG_broke_election_promise }
	}
}

news_event = {
	id = alg_deep_state_news.1
	title = alg_deep_state_news.1.t
	desc = alg_deep_state_news.1.d
	picture = GFX_army_coup_event
	is_triggered_only = yes
	major = yes

	trigger = { NOT = { tag = ALG } }

	immediate = { }

	option = {
		name = alg_deep_state_news.1.a
		trigger = {
			OR = {
				tag = FRA
				tag = USA
				is_in_faction_with = ALG
			}
		}
	}

	option = {
		name = alg_deep_state_news.1.b
		trigger = {
			NOT = {
				OR = {
					tag = FRA
					tag = USA
					is_in_faction_with = ALG
				}
			}
		}
	}
}

country_event = {
	id = ALG_tamazgha.1
	title = ALG_tamazgha.1.t
	desc = ALG_tamazgha.1.d
	picture = GFX_internal_faction_labour_dispute
	is_triggered_only = yes

	trigger = { has_country_flag = ALG_tamazgha_invitation_pending }

	immediate = { clr_country_flag = ALG_tamazgha_invitation_pending }

	option = { # Accept
		name = ALG_tamazgha.1.a
		log = "[GetDateText]: [This.GetName]: ALG_tamazgha.1.a executed"
		FROM = {
			add_to_faction = ROOT
		}
		ai_chance = {
			base = 40
			modifier = {
				factor = 2
				OR = {
					has_government = neutrality
					has_government = democratic
				}
			}
			modifier = {
				factor = 0
				has_war = yes
			}
		}
	}

	option = { # Decline
		name = ALG_tamazgha.1.b
		ai_chance = {
			base = 60
			modifier = {
				factor = 2
				is_in_faction = yes
			}
		}
	}
}


# Long-term stability recovery after Tamazight recognition
country_event = {
	id = alg_ethnic.10
	title = alg_ethnic.10.t
	desc = alg_ethnic.10.d
	picture = GFX_alg_hirak
	is_triggered_only = yes

	option = {
		name = alg_ethnic.10.a
		log = "[GetDateText]: [This.GetName]: alg_ethnic.10.a executed"
		add_stability = 0.03
		add_political_power = 50
		remove_ideas = ALG_tamazight_integration_process
	}
}

country_event = {
	id = alg_politics.10
	title = alg_politics.10.t
	desc = alg_politics.10.d
	picture = GFX_politics_talks
	is_triggered_only = yes

	# Compromise succeeds
	option = {
		name = alg_politics.10.a
		log = "[GetDateText]: [This.GetName]: alg_politics.10.a executed"
		ai_chance = { base = 50 }
		add_stability = 0.05
		add_political_power = 50
		add_timed_idea = {
			idea = ALG_political_truce
			days = 365
		}
	}

	option = {
		name = alg_politics.10.b
		log = "[GetDateText]: [This.GetName]: alg_politics.10.b executed"
		ai_chance = { base = 50 }
		add_stability = -0.03
		add_political_power = -25
	}

	# Compromise rejected
}
# Authoritarian Drift Warning (triggered at -0.60 to -0.80)
country_event = {
	id = alg_politics.22
	title = alg_politics.22.t
	desc = alg_politics.22.d
	picture = GFX_alg_flag
	is_triggered_only = yes

	# Double down on security
	option = {
		name = alg_politics.22.a
		log = "[GetDateText]: [This.GetName]: alg_politics.22.a executed"
		ai_chance = { base = 50 }
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.05
		}
		add_stability = -0.02
		add_war_support = 0.03
	}

	option = {
		name = alg_politics.22.b
		log = "[GetDateText]: [This.GetName]: alg_politics.22.b executed"
		ai_chance = { base = 50 }
		add_power_balance_value = {
			id = algeria_power_balance
			value = 0.10
		}
		add_stability = 0.02
		add_political_power = -50
	}

	# Pull back from the brink
}

# Democratic Surge Warning (triggered at +0.60 to +0.80)
country_event = {
	id = alg_politics.23
	title = alg_politics.23.t
	desc = alg_politics.23.d
	picture = GFX_TAJ_Army_reform
	is_triggered_only = yes

	# Push forward with reforms
	option = {
		name = alg_politics.23.a
		log = "[GetDateText]: [This.GetName]: alg_politics.23.a executed"
		ai_chance = {
			base = 50
			modifier = {
				factor = 3
				is_historical_focus_on = yes
			}
		}
		add_power_balance_value = {
			id = algeria_power_balance
			value = 0.05
		}
		add_stability = 0.02
		add_political_power = -50
	}

	option = {
		name = alg_politics.23.b
		log = "[GetDateText]: [This.GetName]: alg_politics.23.b executed"
		ai_chance = { base = 50 }
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.10
		}
		add_stability = -0.02
		add_war_support = 0.03
	}

	# Slow down to avoid backlash
}
# Reformist Victory (triggered at +0.80 to +1.00)
country_event = {
	id = alg_politics.20
	title = alg_politics.20.t
	desc = alg_politics.20.d
	picture = GFX_iranian_civ_war_country
	is_triggered_only = yes

	# Accept democratic transition
	option = {
		name = alg_politics.20.a
		log = "[GetDateText]: [This.GetName]: alg_politics.20.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.30
			}
			modifier = {
				add = 1
				has_war_support < 0.20
			}
			modifier = {
				add = 5
				has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
			}
		}
		set_politics = {
			ruling_party = democratic
			elections_allowed = yes
		}
		add_stability = -0.08
		add_political_power = 100
		add_popularity = {
			ideology = democratic
			popularity = 0.15
		}
		set_temp_variable = { rul_party_temp = 2 }
		change_ruling_party_effect = yes
		remove_power_balance = { id = algeria_power_balance }
		country_event = { id = ALG_hirak.100 days = 3 }
	}

	option = {
		log = "[GetDateText]: [This.GetName]: alg_politics.20.b executed"
		name = alg_politics.20.b
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
			}
			modifier = {
				add = 5
				has_global_flag = ALG_LE_POUVOIR_FOCUS_PATH
			}
			modifier = {
				add = 2
				has_war_support > 0.50
			}
			modifier = {
				add = 1
				has_stability > 0.60
			}
		}
		add_stability = -0.15
		add_war_support = 0.10
		start_civil_war = {
			ideology = nationalist
			size = 0.35
		}
	}
}

# Military Coup (triggered at -0.80 to -1.00)
country_event = {
	id = alg_politics.21
	title = alg_politics.21.t
	desc = alg_politics.21.d
	picture = GFX_TAJ_tajik_military
	is_triggered_only = yes

	# Accept military rule
	option = {
		name = alg_politics.21.a
		log = "[GetDateText]: [This.GetName]: alg_politics.21.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 5
				has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
			}
			modifier = {
				add = 1
				has_stability < 0.30
			}
		}
		create_country_leader = {
			name = "Said Chengriha"
			picture = "Said_Chengriha.dds"
			ideology = Nat_Autocracy
			traits = {
				nationalist_Nat_Autocracy
			}
		}
		set_politics = {
			ruling_party = nationalist
			elections_allowed = no
		}
		add_stability = -0.08
		add_war_support = 0.15
		add_popularity = {
			ideology = nationalist
			popularity = 0.15
		}
		set_temp_variable = { rul_party_temp = 22 }
		change_ruling_party_effect = yes
		remove_power_balance = { id = algeria_power_balance }
	}

	option = {
		name = alg_politics.21.b
		log = "[GetDateText]: [This.GetName]: alg_politics.21.b executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				add = 2
				has_war_support > 0.50
			}
			modifier = {
				add = 1
				has_stability > 0.60
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
			}
		}
		add_stability = -0.15
		start_civil_war = {
			ideology = democratic
			size = 0.30
		}
	}

	# Resist - civil war
}

# Protest event after arresting opponents
country_event = {
	id = alg_crackdown.1
	title = alg_crackdown.1.t
	desc = alg_crackdown.1.d
	picture = GFX_CAN_g20_riots_toronto
	is_triggered_only = yes

	option = { # Suppress harshly
		name = alg_crackdown.1.a
		log = "[GetDateText]: [This.GetName]: alg_crackdown.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_country_flag = ALG_crackdown_path
			}
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		add_stability = -0.02
		add_political_power = -25
		add_manpower = -500 # casualties
	}

	option = { # Make minor concessions
		name = alg_crackdown.1.b
		log = "[GetDateText]: [This.GetName]: alg_crackdown.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.50
			}
			modifier = {
				add = 1
				has_war_support < 0.30
			}
		}
		add_stability = 0.01
		add_popularity = {
			ideology = nationalist
			popularity = -0.05
		}
	}
}

# Major unrest after banning parties
country_event = {
	id = alg_crackdown.2
	title = alg_crackdown.2.t
	desc = alg_crackdown.2.d
	picture = GFX_great_recession_protests
	is_triggered_only = yes

	option = { # Deploy military
		name = alg_crackdown.2.a
		log = "[GetDateText]: [This.GetName]: alg_crackdown.2.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_country_flag = ALG_crackdown_path
			}
			modifier = {
				add = 1
				OR = {
					has_global_flag = ALG_LE_POUVOIR_FOCUS_PATH
					has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
				}
			}
		}
		add_stability = -0.05
		add_war_support = 0.03
		add_manpower = -2000
	}

	option = { # Negotiate
		name = alg_crackdown.2.b
		log = "[GetDateText]: [This.GetName]: alg_crackdown.2.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
		}
		remove_ideas = ALG_repression_modifier
		add_stability = 0.02
		add_popularity = {
			ideology = nationalist
			popularity = -0.05
		}
		clr_country_flag = ALG_crackdown_path
	}
}


news_event = {
	id = alg_politics_news.1
	title = alg_politics_news.1.t
	desc = alg_politics_news.1.d
	picture = GFX_algerian_protests
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	option = { name = alg_politics_news.1.a }
}
country_event = {
	id = ALG_faction.1
	title = ALG_faction.1.t
	desc = ALG_faction.1.d
	picture = GFX_retake_quds
	is_triggered_only = yes

	option = { #Yes
		name = ALG_faction.1.a
		log = "[GetDateText]: [This.GetName]: ALG_faction.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 3
				has_opinion = { target = ALG value > 50 }
			}
			modifier = {
				factor = 0
				has_war = yes
			}
			modifier = {
				factor = 0.3
				is_in_faction = yes
			}
		}
		every_country = {
			limit = {
				is_in_array = { array = global.middle_eastern_nations value = THIS.id }
			}
			ALG = { add_to_faction = PREV }
		}
	}

	option = {
		name = ALG_faction.1.b
		log = "[GetDateText]: [This.GetName]: ALG_faction.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_in_faction = yes
			}
			modifier = {
				add = 1
				has_war = yes
			}
			modifier = {
				add = 2
				has_opinion = { target = ALG value < 0 }
			}
		}
		every_country = {
			limit = {
				is_in_array = { array = global.middle_eastern_nations value = THIS.id }
			}
			add_opinion_modifier = {
				target = PREV
				modifier = declined_faction_request
			}
		}
	}
}
country_event = {
	id = ALG_faction.2
	title = ALG_faction.2.t
	desc = ALG_faction.2.d
	picture = GFX_retake_quds
	is_triggered_only = yes

	option = {
		name = ALG_faction.2.a
		log = "[GetDateText]: [This.GetName]: ALG_faction.2.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 3
				has_opinion = { target = ALG value > 50 }
			}
			modifier = {
				factor = 0
				has_war = yes
			}
			modifier = {
				factor = 0.3
				is_in_faction = yes
			}
		}
		if = {
			limit = {
				country_exists = MOR
				MOR = { has_idea = sunni }
			}
			ALG = { add_to_faction = MOR }
		}
		if = {
			limit = {
				country_exists = TUN
				TUN = { has_idea = sunni }
			}
			ALG = { add_to_faction = TUN }
		}
		if = {
			limit = {
				country_exists = LBA
				LBA = { has_idea = sunni }
			}
			ALG = { add_to_faction = LBA }
		}
		if = {
			limit = {
				country_exists = EGY
				EGY = { has_idea = sunni }
			}
			ALG = { add_to_faction = EGY }
		}
	}

	option = {
		name = ALG_faction.2.b
		log = "[GetDateText]: [This.GetName]: ALG_faction.2.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_in_faction = yes
			}
			modifier = {
				add = 1
				has_war = yes
			}
			modifier = {
				add = 2
				has_opinion = { target = ALG value < 0 }
			}
		}
		# Each country declines
		if = {
			limit = {
				country_exists = MOR
				MOR = { has_idea = sunni }
			}
			MOR = {
				add_opinion_modifier = {
					target = ALG
					modifier = declined_faction_request
				}
			}
		}
		if = {
			limit = {
				country_exists = TUN
				TUN = { has_idea = sunni }
			}
			TUN = {
				add_opinion_modifier = {
					target = ALG
					modifier = declined_faction_request
				}
			}
		}
		if = {
			limit = {
				country_exists = LBA
				LBA = { has_idea = sunni }
			}
			LBA = {
				add_opinion_modifier = {
					target = ALG
					modifier = declined_faction_request
				}
			}
		}
		if = {
			limit = {
				country_exists = EGY
				EGY = { has_idea = sunni }
			}
			EGY = {
				add_opinion_modifier = {
					target = ALG
					modifier = declined_faction_request
				}
			}
		}
	}
}
country_event = {
	id = ALG_faction.3
	title = ALG_faction.3.t
	desc = ALG_faction.3.d
	picture = GFX_retake_quds
	is_triggered_only = yes

	option = { #Yes
		name = ALG_faction.3.a
		log = "[GetDateText]: [This.GetName]: ALG_faction.3.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 3
				has_opinion = { target = ALG value > 50 }
			}
			modifier = {
				factor = 0
				has_war = yes
			}
			modifier = {
				factor = 0.3
				is_in_faction = yes
			}
		}
		every_country = {
			limit = {
				has_country_flag = asian_nation_flag
				has_idea = sunni
			}
			ALG = { add_to_faction = PREV }
		}
	}

	option = {
		name = ALG_faction.3.b
		log = "[GetDateText]: [This.GetName]: ALG_faction.3.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_in_faction = yes
			}
			modifier = {
				add = 1
				has_war = yes
			}
			modifier = {
				add = 2
				has_opinion = { target = ALG value < 0 }
			}
		}
		every_country = {
			limit = {
				has_country_flag = asian_nation_flag
				has_idea = sunni
			}
			add_opinion_modifier = {
				target = PREV
				modifier = declined_faction_request
			}
		}
	}
}
country_event = {
	id = ALG_FIS.2
	title = ALG_FIS.2.t
	desc = ALG_FIS.2.d
	picture = GFX_alg_fis
	is_triggered_only = yes

	option = {
		name = ALG_FIS.2.a
		log = "[GetDateText]: [This.GetName]: ALG_FIS.2.a executed"
		create_country_leader = {
			name = "Ali Belhadj"
			picture = "algeria_ali-benhadj.dds"
			ideology = Kingdom
			traits = {
				salafist_Kingdom
				anti_zionist
			}
		}
		ai_chance = { base = 1 }
	}

	option = {
		name = ALG_FIS.2.b
		log = "[GetDateText]: [This.GetName]: ALG_FIS.2.b executed"
		create_country_leader = {
			name = "Abdelhak Layada"
			picture = "Abdelhak Layada.dds"
			ideology = Kingdom
			traits = {
				salafist_Kingdom
				anti_zionist
			}
		}
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = ALG_FIS.1
	title = ALG_FIS.1.t
	desc = ALG_FIS.1.d
	picture = GFX_alg_fis
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = ALG_FIS.1.a
		log = "[GetDateText]: [This.GetName]: ALG_FIS.1.a executed"
		ai_chance = { base = 50 }
		swap_ideas = {
			remove_idea = industrial_conglomerates
			add_idea = wahabi_ulema
		}
		set_country_flag = ALG_followed_wahhabi_ulema
	}

	option = {
		name = ALG_FIS.1.b
		log = "[GetDateText]: [This.GetName]: ALG_FIS.1.b executed"
		ai_chance = { base = 50 }
		swap_ideas = {
			remove_idea = industrial_conglomerates
			add_idea = the_ulema
		}
		set_country_flag = ALG_followed_traditional_ulema
	}
}
country_event = {
	id = AlgeriaElections.1
	title = AlgeriaElections.1.t
	desc = AlgeriaElections.1.d
	picture = GFX_election
	is_triggered_only = yes

	option = {
		name = AlgeriaElections.1.a
		log = "[GetDateText]: [This.GetName]: AlgeriaElections.1.a executed"
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_global_flag = ALG_ISLAMIST_FOCUS_PATH
					has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
				}
			}
		}
		set_temp_variable = { rul_party_temp = 18 }
		change_ruling_party_effect = yes
		meta_effect = {
			text = {
				set_politics = {
					ruling_party = neutrality
					elections_allowed = yes
					last_election = "[YEAR].[MONTH].1"
					election_frequency = 60
				}
			}
			YEAR = global.year
			MONTH = global.month
		}
		hidden_effect = {
			set_variable = { term_limit = 2 }
			set_variable = { current_term = 1 }
		}
		set_temp_variable = { party_index = 18 }
		set_temp_variable = { party_popularity_increase = 0.40 }
		set_temp_variable = { temp_outlook_increase = 0.40 }
		change_relative_party_popularity = yes
		swap_ideas = {
			remove_idea = the_military
			add_idea = labour_unions
		}
		swap_ideas = {
			remove_idea = fossil_fuel_industry
			add_idea = farmers
		}
		swap_ideas = {
			remove_idea = industrial_conglomerates
			add_idea = landowners
		}
		set_temp_variable = { temp_opinion = 10 }
		change_labour_unions_opinion = yes
		set_temp_variable = { temp_opinion = 10 }
		change_farmers_opinion = yes
		set_temp_variable = { temp_opinion = 10 }
		change_landowners_opinion = yes
	}

	option = {
		name = AlgeriaElections.1.b
		log = "[GetDateText]: [This.GetName]: AlgeriaElections.1.b executed"
		ai_chance = {
			base = 25
			modifier = {
				factor = 10
				has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_ISLAMIST_FOCUS_PATH
			}
		}
		set_temp_variable = { rul_party_temp = 2 }
		change_ruling_party_effect = yes
		meta_effect = {
			text = {
				set_politics = {
					ruling_party = democratic
					elections_allowed = yes
					last_election = "[YEAR].[MONTH].1"
					election_frequency = 60
				}
			}
			YEAR = global.year
			MONTH = global.month
		}
		hidden_effect = {
			set_variable = { term_limit = 2 }
			set_variable = { current_term = 1 }
		}
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = 0.40 }
		set_temp_variable = { temp_outlook_increase = 0.40 }
		change_relative_party_popularity = yes
		swap_ideas = {
			remove_idea = the_military
			add_idea = international_bankers
		}
		set_temp_variable = { temp_opinion = 10 }
		change_international_bankers_opinion = yes
	}

	option = {
		name = AlgeriaElections.1.c
		log = "[GetDateText]: [This.GetName]: AlgeriaElections.1.c executed"
		ai_chance = {
			base = 25
			modifier = {
				factor = 10
				has_global_flag = ALG_ISLAMIST_FOCUS_PATH
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
			}
		}
		set_temp_variable = { rul_party_temp = 12 }
		change_ruling_party_effect = yes
		meta_effect = {
			text = {
				set_politics = {
					ruling_party = neutrality
					elections_allowed = yes
					last_election = "[YEAR].[MONTH].1"
					election_frequency = 60
				}
			}
			YEAR = global.year
			MONTH = global.month
		}
		hidden_effect = {
			set_variable = { term_limit = 2 }
			set_variable = { current_term = 1 }
		}
		set_temp_variable = { party_index = 12 }
		set_temp_variable = { party_popularity_increase = 0.40 }
		set_temp_variable = { temp_outlook_increase = 0.40 }
		change_relative_party_popularity = yes
		swap_ideas = {
			remove_idea = industrial_conglomerates
			add_idea = the_ulema
		}
		set_temp_variable = { temp_opinion = 10 }
		change_the_ulema_opinion = yes
	}

	option = {
		name = AlgeriaElections.1.dd
		log = "[GetDateText]: [This.GetName]: AlgeriaElections.1.dd executed"
		ai_chance = {
			base = 25
			modifier = {
				factor = 0
				OR = {
					has_global_flag = ALG_ISLAMIST_FOCUS_PATH
					has_global_flag = ALG_HIRAK_DEMOCRACY_FOCUS_PATH
				}
			}
		}
		set_temp_variable = { rul_party_temp = 16 }
		change_ruling_party_effect = yes
		meta_effect = {
			text = {
				set_politics = {
					ruling_party = neutrality
					elections_allowed = yes
					last_election = "[YEAR].[MONTH].1"
					election_frequency = 60
				}
			}
			YEAR = global.year
			MONTH = global.month
		}
		hidden_effect = {
			set_variable = { term_limit = 2 }
			set_variable = { current_term = 1 }
		}
		set_temp_variable = { party_index = 16 }
		set_temp_variable = { party_popularity_increase = 0.40 }
		set_temp_variable = { temp_outlook_increase = 0.40 }
		change_relative_party_popularity = yes
		swap_ideas = {
			remove_idea = the_military
			add_idea = labour_unions
		}
		swap_ideas = {
			remove_idea = fossil_fuel_industry
			add_idea = farmers
		}
		swap_ideas = {
			remove_idea = industrial_conglomerates
			add_idea = landowners
		}
		set_temp_variable = { temp_opinion = 10 }
		change_labour_unions_opinion = yes
		set_temp_variable = { temp_opinion = 10 }
		change_farmers_opinion = yes
		set_temp_variable = { temp_opinion = 10 }
		change_landowners_opinion = yes
	}
}
country_event = {
	id = algerian.1
	title = algerian.1.t
	desc = algerian.1.d
	picture = GFX_generic_tractor_manufacturer
	is_triggered_only = yes

	option = {
		name = algerian.1.a
		log = "[GetDateText]: [This.GetName]: algerian.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0.90
				has_opinion = { target = ALG value < 10 }
			}
			modifier = {
				factor = 0.80
				has_opinion = { target = ALG value < -10 }
			}
			modifier = {
				factor = 0.65
				has_opinion = { target = ALG value < -30 }
			}
			modifier = {
				factor = 0.40
				has_opinion = { target = ALG value < -60 }
			}
			modifier = {
				factor = 0.30
				has_opinion = { target = ALG value < -80 }
			}
			modifier = {
				factor = 0.10
				has_opinion = { target = ALG value < -90 }
			}
			modifier = {
				factor = 0
				has_opinion = { target = ALG value < -100 }
			}
		}
		ALG = {
			random_owned_controlled_state = {
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			country_event = { id = algerian.4 days = 1 }
		}
		set_temp_variable = { percent_change = 1.5 }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = -7 }
		modify_treasury_effect = yes
	}

	option = {
		name = algerian.1.b
		log = "[GetDateText]: [This.GetName]: algerian.1.b executed"
		ALG = { country_event = { id = algerian.5 days = 1 } }
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algerian.4
	title = algerian.4.t
	desc = algerian.4.d
	picture = GFX_handshake_black
	is_triggered_only = yes

	option = {
		name = algerian.4.a
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = algerian.5
	title = algerian.5.t
	desc = algerian.5.d
	picture = GFX_declined_offer_no
	is_triggered_only = yes

	option = {
		name = algerian.5.a
		ai_chance = { base = 5 }
	}
}
#Investments
country_event = {
	id = algeria_invest.1
	title = algeria_invest.1.t
	desc = algeria_invest.1.d
	picture = GFX_chinese_yuan
	is_triggered_only = yes

	option = {
		name = algeria_invest.1.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.1.a executed"
		ALG = {
			random_owned_controlled_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = fossil_powerplant
					level = 1
					instant_build = yes
				}
			}
			country_event = { id = algeria_invest.2 days = 1 }
		}
		set_temp_variable = { percent_change = 5 }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		ai_chance = {
			base = 1
			modifier = {
				factor = 0.90
				has_opinion = { target = ALG value < 10 }
			}
			modifier = {
				factor = 0.80
				has_opinion = { target = ALG value < -10 }
			}
			modifier = {
				factor = 0.65
				has_opinion = { target = ALG value < -30 }
			}
			modifier = {
				factor = 0.40
				has_opinion = { target = ALG value < -60 }
			}
			modifier = {
				factor = 0.30
				has_opinion = { target = ALG value < -80 }
			}
			modifier = {
				factor = 0.10
				has_opinion = { target = ALG value < -90 }
			}
			modifier = {
				factor = 0
				has_opinion = { target = ALG value < -100 }
			}
		}
	}

	option = {
		name = algeria_invest.1.b
		log = "[GetDateText]: [This.GetName]: algeria_invest.1.b executed"
		ALG = { country_event = { id = algeria_invest.3 days = 1 } }
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algeria_invest.2 # they agreed
	title = algeria_invest.2.t
	desc = algeria_invest.2.d
	picture = GFX_chinese_yuan
	is_triggered_only = yes

	option = {
		name = algeria_invest.2.a
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = algeria_invest.3 # disagree
	title = algeria_invest.3.t
	desc = algeria_invest.3.d
	picture = GFX_chinese_yuan
	is_triggered_only = yes

	option = {
		name = algeria_invest.3.a
		ai_chance = { base = 5 }
	}
}
#USA Investments
country_event = {
	id = algeria_invest.4
	title = algeria_invest.4.t
	desc = algeria_invest.4.d
	picture = GFX_united_states_dollar
	is_triggered_only = yes

	option = {
		name = algeria_invest.4.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.4.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0.90
				has_opinion = { target = ALG value < 10 }
			}
			modifier = {
				factor = 0.80
				has_opinion = { target = ALG value < -10 }
			}
			modifier = {
				factor = 0.65
				has_opinion = { target = ALG value < -30 }
			}
			modifier = {
				factor = 0.40
				has_opinion = { target = ALG value < -60 }
			}
			modifier = {
				factor = 0.30
				has_opinion = { target = ALG value < -80 }
			}
			modifier = {
				factor = 0.10
				has_opinion = { target = ALG value < -90 }
			}
			modifier = {
				factor = 0
				has_opinion = { target = ALG value < -100 }
			}
		}
		ALG = {
			set_temp_variable = { skip_payment = 1 }
			one_random_industrial_complex = yes
			random_owned_controlled_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = offices
					level = 1
					instant_build = yes
				}
			}
			country_event = { id = algeria_invest.5 days = 1 }
		}
		set_temp_variable = { percent_change = 5 }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
	}

	option = {
		name = algeria_invest.4.b
		log = "[GetDateText]: [This.GetName]: algeria_invest.4.b executed"
		ALG = { country_event = { id = algeria_invest.6 days = 1 } }
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algeria_invest.5 # they agreed
	title = algeria_invest.5.t
	desc = algeria_invest.5.d
	picture = GFX_united_states_dollar
	is_triggered_only = yes

	option = {
		name = algeria_invest.5.a
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = algeria_invest.6 #dont accept
	title = algeria_invest.6.t
	desc = algeria_invest.6.d
	picture = GFX_united_states_dollar
	is_triggered_only = yes

	option = {
		name = algeria_invest.6.a
		ai_chance = { base = 5 }
	}
}
#Russian Investments
country_event = {
	id = algeria_invest.7
	title = algeria_invest.7.t
	desc = algeria_invest.7.d
	picture = GFX_russian_rubles
	is_triggered_only = yes

	option = {
		name = algeria_invest.7.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.7.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				ALG = { is_subject_of = SOV }
			}
			modifier = {
				factor = 0.90
				has_opinion = { target = ALG value < 10 }
			}
			modifier = {
				factor = 0.80
				has_opinion = { target = ALG value < -10 }
			}
			modifier = {
				factor = 0.65
				has_opinion = { target = ALG value < -30 }
			}
			modifier = {
				factor = 0.40
				has_opinion = { target = ALG value < -60 }
			}
			modifier = {
				factor = 0.30
				has_opinion = { target = ALG value < -80 }
			}
			modifier = {
				factor = 0.10
				has_opinion = { target = ALG value < -90 }
			}
			modifier = {
				factor = 0
				has_opinion = { target = ALG value < -100 }
			}
			modifier = {
				factor = 0.5
				has_war = yes
			}
		}
		ALG = {
			set_temp_variable = { skip_payment = 1 }
			one_random_arms_factory = yes
			random_owned_controlled_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = offices
					level = 1
					instant_build = yes
				}
			}
			country_event = { id = algeria_invest.8 days = 1 }
		}
		set_temp_variable = { percent_change = 5 }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
	}

	option = {
		name = algeria_invest.7.b
		log = "[GetDateText]: [This.GetName]: algeria_invest.7.b executed"
		ALG = { country_event = { id = algeria_invest.9 days = 1 } }
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algeria_invest.8 # they agreed
	title = algeria_invest.8.t
	desc = algeria_invest.8.d
	picture = GFX_russian_rubles
	is_triggered_only = yes

	option = {
		name = algeria_invest.8.a
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = algeria_invest.9 #dont accept
	title = algeria_invest.9.t
	desc = algeria_invest.9.d
	picture = GFX_russian_rubles
	is_triggered_only = yes

	option = {
		name = algeria_invest.9.a
		ai_chance = { base = 5 }
	}
}
#Algeris Metro
country_event = {
	id = algeria_invest.10
	title = algeria_invest.10.t
	desc = algeria_invest.10.d
	picture = GFX_krasnodar_metro
	is_triggered_only = yes

	option = {
		name = algeria_invest.10.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.10.a executed"
		set_temp_variable = { percent_change = 8 }
		set_temp_variable = { tag_index = CHI }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		add_dynamic_modifier = { modifier = ALG_algiers_metro }
		ai_chance = { base = 5 }
	}

	option = {
		name = algeria_invest.10.b
		log = "[GetDateText]: [This.GetName]: algeria_invest.10.b executed"
		custom_effect_tooltip = steal_turkish_money_tt
		hidden_effect = {
			ALG = {
				set_temp_variable = { treasury_change = 10 }
				modify_treasury_effect = yes
			}
			CHI = {
				set_temp_variable = { treasury_change = -10 }
				modify_treasury_effect = yes
			}
		}
		CHI = { country_event = { id = algeria_invest.11 days = 1 } }
		set_temp_variable = { percent_change = -8 }
		set_temp_variable = { tag_index = CHI }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algeria_invest.11
	title = algeria_invest.11.t
	desc = algeria_invest.11.d
	picture = GFX_krasnodar_metro
	is_triggered_only = yes

	option = {
		name = algeria_invest.11.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.11.a executed"
		add_opinion_modifier = {
			target = ALG
			modifier = large_decrease
		}
		add_political_power = -100
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = algeria_invest.12
	title = algeria_invest.12.t
	desc = algeria_invest.12.d
	picture = GFX_generic_train_event
	is_triggered_only = yes

	option = {
		name = algeria_invest.12.a
		log = "[GetDateText]: [This.GetName]: algeria_invest.12.a executed"
		set_temp_variable = { treasury_change = 10 }
		modify_treasury_effect = yes
		ai_chance = { base = 5 }
	}
}
# Desertification increases
country_event = {
	id = ALG_pulse.1
	title = ALG_pulse.1.t
	desc = ALG_pulse.1.d
	picture = GFX_amazon_rainforest_drought
	is_triggered_only = yes

	option = {
		log = "[GetDateText]: [This.GetName]: ALG_pulse.1.a executed"
		name = ALG_pulse.1.a
		ALG_increase_desertification = yes
	}
}

# Desertification steady
country_event = {
	id = ALG_pulse.2
	title = ALG_pulse.2.t
	desc = ALG_pulse.2.d
	picture = GFX_amazon_rainforest_drought
	is_triggered_only = yes

	option = { name = ALG_pulse.2.a }
}

# Desertification decreases
country_event = {
	id = ALG_pulse.3
	title = ALG_pulse.3.t
	desc = ALG_pulse.3.d
	picture = GFX_amazon_rainforest_drought
	is_triggered_only = yes

	option = {
		log = "[GetDateText]: [This.GetName]: ALG_pulse.3.a executed"
		name = ALG_pulse.3.a
		ALG_decrease_desertification = yes
	}
}
country_event = {
	id = Algeria.409
	title = Algeria.409.t
	desc = Algeria.409.d
	picture = GFX_libya_tuareg_militas
	is_triggered_only = yes

	# Media Outreach
	option = {
		name = Algeria.409.a
		log = "[GetDateText]: [This.GetName]: Algeria.409.a executed"
		add_tech_bonus = {
			name = Algeria.409.t
			bonus = 0.5
			uses = 1
			category = CAT_internet
		} hidden_effect = { rq_eb_7763e2bba5 = yes }
		set_temp_variable = { percent_change = 2.5 }
		set_temp_variable = { tag_index = ALG }
		set_temp_variable = { influence_target = TUA }
		change_influence_percentage = yes
		ai_chance = { base = 5 }
	}

	option = {
		name = Algeria.409.b
		log = "[GetDateText]: [This.GetName]: Algeria.409.b executed"
		TUA = {
			add_popularity = {
				ideology = democratic
				popularity = 0.035
			}
			set_temp_variable = { party_popularity_increase = -0.095 }
			set_temp_variable = { temp_outlook_increase = -0.05 }
			change_relative_party_popularity = yes
		}
		ai_chance = { base = 5 }
	}

	# Secret support to tuareg leaders
}
country_event = {
	id = Algeria.237
	title = Algeria.237.t
	desc = Algeria.237.d
	picture = GFX_mali_tuareg_rebels
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = Algeria.237.a
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = Algeria.238
	title = Algeria.238.t
	desc = Algeria.238.d
	picture = GFX_mali_tuareg_rebels
	is_triggered_only = yes

	trigger = { original_tag = ALG }

	# Support the Malian Government
	option = {
		name = Algeria.238.a
		log = "[GetDateText]: [This.GetName]: Algeria.238.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_historical_focus_on = yes
			}
			modifier = {
				add = 1
				has_opinion = { target = MAL value > 25 }
			}
		}
		add_relation_modifier = {
			target = MAL
			modifier = generic_increased_military_support
		}
		set_country_flag = ALG_supp_mali
	}

	option = {
		name = Algeria.238.b
		log = "[GetDateText]: [This.GetName]: Algeria.238.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = TUA value > 25 }
			}
			modifier = {
				add = 1
				NOT = { is_historical_focus_on = yes }
			}
		}
		add_relation_modifier = {
			target = TUA
			modifier = generic_increased_military_support
		}
		set_country_flag = ALG_supp_tuareg
	}

	# Support the Tuaregs
}
country_event = {
	id = algerian_event.51
	title = algerian_event.51.t
	desc = algerian_event.51.d
	picture = GFX_moonbase
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algerian_event.51.a
		log = "[GetDateText]: [This.GetName]: algerian_event.51.a executed"
		add_political_power = 120
		add_war_support = 0.05
		set_temp_variable = { party_popularity_increase = 0.05 }
		set_temp_variable = { temp_outlook_increase = 0.05 }
		change_relative_party_popularity = yes
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = ALG_flavor_event.6
	title = ALG_flavor_event.6.t
	desc = ALG_flavor_event.6.d
	picture = GFX_refugees_turkey
	is_triggered_only = yes

	option = {
		name = ALG_flavor_event.6.a
		log = "[GetDateText]: [This.GetName]: ALG_flavor_event.6.a executed"
		add_ideas = large_refugee_population
		set_country_flag = ALG_migration_flood
		custom_effect_tooltip = ALG_unlocks_focus_for_us
		random_owned_state = {
			set_temp_variable = { movable_pop = THIS.state_population_k }
			multiply_temp_variable = { movable_pop = 2 }
		}
		random_owned_state = {
			limit = {
				NOT = {
					OR = {
						has_state_category = state_08
						has_state_category = state_09
						has_state_category = state_10
						has_state_category = state_11
						has_state_category = state_12
						has_state_category = state_13
						has_state_category = state_14
						has_state_category = state_15
						has_state_category = state_16
						has_state_category = state_17
						has_state_category = state_18
					}
				}
			}
			add_manpower = movable_pop
		}
		ai_chance = { base = 5 }
	}
}
#
country_event = {
	id = ALG_flavor_event.7
	title = ALG_flavor_event.7.t
	desc = ALG_flavor_event.7.d
	picture = GFX_court
	is_triggered_only = yes

	option = {
		name = ALG_flavor_event.7.a
		log = "[GetDateText]: [This.GetName]: ALG_flavor_event.7.a executed"
		add_ideas = ALG_drug_problem
		custom_effect_tooltip = ALG_unlocks_focus_for_us
		set_country_flag = ALG_drugs
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = alg_resistance.1
	title = alg_resistance.1.t
	desc = alg_resistance.1.d
	picture = GFX_weapons_arms1
	is_triggered_only = yes

	option = {
		name = alg_resistance.1.a
		set_country_flag = ALG_resistance_wins
		add_popularity = { ideology = democratic popularity = 0.15 }
		add_stability = 0.1
		add_political_power = 100
		log = "[GetDateText]: [This.GetName]: alg_resistance.1.a executed"
	}
}

news_event = {
	id = alg_resistance.2
	title = alg_resistance.2.t
	desc = alg_resistance.2.d
	picture = GFX_army_coup_event
	is_triggered_only = yes

	option = {
		name = alg_resistance.2.a
		set_country_flag = ALG_pouvoir_wins
		add_popularity = { ideology = neutrality popularity = 0.15 }
		add_stability = 0.05
		add_political_power = 50
		log = "[GetDateText]: [This.GetName]: alg_resistance.2.a executed"
	}
}

country_event = {
	id = alg_resistance.3
	title = alg_resistance.3.t
	desc = alg_resistance.3.d
	picture = GFX_politics_protest
	is_triggered_only = yes

	option = {
		name = alg_resistance.3.a
		log = "[GetDateText]: [This.GetName]: alg_resistance.3.a executed"
		set_country_flag = ALG_junta
		add_stability = -0.1
		add_war_support = -0.1
		add_political_power = -75
		country_event = { id = alg_resistance.4 days = 45 }
	}
}
country_event = {
	id = alg_resistance.4
	title = alg_resistance.4.t
	desc = alg_resistance.4.d
	picture = GFX_election_rally
	is_triggered_only = yes

	option = {
		name = alg_resistance.4.a
		log = "[GetDateText]: [This.GetName]: alg_resistance.4.a executed"
		ai_chance = {
			base = 10
			modifier = {
				factor = 4
				has_stability < 0.35
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
			}
		}
		add_stability = 0.05
		add_political_power = -100
		add_war_support = -0.05
		clr_country_flag = ALG_junta
		clr_country_flag = ALG_resistance_path
		add_ideas = ALG_civilian_government
	}

	option = {
		name = alg_resistance.4.b
		log = "[GetDateText]: [This.GetName]: alg_resistance.4.b executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 10
				has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
			}
		}
		add_stability = -0.2
		start_civil_war = {
			ideology = neutrality
			size = 0.35
		}
	}
}
country_event = {
	id = algeria_intro.1
	title = "algeria_intro.1.t"
	desc = "algeria_intro.1.d"
	picture = GFX_algeria_intro
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = "algeria_intro.1.a" }
}
country_event = {
	id = alg_general.1
	title = alg_general.1.t
	desc = alg_general.1.d
	picture = GFX_alg_nezzar
	is_triggered_only = yes

	option = {
		log = "[GetDateText]: [This.GetName]: alg_general.1.a executed"
		name = alg_general.1.a
		set_country_flag = ALG_unlock_khaled_nezzar
		effect_tooltip = {
			create_field_marshal = {
				name = "Khaled Nezzar"
				portrait_path = "gfx/leaders/ALG/Khaled_Nezzar.dds"
				traits = { organizer war_hero }
				skill = 3
				attack_skill = 2
				defense_skill = 4
				planning_skill = 2
				logistics_skill = 3
			}
		}
		add_political_power = -50
	}
}
country_event = {
	id = ALG_morocco.1
	title = ALG_morocco.1.t
	desc = ALG_morocco.1.d
	picture = GFX_alg_flag
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = ALG_morocco.1.a # "Condemn Morocco Harshly / Court great powers"
		log = "[GetDateText]: [This.GetName]: ALG_morocco.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_political_power = -50
		set_variable = { algeria_casablanca_approach = 1 }
		hidden_effect = { news_event = { id = AlgeriaFocusNews.100 hours = 6 } }
	}

	option = {
		name = ALG_morocco.1.b # "Push moderate sanctions and keep regional control"
		log = "[GetDateText]: [This.GetName]: ALG_morocco.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability > 0.50
			}
		}
		add_stability = -0.02
		add_political_power = 20
		set_variable = { algeria_casablanca_approach = 0 }
		hidden_effect = { news_event = { id = AlgeriaFocusNews.101 hours = 6 } }
	}
}
country_event = {
	id = ALG_morocco.2
	title = ALG_morocco.2.t
	desc = ALG_morocco.2.d
	picture = GFX_handshake_black
	is_triggered_only = yes
	fire_only_once = yes

	trigger = { tag = MOR }

	option = {
		name = ALG_morocco.2.a
		log = "[GetDateText]: [This.GetName]: ALG_morocco.2.a"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		set_temp_variable = { percent_change = -6 }
		change_domestic_influence_percentage = yes
		ALG = {
			set_temp_variable = { percent_change = 6 }
			change_domestic_influence_percentage = yes
		}
		add_opinion_modifier = {
			target = ALG
			modifier = unwanted_pressure
		}
		add_political_power = -20
		add_stability = -0.02
	}

	option = {
		name = ALG_morocco.2.b
		log = "[GetDateText]: [This.GetName]: ALG_morocco.2.b"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_war_support > 0.50
			}
			modifier = {
				add = 1
				has_opinion = { target = USA value < 0 }
			}
		}
		add_stability = -0.03
		add_political_power = -50
		USA = { add_opinion_modifier = { target = MOR modifier = sanctions_relations } }
	}
}
news_event = {
	id = AlgeriaFocusNews.100
	title = AlgeriaFocusNews.100.t
	desc = AlgeriaFocusNews.100.d
	picture = GFX_UN_event_global
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.100.a }
}

news_event = {
	id = AlgeriaFocusNews.101
	title = AlgeriaFocusNews.101.t
	desc = AlgeriaFocusNews.101.d
	picture = GFX_news_arab_spring
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.101.a }
}

news_event = {
	id = AlgeriaFocusNews.102
	title = AlgeriaFocusNews.102.t
	desc = AlgeriaFocusNews.102.d
	picture = GFX_UN_event_global_2
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.102.a }
}

news_event = {
	id = AlgeriaFocusNews.103
	title = AlgeriaFocusNews.103.t
	desc = AlgeriaFocusNews.103.d
	picture = GFX_news_trade_agreement
	is_triggered_only = yes
	major = yes

	option = { name = AlgeriaFocusNews.103.a }
}

news_event = {
	id = AlgeriaFocusNews.104
	title = AlgeriaFocusNews.104.t
	desc = AlgeriaFocusNews.104.d
	picture = GFX_news_trade_agreement
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.104.a }
}

news_event = {
	id = AlgeriaFocusNews.105
	title = AlgeriaFocusNews.105.t
	desc = AlgeriaFocusNews.105.d
	picture = GFX_news_trade_agreement
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.105.a }
}

news_event = {
	id = AlgeriaFocusNews.106
	title = AlgeriaFocusNews.106.t
	desc = AlgeriaFocusNews.106.d
	picture = GFX_news_crime_fighting
	is_triggered_only = yes

	option = { name = AlgeriaFocusNews.106.a }
}
news_event = {
	id = algeria_morocco.1
	title = algeria_morocco.1.t
	desc = algeria_morocco.1.d
	picture = GFX_alg_mor
	is_triggered_only = yes
	major = yes

	option = {
		name = algeria_morocco.1.a
		trigger = { tag = ALG }
	}

	option = {
		name = algeria_morocco.1.b
		trigger = { NOT = { tag = ALG } }
	}
}
news_event = {
	id = algeria.5
	title = algeria.5.t
	desc = algeria.5.d
	picture = GFX_alg_PT
	is_triggered_only = yes
	major = yes

	option = {
		name = algeria.5.a
		trigger = { tag = ALG }
	}

	option = {
		name = algeria.5.b
		trigger = { NOT = { tag = ALG } }
	}
}
news_event = {
	id = algeria.7
	title = algeria.7.t
	desc = algeria.7.d
	picture = GFX_alg_PT
	is_triggered_only = yes
	major = yes

	option = {
		name = algeria.7.a
		trigger = { tag = ALG }
	}

	option = {
		name = algeria.7.b
		trigger = { NOT = { tag = ALG } }
	}
}
country_event = {
	id = ALG_hirak.100
	title = ALG_hirak.100.t
	desc = ALG_hirak.100.d
	picture = GFX_collectiv_protests
	is_triggered_only = yes
	fire_only_once = yes

	option = { # 1 - Zoubida Assoul
		name = ALG_hirak.100.a
		log = "[GetDateText]: [This.GetName]: ALG_hirak.100.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_historical_focus_on = yes
			}
		}
		add_popularity = { ideology = democratic popularity = 0.20 }
		set_temp_variable = { rul_party_temp = 2 }
		change_ruling_party_effect = yes
		create_country_leader = {
			name = "Zoubida Assoul"
			picture = "Zoubida_Assoul.dds"
			ideology = liberalism
			traits = { western_liberalism }
		}
		#set_country_flag = ALG_assoul_president
	}

	option = { # 2 - Karim Tabbou
		name = ALG_hirak.100.b
		log = "[GetDateText]: [This.GetName]: ALG_hirak.100.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
		}
		add_popularity = { ideology = democratic popularity = 0.25 }
		set_temp_variable = { rul_party_temp = 2 }
		change_ruling_party_effect = yes
		create_country_leader = {
			name = "Karim Tabbou"
			picture = "Karim_Tabbou.dds"
			ideology = liberalism
			traits = { western_liberalism }
		}
		#set_country_flag = ALG_tabbou_president
	}

	option = { # 3 - Hakim Addad
		name = ALG_hirak.100.c
		log = "[GetDateText]: [This.GetName]: ALG_hirak.100.c executed"
		ai_chance = {
			base = 1
		}
		add_popularity = { ideology = democratic popularity = 0.15 }
		set_temp_variable = { rul_party_temp = 3 }
		change_ruling_party_effect = yes
		create_country_leader = {
			name = "Hakim Addad"
			picture = "Hakim_Addad.dds"
			ideology = socialism
			traits = { western_socialism }
		}
		#set_country_flag = ALG_addad_president
	}

	option = { # 4 - Amira Bouraoui
		name = ALG_hirak.100.e
		log = "[GetDateText]: [This.GetName]: ALG_hirak.100.e executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.60
			}
		}
		add_popularity = { ideology = democratic popularity = 0.15 }
		set_temp_variable = { rul_party_temp = 3 }
		change_ruling_party_effect = yes
		create_country_leader = {
			name = "Amira Bouraoui"
			picture = "Amira_Bouraoui.dds"
			ideology = socialism
			traits = { western_socialism }
		}
		#set_country_flag = ALG_bouraoui_president
	}
}
country_event = {
	id = ALG_bouteflika_resigns.1
	title = ALG_bouteflika_resigns.1.t
	desc = ALG_bouteflika_resigns.1.d
	picture = GFX_tudose_resigns
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		has_completed_focus = ALG_bouteflika_health_crisis
		power_balance_value = { id = algeria_power_balance value > 0.45 } # Hirak strong
	}

	immediate = {
		clr_country_flag = ALG_boteflika
		set_country_flag = ALG_bouteflika_resigned
		kill_country_leader = yes
	}

	option = {
		name = ALG_bouteflika_resigns.1.a
		log = "[GetDateText]: [This.GetName]: ALG_bouteflika_resigns.1.a executed"
		ai_chance = { base = 100 }
		add_stability = -0.10
		add_war_support = -0.05
		add_political_power = -100
		country_event = { id = ALG_interim_president.1 days = 2 }
	}
}
country_event = {
	id = ALG_interim_president.1
	title = ALG_interim_president.1.t
	desc = ALG_interim_president.1.d
	picture = GFX_EST_PresidentalElections
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		has_country_flag = ALG_bouteflika_resigned
		NOT = { has_country_flag = ALG_interim_president_chosen }
	}

	immediate = { set_country_flag = ALG_interim_president_chosen }

	option = {
		name = ALG_interim_president.1.a # Historical Path
		log = "[GetDateText]: [This.GetName]: ALG_interim_president.1.a executed"
		ai_chance = { base = 90 }
		add_stability = -0.05
		add_political_power = -50
		create_country_leader = {
			name = "Abdelkader Bensalah"
			picture = "Abdelkader_Bensalah.dds"
			expire = "2019.12.31"
			ideology = Conservative
			traits = { emerging_Conservative }
		}
	}
}
country_event = {
	id = alg_generals.1
	title = alg_generals.1.t
	desc = alg_generals.1.d
	picture = GFX_TAJ_Army_reform
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
	}

	option = { name = alg_generals.1.a }
}
country_event = {
	id = alg_generals.2
	title = alg_generals.2.t
	desc = alg_generals.2.d
	picture = GFX_TAJ_Army_reform
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
	}

	option = { name = alg_generals.2.a }
}
country_event = {
	id = alg_generals.3
	title = alg_generals.3.t
	desc = alg_generals.3.d
	picture = GFX_TAJ_Army_reform
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
	}

	option = { name = alg_generals.3.a }
}


news_event = {
	id = algeria_gspc.1
	title = algeria_gspc.1.t
	desc = algeria_gspc.1.d
	picture = GFX_islamic_state
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
	}

	option = {
		name = algeria_gspc.1.a
		log = "[GetDateText]: [This.GetName]: algeria_gspc.1.a executed"
		custom_effect_tooltip = ALG_sahraoui_rise_tt
		set_country_flag = ALG_sahraoui_takes_lead
		add_stability = -0.03
		set_variable = { Caliphate_leader = 1 } # moves leadership to Sahraoui
	}
}
news_event = {
	id = algeria_gspc.2
	title = algeria_gspc.2.t
	desc = algeria_gspc.2.d
	picture = GFX_alg_droukdel2
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	trigger = {
		has_country_flag = ALG_sahraoui_takes_lead
	}

	option = {
		name = algeria_gspc.2.a
		log = "[GetDateText]: [This.GetName]: algeria_gspc.2.a executed"
		custom_effect_tooltip = ALG_droukdel_rise_tt
		clr_country_flag = ALG_sahraoui_takes_lead
		set_country_flag = ALG_droukdel_takes_lead
		add_stability = -0.04
		set_variable = { Caliphate_leader = 2 } # moves leadership to Droukdel
	}
}
country_event = {
	id = algeria_gspc.3
	title = algeria_gspc.3.t
	desc = algeria_gspc.3.d
	picture = GFX_alg_droukdel3
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		has_country_flag = ALG_droukdel_takes_lead
	}

	option = {
		name = algeria_gspc.3.a
		log = "[GetDateText]: [This.GetName]: algeria_gspc.3.a executed"
		custom_effect_tooltip = ALG_hattab_surrender_tt
		add_stability = 0.05
	}
}
country_event = {
	id = alg_mufti.2
	title = alg_mufti.2.t
	desc = alg_mufti.2.d
	picture = GFX_muslim_protest
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		has_completed_focus = ALG_islam_above_the_nation
	}

	option = {
		name = alg_mufti.2.a # Support Nahda (Djaballah)
		log = "[GetDateText]: [This.GetName]: alg_mufti.2.a executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = alg_mufti.2.a.tt
		add_popularity = { ideology = neutrality popularity = 0.10 }
		add_political_power = -50
		set_country_flag = ALG_nahda_path
		set_temp_variable = { temp_opinion = 5 }
		change_the_ulema_opinion = yes
		set_temp_variable = { temp_opinion = 5 }
		change_the_military_opinion = yes
	}

	option = {
		name = alg_mufti.2.b # Follow the Ulema
		log = "[GetDateText]: [This.GetName]: alg_mufti.2.b executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = alg_mufti.2.b.tt
		add_popularity = { ideology = neutrality popularity = 0.05 }
		add_stability = 0.05
		set_country_flag = ALG_ulema_path
		set_temp_variable = { temp_opinion = 10 }
		change_the_ulema_opinion = yes
		set_temp_variable = { temp_opinion = -5 }
		change_the_military_opinion = yes
	}
}
country_event = {
	id = alg_mufti.3
	title = alg_mufti.3.t
	desc = alg_mufti.3.d
	picture = GFX_muslim_protest
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = alg_mufti.3.a # Support Belhadj
		log = "[GetDateText]: [This.GetName]: alg_mufti.3.a executed"
		ai_chance = {
			base = 1
		}
		custom_effect_tooltip = alg_mufti.3.a.tt
		create_country_leader = {
			name = "Ali Belhadj"
			picture = "algeria_ali-benhadj.dds"
			ideology = Caliphate
			desc = "ALG_ali_belhadj_desc"
			traits = {
				salafist_Caliphate
			}
		}
		#set_country_flag = ALG_belhadj_leader
	}

	option = {
		name = alg_mufti.3.b # Support Bouamrane
		log = "[GetDateText]: [This.GetName]: alg_mufti.3.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		custom_effect_tooltip = alg_mufti.3.b.tt
		create_country_leader = {
			name = "Cheikh Bouamrane"
			picture = "bouamrane.dds"
			expire = "2016.05.12"
			ideology = Neutral_Autocracy
			desc = "ALG_bouamrane_desc"
			traits = {
				neutrality_Neutral_Autocracy
			}
		}
		#set_country_flag = ALG_bouamrane_leader
	}
}

# National Policy Trigger Event
country_event = {
	id = AlgeriaPoliticalEvents.1
	title = AlgeriaPoliticalEvents.1.t
	desc = AlgeriaPoliticalEvents.1.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = {
		name = AlgeriaPoliticalEvents.1.a
		log = "[GetDateText]: [This.GetName]: AlgeriaPoliticalEvents.1.a executed"
		add_political_power = 25
	}
}

# USA Protection Offer
country_event = {
	id = Algeria.8
	title = Algeria.8.t
	desc = Algeria.8.d
	picture = GFX_USA_generic
	is_triggered_only = yes

	option = {
		name = Algeria.8.a
		log = "[GetDateText]: [This.GetName]: Algeria.8.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = USA value > 25 }
			}
			modifier = {
				add = 1
				has_government = democratic
			}
		}
		USA = {
			add_opinion_modifier = {
				modifier = military_cooperation
				target = ALG
			}
		}
		ALG = {
			add_opinion_modifier = {
				modifier = military_cooperation
				target = USA
			}
		}
	}

	option = {
		name = Algeria.8.b
		log = "[GetDateText]: [This.GetName]: Algeria.8.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_government = nationalist
			}
			modifier = {
				add = 1
				has_opinion = { target = USA value < 0 }
			}
		}
		add_opinion_modifier = {
			modifier = drama
			target = USA
		}
		reverse_add_opinion_modifier = {
			modifier = drama
			target = USA
		}
	}
}
country_event = {
	id = AlgeriaPoliticalEvents.20
	title = AlgeriaPoliticalEvents.20.t
	desc = AlgeriaPoliticalEvents.20.d
	picture = GFX_raid_international_sanctions_b
	is_triggered_only = yes

	option = {
		name = AlgeriaPoliticalEvents.20.a
		log = "[GetDateText]: [This.GetName]: AlgeriaPoliticalEvents.20.a executed"
		ai_chance = { base = 1 }
		add_political_power = 50
	}

	option = {
		name = AlgeriaPoliticalEvents.20.b
		log = "[GetDateText]: [This.GetName]: AlgeriaPoliticalEvents.20.b executed"
		ai_chance = { base = 1 }
		add_stability = 0.05
	}

	option = {
		name = AlgeriaPoliticalEvents.20.c
		log = "[GetDateText]: [This.GetName]: AlgeriaPoliticalEvents.20.c executed"
		ai_chance = { base = 1 }
		add_popularity = { ideology = fascism popularity = 0.05 }
	}
}

# Event triggered after choosing MSP president
country_event = {
	id = ALG_presidency.1
	title = ALG_presidency.1.t
	desc = ALG_presidency.1.d
	picture = GFX_musl_rally
	is_triggered_only = yes
	fire_only_once = yes

	trigger = { has_country_flag = ALG_msp_president_chosen }

	option = {
		name = ALG_presidency.1.a # Military Accepts New Leadership
		log = "[GetDateText]: [This.GetName]: ALG_presidency.1.a executed"
		ai_chance = {
			base = 50
		}
		add_stability = 0.03
		add_political_power = 25
		custom_effect_tooltip = ALG_presidency_army_accepts_tt
	}

	option = {
		name = ALG_presidency.1.b # Military Rebels!
		log = "[GetDateText]: [This.GetName]: ALG_presidency.1.b executed"
		ai_chance = {
			base = 50
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_ISLAMIST_FOCUS_PATH
			}
			modifier = {
				factor = 4
				has_global_flag = ALG_MILITARY_JUNTA_FOCUS_PATH
			}
		}
		start_civil_war = {
			ideology = neutrality
			size = 0.45
		}
		custom_effect_tooltip = ALG_presidency_army_civilwar_tt
	}
}

country_event = {
	id = ALG_black_spring.1
	title = ALG_black_spring.1.t
	desc = ALG_black_spring.1.d
	picture = GFX_indians_riot_thing
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		NOT = { has_country_flag = ALG_black_spring_triggered }
	}

	immediate = {
		if = {
			limit = { has_idea = ALG_tamazight_integration_process }
			swap_ideas = {
				remove_idea = ALG_tamazight_integration_process
				add_idea = ALG_kabylia_unrest
			}
		}
		else = { add_ideas = ALG_kabylia_unrest }
		add_to_variable = { ALG_kabyle_satisfaction = -15 tooltip = kabyle_satisfaction_factor_tt }
		add_to_variable = { ALG_chaoui_satisfaction = -5 tooltip = ALG_chaoui_satisfaction_factor_tt }
		ALG_update_ethnic_modifiers = yes
	}

	option = {
		name = ALG_black_spring.1.a
		log = "[GetDateText]: [This.GetName]: ALG_black_spring.1.a executed"
		set_country_flag = ALG_black_spring_triggered
	}
}
country_event = {
	id = Algeria_events.5
	title = Algeria_events.5.t
	desc = Algeria_events.5.desc
	picture = GFX_illegal_poaching
	is_triggered_only = yes

	option = {
		log = "[GetDateText]: [This.GetName]: Algeria_events.5.a executed"
		name = Algeria_events.5.a
		set_temp_variable = { poachers_killed = no_of_poachers }
		multiply_temp_variable = { poachers_killed = 0.5 }
		round_temp_variable = poachers_killed
		subtract_from_variable = { no_of_poachers = poachers_killed }
		custom_effect_tooltip = ALG_eliminate_half_of_poachers
	}
}
country_event = {
	id = Algeria_events.6
	title = Algeria_events.6.t
	desc = Algeria_events.6.desc
	picture = GFX_illegal_poaching
	is_triggered_only = yes

	option = { name = Algeria_events.6.a }
}
country_event = {
	id = ALG_bouteflika.1
	title = "alg_health_crisis_title"
	desc = "alg_health_crisis_desc"
	picture = GFX_hospital
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = "alg_health_crisis_option_continue"
		log = "[GetDateText]: [This.GetName]: ALG_bouteflika.1.a executed"
		add_political_power = 50 # Elite support
		add_power_balance_value = { id = algeria_power_balance value = -0.2 } # Le Pouvoir strengthens
		custom_effect_tooltip = alg_le_pouvoir_strengthens_tt
	}
}
country_event = {
	id = ALG_2014_oil_crash.1
	title = "alg_oil_crash_title"
	desc = "alg_oil_crash_desc"
	picture = GFX_oil_refinery
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		NOT = { has_idea = ALG_2014_oil_crash_idea }
	}

	option = {
		log = "[GetDateText]: [Root.GetName]: ALG_2014_oil_crash.1.a executed"
		name = "alg_oil_crash_option"
		add_ideas = ALG_2014_oil_crash_idea
		add_war_support = -0.10 # Public anger
	}
}
country_event = {
	id = ALG_hirak_reforms.1
	title = "alg_hirak_reforms_title"
	desc = "alg_hirak_reforms_desc"
	picture = GFX_election_protests # Protest imagery
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = "alg_hirak_reforms_option"
		log = "[GetDateText]: [This.GetName]: ALG_hirak_reforms.1.a executed"
		add_political_power = -50 # Elite backlash
		add_stability = 0.05 # Short-term hope
		add_power_balance_value = { id = algeria_power_balance value = 0.3 } # Hirak gains more influence
		custom_effect_tooltip = alg_hirak_gains_influence_tt
	}
}
country_event = {
	id = ALG_hirak_crackdown.1
	title = "alg_hirak_crackdown_title"
	desc = "alg_hirak_crackdown_desc"
	picture = GFX_protests_andijan_1 # Military/riot imagery
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = "alg_hirak_crackdown_option"
		log = "[GetDateText]: [This.GetName]: ALG_hirak_crackdown.1.a executed"
		add_political_power = 100 # Elite consolidation
		add_stability = -0.10 # Public anger
		add_power_balance_value = { id = algeria_power_balance value = -0.3 } # Le Pouvoir tightens grip
		custom_effect_tooltip = alg_pouvoir_crackdown_tt
	}
}
country_event = {
	id = ALG_2019_hirak_victory.1
	title = "alg_hirak_victory_title"
	desc = "alg_hirak_victory_desc"
	picture = GFX_report_event_Election_ITA
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		log = "[GetDateText]: [Root.GetName]: ALG_2019_hirak_victory.1.a executed"
		name = "alg_hirak_victory_option"
		add_stability = 0.05 # Temporary hope
	}
}
news_event = {
	id = ALG_2019_military_rule.1
	title = "alg_military_rule_title"
	desc = "alg_military_rule_desc"
	picture = GFX_bolivia_coup_news
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	option = {
		log = "[GetDateText]: [Root.GetName]: ALG_2019_military_rule.1.a executed"
		name = alg_military_rule_option
		add_war_support = 0.15 # Nationalist rhetoric
		add_stability = -0.15 # Oppression
	}
}
country_event = {
	id = algeria_tebboune.1
	title = algeria_tebboune.1.t
	desc = algeria_tebboune.1.d
	picture = GFX_alg_2019_elections
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_tebboune.1.a # Abdelmadjid Tebboune
		log = "[GetDateText]: [This.GetName]: algeria_tebboune.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 5
				is_historical_focus_on = yes
			}
		}
		custom_effect_tooltip = ALG_tebboune_tt
		create_country_leader = {
			name = "Abdelmadjid Tebboune"
			picture = "tebboune.dds"
			ideology = Autocracy
			traits = { emerging_Autocracy }
		}
		#set_country_flag = ALG_tebboune_president
		add_popularity = { ideology = communism popularity = 0.05 } # FLN/establishment bump
	}

	option = {
		name = algeria_tebboune.1.b # Ali Benflis
		log = "[GetDateText]: [This.GetName]: algeria_tebboune.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
		}
		custom_effect_tooltip = ALG_benflis_tt
		create_country_leader = {
			name = "Ali Benflis"
			picture = "Ali_Benflis.dds"
			ideology = liberalism
			traits = { western_liberalism }
		}
		#set_country_flag = ALG_benflis_president
		add_popularity = { ideology = democratic popularity = 0.05 } # Talaie El Houriat → mapped to RND liberal slot
	}

	option = {
		name = algeria_tebboune.1.c # Abdelkader Bengrina
		log = "[GetDateText]: [This.GetName]: algeria_tebboune.1.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_global_flag = ALG_ISLAMIST_FOCUS_PATH
			}
		}
		custom_effect_tooltip = ALG_bengrina_tt
		create_country_leader = {
			name = "Abdelkader Bengrina"
			picture = "bengrina.dds"
			ideology = Neutral_Muslim_Brotherhood
			traits = { neutrality_Neutral_Muslim_Brotherhood }
		}
		#set_country_flag = ALG_bengrina_president
		add_popularity = { ideology = neutrality popularity = 0.05 } # Harakat El-Bina → MSP slot
	}
}
country_event = {
	id = algeria_elections.2024
	title = algeria_elections.2024.t
	desc = algeria_elections.2024.d
	picture = GFX_alg_2024_elections
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		NOT = { has_country_flag = ALG_2024_election_held }
	}

	immediate = {
		# Election flag
		set_country_flag = ALG_2024_election_held
		# Aouchiche victory
		if = {
			limit = {
				check_variable = { party_pop_array^2 > party_pop_array^7 }
				check_variable = { party_pop_array^2 > party_pop_array^12 }
			}
			add_popularity = { ideology = democratic popularity = 0.05 }
			create_country_leader = {
				name = "Youcef Aouchiche"
				desc = "ALG_aouchiche_desc"
				picture = "aouchiche.dds"
				ideology = liberalism
				traits = { western_liberalism }
			}
			custom_effect_tooltip = ALG_aouchiche_2024_tt
		}
		# Hassani victory
		else_if = {
			limit = {
				check_variable = { party_pop_array^12 > party_pop_array^7 }
				check_variable = { party_pop_array^12 > party_pop_array^2 }
			}
			add_popularity = { ideology = neutrality popularity = 0.05 }
			create_country_leader = {
				name = "Abdelali Hassani Cherif"
				desc = "ALG_hassani_desc"
				picture = "abdelali_hassani_cherif.dds"
				ideology = Neutral_Muslim_Brotherhood
				traits = { neutrality_Neutral_Muslim_Brotherhood }
			}
			custom_effect_tooltip = ALG_hassani_2024_tt
		}
		# Default winner: Tebboune
		else = {
			add_popularity = { ideology = communism popularity = 0.05 }
			create_country_leader = {
				name = "Abdelmadjid Tebboune"
				picture = "tebboune.dds"
				ideology = Autocracy
				traits = { emerging_Autocracy }
			}
			custom_effect_tooltip = ALG_tebboune_2024_tt
		}
	}

	option = { name = algeria_elections.2024.a }
}
country_event = {
	id = algeria_reforms.1
	title = algeria_reforms.1.t
	desc = algeria_reforms.1.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = {
		name = algeria_reforms.1.a
		log = "[GetDateText]: [This.GetName]: algeria_reforms.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_stability = 0.05
		add_political_power = 50
	}

	option = {
		name = algeria_reforms.1.b
		log = "[GetDateText]: [This.GetName]: algeria_reforms.1.b executed"
		ai_chance = { base = 1 }
		add_political_power = -50
		add_popularity = { ideology = democratic popularity = 0.05 }
	}
}

country_event = {
	id = ALG_bouteflika.2
	title = "ALG_bouteflika.2.t"
	desc = "ALG_bouteflika.2.d"
	picture = GFX_corruption_event_1_SOV
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = "ALG_bouteflika.2.a"
		log = "[GetDateText]: [This.GetName]: ALG_bouteflika.2.a executed"
		add_stability = 0.01
	}
}
news_event = {
	id = ALG_bouteflika.3
	title = ALG_bouteflika.3.t
	desc = ALG_bouteflika.3.d
	picture = GFX_news_arab_conference
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	option = {
		name = ALG_bouteflika.3.a # "Unlock Bouteflika Health Crisis Focus"
		log = "[GetDateText]: [This.GetName]: ALG_bouteflika.3.a executed"
		add_stability = -0.02
		set_country_flag = ALG_boteflika
		custom_effect_tooltip = ALG_boteflika_tt
	}
}
country_event = {
	id = ALG_maghreb_invite.1
	title = ALG_maghreb_invite.1.t
	desc = ALG_maghreb_invite.1.d
	picture = GFX_arab_spring_defection
	is_triggered_only = yes

	option = {
		name = ALG_maghreb_invite.1.a # "Join the Union"
		log = "[GetDateText]: [This.GetName]: ALG_maghreb_invite.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 1
				is_in_faction = no
			}
		}
		add_opinion_modifier = { target = ALG modifier = in_faction }
		set_country_flag = maghreb_union_member
	}

	option = {
		name = ALG_maghreb_invite.1.b # "Refuse
		log = "[GetDateText]: [This.GetName]: ALG_maghreb_invite.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				is_in_faction = yes
			}
			modifier = {
				add = 2
				has_opinion = { target = ALG value < 0 }
			}
		}
		add_opinion_modifier = { target = ALG modifier = declined_faction_request }
		#set_country_flag = maghreb_union_declined
	}
}
country_event = {
	id = AlgeriaFocus.56
	title = AlgeriaFocus.56.t
	desc = AlgeriaFocus.56.d
	picture = GFX_african_school
	is_triggered_only = yes

	option = {
		name = AlgeriaFocus.56.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocus.56.a executed"
		if = {
			limit = { NOT = { has_idea = SHA_algerian_education } }
			add_ideas = SHA_algerian_education
		}
		else = {
			swap_ideas = {
				add_idea = SHA_algerian_education_2
				remove_idea = SHA_algerian_education
			}
		}
	}
}

#algeria abandons Sahrawi
country_event = {
	id = AlgeriaFocus.57
	title = AlgeriaFocus.57.t
	desc = AlgeriaFocus.57.d
	picture = GFX_african_school
	is_triggered_only = yes

	option = {
		name = AlgeriaFocus.57.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocus.57.a executed"
		if = {
			limit = { has_idea = SHA_algerian_education }
			remove_ideas = SHA_algerian_education
		}
	}
}

country_event = {
	id = AlgeriaInvestment.1
	title = AlgeriaInvestment.1.t
	desc = AlgeriaInvestment.1.desc
	picture = GFX_politics_talks
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.1.a
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.1.a executed"
		set_temp_variable = { treasury_change = -3.5 }
		modify_treasury_effect = yes
		ALG = {
			set_temp_variable = { skip_payment = 1 }
			one_random_infrastructure = yes
			set_temp_variable = { percent_change = 1 }
			change_influence_percentage = yes
			country_event = {
				id = AlgeriaInvestment.2
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_government = ROOT }
			}
			modifier = {
				factor = 2
				ALG = { has_stability > 0.5 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 10
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 25
					}
				}
			}
			modifier = {
				factor = 0
				ALG = { has_stability < 0.2 }
			}
		}
	}

	option = {
		name = AlgeriaInvestment.1.b
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.1.b executed"
		set_temp_variable = { treasury_change = -8.5 }
		modify_treasury_effect = yes
		ALG = {
			set_temp_variable = { skip_payment = 1 }
			one_random_industrial_complex = yes
			set_temp_variable = { percent_change = 2 }
			change_influence_percentage = yes
			country_event = {
				id = AlgeriaInvestment.3
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_government = ROOT }
			}
			modifier = {
				factor = 2
				ALG = { has_stability > 0.6 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 15
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 30
					}
				}
			}
			modifier = {
				factor = 0
				ALG = { has_stability < 0.3 }
			}
		}
	}

	option = {
		name = AlgeriaInvestment.1.c
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.1.c executed"
		set_temp_variable = { treasury_change = -13 }
		modify_treasury_effect = yes
		ALG = {
			random_owned_controlled_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = offices
					level = 1
					instant_build = yes
				}
			}
			set_temp_variable = { percent_change = 3 }
			change_influence_percentage = yes
			country_event = {
				id = AlgeriaInvestment.4
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_government = ROOT }
			}
			modifier = {
				factor = 2
				ALG = { has_stability > 0.75 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 25
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 50
					}
				}
			}
			modifier = {
				factor = 0
				ALG = { has_stability < 0.5 }
			}
		}
	}

	option = {
		name = AlgeriaInvestment.1.d
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.1.d executed"
		add_political_power = 20
		ALG = {
			country_event = {
				id = AlgeriaInvestment.5
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_stability < 0.1 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value < -15
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value < -50
					}
				}
			}
			modifier = {
				factor = 10
				ALG = { has_war = yes }
			}
		}
	}
}

#Invest in Infrastructure
country_event = {
	id = AlgeriaInvestment.2
	title = AlgeriaInvestment.2.t
	desc = AlgeriaInvestment.2.d
	picture = GFX_broken_infrastructure
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.2.a
		ai_chance = { base = 1 }
	}
}

#Invest in Factories
country_event = {
	id = AlgeriaInvestment.3
	title = AlgeriaInvestment.3.t
	desc = AlgeriaInvestment.3.d
	picture = GFX_generic_factory
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.3.a
		ai_chance = { base = 1 }
	}
}

#Invest in Offices
country_event = {
	id = AlgeriaInvestment.4
	title = AlgeriaInvestment.4.t
	desc = AlgeriaInvestment.4.d
	picture = GFX_euro_investments
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.4.a
		ai_chance = { base = 1 }
	}
}

#Investment Offer Rejected
country_event = {
	id = AlgeriaInvestment.5
	title = AlgeriaInvestment.5.t
	desc = AlgeriaInvestment.5.d
	picture = GFX_treaty_rejected
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.5.a
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.5.a executed"
		add_political_power = -10
		ai_chance = { base = 1 }
	}
}

#WTO Tradedeal
country_event = {
	id = AlgeriaInvestment.6
	title = AlgeriaInvestment.6.t
	desc = AlgeriaInvestment.6.d
	picture = GFX_politics_talks
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.6.a
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.6.a executed"
		set_temp_variable = { receiver_nation = ALG.id }
		set_temp_variable = { sender_nation = ROOT.id }
		set_improved_trade_agreement = yes
		ALG = {
			set_temp_variable = { percent_change = 1 }
			change_influence_percentage = yes
			country_event = {
				id = AlgeriaInvestment.7
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_government = ROOT }
			}
			modifier = {
				factor = 2
				ALG = { has_stability > 0.5 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 10
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 25
					}
				}
			}
			modifier = {
				factor = 0
				ALG = { has_stability < 0.2 }
			}
		}
	}

	option = {
		name = AlgeriaInvestment.6.b
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.6.b executed"
		set_temp_variable = { treasury_change = -8.5 }
		modify_treasury_effect = yes
		ALG = {
			set_temp_variable = { skip_payment = 1 }
			one_random_industrial_complex = yes
			set_temp_variable = { percent_change = 2 }
			change_influence_percentage = yes
			country_event = {
				id = AlgeriaInvestment.3
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_government = ROOT }
			}
			modifier = {
				factor = 2
				ALG = { has_stability > 0.6 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 15
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value > 30
					}
				}
			}
			modifier = {
				factor = 0
				ALG = { has_stability < 0.3 }
			}
		}
	}

	option = {
		name = AlgeriaInvestment.6.c
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.6.c executed"
		add_political_power = 20
		ALG = {
			country_event = {
				id = AlgeriaInvestment.5
				days = 5
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = { has_stability < 0.1 }
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value < -15
					}
				}
			}
			modifier = {
				factor = 2
				ROOT = {
					has_opinion = {
						target = ALG
						value < -50
					}
				}
			}
			modifier = {
				factor = 10
				ALG = { has_idea = corruption_level_10 }
			}
			modifier = {
				factor = 10
				ALG = { has_idea = corruption_level_09 }
			}
			modifier = {
				factor = 10
				ALG = { has_war = yes }
			}
		}
	}
}
#signed trade deal
country_event = {
	id = AlgeriaInvestment.7
	title = AlgeriaInvestment.7.t
	desc = AlgeriaInvestment.7.d
	picture = GFX_euro_investments
	is_triggered_only = yes

	option = {
		name = AlgeriaInvestment.7.a
		log = "[GetDateText]: [This.GetName]: AlgeriaInvestment.7.a executed"
		set_temp_variable = { receiver_nation = FROM.id }
		set_temp_variable = { sender_nation = ROOT.id }
		set_improved_trade_agreement = yes
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = Algeria.11
	title = Algeria.11.t
	desc = Algeria.11.d
	picture = GFX_politics_negotiations
	is_triggered_only = yes

	option = {
		name = Algeria.11.a
		log = "[GetDateText]: [This.GetName]: Algeria.11.a executed"
		add_political_power = -50
		give_guarantee = ALG
		ALG = {
			set_temp_variable = { percent_change = 4 }
			set_temp_variable = { tag_index = CHI.id }
			change_influence_percentage = yes
			give_military_access = CHI
			country_event = {
				id = Algeria.12
				days = 2
			}
		}
		hidden_effect = { subtract_from_variable = { CHI_chinese_aggression = 1 } }
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				ALG = {
					NOT = { has_government = democratic }
					NOT = { has_government = neutrality }
					NOT = { has_government = fascism }
				}
			}
			modifier = {
				factor = 2
				ALG = { has_government = communism }
			}
			modifier = {
				factor = 0
				ALG = { has_war = yes }
			}
			modifier = {
				factor = 0
				check_variable = { debt > 10000 }
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = ALG
					value > 25
				}
			}
		}
	}

	option = {
		name = Algeria.11.b
		log = "[GetDateText]: [This.GetName]: Algeria.11.b executed"
		ALG = {
			country_event = {
			id = Algeria.13
			days = 2
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				factor = 2
				check_variable = { uighur_threat > 80 }
			}
			modifier = {
				factor = 2
				has_opinion = {
					target = ALG
					value < -25
				}
			}
		}
	}
}

#China Agrees Guarantee
country_event = {
	id = Algeria.12
	title = Algeria.12.t
	desc = Algeria.12.d
	picture = GFX_negotiations
	is_triggered_only = yes

	option = {
		name = Algeria.12.a
		log = "[GetDateText]: [This.GetName]: Algeria.12.a executed"
		add_political_power = 50
		ai_chance = { base = 1 }
	}
}

#China Refuses Guarantee
country_event = {
	id = Algeria.13
	title = Algeria.13.t
	desc = Algeria.13.d
	picture = GFX_treaty_rejected
	is_triggered_only = yes

	option = {
		name = Algeria.13.a
		log = "[GetDateText]: [This.GetName]: Algeria.13.a executed"
		add_political_power = -20
		set_temp_variable = { arg_popularity = -0.02 }
		add_ruling_outlook_popularity = yes
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = AlgeriaFocus.91
	title = AlgeriaFocus.91.t
	desc = AlgeriaFocus.91.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = {
		name = AlgeriaFocus.91.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocus.91.a executed"
		ai_chance = { base = 50 }
		set_temp_variable = { add_col_one = 16 }
		add_coalition_members_effect = yes
		set_country_flag = federalists_in_coalition
		set_temp_variable = { party_index = 16 }
		set_temp_variable = { party_popularity_increase = 0.10 }
		set_temp_variable = { temp_outlook_increase = 0.10 }
		change_relative_party_popularity = yes
		custom_effect_tooltip = SYR_GOVERNMENT_EXPANSION_EVENT_FED_EFFECT
	}

	option = {
		name = AlgeriaFocus.91.b
		log = "[GetDateText]: [This.GetName]: AlgeriaFocus.91.b executed"
		ai_chance = { base = 50 }
		set_temp_variable = { add_col_one = 20 }
		add_coalition_members_effect = yes
		set_country_flag = nationalists_in_coalition
		set_temp_variable = { party_index = 20 }
		set_temp_variable = { party_popularity_increase = 0.10 }
		set_temp_variable = { temp_outlook_increase = 0.10 }
		change_relative_party_popularity = yes
		custom_effect_tooltip = SYR_GOVERNMENT_EXPANSION_EVENT_REP_EFFECT
	}
}
country_event = {
	id = AlgeriaFocusEvents.43
	title = AlgeriaFocusEvents.43.t
	desc = AlgeriaFocusEvents.43.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = { #Sign me up
		name = AlgeriaFocusEvents.43.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocusEvents.43.a executed"
		add_ideas = CIW_member
		ai_chance = { base = 7 }
	}

	option = { #No
		name = AlgeriaFocusEvents.43.b
		ai_chance = { base = 3 }
	}
}
country_event = {
	id = AlgeriaFocusEvents.41
	title = AlgeriaFocusEvents.41.t
	desc = AlgeriaFocusEvents.41.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = { #Good Idea
		name = AlgeriaFocusEvents.41.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocusEvents.41.a executed"
		FROM = { country_event = { id = md4.17 hours = 3 } }
		ai_chance = {
			base = 5
			modifier = {
				IRQ = { has_opinion = { target = ALG value > 49 } }
				add = 20
			}
		}
	}

	option = { #No
		name = AlgeriaFocusEvents.41.b
		log = "[GetDateText]: [This.GetName]: AlgeriaFocusEvents.41.b executed"
		ALG = {
			country_event = AlgeriaFocusEvents.411
		}
		ai_chance = { base = 5 }
	}
}
#
country_event = {
	id = AlgeriaFocusEvents.411
	title = AlgeriaFocusEvents.411.t
	desc = AlgeriaFocusEvents.411.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = {
		name = AlgeriaFocusEvents.411.a
		ai_chance = { base = 100 }
	}
}
#
country_event = {
	id = AlgeriaFocusEvents.42
	title = AlgeriaFocusEvents.42.t
	desc = AlgeriaFocusEvents.42.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = { #Good Idea
		name = AlgeriaFocusEvents.42.a
		log = "[GetDateText]: [This.GetName]: AlgeriaFocusEvents.42.a executed"
		FROM = { country_event = { id = md4.17 hours = 3 } }
		ai_chance = {
			base = 5
			modifier = {
				IRQ = { has_opinion = { target = ALG value > 49 } }
				add = 20
			}
		}
	}

	option = { #No
		name = AlgeriaFocusEvents.42.b
		log = "[GetDateText]: [This.GetName]: AlgeriaFocusEvents.42.b executed"
		ALG = {
			country_event = AlgeriaFocusEvents.421
		}
		ai_chance = { base = 5 }
	}
}
country_event = {
	id = AlgeriaFocusEvents.421
	title = AlgeriaFocusEvents.421.t
	desc = AlgeriaFocusEvents.421.d
	picture = GFX_political_deal
	is_triggered_only = yes

	option = { #Good Idea
		name = AlgeriaFocusEvents.421.a
		ai_chance = { base = 100 }
	}
}
#Turkey invites us to CIW Alliance (Syria)
country_event = {
	id = AlgeriaFocusEvents.81
	title = AlgeriaFocusEvents.81.t
	desc = AlgeriaFocusEvents.81.desc
	picture = GFX_political_deal
	is_triggered_only = yes

	option = { #Only for a little something in return...
		name = AlgeriaFocusEvents.81.a
		ai_chance = {
			base = 5
			modifier = {
				SYR = { has_opinion = { target = ALG value > 49 } }
				add = 20
			}
		}
	}

	option = { #No way
		name = AlgeriaFocusEvents.81.b
		ai_chance = { base = 1 }
	}
}
country_event = {
	id = algeria_sahar.1
	title = "algeria_sahar.1.t"
	desc = "algeria_sahar.1.d"
	picture = GFX_african_union_forces
	is_triggered_only = yes

	option = {
		name = "algeria_sahar.1.a"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_opinion = { target = ALG value > 25 }
			}
			modifier = {
				add = 1
				has_war_support > 0.50
			}
			modifier = {
				factor = 0
				has_war = yes
			}
		}
		add_manpower = 50000
		set_temp_variable = { wargoal_on = MOR }
		set_temp_variable = { wargoal_type = 1 }
		add_threat_from_wargoal_effect = yes
		create_wargoal = {
			target = MOR
			type = liberate_wargoal
		}
		set_country_flag = sha_algeria_helping
		ALG = { country_event = algeria_sahar.7 }
	}

	option = {
		name = "algeria_sahar.1.b"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_war = yes
			}
			modifier = {
				add = 1
				has_opinion = { target = ALG value < 0 }
			}
		}
		ALG = { country_event = algeria_sahar.8 }
	}
}

country_event = {
	id = algeria_sahar.2
	title = "algeria_sahar.2.t"
	desc = "algeria_sahar.2.d"
	picture = GFX_african_union_forces
	is_triggered_only = yes

	trigger = {
		tag = MOR
		has_war_with = SHA
		surrender_progress > 0.09
	}

	option = {
		name = "algeria_sahar.2.a"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.2.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_war_support < 0.30
			}
		}
		SHA = { country_event = algeria_sahar.3 }
		clr_country_flag = sha_algeria_helping
		set_country_flag = MOR_sahrawi_go
	}

	option = {
		name = algeria_sahar.2.b
		log = "[GetDateText]: [This.GetName]: algeria_sahar.2.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_war_support > 0.50
			}
		}
		SHA = { country_event = algeria_sahar.4 }
		clr_country_flag = sha_algeria_helping
		set_country_flag = MOR_sahrawi_go
	}
}

country_event = {
	id = algeria_sahar.3
	title = "algeria_sahar.3.t"
	desc = "algeria_sahar.3.d"
	picture = GFX_african_union_forces
	is_triggered_only = yes

	option = {
		name = "algeria_sahar.3.a"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.3.a executed"
		ai_chance = { base = 3 }
		MOR = { country_event = algeria_sahar.5 }
		white_peace = SHA
		transfer_state = 373
	}

	option = {
		name = "algeria_sahar.3.b"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.3.b executed"
		ai_chance = { base = 1 }
		MOR = { country_event = algeria_sahar.6 }
		set_cosmetic_tag = SHA_federation
	}
}

country_event = {
	id = algeria_sahar.4
	title = algeria_sahar.4.t
	desc = algeria_sahar.4.d
	picture = GFX_plane_crash
	is_triggered_only = yes

	option = {
		name = algeria_sahar.4.a
		log = "[GetDateText]: [This.GetName]: algeria_sahar.4.a executed"
		ai_chance = { base = 1 }
		set_cosmetic_tag = SHA_federation
	}
}

country_event = {
	id = algeria_sahar.5
	title = "algeria_sahar.5.t"
	desc = "algeria_sahar.5.d"
	picture = GFX_message_signing
	is_triggered_only = yes

	option = {
		name = algeria_sahar.5.a
		log = "[GetDateText]: [This.GetName]: algeria_sahar.5.a executed"
		ai_chance = { base = 1 }
		add_timed_idea = {
			idea = MOR_white_peace
			days = 600
		}
	}
}

country_event = {
	id = algeria_sahar.6
	title = algeria_sahar.6.t
	desc = algeria_sahar.6.d
	picture = GFX_african_union_forces
	is_triggered_only = yes

	option = {
		name = algeria_sahar.6.a
		ai_chance = { base = 1 }
	}
}

country_event = {
	id = algeria_sahar.7
	title = "algeria_sahar.7.t"
	desc = "algeria_sahar.7.d"
	picture = GFX_weapons_arms1
	is_triggered_only = yes

	trigger = { has_country_flag = sha_algeria_helping }

	option = {
		name = "algeria_sahar.7.a"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.7.a executed"
		ai_chance = { base = 1 }
		add_manpower = -50000
		set_temp_variable = { treasury_change = -7 }
		modify_treasury_effect = yes
	}
}
country_event = {
	id = algeria_sahar.8
	title = "algeria_sahar.8.t"
	desc = "algeria_sahar.8.d"
	picture = GFX_treaty_rejected
	is_triggered_only = yes

	option = {
		name = "algeria_sahar.8.a"
		log = "[GetDateText]: [This.GetName]: algeria_sahar.8.a executed"
		ai_chance = { base = 1 }
		add_opinion_modifier = {
			modifier = drama
			target = SHA
		}
		reverse_add_opinion_modifier = {
			modifier = drama
			target = SHA
		}
	}
}
country_event = {
	id = algeria.42
	title = algeria.42.t
	desc = algeria.42.d
	picture = GFX_arab_spring_defection
	is_triggered_only = yes

	option = {
		name = algeria.42.a
		log = "[GetDateText]: [This.GetName]: algeria.42.a executed"
		ai_chance = { base = 1 }
		add_popularity = {
			ideology = neutrality
			popularity = 0.05
		}
		add_equipment_to_stockpile = {
			type = infantry_weapons_1
			amount = 2500
			producer = ALG
		}
	}
}
country_event = {
	id = algeria.43
	title = algeria.43.t
	desc = algeria.43.d
	picture = GFX_arab_spring_defection
	is_triggered_only = yes

	option = {
		name = algeria.43.a
		log = "[GetDateText]: [This.GetName]: algeria.43.a executed"
		ai_chance = { base = 1 }
		add_opinion_modifier = {
			target = ALG
			modifier = hostile_status
		}
		reverse_add_opinion_modifier = {
			target = ALG
			modifier = hostile_status
		}
	}
}
news_event = {
	id = algeria_news.1
	title = algeria_news.1.t
	desc = algeria_news.1.d
	picture = GFX_news_peninsula_shield_intervention
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	option = {
		name = algeria_news.1.a
		log = "[GetDateText]: [This.GetName]: algeria_news.1.a executed"
		custom_effect_tooltip = algeria_news.1_tt
		add_stability = -0.05
		add_war_support = 0.05
		add_political_power = 100
	}
}
news_event = {
	id = algeria_news.2
	title = algeria_news.2.t
	desc = algeria_news.2.d
	picture = GFX_alg_civil_war
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	option = {
		name = algeria_news.2.a
		log = "[GetDateText]: [This.GetName]: algeria_news.2.a executed"
		country_event = { id = algeria_news.9 days = 10 }
	}
}
country_event = {
	id = algeria_news.3
	title = algeria_news.3.t
	desc = algeria_news.3.d
	picture = GFX_alg_president
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.3.a
		log = "[GetDateText]: [This.GetName]: algeria_news.3.a executed"
		custom_effect_tooltip = algeria_news.3_tt
		add_political_power = 50
		add_stability = 0.01
	}
}
country_event = {
	id = algeria_news.4
	title = algeria_news.4.t
	desc = algeria_news.4.d
	picture = GFX_alg_recon
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.4.a
		log = "[GetDateText]: [This.GetName]: algeria_news.4.a executed"
		custom_effect_tooltip = algeria_news.4_tt
		add_stability = 0.01
		add_political_power = 50
		set_temp_variable = { ALG_constitution_stability_temp = 0.05 }
		add_to_variable = { ALG_constitution_stability_effect = ALG_constitution_stability_temp tooltip = stability_factor_tt }
		set_temp_variable = { ALG_constitution_drift_defence_temp = 0.05 }
		add_to_variable = { ALG_constitution_drift_defence_effect = ALG_constitution_drift_defence_temp tooltip = drift_defence_factor_tt }
	}
}
country_event = {
	id = algeria_news.5
	title = algeria_news.5.t
	desc = algeria_news.5.d
	picture = GFX_alg_fln
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.5.a
		log = "[GetDateText]: [This.GetName]: algeria_news.5.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 5
				is_historical_focus_on = yes
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_LE_POUVOIR_FOCUS_PATH
			}
		}
		country_event = algeria_news.6
		set_country_flag = ALG_pres_coa
		add_stability = 0.02
		add_political_power = 50
	}

	option = {
		name = algeria_news.5.b
		log = "[GetDateText]: [This.GetName]: algeria_news.5.b executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 10
				has_global_flag = ALG_LE_POUVOIR_FOCUS_PATH
			}
			modifier = {
				factor = 0
				has_global_flag = ALG_HISTORICAL_FOCUS_PATH
			}
		}
		set_country_flag = ALG_only_FLN
		add_stability = 0.02
		add_political_power = 50
	}
}
country_event = {
	id = algeria_news.6
	title = algeria_news.6.t
	desc = algeria_news.6.d
	picture = GFX_alg_coa
	is_triggered_only = yes

	option = {
		name = algeria_news.6.a
		log = "[GetDateText]: [This.GetName]: algeria_news.6.a executed"
		if = {
			limit = { check_variable = { ruling_party = 7 } }
			set_temp_variable = { add_col_one = 2 }
			add_coalition_members_effect = yes
			set_temp_variable = { add_col_one = 12 }
			add_coalition_members_effect = yes
			hidden_effect = {
				update_party_name = yes
				update_government_coalition_strength = yes
			}
			custom_effect_tooltip = ALG_presidential_alliance
		}
	}
}
country_event = {
	id = algeria_news.7
	title = algeria_news.7.t
	desc = algeria_news.7.d
	picture = GFX_alg_fis
	is_triggered_only = yes

	option = {
		name = algeria_news.7.a
		log = "[GetDateText]: [This.GetName]: algeria_news.7.a executed"
		custom_effect_tooltip = algeria_news.7_tt
		add_stability = -0.01
		add_political_power = 75
	}
}
country_event = {
	id = algeria_news.8
	title = algeria_news.8.t
	desc = algeria_news.8.d
	picture = GFX_alg_victim
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.8.a # Compensate victims
		log = "[GetDateText]: [This.GetName]: algeria_news.8.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_stability = 0.05
		add_political_power = -100
		set_temp_variable = { treasury_change = -15 }
		modify_treasury_effect = yes
		custom_effect_tooltip = algeria_news.8_a_tt
		set_country_flag = ALG_victims_compensated
	}

	option = {
		name = algeria_news.8.b # Symbolic recognition
		log = "[GetDateText]: [This.GetName]: algeria_news.8.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power < 100
			}
		}
		add_stability = -0.01
		add_political_power = -200
		custom_effect_tooltip = algeria_news.8_b_tt
		set_country_flag = ALG_victims_recognized
	}

	option = {
		name = algeria_news.8.c # Ignore their demands
		log = "[GetDateText]: [This.GetName]: algeria_news.8.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power < 50
			}
		}
		add_stability = -0.08
		add_political_power = 250
		custom_effect_tooltip = algeria_news.8_c_tt
		set_country_flag = ALG_victims_ignored
		add_power_balance_value = {
			id = algeria_power_balance
			value = 0.02
		}
	}
}
country_event = {
	id = algeria_news.9
	title = algeria_news.9.t
	desc = algeria_news.9.d
	picture = GFX_arm_war_decl
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.9.a
		# Back the military regime
		log = "[GetDateText]: [Root.GetName]: algeria_news.9.a executed"
		ai_chance = {
			base = 1
		}
		add_political_power = 50
		add_stability = 0.05
		set_temp_variable = { treasury_change = 20.00 }
		modify_treasury_effect = yes
		set_temp_variable = { temp_opinion = 10 }
		change_the_military_opinion = yes
	}

	option = {
		name = algeria_news.9.b
		# Side with the poor / victims
		log = "[GetDateText]: [Root.GetName]: algeria_news.9.b executed"
		ai_chance = {
			base = 1
		}
		add_stability = 0.1
		add_political_power = 25
		set_temp_variable = { treasury_change = -8.00 }
		modify_treasury_effect = yes
		set_temp_variable = { temp_opinion = 10 }
		change_the_ulema_opinion = yes
	}

	option = {
		name = algeria_news.9.c
		# Blame external actors
		log = "[GetDateText]: [Root.GetName]: algeria_news.9.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_stability = 0.02
		add_political_power = 30
		set_temp_variable = { treasury_change = 20.00 }
		modify_treasury_effect = yes
		set_temp_variable = { temp_opinion = -5 }
		change_the_military_opinion = yes
		set_temp_variable = { temp_opinion = -5 }
		change_the_ulema_opinion = yes
		add_opinion_modifier = {
			modifier = betrayed_our_cause
			target = MOR
		}
		reverse_add_opinion_modifier = {
			modifier = unstable_alliance
			target = MOR
		}
	}

	option = {
		name = algeria_news.9.dd
		# Officially erase / suppress discussion
		log = "[GetDateText]: [Root.GetName]: algeria_news.9.dd executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_war_support > 0.50
			}
		}
		add_stability = 0.05
		add_political_power = 20
		set_temp_variable = { temp_opinion = 15 }
		change_fossil_fuel_industry_opinion = yes
		set_temp_variable = { treasury_change = 20.00 }
		modify_treasury_effect = yes
	}
}

country_event = {
	id = algeria_news.10
	title = algeria_news.10.t
	desc = algeria_news.10.d
	picture = GFX_alg_flag
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.10.a
		log = "[GetDateText]: [This.GetName]: algeria_news.10.a executed"
		add_stability = 0.05
		add_political_power = 50
		set_temp_variable = { treasury_change = 10 }
		modify_treasury_effect = yes
		custom_effect_tooltip = algeria_news.10_a_tt
		#set_country_flag = ALG_econ_recovery_started
	}
}
news_event = {
	id = algeria_policy.1
	title = algeria_policy.1.t
	desc = algeria_policy.1.d
	picture = GFX_Franco_algerian_Relations
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		has_completed_focus = ALG_denounce_previous_colonialist_regimes
	}

	option = {
		name = algeria_policy.1.a # Condemn France openly
		log = "[GetDateText]: [This.GetName]: algeria_policy.1.a executed"
		add_opinion_modifier = {
			target = FRA
			modifier = hostile_status
		}
		add_stability = 0.02
		add_political_power = -25
	}
}
country_event = {
	id = fra_colonial.1
	title = fra_colonial.1.t
	desc = fra_colonial.1.d
	picture = GFX_event_ALG_french_flag
	is_triggered_only = yes

	trigger = { tag = FRA }

	option = {
		name = fra_colonial.1.a # Defend the law
		log = "[GetDateText]: [This.GetName]: fra_colonial.1.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.50
			}
		}
		FRA = {
			add_stability = 0.02
			add_political_power = 25
			add_opinion_modifier = {
				target = ALG
				modifier = hostile_status
			}
		}
	}

	option = {
		name = fra_colonial.1.b # Soften the language
		log = "[GetDateText]: [This.GetName]: fra_colonial.1.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		FRA = {
			add_stability = -0.01
			add_political_power = -25
			add_opinion_modifier = {
				target = ALG
				modifier = declaration_of_friendship
			}
		}
	}
}
news_event = {
	id = algeria_disaster.1
	title = algeria_disaster.1.t
	desc = algeria_disaster.1.d
	picture = GFX_alg_boum
	is_triggered_only = yes
	major = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
	}

	option = {
		name = algeria_disaster.1.a # Mobilize emergency response
		log = "[GetDateText]: [This.GetName]: algeria_disaster.1.a executed"
		add_stability = -0.05
		add_manpower = -2300
		add_ideas = ALG_no_disasters_plan
		add_political_power = -50
		set_country_flag = ALG_disaster_start
		country_event = { id = algeria_disaster.2 days = 2 }
		custom_effect_tooltip = ALG_earthquake_recovery_tt
	}
}
country_event = {
	id = algeria_disaster.2
	title = algeria_disaster.2.t
	desc = algeria_disaster.2.d
	picture = GFX_alg_flag
	is_triggered_only = yes
	fire_only_once = yes

	trigger = { has_country_flag = ALG_disaster_start }

	immediate = { clr_country_flag = ALG_disaster_start }

	option = {
		name = algeria_disaster.2.a # Establish a State Aid Fund
		log = "[GetDateText]: [This.GetName]: algeria_disaster.2.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 100
			}
		}
		add_political_power = -100
		add_stability = 0.05
		set_temp_variable = { treasury_change = -40.00 }
		modify_treasury_effect = yes
		add_popularity = { ideology = democratic popularity = 0.03 }
		add_ideas = ALG_government_led_disaster
		remove_ideas = ALG_no_disasters_plan
		custom_effect_tooltip = ALG_state_aid_fund_tt
		set_temp_variable = { percent_change = 10 }
		change_domestic_influence_percentage = yes
	}

	option = {
		name = algeria_disaster.2.b # Seek Foreign Assistance
		log = "[GetDateText]: [This.GetName]: algeria_disaster.2.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power < 50
			}
		}
		add_stability = -0.02
		set_temp_variable = { treasury_change = 45.00 }
		modify_treasury_effect = yes
		add_ideas = ALG_charity_disasters
		remove_ideas = ALG_no_disasters_plan
		custom_effect_tooltip = ALG_foreign_aid_dependence_tt
		set_temp_variable = { percent_change = -10 }
		change_domestic_influence_percentage = yes
		set_temp_variable = { percent_change = 4.5 }
		set_temp_variable = { tag_index = USA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		hidden_effect = {
			every_country = {
				limit = {
					is_in_array = { array = global.EU_member value = THIS.id }
				}
				set_temp_variable = { percent_change = 1.5 }
				set_temp_variable = { influence_target = ALG }
				change_influence_percentage = yes
			}
		}
	}
}


country_event = {
	id = alg.310
	title = alg.310.t
	desc = alg.310.d
	picture = GFX_hospital
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.310.a }
}

country_event = {
	id = alg.311
	title = alg.311.t
	desc = alg.311.d
	picture = GFX_politics_protest
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.311.a }
}
country_event = {
	id = alg.320
	title = alg.320.t
	desc = alg.320.d
	picture = GFX_african_school
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.320.a }
}

country_event = {
	id = alg.321
	title = alg.321.t
	desc = alg.321.d
	picture = GFX_politics_protest
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.321.a }
}
country_event = {
	id = alg.330
	title = alg.330.t
	desc = alg.330.d
	picture = GFX_generic_factory
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.330.a }
}

country_event = {
	id = alg.331
	title = alg.331.t
	desc = alg.331.d
	picture = GFX_politics_protest
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg.331.a }
}
country_event = {
	id = alg.400
	title = alg.400.t
	desc = alg.400.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		has_country_flag = ALG_resistance_path
		check_variable = { ALG_army_influence < 5 }
		check_variable = { ALG_people_grievance > 30 }
	}

	option = {
		name = alg.400.a
		log = "[GetDateText]: [This.GetName]: alg.400.a executed"
		add_ideas = ALG_civilian_government
		add_stability = 0.15
		add_popularity = { ideology = democratic popularity = 0.15 }
		clr_country_flag = ALG_resistance_path
	}
}
country_event = {
	id = alg.401
	title = alg.401.t
	desc = alg.401.d
	picture = GFX_recruit_militia_soldiers
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		has_country_flag = ALG_resistance_path
		check_variable = { ALG_army_influence > 30 }
		check_variable = { ALG_people_grievance > 40 }
	}

	option = {
		name = alg.401.a
		log = "[GetDateText]: [This.GetName]: alg.401.a executed"
		add_ideas = ALG_corrupt_generals
		add_stability = -0.1
		add_war_support = -0.05
		add_to_variable = { var = ALG_people_grievance value = 5 tooltip = ALG_people_grievance_factor_tt }
		clamp_variable = { var = ALG_people_grievance min = 0 max = 100 }
		clamp_variable = { var = ALG_army_influence min = 0 max = 100 }
	}
}
country_event = {
	id = alg.402
	title = alg.402.t
	desc = alg.402.d
	picture = GFX_election_rally
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		has_country_flag = ALG_resistance_path
		check_variable = { ALG_people_grievance > 40 }
		has_stability < 0.25
	}

	option = {
		name = alg.402.a
		log = "[GetDateText]: [This.GetName]: alg.402.a executed"
		set_country_flag = ALG_civil_war_triggered
		start_civil_war = {
			ideology = democratic
			size = 0.35
		}
		clr_country_flag = ALG_resistance_path
	}
}
country_event = {
	id = alg.450
	title = alg.450.t
	desc = alg.450.d
	picture = GFX_election_rally
	is_triggered_only = yes
	fire_only_once = yes

	trigger = { has_country_flag = ALG_civil_war_triggered }

	option = { name = alg.450.a }
}
#2003 Sahara hostage crisis
country_event = {
	id = ALG_terror.1
	title = ALG_terror_2003_hostage_title
	desc = ALG_terror_2003_hostage_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		no_jihadist_government = yes
	}

	option = { name = "ALG_terror_2003_hostage_option" }
}
# 2007 Algiers Bombings
country_event = {
	id = ALG_terror.2
	title = ALG_terror_2007_algiers_title
	desc = ALG_terror_2007_algiers_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.2.a executed"
		add_stability = -0.03
	}
}

# 2007 Batna Bombing
country_event = {
	id = ALG_terror.3
	title = ALG_terror_2007_batna_title
	desc = ALG_terror_2007_batna_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.3.a executed"
		add_stability = -0.02
	}
}

# 2008 Issers Bombing
country_event = {
	id = ALG_terror.4
	title = ALG_terror_2008_issers_title
	desc = ALG_terror_2008_issers_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.4.a executed"
		add_stability = -0.03
	}
}

# 2013 In Amenas Hostage Crisis
country_event = {
	id = ALG_terror.13
	title = ALG_terror_2013_in_amenas_title
	desc = ALG_terror_2013_in_amenas_desc
	picture = GFX_GER_hostage3
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	immediate = {
		if = {
			limit = { fascism < 5 }
			add_stability = 0.02
			add_political_power = 20
			custom_effect_tooltip = ALG_terror_2013_low_tt
		}
		else_if = {
			limit = {
					fascism > 5
					 fascism < 36
				}
			add_stability = -0.03
			add_political_power = -10
			custom_effect_tooltip = ALG_terror_2013_medium_tt
		}
		else_if = {
			limit = { fascism > 35 }
			add_stability = -0.07
			add_political_power = -30
			add_ideas = ALG_insurgency_unleashed
			custom_effect_tooltip = ALG_terror_2013_high_tt
		}
	}

	option = {
		name = ALG_terror_2013_placeholder_option
		# placeholder — effects handled in immediate
	}
}
# Year 2000 - Tizi Ouzou Ambush
country_event = {
	id = ALG_terror.1000
	title = ALG_terror_2000_bus_ambush_title
	desc = ALG_terror_2000_bus_ambush_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.1000.a executed"
		add_stability = -0.01
	}
}

# Year 2002 - Tazmalt Bombing
country_event = {
	id = ALG_terror.1002
	title = ALG_terror_2002_tazmalt_title
	desc = ALG_terror_2002_tazmalt_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.1002.a executed"
		add_stability = -0.01
	}
}

# Year 2002 - Miliana Bombing
country_event = {
	id = ALG_terror.1003
	title = ALG_terror_2002_miliana_title
	desc = ALG_terror_2002_miliana_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = { name = ALG_terror_generic_option }
}

# Year 2002 - Hammam Righa Bombing
country_event = {
	id = ALG_terror.1004
	title = ALG_terror_2002_hammam_title
	desc = ALG_terror_2002_hammam_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = { name = ALG_terror_generic_option }
}

# Year 2002 - Larbaa Bombing
country_event = {
	id = ALG_terror.1005
	title = ALG_terror_2002_larbaa_title
	desc = ALG_terror_2002_larbaa_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = { name = ALG_terror_generic_option }
}

# Year 2002 - M'Sila Bombing
country_event = {
	id = ALG_terror.1006
	title = ALG_terror_2002_msila_title
	desc = ALG_terror_2002_msila_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = { name = ALG_terror_generic_option }
}

# Year 2003 - Tizi Ouzou Bombing
country_event = {
	id = ALG_terror.1007
	title = ALG_terror_2003_tizi_title
	desc = ALG_terror_2003_tizi_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.1007.a executed"
		add_stability = -0.02
	}
}

# Year 2004 - Tebessa Bombing
country_event = {
	id = ALG_terror.1008
	title = ALG_terror_2004_tebessa_title
	desc = ALG_terror_2004_tebessa_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.1008.a executed"
		add_stability = -0.02
	}
}

# Year 2005 - Tidjelabine Bombing
country_event = {
	id = ALG_terror.1009
	title = ALG_terror_2005_tidjelabine_title
	desc = ALG_terror_2005_tidjelabine_desc
	picture = GFX_terrorist_attack
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		no_jihadist_government = yes
	}

	option = {
		name = ALG_terror_generic_option
		log = "[GetDateText]: [This.GetName]: ALG_terror.1009.a executed"
		add_stability = -0.01
	}
}
# Nuclear Events
country_event = {
	id = nuclear_algeria.1
	title = nuclear_algeria.1.t
	desc = nuclear_algeria.1.d
	picture = GFX_nuclear_power_plant
	is_triggered_only = yes

	option = {
		name = nuclear_algeria.1.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.1.a executed"
		trigger = { NOT = { has_war_with = CHI } }
		CHI = {
			country_event = {
				id = nuclear_algeria.2
				days = 1
			}
		}
		ai_chance = { base = 10 }
	}
}

# Algeria Asks Us for Help
country_event = {
	id = nuclear_algeria.2
	title = nuclear_algeria.2.t
	desc = nuclear_algeria.2.d
	picture = GFX_treaty
	is_triggered_only = yes

	# Okay
	option = {
		name = nuclear_algeria.2.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.2.a executed"
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		if = {
			limit = { ROOT = { original_tag = CHI } }
			custom_effect_tooltip = ALG_missile_chi_TT
			ALG = {
				country_event = {
					id = nuclear_algeria.4
					days = 1
				}
			}
		}
		ai_chance = { base = 10 }
	}

	option = {
		name = nuclear_algeria.2.b
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.2.b executed"
		if = {
			limit = { ROOT = { original_tag = CHI } }
			ALG = { set_country_flag = CHI_rejected_ALG }
		}
		ai_chance = { base = 1 }
	}

	# No
}
# China Provides Nuclear Technology
country_event = {
	id = nuclear_algeria.4
	title = nuclear_algeria.4.t
	desc = nuclear_algeria.4.d
	picture = GFX_nuclear_power_plant
	is_triggered_only = yes

	# Okay
	option = {
		name = nuclear_algeria.4.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.4.a executed"
		if = {
			limit = { has_tech = reactor1 }
			set_technology = { reactor2 = 1 }
		}
		else = { ALG = { set_technology = { reactor1 = 1 } } }
		ai_chance = { base = 10 }
	}
}


country_event = {
	id = nuclear_algeria.6
	title = nuclear_algeria.6.t
	desc = nuclear_algeria.6.d
	picture = GFX_missiles_on_road
	is_triggered_only = yes

	# Okay
	option = {
		name = nuclear_algeria.6.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.6.a executed"
		if = {
			limit = { has_dlc = "Gotterdammerung" }
			send_equipment = {
				type = guided_missile_equipment_1
				amount = 400
				target = ALG
			}
		}
		else = {
			send_equipment = {
				type = ballistic_missile_equipment
				amount = 400
				target = ALG
			}
		}
		effect_tooltip = {
			ALG = {
				set_temp_variable = { treasury_change = -30.00 }
				modify_treasury_effect = yes
			}
			CHI = {
				set_temp_variable = { treasury_change = 30.00 }
				modify_treasury_effect = yes
			}
			set_temp_variable = { percent_change = 4 }
			set_temp_variable = { tag_index = CHI }
			set_temp_variable = { influence_target = ALG }
			change_influence_percentage = yes
		}
		ALG = {
			country_event = {
				id = nuclear_algeria.7
				days = 1
			}
		}
		ai_chance = { base = 10 }
	}

	option = {
		name = nuclear_algeria.6.b
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.6.b executed"
		ALG = {
			country_event = {
				id = nuclear_algeria.8
				days = 1
			}
		}
		ai_chance = { base = 1 }
	}

	# No
}

country_event = {
	id = nuclear_algeria.7
	title = nuclear_algeria.7.t
	desc = nuclear_algeria.7.d
	picture = GFX_missiles_on_road
	is_triggered_only = yes

	# Okay
	option = {
		name = nuclear_algeria.7.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.7.a executed"
		effect_tooltip = {
			CHI = {
				if = {
					limit = { has_dlc = "Gotterdammerung" }
					send_equipment = {
						type = guided_missile_equipment_1
						amount = 400
						target = ALG
					}
				}
				else = {
					send_equipment = {
						type = ballistic_missile_equipment
						amount = 400
						target = ALG
					}
				}
			}
		}
		ALG = {
			set_temp_variable = { treasury_change = -32.00 }
			modify_treasury_effect = yes
		}
		CHI = {
			set_temp_variable = { treasury_change = 32.00 }
			modify_treasury_effect = yes
		}
		set_temp_variable = { percent_change = 4 }
		set_temp_variable = { tag_index = CHI }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		ai_chance = { base = 10 }
	}
}

country_event = {
	id = nuclear_algeria.8
	title = nuclear_algeria.8.t
	desc = nuclear_algeria.8.d
	picture = GFX_missiles_on_road
	is_triggered_only = yes

	# Okay
	option = {
		name = nuclear_algeria.8.a
		ai_chance = { base = 10 }
	}
}

country_event = {
	id = algerian_focus.171
	title = algerian_focus.171.t
	desc = algerian_focus.171.d
	picture = GFX_nuclear_power_plant
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algerian_focus.171.a
		log = "[GetDateText]: [This.GetName]:algerian_focus.171.a executed"
		382 = {
			add_building_construction = {
				type = nuclear_reactor
				level = 1
			}
		}
		newline = yes
		set_temp_variable = { percent_change = 2.00 }
		set_temp_variable = { tag_index = CHI }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		newline = yes
		set_temp_variable = { treasury_change = -11.5 }
		modify_treasury_effect = yes
		ai_chance = { base = 5 }
	}

	option = {
		name = algerian_focus.171.b
		log = "[GetDateText]: [This.GetName]:algerian_focus.171.b executed"
		set_temp_variable = { percent_change = 5 }
		change_domestic_influence_percentage = yes
		ai_chance = { base = 5 }
	}
}

# United States Increases Economic Sanctions!
country_event = {
	id = nuclear_algeria.25
	title = nuclear_algeria.25.t
	desc = nuclear_algeria.25.d
	picture = GFX_generic_factory
	is_triggered_only = yes

	# They did what?
	option = {
		name = nuclear_algeria.25.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.25.a executed"
		add_opinion_modifier = {
			target = USA
			modifier = recent_actions_negative
		}
		newline = yes
		custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = ALG_us_sanctions }
		add_to_variable = { ALG_sanction_trade_opinion_factor = -0.1 tooltip = trade_opinion_factor_tt }
		add_to_variable = { ALG_sanction_trade_laws_cost_factor = 0.1 tooltip = trade_laws_cost_factor_tt }
		add_to_variable = { ALG_sanction_oil_export_multiplier_modifier = -0.1 tooltip = oil_export_multiplier_modifier_tt }
		add_to_variable = { ALG_sanction_improve_relations_maintain_cost_factor = 0.1 tooltip = improve_relations_maintain_cost_factor_tt }
		add_to_variable = { ALG_sanction_productivity_growth_modifier = -0.05 tooltip = productivity_growth_modifier_tt }
		add_to_variable = { ALG_sanction_stability_factor = -0.05 tooltip = stability_factor_tt }
		ai_chance = { base = 1 }
	}
}

# United States Decreases Economic Sanctions
country_event = {
	id = nuclear_algeria.26
	title = nuclear_algeria.26.t
	desc = nuclear_algeria.26.d
	picture = GFX_generic_factory
	is_triggered_only = yes

	# They did what?
	option = {
		name = nuclear_algeria.26.a
		log = "[GetDateText]: [This.GetName]: nuclear_algeria.26.a executed"
		add_opinion_modifier = {
			target = USA
			modifier = recent_actions_positive
		}
		newline = yes
		custom_effect_tooltip = { localization_key = modifies_dynamic_modifier_tt MODIFIER = ALG_us_sanctions }
		add_to_variable = { ALG_sanction_trade_opinion_factor = 0.1 tooltip = trade_opinion_factor_tt }
		add_to_variable = { ALG_sanction_trade_laws_cost_factor = -0.1 tooltip = trade_laws_cost_factor_tt }
		add_to_variable = { ALG_sanction_oil_export_multiplier_modifier = 0.1 tooltip = oil_export_multiplier_modifier_tt }
		add_to_variable = { ALG_sanction_improve_relations_maintain_cost_factor = -0.1 tooltip = improve_relations_maintain_cost_factor_tt }
		add_to_variable = { ALG_sanction_productivity_growth_modifier = 0.05 tooltip = productivity_growth_modifier_tt }
		add_to_variable = { ALG_sanction_stability_factor = 0.05 tooltip = stability_factor_tt }
		ai_chance = { base = 1 }
	}
}

country_event = {
	id = nuclear_algeria.28
	title = nuclear_algeria.28.t
	desc = nuclear_algeria.28.d
	picture = GFX_political_deal
	is_triggered_only = yes

	# Good
	option = {
		name = nuclear_algeria.28.a
		ai_chance = { base = 1 }
	}
}

# Main initialization event
country_event = {
	id = ALG_ethnic_data.1
	title = ALG_ethnic_data.1.t
	desc = ALG_ethnic_data.1.d
	picture = GFX_alg_flag
	is_triggered_only = yes

	immediate = {
		hidden_effect = {
			set_variable = { var = arab_pop_percent value = ALG_ethnic_arab }
			multiply_variable = { var = arab_pop_percent value = 0.01 }
			set_variable = { var = kabyle_pop_percent value = ALG_ethnic_kabyle }
			multiply_variable = { var = kabyle_pop_percent value = 0.01 }
			set_variable = { var = tuareg_pop_percent value = ALG_ethnic_tuareg }
			multiply_variable = { var = tuareg_pop_percent value = 0.01 }
			set_variable = { var = chaoui_pop_percent value = ALG_ethnic_chaoui }
			multiply_variable = { var = chaoui_pop_percent value = 0.01 }
			set_variable = { var = mozabite_pop_percent value = ALG_ethnic_mozabite }
			multiply_variable = { var = mozabite_pop_percent value = 0.01 }
			set_variable = { var = christian_pop_percent value = 0.01 }
			ALG_init_favor_counters = yes
			set_country_flag = ALG_ethnic_data_initialized
		}
	}

	option = {
		name = ALG_ethnic_data.1.a
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.1.a executed"
		custom_effect_tooltip = ALG_ethnic_system_active_tt
		ALG_update_ethnic_modifiers = yes
	}
}

# Census event
country_event = {
	id = ALG_ethnic_data.2
	title = ALG_ethnic_data.2.t
	desc = ALG_ethnic_data.2.d
	picture = GFX_alg_hirak
	is_triggered_only = yes

	option = {
		name = ALG_ethnic_data.2.a
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.2.a executed"
		ai_chance = { base = 1 }
		custom_effect_tooltip = ALG_census_arab_focus_tt
		hidden_effect = {
			add_to_variable = { ALG_arab_satisfaction = 15 }
			subtract_from_variable = { ALG_kabyle_satisfaction = 10 }
			subtract_from_variable = { ALG_chaoui_satisfaction = 5 }
			subtract_from_variable = { ALG_tuareg_satisfaction = 5 }
			subtract_from_variable = { ALG_mozabite_satisfaction = 5 }
			clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_kabyle_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_chaoui_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_tuareg_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_mozabite_satisfaction min = 0 max = 100 }
			ALG_update_ethnic_modifiers = yes
		}
		add_political_power = 50
	}

	option = {
		name = ALG_ethnic_data.2.b
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.2.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		custom_effect_tooltip = ALG_census_balanced_tt
		hidden_effect = {
			add_to_variable = { ALG_arab_satisfaction = 5 }
			add_to_variable = { ALG_kabyle_satisfaction = 10 }
			add_to_variable = { ALG_chaoui_satisfaction = 8 }
			add_to_variable = { ALG_tuareg_satisfaction = 5 }
			add_to_variable = { ALG_mozabite_satisfaction = 5 }
			clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_kabyle_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_chaoui_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_tuareg_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_mozabite_satisfaction min = 0 max = 100 }
			ALG_update_ethnic_modifiers = yes
		}
		add_stability = 0.03
	}

	option = {
		name = ALG_ethnic_data.2.c
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.2.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power < 50
			}
		}
		custom_effect_tooltip = ALG_census_neutral_tt
		add_political_power = 25
	}
}
# Warning event - tensions rising
country_event = {
	id = ALG_ethnic_data.10
	title = ALG_ethnic_data.10.t
	desc = ALG_ethnic_data.10.d
	picture = GFX_alg_hirak4
	is_triggered_only = yes

	trigger = {
		original_tag = ALG
		has_country_flag = ALG_ethnic_data_initialized
		OR = {
			check_variable = { ALG_arab_satisfaction < 30 }
			check_variable = { ALG_kabyle_satisfaction < 25 }
			check_variable = { ALG_tuareg_satisfaction < 25 }
			check_variable = { ALG_chaoui_satisfaction < 30 }
			check_variable = { ALG_mozabite_satisfaction < 30 }
		}
		NOT = { has_country_flag = ALG_ethnic_warning_recent }
	}

	option = {
		name = ALG_ethnic_data.10.a
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.10.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power < 50
			}
		}
		add_stability = -0.03
		set_country_flag = { flag = ALG_ethnic_warning_recent days = 60 value = 1 }
	}

	option = {
		name = ALG_ethnic_data.10.b
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.10.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_political_power = -50
		hidden_effect = {
			if = {
				limit = { check_variable = { ALG_arab_satisfaction < 30 } }
				add_to_variable = { ALG_arab_satisfaction = 8 }
			}
			if = {
				limit = { check_variable = { ALG_kabyle_satisfaction < 25 } }
				add_to_variable = { ALG_kabyle_satisfaction = 8 }
			}
			if = {
				limit = { check_variable = { ALG_tuareg_satisfaction < 25 } }
				add_to_variable = { ALG_tuareg_satisfaction = 8 }
			}
			if = {
				limit = { check_variable = { ALG_chaoui_satisfaction < 30 } }
				add_to_variable = { ALG_chaoui_satisfaction = 8 }
			}
			if = {
				limit = { check_variable = { ALG_mozabite_satisfaction < 30 } }
				add_to_variable = { ALG_mozabite_satisfaction = 8 }
			}
			ALG_update_ethnic_modifiers = yes
		}
		set_country_flag = { flag = ALG_ethnic_warning_recent days = 90 value = 1 }
	}
}

# Ghardaia Clashes (Historical - 2013-2015, Mozabite-Arab tensions)
country_event = {
	id = ALG_ethnic_data.20
	title = ALG_ethnic_data.20.t
	desc = ALG_ethnic_data.20.d
	picture = GFX_alg_hirak6
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		has_country_flag = ALG_ethnic_data_initialized
		date > 2013.1.1
		NOT = { has_country_flag = ALG_ghardaia_clashes_happened }
		check_variable = { ALG_mozabite_satisfaction < 45 }
	}

	immediate = { hidden_effect = { set_country_flag = ALG_ghardaia_clashes_happened } }

	option = {
		name = ALG_ethnic_data.20.a
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.20.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability < 0.40
			}
		}
		# Side with Arabs
		custom_effect_tooltip = ALG_ghardaia_arab_side_tt
		add_stability = -0.05
		hidden_effect = {
			subtract_from_variable = { ALG_mozabite_satisfaction = 20 }
			add_to_variable = { ALG_arab_satisfaction = 5 }
			clamp_variable = { var = ALG_mozabite_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
			ALG_update_ethnic_modifiers = yes
		}
	}

	option = {
		name = ALG_ethnic_data.20.b
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.20.b executed"
		ai_chance = {
			base = 1
		}
		# Protect Mozabites
		custom_effect_tooltip = ALG_ghardaia_mozabite_side_tt
		add_political_power = -75
		hidden_effect = {
			subtract_from_variable = { ALG_mozabite_satisfaction = 5 }
			subtract_from_variable = { ALG_arab_satisfaction = 10 }
			clamp_variable = { var = ALG_mozabite_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
			ALG_update_ethnic_modifiers = yes
		}
	}

	option = {
		name = ALG_ethnic_data.20.c
		log = "[GetDateText]: [This.GetName]: ALG_ethnic_data.20.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
		}
		# Neutral mediation
		custom_effect_tooltip = ALG_ghardaia_neutral_tt
		add_political_power = -50
		add_stability = -0.03
		hidden_effect = {
			subtract_from_variable = { ALG_mozabite_satisfaction = 10 }
			subtract_from_variable = { ALG_arab_satisfaction = 3 }
			clamp_variable = { var = ALG_mozabite_satisfaction min = 0 max = 100 }
			clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
			ALG_update_ethnic_modifiers = yes
		}
	}
}
country_event = {
	id = alg_ethnicity.100
	title = alg_ethnicity.100.t
	desc = alg_ethnicity.100.d
	picture = GFX_alg_berber
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		NOT = { has_country_flag = kabyle_unrest_triggered }
		check_variable = { var = ALG_kabyle_satisfaction value < 15 }
	}

	option = {
		name = alg_ethnicity.100.a # Hardline response
		log = "[GetDateText]: [This.GetName]: alg_ethnicity.100.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		add_stability = -0.05
		set_temp_variable = { party_index = 7 }
		set_temp_variable = { party_popularity_increase = -0.40 }
		set_temp_variable = { temp_outlook_increase = -0.40 }
		change_relative_party_popularity = yes
		subtract_from_variable = { var = ALG_kabyle_satisfaction value = 5 }
		add_to_variable = { var = ALG_arab_satisfaction value = 5 }
		clamp_variable = { var = ALG_kabyle_satisfaction min = 0 max = 100 }
		clamp_variable = { var = ALG_arab_satisfaction min = 0 max = 100 }
		set_country_flag = kabyle_unrest_triggered
	}

	option = {
		name = alg_ethnicity.100.b # Conciliatory approach
		log = "[GetDateText]: [This.GetName]: alg_ethnicity.100.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_political_power > 100
			}
		}
		set_temp_variable = { treasury_change = -1.5 }
		modify_treasury_effect = yes
		add_stability = 0.02
		add_political_power = -100
		add_to_variable = { var = ALG_kabyle_satisfaction value = 10 }
		clamp_variable = { var = ALG_kabyle_satisfaction min = 0 max = 100 }
		# NOTE: no unrest flag here
	}
}
country_event = {
	id = alg_ethnicity.200
	title = alg_ethnicity.200.t
	desc = alg_ethnicity.200.d
	picture = GFX_alg_berber
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		original_tag = ALG
		date > 2001.12.1
		has_country_flag = kabyle_unrest_triggered
		check_variable = { var = ALG_kabyle_satisfaction value < 10 }
	}

	option = {
		name = alg_ethnicity.200.a # Grant independence
		log = "[GetDateText]: [This.GetName]: alg_ethnicity.200.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
		}
		add_stability = -0.30
		release = KBY
	}

	option = {
		name = alg_ethnicity.200.b # Crack down – civil war
		log = "[GetDateText]: [This.GetName]: alg_ethnicity.200.b executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes
			}
			modifier = {
				add = 1
				has_war_support > 0.50
			}
		}
		start_civil_war = {
			ideology = neutrality
			size = 0.25
			capital = 385 # Tizi Ouzou
		}
	}

	option = {
		name = alg_ethnicity.200.c # Constitutional concessions
		log = "[GetDateText]: [This.GetName]: alg_ethnicity.200.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 10
				is_historical_focus_on = yes
			}
		}
		add_stability = -0.02
		add_political_power = -75
		add_to_variable = { var = ALG_kabyle_satisfaction value = 25 }
		add_to_variable = { var = ALG_kabyle_favor_counter value = 1 }
		clamp_variable = { var = ALG_kabyle_satisfaction min = 0 max = 100 }
		ALG_update_ethnic_modifiers = yes
	}
}

country_event = {
	id = alg_politics.50
	title = alg_politics.50.t
	desc = alg_politics.50.d
	picture = GFX_Military_Reform
	is_triggered_only = yes

	trigger = {
		tag = ALG
		has_character = ALG_smain_lamari
		NOT = { has_country_flag = smain_lamari_dead }
	}

	immediate = {
		retire_character = ALG_smain_lamari
		set_country_flag = smain_lamari_dead
	}

	option = {
		name = alg_politics.50.a
		log = "[GetDateText]: [This.GetName]: alg_politics.50.a executed"
		add_stability = -0.02
		add_political_power = -50
	}
}

country_event = {
	id = ALG.2001
	title = ALG_2001_title
	desc = ALG_2001_desc
	picture = GFX_women_in_bundeswehr
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		NOT = { has_country_flag = ALG_unlock_fatima_boudouani }
	}

	option = {
		log = "[GetDateText]: [Root.GetName]: ALG.2001.a executed"
		name = ALG_2001_a # "Promote Fatima Boudouani"
		add_political_power = 25
		add_stability = 0.02
		set_country_flag = ALG_unlock_fatima_boudouani
		effect_tooltip = {
			create_corps_commander = {
				name = "Fatima Boudouani"
				portrait_path = "gfx/leaders/ALG/Fatima_Boudouani.dds"
				traits = { organizer }
				skill = 2
				attack_skill = 1
				defense_skill = 2
				planning_skill = 2
				logistics_skill = 2
			}
		}
	}
}
country_event = {
	id = ALG.2002
	title = ALG_2002_title
	desc = ALG_2002_desc
	picture = GFX_women_in_bundeswehr
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		NOT = { has_country_flag = ALG_unlock_fatima_zohra_ardjoune }
	}

	option = {
		log = "[GetDateText]: [Root.GetName]: ALG.2002.a executed"
		name = ALG_2002_a # "Promote Fatima Zohra Ardjoune"
		set_country_flag = ALG_unlock_fatima_zohra_ardjoune
		effect_tooltip = {
			create_field_marshal = {
				name = "Fatima Zohra Ardjoune"
				portrait_path = "gfx/leaders/ALG/Fatima_Zohra_Ardjoune.dds"
				traits = { organizer }
				skill = 2
				attack_skill = 1
				defense_skill = 2
				planning_skill = 2
				logistics_skill = 2
			}
		}
		add_political_power = 25
	}
}
country_event = {
	id = alg_reform.1
	title = alg_reform.1.t
	desc = alg_reform.1.d
	picture = GFX_report_event_Protest_ITA_1
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = alg_reform.1.a # Ahmed Benbitour
		log = "[GetDateText]: [This.GetName]: alg_reform.1.a executed"
		ai_chance = {
			base = 1
		}
		create_country_leader = {
			name = "Ahmed Benbitour"
			picture = "Ahmed_Benbitour.dds"
			ideology = liberalism
			desc = alg_benbitour_desc
			traits = { economist reformer }
		}
		add_popularity = {
			ideology = democratic
			popularity = 0.15
		}
		add_stability = 0.05
	}

	option = {
		name = alg_reform.1.b # Sofiane Djilali
		log = "[GetDateText]: [This.GetName]: alg_reform.1.b executed"
		ai_chance = {
			base = 1
		}
		create_country_leader = {
			name = "Sofiane Djilali"
			picture = "Sofiane_Djilali.dds"
			ideology = socialism
			desc = alg_djilali_desc
			traits = { reformer }
		}
		add_popularity = {
			ideology = democratic
			popularity = 0.20
		}
		add_stability = 0.05
	}

	option = {
		name = alg_reform.1.c # Rachid Nekkaz
		log = "[GetDateText]: [This.GetName]: alg_reform.1.c executed"
		ai_chance = {
			base = 1
		}
		create_country_leader = {
			name = "Rachid Nekkaz"
			picture = "Rachid_Nekkaz.dds"
			ideology = conservatism
			desc = alg_nekkaz_desc
			traits = { populist }
		}
		add_popularity = {
			ideology = democratic
			popularity = 0.25
		}
		add_political_power = 200
		add_stability = -0.05
	}
}
country_event = {
	id = algeria_news.11
	title = algeria_news.11.t
	desc = algeria_news.11.d
	picture = GFX_un_soldier_lebanon
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.11.a
		log = "[GetDateText]: [This.GetName]: algeria_news.11.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_stability < 0.40
			}
			modifier = {
				add = 1
				has_political_power < 50
			}
		}
		add_stability = 0.03
		set_temp_variable = { treasury_change = 30 }
		modify_treasury_effect = yes
		add_political_power = -50
		custom_effect_tooltip = algeria_news.11_a_tt
		set_country_flag = ALG_UN_aid_accepted
		add_ideas = ALG_un_peacekeepers
		set_temp_variable = { percent_change = 4 }
		set_temp_variable = { tag_index = USA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = FRA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = ENG }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
	}

	option = {
		name = algeria_news.11.b
		log = "[GetDateText]: [This.GetName]: algeria_news.11.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_stability > 0.60
			}
		}
		add_stability = -0.03
		add_political_power = 50
		custom_effect_tooltip = algeria_news.11_b_tt
		set_country_flag = ALG_UN_aid_rejected
	}
}
country_event = {
	id = algeria_news.20
	title = algeria_news.20.t
	desc = algeria_news.20.d
	picture = GFX_alg_flag
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.20.a
		log = "[GetDateText]: [This.GetName]: algeria_news.20.a executed"
		custom_effect_tooltip = algeria_news.20_tt
	}
}
country_event = {
	id = algeria_news.30
	title = algeria_news.30.t
	desc = algeria_news.30.d
	picture = GFX_alg_berber
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algeria_news.30.a
		log = "[GetDateText]: [This.GetName]: algeria_news.30.a executed"
		ai_chance = {
			base = 1
			modifier = {
				factor = 0.5
				is_historical_focus_on = yes
			}
		}
		add_stability = 0.05
		add_political_power = 100
		set_country_flag = ALG_kabyle_independence
		remove_ideas = ALG_kabylia_unrest
		custom_effect_tooltip = algeria_news.30_a_tt
	}

	option = {
		name = algeria_news.30.b
		log = "[GetDateText]: [This.GetName]: algeria_news.30.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 5
				is_historical_focus_on = yes
			}
		}
		add_stability = 0.10
		add_political_power = 50
		set_country_flag = ALG_kabyle_autonomy
		remove_ideas = ALG_kabylia_unrest
		custom_effect_tooltip = algeria_news.30_b_tt
	}

	option = {
		name = algeria_news.30.c
		log = "[GetDateText]: [This.GetName]: algeria_news.30.c executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 1
				has_war_support > 0.50
			}
			modifier = {
				factor = 0.25
				is_historical_focus_on = yes
			}
		}
		add_stability = -0.10
		add_war_support = -0.05
		add_political_power = 50
		set_country_flag = ALG_kabyle_suppressed
		remove_ideas = ALG_kabylia_unrest
		custom_effect_tooltip = algeria_news.30_c_tt
	}
}
country_event = {
	id = alg_news_non_aligned.1
	title = alg_news_non_aligned.1.t
	desc = alg_news_non_aligned.1.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.1.a }
}
country_event = {
	id = alg_news_non_aligned.2
	title = alg_news_non_aligned.2.t
	desc = alg_news_non_aligned.2.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.2.a }
}
country_event = {
	id = alg_news_non_aligned.3
	title = alg_news_non_aligned.3.t
	desc = alg_news_non_aligned.3.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.3.a }
}
country_event = {
	id = alg_news_non_aligned.4
	title = alg_news_non_aligned.4.t
	desc = alg_news_non_aligned.4.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.4.a }
}
country_event = {
	id = alg_news_non_aligned.5
	title = alg_news_non_aligned.5.t
	desc = alg_news_non_aligned.5.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.5.a }
}
country_event = {
	id = alg_news_non_aligned.6
	title = alg_news_non_aligned.6.t
	desc = alg_news_non_aligned.6.d
	picture = GFX_politics_talks
	is_triggered_only = yes
	fire_only_once = yes

	option = { name = alg_news_non_aligned.6.a }
}
# Auto Scandal Triggers
country_event = {
	id = ALG_auto.1
	title = ALG_auto.1.t
	desc = ALG_auto.1.desc
	picture = GFX_report_event_Corruption_1
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		date > 2017.1.1
		has_completed_focus = ALG_renault_oran
		has_completed_focus = ALG_bmw_deal
		has_completed_focus = ALG_mercedes_trucks
		has_completed_focus = ALG_auto_exports
		NOT = { has_country_flag = ALG_auto_scandal_happened }
	}

	immediate = { hidden_effect = { set_country_flag = ALG_auto_scandal_happened } }

	# Accept responsibility and investigate
	option = {
		name = ALG_auto.1.a
		log = "[GetDateText]: [This.GetName]: ALG_auto.1.a executed"
		ai_chance = { base = 60 }
		add_stability = -0.10
		add_political_power = -100
		add_timed_idea = {
			idea = ALG_corruption_auto_scandal
			days = 356
		}
		set_temp_variable = { treasury_change = -20 }
		modify_treasury_effect = yes
		add_power_balance_value = {
			id = algeria_power_balance
			value = 0.05
		}
		hidden_effect = {
			country_event = { id = ALG_auto.2 days = 90 }
		}
	}

	option = {
		name = ALG_auto.1.b
		log = "[GetDateText]: [This.GetName]: ALG_auto.1.b"
		ai_chance = { base = 40 }
		add_stability = -0.05
		add_timed_idea = {
			idea = ALG_corruption_auto_scandal_coverup
			days = 500
		}
		set_temp_variable = { treasury_change = -10 }
		modify_treasury_effect = yes
		add_power_balance_value = {
			id = algeria_power_balance
			value = -0.05
		}
	}

	# Deny and cover up
}

# Import Ban Decision (follows investigation path)
country_event = {
	id = ALG_auto.2
	title = ALG_auto.2.t
	desc = ALG_auto.2.desc
	picture = GFX_BRA_event_banco_fortaleza
	is_triggered_only = yes

	# Implement import ban (Tebboune only)
	option = {
		log = "[GetDateText]: [This.GetName]: ALG_auto.2.a executed"
		name = ALG_auto.2.a
		ai_chance = { base = 70 }
		trigger = {
			has_country_leader = {
				name = "Abdelmajid Tebboune"
				ruling_only = yes
			}
		}
		add_stability = -0.05
		add_timed_idea = {
			idea = ALG_import_ban_penalty
			days = 356
		}
		set_temp_variable = { treasury_change = -4 }
		modify_treasury_effect = yes
		hidden_effect = {
			set_country_flag = ALG_import_ban_enacted
			country_event = { id = ALG_auto.3 days = 120 }
		}
	}

	option = {
		log = "[GetDateText]: [This.GetName]: ALG_auto.2.b executed"
		name = ALG_auto.2.b
		ai_chance = { base = 30 }
		add_stability = -0.02
		add_timed_idea = {
			idea = ALG_import_restrictions_light
			days = 200
		}
		set_temp_variable = { treasury_change = -2 }
		modify_treasury_effect = yes
		hidden_effect = {
			set_country_flag = ALG_light_restrictions
			country_event = { id = ALG_auto.4 days = 180 }
		}
	}

	option = {
		name = ALG_auto.2.c
		log = "[GetDateText]: [This.GetName]: ALG_auto.2.c"
		ai_chance = { base = 10 }
		add_stability = -0.08
		add_political_power = -50
	}

	# Partial restrictions only
	# Do nothing
}

# Fiat Approaches Algeria (after import ban)
country_event = {
	id = ALG_auto.3
	title = ALG_auto.3.t
	desc = ALG_auto.3.desc
	picture = GFX_report_event_Italy_Flag
	is_triggered_only = yes

	trigger = {
		country_exists = ITA
		has_country_flag = ALG_import_ban_enacted
		ITA = {
			has_opinion = {
				target = ALG
				value > 20
			}
		}
	}

	# Accept Fiat deal
	option = {
		name = ALG_auto.3.a
		log = "[GetDateText]: [This.GetName]: ALG_auto.3.a executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				ITA = { has_opinion = { target = ALG value > 50 } }
			}
			modifier = {
				add = 2
				has_political_power < 50
			}
			modifier = {
				factor = 0.5
				has_political_power > 200
			}
		}
		random_owned_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size > 1
				}
			}
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
			add_extra_state_shared_building_slots = 2
		}
		add_stability = 0.05
		set_temp_variable = { treasury_change = -9.5 }
		modify_treasury_effect = yes
		set_temp_variable = { percent_change = 3 }
		set_temp_variable = { tag_index = ITA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
	}

	option = {
		name = ALG_auto.3.b
		log = "[GetDateText]: [This.GetName]: ALG_auto.3.b executed"
		ai_chance = {
			base = 1
			modifier = {
				add = 2
				has_political_power > 100
			}
			modifier = {
				add = 1
				has_stability < 0.50
			}
		}
		add_political_power = -25
		hidden_effect = {
			random_list = {
				60 = {
					country_event = { id = ALG_auto.5 days = 30 }
				}
				40 = {
					country_event = { id = ALG_auto.6 days = 30 }
				}
			}
		}
	}

	option = {
		name = ALG_auto.3.c
		log = "[GetDateText]: [This.GetName]: ALG_auto.3.c"
		ai_chance = {
			base = 1
			modifier = {
				add = 3
				has_opinion = { target = ITA value < 0 }
			}
			modifier = {
				add = 2
				has_war = yes
			}
			modifier = {
				add = 2
				has_political_power > 250
			}
		}
		add_political_power = 25
		reverse_add_opinion_modifier = {
			target = ITA
			modifier = cancelled_market_trade
		}
	}

	# Negotiate better terms
	# Reject Fiat
}

# Alternative path - Light restrictions lead to different opportunities
country_event = {
	id = ALG_auto.4
	title = ALG_auto.4.t
	desc = ALG_auto.4.desc
	picture = GFX_Mercedes_Car
	is_triggered_only = yes

	trigger = { has_country_flag = ALG_light_restrictions }

	# Domestic manufacturers step up
	option = {
		name = ALG_auto.4.a
		log = "[GetDateText]: [This.GetName]: ALG_auto.4.a executed"
		ai_chance = { base = 50 }
		random_owned_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size > 0
				}
			}
			add_building_construction = {
				type = industrial_complex
				level = 1
				instant_build = yes
			}
			add_extra_state_shared_building_slots = 1
		}
		add_stability = 0.03
		set_temp_variable = { treasury_change = -5 }
		modify_treasury_effect = yes
	}

	option = {
		name = ALG_auto.4.b
		log = "[GetDateText]: [This.GetName]: ALG_auto.4.b executed"
		ai_chance = { base = 50 }
		add_political_power = 50
		set_temp_variable = { percent_change = -2 }
		change_domestic_influence_percentage = yes
		hidden_effect = {
			country_event = { id = ALG_auto.3 days = 60 }
		}
	}

	# Foreign interest from multiple parties
}

# Fiat accepts better terms
country_event = {
	id = ALG_auto.5
	title = ALG_auto.5.t
	desc = ALG_auto.5.desc
	picture = GFX_report_event_Italy_Flag
	is_triggered_only = yes

	option = {
		name = ALG_auto.5.a
		log = "[GetDateText]: [This.GetName]: ALG_auto.5.a executed"
		random_owned_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size > 1
				}
			}
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
			add_extra_state_shared_building_slots = 3
		}
		add_stability = 0.07
		set_temp_variable = { treasury_change = -6 }
		modify_treasury_effect = yes
		newline = yes
		set_temp_variable = { percent_change = 2 }
		set_temp_variable = { tag_index = ITA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
	}
}

# Fiat rejects negotiation
country_event = {
	id = ALG_auto.6
	title = ALG_auto.6.t
	desc = ALG_auto.6.desc
	picture = GFX_reject
	is_triggered_only = yes

	# Accept original terms
	option = {
		name = ALG_auto.6.a
		log = "[GetDateText]: [This.GetName]: ALG_auto.6.a executed"
		ai_chance = { base = 70 }
		random_owned_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size > 1
				}
			}
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
			add_extra_state_shared_building_slots = 2
		}
		newline = yes
		add_stability = 0.05
		newline = yes
		set_temp_variable = { treasury_change = -9.5 }
		modify_treasury_effect = yes
		newline = yes
		set_temp_variable = { percent_change = 3 }
		set_temp_variable = { tag_index = ITA }
		set_temp_variable = { influence_target = ALG }
		change_influence_percentage = yes
	}

	option = {
		name = ALG_auto.6.b
		log = "[GetDateText]: [This.GetName]: ALG_auto.6.b executed"
		ai_chance = { base = 30 }
		add_political_power = -25
		add_stability = -0.03
	}

	# Walk away
}
# Party Corruption Scandal - Triggers automatically
country_event = {
	id = ALG_fln.1
	title = ALG_fln.1.t
	desc = ALG_fln.1.desc
	picture = GFX_alg_coa
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		has_completed_focus = ALG_share_power
		NOT = { has_country_flag = ALG_corruption_scandal_happened }
	}

	immediate = { hidden_effect = { set_country_flag = ALG_corruption_scandal_happened } }

	# Option A: Cover it up
	option = {
		name = ALG_fln.1.a
		log = "[GetDateText]: [This.GetName]: ALG_fln.1.a executed"
		ai_chance = {
			base = 40
			modifier = {
				factor = 1.5
				has_stability < 0.4
			}
		}
		custom_effect_tooltip = ALG_cover_up_corruption_tt
		newline = yes
		increase_corruption = yes
		increase_corruption = yes
		newline = yes
		add_political_power = -25
		newline = yes
		set_temp_variable = { party_index = 7 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
	}

	option = {
		name = ALG_fln.1.b
		log = "[GetDateText]: [This.GetName]: ALG_fln.1.b executed"
		ai_chance = { base = 35 }
		custom_effect_tooltip = ALG_blame_others_tt
		newline = yes
		increase_corruption = yes
		newline = yes
		add_stability = -0.03
		newline = yes
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = -0.10 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 12 }
		set_temp_variable = { party_popularity_increase = -0.10 }
		change_relative_party_popularity = yes
		newline = yes
		set_temp_variable = { party_index = 7 }
		set_temp_variable = { party_popularity_increase = 0.05 }
		change_relative_party_popularity = yes
	}

	option = {
		name = ALG_fln.1.c
		log = "[GetDateText]: [This.GetName]: ALG_fln.1.c executed"
		ai_chance = {
			base = 15
			modifier = {
				factor = 2
				has_stability > 0.6
			}
		}
		custom_effect_tooltip = ALG_expose_all_tt
		newline = yes
		add_stability = -0.08
		add_political_power = -75
		newline = yes
		set_temp_variable = { party_index = 7 }
		set_temp_variable = { party_popularity_increase = -0.10 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 12 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
		newline = yes
		decrease_corruption = yes
		newline = yes
		add_timed_idea = {
			idea = ALG_anti_corruption_momentum
			days = 365
		}
	}

	option = {
		name = ALG_fln.1.e
		log = "[GetDateText]: [This.GetName]: ALG_fln.1.e executed"
		ai_chance = { base = 10 }
		custom_effect_tooltip = ALG_anti_corruption_campaign_tt
		newline = yes
		set_temp_variable = { treasury_change = -15 }
		modify_treasury_effect = yes
		newline = yes
		add_political_power = -100
		newline = yes
		set_temp_variable = { party_index = 7 }
		set_temp_variable = { party_popularity_increase = -0.10 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 2 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
		set_temp_variable = { party_index = 12 }
		set_temp_variable = { party_popularity_increase = -0.05 }
		change_relative_party_popularity = yes
		newline = yes
		decrease_corruption = yes
		decrease_corruption = yes
		newline = yes
		add_ideas = ALG_anti_corruption_reforms
		newline = yes
		add_stability = 0.05
	}

	# Option B: Blame other parties
	# Option C: Expose everyone
	# Option D: Launch anti-corruption campaign
}
# Sonatrach Corruption Scandal
country_event = {
	id = ALG_fln.2
	title = ALG_fln.2.t
	desc = ALG_fln.2.desc
	picture = GFX_alg_sona
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		date > 2013.1.1
		OR = {
			has_completed_focus = ALG_denounce_previous_colonialist_regimes
			has_completed_focus = ALG_oppose_ffs_and_rcd
		}
		NOT = { has_country_flag = ALG_sonatrach_scandal_happened }
	}

	immediate = { hidden_effect = { set_country_flag = ALG_sonatrach_scandal_happened } }

	# Option A: Cover It Up
	option = {
		name = ALG_fln.2.a
		log = "[GetDateText]: [This.GetName]: ALG_fln.2.a executed"
		ai_chance = { base = 30 }
		add_stability = -0.05
		add_political_power = -50
		newline = yes
		add_timed_idea = {
			idea = ALG_cover_up_scandal
			days = 365
		}
	}

	option = {
		name = ALG_fln.2.b
		log = "[GetDateText]: [This.GetName]: ALG_fln.2.b executed"
		ai_chance = { base = 40 }
		add_stability = -0.10
		add_political_power = 50
		newline = yes
		add_timed_idea = {
			idea = ALG_anti_corruption_probe
			days = 365
		}
		newline = yes
		add_to_variable = { var = ALG_people_grievance value = 5 tooltip = ALG_people_grievance_factor_tt }
		clamp_variable = { var = ALG_people_grievance min = 0 max = 100 }
		custom_effect_tooltip = ALG_grievance_increase_5_tt
		newline = yes
		set_temp_variable = { temp_opinion = -5 }
		change_industrial_conglomerates_opinion = yes
		set_temp_variable = { temp_opinion = -10 }
		change_fossil_fuel_industry_opinion = yes
		newline = yes
		if = {
			limit = { has_idea = ALG_reactioners4 }
			swap_ideas = {
				remove_idea = ALG_reactioners4
				add_idea = ALG_reactioners5
			}
		}
		else_if = {
			limit = { has_idea = ALG_reactioners5 }
			swap_ideas = {
				remove_idea = ALG_reactioners5
				add_idea = ALG_reactioners6
			}
		}
		else_if = {
			limit = { has_idea = ALG_reactioners6 }
			swap_ideas = {
				remove_idea = ALG_reactioners6
				add_idea = ALG_reactioners7
			}
		}
	}

	option = {
		name = ALG_fln.2.c
		log = "[GetDateText]: [This.GetName]: ALG_fln.2.c executed"
		ai_chance = { base = 30 }
		add_stability = -0.05
		newline = yes
		add_popularity = {
			ideology = nationalist
			popularity = 0.05
		}
		newline = yes
		add_timed_idea = {
			idea = ALG_shift_blame
			days = 365
		}
	}

	# Option B: Investigate the Corruption
	# Option C: Blame the Opposition
}

# Hirak Awakens
country_event = {
	id = ALG_fln.3
	title = ALG_fln.3.t
	desc = ALG_fln.3.desc
	picture = GFX_politics_protest
	is_triggered_only = yes
	fire_only_once = yes

	trigger = {
		tag = ALG
		date > 2019.1.1
		has_country_flag = ALG_sonatrach_scandal_happened
		NOT = { has_country_flag = ALG_hirak_happened }
	}

	immediate = { hidden_effect = { set_country_flag = ALG_hirak_happened } }

	# Only option - Original focus effects
	option = {
		name = ALG_fln.3.a
		log = "[GetDateText]: [This.GetName]: ALG_fln.3.a executed"
		ai_chance = { base = 100 }
		add_stability = -0.15
		newline = yes
		set_temp_variable = { temp_opinion = -2 }
		change_the_military_opinion = yes
		newline = yes
		add_popularity = {
			ideology = democratic
			popularity = 0.05
		}
		add_popularity = {
			ideology = neutrality
			popularity = 0.05
		}
		newline = yes
		add_timed_idea = {
			idea = ALG_mass_protests
			days = 730
		}
		newline = yes
		add_power_balance_value = {
			id = algeria_power_balance
			value = 0.10
		}
		newline = yes
		if = {
			limit = { has_idea = ALG_reactioners5 }
			remove_ideas = ALG_reactioners5
		}
		if = {
			limit = { has_idea = ALG_reactioners6 }
			remove_ideas = ALG_reactioners6
		}
		if = {
			limit = { has_idea = ALG_reactioners7 }
			remove_ideas = ALG_reactioners7
		}
	}
}

add_namespace = algerian_events

# 379 - Mzab
country_event = {
	id = algerian_events.201
	title = algerian_events.201.t
	desc = algerian_events.201.d
	picture = GFX_alg_hirak3
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_mzab_fell_recently }
		NOT = { 379 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.201.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.201.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		379 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 380 - Aurès
country_event = {
	id = algerian_events.202
	title = algerian_events.202.t
	desc = algerian_events.202.d
	picture = GFX_alg_hirak2
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_aures_fell_recently }
		NOT = { 380 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.202.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.202.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		380 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 381 - Tamanrasset
country_event = {
	id = algerian_events.203
	title = algerian_events.203.t
	desc = algerian_events.203.d
	picture = GFX_alg_hirak4
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_tamanrasset_fell_recently }
		NOT = { 381 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.203.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.203.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		381 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 382 - Grand Erg Occidental
country_event = {
	id = algerian_events.204
	title = algerian_events.204.t
	desc = algerian_events.204.d
	picture = GFX_alg_hirak4
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_granderg_fell_recently }
		NOT = { 382 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.204.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.204.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		382 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 383 - Algerian Atlas
country_event = {
	id = algerian_events.205
	title = algerian_events.205.t
	desc = algerian_events.205.d
	picture = GFX_alg_hirak1
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_atlas_fell_recently }
		NOT = { 383 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.205.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.205.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		383 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 384 - Constantinois
country_event = {
	id = algerian_events.206
	title = algerian_events.206.t
	desc = algerian_events.206.d
	picture = GFX_alg_hirak1
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_constantinois_fell_recently }
		NOT = { 384 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.206.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.206.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		384 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 385 - Kabylia
country_event = {
	id = algerian_events.207
	title = algerian_events.207.t
	desc = algerian_events.207.d
	picture = GFX_alg_hirak
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_kabylia_fell_recently }
		NOT = { 385 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.207.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.207.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		385 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 386 - Algérois
country_event = {
	id = algerian_events.208
	title = algerian_events.208.t
	desc = algerian_events.208.d
	picture = GFX_alg_hirak2
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_algerois_fell_recently }
		NOT = { 386 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.208.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.208.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		386 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# 387 - Oranais
country_event = {
	id = algerian_events.209
	title = algerian_events.209.t
	desc = algerian_events.209.d
	picture = GFX_alg_hirak4
	is_triggered_only = yes

	trigger = {
		NOT = { has_country_flag = ALG_oranais_fell_recently }
		NOT = { 387 = { has_state_flag = ALG_locals_swayed } }
	}

	option = {
		name = algerian_events.209.a
		log = "[GetDateText]: [Root.GetName]: algerian_events.209.a executed"
		custom_effect_tooltip = ALG_state_falls_TT
		387 = { set_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		add_to_variable = { var = ALG_protest_exhaustion value = 1 }
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = { id = algeria_power_balance value = -0.05 }
		}
		ai_chance = { base = 10 }
	}
}

# Protests Suppressed
country_event = {
	id = algerian_events.200
	title = algerian_events.200.t
	desc = algerian_events.200.d
	picture = GFX_alg_hirak5
	is_triggered_only = yes

	option = {
		name = algerian_events.200.a
		log = "[GetDateText]: [This.GetName]: algerian_events.200.a executed"
		hidden_effect = {
			random_list = {
				70 = {
					add_to_variable = { var = ALG_protest_exhaustion value = 1 }
				}
				30 = {
					add_to_variable = { var = ALG_protest_exhaustion value = -2 }
				}
			}
		}
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = {
				id = algeria_power_balance
				value = 0.02
			}
		}
		ai_chance = { base = 10 }
	}
}

# Suppression Backfires
country_event = {
	id = algerian_events.2015
	title = algerian_events.2015.t
	desc = algerian_events.2015.d
	picture = GFX_alg_hirak6
	is_triggered_only = yes

	option = {
		name = algerian_events.2015.a
		log = "[GetDateText]: [This.GetName]: algerian_events.2015.a executed"
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = {
				id = algeria_power_balance
				value = -0.01
			}
		}
		ai_chance = { base = 10 }
	}
}

# End of Protests
country_event = {
	id = algerian_events.2025
	title = algerian_events.2025.t
	desc = algerian_events.2025.d
	picture = GFX_alg_hirak6
	is_triggered_only = yes

	option = {
		name = algerian_events.2025.a
		log = "[GetDateText]: [This.GetName]: algerian_events.2025.a executed"
		clr_country_flag = ALG_protests_ongoing
		clear_variable = ALG_protest_exhaustion
		every_owned_state = { clr_state_flag = ALG_locals_swayed }
		ALG_update_hirak_gui_dirty_variable = yes
		if = {
			limit = { has_power_balance = { id = algeria_power_balance } }
			add_power_balance_value = {
				id = algeria_power_balance
				value = 0.05
			}
		}
		ai_chance = { base = 10 }
	}
}
country_event = {
	id = algerian_events.300
	title = algerian_events.300.t
	desc = algerian_events.300.d
	picture = GFX_algerian_protests1
	is_triggered_only = yes
	fire_only_once = yes

	option = {
		name = algerian_events.300.a # Downplay unrest
		log = "[GetDateText]: [This.GetName]: algerian_events.300.a executed"
		add_stability = -0.03
		add_popularity = { ideology = communism popularity = 0.02 } # regime consolidates
		ai_chance = {
			base = 12
		}
	}

	option = {
		name = algerian_events.300.b # Protests escalate
		log = "[GetDateText]: [This.GetName]: algerian_events.300.b executed"
		hidden_effect = {
			country_event = { id = algerian_events.301 days = 10 }
		}
		ai_chance = {
			base = 10
		}
	}
}
country_event = {
	id = algerian_events.301
	title = algerian_events.301.t
	desc = algerian_events.301.d
	picture = GFX_algerian_protests1
	is_triggered_only = yes

	option = {
		name = algerian_events.301.a
		log = "[GetDateText]: [This.GetName]: algerian_events.301.a executed"
		set_country_flag = ALG_protests_ongoing
		hidden_effect = {
			news_event = { id = algerian_events.230 days = 7 }
		}
		ai_chance = { base = 10 }
	}
}
news_event = {
	id = algerian_events.230
	title = algerian_events.230.t
	desc = algerian_events.230.d
	picture = GFX_Algerian_CW
	is_triggered_only = yes
	major = yes

	option = {
		name = algerian_events.230.a
		ai_chance = { base = 10 }
	}
}
