focus_tree = {
	id = south_african_focus
	
	country = {
		factor = 0
		
		modifier = {
			add = 10
			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_focus_NOR_restore_public_trust_in_the_storting
		x = 1
		y = 0

		cost = 5

		ai_will_do = {
			factor = 1
		}

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

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
	
		search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
			add_political_power = 120
		}
	}

	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
		search_filters = { FOCUS_FILTER_INDUSTRY }
		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 = 5

		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
		search_filters = { FOCUS_FILTER_MANPOWER }
		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_focus_BRA_tribunal
		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
		search_filters = { FOCUS_FILTER_MANPOWER }
		completion_reward = {
			remove_ideas = SAF_history_of_segregation_2
		}
	}

	focus = {
		id = SAF_outlaw_strikes
		icon = GFX_focus_CHL_avenge_the_pacification_of_araucania
		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

		search_filters = { FOCUS_FILTER_INDUSTRY }
		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
		x = 5
		y = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
		add_political_power = 120
		add_timed_idea = {
				idea = POR_british_influence
				days = 1460
			}
		}
	}

	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 = 5

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		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_focus_ETH_amedeos_feast_of_maskal
		prerequisite = { focus = SAF_support_the_policy_of_appeasement }
		x = -1
		y = 1
		relative_position_id = SAF_support_the_policy_of_appeasement

		cost = 5

		ai_will_do = {
			factor = 2
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {			
			swap_ideas = {
				remove_idea = SAF_ossewabrandwag
				add_idea = SAF_ossewabrandwag_2
			}
			remove_opinion_modifier = { target = ENG modifier = SAF_anti_british_sentiment }
		}
	}

	focus = {
		id = SAF_ravno
		icon = GFX_focus_ARG_keep_it_in_the_party
		prerequisite = { focus = SAF_police_windhoek }
		x = 0
		y = 1
		relative_position_id = SAF_police_windhoek

		cost = 10

		ai_will_do = {
			factor = 2
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_POLITICAL }

		completion_reward = {			
			add_ideas = SAF_equal_opportunities
		}
	}

	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 = 2

		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_joint_air_training_scheme }
		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_focus_BRA_free_prestes
		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
        search_filters = { FOCUS_FILTER_INDUSTRY }
		
		completion_reward = {
			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 = {
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
		search_filters = { FOCUS_FILTER_ANNEXATION }

		completion_reward = {
		ENG = { custom_effect_tooltip = needs_approval 
				country_event = tfv_south_africa.1
				}
		}
	}
	focus = {
		id = SAF_svoboda
		icon = GFX_focus_eng_decolonization
		prerequisite = { focus = SAF_secure_interests_in_africa }
		x = 0
		y = 2
		relative_position_id = SAF_secure_interests_in_africa

		cost = 10

		available = {
			SAF = {is_subject_of = ENG}
		}
		completion_reward = {
			hidden_effect = {
			add_autonomy_ratio = {
				value = 0.999
			}
			add_political_power = 300
			}
		    root = {
					set_autonomy = {
						target = SAF
						autonomy_state = autonomy_free
					}
				}
			}
		}
	

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

	focus = {
		id = SAF_native_laws_amendment_act
		icon = GFX_goal_generic_forceful_treaty
		prerequisite = { focus = SAF_police_windhoek }
		x = 0
		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 = yes
		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_ideas = SAF_cheap_labor_1
		}
	}

	focus = {
		id = SAF_work_for_all_poor
		icon = GFX_focus_generic_population_growth
		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
		search_filters = { FOCUS_FILTER_INDUSTRY }

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

	focus = {
		id = SAF_private
		icon = GFX_focus_POL_warsaw_main_station
		prerequisite = { focus = SAF_work_for_all_poor }
		x = 0
		y = 1
		relative_position_id = SAF_work_for_all_poor

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
		search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_popularity = { 
				ideology = fascism
				popularity = 0.05
			}
			add_popularity = { 
				ideology = communism
				popularity = 0.05
			}
			add_timed_idea = {
				idea = TUR_infrastructure_privatised_idea
				days = 360
			}
		}
	}

	############################
	##### INDUSTRY SECTION #####
	############################

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

		cost = 5

		ai_will_do = {
			factor = 15
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

        search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			custom_effect_tooltip = available_designer
			show_ideas_tooltip = SAF_south_african_railways
		}
	}

	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 = 20
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY}

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

	focus = {
		id = SAF_prodaza_chrome
		icon = GFX_focus_NOR_our_royal_claims
		prerequisite = { focus = SAF_expand_the_mining_industry }
		x = 0
		y = 1
		relative_position_id = SAF_expand_the_mining_industry

		cost = 10

		ai_will_do = {
			factor = 20
		}

		available = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY}

		completion_reward = {
			SAF = {
			give_resource_rights = { 
			receiver = ENG 
			state = 719 
			}
		  }
		  custom_effect_tooltip = generic_skip_one_line_tt
			add_popularity = {
					ideology = democratic
					popularity = 0.1
				}
				custom_effect_tooltip = generic_skip_one_line_tt
				add_ideas = free_trade
				custom_effect_tooltip = generic_skip_one_line_tt
		  remove_ideas = TUR_debt_council	
		}
	}

	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 = 5

		ai_will_do = {
			factor = 20
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = {  FOCUS_FILTER_INDUSTRY FOCUS_FILTER_RESEARCH}

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_heavy_engineering
				bonus = 1.0
				uses = 3
				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 = 1
		y = 2
		relative_position_id = SAF_south_african_railways

		cost = 5

		ai_will_do = {
			factor = 20
		}

		available = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			random_owned_controlled_state = {
				prioritize = { 275 }
				limit = {
					free_building_slots = {
						building = infrastructure
						size > 0
					}
				}
				ETH_upgrade_state_category = yes
				add_building_construction = {
					type = infrastructure
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_infrastructure_effort_Inf
			}
			random_owned_controlled_state = {
				prioritize = { 719 }
				limit = {
					free_building_slots = {
						building = infrastructure
						size > 0
					}
				}
				ETH_upgrade_state_category = yes
				add_building_construction = {
					type = infrastructure
					level = 2
					instant_build = yes
				}
				set_state_flag = SAF_infrastructure_effort_Inf2
			}
		}
	}

	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 = 5

		ai_will_do = {
			factor = 20
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY }

		completion_reward = {
			add_timed_idea = {
				idea = TUR_rearmament_scheme
				days = 180
			}
			random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 3
				add_building_construction = {
					type = arms_factory
					level = 3
					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 = 5

		ai_will_do = {
			factor = 15
		}

		available = {
			controls_state = 275
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY }

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

	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 = 5

		ai_will_do = {
			factor = 10
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY }


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

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

		cost = 5

		ai_will_do = {
			factor = 15
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_INDUSTRY }

		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 = 5

		ai_will_do = {
			factor = 45
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	

	focus = {
		id = SAF_the_cape_defense_institute
		icon = GFX_focus_research
		prerequisite = { focus = SAF_fund_the_university_of_south_africa }
		x = -1
		y = 6
		relative_position_id = SAF_south_african_railways

		cost = 5

		ai_will_do = {
			factor = 100
		}

		available = {
			is_subject = no
		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = SAF_defense_collaboration_initiative
		icon = GFX_goal_generic_scientific_exchange
		prerequisite = { focus = SAF_fund_the_university_of_south_africa }
		x = 1
		y = 6
		relative_position_id = SAF_south_african_railways

		cost = 5

		ai_will_do = {
			factor = 25
		}

		available = {
			is_subject = no
			has_war = yes
			is_in_faction = yes
			OR = {
				num_of_factories > 50
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_research_slot = 1
		}
	}


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

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

		cost = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_war_support = 0.05
			custom_effect_tooltip = generic_skip_one_line_tt
			army_experience = 20
			add_doctrine_cost_reduction = {
				name = SAF_special_service_battalion
				cost_reduction = 0.5
				uses = 1
				category = land_doctrine
			}
		}
	}
	focus = {
		id = SAF_invite_soviet_advisers
		icon = GFX_goal_generic_military_deal
		prerequisite = { focus = SAF_special_service_battalion }
		x = 0
		y = 1
		relative_position_id = SAF_special_service_battalion

		cost = 5

		ai_will_do = {
			factor = 1
		}

		available = {
			SOV = { exists = yes }
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		complete_tooltip = {
			
		}

		completion_reward = {
			add_ideas = SAF_soviet_advisers
			custom_effect_tooltip = generic_skip_one_line_tt
			add_doctrine_cost_reduction = {
				name = SAF__south_african_military_college
				cost_reduction = 0.5
				uses = 1
				category = land_doctrine
			}
		}
	}

	focus = {
		id = SAF_improve_the_three_oh_three
		icon = GFX_goal_generic_small_arms
		prerequisite = { focus = SAF_special_service_battalion }
		x = -2
		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_improve_the_three_oh_three
				bonus = 1.0
				uses = 1
				category = infantry_weapons
			}
		}
	}

	focus = {
		id = SAF_q_services_corps
		icon = GFX_goal_generic_army_motorized
		prerequisite = { focus = SAF_special_service_battalion }
		x = 2
		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 = no
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_q_services_corps
				bonus = 1.0
				uses = 2
				technology = motorised_infantry
				technology = tech_logistics_company
				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_invite_soviet_advisers }
		x = 0
		y = 2
		relative_position_id = SAF_special_service_battalion

		cost = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			remove_ideas = POR_unreliable_army
			custom_effect_tooltip = generic_skip_one_line_tt
			army_experience = 50
			add_doctrine_cost_reduction = {
				name = SAF__south_african_military_college
				cost_reduction = 0.5
				uses = 1
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_expand_the_south_african_artillery
				bonus = 1.0
				uses = 1
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_sa_engineer_corps
				bonus = 1.0
				uses = 1
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_equipment_effort
				bonus = 1.0
				uses = 1
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {			
			add_tech_bonus = {
				name = SAF_mechanization_effort
				bonus = 1.0
				uses = 1
				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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_south_african_special_forces
				bonus = 1.0
				uses = 1
				category = para_tech
				category = marine_tech
				category = mountaineers_tech
			}
			if = {
				limit = { has_dlc = "Arms Against Tyranny" }
				add_doctrine_cost_reduction = {
					cost_reduction = 0.5
					uses = 2
					category = special_forces_doctrine
				}
			}
		}
	}

	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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_tech_bonus = {
				name = SAF_armor_effort
				bonus = 2.0
				uses = 3
				category = armor
			}
		}
	}


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

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

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5

		ai_will_do = {
			factor = 0.4
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5

		ai_will_do = {
			factor = 0.6
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			air_experience = 25
			add_doctrine_cost_reduction = {
				name = SAF_perfect_the_cab_rank_technique
				cost_reduction = 0.5
				uses = 1
				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 = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

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


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

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

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5
				add_building_construction = {
					type = dockyard
					level = 5
					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 = 5

		ai_will_do = {
			factor = 0.8
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		completion_reward = {
			add_doctrine_cost_reduction = {
				name = SAF_protect_the_trade
				cost_reduction = 0.5
				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 = 5

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		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
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}
		
		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes
        search_filters = { FOCUS_FILTER_RESEARCH }

		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 = 5

		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
				}
			}
		}
	}
}		
