###########################
# Namibian Focus Tree
###########################
# By Beelzebub
#edited by IratePirate
###########################


focus_tree = {
	id = NMB_focus
	continuous_focus_position = { x = 0 y = 950 } 
	country = {
		factor = 0
		modifier = {
			add = 20
			tag = NBL
		}
	}

	default = no

###########################
#Political Focuses
###########################

	#Syndicalist focuses
	focus = {
		id = NMB_syndicalist_liberation
		icon = GFX_BBR_syndie_media

		x = 0
		y = 0
		cost = 7

		available = {
			has_socialist_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_syndicalist_liberation"
			custom_effect_tooltip = unlock_focuses
		}
	}

	focus = {
		id = NMB_first_congress
		icon = GFX_goal_CSA_empower_congress

		x = -2
		y = 1
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		prerequisite = {
			focus = NMB_syndicalist_liberation
		}

		available = {
			has_socialist_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_first_congress"
			country_event = {
				id = nmb.30
				days = 1
			}
		}
	}

	focus = {
		id = NMB_cultural_assimilation
		icon = GFX_goal_NYC_Colorblind_Proletariat

		x = 0
		y = 1
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		available = {
			has_socialist_government = yes
		}

		prerequisite = {
			focus = NMB_syndicalist_liberation
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_cultural_assimilation"
			add_manpower = 5000
		}

	}

	focus = {
		id = NMB_dealing_german
		icon = GFX_goal_ZAM_expel_germans

		x = 0
		y = 2
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		available = {
			has_socialist_government = yes
		}

		prerequisite = {
			focus = NMB_cultural_assimilation
		}

		bypass = {
			has_country_flag = NMB_germans_removed_flag
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_dealing_german"
			country_event = {
				id = nmb.31
				days = 1
			}
		}
	}

	focus = {
		id = NMB_end_cultural_divides
		icon = GFX_goal_generic_culture2

		x = 0
		y = 3
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		available = {
			has_socialist_government = yes
		}

		prerequisite = {
			focus = NMB_dealing_german
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_end_cultural_divides"
			add_stability = 0.10
		}
		
	}

	focus = {
		id = NMB_industry_people
		icon = GFX_goal_KIV_uplift_workers

		x = 0
		y = 5
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		prerequisite = {
			focus = NMB_end_cultural_divides
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_industry_people"
			random_owned_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			}
			random_owned_state = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}
		}
		
	}

	#Industry Focuses
	focus = {
		id = NMB_calm_ovambo
		icon = GFX_goal_MEX_Improve_Native_Rights

		x = 2
		y = 2
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		prerequisite = {
			focus = NMB_first_congress
			focus = NMB_first_election
			focus = NMB_strengthen_state
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_calm_ovambo"
			add_timed_idea = { idea = NMB_ovambo_calming_process days = 124 }
		}
	}

	focus = {
		id = NMB_windhoek_odajena
		icon = GFX_NEE_infrastructure_integration

		x = 2
		y = 3
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		prerequisite = {
			focus = NMB_calm_ovambo
		}

		available = {
			NOT = {
				has_idea = NMB_ovambo_calming_process
			}
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_windhoek_odajena"
			541 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
			964 = {
				add_building_construction = {
					type = infrastructure
					level = 1
					instant_build = yes
				}
			}
		}
		
	}

	focus = {
		id = NMB_expand_swakopmund
		icon = GFX_goal_generic_airports

		x = 2
		y = 4
		relative_position_id = NMB_syndicalist_liberation
		cost = 7

		prerequisite = {
			focus = NMB_windhoek_odajena
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_expand_swakopmund"
			541 = {
				add_building_construction = {
					type = air_base
					level = 2
					instant_build = yes
				}
			}
		}

	}

	#Democratic focuses
	focus = {
		id = NMB_democratic_mandate
		icon = GFX_goal_CZE_defend_freedom

		x = 4
		y = 0
		cost = 7

		available = {
			has_elected_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_democratic_mandate"
			custom_effect_tooltip = unlock_focuses
		}
	}

	focus = {
		id = NMB_first_election
		icon = GFX_goal_generic_elections

		x = 0
		y = 1
		relative_position_id = NMB_democratic_mandate
		cost = 4

		prerequisite = {
			focus = NMB_democratic_mandate
		}
		select_effect = {
			country_event = {
				id = nmb.39
				days = 1
			}
			country_event = {
				id = nmb.40
				days = 1
			}
		}
		available = {
			OR = {
				NOT = {
					country_exists = NMB
				}
				NMB = {
					has_capitulated = yes
				}
			}
			has_elected_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_first_election"
			if = {
				limit = {
					  country_exists = NMB
					 }
				annex_country = {
					target = NMB
				}
			}
			country_event = {
				id = nmb.36
				days = 1
			}
			retire_country_leader = yes
			create_country_leader = {
				name = "Samuel Maharero"
				desc = "POLITICS_SAMUEL_MAHARERO_DESC"
				picture = "gfx/leaders/NAM/Portrait_NMB_Samuel_Maharero.png"
				expire = "1.1.1"
				ideology = christian_democracy_subtype
	
			}			
		}
	}

	focus = {
		id = NMB_freedom_speech
		icon = GFX_RUS_Government_Of_Peoples_Trust

		x = 0
		y = 2
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_first_election
		}

		available = {
			has_elected_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_freedom_speech"
			add_ideas = NMB_democratic_1
		}
	
	}

	focus = {
		id = NMB_promote_immigration
		icon = GFX_NEE_immigrant_aid

		x = 0
		y = 3
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_freedom_speech
		}

		available = {
			has_elected_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_promote_immigration"
			add_ideas = NMB_democratic_2
		}
	
	}

	focus = {
		id = NMB_end_north_south
		icon = GFX_goal_CZE_unite_the_right

		x = 0
		y = 4
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_promote_immigration
		}

		available = {
			has_elected_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_end_north_south"
			add_stability = 0.10
		}
		search_filters = { FOCUS_FILTER_STABILITY }
	}

	focus = {
		id = NMB_namibian_miracle
		icon = GFX_RUS_Lessons_Of_Democracy
		relative_position_id = NMB_democratic_mandate
		x = 0
		y = 5

		cost = 7

		available = {
			has_elected_government = yes
		}

		prerequisite = {
			focus = NMB_end_north_south
		}

		prerequisite = {
			focus = NMB_expand_swakopmund
		}

		prerequisite = {
			focus = NMB_prepare_conflict
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_nmbibian_miracle"
			541 = {
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
		}
		search_filters = { FOCUS_FILTER_INDUSTRY }
	}

	#Army focuses
	focus = {
		id = NMB_namibian_defense_corp
		icon = GFX_goal_mass_concentration_of_army

		x = 2
		y = 2
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_first_congress
			focus = NMB_first_election
			focus = NMB_strengthen_state
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_nmbibian_defense_corp"
			add_ideas = NMB_generic_army_1
			custom_effect_tooltip = NMB_deploy_defense_corps
			hidden_effect = {
				load_oob = NMB_defense
			}
		}
		
	}

	focus = {
		id = NMB_request_masters
		icon = GFX_goal_NFA_army_money

		x = 2
		y = 3
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_namibian_defense_corp
		}

		bypass = {
			is_subject = no
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_request_masters"
			add_equipment_to_stockpile = {
				type = infantry_equipment_1
				amount = 2000
				producer = GER
				}
			}
		}

	focus = {
		id = NMB_prepare_conflict
		icon = GFX_goal_NIC_Army_True_Guerillas

		x = 2
		y = 4
		relative_position_id = NMB_democratic_mandate
		cost = 7

		prerequisite = {
			focus = NMB_request_masters
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_prepare_conflict"
			swap_ideas = { remove_idea = NMB_generic_army_1 add_idea = NMB_generic_army_2 }
		}
	}

	#Rightist focuses
	focus = {
		id = NMB_stern_state
		icon = GFX_goal_NFA_military_supremacy

		x = 8
		y = 0
		cost = 7

		available = {
			has_authoritarian_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_stern_state"
			custom_effect_tooltip = unlock_focuses
		}
	}

	focus = {
		id = NMB_strengthen_state
		icon = GFX_goal_MEX_All_power_to_the_Executive

		x = 0
		y = 1
		relative_position_id = NMB_stern_state
		cost = 7

		prerequisite = {
			focus = NMB_stern_state
		}

		available = {
			has_dictatorship_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_strengthen_state"
			if = {
				limit = {	541 = { is_controlled_by = ROOT }	}
				541 = {
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = arms_factory
						level = 1
						instant_build = yes
					}
				}
			}
		}
	
	}

	focus = {
		id = NMB_silence_opposition
		icon = GFX_goal_National_Security_Act

		x = 0
		y = 2
		relative_position_id = NMB_stern_state
		cost = 7

		prerequisite = {
			focus = NMB_strengthen_state
		}

		available = {
			has_dictatorship_government = yes
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_silence_opposition"
			if = {
				limit = {
					has_government = national_populist
				}
				add_popularity = {
					ideology = national_populist
					popularity = 0.2
				}
			}
			if = {
				limit = {
					has_government = paternal_autocrat
				}
				add_popularity = {
					ideology = paternal_autocrat
					popularity = 0.2
				}
			}
			if = {
				limit = {
					has_government = authoritarian_democrat
				}
				add_popularity = {
					ideology = authoritarian_democrat
					popularity = 0.2
				}
			}
		}
	}

	focus = {
		id = NMB_remove_germans
		icon = GFX_goal_WHR_Assert_Independence_Germany

		x = 0
		y = 3
		relative_position_id = NMB_stern_state
		cost = 7

		prerequisite = {
			focus = NMB_silence_opposition
		}

		available = {
			OR = {
				has_government = national_populist
				has_government = paternal_autocrat
			}
		}

		bypass = {
			OR = {
				has_government = authoritarian_democrat
				has_country_flag = NMB_germans_removed_flag
			}
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_remove_germans"
			country_event = {
				id = nmb.31
				days = 1
			}
		}
	}

	focus = {
		id = NMB_close_country
		icon = GFX_goal_CSA_closed_shops

		x = 0
		y = 4
		relative_position_id = NMB_stern_state
		cost = 7

		available = {
			has_dictatorship_government = yes
		}

		prerequisite = {
			focus = NMB_remove_germans
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_close_country"
			add_ideas = closed_economy
		}
	}

	focus = {
		id = NMB_windhoek_fortress
		icon = GFX_goal_NEE_Cannon_City

		x = 0
		y = 5
		relative_position_id = NMB_stern_state

		cost = 7

		available = {
			has_dictatorship_government = yes
		}

		prerequisite = {
			focus = NMB_close_country
		}

		prerequisite = {
			focus = NMB_prepare_conflict
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_windhoek_fortress"
			541 = {
				add_building_construction = {
					type = bunker
					level = 4
					instant_build = yes
				}
			}
		}
		
	}

	focus = {
		id = NMB_united_namibia
		icon = GFX_RUS_Revive_National_Identity

		x = -4
		y = 6
		relative_position_id = NMB_stern_state

		cost = 7
		available = {
			NOT = {
				country_exists = NMB
			}
		}
		prerequisite = {
			focus = NMB_windhoek_fortress focus = NMB_namibian_miracle focus = NMB_industry_people
		}

		completion_reward = {
			log = "[GetDateText]: [Root.GetName]: Focus NMB_united_nmbibia"
			if = {
				limit = {
					964 = {
						NOT = {
							is_core_of = NMB
						}
					}
				}
				add_state_core = 964
			}
			964 = {
				add_building_construction = {
					type = bunker
					level = 1
					instant_build = yes
				}
			}
			hidden_effect = {
			if = {
				limit = {
					has_elected_government = yes
					}
				load_focus_tree = African_Generic_Democracy
			}
			if = {
				limit = {
					has_socialist_government = yes
					}
				load_focus_tree = African_Generic_Democracy
			}
			if = {
				limit = {
					has_authoritarian_government = yes
					}
				load_focus_tree = african_republic_authoritarian
			}
		}
		custom_effect_tooltip = namib_load_tree
	}
}





