############################################################################################################
#	Expert AI mod - navy production
############################################################################################################

EAI_PROD_NAVY_default_ratios = {
	enable = { NOT = { has_country_flag = EAI_military_focus_config_finished } }

	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_carrier 		 value = 100 }
	ai_strategy = { type = role_ratio id = naval_capital_bb		 value = 100 }
	ai_strategy = { type = role_ratio id = naval_capital_bc		 value = 100 }
	ai_strategy = { type = role_ratio id = naval_cruiser_heavy	 value = 100 }
	ai_strategy = { type = role_ratio id = naval_cruiser_light	 value = 100 }
	ai_strategy = { type = role_ratio id = naval_screen			 value = 100 }
	ai_strategy = { type = role_ratio id = naval_escort			 value = 100 }
}

EAI_PROD_NAVY_default_ratios_2 = {
	enable = { has_country_flag = EAI_military_focus_config_finished }

	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_screen			 value = 100 }
}

########################################################
#	FLEET IN BEING
########################################################

### CAPITAL

EAI_PROD_NAVY_FIB_CV_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_CV_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_carrier                      value = 10 }
}

EAI_PROD_NAVY_FIB_BB_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_BB_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bb                   value = 7 }
}

EAI_PROD_NAVY_FIB_BC_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_BC_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bc               	  value = 7 }
}

EAI_PROD_NAVY_FIB_CA_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_CA_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_heavy                value = 7 }
}

### SCREEN

EAI_PROD_NAVY_FIB_CL_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_CL_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_light                value = 10 }
}

EAI_PROD_NAVY_FIB_DD_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_DD_navy_production_strategy }
	abort_when_not_enabled = yes

	# ai_strategy = { type = role_ratio id = naval_screen                    	  value = 30 }
}

### SUB

EAI_PROD_NAVY_FIB_SS_navy_production_strategy = {
	enable = { has_country_flag = EAI_FIB_SS_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_submarine                    value = 8 }
}

########################################################
#	TRADE INTERDICTION
########################################################

### CAPITAL

EAI_PROD_NAVY_TI_CV_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_CV_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_carrier                      value = 7 }
}

EAI_PROD_NAVY_TI_BB_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_BB_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bb                   value = 7 }
}

EAI_PROD_NAVY_TI_BC_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_BC_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bc               	  value = 7 }
}

EAI_PROD_NAVY_TI_CA_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_CA_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_heavy                value = 7 }
}

### SCREEN

EAI_PROD_NAVY_TI_CL_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_CL_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_light                value = 10 }
}

EAI_PROD_NAVY_TI_DD_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_DD_navy_production_strategy }
	abort_when_not_enabled = yes

	# ai_strategy = { type = role_ratio id = naval_screen                    	  value = 30 }
}

### SUB

EAI_PROD_NAVY_TI_SS_navy_production_strategy = {
	enable = { has_country_flag = EAI_TI_SS_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_submarine                    value = 40 }
}

########################################################
#	BASE STRIKE
########################################################

### CAPITAL

EAI_PROD_NAVY_BS_CV_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_CV_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_carrier                      value = 10 }
}

EAI_PROD_NAVY_BS_BB_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_BB_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bb                   value = 7 }
}

EAI_PROD_NAVY_BS_BC_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_BC_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_capital_bc               	  value = 7 }
}

EAI_PROD_NAVY_BS_CA_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_CA_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_heavy                value = 7 }
}

### SCREEN

EAI_PROD_NAVY_BS_CL_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_CL_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_cruiser_light                value = 10 }
}

EAI_PROD_NAVY_BS_DD_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_DD_navy_production_strategy }
	abort_when_not_enabled = yes

	# ai_strategy = { type = role_ratio id = naval_screen                    	  value = 30 }
}

### SUB

EAI_PROD_NAVY_BS_SS_navy_production_strategy = {
	enable = { has_country_flag = EAI_BS_SS_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_submarine                    value = 10 }
}

########################################################
#	DD shortage
########################################################

########################################################
#	ASW
########################################################

# anti submarine destroyer
EAI_PROD_NAVY_ASW_DD_navy_production_strategy_1 = {
	enable = { has_country_flag = EAI_ASW_DD_navy_production_1 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort                    value = 5 }
}
EAI_PROD_NAVY_ASW_DD_navy_production_strategy_2 = {
	enable = { has_country_flag = EAI_ASW_DD_navy_production_2 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort                    value = 5 }
}
EAI_PROD_NAVY_ASW_DD_navy_production_strategy_3 = {
	enable = { has_country_flag = EAI_ASW_DD_navy_production_3 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort                    value = 6 }
}
EAI_PROD_NAVY_ASW_DD_navy_production_strategy_4 = {
	enable = { has_country_flag = EAI_ASW_DD_navy_production_4 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort                    value = 6 }
}
EAI_PROD_NAVY_ASW_DD_navy_production_strategy_5 = {
	enable = { has_country_flag = EAI_ASW_DD_navy_production_5 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort                    value = 6 }
}

# anti submarine light cruiser
EAI_PROD_NAVY_ASW_CL_navy_production_strategy_1 = {
	enable = { has_country_flag = EAI_ASW_CL_navy_production_1 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort_cl                    value = 6 }
	ai_strategy = { type = role_ratio id = naval_screen			 			  value = -6 }
}
EAI_PROD_NAVY_ASW_CL_navy_production_strategy_2 = {
	enable = { has_country_flag = EAI_ASW_CL_navy_production_2 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort_cl                    value = 1 }
	ai_strategy = { type = role_ratio id = naval_screen			 			  value = -1 }
}
EAI_PROD_NAVY_ASW_CL_navy_production_strategy_3 = {
	enable = { has_country_flag = EAI_ASW_CL_navy_production_3 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort_cl                    value = 1 }
	ai_strategy = { type = role_ratio id = naval_screen			 			  value = -1 }
}
EAI_PROD_NAVY_ASW_CL_navy_production_strategy_4 = {
	enable = { has_country_flag = EAI_ASW_CL_navy_production_4 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort_cl                    value = 1 }
	ai_strategy = { type = role_ratio id = naval_screen			 			  value = -1 }
}
EAI_PROD_NAVY_ASW_CL_navy_production_strategy_5 = {
	enable = { has_country_flag = EAI_ASW_CL_navy_production_5 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_escort_cl                    value = 1 }
	ai_strategy = { type = role_ratio id = naval_screen			 			  value = -1 }
}

########################################################
#	MISC
########################################################

# mine layer
EAI_PROD_NAVY_ML_DD_navy_production_strategy = {
	enable = { has_country_flag = EAI_ML_DD_navy_production_strategy }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_mine_layer                    value = 1 }
}

# mine sweeeper
EAI_PROD_NAVY_MS_DD_navy_production_strategy_1 = {
	enable = { has_country_flag = EAI_MS_DD_navy_production_strategy_1 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_mine_sweeper                    value = 1 }
}
EAI_PROD_NAVY_MS_DD_navy_production_strategy_2 = {
	enable = { has_country_flag = EAI_MS_DD_navy_production_strategy_2 }
	abort_when_not_enabled = yes

	ai_strategy = { type = role_ratio id = naval_mine_sweeper                    value = 1 }
}

######################################
#	convoy production
######################################

# convoy
EAI_PROD_NAVY_convoy_production_strategy = {
	enable = {
		num_of_naval_factories > 10
		stockpile_ratio = { archetype = convoy ratio < 500 }
	}
	abort = {
		NOT = {
			AND = {
				num_of_naval_factories > 10
				stockpile_ratio = { archetype = convoy ratio < 750 }
			}
		}
	}

	ai_strategy = { type = equipment_production_min_factories id = convoy value = 3 }
}
EAI_PROD_NAVY_convoy_production_strategy_2 = {
	enable = {
		num_of_naval_factories > 40
		stockpile_ratio = { archetype = convoy ratio < 500 }
	}
	abort = {
		NOT = {
			AND = {
				num_of_naval_factories > 40
				stockpile_ratio = { archetype = convoy ratio < 750 }
			}
		}
	}

	ai_strategy = { type = equipment_production_min_factories id = convoy value = 3 }
}
EAI_PROD_NAVY_convoy_production_strategy_3 = {
	enable = {
		num_of_naval_factories > 80
		stockpile_ratio = { archetype = convoy ratio < 500 }
	}
	abort = {
		NOT = {
			AND = {
				num_of_naval_factories > 50
				stockpile_ratio = { archetype = convoy ratio < 750 }
			}
		}
	}

	ai_strategy = { type = equipment_production_min_factories id = convoy value = 3 }
}

EAI_PROD_NAVY_stop_convoy_production_MAJORS = {
	enable = {
		is_major = yes
		
		stockpile_ratio = { archetype = convoy ratio > 1000 }
		
		EAI_wants_to_build_ships = yes
	}
	abort = {
		NOT = {
			AND = {
				is_major = yes
				
				stockpile_ratio = { archetype = convoy ratio > 500 }
				
				EAI_wants_to_build_ships = yes
			}
		}
	}

	ai_strategy = { type = equipment_variant_production_factor              id = convoy               value = -200 }
}
EAI_PROD_NAVY_stop_convoy_production_MINORS = {
	enable = {
		is_major = no
		
		stockpile_ratio = { archetype = convoy ratio > 200 }
		
		EAI_wants_to_build_ships = yes

		num_of_naval_factories > 3
	}
	abort = {
		NOT = {
			AND = {
				is_major = no
				
				stockpile_ratio = { archetype = convoy ratio > 100 }
				
				EAI_wants_to_build_ships = yes

				num_of_naval_factories > 3
			}
		}
	}

	ai_strategy = { type = equipment_variant_production_factor              id = convoy               value = -200 }
}

EAI_PROD_NAVY_prioritise_convoys_SOV = {
	enable = {

		original_tag = SOV

		num_of_naval_factories > 1
		
		stockpile_ratio = { archetype = convoy ratio < 500 }
		
		EAI_wants_to_build_ships = yes
		
		NOT = { has_global_flag = EAI_free_convoys }
	}
	abort = {
		NOT = {
			AND = {
				EAI_major_country = yes
			
				stockpile_ratio = { archetype = convoy ratio < 800 }
				
				EAI_wants_to_build_ships = yes
				
				NOT = { has_global_flag = EAI_free_convoys }
			}
		}
	}

	ai_strategy = { type = equipment_production_min_factories id = convoy value = 10 }
}
EAI_PROD_NAVY_prioritise_convoys = {
	enable = {
		num_of_naval_factories > 20

		stockpile_ratio = { archetype = convoy ratio < 50 }

		NOT = { has_global_flag = EAI_free_convoys }
	}
	abort = {
		NOT = {
			AND = {
				num_of_naval_factories > 20
				
				stockpile_ratio = { archetype = convoy ratio < 100 }

				NOT = { has_global_flag = EAI_free_convoys }
			}
		}
	}

	ai_strategy = { type = equipment_production_min_factories id = convoy value = 10 }
}