
# this = destroyed ship
# from = attacker (ship)
can_capture_ship = {
	exists = controller
	from = { exists = controller }
	or = {
		controller = { is_country_type = default }
		from.controller = { has_country_flag = can_capture_ship_non_default }
	}
	fleet = { not = { any_controlled_ship = { has_any_comp_against_ship_capturer_comp = yes } } }
	if = {
		limit = { from = { has_any_ship_capturer_comp_no_pirate = yes } }
		or = {
			is_ship_class = shipclass_science_ship
			is_ship_class = shipclass_constructor
			#is_ship_class = shipclass_colonizer
			#is_ship_class = shipclass_transport
			is_ship_class = shipclass_military
			is_ship_class = shipclass_military_special
		}
	}
	else = {
		OR = {
			# below is vanilla game_rule but optimized
			# Civilian Ships
			is_ship_size = constructor
			is_ship_size = nomads_constructor
			is_ship_size = science
			# Regular Ships
			is_ship_size = corvette
			is_ship_size = frigate
			is_ship_size = destroyer
			is_ship_size = cruiser
			is_ship_size = battleship
			# Biological Ships
			is_ship_size = mauler_stage_1
			is_ship_size = mauler_stage_2
			is_ship_size = mauler_stage_3
			is_ship_size = weaver_stage_1
			is_ship_size = weaver_stage_2
			is_ship_size = weaver_stage_3
			is_ship_size = harbinger_stage_1
			is_ship_size = harbinger_stage_2
			is_ship_size = harbinger_stage_3
			is_ship_size = stinger_stage_1
			is_ship_size = stinger_stage_2
			is_ship_size = stinger_stage_3
			# Galactic Nemesis Ships
			is_ship_size = crisis_corvette
			is_ship_size = crisis_destroyer
			is_ship_size = crisis_cruiser
			# Offspring Ships
			AND = {
				controller = { has_origin = origin_progenitor_hive }
				OR = {
					is_ship_size = offspring_corvette
					is_ship_size = offspring_destroyer
					is_ship_size = offspring_cruiser
					is_ship_size = offspring_battleship
					is_ship_size = offspring_harbinger_stage_1
					is_ship_size = offspring_harbinger_stage_2
					is_ship_size = offspring_harbinger_stage_3
					is_ship_size = offspring_mauler_stage_1
					is_ship_size = offspring_mauler_stage_2
					is_ship_size = offspring_mauler_stage_3
					is_ship_size = offspring_weaver_stage_1
					is_ship_size = offspring_weaver_stage_2
					is_ship_size = offspring_weaver_stage_3
					is_ship_size = offspring_stinger_stage_1
					is_ship_size = offspring_stinger_stage_2
					is_ship_size = offspring_stinger_stage_3
				}
			}
			# Cosmogenesis Ships
			is_ship_size = cosmo_crisis_destroyer
			is_ship_size = cosmo_crisis_battlecruiser
			is_ship_size = cosmo_crisis_mauler
			is_ship_size = cosmo_crisis_weaver
			is_ship_size = cosmo_crisis_harbinger
			# Nanotech Ships
			AND = {
				controller = { has_tradition = tr_nanotech_finish }
				OR = {
					is_ship_size = nanite_swarmer
					is_ship_size = nanite_interdictor
				}
			}
			# is_ship_size = nanite_swarmer
			# is_ship_size = nanite_interdictor
			# Fallen Empire Ships
			is_ship_size = large_ship_fallen_empire
			is_ship_size = small_ship_fallen_empire
			is_ship_size = small_fallen_weaver
			is_ship_size = large_fallen_weaver
			is_ship_size = large_fallen_mauler
			is_ship_size = large_fallen_harbinger
			# Marauder Ships
			is_ship_size = marauder_corvette
			is_ship_size = marauder_destroyer
			is_ship_size = marauder_cruiser
			is_ship_size = marauder_galleon
		}
	}
}
