############################################################################################################
# CAS
############################################################################################################

# engine_1_1x
# engine_1_2x
# engine_1_3x
# engine_1_4x
# engine_1_6x
# engine_2_1x
# engine_2_2x
# engine_2_3x
# engine_2_4x
# engine_2_6x
# engine_3_1x
# engine_3_2x
# engine_3_3x
# engine_3_4x
# engine_3_6x
# engine_4_1x
# engine_4_2x
# engine_4_3x
# engine_4_4x
# engine_4_6x

# jet_engine_1x
# jet_engine_2x
# jet_engine_3x
# jet_engine_4x
# jet_engine_6x

# rocket_engine_1
# rocket_engine_2
# rocket_engine_3

# light_mg_2x
# light_mg_4x

# heavy_mg_2x
# heavy_mg_4x

# aircraft_cannon_1_1x
# aircraft_cannon_1_2x

# aircraft_cannon_2_1x
# aircraft_cannon_2_2x

# bomb_locks

# rocket_rails

# small_bomb_bay
# medium_bomb_bay
# large_bomb_bay

# tank_buster_1
# tank_buster_2

# torpedo_mounting

# recon_camera

# airdropped_mines

# guided_anti_ship_missile

# fixed_explosive_charge

# armor_plate_small
# armor_plate_medium
# armor_plate_large

# fuel_tanks_small
# fuel_tanks_medium
# fuel_tanks_large

# self_sealing_fuel_tanks_small
# self_sealing_fuel_tanks_medium
# self_sealing_fuel_tanks_large

# non_strategic_materials_small
# non_strategic_materials_medium
# non_strategic_materials_large

# drop_tanks

# dive_brakes_small

# floats

# demining_coil

# flying_boat_medium
# flying_boat_large

# bomb_sights_1
# bomb_sights_2

# radio_navigation_1
# radio_navigation_2

# air_ground_radar_1
# air_ground_radar_2

# air_air_radar_1
# air_air_radar_2

# lmg_defense_turret
# lmg_defense_turret_2x
# hmg_defense_turret
# hmg_defense_turret_2x

# cannon_defense_turret
# cannon_defense_turret_2x

EAI_cas = {
	category = air
	roles = { air_cas }
	priority = {
		base = 0
		modifier = {
			add = 25000
			EAI_CAS_military_focus = yes
			has_tech = early_bombs
			NOT = { EAI_CAS_design_priority = yes }
		}
	}

	BASIC_CAS = {
		priority = {
			base = 0
			modifier = { 
				add = 100 

				has_tech = basic_small_airframe 
				has_tech = engines_2 
			}
			modifier = { 
				add = -500 

				has_tech = improved_small_airframe 
				has_tech = engines_3 
			}
		}

		target_variant = {
			type = small_plane_cas_airframe_1
			match_value = 1
			
			modules = {
				fixed_main_weapon_slot = bomb_locks
				fixed_auxiliary_weapon_slot_1 = bomb_locks
				engine_type_slot > engine_1_1x
				special_type_slot_1 = { module = fuel_tanks_small module = empty }
				special_type_slot_2 = { module = dive_brakes_small module = empty }
			}
		}

		allowed_modules = {
			plane_engine_type

			bomb_locks
			tank_buster_1
			tank_buster_2

			drop_tanks
			self_sealing_fuel_tanks_small
			armor_plate_small
			dive_brakes_small
			lmg_defense_turret
			lmg_defense_turret_2x
			hmg_defense_turret
			hmg_defense_turret_2x
			cannon_defense_turret
			cannon_defense_turret_2x
		}
	}

	IMPROVED_CAS = {
		priority = {
			base = 0
			modifier = { 
				add = 100 

				has_tech = improved_small_airframe 
				has_tech = engines_3 
			}
			modifier = { 
				add = -500 
				
				has_tech = advanced_small_airframe 
				has_tech = engines_4
			}
			modifier = { 
				add = -500 
				
				has_tech = rocket_artillery 
				has_tech = antitank2
			}
		}

		target_variant = {
			type = small_plane_cas_airframe_2
			match_value = 1
			
			modules = {
				fixed_main_weapon_slot = small_bomb_bay
				fixed_auxiliary_weapon_slot_1 = bomb_locks
				fixed_auxiliary_weapon_slot_2 = bomb_locks
				engine_type_slot = engine_3_1x
				special_type_slot_1 = fuel_tanks_small
				special_type_slot_2 = fuel_tanks_small
				special_type_slot_3 = dive_brakes_small
			}
		}

		allowed_modules = {
			plane_engine_type

			bomb_locks
			tank_buster_1
			tank_buster_2

			drop_tanks
			self_sealing_fuel_tanks_small
			armor_plate_small
			dive_brakes_small
			lmg_defense_turret
			lmg_defense_turret_2x
			hmg_defense_turret
			hmg_defense_turret_2x
			cannon_defense_turret
			cannon_defense_turret_2x
		}
	}

	IMPROVED_CAS_rockets = {
		priority = {
			base = 0
			modifier = { 
				add = 100 

				has_tech = improved_small_airframe 
				has_tech = engines_3
				has_tech = rocket_artillery
				has_tech = antitank2
			}
			modifier = { 
				add = -500 
				
				has_tech = advanced_small_airframe 
				has_tech = engines_4
			}
		}

		target_variant = {
			type = small_plane_cas_airframe_2
			match_value = 1
			
			modules = {
				fixed_main_weapon_slot = tank_buster_2
				fixed_auxiliary_weapon_slot_1 = rocket_rails
				fixed_auxiliary_weapon_slot_2 = rocket_rails
				engine_type_slot = engine_3_1x
				special_type_slot_1 = fuel_tanks_small
				special_type_slot_2 = fuel_tanks_small
				special_type_slot_3 = dive_brakes_small
			}
		}

		allowed_modules = {
			plane_engine_type

			bomb_locks
			tank_buster_1
			tank_buster_2

			drop_tanks
			self_sealing_fuel_tanks_small
			armor_plate_small
			dive_brakes_small
			lmg_defense_turret
			lmg_defense_turret_2x
			hmg_defense_turret
			hmg_defense_turret_2x
			cannon_defense_turret
			cannon_defense_turret_2x
		}
	}

	ADVANCED_CAS = {
		priority = {
			base = 0
			modifier = { 
				add = 100 
				
				has_tech = advanced_small_airframe 
				has_tech = engines_4
				has_tech = rocket_artillery
				has_tech = antitank2
			}
			modifier = { 
				add = -500 

				has_tech = modern_small_airframe
				has_tech = jet_engines
			}
		}

		target_variant = {
			type = small_plane_cas_airframe_3
			match_value = 1
			
			modules = {
				fixed_main_weapon_slot = tank_buster_2
				fixed_auxiliary_weapon_slot_1 = bomb_locks
				fixed_auxiliary_weapon_slot_2 = empty
				fixed_auxiliary_weapon_slot_3 = empty
				engine_type_slot = engine_4_1x
				special_type_slot_1 = dive_brakes_small
				special_type_slot_2 = fuel_tanks_small
				special_type_slot_3 = fuel_tanks_small
				special_type_slot_3 = armor_plate_small
			}
		}

		allowed_modules = {
			plane_engine_type

			bomb_locks
			tank_buster_1
			tank_buster_2

			drop_tanks
			self_sealing_fuel_tanks_small
			armor_plate_small
			dive_brakes_small
			lmg_defense_turret
			lmg_defense_turret_2x
			hmg_defense_turret
			hmg_defense_turret_2x
			cannon_defense_turret
			cannon_defense_turret_2x
		}
	}

	MODERN_CAS = {
		priority = {
			base = -1
			modifier = { 
				add = 400 

				has_tech = modern_small_airframe
				has_tech = jet_engines
			}
		}

		target_variant = {
			type = small_plane_cas_airframe_4
			match_value = 1
			
			modules = {
				fixed_main_weapon_slot = { module = tank_buster_2 module = tank_buster_1 module = bomb_locks }
				fixed_auxiliary_weapon_slot_1 = { module = tank_buster_1 module = bomb_locks }
				fixed_auxiliary_weapon_slot_2 = bomb_locks
				fixed_auxiliary_weapon_slot_3 = bomb_locks
				engine_type_slot = jet_engine_2x
				special_type_slot_1 = self_sealing_fuel_tanks_small
				special_type_slot_2 = dive_brakes_small
				special_type_slot_3 = armor_plate_small
				special_type_slot_4 = armor_plate_small
			}
		}

		allowed_modules = {
			plane_jet_engine_type

			bomb_locks
			tank_buster_1
			tank_buster_2

			drop_tanks
			self_sealing_fuel_tanks_small
			fuel_tanks_small
			armor_plate_small
			dive_brakes_small
			lmg_defense_turret
			lmg_defense_turret_2x
			hmg_defense_turret
			hmg_defense_turret_2x
			cannon_defense_turret
			cannon_defense_turret_2x
		}
	}
}