###########################
# Germany in Exile Eastern Focus Tree
# By Me, myself, and Idlemancer
###########################

shared_focus = {
	id = GEX_war_in_the_east
	icon = GFX_goal_japan_helmet
	x = 0
	y = 0
	
	offset = {
		x = 4
		y = 8
		trigger = {
			tag = MAF
			has_focus_tree = mittleafrikan_focus
		}
	}
	
	offset = {
		x = 46
		y = 0
		trigger = {
			tag = MAF
			has_focus_tree = MAF-RFG
		}
	}
	
	offset = {
		x = 49
		y = 4
		trigger = {
			tag = GEA
		}
	}
	
	offset = {
		x = 54
		y = 0
		trigger = {
			tag = LEP
		}
	}
	
	offset = {
		x = 15
		y = 7
		trigger = {
			tag = TUR
		}
	}
	
	offset = {
		x = 63
		y = 9
		trigger = {
			tag = TXS
		}
	}
	
	offset = {
		x = 20
		y = 34
		trigger = {
			tag = CEA
		}
	}
	
	allow_branch = {
		NOT = {
			country_exists = GER
		}
	}
	
	cost = 8
	available = {
		custom_trigger_tooltip = {
			tooltip = GEX_fled_to_us_tooltip
			GEX_fled_to_us = yes
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		if = {
			limit = {
				LEP = { exists = no }
				GEA = { exists = no }
			}
			country_event = { id = GEX_foreign_east.1 }
		}
		add_political_power = 100
		add_war_support = 0.05
	}
}

shared_focus = {
	id = GEX_japan_wins_waaah
	icon = GFX_goal_align_japan
	x = -2
	y = 1
	
	cost = 8
	prerequisite = { focus = GEX_war_in_the_east }
	mutually_exclusive = {
		focus = GEX_kill_japan
	}
	relative_position_id = GEX_war_in_the_east
	available = {
		NOT = { has_global_flag = GEX_boo_hoo_no_asia }
	}
	allow_branch = {
		NOT = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
		NOT = {
			country_exists = GER
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		JAP = { country_event = { id = GEX_foreign_east.2 days = 1 } }
		custom_effect_tooltip = GEX_treaty_tooltip
	}
}

shared_focus = {
	id = GEX_cut_our_losses
	icon = GFX_goal_JAP_target_gea
	x = 0
	y = 1
	
	cost = 4
	prerequisite = { focus = GEX_japan_wins_waaah }
	relative_position_id = GEX_japan_wins_waaah
	available = {
		has_global_flag = GEX_Japan_concession_treaty
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		if = {
			limit = {
				NOT = { GEA = { has_country_flag = GEX_rejected_exiles } }
			}
			GEA = {
				swap_ideas = {
					remove_idea = GEX_treaty_territory
					add_idea = GEX_treaty_territory_2
				}
			}
		}
		else = {
			add_offsite_building = { type = industrial_complex level = 1 }
		}
		if = {
			limit = {
				NOT = { LEP = { has_country_flag = GEX_rejected_exiles } }
			}
			LEP = {
				swap_ideas = {
					remove_idea = GEX_treaty_territory
					add_idea = GEX_treaty_territory_2
				}
			}
		}
		else = {
			add_offsite_building = { type = industrial_complex level = 1 }
		}
		add_political_power = 50
	}
}

shared_focus = {
	id = GEX_lets_get_outta_ere
	icon = GFX_goal_generic_join_faction
	x = -1
	y = 1
	
	cost = 4
	prerequisite = { focus = GEX_cut_our_losses }
	relative_position_id = GEX_cut_our_losses
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		add_manpower = 250000
		army_experience = 25
	}
}

shared_focus = {
	id = GEX_you_forgot_the_guns_imbecile
	icon = GFX_focus_generic_military_equipment
	x = 0
	y = 1
	
	cost = 4
	prerequisite = { focus = GEX_lets_get_outta_ere }
	relative_position_id = GEX_lets_get_outta_ere
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		random_owned_controlled_state = {
			limit = {
				ROOT = { has_full_control_of_state = PREV }
				is_core_of = ROOT
				free_building_slots = {
					building = arms_factory
					size > 0
					include_locked = yes
				}
			}
			add_extra_state_shared_building_slots = 1
			add_building_construction = {
				type = arms_factory
				level = 1
				instant_build = yes
			}
		}
		if = {
			limit = {
				NOT = {
					GEA = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					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
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						free_building_slots = {
							building = arms_factory
							size > 0
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = arms_factory
						level = 1
						instant_build = yes
					}
				}
			}
		}
		if = {
			limit = {
				GEA = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						arms_factory > 1
					}
				}
			}
				GEA = {
				random_owned_state = {
					limit = {
						arms_factory > 1
					}
					remove_building = {
						type = arms_factory
						level = 2
					}
				}
			}
			else = {
				GEA = {
					add_timed_idea = {
						idea = GEX_fhak_your_mils
						days = 200
					}
				}
			}
		}
		if = {
			limit = {
				NOT = {
					LEP = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					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
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						free_building_slots = {
							building = arms_factory
							size > 0
							include_locked = yes
						}
					}
					add_extra_state_shared_building_slots = 1
					add_building_construction = {
						type = arms_factory
						level = 1
						instant_build = yes
					}
				}
			}
		}
		if = {
			limit = {
				LEP = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						arms_factory > 1
					}
				}
			}
			LEP = {
				random_owned_state = {
					limit = {
						arms_factory > 1
					}
					remove_building = {
						type = arms_factory
						level = 2
					}
				}
			}
			else = {
				LEP = {
					add_timed_idea = {
						idea = GEX_fhak_your_mils
						days = 200
					}
				}
			}
		}
	}
}

shared_focus = {
	id = GEX_grab_da_monies
	icon = GFX_MAF_east_asian_exports
	x = 1
	y = 1
	
	cost = 4
	prerequisite = { focus = GEX_cut_our_losses }
	relative_position_id = GEX_cut_our_losses
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}

	completion_reward = {
		random_owned_controlled_state = {
			limit = {
				ROOT = { has_full_control_of_state = PREV }
				is_core_of = ROOT
				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
			}
		}
		if = {
			limit = {
				NOT = {
					GEA = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						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
					}
				}
			}
		}
		if = {
			limit = {
				GEA = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						industrial_complex > 1
					}
				}
			}
				GEA = {
				random_owned_state = {
					limit = {
						industrial_complex > 1
					}
					remove_building = {
						type = industrial_complex
						level = 2
					}
				}
			}
			else = {
				GEA = {
					add_timed_idea = {
						idea = GEX_fhak_your_civs
						days = 200
					}
				}
			}
		}
		if = {
			limit = {
				NOT = {
					LEP = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 1
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						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
					}
				}
			}
		}
		if = {
			limit = {
				LEP = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						industrial_complex > 1
					}
				}
			}
			LEP = {
				random_owned_state = {
					limit = {
						industrial_complex > 1
					}
					remove_building = {
						type = industrial_complex
						level = 2
					}
				}
			}
			else = {
				LEP = {
					add_timed_idea = {
						idea = GEX_fhak_your_civs
						days = 200
					}
				}
			}
		}
	}
}

shared_focus = {
	id = GEX_grab_da_boats
	icon = GFX_goal_MAG_Navy_with_a_colony
	x = 0
	y = 1
	
	cost = 4
	prerequisite = { focus = GEX_grab_da_monies }
	relative_position_id = GEX_grab_da_monies
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		random_owned_controlled_state = {
			limit = {
				ROOT = { has_full_control_of_state = PREV }
				is_core_of = ROOT
				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
			}
		}
		if = {
			limit = {
				NOT = {
					GEA = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					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
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						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
					}
				}
			}
		}
		if = {
			limit = {
				GEA = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						dockyard > 1
					}
				}
			}
				GEA = {
				random_owned_state = {
					limit = {
						dockyard > 1
					}
					remove_building = {
						type = dockyard
						level = 2
					}
				}
			}
			else = {
				GEA = {
					add_timed_idea = {
						idea = GEX_fhak_your_dockyards
						days = 200
					}
				}
			}
		}
		if = {
			limit = {
				NOT = {
					LEP = { has_country_flag = GEX_rejected_exiles }
				}
			}
			random_owned_controlled_state = {
				limit = {
					ROOT = { has_full_control_of_state = PREV }
					is_core_of = ROOT
					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
				}
			}
			else = {
				random_owned_controlled_state = {
					limit = {
						ROOT = { has_full_control_of_state = PREV }
						is_core_of = ROOT
						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
					}
				}
			}
		}
		if = {
			limit = {
				LEP = {
					NOT = { has_country_flag = GEX_rejected_exiles }
					any_owned_state = {
						dockyard > 1
					}
				}
			}
			LEP = {
				random_owned_state = {
					limit = {
						dockyard > 1
					}
					remove_building = {
						type = dockyard
						level = 2
					}
				}
			}
			else = {
				LEP = {
					add_timed_idea = {
						idea = GEX_fhak_your_dockyards
						days = 200
					}
				}
			}
		}
	}
}

shared_focus = {
	id = GEX_finalize_eastern_surrender
	icon = GFX_goal_generic_forceful_treaty
	x = 0
	y = 3
	
	cost = 4
	prerequisite = { focus = GEX_grab_da_boats }
	prerequisite = { focus = GEX_you_forgot_the_guns_imbecile }
	relative_position_id = GEX_cut_our_losses
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		if = {
			limit = {
				GEA = { has_country_flag = GEX_rejected_exiles }
				NOT = {
					LEP = { has_country_flag = GEX_rejected_exiles }
				}
			}
			custom_effect_tooltip = GEX_treaty_aog_tooltip
			add_political_power = 50
			custom_effect_tooltip = GEX_steal_equipment_tooltip
			GEA = {
				add_ideas = GEX_abandoned_by_germany
			}
		}
		if = {
			limit = {
				LEP = { has_country_flag = GEX_rejected_exiles }
				NOT = {
					GEA = { has_country_flag = GEX_rejected_exiles }
				}
			}
			custom_effect_tooltip = GEX_treaty_gea_tooltip
			add_political_power = 50
			custom_effect_tooltip = GEX_steal_equipment_tooltip
			LEP = {
				add_ideas = GEX_abandoned_by_germany
			}
		}
		if = {
			limit = {
				GEA = { has_country_flag = GEX_rejected_exiles }
				LEP = { has_country_flag = GEX_rejected_exiles }
			}
			add_political_power = 100
			custom_effect_tooltip = GEX_steal_equipment_tooltip
			GEA = {
				add_ideas = GEX_abandoned_by_germany
			}
			LEP = {
				add_ideas = GEX_abandoned_by_germany
			}
		}
		if = {
			limit = {
				NOT = {
					GEA = { has_country_flag = GEX_rejected_exiles }
					LEP = { has_country_flag = GEX_rejected_exiles }
				}
			}
			custom_effect_tooltip = GEX_treaty_both_tooltip
		}
		hidden_effect = {
			if = {
				limit = {
					NOT = {
						GEA = { has_country_flag = GEX_rejected_exiles }
					}
				}
				every_state = {
					limit = {
						is_owned_by = GEA
					}
					set_state_flag = GEX_japan_treaty_concession_state
				}
				GEA = {
					every_unit_leader = {
						set_unit_leader_flag = GEX_exile_leader
						set_nationality = GEX
					}
					every_navy_leader = {
						set_unit_leader_flag = GEX_exile_leader
						set_nationality = GEX
					}
				}
				annex_country = {
					target = GEA
					transfer_troops = yes
				}
			}
			else = {
				GEA = { GEX_cutting_losses_gea_aog_0_2 = yes }
			}
			if = {
				limit = {
					NOT = {
						LEP = { has_country_flag = GEX_rejected_exiles }
					}
				}
				every_state = {
					limit = {
						is_owned_by = LEP
					}
					set_state_flag = GEX_japan_treaty_concession_state
				}
				LEP = {
					every_unit_leader = {
						set_unit_leader_flag = GEX_exile_leader
						set_nationality = GEX
					}
					every_navy_leader = {
						set_unit_leader_flag = GEX_exile_leader
						set_nationality = GEX
					}
				}
				annex_country = {
					target = LEP
					transfer_troops = yes
				}
			}
			else = {
				LEP = { GEX_cutting_losses_gea_aog_0_2 = yes }
			}
			every_state = {
				limit = {
					has_state_flag = GEX_japan_treaty_concession_state
				}
				JAP = {
					transfer_state = PREV
				}
			}
			JAP = {
				give_military_access = GEX
			}
		}
	}
}

shared_focus = {
	id = GEX_kill_japan
	icon = GFX_goal_USA_dismantle_empire
	x = 2
	y = 1
	
	offset = {
		x = -2
		y = 0
		trigger = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
	}
	
	cost = 8
	prerequisite = { focus = GEX_war_in_the_east }
	mutually_exclusive = {
		focus = GEX_japan_wins_waaah
	}
	relative_position_id = GEX_war_in_the_east
	available = {
		NOT = { has_global_flag = GEX_boo_hoo_no_asia }
	}
	ai_will_do = {
		factor = 1000
		modifier = {
			factor = 0
			ROOT_is_threatened = yes
		}
		modifier = {
			factor = 0
			JAP = { is_stronger_than_ROOT_and_not_vulnerable_consider_naval_strength = yes }
		}
	}
	
	completion_reward = {
		every_country = {
			limit = { 
				is_in_faction_with = GEX
			}
			add_ideas = GEX_kill_japan_idea
		}
	}
}

shared_focus = {
	id = GEX_asia_gang
	icon = GFX_goal_generic_anti_japan
	x = 0
	y = 1
	
	cost = 8
	prerequisite = { focus = GEX_kill_japan }
	relative_position_id = GEX_kill_japan
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		add_political_power = 50
		custom_effect_tooltip = GEX_asia_gang_tooltip
	}
}

shared_focus = {
	id = GEX_arm_the_east
	icon = GFX_goal_mittel_arms_trade
	x = -1
	y = 1
	
	offset = {
		x = -1
		y = 0
		trigger = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
	}
	
	cost = 8
	prerequisite = { focus = GEX_asia_gang }
	relative_position_id = GEX_asia_gang
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		if = {
			limit = {
				LEP = {
					exists = no
				}
				GEA = {
					exists = no
				}
			}
			add_offsite_building = { type = arms_factory level = 4 }
		}
		else = {
			add_offsite_building = { type = arms_factory level = 1 }
			custom_effect_tooltip = GEX_arm_the_east_guns_tooltip
			hidden_effect = {
				GEA = {
					add_equipment_to_stockpile = {
						type = infantry_equipment
						amount = 5000
						producer = GER
					}
				}
				LEP = {
					add_equipment_to_stockpile = {
						type = infantry_equipment
						amount = 5000
						producer = GER
					}
				}
			}
		}
	}
}

shared_focus = {
	id = GEX_an_avenue_of_attack
	icon = GFX_GER_restructure_the_oberste_heeresleitung-32626
	x = 0
	y = 1
	
	offset = {
		x = -1
		y = 0
		trigger = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
	}
	
	cost = 8
	prerequisite = { focus = GEX_arm_the_east }
	relative_position_id = GEX_arm_the_east
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		country_event = { id = GEX_foreign_east.12 }
		
		effect_tooltip = {
			add_equipment_to_stockpile = {
				type = transport_plane_equipment
				amount = 100
			}
			add_tech_bonus = {
				name = GEX_an_avenue_of_attack
				bonus = 1
				uses = 1
				category = para_tech
			}
			custom_effect_tooltip = GEX_effect_or2
			add_equipment_to_stockpile = {
				type = convoy
				amount = 100
			}
			add_tech_bonus = {
				name = GEX_an_avenue_of_attack
				bonus = 1
				uses = 1
				category = marine_tech
				category = tp_tech
			}
		}
	}
}

shared_focus = {
	id = GEX_guard_the_coasts
	icon = GFX_goal_generic_fortify_city
	x = 1
	y = 1
	
	offset = {
		x = 1
		y = 0
		trigger = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
	}
	
	cost = 8
	prerequisite = { focus = GEX_asia_gang }
	relative_position_id = GEX_asia_gang
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	bypass = {
		LEP = {
			exists = no
		}
		GEA = {
			exists = no
		}
	}
	
	completion_reward = {
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 336
				}
			}
			336 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 3
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 846
				}
			}
			846 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 1
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 857
				}
			}
			857 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 1
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 856
				}
			}
			856 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 2
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 286
				}
			}
			286 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 2
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 671
				}
			}
			671 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 1
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 744
				}
			}
			744 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 5
					instant_build = yes
				}
			}
		}
		if = {
			limit = {
				any_country = {
					OR = {
						tag = GEX
						is_in_faction_with = GEX
					}
					has_full_control_of_state = 594
				}
			}
			594 = {
				#Fortify naval bases
				add_building_construction = {
					type = coastal_bunker
					province = {
						all_provinces = yes
						limit_to_naval_base = yes
					}
					level = 5
					instant_build = yes
				}
			}
		}
	}
}

shared_focus = {
	id = GEX_contest_the_waters
	icon = GFX_MAG_pride_of_navy
	x = 0
	y = 1
	
	offset = {
		x = 1
		y = 0
		trigger = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
	}
	
	cost = 8
	prerequisite = { focus = GEX_guard_the_coasts }
	relative_position_id = GEX_guard_the_coasts
	available = {
		
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		random_owned_controlled_state = {
			limit = {
				ROOT = { has_full_control_of_state = PREV }
				is_core_of = ROOT
				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
			}
		}
		every_country = {
			limit = {
				is_in_faction_with = GEX
			}
			swap_ideas = {
				remove_idea = GEX_kill_japan_idea
				add_idea = GEX_kill_japan_idea_2
			}
		}
	}
}

shared_focus = {
	id = GEX_lessons_of_the_pacific_war
	icon = GFX_goal_generic_intelligence_exchange
	x = 0
	y = 3
	
	cost = 8
	prerequisite = { focus = GEX_contest_the_waters }
	prerequisite = { focus = GEX_an_avenue_of_attack }
	relative_position_id = GEX_asia_gang
	available = {
		OR = {
			NOT = {
				country_exists = JAP
			}
			has_global_flag = JAP_Fading_Sun
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	allow_branch = {
		NOT = {
			OR = {
				tag = GEA
				tag = LEP
			}
		}
		NOT = {
			country_exists = GER
		}
	}
	
	completion_reward = {
		country_event = GEX_foreign_east.13
	}
}

#Expanded tree focuses
shared_focus = {
	id = GEX_army_of_exile_east
	icon = GFX_goal_Deutsches_Heer
	x = 0
	y = 1
	
	cost = 8
	prerequisite = { focus = GEX_asia_gang }
	relative_position_id = GEX_asia_gang
	available = {
		
	}
	allow_branch = {
		OR = {
			tag = GEA
			tag = LEP
		}
		NOT = {
			country_exists = GER
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		add_equipment_to_stockpile = {
			type = infantry_equipment_1
			amount = 5000
			producer = GER
		}
		add_manpower = 50000
		army_experience = 100
	}
}

shared_focus = {
	id = GEX_german_elites
	icon = GFX_goal_German_Staff
	x = -1
	y = 1
	
	cost = 8
	prerequisite = { focus = GEX_army_of_exile_east }
	mutually_exclusive = {
		focus = GEX_kaisers_own_men
	}
	relative_position_id = GEX_army_of_exile_east
	available = {
		OR = {
			has_completed_focus = GEA_germantroops1
			has_completed_focus = GEA_localtroops3
			tag = LEP
		}
	}
	ai_will_do = { factor = 1000 }
	completion_reward = {
		effect_tooltip = {
			if = {
				limit = { tag = GEA }
				swap_ideas = {
					remove_idea = GEA_prussian_force
					add_idea = GEA_prussian_force_exilewaffen
				}
				custom_effect_tooltip = GEX_effect_or
				swap_ideas = {
					remove_idea = GEA_language
					add_idea = GEA_language_exilewaffen
				}
			}
			else = { add_ideas = GEX_exilewaffen_idea }
		}
		hidden_effect = {
			if = {
				limit = { has_completed_focus = GEA_germantroops1 }
				swap_ideas = {
					remove_idea = GEA_prussian_force
					add_idea = GEA_prussian_force_exilewaffen
				}
			}
			else_if = {
				limit = { has_completed_focus = GEA_localtroops3 }
				swap_ideas = {
					remove_idea = GEA_language
					add_idea = GEA_language_exilewaffen
				}
			}
			else = { add_ideas = GEX_exilewaffen_idea }
		}
		add_manpower = 50000
		add_war_support = 0.10
	}
}

shared_focus = {
	id = GEX_kaisers_own_men
	icon = GFX_germanprimacy
	x = 1
	y = 1
	
	cost = 8
	prerequisite = { focus = GEX_army_of_exile_east }
	mutually_exclusive = {
		focus = GEX_german_elites
	}
	relative_position_id = GEX_army_of_exile_east
	available = {
		OR = {
			has_completed_focus = GEA_germantroops1
			has_completed_focus = GEA_localtroops3
			tag = LEP
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		effect_tooltip = {
			if = {
				limit = {
					tag = GEA
				}
				swap_ideas = {
					remove_idea = GEA_prussian_force
					add_idea = GEA_prussian_force_kaisers_own
				}
				custom_effect_tooltip = GEX_effect_or
				swap_ideas = {
					remove_idea = GEA_language
					add_idea = GEA_language_kaisers_own
				}
			}
			else = { add_ideas = GEX_kaisers_own_idea }
		}
		hidden_effect = {
			if = {
				limit = {
					has_completed_focus = GEA_germantroops1
				}
				swap_ideas = {
					remove_idea = GEA_prussian_force
					add_idea = GEA_prussian_force_kaisers_own
				}
			}
			else_if = {
				limit = {
					has_completed_focus = GEA_localtroops3
				}
				swap_ideas = {
					remove_idea = GEA_language
					add_idea = GEA_language_kaisers_own
				}
			}
			else = { add_ideas = GEX_kaisers_own_idea }
		}
		army_experience = 50
		add_stability = 0.10
	}
}

shared_focus = {
	id = GEX_lessons_of_the_pacific_war_redux
	icon = GFX_lessonsfromkamina
	x = 0
	y = 3
	
	cost = 8
	prerequisite = { focus = GEX_german_elites focus = GEX_kaisers_own_men }
	prerequisite = { focus = GEX_an_avenue_of_attack }
	prerequisite = { focus = GEX_contest_the_waters }
	relative_position_id = GEX_asia_gang
	available = {
		OR = {
			NOT = {
				country_exists = JAP
			}
			has_global_flag = JAP_Fading_Sun
		}
	}
	ai_will_do = {
		factor = 1000
	}
	
	completion_reward = {
		country_event = GEX_foreign_east.13
	}
}