################################################
# South Africa Events (Mittelafrikan collapse) #
################################################

add_namespace = saf.collapse

country_event = {
	id = saf.collapse.1
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.1"}
	title = saf.collapse.1.t
	desc = saf.collapse.1.d
	picture = GFX_report_event_SPR_civwar3

	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
		name = saf.collapse.1.a
		remove_ideas = SAF_threatened_by_mittelafrika
		hidden_effect = {
		set_global_flag = SAF_MAF_collapse
		}
		SAF = {
				country_event = {
					id = saf.collapse.7
					days = 3
				}
			}
	}
}

country_event = {
	id = saf.collapse.2
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.2"}
	title = saf.collapse.2.t
	desc = saf.collapse.2.d
	picture = GFX_report_event_SPR_civwar3

	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
		name = saf.collapse.2.a
		ZIM = {
			transfer_state = 871
			transfer_state = 955
			transfer_state = 956
			transfer_state = 813
			transfer_state = 958
			transfer_state = 957
			add_state_core = 871
			add_state_core = 955
			add_state_core = 956
			add_state_core = 813
			add_state_core = 958
			add_state_core = 957
		}
	}
	option = {
	name = saf.collapse.2.b
	if = {
		limit = {
			SAF = {
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 813
			owns_state = 958
			owns_state = 957
			}
		}
		MLW = {
			transfer_state = 871
			transfer_state = 955
			transfer_state = 956
			transfer_state = 813
			transfer_state = 958
			transfer_state = 957
		}
		MLW = { 
			add_state_core = 871
			add_state_core = 955
			add_state_core = 956
			add_state_core = 813
			add_state_core = 958
			add_state_core = 957
		}
		SAF = {
			puppet = MLW
		}
		MLW = {
			set_capital = { state = 813 }
			set_cosmetic_tag = ZAM
		}
	}
	else = {
		add_political_power = 10
		}
	}
}

country_event = {
	id = saf.collapse.3
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.3"}
	title = saf.collapse.3.t
	desc = saf.collapse.3.d
	picture = GFX_report_event_SPR_civwar3

	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
		name = saf.collapse.3.a
		NMB = {
			transfer_state = 964
			transfer_state = 541
			 
			add_state_core = 964
			add_state_core = 541
		
	}
	SAF = {
	puppet = NMB
	}
	SAF = {
	puppet = NMB
	}
	NMB = {
				 country_event = {
				id = swa.1
				days = 1
			}
			}
	}
}

country_event = {
	id = saf.collapse.4
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.4"}
	title = saf.collapse.4.t
	desc = saf.collapse.4.d
	picture = GFX_report_event_SPR_civwar3

	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
		name = saf.collapse.4.a
		TZN = {
			transfer_state = 546
			transfer_state = 965
			transfer_state = 918
			add_state_core = 546
			add_state_core = 965
			add_state_core = 918
		}
		SAF = {
			puppet = TZN
		}
		TZN = {
			create_country_leader = {
				name = "Lionel de Rothschild"
				desc = "POLITICS_LIONEL_ROTHSCHILD_DESC"
				picture = "gfx/leaders/TZN/TZN_Lionel_de_Rothschild.png"
				expire = "1.1.1"
				ideology = social_conservative_subtype
	
			}
			hidden_effect = {
				set_cosmetic_tag = TZN
			}
		}
	}
	option = {
		name = saf.collapse.4.b
		if = {
			limit = {
				NMB = { 
					exists = yes 
				}
			}
			TZN = {
			transfer_state = 546
			transfer_state = 965
			transfer_state = 918
			add_state_core = 546
			add_state_core = 965
			add_state_core = 918
		
			}
			NMB = {
				puppet = TZN
			}
		}
		else = {
			add_political_power = 10
		}
	}
}

country_event = {
	id = saf.collapse.5
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.5"}
	title = saf.collapse.5.t
	desc = saf.collapse.5.d
	picture = GFX_report_event_SPR_civwar3
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	is_triggered_only = yes
	fire_only_once = yes
	
	option = {
		name = saf.collapse.5.a
		COG = {
			country_event = saf.collapse.6
		}
		set_global_flag = COG_is_in_civil_war
	}
}
	
country_event = {
	id = saf.collapse.6
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.6"}
	title = saf.collapse.6.t
	desc = saf.collapse.6.d
	picture = GFX_report_event_SPR_civwar3
	
	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		has_global_flag = COG_is_in_civil_war
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
		name = saf.collapse.6.a
		CAN = {
			add_to_faction = COG
		}
		COG = {
			add_ideas = GBR_Colonial_Government
		}
		if = {
			limit = {
				MSF = { 
					exists = yes 
				}
			}
			declare_war_on = {
				target = MSF
				type = annex_everything
			}
		}
		if = {
			limit = {
				KIV = { 
					exists = yes 
				}
			}
			declare_war_on = {
				target = KIV
				type = annex_everything
			}
		}
	}
	
	option = {
		name = saf.collapse.6.b
		COG = {
			give_military_access = SAF
		}
		SAF = {
			if = {
				limit = {
					MSF = { 
						exists = yes 
					}
				}
				declare_war_on = {
					target = MSF
					type = annex_everything
				}
			}
			if = {
				limit = {
					KIV = { 
						exists = yes 
					}
				}
				declare_war_on = {
					target = KIV
					type = annex_everything
				}
			}
		}
	}
}
	
	country_event = {
	id = saf.collapse.7
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.7"}
	title = saf.collapse.7.t
	desc = saf.collapse.7.d
	picture = GFX_report_event_saf_smuts

	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		OR = {
			has_idea = SAF_Jan_C_Smuts_hog_sco
			has_country_leader = { ruling_only = yes name = "Jan Smuts" }
		}
	}
	
	option = {
		name = saf.collapse.7.a
		if = {
			limit = {
				has_government = social_democrat
			}
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = social_democrat_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_liberal
			}
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = classical_liberalism_subtype
			}
		}
		else_if = {
			limit = {
				has_government = market_liberal
			}
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = liberal_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_conservative
			}
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = social_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = authoritarian_democrat
			}
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = authdem_boer_nationalism_subtype
			}
		}
		else = {
			create_country_leader = {
				name = "John Ronald Reuel Tolkien"
				desc = "POLITICS_TOLKIEN_DESC"
				picture = "gfx/leaders/SAF/Portrait_SAF_JRR_Tolkien.png"
				expire = "1.1.1"
				ideology = pataut_boer_nationalism_subtype
			}
		}
		set_country_flag = saf_tolkien_gov_general
		clr_country_flag = saf_duncan_gov_general
		clr_country_flag = saf_de_wet_gov_general
		clr_country_flag = saf_jansen_gov_general
	}
	option = {
		name = saf.collapse.7.b
		if = {
			limit = {
				has_government = social_democrat
			}
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = social_democrat_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_liberal
			}
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = classical_liberalism_subtype
			}
		}
		else_if = {
			limit = {
				has_government = market_liberal
			}
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = liberal_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_conservative
			}
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = social_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = authoritarian_democrat
			}
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = authdem_boer_nationalism_subtype
			}
		}
		else = {
			create_country_leader = {
				name = "Adolph Malan"
				picture = "gfx/leaders/SAF/Portrait_SAF_Adolph_Malan.png"
				expire = "1.1.1"
				ideology = pataut_boer_nationalism_subtype
			}
		}
		set_country_flag = saf_malan_gov_general
		clr_country_flag = saf_duncan_gov_general
		clr_country_flag = saf_de_wet_gov_general
		clr_country_flag = saf_jansen_gov_general
	}
	option = {
		name = saf.collapse.7.c
		if = {
			limit = {
				has_government = social_democrat
			}
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = social_democrat_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_liberal
			}
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = classical_liberalism_subtype
			}
		}
		else_if = {
			limit = {
				has_government = market_liberal
			}
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = liberal_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = social_conservative
			}
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = social_conservative_subtype
			}
		}
		else_if = {
			limit = {
				has_government = authoritarian_democrat
			}
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = authdem_boer_nationalism_subtype
			}
		}
		else = {
			create_country_leader = {
				name = "Jan Hendrik Hofmeyr"
				desc = ""
				picture = "gfx/leaders/SAF/Portrait_SAF_Jan_Hendrik_Hofmeyr.png"
				expire = "1.1.1"
				ideology = pataut_boer_nationalism_subtype
			}
		}
		set_country_flag = saf_hofmeyr_gov_general
		clr_country_flag = saf_duncan_gov_general
		clr_country_flag = saf_de_wet_gov_general
		clr_country_flag = saf_jansen_gov_general
	}
option = {
		name = saf.collapse.7.e
		add_war_support = 0.05
	}
}

country_event = {
	id = saf.collapse.8
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.8"}
	title = saf.collapse.8.t
	desc = saf.collapse.8.d
	picture = GFX_report_event_SPR_civwar3
	
	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
	name = saf.collapse.8.a
	CAN = {
	add_to_faction = GAB
	}
	hidden_effect = {
				set_cosmetic_tag = GAB_NFA
				add_ideas = GBR_Colonial_Government
				SAF = {
				country_event = { id = saf.collapse.10 days = 3 }
			}
			}
	}
	}
	
country_event = {
	id = saf.collapse.9
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.9"}
	title = saf.collapse.9.t
	desc = saf.collapse.9.d
	picture = GFX_report_event_SPR_civwar3
	
	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
	name = saf.collapse.9.a
	KEN = {
			transfer_state = 547
			transfer_state = 892
			transfer_state = 925
			transfer_state = 969
			transfer_state = 548
		
	}
	SAF = {
	puppet = KEN
	}
	}
	option = {
	name = saf.collapse.9.b
	KEN = {
			transfer_state = 547
			transfer_state = 892
			transfer_state = 925
			transfer_state = 969
		
	}
	UGA = {
			transfer_state = 548
			create_country_leader = {
				name = "Andrew Cohen"
				desc = "POLITICS_COHEN_DESC"
				picture = "gfx/leaders/UGA/Portrait_Uganda_Cohen.png"
				expire = "1.1.1"
				ideology = social_conservative_subtype
	
			}
			}
	
	SAF = {
	puppet = KEN
	}
	SAF = {
	puppet = UGA
	}
	}
	}
	
country_event = {
	id = saf.collapse.10
	immediate = {log = "[GetDateText]: [Root.GetName]: event saf.collapse.10"}
	title = saf.collapse.10.t
	desc = saf.collapse.10.d
	picture = GFX_report_event_SPR_civwar3
	
	is_triggered_only = yes
	fire_only_once = yes
	
trigger = {
		NOT = {
			OR = {
				has_socialist_government = yes
				has_government = authoritarian_democrat
				has_government = paternal_autocrat
				has_government = national_populist
			}
		}
	}
	
	option = {
	name = saf.collapse.10.a
		hidden_effect = {
		if = {
			limit = {
				TKE = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = TKE
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = TKE
					type = annex_everything
				}
			}
		}
		if = {
			limit = {
				KOG = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = KOG
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = KOG
					type = annex_everything
				}
			}
		}
		if = {
			limit = {
				CMR = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = CMR
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = CMR
					type = annex_everything
				}
			}
		}
		if = {
			limit = {
				MZB = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = MZB
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = MZB
					type = annex_everything
				}
			}
		}
		if = {
			limit = {
				KBR = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = KBR
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = KBR
					type = annex_everything
				}
			}
		}
		if = {
			limit = {
				CEA = { 
					exists = yes 
				}
			}
			SAF = {
				declare_war_on = {
					target = CEA
					type = annex_everything
				}
			}
			GAB = {
				declare_war_on = {
					target = CEA
					type = annex_everything
					}
				}
			}
		}
	}
}

	