From 03a738730124434a1b3758b63ea6d79fce655eeb Mon Sep 17 00:00:00 2001 From: TwistedTail <8784231+TwistedTail@users.noreply.github.com> Date: Thu, 4 Feb 2021 14:29:39 -0300 Subject: [PATCH] Added basic scalable information to weapon definitions - Added basic information to start providing scalability support to weapons. --- lua/acf/shared/weapons/autocannon.lua | 34 ++++++++++++---- lua/acf/shared/weapons/autoloader.lua | 34 ++++++++++++---- lua/acf/shared/weapons/cannon.lua | 25 ++++++++---- lua/acf/shared/weapons/grenadelauncher.lua | 41 ++++++++++++++++---- lua/acf/shared/weapons/heavymachinegun.lua | 40 ++++++++++++++----- lua/acf/shared/weapons/howitzer.lua | 22 +++++++---- lua/acf/shared/weapons/machinegun.lua | 38 +++++++++++++----- lua/acf/shared/weapons/mortar.lua | 23 +++++++---- lua/acf/shared/weapons/rotaryautocannon.lua | 42 ++++++++++++++++---- lua/acf/shared/weapons/semiauto.lua | 36 +++++++++++++---- lua/acf/shared/weapons/shortcannon.lua | 25 ++++++++---- lua/acf/shared/weapons/smokelauncher.lua | 43 +++++++++++++++------ lua/acf/shared/weapons/smoothbore.lua | 23 +++++++---- 13 files changed, 324 insertions(+), 102 deletions(-) diff --git a/lua/acf/shared/weapons/autocannon.lua b/lua/acf/shared/weapons/autocannon.lua index 34d6c888f..1fb997fb4 100644 --- a/lua/acf/shared/weapons/autocannon.lua +++ b/lua/acf/shared/weapons/autocannon.lua @@ -1,12 +1,32 @@ ACF.RegisterWeaponClass("AC", { - Name = "Autocannon", - Description = "Autocannons have a rather high weight and bulk for the ammo they fire, but they can fire it extremely fast.", - MuzzleFlash = "auto_muzzleflash_noscale", - Spread = 0.2, - Sound = "acf_base/weapons/ac_fire4.mp3", + Name = "Autocannon", + Description = "Autocannons have a rather high weight and bulk for the ammo they fire, but they can fire it extremely fast.", + Model = "models/autocannon/autocannon_20mm.mdl", + Sound = "acf_base/weapons/ac_fire4.mp3", + MuzzleFlash = "auto_muzzleflash_noscale", + IsScalable = true, + Mass = 500, -- Relative to the model's volume + Spread = 0.2, Caliber = { - Min = 20, - Max = 50, + Base = 20, + Min = 20, + Max = 50, + }, + MagSize = { + Min = 100, + Max = 25, + }, + MagReload = { + Min = 15, + Max = 30, + }, + Cyclic = { + Min = 250, + Max = 175, + }, + Round = { + MaxLength = 32, -- Relative to the Base caliber, in cm + PropMass = 0.13, -- Relative to the model's volume }, }) diff --git a/lua/acf/shared/weapons/autoloader.lua b/lua/acf/shared/weapons/autoloader.lua index e799e4f2d..2f11a6de3 100644 --- a/lua/acf/shared/weapons/autoloader.lua +++ b/lua/acf/shared/weapons/autoloader.lua @@ -1,12 +1,32 @@ ACF.RegisterWeaponClass("AL", { - Name = "Autoloader", - Description = "A cannon with attached autoloading mechanism. While it allows for several quick shots, the mechanism adds considerable bulk, weight, and magazine reload time.", - MuzzleFlash = "cannon_muzzleflash_noscale", - Spread = 0.08, - Sound = "acf_base/weapons/autoloader.mp3", + Name = "Autoloader", + Description = "A cannon with attached autoloading mechanism. While it allows for several quick shots, the mechanism adds considerable bulk, weight, and magazine reload time.", + Model = "models/tankgun/tankgun_al_100mm.mdl", + Sound = "acf_base/weapons/autoloader.mp3", + MuzzleFlash = "cannon_muzzleflash_noscale", + IsScalable = true, + Mass = 3325, + Spread = 0.08, Caliber = { - Min = 75, - Max = 140, + Base = 100, + Min = 75, + Max = 140, + }, + MagSize = { + Min = 8, + Max = 5, + }, + MagReload = { + Min = 15, + Max = 35, + }, + Cyclic = { + Min = 30, + Max = 8, + }, + Round = { + MaxLength = 93, + PropMass = 9.5, }, }) diff --git a/lua/acf/shared/weapons/cannon.lua b/lua/acf/shared/weapons/cannon.lua index 9de9887f5..0d1b1e1e1 100644 --- a/lua/acf/shared/weapons/cannon.lua +++ b/lua/acf/shared/weapons/cannon.lua @@ -1,12 +1,23 @@ ACF.RegisterWeaponClass("C", { - Name = "Cannon", - Description = "High velocity guns that can fire very powerful ammunition, but are rather slow to reload.", - MuzzleFlash = "cannon_muzzleflash_noscale", - Spread = 0.08, - Sound = "acf_base/weapons/cannon_new.mp3", + Name = "Cannon", + Description = "High velocity guns that can fire very powerful ammunition, but are rather slow to reload.", + Model = "models/tankgun/tankgun_100mm.mdl", + Sound = "acf_base/weapons/cannon_new.mp3", + MuzzleFlash = "cannon_muzzleflash_noscale", + IsScalable = true, + Mass = 2750, + Spread = 0.08, Caliber = { - Min = 20, - Max = 140, + Base = 100, + Min = 20, + Max = 140, + }, + Sounds = { + [50] = "acf_base/weapons/ac_fire4.mp3", + }, + Round = { + MaxLength = 93, + PropMass = 9.5, }, }) diff --git a/lua/acf/shared/weapons/grenadelauncher.lua b/lua/acf/shared/weapons/grenadelauncher.lua index e31487ba1..e0e98378b 100644 --- a/lua/acf/shared/weapons/grenadelauncher.lua +++ b/lua/acf/shared/weapons/grenadelauncher.lua @@ -1,13 +1,34 @@ ACF.RegisterWeaponClass("GL", { - Name = "Grenade Launcher", - Description = "Grenade Launchers can fire shells with relatively large payloads at a fast rate, but with very limited velocities and poor accuracy.", - MuzzleFlash = "gl_muzzleflash_noscale", - Spread = 0.28, - Sound = "acf_base/weapons/grenadelauncher.mp3", - IsBoxed = true, + Name = "Grenade Launcher", + Description = "Grenade Launchers can fire shells with relatively large payloads at a fast rate, but with very limited velocities and poor accuracy.", + Sound = "acf_base/weapons/grenadelauncher.mp3", + Model = "models/launcher/40mmgl.mdl", + MuzzleFlash = "gl_muzzleflash_noscale", + DefaultAmmo = "HE", + IsScalable = true, + IsBoxed = true, + Mass = 55, + Spread = 0.28, Caliber = { - Min = 25, - Max = 40, + Base = 40, + Min = 25, + Max = 40, + }, + MagSize = { + Min = 100, + Max = 60, + }, + MagReload = { + Min = 7.5, + Max = 10, + }, + Cyclic = { + Min = 250, + Max = 200, + }, + Round = { + MaxLength = 7.5, + PropMass = 0.01, }, }) @@ -27,4 +48,8 @@ ACF.RegisterWeapon("40mmGL", "GL", { } }) +ACF.RegisterWeapon("40mmCL", "GL", { + Caliber = 40, +}) + ACF.SetCustomAttachment("models/launcher/40mmgl.mdl", "muzzle", Vector(19), Angle(0, 0, -180)) diff --git a/lua/acf/shared/weapons/heavymachinegun.lua b/lua/acf/shared/weapons/heavymachinegun.lua index 296ec43b1..f360b5f39 100644 --- a/lua/acf/shared/weapons/heavymachinegun.lua +++ b/lua/acf/shared/weapons/heavymachinegun.lua @@ -1,18 +1,38 @@ ACF.RegisterWeaponClass("HMG", { - Name = "Heavy Machinegun", - Description = "Designed as autocannons for aircraft, HMGs are rapid firing, lightweight, and compact but sacrifice accuracy, magazine size, and reload times.", - MuzzleFlash = "mg_muzzleflash_noscale", - Spread = 1.2, - Sound = "acf_base/weapons/mg_fire3.mp3", + Name = "Heavy Machinegun", + Description = "Designed as autocannons for aircraft, HMGs are rapid firing, lightweight, and compact but sacrifice accuracy, magazine size, and reload times.", + Model = "models/machinegun/machinegun_20mm_compact.mdl", + Sound = "acf_base/weapons/mg_fire3.mp3", + MuzzleFlash = "mg_muzzleflash_noscale", + IsScalable = true, + Mass = 160, + Spread = 1.2, Caliber = { - Min = 13, - Max = 40, + Base = 20, + Min = 13, + Max = 40, + }, + MagSize = { + Min = 50, + Max = 30, + }, + MagReload = { + Min = 7.5, + Max = 10, + }, + Cyclic = { + Min = 250, + Max = 200, + }, + Round = { + MaxLength = 30, + PropMass = 0.12, }, LongBarrel = { - Index = 2, + Index = 2, Submodel = 4, - NewPos = "muzzle2", - } + NewPos = "muzzle2", + }, }) ACF.RegisterWeapon("13mmHMG", "HMG", { diff --git a/lua/acf/shared/weapons/howitzer.lua b/lua/acf/shared/weapons/howitzer.lua index e32d3760c..bf1c1c952 100644 --- a/lua/acf/shared/weapons/howitzer.lua +++ b/lua/acf/shared/weapons/howitzer.lua @@ -1,12 +1,20 @@ ACF.RegisterWeaponClass("HW", { - Name = "Howitzer", - Description = "Howitzers are limited to rather mediocre muzzle velocities, but can fire extremely heavy projectiles with large useful payload capacities.", - MuzzleFlash = "howie_muzzleflash_noscale", - Spread = 0.1, - Sound = "acf_base/weapons/howitzer_new2.mp3", + Name = "Howitzer", + Description = "Howitzers are limited to rather mediocre muzzle velocities, but can fire extremely heavy projectiles with large useful payload capacities.", + Sound = "acf_base/weapons/howitzer_new2.mp3", + Model = "models/howitzer/howitzer_105mm.mdl", + MuzzleFlash = "howie_muzzleflash_noscale", + IsScalable = true, + Mass = 1480, + Spread = 0.1, Caliber = { - Min = 75, - Max = 203, + Base = 105, + Min = 75, + Max = 203, + }, + Round = { + MaxLength = 86, + PropMass = 3.75, }, }) diff --git a/lua/acf/shared/weapons/machinegun.lua b/lua/acf/shared/weapons/machinegun.lua index 3497c75f1..03cbec17d 100644 --- a/lua/acf/shared/weapons/machinegun.lua +++ b/lua/acf/shared/weapons/machinegun.lua @@ -1,13 +1,33 @@ ACF.RegisterWeaponClass("MG", { - Name = "Machinegun", - Description = "Machineguns are light guns that fire equally light bullets at a fast rate.", - MuzzleFlash = "mg_muzzleflash_noscale", - Spread = 0.16, - Sound = "acf_base/weapons/mg_fire4.mp3", - IsBoxed = true, + Name = "Machinegun", + Description = "Machineguns are light guns that fire equally light bullets at a fast rate.", + Model = "models/machinegun/machinegun_762mm.mdl", + Sound = "acf_base/weapons/mg_fire4.mp3", + MuzzleFlash = "mg_muzzleflash_noscale", + IsScalable = true, + IsBoxed = true, + Spread = 0.16, + Mass = 12, Caliber = { - Min = 5.56, - Max = 20, + Base = 7.62, + Min = 5.56, + Max = 20, + }, + MagSize = { + Min = 300, + Max = 200, + }, + MagReload = { + Min = 5, + Max = 8, + }, + Cyclic = { + Min = 800, + Max = 400, + }, + Round = { + MaxLength = 13, + PropMass = 0.04, }, }) @@ -24,7 +44,7 @@ ACF.RegisterWeapon("7.62mmMG", "MG", { Round = { MaxLength = 13, PropMass = 0.04, - } + }, }) ACF.RegisterWeapon("12.7mmMG", "MG", { diff --git a/lua/acf/shared/weapons/mortar.lua b/lua/acf/shared/weapons/mortar.lua index 31247f238..10ad7debd 100644 --- a/lua/acf/shared/weapons/mortar.lua +++ b/lua/acf/shared/weapons/mortar.lua @@ -1,12 +1,21 @@ ACF.RegisterWeaponClass("MO", { - Name = "Mortar", - Description = "Mortars are able to fire shells with usefull payloads from a light weight gun, at the price of limited velocities.", - MuzzleFlash = "mortar_muzzleflash_noscale", - Spread = 0.72, - Sound = "acf_base/weapons/mortar_new.mp3", + Name = "Mortar", + Description = "Mortars are able to fire shells with usefull payloads from a light weight gun, at the price of limited velocities.", + Sound = "acf_base/weapons/mortar_new.mp3", + Model = "models/mortar/mortar_120mm.mdl", + MuzzleFlash = "mortar_muzzleflash_noscale", + DefaultAmmo = "HE", + IsScalable = true, + Spread = 0.72, + Mass = 640, Caliber = { - Min = 37, - Max = 280, + Base = 120, + Min = 37, + Max = 280, + }, + Round = { + MaxLength = 45, + PropMass = 0.175, }, }) diff --git a/lua/acf/shared/weapons/rotaryautocannon.lua b/lua/acf/shared/weapons/rotaryautocannon.lua index 209401a69..e48c2ef3c 100644 --- a/lua/acf/shared/weapons/rotaryautocannon.lua +++ b/lua/acf/shared/weapons/rotaryautocannon.lua @@ -1,12 +1,32 @@ ACF.RegisterWeaponClass("RAC", { - Name = "Rotary Autocannon", - Description = "Rotary Autocannons sacrifice weight, bulk and accuracy over classic autocannons to get the highest rate of fire possible.", - MuzzleFlash = "mg_muzzleflash_noscale", - Spread = 0.48, - Sound = "acf_base/weapons/mg_fire3.mp3", + Name = "Rotary Autocannon", + Description = "Rotary Autocannons sacrifice weight, bulk and accuracy over classic autocannons to get the highest rate of fire possible.", + Model = "models/rotarycannon/kw/20mmrac.mdl", + Sound = "acf_base/weapons/mg_fire3.mp3", + MuzzleFlash = "mg_muzzleflash_noscale", + IsScalable = true, + Spread = 0.48, + Mass = 760, Caliber = { - Min = 7.62, - Max = 37, + Base = 20, + Min = 7.62, + Max = 37, + }, + MagSize = { + Min = 400, + Max = 100, + }, + MagReload = { + Min = 8, + Max = 20, + }, + Cyclic = { + Min = 2500, + Max = 1500, + }, + Round = { + MaxLength = 30, + PropMass = 0.12, }, }) @@ -58,6 +78,14 @@ ACF.RegisterWeapon("30mmRAC", "RAC", { } }) +ACF.RegisterWeapon("20mmHRAC", "RAC", { + Caliber = 20, +}) + +ACF.RegisterWeapon("30mmHRAC", "RAC", { + Caliber = 30, +}) + ACF.SetCustomAttachment("models/rotarycannon/kw/14_5mmrac.mdl", "muzzle", Vector(43.21, 0, 1.26)) ACF.SetCustomAttachment("models/rotarycannon/kw/20mmrac.mdl", "muzzle", Vector(59.6, 0, 1.74)) ACF.SetCustomAttachment("models/rotarycannon/kw/30mmrac.mdl", "muzzle", Vector(89.4, 0, 2.61)) diff --git a/lua/acf/shared/weapons/semiauto.lua b/lua/acf/shared/weapons/semiauto.lua index 5211aa7e5..4f8f2fcd1 100644 --- a/lua/acf/shared/weapons/semiauto.lua +++ b/lua/acf/shared/weapons/semiauto.lua @@ -1,13 +1,33 @@ ACF.RegisterWeaponClass("SA", { - Name = "Semiautomatic Cannon", - Description = "Semiautomatic cannons offer light weight, small size, and high rates of fire at the cost of often reloading and low accuracy.", - MuzzleFlash = "semi_muzzleflash_noscale", - Spread = 0.12, - Sound = "acf_base/weapons/sa_fire1.mp3", - IsBoxed = true, + Name = "Semiautomatic Cannon", + Description = "Semiautomatic cannons offer light weight, small size, and high rates of fire at the cost of often reloading and low accuracy.", + Model = "models/autocannon/semiautocannon_45mm.mdl", + Sound = "acf_base/weapons/sa_fire1.mp3", + MuzzleFlash = "semi_muzzleflash_noscale", + IsScalable = true, + IsBoxed = true, + Spread = 0.12, + Mass = 750, Caliber = { - Min = 20, - Max = 76, + Base = 45, + Min = 20, + Max = 76, + }, + MagSize = { + Min = 5, + Max = 5, + }, + MagReload = { + Min = 2, + Max = 7.6, + }, + Cyclic = { + Min = 325, + Max = 150, + }, + Round = { + MaxLength = 52, + PropMass = 1.8, }, }) diff --git a/lua/acf/shared/weapons/shortcannon.lua b/lua/acf/shared/weapons/shortcannon.lua index 3f567e160..f294d8052 100644 --- a/lua/acf/shared/weapons/shortcannon.lua +++ b/lua/acf/shared/weapons/shortcannon.lua @@ -1,13 +1,24 @@ ACF.RegisterWeaponClass("SC", { - Name = "Short-Barrelled Cannon", - Description = "Short cannons trade muzzle velocity and accuracy for lighter weight and smaller size, with more penetration than howitzers and lighter than cannons.", - MuzzleFlash = "cannon_muzzleflash_noscale", - Spread = 0.16, - Sound = "acf_base/weapons/cannon_new.mp3", + Name = "Short-Barrelled Cannon", + Description = "Short cannons trade muzzle velocity and accuracy for lighter weight and smaller size, with more penetration than howitzers and lighter than cannons.", + Model = "models/tankgun/tankgun_short_100mm.mdl", + Sound = "acf_base/weapons/cannon_new.mp3", + MuzzleFlash = "cannon_muzzleflash_noscale", + IsScalable = true, + Spread = 0.16, + Mass = 1750, Caliber = { - Min = 37, - Max = 140, + Base = 100, + Min = 20, + Max = 140, }, + Sounds = { + [50] = "acf_base/weapons/ac_fire4.mp3", + }, + Round = { + MaxLength = 93, + PropMass = 4.5, + } }) ACF.RegisterWeapon("37mmSC", "SC", { diff --git a/lua/acf/shared/weapons/smokelauncher.lua b/lua/acf/shared/weapons/smokelauncher.lua index dac8a8f50..e6cd9b638 100644 --- a/lua/acf/shared/weapons/smokelauncher.lua +++ b/lua/acf/shared/weapons/smokelauncher.lua @@ -1,20 +1,41 @@ ACF.RegisterWeaponClass("SL", { - Name = "Smoke Launcher", - Description = "Smoke launcher to block an attacker's line of sight.", - MuzzleFlash = "gl_muzzleflash_noscale", - Spread = 0.32, - Sound = "acf_base/weapons/smoke_launch.mp3", - IsBoxed = true, - Cleanup = "acf_smokelauncher", + Name = "Smoke Launcher", + Description = "Smoke launcher to block an attacker's line of sight.", + Sound = "acf_base/weapons/smoke_launch.mp3", + Model = "models/launcher/40mmsl.mdl", + MuzzleFlash = "gl_muzzleflash_noscale", + Cleanup = "acf_smokelauncher", + DefaultAmmo = "SM", + IsScalable = true, + IsBoxed = true, + Spread = 0.32, + Mass = 2, + Caliber = { + Base = 40, + Min = 40, + Max = 81, + }, + MagSize = { + Min = 1, + Max = 1, + }, + MagReload = { + Min = 20, + Max = 30, + }, + Cyclic = { + Min = 600, + Max = 600, + }, + Round = { + MaxLength = 17.5, + PropMass = 0.000075, + }, LimitConVar = { Name = "_acf_smokelauncher", Amount = 10, Text = "Maximum amount of ACF smoke launchers a player can create." }, - Caliber = { - Min = 40, - Max = 81, - }, }) ACF.RegisterWeapon("40mmSL", "SL", { diff --git a/lua/acf/shared/weapons/smoothbore.lua b/lua/acf/shared/weapons/smoothbore.lua index d6dc380e8..2a7bb7021 100644 --- a/lua/acf/shared/weapons/smoothbore.lua +++ b/lua/acf/shared/weapons/smoothbore.lua @@ -1,12 +1,21 @@ ACF.RegisterWeaponClass("SB", { - Name = "Smoothbore Cannon", - Description = "More modern smoothbore cannons that can only fire munitions that do not rely on spinning for accuracy.", - MuzzleFlash = "cannon_muzzleflash_noscale", - Spread = 0.08, - Sound = "acf_base/weapons/cannon_new.mp3", + Name = "Smoothbore Cannon", + Description = "More modern smoothbore cannons that can only fire munitions that do not rely on spinning for accuracy.", + Model = "models/tankgun_old/tankgun_100mm.mdl", + Sound = "acf_base/weapons/cannon_new.mp3", + MuzzleFlash = "cannon_muzzleflash_noscale", + DefaultAmmo = "APFSDS", + IsScalable = true, + Spread = 0.08, + Mass = 3550, Caliber = { - Min = 20, - Max = 140, + Base = 105, + Min = 105, + Max = 140, + }, + Round = { + MaxLength = 101, + PropMass = 9, }, })