Skip to content

Commit

Permalink
Added basic scalable information to weapon definitions
Browse files Browse the repository at this point in the history
- Added basic information to start providing scalability support to weapons.
  • Loading branch information
TwistedTail committed Feb 14, 2021
1 parent 64e0ee1 commit 03a7387
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 102 deletions.
34 changes: 27 additions & 7 deletions lua/acf/shared/weapons/autocannon.lua
Original file line number Diff line number Diff line change
@@ -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
},
})

Expand Down
34 changes: 27 additions & 7 deletions lua/acf/shared/weapons/autoloader.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand Down
25 changes: 18 additions & 7 deletions lua/acf/shared/weapons/cannon.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand Down
41 changes: 33 additions & 8 deletions lua/acf/shared/weapons/grenadelauncher.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand All @@ -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))
40 changes: 30 additions & 10 deletions lua/acf/shared/weapons/heavymachinegun.lua
Original file line number Diff line number Diff line change
@@ -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", {
Expand Down
22 changes: 15 additions & 7 deletions lua/acf/shared/weapons/howitzer.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand Down
38 changes: 29 additions & 9 deletions lua/acf/shared/weapons/machinegun.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand All @@ -24,7 +44,7 @@ ACF.RegisterWeapon("7.62mmMG", "MG", {
Round = {
MaxLength = 13,
PropMass = 0.04,
}
},
})

ACF.RegisterWeapon("12.7mmMG", "MG", {
Expand Down
23 changes: 16 additions & 7 deletions lua/acf/shared/weapons/mortar.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand Down
42 changes: 35 additions & 7 deletions lua/acf/shared/weapons/rotaryautocannon.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})

Expand Down Expand Up @@ -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))
Loading

0 comments on commit 03a7387

Please sign in to comment.