#category = short_term medium_term or long_term
# ROOT is faction leader, FROM is faction member who opens UI and views goals, completed/cancel/complete_effect do not have FROM scopes


######################################################################

###  ##   ##  ### ###  ##  #  #      ## ###  ###  ##  ### ### ###  ##  
#   #  # #  #  #   #  #  # ## #     #   #  # #   #  #  #  #    #  #  # 
##  #### #     #   #  #  # # ##      #  ###  ##  #     #  ##   #  #    
#   #  # #  #  #   #  #  # #  #       # #    #   #  #  #  #    #  #  # 
#   #  #  ##   #  ###  ##  #  #     ##  #    ###  ##  ### #   ###  ##  

######################################################################


 ##  #   # ###  ## 
#  #  # #   #  #   
####   #    #   #  
#  #  # #   #    # 
#  # #   # ### ##  


faction_goal_one_germany = {
	name = one_germany_goal_name
	description = one_germany_goal_desc
	category = short_term
	group = FOCUS_FILTER_ANNEXATION
	visible = {
	}
	cancel = { 
		FROM = {
			NOT = { has_government = criminal }
		}
	}
	completed = {
	}
	complete_effect = {
		add_faction_power_projection = 50
		custom_effect_tooltip = THE_FACTION_LEADER
		add_stability = 0.05
	}
	ai_will_do = {
		base = 10
	}
}


#  #  ##  ##  
#  # #   #  # 
#  #  #  #### 
#  #   # #  # 
 ##  ##  #  # 


faction_goal_building_up_guam = {
	name = building_up_guam_goal_name
	description = building_up_guam_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	cancel = { 
		FROM = { NOT = { controls_state = 638 } }
	}
	completed = {
		638 = { naval_base > 3 }
	}
	complete_effect = {
		add_faction_power_projection = 50 
		custom_effect_tooltip = THE_FACTION_LEADER
		add_war_support = 0.02
	}
	ai_will_do = {
		base = 10
	}
}


### #  # ###      ##  #   #   ### ###  ## 
 #  #  # #       #  # #   #    #  #   #   
 #  #### ##      #### #   #    #  ##   #  
 #  #  # #       #  # #   #    #  #     # 
 #  #  # ###     #  # ### ### ### ### ## 


### none!


 ##  #  # ### #  #  ##  
#  # #  #  #  ## # #  # 
#    ####  #  # ## #### 
#  # #  #  #  #  # #  # 
 ##  #  # ### #  # #  # 


faction_goal_guerilla_expansion = {
	name = guerilla_expansion_goal_name
	description = guerilla_expansion_goal_desc
	category = short_term
	group = FOCUS_FILTER_POLITICAL_CHARACTER
	allowed = {
	}
	visible = {
		FROM = {
			has_war = yes
		}
	}
	completed = {
		custom_trigger_tooltip = {
			tooltip = GUERILLA_TOTAL_ABOVE_THRESHOLD
			check_variable = { global.guerilla_counter > 4 }
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		every_collection_element = {
			input = {
				input = game:scope
				operators =  { 
					faction_members 
					limit = {
						check_variable = { THIS.guerilla_counter > 2 }
					}
				}
				name = GUERILLA_ABOVE_THRESHOLD
			}
			add_faction_influence_ratio = 0.2
			add_war_support = 0.05
		}
	}
	ai_will_do = {
		base = 3 # Pretty much everyone should want to do this
	}
}

faction_goal_north_subjugated = {
	name = faction_goal_north_subjugated_name
	description = faction_goal_north_subjugated_desc
	category = short_term
	group = FOCUS_FILTER_ANNEXATION
	visible = {
		FROM = {
			has_faction_template = faction_template_chinese_united_front 
			NOT = {
				has_country_flag = CHI_tour_the_south_flag
				has_country_flag = CHI_tour_the_west_flag
			}
		}
	}
	available = {
	}
	completed = {

	}
	complete_effect = {
		add_faction_power_projection = 50
		every_collection_element = {
			input = {
				input = game:scope
				operators =  { 
					faction_members
					limit = {
						is_subject = yes
					}
				}
				
				name = ALL_FACTION_MEMBERS
			}
			custom_effect_tooltip = ALL_FACTION_MEMBERS
		}
	}
	ai_will_do = {
		base = 1
	}
}

faction_goal_unlock_research = {
	name = faction_goal_unlock_research_name
	description = faction_goal_unlock_research_desc
	category = short_term
	group = FOCUS_FILTER_INTERNAL_AFFAIRS
	available = {
		FROM = { num_faction_members > 2 }
	}
	visible = {
		FROM = { has_faction_research_unlocked = no }
	}
	select_effect = {
		set_temp_variable = { total_techs = 0 }
		every_collection_element = {
			input = {
				input = game:scope
				operators =  {
					faction_members
				}
			}
			add_to_temp_variable = { total_techs = num_researched_technologies }
		}
		
		multiply_temp_variable = {
			var = total_techs
			value = 1.20
		}
		scope:faction = {
			set_variable = { unlock_military_techs_researched_target = total_techs }
		}
	}
	completed = {
		scope:faction = {
			hidden_trigger = {
				tooltip_evaluation = eval
				set_temp_variable = { unlock_military_techs_researched_compare = 0 }			
				all_collection_elements = {
					collection = {
						input = game:scope
						operators =  { faction_members }
					}
					add_to_temp_variable = { unlock_military_techs_researched_compare = num_researched_technologies }
				}
				set_temp_variable = { unlock_military_techs_researched_compare_temp_target = unlock_military_techs_researched_compare }
				multiply_temp_variable = { unlock_military_techs_researched_compare_temp_target = 1.20 }
			}
			if = {
				limit = {
					has_variable = unlock_military_techs_researched_target
				}
				check_variable = {
					var = unlock_military_techs_researched_compare
					value = unlock_military_techs_researched_target
					compare = greater_than
					tooltip = "GOAL_T_TRIGGER_A"
				}
			}
			else = {
				check_variable = {
					var = unlock_military_techs_researched_compare
					value = unlock_military_techs_researched_compare_temp_target
					compare = greater_than
					tooltip = "GOAL_T_TRIGGER_A"
				}
			}
		}
	}
	complete_effect = {
		set_faction_research_unlocked = yes
		add_faction_initiative = 1
	}
	ai_will_do = {
		base = 1000 # They should always do this if they can
	}
}

faction_goal_unlock_military = {
	name = faction_goal_unlock_military_name
	description = faction_goal_unlock_military_desc
	category = short_term
	group = FOCUS_FILTER_INTERNAL_AFFAIRS
	available = {
		FROM = { num_faction_members > 2 }
	}
	visible = {
		FROM = { has_faction_military_unlocked = no }
	}
	select_effect = {
		set_temp_variable = { total_divs = 0 }
		every_collection_element = {
			input = {
				input = game:scope
				operators =  {
					faction_members
				}
			}
			add_to_temp_variable = { total_divs = num_armies }
		}
		
		multiply_temp_variable = {
			var = total_divs
			value = 1.20
		}
		scope:faction = {
			set_variable = { unlock_target = total_divs }
		}
	}
	completed = {
		scope:faction = {
			hidden_trigger = {
				tooltip_evaluation = eval
				set_temp_variable = { unlock_compare = 0 }			
				all_collection_elements = {
					collection = {
						input = game:scope
						operators =  { faction_members }
					}
					add_to_temp_variable = { unlock_compare = num_armies }
					set_temp_variable = { unlock_military_techs_researched_compare_temp_target = unlock_compare }
					multiply_temp_variable = { unlock_military_techs_researched_compare_temp_target = 1.20 }
				}
			}
			if = {
				limit = {
					has_variable = unlock_target
				}
				check_variable = {
					var = unlock_compare
					value = unlock_target
					compare = greater_than
					tooltip = "GOAL_T_TRIGGER_B"
				}
			}
			else = {
				check_variable = {
					var = unlock_compare
					value = unlock_military_techs_researched_compare_temp_target
					compare = greater_than
					tooltip = "GOAL_T_TRIGGER_B"
				}
			}
		}
	}
	complete_effect = {
		set_faction_military_unlocked = yes
		add_faction_initiative = 1
	}
	ai_will_do = {
		base = 1000 # They should always do this if they can
	}
}

faction_goal_west_subjugated = {
	name = faction_goal_west_subjugated_name
	description = faction_goal_west_subjugated_desc
	category = short_term
	group = FOCUS_FILTER_ANNEXATION
	visible = {
		FROM = {
			has_faction_template = faction_template_chinese_united_front 
			NOT = {
				has_country_flag = CHI_tour_the_south_flag
				has_country_flag = CHI_tour_the_north_flag
			}
		}
	}
	available = {
	}
	completed = {
	}
	complete_effect = {
		add_faction_power_projection = 50
		every_collection_element = {
			input = {
				input = game:scope
				operators =  { 
					faction_members
					limit = {
						is_subject = yes
					}
				}
				
				name = ALL_FACTION_MEMBERS
			}
			custom_effect_tooltip = ALL_FACTION_MEMBERS
		}
	}
	ai_will_do = {
		base = 1
	}
}

faction_goal_south_subjugated = {
	name = faction_goal_south_subjugated_name
	description = faction_goal_south_subjugated_desc
	group = FOCUS_FILTER_ANNEXATION
	category = short_term
	visible = {
		FROM = {
			has_faction_template = faction_template_chinese_united_front 
			NOT = {
				has_country_flag = CHI_tour_the_north_flag
				has_country_flag = CHI_tour_the_west_flag
			}
		}
	}
	available = {
	}
	completed = {
	}
	complete_effect = {
		add_faction_power_projection = 50
		every_collection_element = {
			input = {
				input = game:scope
				operators =  { 
					faction_members
					limit = {
						is_subject = yes
					}
				}
				
				name = ALL_FACTION_MEMBERS
			}
			custom_effect_tooltip = ALL_FACTION_MEMBERS
		}
	}
	ai_will_do = {
		base = 1
	}
}


 ###  ##  ###   ##  #  # 
   # #  # #  # #  # ## # 
   # #### ###  #### # ## 
#  # #  # #    #  # #  # 
 ##  #  # #    #  # #  # 


faction_goal_coastal_security = {
	name = coastal_security_goal_name
	description = coastal_security_goal_desc
	category = short_term
	group = FOCUS_FILTER_NAVY_XP
	allowed = {
	}
	visible = {
	}
	completed = {
		has_naval_control = 90
		has_naval_control = 79
		has_naval_control = 77
		has_naval_control = 76
		has_naval_control = 75
		has_naval_control = 73
	}
	complete_effect = {
		add_faction_initiative = 1
		add_faction_power_projection = 500
		every_collection_element = {
			input = {
				input = game:scope
				operators =  { 
					faction_members 
				}	
				name = ALL_FACTION_MEMBERS
			}
			navy_experience = 50
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 4 # Mid game prio
			date > 1940.1.1
		}
	}
}


 ##  ##  #   # ### ### ###     #  # #  # ###  ##  #  # 
#   #  # #   #  #  #    #      #  # ## #  #  #  # ## # 
 #  #  #  # #   #  ##   #      #  # # ##  #  #  # # ## 
  # #  #  # #   #  #    #      #  # #  #  #  #  # #  # 
##   ##    #   ### ###  #       ##  #  # ###  ##  #  # 


#faction_goal_production_quotas = {
#	name = production_quotas_goal_name
#	description = production_quotas_goal_desc
#	category = short_term
#	allowed = {
#		tag = SOV
#	}
#	completed = {
#		
#		custom_trigger_tooltip = {
#			tooltip = "TODO Count faction Equipment - tanks - Infantry EQ - Planes"
#			check_variable = { ROOT.num_equipment@infantry_equipment > 1000}
#		}
#		#count_in_collection = {
#		#	collection = {
#		#		input = game:scope
#		#		operators = { faction_members }
#		#		name = FACTION_NAME
#		#	}
#		#	equipment = { infantry_equipment }
#		#	size > 50000
#		#}
#		
#	}
#	complete_effect = {
#		add_faction_power_projection = 200
#		custom_effect_tooltip = generic_skip_one_line_tt
#		custom_effect_tooltip = INFLUENCE_ABOVE_30_PERCENT
#		every_faction_member = {
#			limit = { faction_influence_ratio > 0.3}
#			add_political_power = 75
#		}
#	}
#	ai_will_do = {
#		base = 1
#		modifier = {
#			add = 1
#			date < 1940.1.1
#		}
#	}
#}

faction_goal_stall_the_fascist_threat = {
	name = stall_the_fascist_threat_goal_name
	description = stall_the_fascist_threat_goal_desc
	group = FOCUS_FILTER_INTERNAL_AFFAIRS
	category = short_term
	allowed = {
	}
	visible = {
		date < 1938.6.1
	}
	completed = {
		OR = {
			AND = {
				date > 1939.1.1
				NOT = { has_global_flag = scw_over }
			}
			AND = {
				has_global_flag = scw_over
				has_global_flag = republican_victory
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 200
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_FACTION_LEADER
		add_faction_initiative = 1
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = { army_experience = 50 }
	}
	ai_will_do = {
		base = 0
	}
}


##########################################################

 ##  ### #  # ### ###  ###  ##       ##   ##   ##  #    ## 
#    #   ## # #   #  #  #  #  #     #    #  # #  # #   #   
# ## ##  # ## ##  ###   #  #        # ## #  # #### #    #  
#  # #   #  # #   #  #  #  #  #     #  # #  # #  # #     # 
 ##  ### #  # ### #  # ###  ##       ##   ##  #  # ### ##  

##########################################################


# Faction Growth

faction_goal_growing_the_faction = {
	name = growing_the_faction
	description = growing_the_faction_desc
	category = short_term
	group = FOCUS_FILTER_POLITICAL_CHARACTER
	visible = {
		num_faction_members < 5
	}
	completed = {
		num_faction_members > 4
	}
	complete_effect = {
		add_faction_power_projection = 50 
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_FACTION_LEADER
		add_faction_initiative = 1
	}
	ai_will_do = {
		base = 0
		modifier = {  
			add = 1
			num_faction_members < 5
		}
		modifier = {  
			add = 1
			num_faction_members < 4
		}
		modifier = {  
			add = 3
			num_faction_members < 3
		}
	}
}

faction_goal_spy_master = {
	name = spy_master_goal_name
	description = spy_master_goal_desc
	group = FOCUS_FILTER_POLITICAL_CHARACTER
	category = short_term
	allowed = {
		has_dlc = "La Resistance"
	}
	visible = {
		FROM = {
			is_spymaster = no
			any_allied_country = {
				is_spymaster = no
			}
		}
	}
	completed = {
		OR = {
			is_spymaster = yes
			any_allied_country = {
				is_spymaster = yes
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 50
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_SPY_MASTER
		add_faction_initiative = 1
		custom_effect_tooltip = generic_skip_one_line_tt
		every_faction_member = { 
			limit = {
				has_intelligence_agency = no
			}
			create_intelligence_agency = yes
		}
		every_faction_member = { 
			limit = {
				has_intelligence_agency = yes
				NOT = { has_done_agency_upgrade  = upgrade_form_department }
			}
			upgrade_intelligence_agency = upgrade_form_department
		}
		every_faction_member = {
			limit = {
				has_intelligence_agency = yes
				has_done_agency_upgrade  = upgrade_form_department
				NOT = { has_done_agency_upgrade = upgrade_crypto_strength }
			}
			upgrade_intelligence_agency = upgrade_crypto_strength
		}
		every_faction_member = { 
			limit = {
				has_intelligence_agency = yes
				has_done_agency_upgrade = upgrade_crypto_strength
				has_tech = mechanical_computing
				NOT = { has_done_agency_upgrade = upgrade_crypto_strength_2 }
			}
			add_faction_initiative = 1
			upgrade_intelligence_agency = upgrade_crypto_strength_2
		}
		every_faction_member = { 
			limit = {
				has_intelligence_agency = yes
				NOT = { agency_upgrade_number > 30 }
				OR = {
					has_done_agency_upgrade = upgrade_crypto_strength_2
					NOT = { has_tech = mechanical_computing }
				}
			}
			add_faction_initiative = 1
			gain_random_agency_upgrade = yes
		}
		every_faction_member = { # Fallback in case someone completed everything
			visible_when_empty = yes
			limit = {
				has_intelligence_agency = yes
				agency_upgrade_number > 30
			}
			add_faction_initiative = 1
			add_political_power = 100
		}
	}
	ai_will_do = {
		base = 1
		modifier = {  
			add = 2
			has_intelligence_agency = yes
		}
	}
}


#faction_goal_convoy_sufficiency = {
#	name = convoy_sufficiency_goal_name
#	description = convoy_sufficiency_goal_desc
#	completed = {
#		count_in_collection = {
#			collection = {
#				input = game:scope
#				operators = { faction_members }
#				name = FACTION_NAME
#			}
#			equipment = { convoy }
#			size > 1000
#		}
#	}
#	complete_effect = {
#		add_faction_power_projection = 200
#		custom_effect_tooltip = generic_skip_one_line_tt
#		every_faction_member = {
#			tooltip = AT_LEAST_50_MILS
#			visible_when_empty = yes 
#			limit = {
#				num_of_military_factories > 49
#			}
#			add_faction_initiative = 1
#		}
#		
#	}
#}

faction_goal_ensure_military_r_d = {
	name = ensure_military_r_d_goal_name
	description = ensure_military_r_d_goal_desc
	category = short_term
	group = FOCUS_FILTER_RESEARCH
	visible = {
		OR = {
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							land_facility > 0
						}
					}
					name = COLLECTION_FACTION_LAND_FACILITY
				}
				value < 1
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							naval_facility > 0
						}
					}
					name = COLLECTION_FACTION_NAVAL_FACILITY
				}
				value < 1
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							air_facility > 0
						}
					}
					name = COLLECTION_FACTION_AIR_FACILITY
				}
				value < 1
			}
		}
	}
	completed = {
		collection_size = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_controlled_by_ROOT_or_ally = yes 
						land_facility > 0
					}
				}
				name = COLLECTION_FACTION_LAND_FACILITY
			}
			value > 0
		}
		collection_size = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_controlled_by_ROOT_or_ally = yes 
						naval_facility > 0
					}
				}
				name = COLLECTION_FACTION_NAVAL_FACILITY
			}
			value > 0
		}
		collection_size = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_controlled_by_ROOT_or_ally = yes 
						air_facility > 0
					}
				}
				name = COLLECTION_FACTION_AIR_FACILITY
			}
			value > 0
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_collection_element = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_controlled_by_ROOT_or_ally = yes
						OR = {
							air_facility > 0
							land_facility > 0
							naval_facility > 0
						}
					}
				}
				name = OWNS_LISTED_STATE
			}
			custom_effect_tooltip = OWNS_LISTED_STATE
			add_faction_influence_ratio = 0.05
		}
		every_faction_member = {
			if = {
				limit = {
					any_scientist = {
						has_scientist_level = {
							level > 0
							specialization = specialization_land
						}
						is_active_scientist = yes
					}
				}
				every_scientist = {
					visible_when_empty = yes
					limit = {
						has_scientist_level = {
							level > 0
							specialization = specialization_land
						}
						is_active_scientist = yes
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.very_high
						specialization = specialization_land
					}
				}
			}
			if = {
				limit = {
					any_scientist = {
						has_scientist_level = {
							level > 0
							specialization = specialization_naval
						}
						is_active_scientist = yes
					}
				}
				every_scientist = {
					visible_when_empty = yes
					limit = {
						has_scientist_level = {
							level > 0
							specialization = specialization_naval
						}
						is_active_scientist = yes
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.very_high
						specialization = specialization_naval
					}
				}
			}
			if = {
				limit = {
					any_scientist = {
						has_scientist_level = {
							level > 0
							specialization = specialization_air
						}
						is_active_scientist = yes
					}
				}
				every_scientist = {
					visible_when_empty = yes
					limit = {
						has_scientist_level = {
							level > 0
							specialization = specialization_air
						}
						is_active_scientist = yes
					}
					add_scientist_xp = {
						experience = constant:sp_scientist_xp_gain.very_high
						specialization = specialization_air
					}
				}
			}
		}
	}
	ai_will_do = {
		base = 1
	}
}


### Industry

faction_goal_military_infrastructure = {
	name = military_infrastructure_goal_name
	description = military_infrastructure_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	visible = {
		collection_size = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_core_of = CONTROLLER
						is_controlled_by_ROOT_or_ally = yes 
						any_neighbor_state = {
							controller = {
								NOT = { is_in_faction_with = ROOT }
							}
						}
						infrastructure < 5
					}
				}
				name = COLLECTION_FACTION_BORDER_STATES_FULL_INFRASTRUCTURE
			}
			value > 0
		}
	}
	completed = {
		collection_size = {
			input = {
				input = game:all_states
				operators = {
					limit = {
						is_controlled_by_ROOT_or_ally = yes 
						any_neighbor_state = {
							controller = {
								NOT = { is_in_faction_with = ROOT }
							}
						}
						infrastructure < 5
					}
				}
				name = COLLECTION_FACTION_BORDER_STATES_FULL_INFRASTRUCTURE
			}
			value < 1
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			army_experience = 50
		}
	}
	ai_will_do = {
		base = 0
		modifier = {  
			add = 1
			has_war = no
		}
	}
}

faction_goal_a_great_fortress = {
	name = a_great_fortress_goal_name
	description = a_great_fortress_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	visible = {
	}
	available = {
		collection_size = {
			input = {
				input = collection:faction_owned_core_states
				operators = {
					limit = {
						NOT = { is_fully_controlled_by = OWNER }
					}
				}
				name = FACTION_CORE_STATES_NOT_FULLY_CONTROLLED
			}
			value < 1
		}
	}
	completed = {
		OR = {
			ROOT = {
				has_tech = coastal_fort_tech_2
			}
			any_allied_country = {
				has_tech = coastal_fort_tech_2
			}
			count_in_collection = {
				collection = {
					input = game:scope
					operators = { faction_members }
					name = FACTION_NAME
				}
				buildings = { bunker coastal_bunker}
				size > 29
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1
			has_tech = basic_fortification_tech
		}
	}
}


### War Waging



faction_goal_preemptive_strike_on_fascism = {
	name = preemptive_strike_on_fascism_goal_name
	description = preemptive_strike_on_fascism_goal_desc
	category = short_term
	group = FOCUS_FILTER_WAR_SUPPORT
	visible = {
		FROM = {
			NOT = {
				has_government = criminal
			}
			NOT = {
				any_enemy_country = {
					has_government = criminal
				}
			}
		}
	}
	available = {
		threat < 0.5
	}
	completed = {
		any_allied_country = {
			has_offensive_war = yes
			any_enemy_country = {
				has_government = criminal
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_FACTION_LEADER
		add_faction_initiative = 1
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			army_experience = 25
			add_war_support = 0.05
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1
			is_historical_focus_on = yes
		}
	}
}


faction_goal_war_on_communism = {
	name = war_on_communism_goal_name
	description = war_on_communism_goal_desc
	category = short_term
	group = FOCUS_FILTER_WAR_SUPPORT
	visible = {
		FROM = {
			NOT = {
				has_government = terrorist
			}
		}
		any_country = {
			has_government = terrorist
			is_on_same_continent_as = FROM
		}
	}
	completed = {
		OR = {
			any_enemy_country = {
				has_government = terrorist
				is_on_same_continent_as = ROOT
			}
			any_allied_country = {
				any_enemy_country = {
					has_government = terrorist
					is_on_same_continent_as = PREV
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_FACTION_LEADER
		add_faction_initiative = 1
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			add_war_support = 0.05
		}
	}
	ai_will_do = {
		base = 1
	}
}

faction_goal_war_on_democracy = {
	name = war_on_democracy_goal_name
	description = war_on_democracy_goal_desc
	group = FOCUS_FILTER_WAR_SUPPORT
	category = short_term
	visible = {
		FROM = {
			NOT = {
				has_government = council
			}
		}
		any_country = {
			has_government = council
			is_on_same_continent_as = FROM
		}
	}
	completed = {
		OR = {
			any_enemy_country = {
				has_government = council
				is_on_same_continent_as = ROOT
			}
			any_allied_country = {
				any_enemy_country = {
					has_government = council
					is_on_same_continent_as = PREV
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = THE_FACTION_LEADER
		add_faction_initiative = 1
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			add_war_support = 0.05
		}
	}
	ai_will_do = {
		base = 1
	}
}


### Units

faction_goal_an_armored_fist = {
	name = an_armored_fist_goal_name
	description = an_armored_fist_goal_desc
	category = short_term
	group = FOCUS_FILTER_ARMY_XP
	visible = {

	}
	completed = {
		count_in_collection = {
			collection = {
			    input = game:scope
			    operators = { faction_members }
			    name = FACTION
			}
			unit = armor
			size > 14
		}
		
		
	}
	complete_effect = {
		add_faction_power_projection = 200
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			army_experience = 50 
			random_character = {
				tooltip = ONE_PANZER_GENERAL	
				visible_when_empty = yes
				limit = {
					is_unit_leader = yes 
					OR = {
						has_trait = panzer_leader
						has_trait = panzer_expert 
					}
				}
				gain_xp = 400
				add_attack = 1
			}
		}
	}
	ai_will_do = {
		base = 1
	}
}

faction_goal_an_infantry_army = {
	name = an_infantry_army_goal_name
	description = an_infantry_army_goal_desc
	category = short_term
	group = FOCUS_FILTER_ARMY_XP
	completed = {
		count_in_collection = {
		    collection = {
		        input = game:scope
		        operators = { faction_members }
		        name = FACTION
		    }
		   unit = infantry
		   size > 249
		}
	}
	complete_effect = {
		add_faction_power_projection = 200
		custom_effect_tooltip = ALL_FACTION_MEMBERS
		every_faction_member = {
			army_experience = 50 
			random_character = {
				tooltip = ONE_INFANTRY_GENERAL
				visible_when_empty = yes
				limit = {
					is_unit_leader = yes 
					OR = {
						has_trait = infantry_leader
						has_trait = infantry_expert 
					}
				}
				gain_xp = 400
				add_logistics = 1
			}
		}
	}
	ai_will_do = {
		base = 1
	}
}

### Strategic Resources

# Mexican Oil
faction_goal_develop_mexican_oil = {
	name = develop_mexican_oil_goal_name
	description = develop_mexican_oil_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			480 = { is_controlled_by_ROOT_or_ally = yes }
			479 = {	is_controlled_by_ROOT_or_ally = yes }
			477 = {	is_controlled_by_ROOT_or_ally = yes }
			476 = {	is_controlled_by_ROOT_or_ally = yes }	
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		480 = { is_controlled_by_ROOT_or_ally = yes }
		479 = {	is_controlled_by_ROOT_or_ally = yes }
		477 = {	is_controlled_by_ROOT_or_ally = yes }
		476 = {	is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		480 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		479 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		477 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		476 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		every_state = {
			limit = {
				OR = {
					state = 480
					state = 479
					state = 477
					state = 476
				}
			}
			add_resource = {
			    type = liquid_dust
			    amount = 4
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 480
				controls_state = 479
				controls_state = 477
				controls_state = 476
			}
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Curacao Oil
faction_goal_develop_curacao_oil = {
	name = develop_curacao_oil_goal_name
	description = develop_curacao_oil_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		695 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
	}
	completed = {
		695 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		695 = {
			add_resource = {
			    type = liquid_dust
			    amount = 14
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			controls_state = 695
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Venezuelan Oil
faction_goal_develop_venezuelan_oil = {
	name = develop_venezuelan_oil_goal_name
	description = develop_venezuelan_oil_goal_desc
	category = short_term
	group = resources_to_market_icon

	allowed = {
		
	}
	visible = {
		OR = {
			489 = { is_controlled_by_ROOT_or_ally = yes }
			307 = {	is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		489 = { is_controlled_by_ROOT_or_ally = yes }
		307 = {	is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		489 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		307 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		every_state = {
			limit = {
				OR = {
					state = 489
					state = 307
				}
			}
			add_resource = {
			    type = liquid_dust
			    amount = 8
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 489
				controls_state = 307
			}
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Guyanan Bauxite
faction_goal_develop_guyanan_bauxite = {
	name = develop_guyanan_bauxite_goal_name
	description = develop_guyanan_bauxite_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		687 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}

	}
	completed = {
		687 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		687 = {
			add_resource = {
			    type = aluminium
			    amount = 14
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			controls_state = 687
		}
		modifier = {
			add = 1 # If entire alliance is low on aluminium they should be incentivized to developing more
			has_resources_in_collection = {
				collection = {
						input = game:scope
						operators =  { faction_members }
						name = FACTION
				}
				resource = aluminium
				amount < 30
				extracted = no # (optional, default: no) checks extracted amount instead of country balance
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on aluminium they should be heavily incentivized to developing more
			has_resources_in_collection = {
				collection = {
						input = game:scope
						operators =  { faction_members }
						name = FACTION
				}
				resource = aluminium
				amount < 10
				extracted = no # (optional, default: no) checks extracted amount instead of country balance
			}
		}
	}
}

# Surinamese Bauxite
faction_goal_develop_suriname_bauxite = {
	name = develop_suriname_bauxite_goal_name
	description = develop_suriname_bauxite_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		309 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}

	}
	completed = {
		309 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		309 = {
			add_resource = {
			    type = aluminium
			    amount = 14
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			controls_state = 309
		}
		modifier = {
			add = 1 # If entire alliance is low on aluminium they should be incentivized to developing more
			has_resources_in_collection = {
				collection = {
						input = game:scope
						operators =  { faction_members }
						name = FACTION
				}
				resource = aluminium
				amount < 30
				extracted = no # (optional, default: no) checks extracted amount instead of country balance
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on aluminium they should be heavily incentivized to developing more
			has_resources_in_collection = {
				collection = {
						input = game:scope
						operators =  { faction_members }
						name = FACTION
				}
				resource = aluminium
				amount < 10
				extracted = no # (optional, default: no) checks extracted amount instead of country balance
			}
		}
	}
}

# Lappland Metals
faction_goal_develop_lappland_metals = {
	name = develop_lappland_metals_goal_name
	description = develop_lappland_metals_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			666 = { is_controlled_by_ROOT_or_ally = yes }
			918 = {	is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		666 = { is_controlled_by_ROOT_or_ally = yes }
		918 = {	is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		666 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		918 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		666 = {
			add_resource = {
			    type = tungsten
			    amount = 14
			}
			add_resource = {
			    type = steel
			    amount = 14
			}
			add_resource = {
			    type = chromium
			    amount = 8
			}
		}
		918 = {
			add_resource = {
			    type = tungsten
			    amount = 10
			}
			add_resource = {
			    type = steel
			    amount = 10
			}
			add_resource = {
			    type = chromium
			    amount = 5
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 666
				controls_state = 918
			}
		}
		modifier = {
			add = 1 # If entire alliance is low on resources they should be incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = chromium
					amount < 24
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on resources they should be heavily incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = chromium
					amount < 8
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
	}
}

# Ploiesti Oil Fields
faction_goal_develop_ploiesti_oil_fields = {
	name = develop_ploiesti_oil_fields_goal_name
	description = develop_ploiesti_oil_fields_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		46 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
	}
	completed = {
		46 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		46 = {
			add_resource = {
			    type = liquid_dust
			    amount = 14
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			controls_state = 46
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Baku Oil Fields
faction_goal_develop_baku_oil_fields = {
	name = develop_baku_oil_fields_goal_name
	description = develop_baku_oil_fields_goal_desc
	category = short_term
	group = resources_to_market_icon

	allowed = {
		
	}
	visible = {
		OR = {
			229 = { is_controlled_by_ROOT_or_ally = yes }
			232 = {	is_controlled_by_ROOT_or_ally = yes }
			821 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		229 = { is_controlled_by_ROOT_or_ally = yes }
		232 = {	is_controlled_by_ROOT_or_ally = yes }
		821 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		229 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		232 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		821 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		every_state = {
			limit = {
				OR = {
					state = 232
					state = 821
				}
			}
			add_resource = {
			    type = liquid_dust
			    amount = 4
			}
		}
		229 = {
			add_resource = {
			    type = liquid_dust
			    amount = 14
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			controls_state = 46
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Iraqi Oil
faction_goal_develop_iraqi_oil = {
	name = develop_iraqi_oil_goal_name
	description = develop_iraqi_oil_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			291 = { is_controlled_by_ROOT_or_ally = yes }
			676 = {	is_controlled_by_ROOT_or_ally = yes }
			1010 = { is_controlled_by_ROOT_or_ally = yes }	
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		291 = { is_controlled_by_ROOT_or_ally = yes }
		676 = {	is_controlled_by_ROOT_or_ally = yes }
		1010 = { is_controlled_by_ROOT_or_ally = yes }	
	}
	completed = {
		291 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		676 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		1010 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		291 = {
			add_resource = {
			    type = liquid_dust
			    amount = 6
			}
		}
		676 = {
			add_resource = {
			    type = liquid_dust
			    amount = 4
			}
		}
		1010 = {
			add_resource = {
			    type = liquid_dust
			    amount = 2
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			controls_state = 46
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Persian Oil
faction_goal_develop_persian_oil = {
	name = develop_persian_oil_goal_name
	description = develop_persian_oil_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			411 = { is_controlled_by_ROOT_or_ally = yes }
			412 = {	is_controlled_by_ROOT_or_ally = yes }
			413 = { is_controlled_by_ROOT_or_ally = yes }	
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		411 = { is_controlled_by_ROOT_or_ally = yes }
		412 = {	is_controlled_by_ROOT_or_ally = yes }
		413 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		411 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		412 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		413 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		411 = {
			add_resource = {
			    type = liquid_dust
			    amount = 6
			}
		}
		412 = {
			add_resource = {
			    type = liquid_dust
			    amount = 4
			}
		}
		413 = {
			add_resource = {
			    type = liquid_dust
			    amount = 8
			}
		}
	}
	ai_will_do = {
		base = 1 # Everyone should always kiiiinda care about oil
		modifier = {
			add = 1 # State owners should care more
			controls_state = 46
		}
		modifier = {
			add = -1 # If the alliance is doing well with fuel avoid taking this...
			fuel_ratio > 0.9
			all_allied_country = {
				fuel_ratio > 0.9
			}
		}
		modifier = {
			add = 1 # Powers with low fuel should care about oil a bit more
			fuel_ratio < 0.4
		}
		modifier = {
			add = 1 # Powers with very low fuel should care about oil A LOT
			fuel_ratio < 0.1
		}
	}
}

# Chinese Metals
faction_goal_develop_chinese_metals = {
	name = develop_chinese_metals_goal_name
	description = develop_chinese_metals_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {

	}
	visible = {
		OR = {
			592 = { is_controlled_by_ROOT_or_ally = yes }
			593 = {	is_controlled_by_ROOT_or_ally = yes }
			594 = { is_controlled_by_ROOT_or_ally = yes }
			599 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		592 = { is_controlled_by_ROOT_or_ally = yes }
		593 = {	is_controlled_by_ROOT_or_ally = yes }
		594 = { is_controlled_by_ROOT_or_ally = yes }
		599 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		592 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		593 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		594 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		599 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		592 = {
			add_resource = {
			    type = tungsten
			    amount = 4
			}
			add_resource = {
			    type = steel
			    amount = 6
			}
			add_resource = {
			    type = chromium
			    amount = 2
			}
		}
		593 = {
			add_resource = {
			    type = tungsten
			    amount = 6
			}
			add_resource = {
			    type = steel
			    amount = 6
			}
			add_resource = {
			    type = chromium
			    amount = 2
			}
		}
		594 = {
			add_resource = {
			    type = tungsten
			    amount = 4
			}
			add_resource = {
			    type = steel
			    amount = 4
			}
			add_resource = {
			    type = chromium
			    amount = 2
			}
		}
		599 = {
			add_resource = {
			    type = tungsten
			    amount = 6
			}
			add_resource = {
			    type = steel
			    amount = 6
			}
			add_resource = {
			    type = chromium
			    amount = 2
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 592
				controls_state = 593
				controls_state = 594
				controls_state = 599
			}
		}
		modifier = {
			add = 1 # If entire alliance is low on resources they should be incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = chromium
					amount < 24
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on resources they should be heavily incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = chromium
					amount < 8
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
	}
}

# Malayan Riches
faction_goal_develop_malayan_riches = {
	name = develop_malayan_riches_goal_name
	description = develop_malayan_riches_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			333 = { is_controlled_by_ROOT_or_ally = yes }
			336 = {	is_controlled_by_ROOT_or_ally = yes }
			1021 = { is_controlled_by_ROOT_or_ally = yes }
			1024 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		333 = { is_controlled_by_ROOT_or_ally = yes }
		336 = {	is_controlled_by_ROOT_or_ally = yes }
		1021 = { is_controlled_by_ROOT_or_ally = yes }
		1024 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		333 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		336 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		1021 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		1024 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		333 = {
			add_resource = {
			    type = liquid_dust
			    amount = 2
			}
			add_resource = {
			    type = rubber
			    amount = 8
			}
		}
		336 = {
			add_resource = {
			    type = aluminium
			    amount = 4
			}
			add_resource = {
			    type = rubber
			    amount = 60
			}
			add_resource = {
			    type = tungsten
			    amount = 28
			}
			add_resource = {
			    type = steel
			    amount = 4
			}
		}
		1021 = {
			add_resource = {
			    type = aluminium
			    amount = 3
			}
			add_resource = {
			    type = tungsten
			    amount = 12
			}
			add_resource = {
			    type = steel
			    amount = 4
			}
		}
		1024 = {
			add_resource = {
			    type = rubber
			    amount = 8
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 333
				controls_state = 336
				controls_state = 1021
				controls_state = 1024
			}
		}
		modifier = {
			add = 1 # If entire alliance is low on resources they should be incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = rubber
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 24
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = aluminium
					amount < 12
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = liquid_dust
					amount < 30
					extracted = yes  # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on resources they should be heavily incentivized to taking more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = rubber
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 8
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = aluminium
					amount < 4
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = liquid_dust
					amount < 10
					extracted = yes  # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
	}
}

# Indonesian Riches
faction_goal_develop_indonesian_riches = {
	name = develop_indonesian_riches_goal_name
	description = control_indonesian_riches_goal_desc
	category = short_term
	group = resources_to_market_icon
	allowed = {
		
	}
	visible = {
		OR = {
			334 = { is_controlled_by_ROOT_or_ally = yes }
			335 = {	is_controlled_by_ROOT_or_ally = yes }
			667 = {	is_controlled_by_ROOT_or_ally = yes }
			672 = { is_controlled_by_ROOT_or_ally = yes }
			673 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		FROM = {
			has_tech = excavation1
			has_tech = excavation2
		}
		334 = { is_controlled_by_ROOT_or_ally = yes }
		335 = {	is_controlled_by_ROOT_or_ally = yes }
		667 = {	is_controlled_by_ROOT_or_ally = yes }
		672 = { is_controlled_by_ROOT_or_ally = yes }
		673 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		334 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		335 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		667 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		672 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
		673 = {
			CONTROLLER = { has_tech = excavation3 }
			infrastructure > 4
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		334 = {
			add_resource = {
			    type = liquid_dust
			    amount = 3
			}
			add_resource = {
			    type = rubber
			    amount = 28
			}
		}
		335 = {
			add_resource = {
			    type = liquid_dust
			    amount = 4
			}
			add_resource = {
			    type = rubber
			    amount = 48
			}
		}
		667 = {
			add_resource = {
			    type = rubber
			    amount = 6
			}
		}
		672 = {
			add_resource = {
			    type = liquid_dust
			    amount = 5
			}
			add_resource = {
			    type = aluminium
			    amount = 8
			}
			add_resource = {
			    type = rubber
			    amount = 50
			}
		}
		673 = {
			add_resource = {
			    type = rubber
			    amount = 10
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # State owners should care more
			OR = {
				controls_state = 334
				controls_state = 335
				controls_state = 667
				controls_state = 672
				controls_state = 673
			}
		}
		modifier = {
			add = 1 # If entire alliance is low on resources they should be incentivized to developing more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = rubber
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 45
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 24
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = aluminium
					amount < 12
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = liquid_dust
					amount < 30
					extracted = yes  # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
		modifier = {
			add = 3 # If entire alliance is very low on resources they should be heavily incentivized to taking more
			OR = {
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = rubber
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = tungsten
					amount < 15
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = steel
					amount < 8
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = aluminium
					amount < 4
					extracted = no # (optional, default: no) checks extracted amount instead of country balance
				}
				has_resources_in_collection = {
					collection = {
							input = game:scope
							operators =  { faction_members }
							name = FACTION
					}
					resource = liquid_dust
					amount < 10
					extracted = yes  # (optional, default: no) checks extracted amount instead of country balance
				}
			}
		}
	}
}

### Strategic Bases

# Newfoundland
faction_goal_expand_newfoundland_bases = {
	name = expand_newfoundland_bases_goal_name
	description = expand_newfoundland_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION

	allowed = {
		
	}
	visible = {
		331 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		
	}
	completed = {
		331 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 331
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Bermuda
faction_goal_expand_bermuda_bases = {
	name = expand_bermuda_bases_goal_name
	description = expand_bermuda_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		696 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {
		
	}
	completed = {
		696 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = {
			visible_when_empty = yes
			limit = {
				controls_state = 696
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Bahamas
faction_goal_expand_bahamas_bases = {
	name = expand_bahamas_bases_goal_name
	description = expand_bahamas_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		OR = {
			690 = { is_controlled_by_ROOT_or_ally = yes }
			693 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		690 = { is_controlled_by_ROOT_or_ally = yes }
		693 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		any_state = {
			OR = {
				state = 690
				state = 693
			}
			air_base > 1
		}
		any_state = {
			OR = {
				state = 690
				state = 693
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				OR = {
					controls_state = 690
					controls_state = 693
				}
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Panama
faction_goal_fortify_panama_canal = {
	name = fortify_panama_canal_goal_name
	description = control_panama_canal_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		685 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		685 = {
			air_base > 7
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 4
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = coastal_bunker
				level > 0
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = bunker
				level > 0
			}
		}
		OR = {
			divisions_in_state = { state = 685 size > 0 }
			any_allied_country = {
				divisions_in_state = { state = 685 size > 0 }
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 685
			}
			add_faction_initiative = 1
		}
		685 = {
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 7617
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 7617
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
		modifier = {
			add = 2 # If major naval power seek to protect access
			has_navy_size = {
				size > 20
				type = capital_ship
			}
		}
	}
}

# Trinidad
faction_goal_expand_trinidad_bases = {
	name = expand_trinidad_bases_goal_name
	description = control_trinidad_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		691 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		691 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 691
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Azores
faction_goal_expand_azores_bases = {
	name = expand_azores_bases_goal_name
	description = control_azores_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION

	allowed = {
		
	}
	visible = {
		698 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		698 = {
			air_base > 2
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 4
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 698
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Iceland
faction_goal_expand_iceland_bases = {
	name = expand_iceland_bases_goal_name
	description = expand_iceland_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		100 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		100 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 100
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Faroe Islands
faction_goal_expand_faroese_bases = {
	name = expand_faroese_bases_goal_name
	description = control_faroe_islands_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		337 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		337 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 337
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transatlantic supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Narvik
faction_goal_expand_narvik_bases = {
	name = expand_narvik_bases_goal_name
	description = expand_narvik_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		144 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		144 = {
			air_base > 2
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 4
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 144
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Danish Belts
faction_goal_fortify_danish_belts = {
	name = fortify_danish_belts_goal_name
	description = fortify_danish_belts_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		OR = {
			37 = { is_controlled_by_ROOT_or_ally = yes }
			911 = { is_controlled_by_ROOT_or_ally = yes }
			99 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		37 = { is_controlled_by_ROOT_or_ally = yes }
		911 = { is_controlled_by_ROOT_or_ally = yes }
		99 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		custom_trigger_tooltip = {
            tooltip = fortify_danish_belts_tooltip
			37 = {
				any_province_building_level = {
					province = {
						id = 6287
						id = 3260
					}
					building = coastal_bunker
					level > 0
				}
			}
			911 = {
				any_province_building_level = {
					province = {
						id = 3325
					}
					building = coastal_bunker
					level > 0
				}
			}
			99 = {
				any_province_building_level = {
					province = {
						id = 394
						id = 3277
					}
					building = coastal_bunker
					level > 0
				}
			}
			OR = {
				AND = {
					divisions_in_state = { state = 37 size > 1 }
					divisions_in_state = { state = 911 size > 0 }
					divisions_in_state = { state = 99 size > 1 }
				}
				any_allied_country = {
					divisions_in_state = { state = 37 size > 1 }
					divisions_in_state = { state = 911 size > 0 }
					divisions_in_state = { state = 99 size > 1 }
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				OR = {
					controls_state = 37
					controls_state = 911
					controls_state = 99
				}
			}
			add_faction_initiative = 1
		}
		37 = {
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 6287
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 3260
				instant_build = yes
			}
		}
		911 = {
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 3325
				instant_build = yes
			}
		}
		99 = {
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 394
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 3277
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 1 # If naval power seek to control access
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
		modifier = {
			add = 1 # If at war with ENG and capital is on mainland Europe prioritize this
			capital_scope = {
				is_on_continent = europe
			}
		}
	}
}

# Gibraltar
faction_goal_fortify_gibraltar = {
	name = fortify_gibraltar_goal_name
	description = fortify_gibraltar_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION

	allowed = {
		
	}
	visible = {
		118 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		118 = {
			air_base > 3
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 6
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = coastal_bunker
				level > 2
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = bunker
				level > 2
			}
		}
		OR = {
			divisions_in_state = { state = 118 size > 0 }
			any_allied_country = {
				divisions_in_state = { state = 118 size > 0 }
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 118
			}
			add_faction_initiative = 1
		}
		118 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = air_base
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = naval_base
				level = 1
				instant_build = yes
				province = {
					all_provinces = yes
					limit_to_naval_base = yes
				}
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 4135
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 4135
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			factor = 2 # Target of opportunity - already at war anyway
			118 = {
				controller = {
					has_war_with = ROOT
				}
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Malta
faction_goal_expand_maltese_bases = {
	name = expand_maltese_bases_goal_name
	description = expand_maltese_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		116 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		116 = {
			air_base > 3
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 3
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 116
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 2 # If convoys being threatened try to secure the mediterranean supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							is_on_continent = europe
						}
					}
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							OR = {
								is_on_continent = middle_east
								is_on_continent = africa
							}
						}
					}
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Crete
faction_goal_expand_cretan_bases = {
	name = expand_cretan_bases_goal_name
	description = expand_cretan_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		182 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		182 = {
			air_base > 3
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 4
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 182
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 2 # If convoys being threatened try to secure the mediterranean supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							is_on_continent = europe
						}
					}
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							OR = {
								is_on_continent = middle_east
								is_on_continent = africa
							}
						}
					}
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Cyprus
faction_goal_expand_cypriot_bases = {
	name = expand_cypriot_bases_goal_name
	description = expand_cypriot_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		183 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		183 = {
			air_base > 2
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 3
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 183
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 2 # If convoys being threatened try to secure the mediterranean supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							is_on_continent = europe
						}
					}
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							OR = {
								is_on_continent = middle_east
								is_on_continent = africa
							}
						}
					}
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Bosporus
faction_goal_fortify_bosporus = {
	name = fortify_bosporus_goal_name
	description = fortify_bosporus_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		797 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		custom_trigger_tooltip = {
            tooltip = fortify_bosporus_tooltip
			797 = {
				any_province_building_level = {
					province = {
						id = 9833
						id = 11829
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 9833
						id = 11829
					}
					building = bunker
					level > 0
				}
			}
			OR = {
				divisions_in_state = { state = 797 size > 1 }
				any_allied_country = {
					divisions_in_state = { state = 797 size > 1 }
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 797
			}
			add_faction_initiative = 1
		}
		797 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 9833
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 9833
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 11829
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 11829
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 1 # If major naval power seek to control access
			has_navy_size = {
				size > 20
				type = capital_ship
			}
		}
	}
}

# Dardanelles
faction_goal_fortify_dardanelles = {
	name = fortify_dardanelles_goal_name
	description = fortify_dardanelles_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		OR = {
			340 = { is_controlled_by_ROOT_or_ally = yes }
			341 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		340 = { is_controlled_by_ROOT_or_ally = yes }
		341 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		custom_trigger_tooltip = {
            tooltip = fortify_dardanelles_tooltip
			340 = {
				any_province_building_level = {
					province = {
						id = 6864
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 6864
					}
					building = bunker
					level > 0
				}
			}
			341 = {
				any_province_building_level = {
					province = {
						id = 849
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 849
					}
					building = bunker
					level > 0
				}
			}
			OR = {
				AND = {
					divisions_in_state = { state = 797 size > 0 }
					divisions_in_state = { state = 341 size > 0 }
				}
				any_allied_country = {
					divisions_in_state = { state = 797 size > 0 }
					divisions_in_state = { state = 341 size > 0 }
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				OR = {
					controls_state = 340
					controls_state = 341
				}
			}
			add_faction_initiative = 1
		}
		340 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 6864
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 6864
				instant_build = yes
			}
		}
		341 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = naval_base
				level = 1
				instant_build = yes
				province = 849
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 849
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 849
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 1 # If major naval power seek to control access
			has_navy_size = {
				size > 20
				type = capital_ship
			}
		}
	}
}

# Suez Canal
faction_goal_fortify_suez_canal = {
	name = fortify_suez_canal_goal_name
	description = fortify_suez_canal_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION

	allowed = {
		
	}
	visible = {
		446 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		custom_trigger_tooltip = {
            tooltip = fortify_suez_tooltip
			446 = {
				any_province_building_level = {
					province = {
						id = 12049
						id = 4073
						id = 1155
						id = 9947
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 12049
						id = 4073
						id = 1155
						id = 9947
					}
					building = bunker
					level > 0
				}
			}
			OR = {
				divisions_in_state = { state = 446 size > 3 }
				any_allied_country = {
					divisions_in_state = { state = 446 size > 3 }
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 446
			}
			add_faction_initiative = 1
		}
		446 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 12049
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 12049
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 4073
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 4073
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 1155
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 1155
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 9947
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 9947
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
		modifier = {
			add = 2 # If major naval power seek to control access
			has_navy_size = {
				size > 20
				type = capital_ship
			}
		}
	}
}

# Gulf of Aden
faction_goal_expand_gulf_of_aden_bases = {
	name = expand_gulf_of_aden_bases_goal_name
	description = control_gulf_of_aden_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		992 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		992 = {
			air_base > 2
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 992
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the suez supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to control access
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Strait of Hormuz
faction_goal_fortify_strait_of_hormuz = {
	name = fortify_strait_of_hormuz_goal_name
	description = fortify_strait_of_hormuz_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {

	}
	visible = {
		OR = {
			412 = { is_controlled_by_ROOT_or_ally = yes }
			1013 = { is_controlled_by_ROOT_or_ally = yes }
		}
	}
	available = {
		412 = { is_controlled_by_ROOT_or_ally = yes }
		1013 = { is_controlled_by_ROOT_or_ally = yes }
	}
	completed = {
		custom_trigger_tooltip = {
            tooltip = fortify_strait_of_hormuz_tooltip
			412 = {
				any_province_building_level = {
					province = {
						id = 7982
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 7982
					}
					building = bunker
					level > 0
				}
			}
			1013 = {
				any_province_building_level = {
					province = {
						id = 13369
					}
					building = coastal_bunker
					level > 0
				}
				any_province_building_level = {
					province = {
						id = 13369
					}
					building = bunker
					level > 0
				}
			}
			OR = {
				AND = {
					divisions_in_state = { state = 412 size > 0 }
					divisions_in_state = { state = 1013 size > 0 }
				}
				any_allied_country = {
					divisions_in_state = { state = 412 size > 0 }
					divisions_in_state = { state = 1013 size > 0 }
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				OR = {
					controls_state = 412
					controls_state = 1013
				}
			}
			add_faction_initiative = 1
		}
		412 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 7982
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 7982
				instant_build = yes
			}
		}
		1013 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 13369
				instant_build = yes
			}
			add_building_construction = {
				type = bunker
				level = 1
				province = 13369
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 2 # If convoys being threatened try to secure the suez supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							OR = {
								is_on_continent = europe
								is_on_continent = asia
							}
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE_OR_ASIA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = middle_east
						}
					}
					name = COLLECTION_FACTION_STATES_IN_MIDDLE_EAST
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to control access
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Ceylon
faction_goal_expand_ceylonese_bases = {
	name = expand_ceylonese_bases_goal_name
	description = expand_ceylonese_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		422 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		422 = {
			air_base > 4
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 6
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 422
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Singapore
faction_goal_expand_singapore_naval_base = {
	name = expand_singapore_naval_base_goal_name
	description = expand_singapore_naval_base_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		1021 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		1021 = {
			air_base > 7
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 9
			}
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = coastal_bunker
				level > 3
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 1021
			}
			add_faction_initiative = 1
		}
		1021 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 2 # If convoys being threatened try to secure the supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = europe
						}
					}
					name = COLLECTION_FACTION_STATES_IN_EUROPE
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Manila
faction_goal_fortify_manila_bay = {
	name = fortify_manila_bay_goal_name
	description = fortify_manila_bay_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		327 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		custom_trigger_tooltip = {
			tooltip = fortify_manila_tooltip
			327 = {
				air_base > 7
				any_province_building_level = {
					province = {
						id = 10265
					}
					building = naval_base
					level > 6
				}
				any_province_building_level = {
					province = {
						id = 10265
					}
					building = coastal_bunker
					level > 1
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 327
			}
			add_faction_initiative = 1
		}
		327 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 10265
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 1
		modifier = {
			add = 1 # If naval power seek to protect it by expandin/fortifying bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Okinawa
faction_goal_fortify_okinawa = {
	name = fortify_okinawa_goal_name
	description = fortify_okinawa_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION

	allowed = {
		
	}
	visible = {
		526 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		custom_trigger_tooltip = {
			tooltip = fortify_okinawa_tooltip
			526 = {
				air_base > 4
				anti_air_building > 0
				any_province_building_level = {
					province = {
						id = 10265
					}
					building = coastal_bunker
					level > 1
				}
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 526
			}
			add_faction_initiative = 1
		}
		526 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 11932
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 0
	}
}

# Iwo Jima
faction_goal_fortify_iwo_jima = {
	name = fortify_iwo_jima_goal_name
	description = fortify_iwo_jima_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		645 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		645 = {
			air_base > 2
			anti_air_building > 0
			any_province_building_level = {
				province = {
					id = 10265
				}
				building = coastal_bunker
				level > 1
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 645
			}
			add_faction_initiative = 1
		}
		645 = {
			add_building_construction = {
				type = anti_air_building
				level = 1
				instant_build = yes
			}
			add_building_construction = {
				type = coastal_bunker
				level = 1
				province = 13025
				instant_build = yes
			}
		}
	}
	ai_will_do = {
		base = 0
	}
}

# Caroline Islands
faction_goal_expand_caroline_islands_bases = {
	name = expand_caroline_islands_bases_goal_name
	description = expand_caroline_islands_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		684 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		684 = {
			air_base > 4
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 7
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 684
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transpacific supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Guadalcanal
faction_goal_expand_guadalcanal_bases = {
	name = expand_guadalcanal_bases_goal_name
	description = expand_guadalcanal_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		634 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		634 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 3
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 634
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transpacific supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes
							OR = {
								is_on_continent = north_america
								is_on_continent = asia
							}
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA_OR_ASIA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = australia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_AUSTRALIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Wake Island
faction_goal_expand_wake_island_bases = {
	name = expand_wake_island_bases_goal_name
	description = control_wake_island_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		632 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		632 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 632
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transpacific supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}

# Midway Island
faction_goal_expand_midway_island_bases = {
	name = expand_midway_island_bases_goal_name
	description = expand_midway_island_bases_goal_desc
	category = short_term
	group = FOCUS_FILTER_CONSOLIDATION
	allowed = {
		
	}
	visible = {
		631 = { is_controlled_by_ROOT_or_ally = yes }
	}
	available = {

	}
	completed = {
		631 = {
			air_base > 1
			any_province_building_level = {
				province = {
					all_provinces = yes
				}
				building = naval_base
				level > 2
			}
		}
	}
	complete_effect = {
		add_faction_power_projection = 100
		custom_effect_tooltip = generic_skip_one_line_tt
		custom_effect_tooltip = TARGET_STATE_CONTROLLERS
		every_faction_member = { 
			visible_when_empty = yes
			limit = {
				controls_state = 631
			}
			add_faction_initiative = 1
		}
	}
	ai_will_do = {
		base = 0
		modifier = {
			add = 2 # If convoys being threatened try to secure the transpacific supply lines better
			convoy_threat > 0.5
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = north_america
						}
					}
					name = COLLECTION_FACTION_STATES_IN_NORTH_AMERICA
				}
				value > 0
			}
			collection_size = {
				input = {
					input = game:all_states
					operators = {
						limit = {
							is_controlled_by_ROOT_or_ally = yes 
							is_on_continent = asia
						}
					}
					name = COLLECTION_FACTION_STATES_IN_ASIA
				}
				value > 0
			}
		}
		modifier = {
			add = 1 # If naval power seek to project it by expanding bases
			has_navy_size = {
				size > 5
				type = capital_ship
			}
		}
	}
}