-- Soldier with Kornet

GT_t.LN_t.Spriggan = {}
GT_t.LN_t.Spriggan.type = 33
GT_t.LN_t.Spriggan.beamWidth = math.rad(1);
GT_t.LN_t.Spriggan.distanceMin = 100
GT_t.LN_t.Spriggan.distanceMax = 5500
GT_t.LN_t.Spriggan.max_trg_alt = 3000
GT_t.LN_t.Spriggan.reactionTime = 10
GT_t.LN_t.Spriggan.launch_delay = 2
GT_t.LN_t.Spriggan.radialDisperse = 3.2;
GT_t.LN_t.Spriggan.dispertionReductionFactor = 0.97;
GT_t.LN_t.Spriggan.missileControlInterval = 0.2;
GT_t.LN_t.Spriggan.maxShootingSpeed = 0
GT_t.LN_t.Spriggan.show_external_missile = false
GT_t.LN_t.Spriggan.sensor = {}
set_recursive_metatable(GT_t.LN_t.Spriggan.sensor, GT_t.WSN_t[0])
GT_t.LN_t.Spriggan.PL = {}
GT_t.LN_t.Spriggan.PL[1] = {};
GT_t.LN_t.Spriggan.PL[1].automaticLoader = false;
GT_t.LN_t.Spriggan.PL[1].shot_delay = 10;
GT_t.LN_t.Spriggan.PL[1].ammo_capacity = 4;
GT_t.LN_t.Spriggan.PL[1].reload_time = 4*20;
GT_t.LN_t.Spriggan.PL[1].type_ammunition={4,4,11,153}
GT_t.LN_t.Spriggan.PL[1].name_ammunition="9M133";

GT_t.CH_t.ATSOLDIER = {
	life = 1.5,
	mass = 150,
	length = 2,
	width = 2,
	max_road_velocity = 2,
	max_slope = 0.87,
	engine_power = 0.5,
	fordingDepth = 1.0,
	max_vert_obstacle = 1,
	max_acceleration = 3.0,
	min_turn_radius = 0.1,
	X_gear_1 = 1,
	Y_gear_1 = 0,
	Z_gear_1 = 1,
	X_gear_2 = -1,
	Y_gear_2 = 0,
	Z_gear_2 = 1,
	gear_type = GT_t.GEAR_TYPES.HUMAN,
	r_max = 0.53,
	armour_thickness = 0,
	human_figure = true,
}

GT = {};

GT_t.ws = 0;
set_recursive_metatable(GT, GT_t.generic_human);
set_recursive_metatable(GT.chassis, GT_t.CH_t.ATSOLDIER);

GT.visual.shape = "soldier_9k135";
GT.visual.shape_dstr = "soldier_9k135_dead";

GT.mobile = true;
GT.humanPlayable = true;

GT.sensor = {};
set_recursive_metatable(GT.sensor, GT_t.SN_visual);
GT.sensor.height = 1.8;
GT.sensor.max_range_finding_target = 5500;

GT.WS = {};
GT.WS.maxTargetDetectionRange = 5500;

local ws = GT_t.inc_ws();
GT.WS[ws] = {};
GT.WS[ws].new_rotation = false;
GT.WS[ws].pos = {0,1,0};
GT.WS[ws].angles = {
					{math.rad(180), math.rad(-180), math.rad(-10), math.rad(10)},
					};
GT.WS[ws].drawArgument1 = 0;
GT.WS[ws].drawArgument2 = 1;
GT.WS[ws].new_rotation = false;
GT.WS[ws].laser = true;
GT.WS[ws].omegaY = math.rad(100);
GT.WS[ws].omegaZ = math.rad(100);
GT.WS[ws].pidY = {p=100,i=1.5,d=9,inn=10};
GT.WS[ws].pidZ = {p=100,i=1.5,d=9,inn=10,};
GT.WS[ws].pointer = 'POINT_SIGHT_1';

__LN = add_launcher(GT.WS[ws], GT_t.LN_t.Spriggan)
__LN.BR = { {connector_name = 'POINT_ROCKET', drawArgument = 4}, }
__LN.customViewPoint = { "genericMissileAT", {0.0, 0.0, 0.0}, };
__LN.sightMasterMode = 1;
__LN.sightIndicationMode = 1;

GT.Name = "Infantry AT-14 Soldier";
GT.DisplayName = _("Infantry AT-14 'Spriggan' Soldier");
GT.Rate = 5;

GT.Sensors = { OPTIC = {"TKN-3B day", "TKN-3B night", -- командирский
						--"1PN22M1 day", "1PN22M1 night" -- наводчика,
						},
			};

GT.DetectionRange = 0;
GT.ThreatRange = GT.WS[1].LN[1].distanceMax;
GT.mapclasskey = "P0091000201";
GT.attribute = {wsType_Ground,wsType_Tank,wsType_Gun,wsType_GenericInfantry,
				"Infantry",
				"ATGM",
				"Datalink"
				};
GT.category = "Infantry";
GT.Countries = { "Russia","Greece","India","Iran","Iraq","Syria","TURKEY","Aggressors"};
GT.Transportable = {
	size = 150
}

add_surface_unit(GT)