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

EAI_PRODUCTION_stockpile_strategies = {

	# if = { limit = { EAI_DESIGN_ARMOR_armored_engineer_production_focus = yes }
	
	# 	if = { limit = { EAI_DESIGN_ARMOR_armored_engineer_upgrade_production_started = yes }
		
	# 		set_country_flag = EAI_DESIGN_ARMOR_armored_engineer_upgrade_production_started
	# 	}
	# }

	if = { limit = { EAI_DESIGN_ARMOR_mechanized_production_focus = yes }
	
		if = { limit = { EAI_DESIGN_ARMOR_mechanized_upgrade_production_started = yes }
		
			set_country_flag = EAI_DESIGN_ARMOR_mechanized_upgrade_production_started
		}
	}

	if = { limit = { EAI_DESIGN_ARMOR_modern_production_focus = yes }
	
		if = { limit = { EAI_DESIGN_ARMOR_modern_upgrade_production_started = yes }
		
			set_country_flag = EAI_DESIGN_ARMOR_modern_upgrade_production_started
		}
	}
}

########################################################################
### 	Army production strategies
########################################################################

EAI_PRODUCTION_army_production_strategies = {

	EAI_PRODUCTION_MW_army_production_strategies = yes

	EAI_PRODUCTION_SF_army_production_strategies = yes

	EAI_PRODUCTION_GB_army_production_strategies = yes

	EAI_PRODUCTION_MA_army_production_strategies = yes

	EAI_PRODUCTION_attachment_production_strategies = yes
	
	EAI_PRODUCTION_AT_army_production_strategies = yes

	EAI_PRODUCTION_garrison_production_strategies = yes
}

###

EAI_PRODUCTION_MW_army_production_strategies = {

	if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } } 

		### ARMOR

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				OR = {
					EAI_light_armor_production = yes
					EAI_medium_armor_production = yes
					EAI_heavy_armor_production = yes
					EAI_modern_armor_production = yes
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_MW_armor_army_production_strategy } }

				set_country_flag = EAI_MW_armor_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_MW_armor_army_production_strategy }

			clr_country_flag = EAI_MW_armor_army_production_strategy 
		}

		### MOTORIZED

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				
				EAI_motorized_production = yes
			} 

			if = { limit = { NOT = { has_country_flag = EAI_MW_motorized_army_production_strategy } }

				set_country_flag = EAI_MW_motorized_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_MW_motorized_army_production_strategy }

			clr_country_flag = EAI_MW_motorized_army_production_strategy 
		}
	}

	else_if = { limit = { OR = { has_country_flag = EAI_MW_armor_army_production_strategy has_country_flag = EAI_MW_motorized_army_production_strategy } } 

		clr_country_flag = EAI_MW_armor_army_production_strategy
		clr_country_flag = EAI_MW_motorized_army_production_strategy
	}
}

EAI_PRODUCTION_SF_army_production_strategies = {

	if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } } 

		### ARMOR

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				OR = {
					EAI_light_armor_production = yes
					EAI_medium_armor_production = yes
					EAI_heavy_armor_production = yes
					EAI_modern_armor_production = yes
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_SF_armor_army_production_strategy } }

				set_country_flag = EAI_SF_armor_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_SF_armor_army_production_strategy }

			clr_country_flag = EAI_SF_armor_army_production_strategy 
		}

		### MOTORIZED

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				
				EAI_motorized_production = yes
			} 

			if = { limit = { NOT = { has_country_flag = EAI_SF_motorized_army_production_strategy } }

				set_country_flag = EAI_SF_motorized_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_SF_motorized_army_production_strategy }

			clr_country_flag = EAI_SF_motorized_army_production_strategy 
		}
	}

	else_if = { limit = { OR = { has_country_flag = EAI_SF_armor_army_production_strategy has_country_flag = EAI_SF_motorized_army_production_strategy } } 

		clr_country_flag = EAI_SF_armor_army_production_strategy
		clr_country_flag = EAI_SF_motorized_army_production_strategy
	}
}

EAI_PRODUCTION_GB_army_production_strategies = {

	if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } 

		### ARMOR

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				OR = {
					EAI_light_armor_production = yes
					EAI_medium_armor_production = yes
					EAI_heavy_armor_production = yes
					EAI_modern_armor_production = yes
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_GB_armor_army_production_strategy } }

				set_country_flag = EAI_GB_armor_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_GB_armor_army_production_strategy }

			clr_country_flag = EAI_GB_armor_army_production_strategy 
		}

		### MOTORIZED

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				
				EAI_motorized_production = yes
			} 

			if = { limit = { NOT = { has_country_flag = EAI_GB_motorized_army_production_strategy } }

				set_country_flag = EAI_GB_motorized_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_GB_motorized_army_production_strategy }

			clr_country_flag = EAI_GB_motorized_army_production_strategy 
		}
	}

	else_if = { limit = { OR = { has_country_flag = EAI_GB_armor_army_production_strategy has_country_flag = EAI_GB_motorized_army_production_strategy } } 

		clr_country_flag = EAI_GB_armor_army_production_strategy
		clr_country_flag = EAI_GB_motorized_army_production_strategy
	}
}

EAI_PRODUCTION_MA_army_production_strategies = {

	if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MA_DOCTRINE } } 

		### ARMOR

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				OR = {
					EAI_light_armor_production = yes
					EAI_medium_armor_production = yes
					EAI_heavy_armor_production = yes
					EAI_modern_armor_production = yes
				}

				### Strategies

					EAI_STRATEGY_CHL_start_tanks = yes

				###
			} 

			if = { limit = { NOT = { has_country_flag = EAI_MA_armor_army_production_strategy } }

				set_country_flag = EAI_MA_armor_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_MA_armor_army_production_strategy }

			clr_country_flag = EAI_MA_armor_army_production_strategy 
		}

		### MOTORIZED

		if = { 
			limit = { 
				num_of_military_factories > 20 
				
				EAI_motorized_production = yes

				### Strategies

					EAI_STRATEGY_CHL_start_tanks = yes

				###
			} 

			if = { limit = { NOT = { has_country_flag = EAI_MA_motorized_army_production_strategy } }

				set_country_flag = EAI_MA_motorized_army_production_strategy
			}
		}
		else_if = { limit = { has_country_flag = EAI_MA_motorized_army_production_strategy }

			clr_country_flag = EAI_MA_motorized_army_production_strategy 
		}
	}

	else_if = { limit = { OR = { has_country_flag = EAI_MA_armor_army_production_strategy has_country_flag = EAI_MA_motorized_army_production_strategy } } 

		clr_country_flag = EAI_MA_armor_army_production_strategy
		clr_country_flag = EAI_MA_motorized_army_production_strategy
	}
}

EAI_PRODUCTION_attachment_production_strategies = {

	# mot
	if = { limit = { num_of_military_factories > 15  EAI_motorized_attachment_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_motorized_attachment_army_production_strategy } } 
		
			set_country_flag = EAI_motorized_attachment_army_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_motorized_attachment_army_production_strategy }
		
		clr_country_flag = EAI_motorized_attachment_army_production_strategy
	}

	# larm
	if = { limit = { num_of_military_factories > 15  EAI_light_armor_attachment_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_light_armor_attachment_army_production_strategy } } 
		
			set_country_flag = EAI_light_armor_attachment_army_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_light_armor_attachment_army_production_strategy }
		
		clr_country_flag = EAI_light_armor_attachment_army_production_strategy
	}

	# marm
	if = { limit = { num_of_military_factories > 20  EAI_medium_attachment_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_medium_armor_attachment_army_production_strategy } } 
		
			set_country_flag = EAI_medium_armor_attachment_army_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_medium_armor_attachment_army_production_strategy }
		
		clr_country_flag = EAI_medium_armor_attachment_army_production_strategy
	}

	# harm
	if = { limit = { num_of_military_factories > 20  EAI_heavy_attachment_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_heavy_armor_attachment_army_production_strategy } } 
		
			set_country_flag = EAI_heavy_armor_attachment_army_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_heavy_armor_attachment_army_production_strategy }
		
		clr_country_flag = EAI_heavy_armor_attachment_army_production_strategy
	}

	# modarm
	if = { limit = { num_of_military_factories > 20  EAI_modern_attachment_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_modern_armor_attachment_army_production_strategy } } 
		
			set_country_flag = EAI_modern_armor_attachment_army_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_modern_armor_attachment_army_production_strategy }
		
		clr_country_flag = EAI_modern_armor_attachment_army_production_strategy
	}
}

EAI_PRODUCTION_AT_army_production_strategies = {

	if = { limit = { has_country_flag = EAI_anti_tank_template_upgrade } 

		# at 1
		if = { 
			limit = {
				if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } }
					check_variable = { EAI_FOCUS/LAND/armor_focus = global.EAI_AT_FOCUS }
				}

				if = { limit = { OR = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } }
					NOT = { check_variable = { EAI_FOCUS/LAND/antitank_design = global.EAI_MTD_AT_DESIGN } }
				}

				OR = {
					any_enemy_country = { has_army_size = { type = armor size > 5 } }
					any_neighbor_country = { has_army_size = { type = armor size > 5 } }
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_AT_attachment_army_production_strategy_1 } } 
			
				set_country_flag = EAI_AT_attachment_army_production_strategy_1
			}
		}
		else_if = { limit = { has_country_flag = EAI_AT_attachment_army_production_strategy_1 }
			
			clr_country_flag = EAI_AT_attachment_army_production_strategy_1
		}

		# at 2
		if = { 
			limit = {
				if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } }
					check_variable = { EAI_FOCUS/LAND/armor_focus = global.EAI_AT_FOCUS }
				}

				if = { limit = { OR = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } }
					NOT = { check_variable = { EAI_FOCUS/LAND/antitank_design = global.EAI_MTD_AT_DESIGN } }
				}

				OR = {
					any_enemy_country = { has_army_size = { type = armor size > 10 } }
					any_neighbor_country = { has_army_size = { type = armor size > 10 } }
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_AT_attachment_army_production_strategy_2 } } 
			
				set_country_flag = EAI_AT_attachment_army_production_strategy_2
			}
		}
		else_if = { limit = { has_country_flag = EAI_AT_attachment_army_production_strategy_2 }
			
			clr_country_flag = EAI_AT_attachment_army_production_strategy_2
		}

		# at 3
		if = { 
			limit = {
				if = { limit = { OR = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } }
					NOT = { check_variable = { EAI_FOCUS/LAND/antitank_design = global.EAI_MTD_AT_DESIGN } }
				}

				if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } }
					check_variable = { EAI_FOCUS/LAND/armor_focus = global.EAI_AT_FOCUS }
				}

				OR = {
					any_enemy_country = { has_army_size = { type = armor size > 15 } }
					any_neighbor_country = { has_army_size = { type = armor size > 15 } }
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_AT_attachment_army_production_strategy_3 } } 
			
				set_country_flag = EAI_AT_attachment_army_production_strategy_3
			}
		}
		else_if = { limit = { has_country_flag = EAI_AT_attachment_army_production_strategy_3 }
			
			clr_country_flag = EAI_AT_attachment_army_production_strategy_3
		}

		# at 4
		if = { 
			limit = {
				if = { limit = { OR = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } }
					NOT = { check_variable = { EAI_FOCUS/LAND/antitank_design = global.EAI_MTD_AT_DESIGN } }
				}

				if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } }
					check_variable = { EAI_FOCUS/LAND/armor_focus = global.EAI_AT_FOCUS }
				}

				OR = {
					any_enemy_country = { has_army_size = { type = armor size > 25 } }
					any_neighbor_country = { has_army_size = { type = armor size > 25 } }
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_AT_attachment_army_production_strategy_4 } } 
			
				set_country_flag = EAI_AT_attachment_army_production_strategy_4
			}
		}
		else_if = { limit = { has_country_flag = EAI_AT_attachment_army_production_strategy_4 }
			
			clr_country_flag = EAI_AT_attachment_army_production_strategy_4
		}

		# at 5
		if = { 
			limit = {
				if = { limit = { OR = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_SF_DOCTRINE } check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_GB_DOCTRINE } } }
					NOT = { check_variable = { EAI_FOCUS/LAND/antitank_design = global.EAI_MTD_AT_DESIGN } }
				}

				if = { limit = { check_variable = { EAI_FOCUS/LAND/land_doctrine = global.EAI_MW_DOCTRINE } }
					check_variable = { EAI_FOCUS/LAND/armor_focus = global.EAI_AT_FOCUS }
				}

				OR = {
					any_enemy_country = { has_army_size = { type = armor size > 40 } }
					any_neighbor_country = { has_army_size = { type = armor size > 40 } }
				}
			} 

			if = { limit = { NOT = { has_country_flag = EAI_AT_attachment_army_production_strategy_5 } } 
			
				set_country_flag = EAI_AT_attachment_army_production_strategy_5
			}
		}
		else_if = { limit = { has_country_flag = EAI_AT_attachment_army_production_strategy_5 }
			
			clr_country_flag = EAI_AT_attachment_army_production_strategy_5
		}
	}
}

EAI_PRODUCTION_garrison_production_strategies = {

	### Garrison

	if = { limit = { EAI_garrison_production = yes }

		if = { limit = { num_of_controlled_states < 20 }
			set_temp_variable = { t1 = num_of_controlled_states }
			multiply_temp_variable = { t1 = 0.5 }
			round_temp_variable = t1
			multiply_temp_variable = { t1 = 2 }
		}
		else_if = { limit = { num_of_controlled_states < 50 }
			set_temp_variable = { t1 = num_of_controlled_states }
			multiply_temp_variable = { t1 = 0.2 }
			round_temp_variable = t1
			multiply_temp_variable = { t1 = 5 }
		}
		else = { 
			set_temp_variable = { t1 = num_of_controlled_states }
			multiply_temp_variable = { t1 = 0.1 }
			round_temp_variable = t1
			multiply_temp_variable = { t1 = 10 }
		}
		clamp_temp_variable = { var = t1 min = 0 max = 100 }
		meta_effect = {
			text = { set_country_flag = { flag = EAI_garrison_divisions value = [x] } }
			x = "[?t1]"
		}
	}
	else = { clr_country_flag = EAI_garrison_divisions }
}

########################################################################
### 	Aircraft production strategies
########################################################################

EAI_PRODUCTION_aircraft_production_strategies = {

	### Block all air production

	EAI_PRODUCTION_block_aircraft_production_strategies = yes

	### FTR

	EAI_PRODUCTION_FTR_aircraft_production_strategies = yes

	### HFTR

	EAI_PRODUCTION_HFTR_aircraft_production_strategies = yes

	### CAS

	EAI_PRODUCTION_CAS_aircraft_production_strategies = yes

	### TAC

	EAI_PRODUCTION_TAC_aircraft_production_strategies = yes

	### NAV

	EAI_PRODUCTION_NAV_aircraft_production_strategies = yes

	### MAR

	EAI_PRODUCTION_MAR_aircraft_production_strategies = yes

	### STR

	EAI_PRODUCTION_STR_aircraft_production_strategies = yes

	### CVFTR CVNAV

	if = { 
		limit = {
			EAI_CV_aircraft_production = yes
		} 

		if = { limit = { NOT = { has_country_flag = EAI_CV_aircraft_production_strategy } } 
		
			set_country_flag = EAI_CV_aircraft_production_strategy
		}
	}
	else_if = { limit = { has_country_flag = EAI_CV_aircraft_production_strategy }

		clr_country_flag = EAI_CV_aircraft_production_strategy
	}

	### TRNS

	EAI_PRODUCTION_TRNS_aircraft_production_strategies = yes
}

EAI_PRODUCTION_block_aircraft_production_strategies = {

	### SOV

	if = { limit = { tag = SOV }
	
		if = {
			limit = {
				check_variable = { EAI_PC_strategy_state = 1 }
			}
	
			if = { limit = { NOT = { has_country_flag = EAI_block_aircraft_production_strategy } }
	
				set_country_flag = EAI_block_aircraft_production_strategy
			}
		}
		else = {
	
			if = { limit = { has_country_flag = EAI_block_aircraft_production_strategy }
	
				clr_country_flag = EAI_block_aircraft_production_strategy
			}
		}
	}
}

###

EAI_PRODUCTION_FTR_aircraft_production_strategies = {

	if = { limit = { EAI_FTR_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 15000 type = fighter }
			} 

			if = { limit = { NOT = { has_country_flag = EAI_FTR_aircraft_production_strategy } }

				set_country_flag = EAI_FTR_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = {
				has_deployed_air_force_size = { size > 20000 type = fighter }
			}

			if = { limit = { has_country_flag = EAI_FTR_aircraft_production_strategy }

				clr_country_flag = EAI_FTR_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_FTR_aircraft_production_strategy }

		clr_country_flag = EAI_FTR_aircraft_production_strategy
	}
}

EAI_PRODUCTION_HFTR_aircraft_production_strategies = {

	if = { limit = { EAI_HFTR_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 15000 type = fighter }
			} 

			if = { limit = { NOT = { has_country_flag = EAI_HFTR_aircraft_production_strategy } }

				set_country_flag = EAI_HFTR_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = {
				has_deployed_air_force_size = { size > 20000 type = fighter }
			}

			if = { limit = { has_country_flag = EAI_HFTR_aircraft_production_strategy }

				clr_country_flag = EAI_HFTR_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_HFTR_aircraft_production_strategy }

		clr_country_flag = EAI_HFTR_aircraft_production_strategy
	}
}

EAI_PRODUCTION_CAS_aircraft_production_strategies = {

	if = { limit = { EAI_CAS_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 10000 type = cas }
			} 

			if = { limit = { NOT = { has_country_flag = EAI_CAS_aircraft_production_strategy } }

				set_country_flag = EAI_CAS_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = {
				has_deployed_air_force_size = { size > 15000 type = cas }
			}

			if = { limit = { has_country_flag = EAI_CAS_aircraft_production_strategy }

				clr_country_flag = EAI_CAS_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_CAS_aircraft_production_strategy }

		clr_country_flag = EAI_CAS_aircraft_production_strategy
	}
}

EAI_PRODUCTION_TAC_aircraft_production_strategies = {

	if = { limit = { EAI_TAC_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 7500 type = tactical_bomber }
			} 

			if = { limit = { NOT = { has_country_flag = EAI_TAC_aircraft_production_strategy } }

				set_country_flag = EAI_TAC_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = {
				has_deployed_air_force_size = { size > 10000 type = tactical_bomber }
			}

			if = { limit = { has_country_flag = EAI_TAC_aircraft_production_strategy }

				clr_country_flag = EAI_TAC_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_TAC_aircraft_production_strategy }

		clr_country_flag = EAI_TAC_aircraft_production_strategy
	}
}

EAI_PRODUCTION_NAV_aircraft_production_strategies = {

	if = { limit = { EAI_NAV_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 2000 type = naval_bomber }
			} 

			if = { limit = { num_of_military_factories > 300 check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 6 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 6 }
				}
			}
			else_if = { limit = { num_of_military_factories > 250 check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 5 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 5 }
				}
			}
			else_if = { limit = { num_of_military_factories > 200 check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 4 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 4 }
				}
			}
			else_if = { limit = { num_of_military_factories > 150 check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 3 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 3 }
				}
			}
			else_if = { limit = { num_of_military_factories > 50 check_variable = { EAI_RESEARCH_naval_research_factor > 0.5 } } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 2 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 2 }
				}
			}
			else_if = { limit = { num_of_military_factories > 25 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 1 } } }

					set_country_flag = { flag = EAI_NAV_aircraft_production_strategy value = 1 }
				}
			}
			else_if = { limit = { has_country_flag = EAI_NAV_aircraft_production_strategy }

				clr_country_flag = EAI_NAV_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = { 
				has_deployed_air_force_size = { size > 3000 type = naval_bomber }
			} 

			if = { limit = { has_country_flag = EAI_NAV_aircraft_production_strategy }

				clr_country_flag = EAI_NAV_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_NAV_aircraft_production_strategy }

		clr_country_flag = EAI_NAV_aircraft_production_strategy
	}
}

EAI_PRODUCTION_MAR_aircraft_production_strategies = {

	if = { limit = { EAI_MAR_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 500 type = maritime_patrol_plane }
			} 

			if = { limit = { num_of_military_factories > 300 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_MAR_aircraft_production_strategy value > 5 } } }

					set_country_flag = { flag = EAI_MAR_aircraft_production_strategy value = 6 }
				}
			}
			else_if = { limit = { num_of_military_factories > 250 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_MAR_aircraft_production_strategy value > 4 } } }

					set_country_flag = { flag = EAI_MAR_aircraft_production_strategy value = 5 }
				}
			}
			else_if = { limit = { num_of_military_factories > 200 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_MAR_aircraft_production_strategy value > 3 } } }

					set_country_flag = { flag = EAI_MAR_aircraft_production_strategy value = 4 }
				}
			}
			else_if = { limit = { num_of_military_factories > 150 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_MAR_aircraft_production_strategy value > 2 } } }

					set_country_flag = { flag = EAI_MAR_aircraft_production_strategy value = 3 }
				}
			}
			else_if = { limit = { num_of_military_factories > 50 } 

				if = { limit = { NOT = { has_country_flag = { flag = EAI_MAR_aircraft_production_strategy value > 1 } } }

					set_country_flag = { flag = EAI_MAR_aircraft_production_strategy value = 2 }
				}
			}
			else_if = { limit = { num_of_military_factories > 25 } 

				if = { limit = { NOT = { has_country_flag = EAI_MAR_aircraft_production_strategy } }

					set_country_flag = EAI_MAR_aircraft_production_strategy
				}
			}
			else_if = { limit = { has_country_flag = EAI_MAR_aircraft_production_strategy }

				clr_country_flag = EAI_MAR_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = { 
				has_deployed_air_force_size = { size > 1000 type = maritime_patrol_plane }
			} 

			if = { limit = { has_country_flag = EAI_MAR_aircraft_production_strategy }

				clr_country_flag = EAI_MAR_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_MAR_aircraft_production_strategy }

		clr_country_flag = EAI_MAR_aircraft_production_strategy
	}
}

EAI_PRODUCTION_STR_aircraft_production_strategies = {

	if = { limit = { EAI_STR_aircraft_production = yes }

		### ENABLE

		if = { 
			limit = {
				has_deployed_air_force_size = { size < 5000 type = strategic_bomber }
			} 

			if = { limit = { NOT = { has_country_flag = EAI_STR_aircraft_production_strategy } }

				set_country_flag = EAI_STR_aircraft_production_strategy
			}
		}

		### DISABLE

		else_if = { 
			limit = {
				has_deployed_air_force_size = { size > 7500 type = strategic_bomber }
			}

			if = { limit = { has_country_flag = EAI_STR_aircraft_production_strategy }

				clr_country_flag = EAI_STR_aircraft_production_strategy
			}
		}
	}

	else_if = { limit = { has_country_flag = EAI_STR_aircraft_production_strategy }

		clr_country_flag = EAI_STR_aircraft_production_strategy
	}
}

EAI_PRODUCTION_TRNS_aircraft_production_strategies = {

	if = { limit = { EAI_TRNS_aircraft_production = yes } 

		### ENABLE

		if = { limit = { num_of_military_factories > 80 has_deployed_air_force_size = { size < 100 type = air_transport } } 

			if = { limit = { NOT = { has_country_flag = EAI_TRNS_aircraft_production_strategy } }

				set_country_flag = { flag = EAI_TRNS_aircraft_production_strategy value = 1 }
			}
		}

		### DISABLE

		else_if = { limit = { OR = { num_of_military_factories < 70 has_deployed_air_force_size = { size > 200 type = air_transport } } } 

			if = { limit = { has_country_flag = EAI_TRNS_aircraft_production_strategy }

				clr_country_flag = EAI_TRNS_aircraft_production_strategy
			}
		}
	}
	else_if = { limit = { has_country_flag = EAI_TRNS_aircraft_production_strategy }

		clr_country_flag = EAI_TRNS_aircraft_production_strategy
	}
}

########################################################################
### 	Navy production strategies
########################################################################

EAI_PRODUCTION_maintain_capital_to_escort_balance = {

	set_temp_variable = { num_capitals = 1 }
	add_to_temp_variable = { num_capitals = num_ships_with_type@carrier }
	add_to_temp_variable = { num_capitals = num_ships_with_type@battleship }
	add_to_temp_variable = { num_capitals = num_ships_with_type@battle_cruiser }
	add_to_temp_variable = { num_capitals = num_ships_with_type@heavy_cruiser }

	set_temp_variable = { num_screens = 1 }
	add_to_temp_variable = { num_screens = num_ships_with_type@destroyer }
	add_to_temp_variable = { num_screens = num_ships_with_type@light_cruiser }

	###

	set_variable = { EAI_screen_to_capital_ratio = num_screens }
	divide_variable = { EAI_screen_to_capital_ratio = num_capitals }

	###

	if = { limit = { check_variable = { EAI_screen_to_capital_ratio < 4 } }

		set_country_flag = EAI_more_screens_required_for_fleets
	}
	else = {
		clr_country_flag = EAI_more_screens_required_for_fleets
	}
}

###

EAI_PRODUCTION_navy_production_strategies = {

	EAI_PRODUCTION_maintain_capital_to_escort_balance = yes

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

	### FIB

	if = { limit = { check_variable = { EAI_FOCUS/NAVY/naval_doctrine = global.EAI_FIB_DOCTRINE } } 

		set_country_flag = EAI_PRODUCTION_FIB_navy_production_strategies
		EAI_PRODUCTION_FIB_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_FIB_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_FIB_navy_production_strategies

		clr_country_flag = EAI_FIB_CV_navy_production_strategy
		clr_country_flag = EAI_FIB_BB_navy_production_strategy
		clr_country_flag = EAI_FIB_BC_navy_production_strategy
		clr_country_flag = EAI_FIB_CA_navy_production_strategy
		clr_country_flag = EAI_FIB_CL_navy_production_strategy
		clr_country_flag = EAI_FIB_DD_navy_production_strategy
		clr_country_flag = EAI_FIB_SS_navy_production_strategy
	}

	### TI

	if = { limit = { check_variable = { EAI_FOCUS/NAVY/naval_doctrine = global.EAI_TI_DOCTRINE } } 

		set_country_flag = EAI_PRODUCTION_TI_navy_production_strategies
		EAI_PRODUCTION_TI_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_TI_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_TI_navy_production_strategies

		clr_country_flag = EAI_TI_CV_navy_production_strategy
		clr_country_flag = EAI_TI_BB_navy_production_strategy
		clr_country_flag = EAI_TI_BC_navy_production_strategy
		clr_country_flag = EAI_TI_CA_navy_production_strategy
		clr_country_flag = EAI_TI_CL_navy_production_strategy
		clr_country_flag = EAI_TI_DD_navy_production_strategy
		clr_country_flag = EAI_TI_SS_navy_production_strategy
	}

	### BS

	if = { limit = { check_variable = { EAI_FOCUS/NAVY/naval_doctrine = global.EAI_BS_DOCTRINE } } 

		set_country_flag = EAI_PRODUCTION_BS_navy_production_strategies
		EAI_PRODUCTION_BS_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_BS_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_BS_navy_production_strategies

		clr_country_flag = EAI_BS_CV_navy_production_strategy
		clr_country_flag = EAI_BS_BB_navy_production_strategy
		clr_country_flag = EAI_BS_BC_navy_production_strategy
		clr_country_flag = EAI_BS_CA_navy_production_strategy
		clr_country_flag = EAI_BS_CL_navy_production_strategy
		clr_country_flag = EAI_BS_DD_navy_production_strategy
		clr_country_flag = EAI_BS_SS_navy_production_strategy
	}

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

	### ASW DD

	if = { limit = { EAI_ASW_DD_navy_production = yes }

		set_country_flag = EAI_PRODUCTION_ASW_DD_navy_production_strategies
		EAI_PRODUCTION_ASW_DD_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_ASW_DD_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_ASW_DD_navy_production_strategies

		clr_country_flag = EAI_ASW_DD_navy_production_strategy_1
		clr_country_flag = EAI_ASW_DD_navy_production_strategy_2
		clr_country_flag = EAI_ASW_DD_navy_production_strategy_3
		clr_country_flag = EAI_ASW_DD_navy_production_strategy_4
		clr_country_flag = EAI_ASW_DD_navy_production_strategy_5
	}

	### ASW CL

	if = { limit = { EAI_ASW_CL_navy_production = yes } 

		set_country_flag = EAI_PRODUCTION_ASW_CL_navy_production_strategies
		EAI_PRODUCTION_ASW_CL_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_ASW_CL_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_ASW_CL_navy_production_strategies

		clr_country_flag = EAI_ASW_CL_navy_production_strategy_1
		clr_country_flag = EAI_ASW_CL_navy_production_strategy_2
		clr_country_flag = EAI_ASW_CL_navy_production_strategy_3
		clr_country_flag = EAI_ASW_CL_navy_production_strategy_4
		clr_country_flag = EAI_ASW_CL_navy_production_strategy_5
	}

	### ML

	if = { limit = { EAI_ML_DD_navy_production = yes }

		set_country_flag = EAI_ML_DD_navy_production_strategy
	}
	else_if = { limit = { has_country_flag = EAI_ML_DD_navy_production_strategy } 
	
		clr_country_flag = EAI_ML_DD_navy_production_strategy
	}

	### MS

	if = { limit = { EAI_MS_DD_navy_production = yes }

		set_country_flag = EAI_PRODUCTION_MS_DD_navy_production_strategies
		EAI_PRODUCTION_MS_DD_navy_production_strategies = yes
	}
	else_if = { limit = { has_country_flag = EAI_PRODUCTION_MS_DD_navy_production_strategies } 
	
		clr_country_flag = EAI_PRODUCTION_MS_DD_navy_production_strategies

		clr_country_flag = EAI_MS_DD_navy_production_strategy_1
		clr_country_flag = EAI_MS_DD_navy_production_strategy_2
	}
}

###

EAI_PRODUCTION_FIB_navy_production_strategies = {

	# CV
	if = { limit = { EAI_CV_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_CV_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_CV_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_CV_navy_production_strategy }

	# BB
	if = { limit = { EAI_BB_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_BB_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_BB_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_BB_navy_production_strategy }

	# BC
	if = { limit = { EAI_BC_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_BC_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_BC_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_BC_navy_production_strategy }

	# CA
	if = { limit = { EAI_CA_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_CA_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_CA_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_CA_navy_production_strategy }

	# CL
	if = { limit = { EAI_CL_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_CL_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_CL_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_CL_navy_production_strategy }

	# DD
	if = { limit = { EAI_DD_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_DD_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_DD_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_DD_navy_production_strategy }

	# SS
	if = { limit = { EAI_SS_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_FIB_SS_navy_production_strategy } } 
		
			set_country_flag = EAI_FIB_SS_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_FIB_SS_navy_production_strategy }
}

EAI_PRODUCTION_TI_navy_production_strategies = {

	# CV
	if = { limit = { EAI_CV_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_CV_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_CV_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_CV_navy_production_strategy }

	# BB
	if = { limit = { EAI_BB_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_BB_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_BB_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_BB_navy_production_strategy }

	# BC
	if = { limit = { EAI_BC_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_BC_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_BC_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_BC_navy_production_strategy }

	# CA
	if = { limit = { EAI_CA_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_CA_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_CA_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_CA_navy_production_strategy }

	# CL
	if = { limit = { EAI_CL_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_CL_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_CL_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_CL_navy_production_strategy }

	# DD
	if = { limit = { EAI_DD_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_DD_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_DD_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_DD_navy_production_strategy }

	# SS
	if = { limit = { EAI_SS_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_TI_SS_navy_production_strategy } } 
		
			set_country_flag = EAI_TI_SS_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_TI_SS_navy_production_strategy }
}

EAI_PRODUCTION_BS_navy_production_strategies = {

	# CV
	if = { limit = { EAI_CV_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_CV_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_CV_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_CV_navy_production_strategy }

	# BB
	if = { limit = { EAI_BB_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_BB_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_BB_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_BB_navy_production_strategy }

	# BC
	if = { limit = { EAI_BC_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_BC_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_BC_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_BC_navy_production_strategy }

	# CA
	if = { limit = { EAI_CA_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_CA_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_CA_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_CA_navy_production_strategy }

	# CL
	if = { limit = { EAI_CL_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_CL_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_CL_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_CL_navy_production_strategy }

	# DD
	if = { limit = { EAI_DD_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_DD_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_DD_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_DD_navy_production_strategy }

	# SS
	if = { limit = { EAI_SS_navy_production = yes } 

		if = { limit = { NOT = { has_country_flag = EAI_BS_SS_navy_production_strategy } } 
		
			set_country_flag = EAI_BS_SS_navy_production_strategy
		}
	}
	else = { clr_country_flag = EAI_BS_SS_navy_production_strategy }
}

EAI_PRODUCTION_ASW_DD_navy_production_strategies = {

	if = { limit = { NOT = { has_country_flag = EAI_ASW_DD_navy_production_1 } } 
		
		set_country_flag = EAI_ASW_DD_navy_production_1
	}

	if = { limit = { any_enemy_country = { has_navy_size = { size > 40 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_DD_navy_production_2 } } 
		
			set_country_flag = EAI_ASW_DD_navy_production_2
		}
	}
	else = { clr_country_flag = EAI_ASW_DD_navy_production_2 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 60 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_DD_navy_production_3 } } 
		
			set_country_flag = EAI_ASW_DD_navy_production_3
		}
	}
	else = { clr_country_flag = EAI_ASW_DD_navy_production_3 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 80 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_DD_navy_production_4 } } 
		
			set_country_flag = EAI_ASW_DD_navy_production_4
		}
	}
	else = { clr_country_flag = EAI_ASW_DD_navy_production_4 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 100 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_DD_navy_production_5 } } 
		
			set_country_flag = EAI_ASW_DD_navy_production_5
		}
	}
	else = { clr_country_flag = EAI_ASW_DD_navy_production_5 }
}

EAI_PRODUCTION_ASW_CL_navy_production_strategies = {

	if = { limit = { NOT = { has_country_flag = EAI_ASW_CL_navy_production_1 } } 
		
		set_country_flag = EAI_ASW_CL_navy_production_1
	}

	if = { limit = { any_enemy_country = { has_navy_size = { size > 40 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_CL_navy_production_2 } } 
		
			set_country_flag = EAI_ASW_CL_navy_production_2
		}
	}
	else = { clr_country_flag = EAI_ASW_CL_navy_production_2 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 60 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_CL_navy_production_3 } } 
		
			set_country_flag = EAI_ASW_CL_navy_production_3
		}
	}
	else = { clr_country_flag = EAI_ASW_CL_navy_production_3 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 80 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_CL_navy_production_4 } } 
		
			set_country_flag = EAI_ASW_CL_navy_production_4
		}
	}
	else = { clr_country_flag = EAI_ASW_CL_navy_production_4 }

	if = { limit = { any_enemy_country = { has_navy_size = { size > 100 unit = submarine } } } 

		if = { limit = { NOT = { has_country_flag = EAI_ASW_CL_navy_production_5 } } 
		
			set_country_flag = EAI_ASW_CL_navy_production_5
		}
	}
	else = { clr_country_flag = EAI_ASW_CL_navy_production_5 }
}

EAI_PRODUCTION_MS_DD_navy_production_strategies = {

	if = { limit = { NOT = { has_country_flag = EAI_MS_DD_navy_production_strategy_1 } } 
		
		set_country_flag = EAI_MS_DD_navy_production_strategy_1
	}

	if = { limit = { has_country_flag = EAI_enemy_mines_on_our_coasts }

		if = { limit = { NOT = { has_country_flag = EAI_MS_DD_navy_production_strategy_2 } } 
		
			set_country_flag = EAI_MS_DD_navy_production_strategy_2
		}
	}
	else = { clr_country_flag = EAI_MS_DD_navy_production_strategy_2 }
}

EAI_armor_production_design_upgrade_fix = {
	if = {
		limit = {
			EAI_armor_production_design_upgrade_fix_needed = yes
		}
		set_country_flag = { flag = EAI_armor_production_design_upgrade_fix value = 1 } #45 days + up to 15 days for bimonthly update to execute EAI_check_division_limits
	}
	else = {
		clr_country_flag = EAI_armor_production_design_upgrade_fix
	}
}