#######################################################################################
###		Industry technologies
#######################################################################################

@PR_machine_tools = 1000
@PR_concentrated_industry = 1000
@PR_dispersed_industry = 1000
@PR_fuel_silos = 500
@PR_fuel_refining = 900
@PR_synth_oil_experiments = 900
@PR_oil_processing = 500
@PR_rubber_processing = 900
@PR_construction = 1000
@PR_excavation = 950
@PR_energy_gain = 1200

EAI_PR_STRATEGIES_industry_technologies = {

	EAI_PR_STRATEGIES_machine_tools = yes
	EAI_PR_STRATEGIES_concentrated_industry = yes
	EAI_PR_STRATEGIES_dispersed_industry = yes
	EAI_PR_STRATEGIES_fuel_silos = yes
	EAI_PR_STRATEGIES_fuel_refining = yes
	EAI_PR_STRATEGIES_synth_oil_experiments = yes
	EAI_PR_STRATEGIES_oil_processing = yes
	EAI_PR_STRATEGIES_rubber_processing = yes
	EAI_PR_STRATEGIES_construction = yes
	EAI_PR_STRATEGIES_excavation = yes
	EAI_PR_STRATEGIES_energy_gain = yes
}

###

EAI_PR_STRATEGIES_machine_tools = {

	if = { 
		limit = { 
			always = yes
		}

		set_temp_variable = { prio_cat = @PR_machine_tools }

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

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

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

		### basic_machine_tools

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

			date > 1936.1.1 
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_machine_tools

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

			date > 1936.1.1 
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_machine_tools

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

			date > 1939.1.1 
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### assembly_line_production

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

			date > 1941.1.1 
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### flexible_line

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

			always = no
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### streamlined_line

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

			date > 1943.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_concentrated_industry = {

	if = { 
		limit = { 
			EAI_concentrated_industry_tech_focus = yes 
		}

		set_temp_variable = { prio_cat = @PR_concentrated_industry }

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

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

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

		### concentrated_industry

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

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### concentrated_industry2

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

			date > 1936.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### concentrated_industry3

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

			date > 1938.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### concentrated_industry4

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

			date > 1940.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### concentrated_industry5

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

			date > 1942.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_dispersed_industry = {

	if = { 
		limit = { 
			EAI_dispersed_industry_tech_focus = yes 
		}

		set_temp_variable = { prio_cat = @PR_dispersed_industry }

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

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

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

		### 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.10.1
				
		} 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 }

			date > 1940.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### dispersed_industry5

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

			date > 1942.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_fuel_silos = {

	if = { 
		limit = { 
			always = no
		}

		set_temp_variable = { prio_cat = @PR_fuel_silos }

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

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

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

		### fuel_silos

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

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_fuel_refining = {

	if = { 
		limit = { 
			OR = {
				AND = {
					check_variable = { EAI_fuel_resource_shortage = 3 }
					synthetic_refinery > 10
				}
				EAI_is_island_nation = yes #to limit imports and convoy usage as much as possible
			}
		}

		set_temp_variable = { prio_cat = @PR_fuel_refining }

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

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

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

		### fuel_refining

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

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### fuel_refining2

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

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### fuel_refining3

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

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### fuel_refining4

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

			date > 1941.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### fuel_refining5

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

			date > 1943.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_synth_oil_experiments = {

	if = { 
		limit = { 
			OR = {
				EAI_rubber_processing_tech_focus = yes 
				EAI_synth_tech_focus = yes

				AND = {
					OR = {
						AND = {
							OR = {
								check_variable = { resource@rubber < 10 }
								check_variable = { resource_imported@rubber > 20 }
							}
				
							check_variable = { resource_consumed@rubber > 50 }
						}

						AND = {
							check_variable = { EAI_rubber_resource_shortage = 3 }
							check_variable = { EAI_rubber_needed = 3 }
						}
					}
				}
			}
		}

		set_temp_variable = { prio_cat = @PR_synth_oil_experiments }

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

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

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

		### synth_oil_experiments

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

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_oil_processing = {

	if = { 
		limit = { 
			always = no
		}

		set_temp_variable = { prio_cat = @PR_oil_processing }

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

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

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

		### oil_processing

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

			date > 1937.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### improved_oil_processing

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

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_oil_processing

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

			date > 1941.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### modern_oil_processing

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

			date > 1943.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_rubber_processing = {

	if = { 
		limit = { 
			synthetic_refinery > 10

			OR = {
				AND = {
					OR = {
						check_variable = { resource@rubber < 10 }
						check_variable = { resource_imported@rubber > 20 }
					}
		
					check_variable = { resource_consumed@rubber > 50 }
				}

				AND = {
					check_variable = { EAI_rubber_resource_shortage = 3 }
					check_variable = { EAI_rubber_needed = 3 }
				}
			}
		}

		set_temp_variable = { prio_cat = @PR_rubber_processing }

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

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

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

		### rubber_processing

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

			date > 1937.1.1
				
		} 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 }

		### advanced_rubber_processing

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

			OR = {
				date > 1941.1.1

				AND = {
					check_variable = { EAI_rubber_resource_shortage = 3 }
					date > 1940.1.1
				}
			}
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### modern_rubber_processing

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

			OR = {
				date > 1943.1.1

				AND = {
					check_variable = { EAI_rubber_resource_shortage = 3 }
					date > 1942.1.1
				}
			}
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_construction = {

	if = {
		limit = {
			always = yes
		}

		set_temp_variable = { prio_cat = @PR_construction }

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

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

			if = { limit = { has_war = no }

				multiply_temp_variable = { prio_cat = 1.1 }
			}

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

		### 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.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction4

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

			date > 1940.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### construction5

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

			date > 1942.10.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_excavation = {

	if = { 
		limit = { 
			OR = {
				AND = {
					OR = { check_variable = { EAI_needs_steel = 3 } }
					check_variable = { resource_produced@steel > 100 }
				}
				AND = {
					OR = { check_variable = { EAI_needs_aluminium = 3 } }
					check_variable = { resource_produced@aluminium > 100 }
				}
				AND = {
					OR = { check_variable = { EAI_needs_tungsten = 3 } }
					check_variable = { resource_produced@tungsten > 100 }
				}
				AND = {
					OR = { check_variable = { EAI_needs_rubber = 3 } }
					check_variable = { resource_produced@rubber > 100 }
				}
				AND = {
					OR = { check_variable = { EAI_needs_chromium = 3 } }
					check_variable = { resource_produced@chromium > 100 }
				}
				
				original_tag = HUN #Rubber and Oil production
				original_tag = ROM #Oil production
			}
		}

		set_temp_variable = { prio_cat = @PR_excavation }

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

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

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

		### excavation1

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

			date > 1937.1.1
				
		} 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 }

			date > 1937.1.1
				
		} 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 }

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### excavation4

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

			date > 1941.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### excavation5

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

			date > 1943.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}

EAI_PR_STRATEGIES_energy_gain = {

	if = { 
		limit = { 
			always = yes
		}

		set_temp_variable = { prio_cat = @PR_energy_gain }

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

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

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

		set_temp_variable = { _val_ = EAI_coal_resource_shortage }
		set_temp_variable = { _min = 0 }
		set_temp_variable = { _max = 3 }
		EAI_MATH_normalize = yes
		multiply_temp_variable = { prio_cat = _val_ }

		### improved_equipment_conversion

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

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }

		### advanced_equipment_conversion

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

			date > 1939.1.1
				
		} EAI_PR_add_to_priority_research_queue = yes }
	}
}