SAF_Decision_Group_Boer_War = {
	SFR_hold_natal_mission = {

		icon = generic_tank

		available = {
			OR = {
				AND = {
					NOT = {
						SFR = {
							has_full_control_of_state = 719
						}
					}
					has_war_with = SAF
				}
				has_country_flag = sfr_mission_completed
				hidden_trigger = {
					has_country_flag = sfr_canada_not_interested
				}
			}
		}

		days_mission_timeout = 365
		is_good = yes

		activation = {
			OR = {
				tag = SFR
				tag = ENT
			}
			SFR = {
				has_full_control_of_state = 719
			}
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = sfr_mission_completed
				has_country_flag = sfr_canada_not_interested
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision SFR_hold_natal_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout SFR_hold_natal_mission"
			SFR = {
				country_event = { id = natal.12 } #Newcastle Convention
			}
			set_country_flag = sfr_mission_completed
		}
	}

	SAF_hold_natal_mission = {

		icon = generic_tank

		available = {
			OR = {
				AND = {
					NOT = {
						SFR = {
							has_full_control_of_state = 719
						}
					}
					has_war_with = SFR
				}
				has_country_flag = sfr_mission_completed
			}
		}

		days_mission_timeout = 365
		is_good = no

		activation = {
			tag = SAF
			SFR = {
				has_full_control_of_state = 719
			}
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = sfr_mission_completed
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision SAF_hold_natal_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout SAF_hold_natal_mission"
			effect_tooltip = {
				SFR = { country_event = natal.12 } #Newcastle Convention
			}
			set_country_flag = sfr_mission_completed
		}
	}
	
	ZIM_hold_rhodesia_mission = {

		icon = generic_tank

		available = {
			OR = {
				AND = {
					NOT = {
						ZIM = {
							has_full_control_of_state = 545
						}
					}
					has_war_with = SAF
				}
				has_country_flag = sfr_mission_completed
				hidden_trigger = {
					has_country_flag = sfr_canada_not_interested
				}
			}
		}

		days_mission_timeout = 380
		is_good = yes

		activation = {
			OR = {
				tag = ENT
				tag = ZIM
			}
			ZIM = {
				has_full_control_of_state = 545
			}
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = sfr_mission_completed
				has_country_flag = sfr_canada_not_interested
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision SFR_hold_natal_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout SFR_hold_natal_mission"
			ZIM = {
				country_event = { id = natal.12 } #Newcastle Convention
			}
			set_country_flag = sfr_mission_completed
		}
	}

	SAF_hold_rhodesia_mission = {

		icon = generic_tank

		available = {
			OR = {
				AND = {
					NOT = {
						ZIM = {
							has_full_control_of_state = 545
						}
					}
					has_war_with = SAF
				}
				AND = {
					ZIM = { exists = no }
					SAF = { owns_state = 545 }
				}
				has_country_flag = sfr_mission_completed
			}
		}

		days_mission_timeout = 380
		is_good = no

		activation = {
			tag = SAF
			ZIM = {
				has_full_control_of_state = 545
			}
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = sfr_mission_completed
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision SAF_hold_natal_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout SAF_hold_natal_mission"
			effect_tooltip = {
				ZIM = { country_event = natal.12 } #Newcastle Convention
			}
			set_country_flag = sfr_mission_completed
		}
	}
	
	SAF_defend_South_Africa_mission = {

		icon = generic_tank

		available = {
			NOT = {
				controls_state = 85 #Lesotho
				controls_state = 275 #Transvaal
				controls_state = 542 #Bechuanaland
				controls_state = 545 #Rhodesia
				controls_state = 681 #Western Cape
				controls_state = 719 #Natal
				controls_state = 738 #Swaziland
				controls_state = 945 #Northern Cape
				controls_state = 946 #Eastern Cape
				controls_state = 947 #OFS
			}
			has_war_with = ENT
		}

		days_mission_timeout = 365
		is_good = yes

		activation = {
			tag = SAF
			controls_state = 85 #Lesotho
			controls_state = 275 #Transvaal
			controls_state = 542 #Bechuanaland
			controls_state = 545 #Rhodesia
			controls_state = 681 #Western Cape
			controls_state = 719 #Natal
			controls_state = 738 #Swaziland
			controls_state = 945 #Northern Cape
			controls_state = 946 #Eastern Cape
			controls_state = 947 #OFS
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = saf_mission_completed
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision SAF_defend_South_Africa_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout SAF_defend_South_Africa_mission"
			country_event = { id = natal.13 } #Peace with ENT
			set_country_flag = saf_mission_completed
		}
	}

	ENT_defend_South_Africa_mission = {

		icon = generic_tank

		available = {
			SAF = {
				NOT = {
					controls_state = 85 #Lesotho
					controls_state = 275 #Transvaal
					controls_state = 542 #Bechuanaland
					controls_state = 545 #Rhodesia
					controls_state = 681 #Western Cape
					controls_state = 719 #Natal
					controls_state = 738 #Swaziland
					controls_state = 945 #Northern Cape
					controls_state = 946 #Eastern Cape
					controls_state = 947 #OFS
				}
			}
			has_war_with = SAF
		}

		days_mission_timeout = 365
		is_good = no

		activation = {
			tag = ENT
			controls_state = 85 #Lesotho
			controls_state = 275 #Transvaal
			controls_state = 542 #Bechuanaland
			controls_state = 545 #Rhodesia
			controls_state = 681 #Western Cape
			controls_state = 719 #Natal
			controls_state = 738 #Swaziland
			controls_state = 945 #Northern Cape
			controls_state = 946 #Eastern Cape
			controls_state = 947 #OFS
			has_global_flag = saf_boer_war
			NOT = {
				has_country_flag = saf_mission_completed
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision ENT_defend_South_Africa_mission"
			custom_effect_tooltip = dei_tt_the_timer_will_be_reset
		}

		timeout_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision timeout ENT_defend_South_Africa_mission"
			effect_tooltip = {
				SAF = {
					country_event = { id = natal.13 } #Peace with ENT
				}
			}
			set_country_flag = saf_mission_completed
		}
	}
}

# Southern Rhodesia decisions

political_actions = {
	zim_form_central_african_federation = {
		icon = GFX_decision_generic_nationalism
		
		allowed = {
			tag = ZIM
		}

		available = {
			813 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
			871 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
			955 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
			956 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
			957 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
			958 = {
				is_fully_controlled_by = ROOT
				resistance < 5
			}
		}

		visible = {
			owns_state = 813
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 957
			owns_state = 958
			has_completed_focus = ZIM_cross_zambezi
			NOT = { has_cosmetic_tag = ZIM_federation }
		}

		cost = 25
		fire_only_once = yes

		ai_will_do = {
			factor = 10
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision zim_form_central_african_federation"
			set_cosmetic_tag = ZIM_federation
			add_state_core = 813 #South Zambezia
			add_state_core = 871 #Nyasaland
			add_state_core = 955 #Eastern Zambezia
			add_state_core = 956 #Northern Zambezia
			add_state_core = 957 #Western Barotseland
			add_state_core = 958 #Eastern Barotseland
			813 = { set_state_name = "North-Western Rhodesia" }
			871 = { set_state_name = "Nyasaland" }
			955 = { set_state_name = "Chewaland" }
			956 = { set_state_name = "North-Eastern Rhodesia" }
			957 = { set_state_name = "Western Barotseland" }
			958 = { set_state_name = "Eastern Barotseland" }
		}
	}
	ZIM_claim_maf = {
		icon = generic_form_nation
		fire_only_once = yes
		allowed = { tag = ZAM }
		visible = {
			has_global_flag = MAF_collapse
			owns_state = 813
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 957
			owns_state = 958
			has_completed_focus = ZIM_cross_zambezi
			has_cosmetic_tag = ZIM_federation
		}
		available = {
			has_global_flag = MAF_collapse
			owns_state = 813
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 957
			owns_state = 958
			has_completed_focus = ZIM_cross_zambezi
			has_cosmetic_tag = ZIM_federation
			has_war = no
		}
		cost = 100
		ai_will_do = {
			factor = 0
		}
		remove_effect = {
		set_country_flag = ZIM_claim_maf
		custom_effect_tooltip = KIK_gain_wargoals_tt
		every_country = {
			limit = { is_in_array = { global.MAF_collapse_tags = THIS } }
			ROOT = {
				create_wargoal = {
					type = annex_everything target = PREV
				}
			}
		}
		every_state = {
			limit = { has_state_flag = MAF_claim }
			ROOT = {
				add_state_claim = PREV
			}
		}
		hidden_effect = { add_state_claim = 925 }
		every_country = {
			limit = { is_subject_of = ROOT }
			ROOT = {
				annex_country = {
					target = PREV
					transfer_troops = yes
				}
			}
		}
		unlock_decision_tooltip = AFR_form_maf
		log = "[GetDateText]: [Root.GetName]: Decision ZAM_claim_maf"
		}
	}
	ZIM_form_maf = {
		icon = generic_form_nation
		fire_only_once = yes
		allowed = { tag = ZAM }
		visible = {
			has_global_flag = MAF_collapse
			owns_state = 813
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 957
			owns_state = 958
			owns_state = 539
			owns_state = 1183
			owns_state = 965
			owns_state = 925
			owns_state = 660
			owns_state = 927
			owns_state = 558
			owns_state = 881
			has_completed_focus = ZIM_cross_zambezi
			has_cosmetic_tag = ZIM_federation
		}
		available = {
			has_global_flag = MAF_collapse
			owns_state = 813
			owns_state = 871
			owns_state = 955
			owns_state = 956
			owns_state = 957
			owns_state = 958
			owns_state = 539
			owns_state = 1183
			owns_state = 965
			owns_state = 925
			owns_state = 660
			owns_state = 927
			owns_state = 558
			owns_state = 881
			has_completed_focus = ZIM_cross_zambezi
			has_cosmetic_tag = ZIM_federation
			has_war = no
		}
		days_remove = 10
		cost = 0
		ai_will_do = {
			factor = 0
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision AFR_accept_bribes"
			custom_effect_tooltip = MAF_reform_mittelafrika_tt
			every_state = {
				limit = { has_state_flag = MAF_claim }
				ROOT = {
						add_state_core = PREV
				}
			}
			hidden_effect = { 925 = { add_core_of = ZIM } }
			set_cosmetic_tag = GBR_MITTEL
		}
	}
}

ZIM_Decision_recover_zambesia = {
	zim_intervene_northern_rhodesia = {
		icon = generic_prepare_civil_war

		available = {
			FROM = {
				any_neighbor_country = {
					custom_trigger_tooltip = {
						tooltip = is_ally_of_ROOT
						is_ally_of_ROOT = yes
					}
				}
			}
		}

		visible = {
			has_completed_focus = ZIM_cross_zambezi
			can_declare_war_on = FROM
			is_subject = no
		}

		cost = 0
		days_remove = SAF_invade_north_rhodesia_time?0
		war_with_target_on_remove = yes
		cancel_if_not_visible = yes
		fire_only_once = yes
		
		targets = { ZAM BRT MLW }
		target_root_trigger = {
			has_completed_focus = ZIM_cross_zambezi
		}
		target_trigger = {
			can_declare_war_on = FROM
		}

		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				OR = {
					ROOT_is_threatened_cautious = yes
					FROM = { dont_start_major_faction_wars = yes }
					FROM = { default_attack_AI_trigger_FROM = yes }
					FROM = { is_ai = no }
					OR = {
						NMB = { is_ai = no }
						TZN = { is_ai = no }
					}
				}
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision zim_intervene_northern_rhodesia"
			if = {
				limit = { is_ai = yes }
				set_country_flag = { flag = imminent_war days = 31 value = 1 }
				set_variable = { SAF_invade_north_rhodesia_time = 30 }
				setup_decision_attack_AI = yes
			}
			else = {
				add_state_claim = 813 #South Zambezia
				add_state_claim = 955 #Eastern Zambezia
				add_state_claim = 956 #Northern Zambezia
				add_state_claim = 957 #Western Barotseland
				add_state_claim = 958 #Eastern Barotseland
				declare_war_on = {
					target = FROM
					type = annex_everything
				}
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove zim_intervene_northern_rhodesia"
			if = {
				limit = { is_ai = yes }
				clear_variable = SAF_invade_north_rhodesia_time
				clear_decision_attack_AI = yes
				add_state_claim = 813 #South Zambezia
				add_state_claim = 955 #Eastern Zambezia
				add_state_claim = 956 #Northern Zambezia			
				add_state_claim = 957 #Western Barotseland
				add_state_claim = 958 #Eastern Barotseland
				declare_war_on = {
					target = FROM
					type = annex_everything
				}
			}
		}
	}
	
	zim_intervene_nyasaland = {
		icon = generic_prepare_civil_war

		available = {
			FROM = {
				any_neighbor_country = {
					custom_trigger_tooltip = {
						tooltip = is_ally_of_ROOT
						is_ally_of_ROOT = yes
					}
				}
			}
		}

		visible = {
			has_completed_focus = ZIM_cross_zambezi
			can_declare_war_on = FROM
			is_subject = no
		}

		cost = 0
		days_remove = SAF_invade_nyasaland_time?0
		war_with_target_on_remove = yes
		cancel_if_not_visible = yes
		fire_only_once = yes
		
		targets = { ZAM BRT MLW }
		target_root_trigger = {
			has_completed_focus = ZIM_cross_zambezi
		}
		target_trigger = {
			can_declare_war_on = FROM
		}

		ai_will_do = {
			factor = 10
			modifier = {
				factor = 0
				OR = {
					ROOT_is_threatened_cautious = yes
					FROM = { dont_start_major_faction_wars = yes }
					FROM = { default_attack_AI_trigger_FROM = yes }
					FROM = { is_ai = no }
					OR = {
						NMB = { is_ai = no }
						TZN = { is_ai = no }
					}
				}
			}
		}

		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision zim_intervene_nyasaland"
			if = {
				limit = { is_ai = yes }
				set_country_flag = { flag = imminent_war days = 31 value = 1 }
				set_variable = { SAF_invade_nyasaland_time = 30 }
				setup_decision_attack_AI = yes
			}
			else = {
				add_state_claim = 871 #Nyasaland
				declare_war_on = {
					target = FROM
					type = annex_everything
				}
			}
		}

		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove zim_intervene_nyasaland"
			if = {
				limit = { is_ai = yes }
				clear_variable = SAF_invade_nyasaland_time
				clear_decision_attack_AI = yes
				add_state_claim = 871 #Nyasaland
				declare_war_on = {
					target = FROM
					type = annex_everything
				}
			}
		}
	}
}