-- Reference information for this code was taken from Currenthill's mods (Type 55 frigate (YJ-21 weapon) and Iskander), JSN64's mods and stock game files =====================================================================================================================

local MUSUDAN_MRBM = {
	category		= CAT_MISSILES,
	name			= "MUSUDAN_MISSILE",
	user_name	 	= _("MUSUDAN_MRBM"),
	mass			= 3800,
	model			= 'MusudanMissile',
	wsTypeOfWeapon  = {wsType_Weapon,wsType_Missile,wsType_AS_Missile,WSTYPE_PLACEHOLDER},
	Escort 			= 0,
	Head_Type 		= 5,  
	sigma 			= {7, 7, 7},
	M 				= 8800.0,    
	H_max 			= 189000.0,  
	H_min 			= -1,
	Diam 			= 920.0,
	Cx_pil 			= 6.0,   
	D_max 			= 900000.0, 
	D_min 			= 300000.0,
	Head_Form 		= 1, 
	Life_Time 		= 3600.0,   
	Nr_max 			= 2.8,  
	v_min 			= 170.0,
	v_mid 			= 2100.0, 
	Mach_max 		= 8.7,  
	t_b 			= 0.0,
	t_acc 			= 19.2, 
	t_marsh         = 260.0,  
	Range_max 		= 900000.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, 1, 1, 1 },
	X_back 			= 10.5,  
	Y_back 			= 0.0, 
	Z_back 			= 0.0, 
	exhaust2 		= { 1, 1, 1, 0.1 },	
	X_back_acc 		= -0.0,
    Y_back_acc 		= 0.0,
    Z_back_acc 		= 0.0,	
	Reflection 		= 0.2, 
	KillDistance 	= 0.0, 
	add_attributes = {"Cruise missiles"},	

	warhead = simple_warhead(59700),
	warhead_air = simple_warhead(59700),
	
	shape_table_data = 
	{
		{

			name	 = "MUSUDAN_MISSILE";
			file  	 = "MusudanMissile";   		
			life  	 = 1;
			fire  	 = { 0, 1};
			username = _("Musudan MRBM");
			index = WSTYPE_PLACEHOLDER;
		},
	},
	
}

declare_weapon(MUSUDAN_MRBM)

GT_t.WS_t.MISSILE_MUSUDAN = {} 
GT_t.WS_t.MISSILE_MUSUDAN.angles = {
					{math.rad(180), math.rad(-180), math.rad(-90), math.rad(90)},
					};
GT_t.WS_t.MISSILE_MUSUDAN.moveable = false					
GT_t.WS_t.MISSILE_MUSUDAN.mount_before_move = true;					
GT_t.WS_t.MISSILE_MUSUDAN.LN = {}
GT_t.WS_t.MISSILE_MUSUDAN.LN[1] = {}
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].type = 8
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].distanceMin = 300000
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].distanceMax = 900000
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].reactionTime = 18.0;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].maxShootingSpeed = 0;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].launch_delay = 4.0;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].barrels_reload_type = 2;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].max_number_of_missiles_channels = 1
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].sensor = {}
set_recursive_metatable(GT_t.WS_t.MISSILE_MUSUDAN.LN[1].sensor, GT_t.WSN_t[0])
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].external_tracking_awacs = true
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].show_external_missile = true
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL = {}
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1] = {}
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1].switch_on_delay = 600;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1].ammo_capacity = 1
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1].type_ammunition = MUSUDAN_MRBM.wsTypeOfWeapon
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1].reload_time = 6000; 
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].PL[1].shot_delay = 0.1;
GT_t.WS_t.MISSILE_MUSUDAN.LN[1].BR = { {pos = {0, 0, 0} } }
