focus_tree = {
	id = south_african_focus
	
	country = {
		factor = 0
		
		modifier = {
			add = 10
			tag = SAF
			has_dlc = "Together for Victory"
		}
		
		#modifier = {
		#	add = 10
		#	original_tag = SAF
		#	has_dlc = "Together for Victory"
		#}
	}
	
	default = no



#	focus = {
#		id = SAF_
#		icon = GFX_
#		prerequisite = { focus = }
#		mutually_exclusive = { focus =  }
#		x = -3
#		y = 0
#		relative_position_id = 
#
#		cost = 10
#
#		ai_will_do = {
#			factor = 1
#		}
#
#		available = {
#
#		}
#		
#		bypass = {
#
#		}
#
#		cancel_if_invalid = yes
#		continue_if_invalid = no
#		available_if_capitulated = no
#
#		complete_tooltip = {
#
#		}
#
#		completion_reward = {
#
#		}
#	}



	############################
	#### WAR PREP SECTION ######
	############################

	focus = {
		id = SAF_war_measures_act
		icon = GFX_goal_generic_demand_territory
		x = 1
		y = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			OR = {
				threat > 0.2
				NOT = { has_government = democratic }
			}
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_manpower = 50000
			add_equipment_to_stockpile = { type = infantry_equipment_0 amount = 1000 }
		}
	}

	focus = {
		id = SAF_emergency_workers
		icon = GFX_goal_generic_production
		prerequisite = { focus = SAF_war_measures_act }
		x = -1
		y = 1
		relative_position_id = SAF_war_measures_act

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = SAF_emergency_workers
		}
	}

	focus = {
		id = SAF_cape_garrison_artillery
		icon = GFX_goal_generic_fortify_city
		prerequisite = { focus = SAF_emergency_workers }
		x = -1
		y = 2
		relative_position_id = SAF_war_measures_act

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_in_home_area = yes
				}
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_coastal = yes
					}
					level = 2
					instant_build = yes
				}
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes							
						limit_to_naval_base = yes
					}
					level = 2
					instant_build = yes
				}
			}
		}
	}
	
	focus = {
		id = SAF_reconstitute_the_cape_corps
		icon = GFX_goal_generic_allies_build_infantry
		prerequisite = { focus = SAF_cape_garrison_artillery}
		x = -1
		y = 4
		relative_position_id = SAF_war_measures_act

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_history_of_segregation
				add_idea = SAF_history_of_segregation_2
			}
		}
	}

	focus = {
		id = SAF_expand_the_cape_corps
		icon = GFX_goal_generic_demand_territory
		prerequisite = { focus = SAF_reconstitute_the_cape_corps }
		mutually_exclusive = { focus = SAF_outlaw_strikes }
		x = 0
		y = 5
		relative_position_id = SAF_war_measures_act

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			remove_ideas = SAF_history_of_segregation_2
		}
	}

	focus = {
		id = SAF_outlaw_strikes
		icon = GFX_goal_generic_consumer_goods
		prerequisite = { focus = SAF_work_for_all_poor }
		mutually_exclusive = { focus = SAF_expand_the_cape_corps }
		x = 2
		y = 5
		relative_position_id = SAF_war_measures_act

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_cheap_labor_2
				add_idea = SAF_cheap_labor_3
			}
		}
	}


	############################
	# GO COMMONWEALTH SECTION ##
	############################

	focus = {
		id = SAF_support_the_policy_of_appeasement
		icon = GFX_goal_tfv_strengthen_commonwealth_ties
		mutually_exclusive = { focus = SAF_abandon_westminster }
		x = 5
		y = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			OR = {
				is_subject_of = ENG
				AND = {
					has_global_flag = ENG_decolonized
					is_in_faction_with = ENG
				}
			}
			ENG = { has_war = no }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
		add_political_power = 100
		}
	}

	focus = {
		id = SAF_csir
		icon = GFX_goal_tfv_generic_tech_sharing
		prerequisite = { focus = SAF_war_measures_act }
		prerequisite = { focus = SAF_support_the_policy_of_appeasement }
		x = -3
		y = 1
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			is_in_tech_sharing_group = commonwealth_research
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			SAF = {
   				modify_tech_sharing_bonus = {
         			id = commonwealth_research
         			bonus = 0.1  # we get 20% higher bonus from this group
    			}
			}
		}
	}

	focus = {
		id = SAF_police_windhoek
		icon = GFX_goal_generic_political_pressure
		prerequisite = { focus = SAF_support_the_policy_of_appeasement }
		x = -1
		y = 1
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 2
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {			
			swap_ideas = {
				remove_idea = SAF_ossewabrandwag
				add_idea = SAF_ossewabrandwag_2
			}
			add_war_support = 0.1
		}
	}

	focus = {
		id = SAF_joint_air_training_scheme
		icon = GFX_goal_generic_air_fighter2
		prerequisite = { focus = SAF_csir }
		x = -3
		y = 2
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = SAF_joint_air_training_scheme
		}
	}

	focus = {
		id = SAF_desert_equipment
		icon = GFX_goal_generic_allies_build_infantry
		prerequisite = { focus = SAF_cape_garrison_artillery }
		x = -4
		y = 3
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = SAF_desert_equipment
		}
	}

	focus = {
		id = SAF_suppress_the_stormjaers
		icon = GFX_goal_generic_military_sphere
		prerequisite = { focus = SAF_joint_air_training_scheme }
		prerequisite = { focus = SAF_police_windhoek }
		x = -2
		y = 3
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 2
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
		    add_political_power = 100
			remove_ideas = SAF_ossewabrandwag_2
		}
	}

	focus = {
		id = SAF_secure_interests_in_africa
		icon = GFX_goal_tfv_saf_secure_interests_in_africa
		prerequisite = { focus = SAF_suppress_the_stormjaers }
		prerequisite = { focus = SAF_desert_equipment }
		x = -3
		y = 4
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 0
		}

		available = {
			NOT = { has_war_with = ENG }
			ENG = { is_puppet = no }

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
		ENG = { custom_effect_tooltip = needs_approval 
				country_event = tfv_south_africa.1
				}
		}
	}

	############################
	## SHARED POLITICS SECTION #
	############################

	focus = {
		id = SAF_native_laws_amendment_act
		icon = GFX_goal_generic_forceful_treaty
		prerequisite = { focus = SAF_police_windhoek focus = SAF_support_the_afrikaner_broederbond }
		x = 0
		y = 2
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_ideas = SAF_cheap_labor_1
		}
	}

	focus = {
		id = SAF_work_for_all_poor
		icon = GFX_goal_generic_construction2
		prerequisite = { focus = SAF_native_laws_amendment_act }
		x = 0
		y = 4
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_cheap_labor_1
				add_idea = SAF_cheap_labor_2
			}
		}
	}

	############################
	#### GO FASCIST SECTION ####
	############################

	focus = {
		id = SAF_abandon_westminster
		icon = GFX_goal_tfv_sever_ties_with_uk
		mutually_exclusive = { focus = SAF_support_the_policy_of_appeasement }
		x = 7
		y = 0

		cost = 10

		ai_will_do = {
			factor = 0.5
			modifier = {
				NOT = { ENG = { has_government = democratic } }
				factor = 10
			}
			modifier = {
				NOT = { has_government = democratic }
				factor = 100
			}
			modifier = {	#makes it significantly more likely if player boosts non-democratic
				democratic < 0.5
				factor = 20
			}
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
		    add_political_power = 100
			add_timed_idea = { idea = SAF_abandon_westminster days = 1825 }
		}
	}

	focus = {
		id = SAF_support_the_afrikaner_broederbond
		icon = GFX_goal_support_fascism
		prerequisite = { focus = SAF_abandon_westminster }
		mutually_exclusive = { focus = SAF_empower_the_workers }
		x = 0
		y = 1
		relative_position_id = SAF_abandon_westminster

		cost = 10

		ai_will_do = {
			factor = 0.5
			modifier = {
				fascism > 0.25
				factor = 10
			}
			modifier = {
				fascism > 0.45
				factor = 10
			}
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_abandon_westminster
				add_idea = SAF_abandon_westminster_fascism
			}
		}
	}

	focus = {
		id = SAF_support_ossewabrandwag
		icon = GFX_goal_tfv_saf_support_ossebrandwag
		prerequisite = { focus = SAF_support_the_afrikaner_broederbond }
		x = 0
		y = 1
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			OR = {
				is_subject = no
				if = {
					limit = { NOT = { has_government = fascism } }
					AND = {
						has_autonomy_state = autonomy_dominion
						compare_autonomy_progress_ratio > 0.65
					}
				}
				if = {
					limit = { has_government = fascism } 
					AND = {
						has_autonomy_state = autonomy_satellite
						compare_autonomy_progress_ratio > 0.65
					}
				}
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			army_experience = 15
			swap_ideas = {
				remove_idea = SAF_ossewabrandwag
				add_idea = SAF_ossewabrandwag_fascism
			}
		}
	}

	focus = {
		id = SAF_celebrate_the_great_trek
		icon = GFX_goal_generic_demand_territory
		prerequisite = { focus = SAF_support_the_afrikaner_broederbond }
		x = 1
		y = 2
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_political_power = 100
			add_war_support = 0.15
		}
	}

	focus = {
		id = SAF_voortrekker_monument
		icon = GFX_goal_generic_national_unity
		prerequisite = { focus = SAF_native_laws_amendment_act focus = SAF_support_ossewabrandwag }
		x = -1
		y = 2
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_ideas = SAF_voortrekker_monument
		}
	}

	focus = {
		id = SAF_support_nazification_of_south_west_africa
		icon = GFX_goal_generic_attack_allies
		prerequisite = { focus = SAF_support_ossewabrandwag }
		mutually_exclusive = { focus = SAF_south_africa_first }
		x = 0
		y = 3
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 0.45
			modifier = {
				GER = { has_war = yes }
				factor = 0
			}
		}

		available = {
			fascism > 0.20
			if = {
				limit = { not = { has_government = fascism } }
				compare_autonomy_state > autonomy_colony
			}
			if = {
				limit = { has_government = fascism  }
				compare_autonomy_state > autonomy_reichsprotectorate
			}
			controls_state = 541
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			541 = {
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
				add_building_construction = {
					type = bunker
					province = {
						id = 5154
						id = 5189
						id = 7605
						id = 10963
					}
					level = 2
					instant_build = yes
				}
				add_building_construction = {
					type = bunker
					province = {
						id = 12519
						id = 7770
						id = 4879
					}
					level = 2
					instant_build = yes
				}
				add_building_construction = {
					type = air_base
					level = 2 
					instant_build = yes
				}
				add_building_construction = {
					type = naval_base
					province = {
						id = 2207
					}
					level = 1
					instant_build = yes
				}
			}
			
		}
	}

	focus = {
		id = SAF_south_africa_first
		icon = GFX_goal_generic_political_pressure
		prerequisite = { focus = SAF_celebrate_the_great_trek }
		mutually_exclusive = { focus = SAF_support_nazification_of_south_west_africa }
		x = 2
		y = 3
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 0.75
			modifier = {
				GER = { surrender_progress > 0.5 }
				factor = 10 #nopenopnenope
			}
		}

		available = {
			OR = {
				is_subject = no
				if = {
					limit = { NOT = { has_government = fascism } }
					AND = {
						has_autonomy_state = autonomy_dominion
						compare_autonomy_progress_ratio > 0.75
					}
				}
				if = {
					limit = { has_government = fascism } 
					AND = {
						has_autonomy_state = autonomy_satellite
						compare_autonomy_progress_ratio > 0.75
					}
				}
			}
			NOT = { has_war_together_with = ENG }
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = indoctrination_focus
			if = {
				limit = {
					is_subject = yes
				}
				OVERLORD = {
					set_autonomy = {
						target = SAF
						autonomy_state = autonomy_free
					}
				}
			}
			ENG = { remove_from_faction = ROOT }
			set_rule = { can_create_factions = yes }
			add_political_power = 100
			add_stability = 0.1
			add_manpower = 25000
		}
	}

	focus = {
		id = SAF_support_the_german_coup
		icon = GFX_goal_tfv_saf_support_german_coup
		prerequisite = { focus = SAF_support_nazification_of_south_west_africa }
		x = 1
		y = 4
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			fascism > 0.25
			controls_state = 541
			OR = {
				is_subject = no
				if = {
					limit = { NOT = { has_government = fascism } }
					AND = {
						has_autonomy_state = autonomy_dominion
						compare_autonomy_progress_ratio > 0.80
					}
				}
				if = {
					limit = { has_government = fascism } 
					AND = {
						has_autonomy_state = autonomy_satellite
						compare_autonomy_progress_ratio > 0.80
					}
				}
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {
			has_government = fascism
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			set_capital = { state = 541 }
			start_civil_war = {
				ruling_party = fascism
				ideology = democratic
				size = 0.75
				capital = 681
				states = { 681 275 719 }
			}

		}

		completion_reward = {
			custom_effect_tooltip = SAF_civil_war_tt
			hidden_effect = {
				set_capital = { state = 541 }
				start_civil_war = {
					ruling_party = fascism
					ideology = democratic
					size = 0.45
					capital = 681
					states = { 681 275 719 }
				}
				random_other_country = {
					limit = {
						original_tag = SAF
						has_government = democratic
					}
					load_oob = "SAF_D_civil_war"
					set_equipment_fraction = 0.7
					add_popularity = {
						ideology = democratic
						popularity = 0.35
					}
				}
				news_event = { hours = 6 id = news.262 }
				
				load_oob = "SAF_F_civil_war"
				set_equipment_fraction = 0.8
				
				add_popularity = {
					ideology = fascism
					popularity = 1
				}
				random_country = {
					limit = {
						original_tag = GER
						has_government = fascism
					}
					set_country_flag = saf_fascist_uprising # Affects GER ai_strategy
				}
			}
		}
	}

	focus = {
		id = SAF_reclaim_boer_colonies
		icon = GFX_goal_generic_major_war
		prerequisite = { focus = SAF_south_africa_first }
		x = 3
		y = 4
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
		has_army_manpower = { size > 150000 }
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			create_wargoal = {
				type = take_state_focus
				target = ENG
				generator = { 542 545 }
			}
		}
	}

	focus = {
		id = SAF_commemorate_the_battle_of_blood_river
		icon = GFX_goal_generic_secret_weapon
		prerequisite = { focus = SAF_support_nazification_of_south_west_africa }
		prerequisite = { focus = SAF_voortrekker_monument }
		x = -1
		y = 4
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_voortrekker_monument
				add_idea = SAF_voortrekker_monument_2
			}

		}
	}

	focus = {
		id = SAF_german_scientists
		icon = GFX_goal_tfv_generic_tech_sharing
		prerequisite = { focus = SAF_support_the_german_coup }
		x = -2
		y = 5
		relative_position_id = SAF_support_the_afrikaner_broederbond
		available = {
			GER = { has_government = fascism }
		}

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {
			
			is_in_faction_with = GER
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			GER = { add_to_tech_sharing_group = axis_research }
			add_to_tech_sharing_group = axis_research
		}
	}

	focus = {
		id = SAF_a_king_for_our_people
		icon = GFX_goal_generic_propaganda
		prerequisite = { focus = SAF_support_the_german_coup focus = SAF_south_africa_first }
		x = 2
		y = 5
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			custom_trigger_tooltip = {
				NOT  = { ENG = { has_idea = ENG_king_edward } }
				NOT = { ENG = { has_idea = ENG_king_edward_fascism } }
				NOT = { ENG = { has_completed_focus = ENG_the_kings_party } }
				ENG = { has_country_flag = ENG_king_died }
				tooltip = SAF_a_king_for_our_people_trigger_tt					
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = SAF_king_edward
		}
	}


	focus = {
		id = SAF_support_axis_interests
		icon = GFX_goal_generic_construct_infrastructure
		prerequisite = { focus = SAF_support_the_german_coup }
		x = 0
		y = 5
		relative_position_id = SAF_support_the_afrikaner_broederbond

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			controls_state = 542
			controls_state = 545
			controls_state = 546
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			custom_effect_tooltip = SAF_support_axis_interests_effect_tt
			every_state = {
				limit = {
					is_controlled_by = ROOT
					OR = {
						state = 542
						state = 545
						state = 546
						state = 540
						state = 544
						state = 295
						state = 538
						state = 718
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = infrastructure
					level = 3
					instant_build = yes
				}
			}
		}
	}

	############################
	### GO COMMUNIST SECTION ###
	############################

	focus = {
		id = SAF_empower_the_workers
		icon = GFX_goal_support_communism
		prerequisite = { focus = SAF_abandon_westminster }
		mutually_exclusive = { focus = SAF_support_the_afrikaner_broederbond }
		x = 5
		y = 1
		relative_position_id = SAF_abandon_westminster

		cost = 10

		ai_will_do = {
			factor = 0.5
			modifier = {	#will make country more likely to go down this path if player boosts communism support
				communism > 0.1
				factor = 10
			}
			modifier = {
				communism > 0.2
				factor = 10
			}
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			swap_ideas = {
				remove_idea = SAF_abandon_westminster
				add_idea = SAF_abandon_westminster_communism
			}
		}
	}

	focus = {
		id = SAF_support_spain
		icon = GFX_goal_generic_position_armies
		prerequisite = { focus = SAF_empower_the_workers }
		x = -1
		y = 1
		relative_position_id = SAF_empower_the_workers

		cost = 5

		ai_will_do = {
			factor = 30
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = scw_in_progress_tt
				AND = {
					has_global_flag = spanish_civil_war
					NOT = { has_global_flag = scw_over }
				}
			}
			OR = {
				has_government = communism
				communism > 0.1
			}
			OR = {
				is_subject = no
				if = {
					limit = { NOT = { has_government = fascism } }
					AND = {
						has_autonomy_state = autonomy_dominion
						compare_autonomy_progress_ratio > 0.65
					}
				}
				if = {
					limit = { has_government = fascism } 
					AND = {
						has_autonomy_state = autonomy_satellite
						compare_autonomy_progress_ratio > 0.65
					}
				}
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			country_event = { id = tfv_south_africa.50 }
			#event for nationalist/communist choice?
		}
	}

	focus = {
		id = SAF_repeal_the_native_representation_act
		icon = GFX_goal_generic_national_unity
		prerequisite = { focus = SAF_empower_the_workers }
		x = 1
		y = 1
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			communism > 0.1
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
		add_political_power = 120
		add_ideas =  SAF_black_volunteers
		swap_ideas = {
				remove_idea = SAF_ossewabrandwag
				add_idea = SAF_ossewabrandwag_2
			}
		}
	}
	focus = {
		id = SAF_equal_opportunity_employment
		icon = GFX_goal_generic_production
		prerequisite = { focus = SAF_repeal_the_native_representation_act }
		x = 2
		y = 2
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_ideas = SAF_equal_opportunities
			remove_ideas = SAF_ossewabrandwag_2
		}
	}

	focus = {
		id = SAF_burn_the_kings_portraits
		icon = GFX_goal_tfv_burn_the_royal_portraits
		prerequisite = { focus = SAF_support_spain focus = SAF_repeal_the_native_representation_act }
		x = 0
		y = 2
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			communism > 0.35
			OR = {
				compare_autonomy_progress_ratio > 0.7
				is_subject = no
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_political_power = 100
			add_popularity = {	
						ideology = communism
						popularity = 0.35
					}
			hidden_effect = {
			news_event = { hours = 6 id = news.263 }
					}
		}
	}
	focus = {
		id = SAF_anti_colonialist_crusade
		icon = GFX_goal_tfv_saf_anti_colonialist_crusade
		prerequisite = { focus = SAF_burn_the_kings_portraits }
		mutually_exclusive = { focus = SAF_join_comintern }
		x = 2
		y = 3
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 34
			modifier = {
				OR = {
					SOV = { has_war_with = ENG }
					SOV = { has_war_with = BEL }
					SOV = { has_war_with = POR }
				}
				factor = 20 #now is the time to strike!
			}
		}

		available = {
			is_subject = no
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			
		}

		completion_reward = {
			add_war_support = 0.1
			ENG = { 
					remove_from_faction = SAF
					add_opinion_modifier = { target = SAF modifier = SAF_anti_colonialist_crusaders }
			 }
			FRA = { 
			 		add_opinion_modifier = { target = SAF modifier = SAF_anti_colonialist_crusaders } 
			 }
			BEL = { 
			 		add_opinion_modifier = { target = SAF modifier = SAF_anti_colonialist_crusaders } 
			 }
			POR = { 
			 		add_opinion_modifier = { target = SAF modifier = SAF_anti_colonialist_crusaders } 
			 }
		}
	}

	focus = {
		id = SAF_Union_of_the_African_People
		icon = GFX_goal_anschluss
		prerequisite = { focus = SAF_anti_colonialist_crusade}
		x = 4
		y = 4
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
		    is_subject = no
			is_in_faction = no
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			set_rule = { can_create_factions = yes }
			create_faction = SAF_faction_uotap
			add_ideas = idea_political_correctness
			hidden_effect = {
				news_event = { hours = 6 id = news.264 }
			}
		}
	}
	focus = {
		id = SAF_liberate_portugese
		icon = GFX_goal_generic_military_sphere
		prerequisite = { focus = SAF_Union_of_the_African_People}
		x = 4
		y = 5
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				POR = { has_war = yes }
				factor = 10
			}
		}

		available = {
			has_army_manpower = { size > 150000 }
			OR = {
				ANG = { exists = no }
				MZB = { exists = no }
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			create_wargoal = {
				type = take_state_focus
				target = POR
				generator = { 540 544 }
			}
			
		}
	}
	focus = {
		id = SAF_liberate_belgian
		icon = GFX_goal_generic_more_territorial_claims
		prerequisite = { focus = SAF_liberate_portugese}
		x = 4
		y = 6
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				BEL = { has_war = yes }
				factor = 10
			}
		}

		available = {
		has_army_manpower = { size > 150000 }
			COG = { exists = no }
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			create_wargoal = {
				type = take_state_focus
				target = BEL
				generator = { 538 718 295 }
			}
			
		}
	}
	focus = {
		id = SAF_liberate_british
		icon = GFX_goal_generic_occupy_states_ongoing_war
		prerequisite = { focus = SAF_Union_of_the_African_People}
		x = 6
		y = 5
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				ENG = { has_war = yes }
				factor = 10
			}
		}

		available = {
		has_army_manpower = { size > 150000 }
			OR = {
				KEN = { exists = no } 
				ZIM = { exists = no }
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			create_wargoal = {
				type = take_state_focus
				target = ENG
				generator = { 546 547 548 542 545 }
			}
			
		}
	}

	

	focus = {
		id = SAF_join_comintern
		icon = GFX_goal_support_communism
		prerequisite = { focus = SAF_burn_the_kings_portraits }
		mutually_exclusive = { focus = SAF_anti_colonialist_crusade }
		x = 0
		y = 3
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 50
			modifier = {
				SOV = { surrender_progress > 0.75 }
				factor = 0 # let's not get into that...
			}
			modifier = {
				has_opinion = { target = SOV value > 50 }
				factor = 3
			}
		}

		available = {
			NOT = { has_war_with = SOV }
			SOV = { is_puppet = no }
			is_subject = no
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {
			is_in_faction_with = SOV
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		complete_tooltip = {
			
		}

		completion_reward = {
			SOV = { country_event = { id = tfv_south_africa.20 } }
		}
	}
	
	focus = {
		id = SAF_support_the_world_revolution
		icon = GFX_goal_generic_intelligence_exchange
		prerequisite = { focus = SAF_join_comintern }
		x = 0
		y = 4
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_ideas = SAF_support_the_world_revolution
		}
	}
	focus = {
		id = SAF_invite_soviet_advisers
		icon = GFX_goal_generic_military_deal
		prerequisite = { focus = SAF_support_the_world_revolution }
		x = 0
		y = 5
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			SOV = { exists = yes }
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		complete_tooltip = {
			
		}

		completion_reward = {
			add_ideas = SAF_soviet_advisers
			add_doctrine_cost_reduction = {
				name = SAF_invite_soviet_advisers
				cost_reduction = 0.5
				uses = 2
				category = cat_mass_assault
			}
			add_doctrine_cost_reduction = {
				name = SAF_invite_soviet_advisers
				cost_reduction = 0.5
				uses = 2
				category = land_doctrine
			}
		}
	}
	focus = {
		id = SAF_south_african_soviet_research_treaty
		icon = GFX_goal_tfv_generic_tech_sharing
		prerequisite = { focus = SAF_invite_soviet_advisers }
		x = 0
		y = 6
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 2
		}

		available = {
			SOV = { 
				exists = yes
				is_puppet = no
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		complete_tooltip = {
			
		}

		completion_reward = {
			SOV = {
				custom_effect_tooltip = needs_approval
				country_event = { id = tfv_south_africa.40 } #tech sharing
			}
		}

	}
	focus = {
		id = SAF_demand_madagascar
		icon = GFX_goal_generic_demand_territory
		prerequisite = { focus = SAF_anti_colonialist_crusade focus = SAF_join_comintern}
		x = 2
		y = 4
		relative_position_id = SAF_empower_the_workers

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			has_global_flag = sov_yes_pact
			FRA = {
				has_capitulated = yes
				exists = yes #otherwise Franco-British union might screw things up
				NOT = { has_government = communism }
			}
			NOT = { has_country_flag = britain_enforced_our_loyalty }
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			
		}

		completion_reward = {
			FRA = {
				custom_effect_tooltip = needs_approval
					country_event = { id = tfv_south_africa.30 hours = 12 }
			}
			hidden_effect = {
				news_event = { id = news.265 }
			}
		}
	}
	############################
	##### INDUSTRY SECTION #####
	############################

	focus = {
		id = SAF_south_african_railways
		icon = GFX_goal_generic_construct_infrastructure
		x = 20
		y = 0

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_south_african_railways_Inf
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = infrastructure
						size > 1
					}
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				set_state_flag = SAF_south_african_railways_Inf
			}
		}
	}

	focus = {
		id = SAF_expand_the_mining_industry
		icon = GFX_goal_generic_construction
		prerequisite = { focus = SAF_south_african_railways }
		x = -1
		y = 1
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_expand_the_mining_industry_IC
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
				set_state_flag = SAF_expand_the_mining_industry_IC
			}
			add_tech_bonus = {
				name = SAF_expand_the_mining_industry
				bonus = 0.75
				uses = 2
				technology = excavation2
				technology = excavation3
				technology = excavation4
				technology = excavation5
			}
		}
	}

	focus = {
		id = SAF_heavy_engineering
		icon = GFX_goal_generic_production
		prerequisite = { focus = SAF_south_african_railways }
		x = 1
		y = 1
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 20
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_heavy_engineering
				bonus = 0.75
				uses = 2
				category = industry
			}
		}
	}

	focus = {
		id = SAF_infrastructure_effort
		icon = GFX_goal_generic_construct_infrastructure
		prerequisite = { focus = SAF_heavy_engineering focus = SAF_expand_the_mining_industry }
		x = 0
		y = 2
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_infrastructure_effort_Inf
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = infrastructure
						size > 1
					}
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				set_state_flag = SAF_infrastructure_effort_Inf
			}
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = infrastructure
						size > 1
					}
				}
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
				set_state_flag = SAF_infrastructure_effort_Inf
			}
		}
	}

	focus = {
		id = SAF_armament_effort
		icon = GFX_goal_generic_construct_mil_factory
		prerequisite = { focus = SAF_infrastructure_effort }
		x = -1
		y = 3
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_armament_effort_AF
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_armament_effort_AF
			}
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_armament_effort_AF
			}
		}
	}

	focus = {
		id = SAF_south_african_steel
		icon = GFX_goal_generic_construction2
		prerequisite = { focus = SAF_infrastructure_effort }
		x = 1
		y = 3
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {
			controls_state = 275
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			275 = {
				add_resource = {
					type = steel
					amount = 21
				}
			}
		}
	}

	focus = {
		id = SAF_pretoria_arms
		icon = GFX_goal_generic_production2
		prerequisite = { focus = SAF_armament_effort }
		prerequisite = { focus = SAF_south_african_steel }
		x = -1
		y = 4
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_pretoria_arms_AF
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_pretoria_arms_AF
			}
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_pretoria_arms_AF
			}
		}
	}

	focus = {
		id = SAF_expand_the_rand_mines
		icon = GFX_goal_generic_consumer_goods
		prerequisite = { focus = SAF_south_african_steel }
		x = 1
		y = 4
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = SAF_gold_exports
		}
	}

	focus = {
		id = SAF_fund_the_university_of_south_africa
		icon = GFX_focus_research
		prerequisite = { focus = SAF_pretoria_arms focus = SAF_expand_the_rand_mines }
		x = 0
		y = 5
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 150
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = SAF_establish_the_atomics_energy_board
		icon = GFX_focus_wonderweapons
		prerequisite = { focus = SAF_fund_the_university_of_south_africa }
		x = 0
		y = 6
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 5
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_tech_bonus = {
				name = SAF_establish_the_atomics_energy_board
				bonus = 1.0
				uses = 2
				category = nuclear
			}
		}
	}

	focus = {
		id = SAF_the_cape_defense_institute
		icon = GFX_focus_research
		prerequisite = { focus = SAF_establish_the_atomics_energy_board }
		x = -1
		y = 7
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 100
		}

		available = {
			is_subject = no
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = SAF_defense_collaboration_initiative
		icon = GFX_goal_generic_scientific_exchange
		prerequisite = { focus = SAF_establish_the_atomics_energy_board }
		x = 1
		y = 7
		relative_position_id = SAF_south_african_railways

		cost = 10

		ai_will_do = {
			factor = 25
		}

		available = {
			OR = {
			    is_subject = no
				num_of_factories > 35
				any_other_country = {
					is_in_faction_with = ROOT
					num_of_factories > 50
				}
			}
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_research_slot = 1
		}
	}


	############################
	####### ARMY SECTION #######
	############################

	focus = {
		id = SAF_special_service_battalion
		icon = GFX_goal_generic_army_doctrines
		x = 24
		y = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			army_experience = 10

			add_doctrine_cost_reduction = {
				name = SAF_special_service_battalion
				cost_reduction = 0.5
				uses = 2
				category = land_doctrine
			}
		}
	}

	focus = {
		id = SAF_improve_the_three_oh_three
		icon = GFX_goal_generic_small_arms
		prerequisite = { focus = SAF_special_service_battalion }
		x = -1
		y = 1
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_improve_the_three_oh_three
				bonus = 0.5
				uses = 2
				category = infantry_weapons
			}
		}
	}

	focus = {
		id = SAF_q_services_corps
		icon = GFX_goal_generic_army_motorized
		prerequisite = { focus = SAF_special_service_battalion }
		x = 1
		y = 1
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_tech_bonus = {
				name = SAF_q_services_corps
				bonus = 0.5
				uses = 1
				technology = motorised_infantry
			}
			add_tech_bonus = {
				name = SAF_q_services_corps
				bonus = 0.5
				uses = 2
				technology = tech_logistics_company2
				technology = tech_logistics_company3
				technology = tech_logistics_company4
			}
		}
	}

	focus = {
		id = SAF__south_african_military_college
		icon = GFX_goal_generic_military_sphere
		prerequisite = { focus = SAF_improve_the_three_oh_three focus = SAF_q_services_corps }
		x = 0
		y = 2
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			army_experience = 10
			add_doctrine_cost_reduction = {
				name = SAF__south_african_military_college
				cost_reduction = 0.5
				uses = 2
				category = land_doctrine
			}
		}
	}

	focus = {
		id = SAF_expand_the_south_african_artillery
		icon = GFX_goal_generic_army_artillery2
		prerequisite = { focus = SAF_improve_the_three_oh_three focus = SAF__south_african_military_college }
		x = -1
		y = 3
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_expand_the_south_african_artillery
				bonus = 0.75
				uses = 2
				category = artillery
			}
		}
	}

	focus = {
		id = SAF_sa_engineer_corps
		icon = GFX_goal_generic_allies_build_infantry
		prerequisite = { focus = SAF_q_services_corps focus = SAF__south_african_military_college }
		x = 1
		y = 3
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_sa_engineer_corps
				bonus = 0.75
				uses = 2
				category = support_tech
			}
		}
	}

	focus = {
		id = SAF_equipment_effort
		icon = GFX_goal_generic_army_artillery
		prerequisite = { focus = SAF_expand_the_south_african_artillery focus = SAF_sa_engineer_corps }
		x = 0
		y = 4
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_equipment_effort
				bonus = 0.5
				uses = 2
				category = infantry_weapons
				category = artillery
			}
		}
	}

	focus = {
		id = SAF_mechanization_effort
		icon = GFX_goal_generic_build_tank
		prerequisite = { focus = SAF_equipment_effort }
		x = -1
		y = 5
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_mechanization_effort
				bonus = 0.5
				uses = 2
				category = cat_mechanized_equipment
			}
		}
	}

	focus = {
		id = SAF_south_african_special_forces
		icon = GFX_goal_generic_special_forces
		prerequisite = { focus = SAF_equipment_effort focus = SAF_sa_engineer_corps }
		x = 1
		y = 5
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_ideas = special_forces
			add_tech_bonus = {
				name = SAF_south_african_special_forces
				bonus = 0.5
				uses = 2
				category = para_tech
				category = marine_tech
				category = mountaineers_tech
			}
		}
	}

	focus = {
		id = SAF_armor_effort
		icon = GFX_goal_generic_army_tanks
		prerequisite = { focus = SAF_south_african_special_forces focus = SAF_mechanization_effort }
		x = 0
		y = 6
		relative_position_id = SAF_special_service_battalion

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_tech_bonus = {
				name = SAF_armor_effort
				bonus = 0.5
				uses = 2
				category = armor
			}
		}
	}


	############################
	####### AIR SECTION ########
	############################

	focus = {
		id = SAF_commit_to_the_five_year_plan
		icon = GFX_goal_generic_build_airforce
		x = 28
		y = 0	

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			air_experience = 25
			random_state = {				
				limit = {
					has_state_flag = SAF_commit_to_the_five_year_plan_AB
				}
				add_building_construction = {
					type = air_base
					level = 2
					instant_build = yes
				}
			}
			add_doctrine_cost_reduction = {
				name = SAF_commit_to_the_five_year_plan
				cost_reduction = 0.5
				uses = 1
				category = air_doctrine
			}
		}

		completion_reward = {
			air_experience = 25
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = air_base
						size > 1
					}
				}
				add_building_construction = {
					type = air_base
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_commit_to_the_five_year_plan_AB
			}
			add_doctrine_cost_reduction = {
				name = SAF_commit_to_the_five_year_plan
				cost_reduction = 0.5
				uses = 1
				category = air_doctrine
			}
		}
	}

	focus = {
		id = SAF_improve_the_hawker_hartbees
		icon = GFX_goal_generic_air_fighter
		prerequisite = { focus = SAF_commit_to_the_five_year_plan }
		mutually_exclusive = { focus = SAF_replace_the_blenheim  }
		x = -1
		y = 1
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 0.4
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_improve_the_hawker_hartbees
				bonus = 1.0
				uses = 1
				category = light_fighter
			}
		}
	}

	focus = {
		id = SAF_replace_the_blenheim
		icon = GFX_goal_generic_occupy_start_war
		prerequisite = { focus = SAF_commit_to_the_five_year_plan }
		mutually_exclusive = { focus = SAF_improve_the_hawker_hartbees  }
		x = 1
		y = 1
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 0.6
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_replace_the_blenheim
				bonus = 1.0
				uses = 1
				category = tactical_bomber
				category = cas_bomber
				category = naval_bomber
			}
		}
	}

	focus = {
		id = SAF_perfect_the_cab_rank_technique
		icon = GFX_goal_generic_air_doctrine
		prerequisite = { focus = SAF_improve_the_hawker_hartbees focus = SAF_replace_the_blenheim }
		x = 0
		y = 2
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			air_experience = 25
			add_doctrine_cost_reduction = {
				name = SAF_perfect_the_cab_rank_technique
				cost_reduction = 0.5
				uses = 2
				category = cat_battlefield_support
			}
		}
	}

	focus = {
		id = SAF_desert_air_force
		icon = GFX_goal_generic_CAS
		prerequisite = { focus = SAF_perfect_the_cab_rank_technique }
		x = -1
		y = 3
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_desert_air_force
				bonus = 1.0
				uses = 1
				category = cas_bomber
			}
		}
	}

	focus = {
		id = SAF_secure_the_cape_sea_route
		icon = GFX_goal_generic_air_bomber 
		prerequisite = { focus = SAF_perfect_the_cab_rank_technique focus = SAF_replace_the_blenheim }
		x = 1
		y = 3
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_secure_the_cape_sea_route
				bonus = 1.0
				uses = 1
				category = naval_bomber
			}
		}
	}

	focus = {
		id = SAF_retain_experienced_pilots
		icon = GFX_goal_generic_air_doctrine
		prerequisite = { focus = SAF_desert_air_force focus = SAF_secure_the_cape_sea_route }
		x = 0
		y = 4
		relative_position_id = SAF_commit_to_the_five_year_plan

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			air_experience = 35
			add_doctrine_cost_reduction = {
				name = SAF_retain_experienced_pilots
				cost_reduction = 0.5
				uses = 1
				category = air_doctrine
			}
		}
	}


	############################
	###### NAVY SECTION ########
	############################

	focus = {
		id = SAF_seaward_defence_force
		icon = GFX_goal_generic_navy_doctrines_tactics
		x = 32
		y = 0		

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			navy_experience = 25
			random_state = {
				limit = {
					has_state_flag = SAF_seaward_defence_force_DY
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = dockyard
					level = 1
					instant_build = yes
				}
			}
		}

		completion_reward = {
			navy_experience = 25
			random_owned_controlled_state = {
				prioritize = { 681 719 }
				limit = {
					is_coastal = yes
					free_building_slots = {
						building = dockyard
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = dockyard
					level = 1
					instant_build = yes
				}
				set_state_flag = SAF_seaward_defence_force_DY
			}			
			add_doctrine_cost_reduction = {
				name = SAF_seaward_defence_force
				cost_reduction = 0.5
				uses = 1
				category = naval_doctrine
			}
		}
	}

	focus = {
		id = SAF_protect_the_trade
		icon = GFX_goal_generic_navy_cruiser
		prerequisite = { focus = SAF_seaward_defence_force }
		mutually_exclusive = { focus = SAF_disrupt_the_trade }
		x = -1
		y = 1
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 0.8
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_protect_the_trade
				bonus = 1.0
				uses = 1
				category = convoy_defense_tree
			}
		}
	}

	focus = {
		id = SAF_disrupt_the_trade
		icon = GFX_goal_generic_occupy_states_coastal
		prerequisite = { focus = SAF_seaward_defence_force }
		mutually_exclusive = { focus = SAF_protect_the_trade }
		x = 1
		y = 1
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 0.2
			modifier = {
				has_war_with = ENG
				factor = 10
			}
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_doctrine_cost_reduction = {
				name = SAF_disrupt_the_trade
				cost_reduction = 0.5
				uses = 1
				category = cat_trade_interdiction
			}
		}
	}

	focus = {
		id = SAF_expand_the_simons_town_base
		icon = GFX_goal_generic_construct_naval_dockyard
		prerequisite = { focus = SAF_protect_the_trade focus = SAF_disrupt_the_trade }
		x = 0
		y = 2
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = SAF_expand_the_simons_town_base_DY
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = dockyard
					level = 3
					instant_build = yes
				}
			}
			random_state = {
				limit = {
					has_state_flag = SAF_expand_the_simons_town_base_NB
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = coastal_bunker
					province = 12589
					level = 2
					instant_build = yes
				}
			}
		}

		completion_reward = {
			random_owned_controlled_state = {
				prioritize = { 681 }
				limit = {
					is_coastal = yes
					free_building_slots = {
						building = dockyard
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = dockyard
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_expand_the_simons_town_base_DY
			}
			if = {
				limit = { 681 = { is_controlled_by = ROOT } }
				681 = {
					add_building_construction = {
						type = coastal_bunker
						province = 12589
						level = 2
						instant_build = yes
					}
					set_state_flag = SAF_expand_the_simons_town_base_NB
				}
			}
		}
	}

	focus = {
		id = SAF_anti_submarine_tactics
		icon = GFX_goal_generic_navy_anti_submarine
		prerequisite = { focus = SAF_expand_the_simons_town_base }
		x = -1
		y = 3
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_anti_submarine_tactics
				bonus = 1.0
				ahead_reduction = 2
				uses = 1
				category = dd_tech
			}
		}
	}

	focus = {
		id = SAF_submarine_warfare
		icon = GFX_goal_generic_navy_submarine
		prerequisite = { focus = SAF_expand_the_simons_town_base }
		x = 1
		y = 3
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				has_war_with = ENG
				factor = 3
			}
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_tech_bonus = {
				name = SAF_submarine_warfare
				bonus = 1.0
				ahead_reduction = 2
				uses = 1
				category = ss_tech
			}
		}
	}

	focus = {
		id = SAF_prepare_overseas_offensive
		icon = GFX_goal_generic_navy_doctrines_tactics
		prerequisite = { focus = SAF_anti_submarine_tactics }
		mutually_exclusive = { focus = SAF_strengthen_the_cape_garrison_artillery }
		x = -1
		y = 4
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_doctrine_cost_reduction = {
				name = SAF_prepare_overseas_offensive
				cost_reduction = 0.5
				uses = 1
				category = convoy_defense_tree
			}
			add_tech_bonus = {
				name = SAF_prepare_overseas_offensive
				bonus = 1.0
				uses = 1
				category = marine_tech
				category = tp_tech
			}
		}
	}

	focus = {
		id = SAF_strengthen_the_cape_garrison_artillery
		icon = GFX_goal_generic_construct_military
		prerequisite = { focus = SAF_submarine_warfare }
		mutually_exclusive = { focus = SAF_prepare_overseas_offensive }
		x = 1
		y = 4
		relative_position_id = SAF_seaward_defence_force

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
					is_in_home_area = yes
				}
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_coastal = yes
					}
					level = 3
					instant_build = yes
				}
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes							
						limit_to_naval_base = yes
					}
					level = 1
					instant_build = yes
				}
			}
		}
	}
}		
