###########################
# South Africa Focus Tree
# By Thomahawk2k
###########################

focus_tree = {
	id = SFR_federation_focus

	country = {
		factor = 0

		modifier = {
			add = 1
			tag = SFR
		}
	}

	reset_on_civilwar = no
	default = no
	continuous_focus_position = { x = 100 y = 950 }

	focus = {
		id = SFR_the_new_south_africa_act
		icon = GFX_goal_SAF_federation
		x = 4
		y = 0
		cost = 5

		ai_will_do = {
			factor = 500
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_the_new_south_africa_act"
			every_state = {
				limit = {
					is_core_of = SAF
				}
				add_core_of = SFR
				remove_core_of = SAF
			}
			every_state = {
				limit = {
					is_claimed_by = SAF
				}
				add_claim_by = SFR
				remove_claim_by = SAF
			}
			add_stability = 0.1
		}
		search_filters = { FOCUS_FILTER_ANNEXATION }
	}
	
	focus = {
		id = SFR_milners_kindergarten
		icon = GFX_britishprimacy
		x = -2
		y = 1
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_the_new_south_africa_act
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_milners_kindergarten"
			add_stability = 0.05
			add_popularity = { ideology = paternal_autocrat popularity = 0.3 }
		}
		search_filters = { FOCUS_FILTER_STABILITY FOCUS_FILTER_POLITICAL }
	}
	
	focus = {
		id = SFR_herald_english_as_sole_language
		icon = GFX_SAF_englishlang
		x = -3
		y = 2
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_milners_kindergarten
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_herald_english_as_sole_language"
			add_ideas = SFR_idea_anglicisation
			hidden_effect = {
			country_event = { id = natal.54 days = 365 random = 100 }
			}
		}
	}
	
	focus = {
		id = SFR_attract_exile_settlement
		icon = GFX_SAF_increased_royals
		x = -4
		y = 3
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_herald_english_as_sole_language
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_attract_exile_settlement"
			if = {
				limit = {
					has_idea = SFR_idea_anglicisation_0_1
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_1_1 remove_idea = SFR_idea_anglicisation_0_1 }
			}
			else_if = {
				limit = {
					has_idea = SFR_idea_anglicisation_0_2
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_1_2 remove_idea = SFR_idea_anglicisation_0_2 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_anglicisation_1_0 remove_idea = SFR_idea_anglicisation }
			}
		}
	}
	
	focus = {
		id = SFR_support_british_companies
		icon = GFX_GBR_british_money
		x = -4
		y = 4
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_attract_exile_settlement
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_support_british_companies"
			if = {
				limit = {
					has_idea = SFR_idea_anglicisation_1_1
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_2_1 remove_idea = SFR_idea_anglicisation_1_1 }
			}
			else_if = {
				limit = {
					has_idea = SFR_idea_anglicisation_1_2
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_2_2 remove_idea = SFR_idea_anglicisation_1_2 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_anglicisation_2_0 remove_idea = SFR_idea_anglicisation_1_0 }
			}
		}
		search_filters = { FOCUS_FILTER_INDUSTRY }
	}
	
	focus = {
		id = SFR_banish_afrikaans_from_bureaucracy
		icon = GFX_focus_SAF_colonialist_crusade2
		x = -2
		y = 3
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_herald_english_as_sole_language
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_banish_afrikaans_from_bureaucracy"
			if = {
				limit = {
					has_idea = SFR_idea_anglicisation_1_0
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_1_1 remove_idea = SFR_idea_anglicisation_1_0 }
			}
			else_if = {
				limit = {
					has_idea = SFR_idea_anglicisation_2_0
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_2_1 remove_idea = SFR_idea_anglicisation_2_0 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_anglicisation_0_1 remove_idea = SFR_idea_anglicisation }
			}
		}
	}
	
	focus = {
		id = SFR_close_afrikaner_institutions
		icon = GFX_SAF_eliminate_boer
		x = -2
		y = 4
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_banish_afrikaans_from_bureaucracy
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_close_afrikaner_institutions"
			if = {
				limit = {
					has_idea = SFR_idea_anglicisation_1_1
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_1_2 remove_idea = SFR_idea_anglicisation_1_1 }
			}
			else_if = {
				limit = {
					has_idea = SFR_idea_anglicisation_2_1
				}
				swap_ideas = { add_idea = SFR_idea_anglicisation_2_2 remove_idea = SFR_idea_anglicisation_2_1 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_anglicisation_0_2 remove_idea = SFR_idea_anglicisation_0_1 }
			}
		}
	}
	
	focus = {
		id = SFR_teachers_from_the_empire
		icon = GFX_goal_KTG_Bookstack
		x = -3
		y = 5
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_support_british_companies
		}
		prerequisite = {
			focus = SFR_close_afrikaner_institutions
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_teachers_from_the_empire"
			swap_ideas = { add_idea = SFR_idea_anglicisation_3 remove_idea = SFR_idea_anglicisation_2_2 }
		}
		search_filters = { FOCUS_FILTER_RESEARCH }
	}
	
	focus = {
		id = SFR_tea_time_for_south_africa
		icon = GFX_thebritisharecontent
		x = -3
		y = 6
		relative_position_id = SFR_the_new_south_africa_act
		cost = 5

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_teachers_from_the_empire
		}
		available = {
			has_government = paternal_autocrat
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_teachers_from_the_empire"
			remove_ideas = SFR_idea_bittereinder_resistance
			add_popularity = { ideology = paternal_autocrat popularity = 0.2 }
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}
	
	focus = {
		id = SFR_empower_paramount_chiefs
		icon = GFX_theparamountchiefs
		x = 0	
		y = 1
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		
		bypass = {
			hidden_trigger = {
				SAF = {
					has_completed_focus = SAF_empower_paramount_chiefs
				}
			}
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_the_new_south_africa_act
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_empower_paramount_chiefs"
			modify_country_flag = { flag = SFR_segregation_reform value = 1 }
			add_political_power = 50
			add_stability = 0.1
			SFR_reform_segregation_1 = yes
		}
		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_MANPOWER }
	}
	
	focus = {
		id = SFR_develop_basutoland_swaziland
		icon = GFX_purchasingland
		x = -1	
		y = 2
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		bypass = {
			hidden_trigger = {
				SAF = {
					has_completed_focus = SAF_develop_basutoland_swaziland
				}
			}
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_empower_paramount_chiefs
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_develop_basutoland_swaziland"
			random_owned_state = {
				limit = {
					free_building_slots = {
						building = industrial_complex
						size > 0
						include_locked = yes
					}
				}
				prioritize = {
					85
				}
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
				add_extra_state_shared_building_slots = 1
			}
		}
		search_filters = { FOCUS_FILTER_INDUSTRY }
	}
	
	focus = {
		id = SFR_develop_bechuanaland
		icon = GFX_goal_generic_loans
		x = 1	
		y = 2
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_full_control_of_state = 542
		}
		bypass = {
			OR = {
				NOT = {
					has_full_control_of_state = 542
				}
				hidden_trigger = {
					SAF = {
						has_completed_focus = SAF_develop_bechuanaland
					}
				}
			}
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_empower_paramount_chiefs
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_develop_bechuanaland"
			if = {
				limit = {
					542 = {
						free_building_slots = {
							building = industrial_complex
							size > 0
							include_locked = yes
						}
					}
				}
				542 = {
					add_building_construction = {
						type = industrial_complex
						level = 1
						instant_build = yes
					}
					add_extra_state_shared_building_slots = 1
				}
			}
		}
		search_filters = { FOCUS_FILTER_INDUSTRY }
	}
	
	focus = {
		id = SFR_root_out_slavery
		icon = GFX_hintatmorenativerights
		x = 0	
		y = 3
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		bypass = {
			hidden_trigger = {
				SAF = {
					has_completed_focus = SAF_root_out_slavery
				}
			}
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_develop_bechuanaland
		}
		prerequisite = {
			focus = SFR_develop_basutoland_swaziland
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_root_out_slavery"
			add_political_power = 100
			remove_ideas = SAF_idea_slavery
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}
	
	focus = {
		id = SFR_question_of_native_autonomy
		icon = GFX_extendingnativeautonomy
		x = 0	
		y = 4
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_root_out_slavery
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_question_of_native_autonomy"
			country_event = { id = saf.11 }
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}
	
	focus = {
		id = SFR_strengthen_advisory_councils
		icon = GFX_SAF_race_council
		x = -1	
		y = 5
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_question_of_native_autonomy
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SAF_strengthen_advisory_councils"
			add_political_power = 100
			add_ideas = SAF_idea_native_advisory_councils
		}
		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY FOCUS_FILTER_RESISTANCE }
	}
	
	focus = {
		id = SFR_chief_justice_of_the_high_commissioner_territories
		icon = GFX_goal_DOM_The_Trial
		x = 1	
		y = 5
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_question_of_native_autonomy
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_chief_justice_of_the_high_commissioner_territories"
			country_event = { id = saf.26 }
		}
	}
	
	focus = {
		id = SFR_reform_the_commissioner_system
		icon = GFX_decouplethelegislature
		x = 0	
		y = 6
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			country_exists = ENT
			is_in_faction_with = ENT
			ENT = { is_faction_leader = yes }
		}
		prerequisite = {
			focus = SFR_chief_justice_of_the_high_commissioner_territories
		}
		prerequisite = {
			focus = SFR_strengthen_advisory_councils
		}
		ai_will_do = {
			factor = 100
		}
		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_reform_the_commissioner_system"
			ENT = {
				country_event = { id = saf.27 }
			}
			if = {
				limit = {
					owns_state = 85
				}
				add_state_core = 85
			}
			if = {
				limit = {
					owns_state = 738
				}
				add_state_core = 738
			}
			if = {
				limit = {
					owns_state = 542
				}
				add_state_core = 542
			}
		}
		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_ANNEXATION }
	}
	
	focus = {
		id = SFR_reconciliation_take_two
		icon = GFX_SAF_afrikaanreconciliation
		x = 2
		y = 1
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_the_new_south_africa_act
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_reconciliation_take_two"
			add_ideas = SFR_idea_reconciliation
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}
	
	focus = {
		id = SFR_federal_elections
		icon = GFX_the1938southafricanelections
		x = 3
		y = 2
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_reconciliation_take_two
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_federal_elections"
			country_event = { id = natal.27 }
		}
		search_filters = { FOCUS_FILTER_POLITICAL }
	}
	
	focus = {
		id = SFR_amnesty_arrangement
		icon = GFX_goal_DOM_The_Trial
		x = 2
		y = 3
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_federal_elections
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_amnesty_arrangement"
			remove_ideas = SFR_idea_bittereinder_resistance
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}
	
	focus = {
		id = SFR_symmetric_veteran_stipend
		icon = GFX_goal_KSV_pay_men
		x = 2
		y = 4
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_amnesty_arrangement
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_symmetric_veteran_stipend"
			if = {
				limit = {
					has_idea = SFR_idea_reconciliation_1
				}
				swap_ideas = { add_idea = SFR_idea_reconciliation_3 remove_idea = SFR_idea_reconciliation_1 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_reconciliation_2 remove_idea = SFR_idea_reconciliation }
			}
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}
	
	focus = {
		id = SFR_establish_reconciliation_commission
		icon = GFX_SAF_angloboer_harmony
		x = 4
		y = 3
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_federal_elections
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_establish_reconciliation_commission"
			if = {
				limit = {
					has_idea = SFR_idea_reconciliation_2
				}
				swap_ideas = { add_idea = SFR_idea_reconciliation_3 remove_idea = SFR_idea_reconciliation_2 }
			}
			else = {
				swap_ideas = { add_idea = SFR_idea_reconciliation_1 remove_idea = SFR_idea_reconciliation }
			}
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}
	
	focus = {
		id = SFR_curb_german_influence
		icon = GFX_goal_ZAM_expel_germans
		x = 4
		y = 4
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_establish_reconciliation_commission
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_curb_german_influence"
			add_political_power = 100
			add_stability = 0.1 
			add_opinion_modifier = { target = GER modifier = SFR_rebuffed_influence_operation }
		}
		search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_STABILITY }
	}
	
	focus = {
		id = SFR_rebuilding_from_the_war
		icon = GFX_goal_generic_destruction_civil_war
		x = 3
		y = 5
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_symmetric_veteran_stipend
		}
		prerequisite = {
			focus = SFR_curb_german_influence
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_rebuilding_from_the_war"
			swap_ideas = { add_idea = SFR_idea_reconciliation_4 remove_idea = SFR_idea_reconciliation_3 }
		}
	}
	
	focus = {
		id = SFR_peace_and_prosperity
		icon = GFX_SAF_shining_democracy
		x = 3
		y = 6
		cost = 5
		relative_position_id = SFR_the_new_south_africa_act
		available = {
			has_democratic_government = yes
		}

		ai_will_do = {
			factor = 100
		}
		prerequisite = {
			focus = SFR_rebuilding_from_the_war
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus SFR_peace_and_prosperity"
			swap_ideas = { add_idea = SFR_idea_reconciliation_5 remove_idea = SFR_idea_reconciliation_4 }
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}
	
	shared_focus = SAF_found_sabc
	shared_focus = SAF_New_Rifles
	shared_focus = SAF_Expand_Branches
}

