Skip to content

Commit

Permalink
Merge pull request #105 from RedDeadlyCreeper/GunBalanceTweaks
Browse files Browse the repository at this point in the history
Some Balance Adjustments
  • Loading branch information
RedDeadlyCreeper committed Aug 7, 2024
2 parents 81668da + 4c21921 commit cb4e12d
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 70 deletions.
8 changes: 4 additions & 4 deletions lua/acf/server/sv_acfballistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ function GenerateMissile(MissileData,Crate,BData) --Shorthand function for gener
fuse:Configure(missile, missile.Guidance or missile:SetGuidance(ACF.Guidance.Dumb()))
end
end


local phys = missile:GetPhysicsObject()
if (IsValid(phys)) then
Expand All @@ -703,8 +703,8 @@ function GenerateMissile(MissileData,Crate,BData) --Shorthand function for gener
missile.MotorSound = MissileData.MotorSound
missile:EmitSound(missile.MotorSound, 500, 100, 1, CHAN_WEAPON ) --Formerly 107

if missile:IsValid() then
return true
end
--if missile:IsValid() then
return missile
--end

end
4 changes: 2 additions & 2 deletions lua/acf/shared/guidances/d_infrared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ this.Name = ClassName
this.Target = nil

-- Cone to acquire targets within.
this.SeekCone = 30
this.SeekCone = 12

-- Cone to retain targets within.
this.ViewCone = 60
this.ViewCone = 70

-- This instance must wait this long between target seeks.
this.SeekDelay = 0.1 -- Re-seek drastically reduced cost so we can re-seek
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/shared/guidances/j_topattackir.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ this.Name = ClassName
this.Target = nil

-- Cone to acquire targets within.
this.SeekCone = 15
this.SeekCone = 5

-- Cone to retain targets within.
this.ViewCone = 180
Expand Down
16 changes: 0 additions & 16 deletions lua/acf/shared/guns/grenadelauncher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,3 @@ ACF_defineGun("20mmGL", { --id
propweight = 0.005
}
} )

ACF_defineGun("40mmGLSingle", { --id
name = "40mm Single Grenade Launcher",
desc = "The 40mm grenade projecter excels at launching a small 40mm charge at nearby infantry or defending a tank from an incoming rocket.",
model = "models/launcher/40mmsl.mdl",
sound = "ace_weapons/multi_sound/smoke_multi.mp3",
gunclass = "GL",
caliber = 4.0,
weight = 5,
rofmod = 6,
year = 1940,
round = {
maxlength = 35,
propweight = 0.02
}
} )
24 changes: 12 additions & 12 deletions lua/acf/shared/guns/heavymachinegun.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--define the class
ACF_defineGunClass("HMG", {
type = "Gun",
spread = 0.25,
spread = 0.17,
name = "Heavy Machinegun",
desc = ACFTranslation.GunClasses[7],
muzzleflash = "MG",
rofmod = 0.17,
rofmod = 0.16,
year = 1935,
sound = "ace_weapons/multi_sound/30mm_hmg_multi.mp3",
noloader = true,
Expand Down Expand Up @@ -57,14 +57,14 @@ ACF_defineGun("20mmHMG", {
sound = "ace_weapons/multi_sound/20mm_hmg_multi.mp3",
gunclass = "HMG",
caliber = 2.0,
weight = 100,
weight = 80,
year = 1935,
rofmod = 1.2, --at 1.5, 675rpm; at 2.0, 480rpm
magsize = 60,
magreload = 8,
magreload = 5,
round = {
maxlength = 30,
propweight = 0.12
maxlength = 32,
propweight = 0.13
}
} )

Expand All @@ -75,13 +75,13 @@ ACF_defineGun("30mmHMG", {
sound = "ace_weapons/multi_sound/30mm_hmg_multi.mp3",
gunclass = "HMG",
caliber = 3.0,
weight = 180,
weight = 150,
year = 1941,
rofmod = 0.8, --at 1.05, 495rpm;
magsize = 50,
magreload = 10,
magreload = 6,
round = {
maxlength = 37,
maxlength = 39,
propweight = 0.35
}
} )
Expand All @@ -93,13 +93,13 @@ ACF_defineGun("40mmHMG", {
sound = "ace_weapons/multi_sound/30mm_hmg_multi.mp3",
gunclass = "HMG",
caliber = 4.0,
weight = 340,
weight = 300,
year = 1955,
rofmod = 0.95, --at 0.75, 455rpm
magsize = 35,
magreload = 10,
magreload = 7,
round = {
maxlength = 42,
maxlength = 45,
propweight = 0.9
}
} )
22 changes: 11 additions & 11 deletions lua/acf/shared/guns/semiauto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ ACF_defineGun("25mmSA", { --id
caliber = 2.5,
weight = 75,
year = 1935,
rofmod = 0.7,
magsize = 20,
magreload = 4,
rofmod = 0.45,
magsize = 12,
magreload = 2,
round = {
maxlength = 39,
propweight = 0.5
Expand All @@ -40,9 +40,9 @@ ACF_defineGun("37mmSA", {
caliber = 3.7,
weight = 180,
year = 1940,
rofmod = 0.5,
rofmod = 0.4,
magsize = 15,
magreload = 6,
magreload = 4,
round = {
maxlength = 42,
propweight = 1.125
Expand All @@ -58,9 +58,9 @@ ACF_defineGun("45mmSA", { --
caliber = 4.5,
weight = 495,
year = 1965,
rofmod = 0.47,
rofmod = 0.325,
magsize = 12,
magreload = 7,
magreload = 5,
round = {
maxlength = 52,
propweight = 1.8
Expand All @@ -76,9 +76,9 @@ ACF_defineGun("57mmSA", {
caliber = 5.7,
weight = 780,
year = 1965,
rofmod = 0.5,
rofmod = 0.4,
magsize = 12,
magreload = 10,
magreload = 9,
round = {
maxlength = 62,
propweight = 2
Expand All @@ -94,9 +94,9 @@ ACF_defineGun("76mmSA", {
caliber = 7.62,
weight = 1700,
year = 1984,
rofmod = 0.4,
rofmod = 0.325,
magsize = 12,
magreload = 10,
magreload = 12,
round = {
maxlength = 70,
propweight = 4.75
Expand Down
14 changes: 7 additions & 7 deletions lua/acf/shared/guns/shortcannon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ACF_defineGunClass("SC", {
name = "Short-Barrel Cannon",
desc = ACFTranslation.GunClasses[13],
muzzleflash = "MO",
rofmod = 1.3,
rofmod = 1.1,
maxrof = 25, -- maximum rounds per minute
year = 1915,
sound = "ace_weapons/multi_sound/100mm_multi.mp3",
Expand All @@ -21,7 +21,7 @@ ACF_defineGun("37mmSC", {
gunclass = "SC",
caliber = 3.7,
weight = 55,
maxrof = 40, -- maximum rounds per minute
maxrof = 60, -- maximum rounds per minute
year = 1915,
round = {
maxlength = 45,
Expand Down Expand Up @@ -53,7 +53,7 @@ ACF_defineGun("75mmSC", {
gunclass = "SC",
caliber = 7.5,
weight = 480,
maxrof = 25, -- maximum rounds per minute
maxrof = 35, -- maximum rounds per minute
year = 1936,
round = {
maxlength = 76,
Expand All @@ -68,7 +68,7 @@ ACF_defineGun("85mmSC", {
gunclass = "SC",
caliber = 8.5,
weight = 1250,
maxrof = 23, -- maximum rounds per minute
maxrof = 30, -- maximum rounds per minute
year = 1942,
round = {
maxlength = 84.5,
Expand All @@ -84,7 +84,7 @@ ACF_defineGun("100mmSC", {
gunclass = "SC",
caliber = 10.0,
weight = 1000,
maxrof = 18, -- maximum rounds per minute
maxrof = 25, -- maximum rounds per minute
year = 1940,
round = {
maxlength = 93,
Expand All @@ -100,7 +100,7 @@ ACF_defineGun("120mmSC", {
gunclass = "SC",
caliber = 12.0,
weight = 1400,
maxrof = 13, -- maximum rounds per minute
maxrof = 17, -- maximum rounds per minute
year = 1944,
round = {
maxlength = 110,
Expand All @@ -116,7 +116,7 @@ ACF_defineGun("140mmSC", {
gunclass = "SC",
caliber = 14.0,
weight = 2050,
maxrof = 9, -- maximum rounds per minute
maxrof = 12, -- maximum rounds per minute
year = 1999,
round = {
maxlength = 127,
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/shared/guns/smokelauncher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ACF_defineGunClass("SL", {
name = "Smoke Launcher",
desc = ACFTranslation.GunClasses[14],
muzzleflash = "MO",
rofmod = 45,
rofmod = 4,
year = 1941,
sound = "ace_weapons/multi_sound/smoke_multi.mp3",
nolights = true
Expand Down
4 changes: 2 additions & 2 deletions lua/acf/shared/rounds/roundapds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ function Round.convert( _, PlayerData )
Data.Ricochet = 68
elseif GunClass == "SA" then

Data.MinCalMult = 0.3
Data.MinCalMult = 0.23
Data.MaxCalMult = 1.0
Data.PenModifier = 2
Data.VelModifier = 1.6
Data.VelModifier = 1.7
Data.Ricochet = 68
elseif GunClass == "C" then

Expand Down
39 changes: 33 additions & 6 deletions lua/acf/shared/rounds/roundapfsds.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

AddCSLuaFile()

ACF.AmmoBlacklist.APFSDS = { "AC", "SA","C","MG", "HMG" ,"RAC", "SC","ATR" , "MO" , "RM", "SL", "GL", "HW", "SC", "BOMB" , "GBU", "ASM", "AAM", "SAM", "UAR", "POD", "FFAR", "ATGM", "ARTY", "ECM", "FGL"}
ACF.AmmoBlacklist.APFSDS = { "C","MG", "SC" , "MO" , "RM", "SL", "GL", "HW", "SC", "BOMB" , "GBU", "ASM", "AAM", "SAM", "UAR", "POD", "FFAR", "ATGM", "ARTY", "ECM", "FGL"}
ACF.AmmoBlacklist.APDS = { "MG", "MO", "RM", "SL", "GL", "HW", "SC", "BOMB" , "GBU", "AAM", "FFAR", "SAM", "FGL","SBC"}

local Round = {}

Expand Down Expand Up @@ -34,11 +35,37 @@ function Round.convert( _, PlayerData )

PlayerData, Data, ServerData, GUIData = ACF_RoundBaseGunpowder( PlayerData, Data, ServerData, GUIData )

Data.MinCalMult = 0.2
Data.MaxCalMult = 1.0
Data.PenModifier = 1.08 --for 120mm. 726 @ 1.1. 630 @1.3
Data.VelModifier = 1.1
Data.Ricochet = 80
local GunClass = ACF.Weapons["Guns"][Data["Id"] or PlayerData["Id"]]["gunclass"]

if GunClass == "AC" or GunClass == "HMG" then

Data.MinCalMult = 0.3
Data.MaxCalMult = 1.0
Data.PenModifier = 2 -- Autocannons are puny anyways
Data.VelModifier = 1.5
Data.Ricochet = 68
elseif GunClass == "RAC" then

Data.MinCalMult = 0.5
Data.MaxCalMult = 1.0
Data.PenModifier = 1.8
Data.VelModifier = 1.6
Data.Ricochet = 68
elseif GunClass == "SA" then

Data.MinCalMult = 0.22
Data.MaxCalMult = 1.0
Data.PenModifier = 2
Data.VelModifier = 1.475
Data.Ricochet = 68
else
Data.MinCalMult = 0.2
Data.MaxCalMult = 1.0
Data.PenModifier = 1.08 --for 120mm. 726 @ 1.1. 630 @1.3
Data.VelModifier = 1.1
Data.Ricochet = 80
end


--Used for adapting acf2 apds/apfsds to the new format
PlayerData.Data5 = math.Clamp(PlayerData.Data5,Data.MinCalMult,Data.MaxCalMult)
Expand Down
6 changes: 3 additions & 3 deletions lua/acf/shared/rounds/roundclusterap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ do
--Make cluster to fail. Allow with rounds on whitelist only.
--if not WhiteList[RoundType] then return end

local Bomblets = math.Round(math.Clamp(math.Round(bdata.ProjMass * 0.2),5,120) * (bdata.ClusterMult or 100) / 100) --30 bomblets original
local Bomblets = math.Round(math.Clamp(math.Round(bdata.ProjMass * 0.3),10,240) * (bdata.ClusterMult or 100) / 100) --30 bomblets original

local GEnt = bdata.Gun

Expand Down Expand Up @@ -199,7 +199,7 @@ do

local MuzzleVec = bullet.Flight:GetNormalized()
GEnt.BulletDataC = GEnt.BulletDataC or {}
local MuzzleSpeed = bullet.Flight:Length() + (GEnt.BulletDataC["MuzzleVel"] or 0) * 39.37
local MuzzleSpeed = bullet.Flight:Length() + (GEnt.BulletDataC["MuzzleVel"] or 0) * 2 * 39.37
local GunBData = GEnt.BulletDataC or {}
local CCount = GunBData.Bomblets or 0

Expand All @@ -212,7 +212,7 @@ do
--Spread = Spread
Spread = Vector(Spread.x * math.abs(Spread.x), Spread.y * math.abs(Spread.y), Spread.z * math.abs(Spread.z))
--GEnt.BulletDataC["Flight"] = (MuzzleVec + ( Spread * math.min((GEnt.BulletDataC.Bomblets/10) * 0.1 , 0.65))):GetNormalized() * GEnt.BulletDataC["MuzzleVel"] * 39.37 * math.Rand(0.5,1.0)
GEnt.BulletDataC["Flight"] = (MuzzleVec + ( Spread * 0.4)):GetNormalized() * MuzzleSpeed --Fixed scatter pattern since we're using the detonate offset to control spread.
GEnt.BulletDataC["Flight"] = (MuzzleVec + ( Spread * 0.2)):GetNormalized() * MuzzleSpeed --Fixed scatter pattern since we're using the detonate offset to control spread.

local MuzzlePos = bullet.Pos
GEnt.BulletDataC.Pos = MuzzlePos - MuzzleVec
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/shared/rounds/roundhe.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

AddCSLuaFile()

ACF.AmmoBlacklist.HE = { "MG", "SL", "ECM","ATR","SBC" }
ACF.AmmoBlacklist.HE = { "MG", "ECM","ATR","SBC" }

local Round = {}

Expand Down
2 changes: 1 addition & 1 deletion lua/entities/acf_gun/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ function ENT:LoadAmmo( AddTime, Reload )
Wire_TriggerOutput(self, "Muzzle Weight", math.floor(self.BulletData.ProjMass * 1000) )
Wire_TriggerOutput(self, "Muzzle Velocity", math.floor(self.BulletData.MuzzleVel * ACF.VelScale) )

self.KERecoil = (self.BulletData.PropMass * 39.37) * (GetConVar("acf_recoilpush"):GetFloat() or 1) * 500
self.KERecoil = (self.BulletData.PropMass * 39.37) * (GetConVar("acf_recoilpush"):GetFloat() or 1) * 1000

self.NextFire = curTime + self.ReloadTime
local reloadTime = self.ReloadTime
Expand Down
4 changes: 3 additions & 1 deletion lua/weapons/weapon_ace_javelin/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ function SWEP:PrimaryAttack()
BData.Crate = BData.FakeCrate:EntIndex()
--self:DeleteOnRemove(BData.FakeCrate)

GenerateMissile(MDat,BData.FakeCrate,BData)
local MisEnt = GenerateMissile(MDat,BData.FakeCrate,BData)
MisEnt.TargetPos = self.TarEnt:GetPos()

self:EmitSound(self.Primary.Sound)
self:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
self:GetOwner():SetAnimation(PLAYER_ATTACK1)
Expand Down
Loading

0 comments on commit cb4e12d

Please sign in to comment.