add_namespace = sudan
add_namespace = sudan_news

country_event = {			#Victory in the Second Sudanese Civil War
	id = sudan.1
	title = sudan.1.t
	desc = sudan.1.d
	picture = GFX_report_event_spla

	trigger = {
		tag = SSD
		has_idea = partially_recognized_state
		has_war_with = SUD
		controls_state  = 762
		controls_state  = 1140
		controls_state  = 1141
		controls_state  = 1142
		SUD = {
			surrender_progress > 0.2
		}
	}

	fire_only_once = yes

	option = {
		name = sudan.1.a
		ai_chance = {
			factor = 80
		}
		white_peace= SUD
		drop_cosmetic_tag = yes
		remove_ideas = SPLM_Nasir_insurgency
		transfer_state = 1140
		transfer_state = 1141
		1140 = {
			set_demilitarized_zone = yes
		}
		1141 = {
			set_demilitarized_zone = yes
		}
	}
	option = {
		name = sudan.1.b
		ai_chance = {
			factor = 20
		}
		remove_ideas = SPLM_Nasir_insurgency
		start_civil_war = {
			ideology = nationalist
			size = 0.2
			states = {
				1142
			}
		}
		every_state = {
			limit = { is_core_of = SUD }
			add_core_of = SSD
		}
		set_cosmetic_tag = SSD_SUD
	}
}

country_event = {			#Death of John Garang
	id = sudan.2
	title = sudan.2.t
	desc = sudan.2.d
	picture = GFX_report_event_garang

	trigger = {
		tag = SSD
		date > 2005.7.1
		date < 2005.7.30
	}

	fire_only_once = yes

	option = {
		name = sudan.2.a
		ai_chance = {
			factor = 100
		}
		add_country_leader_role = {
			character = SSD_salva_kiir
			country_leader = {
				ideology = social_democrat_ideology
			}
			promote_leader = yes
		}
	}
}

country_event = {			#Comprehensive Peace Agreement
	id = sudan.3
	title = sudan.3.t
	desc = sudan.3.d
	picture = GFX_report_event_sudan_peace

	trigger = {
		tag = SUD
		date > 2005.1.9
		date < 2005.1.29
		has_war_with = SSD
	}

	fire_only_once = yes

	option = {
		name = sudan.3.a
		ai_chance = {
			factor = 100
		}
		white_peace= SSD
		puppet = SSD
		SSD = {
			drop_cosmetic_tag = yes
			remove_ideas = SPLM_Nasir_insurgency
			set_politics = {
				ruling_party = social_democrat
				elections_allowed = yes
			}
			set_popularities = {
				reactionary = 5
				nationalist = 30
				democratic_socialist = 10
				communist = 8
				social_liberal = 5
				social_democrat = 42
			}
			set_cosmetic_tag = SSD_subject
		}
		1140 = {
			set_demilitarized_zone = yes
		}
	}
	option = {
		name = sudan.3.b
		ai_chance = {
			factor = 0
		}
		add_political_power = -100
	}
}

country_event = {			#South Sudanese Independence
	id = sudan.4
	title = sudan.4.t
	desc = sudan.4.d
	picture = GFX_report_event_south_sudan

	trigger = {
		tag = SUD
		date > 2011.6.15
		date < 2011.7.9
		SSD = {
			OR = {
				exists = no
				is_puppet_of = SUD
			}
		}
	}

	fire_only_once = yes

	option = {
		name = sudan.4.a
		ai_chance = {
			factor = 100
		}
		end_puppet = SSD
		SSD = {
			transfer_state = 762
			transfer_state = 1142
			drop_cosmetic_tag = yes
		}
		1140 = {
			set_demilitarized_zone = yes
		}
	}
	option = {
		name = sudan.4.b
		ai_chance = {
			factor = 100
		}
		add_stability = -0.1
		add_political_power = -100
		if = {
			limit ={
				SSD = {
					exists = no
				}
				SUD = {
					controls_state  = 762
					controls_state  = 1142
				}
			}
			762 = {
				remove_core_of = SUD
				add_resistance = 50
			}
			1142 = {
				remove_core_of = SUD
				add_resistance = 50
			}
		}
		else = {
			SSD ={
				set_politics = {
					ruling_party = nationalist
					elections_allowed = no
				}
				add_popularity = {
					ideology = nationalist
					popularity = 0.3
				}
				start_civil_war = {
					ideology = social_democrat
					size = 0.5
				}
			}
		}
		add_political_power = -100
	}
}

news_event = {			##South Sudan Independence
	id = sudan_news.1
	title = sudan_news.1.t
	desc = sudan_news.1.d
	picture = GFX_news_south_sudan

	is_triggered_only = yes
	major = yes

	option = {
		name = sudan_news.1.a
	}
}

news_event = {			##South Sudan Independence - military victory
	id = sudan_news.2
	title = sudan_news.1.t
	desc = sudan_news.2.d
	picture = GFX_news_south_sudan

	is_triggered_only = yes
	major = yes

	option = {
		name = sudan_news.1.a
	}
}
