############################################################################################################
#	Expert AI mod
############################################################################################################

@PR_TOP_PRIORITY = 3000

@PR_RESOURCE_EXTRACTION = 900
@PR_RUBBER_PRODUCTION = 900
@PR_DEVELOP_RADAR = 600
@PR_INVASION_CAPACITY = 700
@PR_ANTI_MINE = 600

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

EAI_priority_research_strategies = {

	EAI_PR_STRATEGIES_startup = yes

	###

	EAI_PR_STRATEGIES_country_specific = yes

	###

	EAI_PR_STRATEGIES_strong_infantry = yes

	###

	EAI_PR_STRATEGIES_industry_technologies = yes
	EAI_PR_STRATEGIES_electronic_technologies = yes
	EAI_PR_STRATEGIES_infantry_technologies = yes
	EAI_PR_STRATEGIES_support_technologies = yes
	EAI_PR_STRATEGIES_artillery_technologies = yes
	EAI_PR_STRATEGIES_armor_technologies = yes
	EAI_PR_STRATEGIES_aircraft_technologies = yes
	EAI_PR_STRATEGIES_navy_technologies = yes
}

#######################################################################################
###		Startup research queue
#######################################################################################

EAI_PR_STRATEGIES_startup = {

	if = { 
		limit = { 
			NOT = { has_country_flag = EAI_PR_STRATEGIES_startup }
		}

		set_country_flag = EAI_PR_STRATEGIES_startup
		
		set_temp_variable = { prio_max = @PR_TOP_PRIORITY }

		###

		add_to_temp_array = { force_queue = token:construction1 }
		add_to_temp_array = { force_queue = token:construction2 }
		add_to_temp_array = { force_queue = token:basic_machine_tools }
		add_to_temp_array = { force_queue = token:electronic_mechanical_engineering }
		if = { limit = { EAI_concentrated_industry_tech_focus = yes } add_to_temp_array = { force_queue = token:concentrated_industry } }
		if = { limit = { EAI_dispersed_industry_tech_focus = yes } add_to_temp_array = { force_queue = token:dispersed_industry } }
		add_to_temp_array = { force_queue = token:mechanical_computing }
		add_to_temp_array = { force_queue = token:gw_artillery }
		add_to_temp_array = { force_queue = token:interwar_antiair }
		add_to_temp_array = { force_queue = token:interwar_antitank }

		###

		for_each_loop = { array = force_queue
		
			if = { limit = { set_temp_variable = { _prio_tech = v } set_temp_variable = { _prio_val = prio_max }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }

			subtract_from_temp_variable = { prio_max = 1 }
		}

		clear_temp_array = force_queue
	}
}

#######################################################################################
###		Generic strategies
#######################################################################################

EAI_PR_STRATEGIES_strong_infantry = {

	if = {
		limit = {
			OR = {
				has_war = yes

				date > 1937.1.1
			}

			OR = {

				AND = {
					tag = FIN
				}

				AND = {
					tag = CHI
				}
			}
		}
	
		#########################################################
		### Infantry techs
		#########################################################
	
		if = {
			limit = { 
				always = yes
			}
	
			set_temp_variable = { prio_cat = 990 }

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

			### radio

			if = { limit = { set_temp_variable = { _prio_tech = token:radio } set_temp_variable = { _prio_val = prio_cat }

				date > 1937.1.1
					
			} EAI_PR_add_to_priority_research_queue = yes }

			######
			######
			######
	
			### infantry_weapons
	
			if = { limit = { set_temp_variable = { _prio_tech = token:infantry_weapons } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### infantry_weapons1
	
			if = { limit = { set_temp_variable = { _prio_tech = token:infantry_weapons1 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### infantry_weapons2
	
			if = { limit = { set_temp_variable = { _prio_tech = token:infantry_weapons2 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### improved_infantry_weapons
	
			if = { limit = { set_temp_variable = { _prio_tech = token:improved_infantry_weapons } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1938.1.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### improved_infantry_weapons_2
	
			if = { limit = { set_temp_variable = { _prio_tech = token:improved_infantry_weapons_2 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1939.1.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			######
			######
			######
	
			### support_weapons
	
			if = { limit = { set_temp_variable = { _prio_tech = token:support_weapons } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### support_weapons2
	
			if = { limit = { set_temp_variable = { _prio_tech = token:support_weapons2 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### support_weapons3
	
			if = { limit = { set_temp_variable = { _prio_tech = token:support_weapons3 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1939.1.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			######
			######
			######

			### tech_support
	
			if = { limit = { set_temp_variable = { _prio_tech = token:tech_support } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.1.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### tech_engineers
	
			if = { limit = { set_temp_variable = { _prio_tech = token:tech_engineers } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### tech_engineers2
	
			if = { limit = { set_temp_variable = { _prio_tech = token:tech_engineers2 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1938.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			######
			######
			######
	
			### gw_artillery
	
			if = { limit = { set_temp_variable = { _prio_tech = token:gw_artillery } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### interwar_artillery
	
			if = { limit = { set_temp_variable = { _prio_tech = token:interwar_artillery } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1937.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### artillery1
	
			if = { limit = { set_temp_variable = { _prio_tech = token:artillery1 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1938.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
	
			### artillery2
	
			if = { limit = { set_temp_variable = { _prio_tech = token:artillery2 } set_temp_variable = { _prio_val = prio_cat }
	
				date > 1939.6.1
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}
	}
}

#######################################################################################
###		Country specific strategies
#######################################################################################

EAI_PR_STRATEGIES_country_specific = {

	if = { limit = { tag = ENG } EAI_PR_STRATEGIES_ENG = yes }
	if = { limit = { tag = USA } EAI_PR_STRATEGIES_USA = yes }
	if = { limit = { tag = FRA } EAI_PR_STRATEGIES_FRA = yes }

	if = { limit = { tag = GER } EAI_PR_STRATEGIES_GER = yes }
	if = { limit = { tag = ITA } EAI_PR_STRATEGIES_ITA = yes }
	if = { limit = { tag = JAP } EAI_PR_STRATEGIES_JAP = yes }

	if = { limit = { tag = SOV } EAI_PR_STRATEGIES_SOV = yes } 
}

EAI_PR_STRATEGIES_ENG = {

	#########################################################
	### ENG - rush fighters
	#########################################################

	if = {
		limit = { 
			OR = {
				EAI_FTR_tech_focus = yes
				EAI_HFTR_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### improved_small_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_small_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
			EAI_FTR_tech_focus = yes
			has_completed_focus = fighter_command_focus
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_small_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:advanced_small_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1943.1.1
			EAI_FTR_tech_focus = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### improved_medium_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
			EAI_HFTR_tech_focus = yes
			has_completed_focus = fighter_command_focus

				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_medium_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:advanced_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1943.1.1
			EAI_HFTR_tech_focus = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### engines_1

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_1 } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### engines_2

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_2 } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### engines_3

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_3 } set_temp_variable = { _prio_val = prio_cat }

			OR = { 
				has_tech = improved_small_airframe is_researching_technology = improved_small_airframe 
				has_tech = improved_medium_airframe is_researching_technology = improved_medium_airframe 
			}
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### engines_4

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_4 } set_temp_variable = { _prio_val = prio_cat }

			OR = { 
				has_tech = advanced_medium_airframe is_researching_technology = advanced_medium_airframe 
			}
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### ENG - make sure ASW ships are up to date
	#########################################################

	if = { 
		limit = { 
			OR = {
				EAI_ASW_DD_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### early_ship_hull_light

		if = { limit = { set_temp_variable = { _prio_tech = token:early_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_ship_hull_light

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_ship_hull_light

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_ship_hull_light

		if = { limit = { set_temp_variable = { _prio_tech = token:advanced_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

			date > 1943.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	if = { 
		limit = { 
			OR = {
				EAI_ASW_CL_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### early_ship_hull_cruiser

		if = { limit = { set_temp_variable = { _prio_tech = token:early_ship_hull_cruiser } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_ship_hull_cruiser

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_ship_hull_cruiser } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_ship_hull_cruiser

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_ship_hull_cruiser } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_ship_hull_cruiser

		if = { limit = { set_temp_variable = { _prio_tech = token:advanced_ship_hull_cruiser } set_temp_variable = { _prio_val = prio_cat }

			date > 1943.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	if = { 
		limit = { 
			OR = {
				EAI_ASW_DD_tech_focus = yes
				EAI_ASW_CL_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### sonar

		if = { limit = { set_temp_variable = { _prio_tech = token:sonar } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_sonar

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_sonar } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	if = { 
		limit = { 
			OR = {
				EAI_ASW_DD_tech_focus = yes
				EAI_ASW_CL_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### basic_depth_charges

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_depth_charges } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_depth_charges

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_depth_charges } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	if = { 
		limit = { 
			EAI_light_battery_MODULE_FOCUS = yes
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### basic_battery

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_battery } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_light_battery

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_light_battery } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_light_shell

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_light_shell } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_light_battery

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_light_battery } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	# if = { 
	# 	limit = { 
	# 		OR = {
	# 			EAI_ASW_CL_tech_focus = yes
	# 		}
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

	# 	### improved_airplane_launcher

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_airplane_launcher } set_temp_variable = { _prio_val = prio_cat }

	# 		OR = {
	# 			AND = {
	# 				date > 1936.6.1
	# 				EAI_ASW_CL_tech_focus = yes
	# 			}
	# 		}
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }
}

EAI_PR_STRATEGIES_USA = {

	#########################################################
	### USA - focus on strategic bombers
	#########################################################

	if = {
		limit = { 
			EAI_STR_military_focus = yes
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### iw_large_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:iw_large_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_large_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_large_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_large_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_large_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### engines_3

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_3 } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### early_bombs

		if = { limit = { set_temp_variable = { _prio_tech = token:early_bombs } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### survivability_studies

		if = { limit = { set_temp_variable = { _prio_tech = token:survivability_studies } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### radio

		if = { limit = { set_temp_variable = { _prio_tech = token:radio } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### radio_detection

		if = { limit = { set_temp_variable = { _prio_tech = token:radio_detection } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### cavity_magnatron

		if = { limit = { set_temp_variable = { _prio_tech = token:cavity_magnatron } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### centimetric_radar

		if = { limit = { set_temp_variable = { _prio_tech = token:centimetric_radar } set_temp_variable = { _prio_val = prio_cat }

			date > 1940.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### phased_array

		if = { limit = { set_temp_variable = { _prio_tech = token:phased_array } set_temp_variable = { _prio_val = prio_cat }

			date > 1940.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### monopulse_radar

		if = { limit = { set_temp_variable = { _prio_tech = token:monopulse_radar } set_temp_variable = { _prio_val = prio_cat }

			date > 1941.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### mechanical_computing

		if = { limit = { set_temp_variable = { _prio_tech = token:mechanical_computing } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### computing_machine

		if = { limit = { set_temp_variable = { _prio_tech = token:computing_machine } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_computing_machine

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_computing_machine } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

		### Rush Improved tanks

	if = {
		limit = {
			EAI_MARM_tech_focus = yes
			NOT = { has_tech = improved_medium_tank_chassis is_researching_technology = improved_medium_tank_chassis }
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

			date > 1940.1.1
			
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	### Rush Ambibious drive

	if = {
		limit = {
			EAI_amphibious_tech_focus = yes
			NOT = { has_tech = amphibious_tank_chassis is_researching_technology = amphibious_tank_chassis }
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		if = { limit = { set_temp_variable = { _prio_tech = token:amphibious_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

			multiply_temp_variable = { _prio_val = 10 }
			date > 1939.6.1
			
		} EAI_PR_add_to_priority_research_queue = yes }
	}
	if = {
		limit = {
			EAI_amphibious_tech_focus = yes
			has_tech = amphibious_tank_chassis
			NOT = { has_tech = amphibious_drive is_researching_technology = amphibious_drive }
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		if = { limit = { set_temp_variable = { _prio_tech = token:amphibious_drive } set_temp_variable = { _prio_val = prio_cat }
			multiply_temp_variable = { _prio_val = 10 }
			date > 1940.6.1
			
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	### Rush AMTRAC

	if = {
		limit = {
			EAI_amtrac_tech_focus = yes
			NOT = { has_tech = amphibious_mechanized_infantry is_researching_technology = amphibious_mechanized_infantry }
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		if = { limit = { set_temp_variable = { _prio_tech = token:amphibious_mechanized_infantry } set_temp_variable = { _prio_val = prio_cat }
			multiply_temp_variable = { _prio_val = 10 }
			date > 1940.6.1
			
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_FRA = {

}

EAI_PR_STRATEGIES_GER = {

	#########################################################
	### GER - radio for focus
	#########################################################

	if = {
		limit = {
			date > 1938.1.1
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### radio

		if = { limit = { set_temp_variable = { _prio_tech = token:radio } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### GER - rubber+oil techs for focus
	#########################################################

	if = {
		limit = {
			date > 1939.1.1
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### rubber_processing

		if = { limit = { set_temp_variable = { _prio_tech = token:rubber_processing } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_rubber_processing

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_rubber_processing } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### oil_processing

		if = { limit = { set_temp_variable = { _prio_tech = token:oil_processing } set_temp_variable = { _prio_val = prio_cat }

			has_tech = improved_rubber_processing
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### GER - construction tech rush
	#########################################################

	if = {
		limit = {
			OR = {
				AND = {
					has_completed_focus = GER_the_four_year_plan
					NOT = { has_tech = construction2 is_researching_technology = construction2 }
				}
				AND = {
					has_completed_focus = GER_autarky_efforts
					NOT = { has_tech = construction3 is_researching_technology = construction3 }
				}
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 2 }

		###

		add_to_array = { EAI_priority_research_block_techs = token:dispersed_industry }
		add_to_array = { EAI_priority_research_block_techs = token:concentrated_industry }
		add_to_array = { EAI_priority_research_block_techs = token:improved_machine_tools }
		add_to_array = { EAI_priority_research_block_techs = token:excavation1 }
		add_to_array = { EAI_priority_research_block_techs = token:excavation2 }

		### construction1

		if = { limit = { set_temp_variable = { _prio_tech = token:construction1 } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction2

		if = { limit = { set_temp_variable = { _prio_tech = token:construction2 } set_temp_variable = { _prio_val = prio_cat }

			has_completed_focus = GER_the_four_year_plan
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction3

		if = { limit = { set_temp_variable = { _prio_tech = token:construction3 } set_temp_variable = { _prio_val = prio_cat }

			has_completed_focus = GER_autarky_efforts
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### GER - focus on submarines
	#########################################################
	
	if = {
		limit = { 
			EAI_SS_tech_focus = yes
			check_variable = { EAI_FOCUS/NAVY/naval_doctrine = global.EAI_TI_DOCTRINE }
		}

		set_temp_variable = { prio_cat = 900 }

		### early_ship_hull_submarine

		if = { limit = { set_temp_variable = { _prio_tech = token:early_ship_hull_submarine } set_temp_variable = { _prio_val = prio_cat }

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_ship_hull_submarine

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_ship_hull_submarine } set_temp_variable = { _prio_val = prio_cat }

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_ship_hull_submarine

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_ship_hull_submarine } set_temp_variable = { _prio_val = prio_cat }

			date > 1940.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### basic_submarine_snorkel

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_submarine_snorkel } set_temp_variable = { _prio_val = prio_cat }

			date > 1940.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### GER - rush armor
	#########################################################

	if = {
		limit = {
			date > 1937.10.1
			OR = {
				EAI_LARM_tech_focus = yes
				EAI_MARM_tech_focus = yes
				EAI_HARM_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 2 }

		###

		if = {
			limit = {
				EAI_LARM_tech_focus = yes
				NOT = { has_tech = advanced_light_tank_chassis is_researching_technology = advanced_light_tank_chassis }
			}

			### improved_light_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_light_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### advanced_light_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:advanced_light_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					has_completed_focus = GER_advanced_panzer_research
					date > 1939.8.1
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}

		if = {
			limit = {
				EAI_MARM_tech_focus = yes
				NOT = { has_tech = improved_medium_tank_chassis is_researching_technology = improved_medium_tank_chassis }
			}

			### basic_medium_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:basic_medium_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### improved_medium_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					has_completed_focus = GER_advanced_panzer_research
					date > 1939.8.1
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}

		if = {
			limit = {
				EAI_HARM_tech_focus = yes
				NOT = { has_tech = improved_heavy_tank_chassis is_researching_technology = improved_heavy_tank_chassis }
			}

			### basic_heavy_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:basic_heavy_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### improved_heavy_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_heavy_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					has_completed_focus = GER_advanced_panzer_research
					date > 1939.8.1
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}
	}

	if = {
		limit = {
			OR = {
				EAI_LARM_tech_focus = yes
				EAI_MARM_tech_focus = yes
				EAI_HARM_tech_focus = yes
			}
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### interwar_antitank

		if = { limit = { set_temp_variable = { _prio_tech = token:interwar_antitank } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### antitank1

		if = { limit = { set_temp_variable = { _prio_tech = token:antitank1 } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_maintenance_company

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_maintenance_company } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_maintenance_company2

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_maintenance_company2 } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
			subtract_from_temp_variable = { _prio_val = 2200 }
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_engineers

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_engineers } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_engineers2

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_engineers2 } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
			subtract_from_temp_variable = { _prio_val = 2200 }
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### GER - fighter
	#########################################################

	if = {
		limit = {
			has_completed_focus = GER_aeronautical_research_institute
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 2 }

		### improved_small_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_small_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_ITA = {

	#########################################################
	### ITA - ITA_air_innovations_bba
	#########################################################

	if = {
		limit = {
			EAI_FTR_tech_focus = yes
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 1 }

		### basic_small_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:basic_small_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.6.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_small_airframe

		if = { limit = { set_temp_variable = { _prio_tech = token:improved_small_airframe } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
			has_completed_focus = ITA_air_innovations_bba
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### engines_3

		if = { limit = { set_temp_variable = { _prio_tech = token:engines_3 } set_temp_variable = { _prio_val = prio_cat }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_JAP = {

	#########################################################
	### JAP - Resource techs to unlock decisions
	#########################################################

	if = {
		limit = {
			date > 1940.1.1
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		subtract_from_temp_variable = { prio_cat = 1 }

		### excavation1

		if = { limit = { set_temp_variable = { _prio_tech = token:excavation1 } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### excavation2

		if = { limit = { set_temp_variable = { _prio_tech = token:excavation2 } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### excavation3

		if = { limit = { set_temp_variable = { _prio_tech = token:excavation3 } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### JAP - Prep for early war
	#########################################################

	if = {
		limit = {
			date > 1936.10.1
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 1 }

		### support_weapons

		if = { limit = { set_temp_variable = { _prio_tech = token:support_weapons } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### radio

		if = { limit = { set_temp_variable = { _prio_tech = token:radio } set_temp_variable = { _prio_val = prio_cat }

			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }

		# ### tech_logistics_company

		# if = { limit = { set_temp_variable = { _prio_tech = token:tech_logistics_company } set_temp_variable = { _prio_val = prio_cat }

		# 	always = yes
				
		# } EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### JAP - JAP_bypass_the_philippines
	#########################################################

	# if = {
	# 	limit = {
	# 		NOT = { has_tech = mtg_tank_landing_craft is_researching_technology = mtg_tank_landing_craft }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### mtg_landing_craft

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:mtg_landing_craft } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1940.1.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### mtg_tank_landing_craft

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:mtg_tank_landing_craft } set_temp_variable = { _prio_val = prio_cat }

	# 		has_completed_focus = JAP_bypass_the_philippines
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }

	#########################################################
	### JAP - JAP_small_arms_modernization
	#########################################################

	# if = {
	# 	limit = {
	# 		has_completed_focus = JAP_small_arms_modernization
	# 		NOT = { has_country_flag = JAP_small_arms_modernization_used }
	# 	}

	# 	set_country_flag = JAP_small_arms_modernization_used

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	###

	# 	set_temp_variable = { next_tech = 0 }
	# 	clear_temp_array = find_latest_tech
	# 	add_to_temp_array = { find_latest_tech = token:infantry_weapons }
	# 	add_to_temp_array = { find_latest_tech = token:infantry_weapons1 }
	# 	add_to_temp_array = { find_latest_tech = token:infantry_weapons2 }
	# 	add_to_temp_array = { find_latest_tech = token:improved_infantry_weapons }
	# 	add_to_temp_array = { find_latest_tech = token:improved_infantry_weapons_2 }
	# 	add_to_temp_array = { find_latest_tech = token:advanced_infantry_weapons }
	# 	add_to_temp_array = { find_latest_tech = token:advanced_infantry_weapons2 }
	# 	for_each_loop = { array = find_latest_tech
	# 		if = { limit = { NOT = { has_tech = var:v is_researching_technology = var:v } }
	# 			set_temp_variable = { next_tech = v }
	# 			set_temp_variable = { break = 1 }
	# 		}
	# 	}

	# 	if = { limit = { NOT = { check_variable = { next_tech = 0 } } }

	# 		### next_tech

	# 		if = { limit = { set_temp_variable = { _prio_tech = next_tech } set_temp_variable = { _prio_val = prio_cat }

	# 			always = yes
					
	# 		} EAI_PR_add_to_priority_research_queue = yes }
	# 	}
	# }

	#########################################################
	### JAP - JAP_modern_artillery
	#########################################################

	# if = {
	# 	limit = {
	# 		has_completed_focus = JAP_modern_artillery
	# 		NOT = { has_country_flag = JAP_modern_artillery_used }
	# 	}

	# 	set_country_flag = JAP_modern_artillery_used

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	###

	# 	set_temp_variable = { next_tech = 0 }
	# 	clear_temp_array = find_latest_tech
	# 	add_to_temp_array = { find_latest_tech = token:gw_artillery }
	# 	add_to_temp_array = { find_latest_tech = token:interwar_artillery }
	# 	add_to_temp_array = { find_latest_tech = token:artillery1 }
	# 	add_to_temp_array = { find_latest_tech = token:artillery2 }
	# 	add_to_temp_array = { find_latest_tech = token:artillery3 }
	# 	add_to_temp_array = { find_latest_tech = token:artillery4 }
	# 	add_to_temp_array = { find_latest_tech = token:artillery5 }
	# 	for_each_loop = { array = find_latest_tech
	# 		if = { limit = { NOT = { has_tech = var:v is_researching_technology = var:v } }
	# 			set_temp_variable = { next_tech = v }
	# 			set_temp_variable = { break = 1 }
	# 		}
	# 	}

	# 	if = { limit = { NOT = { check_variable = { next_tech = 0 } } }

	# 		### next_tech

	# 		if = { limit = { set_temp_variable = { _prio_tech = next_tech } set_temp_variable = { _prio_val = prio_cat }

	# 			always = yes
					
	# 		} EAI_PR_add_to_priority_research_queue = yes }
	# 	}
	# }

	#########################################################
	### JAP - JAP_armored_divisions
	#########################################################

	# if = {
	# 	limit = {
	# 		has_completed_focus = JAP_armored_divisions
	# 		NOT = { has_country_flag = JAP_armored_divisions_used }
	# 	}

	# 	set_country_flag = JAP_armored_divisions_used

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	###

	# 	if = { limit = { EAI_LARM_tech_focus = yes }

	# 		set_temp_variable = { next_tech = 0 }
	# 		clear_temp_array = find_latest_tech
	# 		add_to_temp_array = { find_latest_tech = token:gwtank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:basic_light_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:improved_light_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:advanced_light_tank_chassis }
	# 		for_each_loop = { array = find_latest_tech
	# 			if = { limit = { NOT = { has_tech = var:v is_researching_technology = var:v } }
	# 				set_temp_variable = { next_tech = v }
	# 				set_temp_variable = { break = 1 }
	# 			}
	# 		}
	# 	}

	# 	if = { limit = { EAI_MARM_tech_focus = yes }

	# 		set_temp_variable = { next_tech = 0 }
	# 		clear_temp_array = find_latest_tech
	# 		add_to_temp_array = { find_latest_tech = token:gwtank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:basic_medium_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:improved_medium_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:advanced_medium_tank_chassis }
	# 		for_each_loop = { array = find_latest_tech
	# 			if = { limit = { NOT = { has_tech = var:v is_researching_technology = var:v } }
	# 				set_temp_variable = { next_tech = v }
	# 				set_temp_variable = { break = 1 }
	# 			}
	# 		}
	# 	}

	# 	if = { limit = { EAI_HARM_tech_focus = yes }

	# 		set_temp_variable = { next_tech = 0 }
	# 		clear_temp_array = find_latest_tech
	# 		add_to_temp_array = { find_latest_tech = token:gwtank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:basic_heavy_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:improved_heavy_tank_chassis }
	# 		add_to_temp_array = { find_latest_tech = token:advanced_heavy_tank_chassis }
	# 		for_each_loop = { array = find_latest_tech
	# 			if = { limit = { NOT = { has_tech = var:v is_researching_technology = var:v } }
	# 				set_temp_variable = { next_tech = v }
	# 				set_temp_variable = { break = 1 }
	# 			}
	# 		}
	# 	}

	# 	if = { limit = { NOT = { check_variable = { next_tech = 0 } } }

	# 		### next_tech

	# 		if = { limit = { set_temp_variable = { _prio_tech = next_tech } set_temp_variable = { _prio_val = prio_cat }

	# 			always = yes
					
	# 		} EAI_PR_add_to_priority_research_queue = yes }
	# 	}
	# }

	#########################################################
	### JAP - JAP_fighter_modernization
	#########################################################

	# if = {
	# 	limit = {
	# 		EAI_FTR_military_focus = yes
	# 		NOT = { has_tech = improved_small_airframe is_researching_technology = improved_small_airframe }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### basic_small_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:basic_small_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1936.6.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### improved_small_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_small_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1938.1.1
	# 		has_completed_focus = JAP_fighter_modernization
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

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

	# 	### engines_3

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:engines_3 } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1939.1.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }

	# if = {
	# 	limit = {
	# 		EAI_HFTR_military_focus = yes
	# 		NOT = { has_tech = improved_medium_airframe is_researching_technology = improved_medium_airframe }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### basic_medium_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:basic_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1936.6.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### improved_medium_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1938.1.1
	# 		has_completed_focus = JAP_fighter_modernization
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

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

	# 	### engines_3

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:engines_3 } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1939.1.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }

	#########################################################
	### JAP - JAP_bomber_modernization
	#########################################################

	# if = {
	# 	limit = {
	# 		EAI_CAS_military_focus = yes
	# 		NOT = { has_tech = improved_small_airframe is_researching_technology = improved_small_airframe }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### basic_small_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:basic_small_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1936.6.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### improved_small_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_small_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1939.1.1
	# 		has_completed_focus = JAP_bomber_modernization
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }

	# if = {
	# 	limit = {
	# 		EAI_TAC_military_focus = yes
	# 		NOT = { has_tech = improved_medium_airframe is_researching_technology = improved_medium_airframe }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### basic_medium_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:basic_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1936.6.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### improved_medium_airframe

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_airframe } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1939.1.1
	# 		has_completed_focus = JAP_bomber_modernization
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }

	#########################################################
	### JAP - JAP_modern_escorts
	#########################################################

	# if = {
	# 	limit = {
	# 		EAI_DD_tech_focus = yes
	# 		NOT = { has_tech = improved_ship_hull_light is_researching_technology = improved_ship_hull_light }
	# 	}

	# 	set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
	# 	multiply_temp_variable = { prio_cat = 1 }

	# 	### basic_ship_hull_light

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:basic_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1936.6.1
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }

	# 	### improved_ship_hull_light

	# 	if = { limit = { set_temp_variable = { _prio_tech = token:improved_ship_hull_light } set_temp_variable = { _prio_val = prio_cat }

	# 		date > 1939.1.1
	# 		has_completed_focus = JAP_modern_escorts
				
	# 	} EAI_PR_add_to_priority_research_queue = yes }
	# }
}

EAI_PR_STRATEGIES_SOV = {

	#########################################################
	### SOV - focus on armor
	#########################################################

	if = {
		limit = {
			OR = {
				EAI_LARM_tech_focus = yes
				EAI_MARM_tech_focus = yes
				EAI_HARM_tech_focus = yes
			}

			### Strategies

				EAI_STRATEGY_CHL_mass_infantry_prioritize_tanks = yes

			###
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 2 }

		###

		if = {
			limit = {
				EAI_LARM_tech_focus = yes
				NOT = { has_tech = advanced_light_tank_chassis is_researching_technology = advanced_light_tank_chassis }
			}

			if = { limit = { has_opinion_modifier = sov_ger_treaty }
			
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_2 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_2 }
			}

			### improved_light_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_light_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1938.1.1
					has_war = yes
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### advanced_light_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:advanced_light_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1940.6.1
					has_opinion_modifier = sov_ger_treaty
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}

		if = {
			limit = {
				EAI_MARM_tech_focus = yes
				NOT = { has_tech = improved_medium_tank_chassis is_researching_technology = improved_medium_tank_chassis }
			}

			if = { limit = { has_opinion_modifier = sov_ger_treaty }
			
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_2 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_2 }
			}

			### basic_medium_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:basic_medium_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1938.1.1
					has_war = yes
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### improved_medium_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_medium_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1938.6.1
					has_opinion_modifier = sov_ger_treaty
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}

		if = {
			limit = {
				EAI_HARM_tech_focus = yes
				NOT = { has_tech = improved_heavy_tank_chassis is_researching_technology = improved_heavy_tank_chassis }
			}

			if = { limit = { has_opinion_modifier = sov_ger_treaty }
			
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:armor_tech_2 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_1 }
				add_to_array = { EAI_priority_research_block_techs = token:engine_tech_2 }
			}

			### basic_heavy_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:basic_heavy_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1938.1.1
					has_war = yes
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### improved_heavy_tank_chassis

			if = { limit = { set_temp_variable = { _prio_tech = token:improved_heavy_tank_chassis } set_temp_variable = { _prio_val = prio_cat }

				OR = {
					date > 1938.6.1
					has_opinion_modifier = sov_ger_treaty
				}
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}
	}

	if = {
		limit = {
			OR = {
				EAI_LARM_tech_focus = yes
				EAI_MARM_tech_focus = yes
				EAI_HARM_tech_focus = yes
			}

			### Strategies

				EAI_STRATEGY_CHL_mass_infantry_prioritize_tanks = yes

			###
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }

		### interwar_antitank

		if = { limit = { set_temp_variable = { _prio_tech = token:interwar_antitank } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### antitank1

		if = { limit = { set_temp_variable = { _prio_tech = token:antitank1 } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_maintenance_company

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_maintenance_company } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### tech_engineers

		if = { limit = { set_temp_variable = { _prio_tech = token:tech_engineers } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}

	#########################################################
	### SOV - rush industry
	#########################################################

	if = {
		limit = {
			EAI_dispersed_industry_tech_focus = yes
		}

		set_temp_variable = { prio_cat = @PR_TOP_PRIORITY }
		multiply_temp_variable = { prio_cat = 3 }

		### construction1

		if = { limit = { set_temp_variable = { _prio_tech = token:construction1 } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction2

		if = { limit = { set_temp_variable = { _prio_tech = token:construction2 } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction3

		if = { limit = { set_temp_variable = { _prio_tech = token:construction3 } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.3.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		### dispersed_industry

		if = { limit = { set_temp_variable = { _prio_tech = token:dispersed_industry } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### dispersed_industry2

		if = { limit = { set_temp_variable = { _prio_tech = token:dispersed_industry2 } set_temp_variable = { _prio_val = prio_cat }

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### dispersed_industry3

		if = { limit = { set_temp_variable = { _prio_tech = token:dispersed_industry3 } set_temp_variable = { _prio_val = prio_cat }

			date > 1938.3.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

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

		if = {
			limit = {
				has_completed_focus = SOV_reorganize_the_pc_of_heavy_industry
				NOT = { has_tech = construction4 is_researching_technology = construction4 }
				NOT = { has_tech = dispersed_industry4 is_researching_technology = dispersed_industry4 }
			}

			###

			add_to_array = { EAI_priority_research_block_techs = token:excavation1 }
			add_to_array = { EAI_priority_research_block_techs = token:excavation2 }
			add_to_array = { EAI_priority_research_block_techs = token:excavation3 }
			add_to_array = { EAI_priority_research_block_techs = token:excavation4 }
			add_to_array = { EAI_priority_research_block_techs = token:advanced_machine_tools }
			add_to_array = { EAI_priority_research_block_techs = token:computing_machine }
			add_to_array = { EAI_priority_research_block_techs = token:radio }
			add_to_array = { EAI_priority_research_block_techs = token:radio_detection }
			add_to_array = { EAI_priority_research_block_techs = token:basic_fire_control_system }
			add_to_array = { EAI_priority_research_block_techs = token:improved_fire_control_system }
			add_to_array = { EAI_priority_research_block_techs = token:fuel_refining }
			add_to_array = { EAI_priority_research_block_techs = token:fuel_refining2 }
			add_to_array = { EAI_priority_research_block_techs = token:rubber_processing }
			add_to_array = { EAI_priority_research_block_techs = token:improved_rubber_processing }
			add_to_array = { EAI_priority_research_block_techs = token:oil_processing }
			add_to_array = { EAI_priority_research_block_techs = token:improved_oil_processing }

			### construction4

			if = { limit = { set_temp_variable = { _prio_tech = token:construction4 } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }

			### dispersed_industry4

			if = { limit = { set_temp_variable = { _prio_tech = token:dispersed_industry4 } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}

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

		if = {
			limit = {
				has_completed_focus = SOV_industrial_modernization
				NOT = { has_tech = dispersed_industry5 is_researching_technology = dispersed_industry5 }
			}

			###

			add_to_array = { EAI_priority_research_block_techs = token:construction5 }

			### dispersed_industry5

			if = { limit = { set_temp_variable = { _prio_tech = token:dispersed_industry5 } set_temp_variable = { _prio_val = prio_cat }

				always = yes
					
			} EAI_PR_add_to_priority_research_queue = yes }
		}
	}
}