--
-- file prepared: 8 February 2025 20:13:44.496, using fd705a
--

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


--
-- MG 17 round 1 (7.92)
--
declare_weapon({category = CAT_SHELLS,name = "PKT_7_7",
  user_name		= _("PKT_7_7"),
  model_name    = "tracer_bullet_red",
  v0    = 855.0,
  Dv0   = 0.0082,
  Da0     = 0.0004,
  Da1     = 0.0,
  mass      = 0.0096,
  explosive     = 0.0000,
  life_time     = 7,
  caliber     = 7.92,
  s         = 0.0,
  j         = 0.0,
  l         = 0.0,
  charTime    = 0,
  cx        = {1.0,0.62,0.65,0.175,1.8},
  k1        = 2.9e-08,
  tracer_off    = -100,
  scale_tracer  = 1, 
  cartridge = 0,

})

--
-- MG 17 round 2 (7.92)
--
declare_weapon({category = CAT_SHELLS, name =   "PKT_7_7_T",
  user_name		= _("PKT_7_7_T"),
  model_name    = "tracer_bullet_red",
  v0    = 855.0,
  Dv0   = 0.0082,
  Da0     = 0.0004,
  Da1     = 0.0,
  mass      = 0.0096,
  explosive     = 0.0000,
  life_time     = 7,
  caliber     = 7.92,
  s         = 0.0,
  j         = 0.0,
  l         = 0.0,
  charTime    = 0,
  cx        = {1.0,0.62,0.65,0.175,1.8},
  k1        = 2.9e-08,
  tracer_off    = 3,
  scale_tracer  = 1,
  cartridge = 0,
 
  --round_mass 	 = 0.260+0.058,		-- round + link
  --cartridge_mass = 0.058,			-- links are collected
  --tracer_on      = 0.01,

})

--
-- MG 17 cannon (7.92)
--
function MG_17(tbl)

	tbl.category = CAT_GUN_MOUNT 
	tbl.name 	 = "MG_17"
	tbl.supply 	 =
	{
		shells = {"PKT_7_7", "PKT_7_7_T" },
		mixes  = {{1,1,2,1,2}},
		count  = 1000,		
	}
	if tbl.mixes then 
	   tbl.supply.mixes =  tbl.mixes
	   tbl.mixes	    = nil
	end
	tbl.gun = 
	{
		max_burst_length = 25,
		rates 			 = {800},		---Type 89 
		recoil_coeff 	 = 0.2*1.3,
		barrels_count 	 = 1,
	}
	if tbl.rates then 
	   tbl.gun.rates    =  tbl.rates
	   tbl.rates	    = nil
	end	
	tbl.ejector_pos 			= tbl.ejector_pos or {-0.4, -1.2, 0.18}
	tbl.ejector_dir 			= {0,-1,0}
	tbl.supply_position  		= tbl.supply_position   or {0,  0.3, -0.3}
	tbl.aft_gun_mount 			= false
	tbl.effective_fire_distance = 1500
	tbl.drop_cartridge 			= 0
	tbl.muzzle_pos				= tbl.muzzle_pos 		 or  {0,0,0} -- all position from connector
	tbl.muzzle_pos_connector	= tbl.muzzle_pos_connector 		 or  "Gun_point" -- all position from connector
	tbl.azimuth_initial 		= tbl.azimuth_initial    or 0   
	tbl.elevation_initial 		= tbl.elevation_initial  or 0   
	if  tbl.effects == nil then
		tbl.effects = {{ name = "FireEffect"     , arg 		 = tbl.effect_arg_number or 436 },
					   { name = "HeatEffectExt"  , shot_heat = 7.823, barrel_k = 0.462 * 2.7, body_k = 0.462 * 14.3 },
					   { name = "SmokeEffect"}}
	end
	return declare_weapon(tbl)
end


--
--	note: the above is modelled after the example for the GSHG_7_62 cannons as found in Scripts\Database\Weapons\aircraft_gun_mounts.lua, and
--  the example for the PKT_7_62, and PKT_7_62_T rounds as found in Scripts\Database\Weapons\shell_table.lua
--



