#######################################################################################
###		Electronic technologies
#######################################################################################

@PR_rockets = 900
@PR_radio = 1000
@PR_radar = 700
@PR_computing_machine = 900
@PR_fire_control_system = 900
@PR_nukes = 800
@PR_jet_engines = 850

EAI_PR_STRATEGIES_electronic_technologies = {

	EAI_PR_STRATEGIES_radio = yes
	EAI_PR_STRATEGIES_radar = yes
	EAI_PR_STRATEGIES_computing_machine = yes
	EAI_PR_STRATEGIES_fire_control_system = yes
	EAI_PR_STRATEGIES_nukes = yes
	EAI_PR_STRATEGIES_jet_engines = yes
	EAI_PR_STRATEGIES_rockets = yes
}

###

EAI_PR_STRATEGIES_radio = {

	if = { 
		limit = { 
			always = yes
		}

		set_temp_variable = { prio_cat = @PR_radio }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

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

		### radio

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

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

		### improved_radio

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

			OR = {
				has_war = yes
				date > 1939.1.1
			}
			subtract_from_temp_variable = { _prio_val = 200 }
			if = { limit = { date > 1940.1.1 } multiply_temp_variable = { _prio_val = 1.1 } }
			if = { limit = { date > 1942.1.1 } multiply_temp_variable = { _prio_val = 1.1 } }
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_radio

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

			date > 1941.1.1
			subtract_from_temp_variable = { _prio_val = 200 }
			if = { limit = { date > 1942.1.1 } multiply_temp_variable = { _prio_val = 1.1 } }
			if = { limit = { date > 1944.1.1 } multiply_temp_variable = { _prio_val = 1.1 } }
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_radar = {

	if = { 
		limit = { 
			amount_research_slots > 3
			date > 1940.1.1

			OR = {
				AND = {
					num_of_controlled_factories > 100
					check_variable = { num_deployed_planes > 2000 }
				}
				AND = {
					is_major = yes
					any_enemy_country = { is_major = yes }
				}
				AND = {
					OR = {
						EAI_air_to_ground_radar_MODULE_FOCUS = yes
						AND = { EAI_naval_radar_MODULE_FOCUS = yes check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } }
						EAI_radar_tech_focus = yes
					}
				}
			}
		}

		set_temp_variable = { prio_cat = @PR_radar }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

			if = {
				limit = {
					num_of_controlled_factories > 200
					check_variable = { num_deployed_planes > 2000 }
				}
			
				add_to_temp_variable = { prio_cat = 400 }
			}

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

		### cavity_magnatron

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

			date > 1939.1.1
			OR = {
				AND = {
					num_of_controlled_factories > 100
					check_variable = { num_deployed_planes > 2000 }
				}
				AND = {
					is_major = yes
					any_enemy_country = { is_major = yes }
				}
				AND = {
					OR = {
						EAI_air_to_ground_radar_MODULE_FOCUS = yes
						AND = { EAI_naval_radar_MODULE_FOCUS = yes check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } }
						EAI_radar_tech_focus = yes
					}
				}
			}
			if = { limit = { EAI_radar_tech_focus = yes } multiply_temp_variable = { _prio_val = 1.6 } }
				
		} 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
			OR = {
				AND = {
					num_of_controlled_factories > 100
					check_variable = { num_deployed_planes > 2000 }
				}
				AND = {
					is_major = yes
					any_enemy_country = { is_major = yes }
				}
				AND = {
					OR = {
						EAI_air_to_ground_radar_MODULE_FOCUS = yes
						AND = { EAI_naval_radar_MODULE_FOCUS = yes check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } }
						EAI_radar_tech_focus = yes
					}
				}
			}
			if = { limit = { EAI_radar_tech_focus = yes } multiply_temp_variable = { _prio_val = 1.6 } }
				
		} 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 > 1941.1.1
			OR = {
				EAI_air_to_ground_radar_MODULE_FOCUS = yes
				AND = { EAI_naval_radar_MODULE_FOCUS = yes check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } }
				EAI_radar_tech_focus = yes
			}
				
		} 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 > 1942.1.1
			OR = {
				EAI_air_to_ground_radar_MODULE_FOCUS = yes
				AND = { EAI_naval_radar_MODULE_FOCUS = yes check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } }
				EAI_radar_tech_focus = yes
			}
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_computing_machine = {

	if = { 
		limit = { 
			always = no
		}

		set_temp_variable = { prio_cat = @PR_computing_machine }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

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

		### electronic_mechanical_engineering

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

			date > 1936.1.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 > 1936.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 > 1940.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_computing_machine

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

			date > 1942.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_fire_control_system = {

	if = { 
		limit = { 
			EAI_fire_control_MODULE_FOCUS = yes
		}

		set_temp_variable = { prio_cat = @PR_fire_control_system }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

			set_temp_variable = { prio_factor = EAI_RESEARCH_naval_research_factor }
			add_to_temp_variable = { prio_factor = 0.5 }
			multiply_temp_variable = { prio_cat = prio_factor }

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

		### electronic_mechanical_engineering

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

			date > 1936.1.1
			set_temp_variable = { _prio_val = @PR_fire_control_system }
				
		} 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
			set_temp_variable = { _prio_val = @PR_fire_control_system }
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### basic_fire_control_system

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

			NOT = { has_tech = improved_fire_control_system can_research = improved_fire_control_system is_researching_technology = improved_fire_control_system }
			set_temp_variable = { _prio_val = @PR_fire_control_system }
				
		} 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 > 1940.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_fire_control_system

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

			date > 1938.1.1
			NOT = { has_tech = advanced_fire_control_system can_research = advanced_fire_control_system is_researching_technology = advanced_fire_control_system }
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_computing_machine

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

			date > 1942.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_fire_control_system

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

			date > 1940.1.1
			always = yes
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_nukes = {

	if = { 
		limit = { 
			EAI_nuclear_tech_focus = yes
		}

		set_temp_variable = { prio_cat = @PR_nukes }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

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

		### Strategies

		if = { limit = { tag = USA }
		
			add_to_temp_variable = { prio_cat = 500 }
		}

		### atomic_research

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

			date > 1940.1.1 
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_jet_engines = {

	if = { 
		limit = { 
			EAI_wants_to_build_aircraft = yes
			is_major = yes
		}

		set_temp_variable = { prio_cat = @PR_jet_engines }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

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

		### experimental_rockets

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

			date > 1944.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### rocket_engines

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

			date > 1944.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### jet_engines

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

			date > 1945.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_rockets = {

	if = { 
		limit = { 
			EAI_SP_rockets_ballistic_missile_focus = yes
		}

		set_temp_variable = { prio_cat = @PR_rockets }

		############################
		# Strategies
		############################

			# if = { limit = { tag = SOV }
			# 	if = {
			# 		limit = {
			# 			always = yes
			# 		}
				
			# 		multiply_temp_variable = { prio_cat = 1 }
			# 	}
			# }

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

		### experimental_rockets

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

			date > 1942.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### sp_rockets_rocket_bomber

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

			date > 1944.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### sp_rockets_improved_rocket_bomber

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

			date > 1945.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}