Skip to content

Commit

Permalink
Merge pull request #353 from LiddulBOFH/dev
Browse files Browse the repository at this point in the history
Modify APHE penetration
  • Loading branch information
TwistedTail authored Jun 26, 2023
2 parents 7ae3025 + 8ae0f0c commit 392203d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lua/acf/entities/ammo_types/aphe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ function Ammo:OnLoaded()
}
end

function Ammo:GetPenetration(Bullet, Speed)
if not isnumber(Speed) then
Speed = Bullet.Flight and Bullet.Flight:Length() / ACF.Scale * 0.0254 or Bullet.MuzzleVel
end

return ACF.Penetration(Speed, Bullet.ProjMass, Bullet.Diameter * 10) * (1 - Bullet.FillerRatio)
end

function Ammo:GetDisplayData(Data)
local Display = Ammo.BaseClass.GetDisplayData(self, Data)
local FragMass = Data.ProjMass - Data.FillerMass
Expand Down Expand Up @@ -45,6 +53,7 @@ function Ammo:UpdateRoundData(ToolData, Data, GUIData)
Data.MuzzleVel = ACF.MuzzleVelocity(Data.PropMass, Data.ProjMass, Data.Efficiency)
Data.DragCoef = Data.ProjArea * 0.0001 / Data.ProjMass
Data.CartMass = Data.PropMass + Data.ProjMass
Data.FillerRatio = math.Clamp(ToolData.FillerRatio, 0, 1)

hook.Run("ACF_UpdateRoundData", self, ToolData, Data, GUIData)

Expand Down

0 comments on commit 392203d

Please sign in to comment.