-- FACM Roussen Super Vita

GT = {};
GT_t.ws = 0;

set_recursive_metatable(GT, GT_t.generic_ship)

GT.visual = {}
GT.visual.shape = "roussen"
GT.visual.shape_dstr = ""

GT.encyclopediaAnimation = { 
	args = {
		[14] = 0.15, -- fwd cannon elevation
		[15] = 1, -- aft cannon rotation
		[16] = 0.15, -- aft cannon elevation
	}		
}

GT.IR_emission_coeff = 0.1

GT.life = 1500
GT.mass = 275.0e+003
GT.max_velocity = 16.5
GT.race_velocity = 16.5
GT.economy_velocity = 10.0
GT.economy_distance = 300000
GT.race_distance = 200000
--GT.propeller_omega_max = 5000.0
--GT.economy_distance = 15700.0e+003
--GT.race_distance = 1.5e+006
GT.shipLength = 62
GT.Width = 9.5
GT.Height = 13
GT.Length = 62
GT.DeckLevel = 2.2
GT.X_nose = 20.5
GT.X_tail = -23.0
GT.Tail_Width = 9.4
GT.draft = 2.5
GT.Gamma_max = 0.6
GT.Om = 0.03
GT.speedup = 4.0
GT.R_min = 20
GT.distFindObstacles = 250.0
GT.RCS = 20000 -- estimated RCS in square meters

--GT.riverCraft = true

GT.airWeaponDist = 15000
GT.airFindDist = 50000

GT.sensor = {
	max_range_finding_target = 50000,
	min_range_finding_target = 0,
	max_alt_finding_target = 15000,
	min_alt_finding_target = 0,
	pos = {0.0, 12.8, 0.0},
}

GT.animation_arguments = {
	nav_lights = 69,
	radar1_rotation = 5,
	radar2_rotation = 6,
	radar3_rotation = 12,
	flag_animation = 11,
	water_propeller = 30,
	alarm_state = -1
}
GT.radar1_period = 3.0
GT.radar2_period = 1.0
GT.radar3_period = 2.0

GT.DM = {
	{ area_name = "HULLSV", 		area_arg = 71, area_life = 75, area_fire = { connector = 'HULL_Point', 	size = 0.4}},
	{ area_name = "FDECK", 			area_arg = 72, area_life = 75, area_fire = { connector = 'FDECK_Point', size = 0.3}},
	{ area_name = "BOWSV", 			area_arg = 73, area_life = 75, area_fire = { connector = 'BOW_Point', size = 0.3}},
	{ area_name = "TOWERSV", 		area_arg = 74, area_life = 65, area_fire = { connector = 'TOWER_Point', size = 0.3}},
	{ area_name = "BRIDGESV",		area_arg = 75, area_life = 80, area_fire = { connector = 'BRIDGE_Point', size = 0.3}},
	{ area_name = "HARPOONSSV", 	area_arg = 76, area_life = 65, area_fire = { connector = 'HARPOONS_Point', size = 0.2}},
	{ area_name = "FTURRETSV", 		area_arg = 77, area_life = 65},
	{ area_name = "RAMTURRETSV", 	area_arg = 78, area_life = 65},
	{ area_name = "BTURRETL", 		area_arg = 79, area_life = 65},
	{ area_name = "BTURRETR", 		area_arg = 80, area_life = 65},
}

-- weapon systems
GT.WS = {}
GT.WS.maxTargetDetectionRange = 50000;

local ws;

-- forward OTO Melara 76 mm

ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.ship_MK75)
GT.WS[ws].area = 'FTURRETSV'
GT.WS[ws].center = 'CENTER_TURRETSV_01'
GT.WS[ws].drawArgument1 = 13
GT.WS[ws].drawArgument2 = 14
GT.WS[ws].reference_angle_Z = math.rad(5)
GT.WS[ws].angles = {
					{math.rad(170), math.rad(40), math.rad(-7.5), math.rad(65)},
					{math.rad(40), math.rad(-40), math.rad(0), math.rad(65)},
					{math.rad(-40), math.rad(-170), math.rad(-7.5), math.rad(65)},
					};
GT.WS[ws].LN[1].BR[1].connector_name = 'POINT_GUNSV_01'
				--recoilArgument = 117,
GT.WS[ws].LN[1].BR[1].recoilTime = 0.120;
--GT.WS[ws].cockpit = { "IronSight/IronSight", {-1.2, 0.1, 0.0 }, open = true};
--GT.WS[ws].LN[1].sightMasterMode = 1;

---------------------------------------------------------------------------------------------------------------------------------------------------------

-- RIM-116 Rolling Airframe Missile

ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.RIM_116)
GT.WS[ws].area = 'RAMTURRETSV'
GT.WS[ws].angles[1][1] = {math.rad(180), math.rad(-45), math.rad(45), math.rad(80)};
GT.WS[ws].angles[1][2] = {math.rad(-45), math.rad(-180), math.rad(-5), math.rad(80)};
GT.WS[ws].reference_angle_Z = math.rad(0)
GT.WS[ws].reference_angle_Y = math.rad(-90)
GT.WS[ws].center = 'SeaRamSV_Center_Point'
GT.WS[ws].drawArgument1 = 23
GT.WS[ws].drawArgument2 = 24
local LN_ = GT.WS[ws].LN[1]
LN_.BR = {{connector_name = 'POINT_SEARAMSV', drawArgument = 198},}

---------------------------------------------------------------------------------------------------------------------------------------------------------
				
-- Backward Bofor Left 40mm
ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.Bofors_40mm)
GT.WS[ws].area = 'BTURRETL'
GT.WS[ws].center = 'CENTER_BGUNL_01'
GT.WS[ws].drawArgument1 = 15
GT.WS[ws].drawArgument2 = 16
GT.WS[ws].reference_angle_Y = math.rad(-180)
GT.WS[ws].reference_angle_Z = math.rad(5)
GT.WS[ws].angles = {
					{math.rad(170), math.rad(0), math.rad(-10), math.rad(45)},
					};
GT.WS[ws].LN[1].BR[1].connector_name = 'POINT_BGUNL_01'
				--recoilArgument = 118,
				--recoilTime = 0.120}
--GT.WS[ws].cockpit = { "IronSight/IronSight", {-1.2, 0.1, 0.0 }, open = true};
--GT.WS[ws].LN[1].sightMasterMode = 1;

-- Backward Bofor Right 40mm
ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.Bofors_40mm)
GT.WS[ws].area = 'BTURRETR'
GT.WS[ws].center = 'CENTER_BGUNR_01'
GT.WS[ws].drawArgument1 = 17
GT.WS[ws].drawArgument2 = 18
GT.WS[ws].reference_angle_Y = math.rad(-180)
GT.WS[ws].reference_angle_Z = math.rad(5)
GT.WS[ws].angles = {
					{math.rad(0), math.rad(-170), math.rad(-10), math.rad(45)},
					};
GT.WS[ws].LN[1].BR[1].connector_name = 'POINT_BGUNR_01'
				--recoilArgument = 118,
				--recoilTime = 0.120}
--GT.WS[ws].cockpit = { "IronSight/IronSight", {-1.2, 0.1, 0.0 }, open = true};
--GT.WS[ws].LN[1].sightMasterMode = 1;

---------------------------------------------------------------------------------------------

-- Harpoon

ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.ship_HARPOON )
GT.WS[ws].area = 'HARPOONSSV';
GT.WS[ws].center = 'Rocket_Point_125'
GT.WS[ws].pos = {14.459,-0.989,9.471}

GT.WS[ws].LN[1].PL[1].ammo_capacity = 4;
GT.WS[ws].LN[1].BR = {
		{connector_name = 'Rocket_Point_123', drawArgument = 153},
		{connector_name = 'Rocket_Point_124', drawArgument = 154},
		{connector_name = 'Rocket_Point_125', drawArgument = 155},
		{connector_name = 'Rocket_Point_126', drawArgument = 156},
}

ws = GT_t.inc_ws();
GT.WS[ws] = {}
set_recursive_metatable(GT.WS[ws], GT_t.WS_t.ship_HARPOON )
GT.WS[ws].area = 'HARPOONSSV';
GT.WS[ws].center = 'Rocket_Point_129'
GT.WS[ws].pos = {14.459,0.68,7.65}

GT.WS[ws].LN[1].PL[1].ammo_capacity = 4;
GT.WS[ws].LN[1].BR = {
		{connector_name = 'Rocket_Point_127', drawArgument = 157},
		{connector_name = 'Rocket_Point_128', drawArgument = 158},
		{connector_name = 'Rocket_Point_129', drawArgument = 159},
		{connector_name = 'Rocket_Point_130', drawArgument = 160},
}

GT.Name = "ROUSSEN"
GT.DisplayName = _("FACM Roussen, Super Vita")
GT.DisplayNameShort = _("Roussen")
GT.Rate = 1100

GT.Sensors = {  OPTIC = {"long-range naval optics", "long-range naval LLTV"},
				RADAR = {"molniya search radar"}
            };

GT.DetectionRange  = GT.airFindDist;
GT.ThreatRange = GT.airWeaponDist;
GT.Singleton   = "no";
GT.mapclasskey = "P0091000070";
GT.attribute = {wsType_Navy,wsType_Ship,wsType_ArmedShip, WSTYPE_PLACEHOLDER,
                    "Corvettes",
					"DetectionByAWACS",
					"NO_SAM"
				};
GT.Categories = {
					{name = "Armed Ship"},
				};
GT.tags  =
{
	"Fast Attack Craft",
}
GT.Countries = {"Greece"}

add_surface_unit(GT)	