-- YJ-21 by Currenthill

-- =============================== YJ-21 ship launched anti ship missile ==========================================

local YJ_21_warhead = {
    mass                 = 500,
    caliber              = 1000,
    expl_mass            = 400,
    piercing_mass        = 0.0,
    other_factors        = { 1.0, 1.0, 1.0 },
    concrete_factors     = { 3.0, 1.0, 1.0 },
    concrete_obj_factor  = 2.0,
    obj_factors          = { 3.0, 1.0 },
    cumulative_factor    = 2.0,
    cumulative_thickness = 0.0,
}

local TYPE_055_YJ_21 = {
	category		= CAT_MISSILES,
	name			= "TYPE055_YJ21",
	user_name	 	= _("YJ-21"),
	mass			= 3800,
	model			= 'Type055_YJ-21',
	wsTypeOfWeapon  = {wsType_Weapon,wsType_Missile,wsType_AS_Missile,WSTYPE_PLACEHOLDER, "Anti-Ship missiles"},
        Escort = 0,
        Head_Type = 5,
		sigma = {10, 10, 10},
        M = 3800.0,
        H_max = 60000.0,
        H_min = 1000.0,
        Diam = 920.0,
        Cx_pil = 7,
        D_max = 1000000.0,
        D_min = 100000.0,
        Head_Form = 1,
        Life_Time = 1800.0,
        Nr_max = 10,
        v_min = 100.0,
        v_mid = 3600.0,
        Mach_max = 10.0,
        t_b = 0.0,
        t_acc = 6.0,
        t_marsh = 50.0,
        Range_max = 1000000.0,
        H_min_t = 0.0,
        Fi_start = 3.14152,
        Fi_rak = 3.14152,
        Fi_excort = 3.14152,
        Fi_search = 99.9,
        OmViz_max = 99.9,
		exhaust1 = {1.0, 1.0, 1.0, 1.0},
        X_back = -3.8,
        Y_back = 0.0,
        Z_back = 0.0,
		exhaust2 = {1.0, 1.0, 1.0, 1.0},
		X_back_acc = -7.6,
		Y_back_acc = 0.0,
		Z_back_acc = 0.0,		
		tail_scale = 1.2,			
        Reflection = 0.6,
        KillDistance = 0.0,
		add_attributes = {"Cruise missiles"},

	warhead	= YJ_21_warhead,
	warhead_air = YJ_21_warhead,

	shape_table_data = 
	{
		{

			name	 = "TYPE055_YJ21";
			file  	 = "Type055_YJ-21";   		
			life  	 = 1;
			fire  	 = { 0, 1};
			username = _("YJ-21");
			index = WSTYPE_PLACEHOLDER;
		},
	},
 	
}

declare_weapon(TYPE_055_YJ_21)

GT_t.WS_t.Type055_YJ21 = {} 
GT_t.WS_t.Type055_YJ21.angles = {
					{math.rad(180), math.rad(-180), math.rad(-90), math.rad(90)},
					};
GT_t.WS_t.Type055_YJ21.moveable = false
GT_t.WS_t.Type055_YJ21.LN = {}
GT_t.WS_t.Type055_YJ21.LN[1] = {}
GT_t.WS_t.Type055_YJ21.LN[1].type = 1
GT_t.WS_t.Type055_YJ21.LN[1].distanceMin = 100000
GT_t.WS_t.Type055_YJ21.LN[1].distanceMax = 1000000
GT_t.WS_t.Type055_YJ21.LN[1].reactionTime = 1;
GT_t.WS_t.Type055_YJ21.LN[1].launch_delay = 1;
GT_t.WS_t.Type055_YJ21.LN[1].max_number_of_missiles_channels = 8
GT_t.WS_t.Type055_YJ21.LN[1].sensor = {}
set_recursive_metatable(GT_t.WS_t.Type055_YJ21.LN[1].sensor, GT_t.WSN_t[0])
GT_t.WS_t.Type055_YJ21.LN[1].external_tracking_awacs = true
GT_t.WS_t.Type055_YJ21.LN[1].show_external_missile = true
GT_t.WS_t.Type055_YJ21.LN[1].PL = {}
GT_t.WS_t.Type055_YJ21.LN[1].PL[1] = {}
GT_t.WS_t.Type055_YJ21.LN[1].PL[1].ammo_capacity = 8
GT_t.WS_t.Type055_YJ21.LN[1].PL[1].type_ammunition = TYPE_055_YJ_21.wsTypeOfWeapon
GT_t.WS_t.Type055_YJ21.LN[1].PL[1].reload_time = 1000000; 
GT_t.WS_t.Type055_YJ21.LN[1].PL[1].shot_delay = 0.1;
GT_t.WS_t.Type055_YJ21.LN[1].BR = { {pos = {0, 0, 0} } }

