Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions lua/acf/server/sv_acfbase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function ACF_Activate ( Entity , Recalc )
else
local Size = Entity.OBBMaxs(Entity) - Entity.OBBMins(Entity)
if not Entity.ACF.Aera then
Entity.ACF.Aera = ((Size.x * Size.y)+(Size.x * Size.z)+(Size.y * Size.z)) * 6.45
Entity.ACF.Aera = ((Size.x * Size.y)+(Size.x * Size.z)+(Size.y * Size.z)) * 6.45 --^ 1.15
end
--if not Entity.ACF.Volume then
-- Entity.ACF.Volume = Size.x * Size.y * Size.z * 16.38
Expand All @@ -56,16 +56,16 @@ function ACF_Activate ( Entity , Recalc )
local Armour = ACF_CalcArmor( Area, Ductility, Entity:GetPhysicsObject():GetMass() ) -- So we get the equivalent thickness of that prop in mm if all its weight was a steel plate
local Health = ( Area / ACF.Threshold ) * ( 1 + Ductility ) -- Setting the threshold of the prop aera gone

local Percent = 1
local Percent = 1

if Recalc and Entity.ACF.Health and Entity.ACF.MaxHealth then
Percent = Entity.ACF.Health/Entity.ACF.MaxHealth
end

Entity.ACF.Health = Health * Percent
Entity.ACF.MaxHealth = Health
Entity.ACF.Armour = Armour * (0.5 + Percent/2)
Entity.ACF.MaxArmour = Armour * ACF.ArmorMod
Entity.ACF.Armour = (Armour) * (0.5 + Percent/2)
Entity.ACF.MaxArmour = (Armour) * ACF.ArmorMod
Entity.ACF.Type = nil
Entity.ACF.Mass = PhysObj:GetMass()
--Entity.ACF.Density = (PhysObj:GetMass()*1000)/Entity.ACF.Volume
Expand Down Expand Up @@ -133,8 +133,21 @@ function ACF_CalcDamage( Entity , Energy , FrAera , Angle )
local maxPenetration = (Energy.Penetration / FrAera) * ACF.KEtoRHA --RHA Penetration

local HitRes = {}


if istable(Entity) == false then -- ACF feeds us a table for some reason when we shoot living things.
if (!Entity:IsNPC() and !Entity:IsPlayer()) and (!Entity:IsNextBot()) then -- Don't do this to living things!

if Entity:GetCollisionBounds() != Entity:GetModelBounds() then -- Did they do the makespherical cheat?
armor = 1
losArmor = 1
end
end
end

local dmul = 1--This actually controls overall prop damage from rounds. It should be in globals but i'm suck's at Coding's -karb

--BNK Stuff
local dmul = 1
if (ISBNK) then
local cvar = GetConVarNumber("sbox_godmode")

Expand Down Expand Up @@ -192,14 +205,16 @@ end
function ACF_PropDamage( Entity , Energy , FrAera , Angle , Inflictor , Bone )

local HitRes = ACF_CalcDamage( Entity , Energy , FrAera , Angle )


HitRes.Kill = false
if HitRes.Damage >= Entity.ACF.Health then
HitRes.Kill = true
else
Entity.ACF.Health = Entity.ACF.Health - HitRes.Damage
Entity.ACF.Armour = Entity.ACF.MaxArmour * (0.5 + Entity.ACF.Health/Entity.ACF.MaxHealth/2) --Simulating the plate weakening after a hit
Entity.ACF.Armour = math.Clamp(Entity.ACF.MaxArmour * (0.5 + Entity.ACF.Health/Entity.ACF.MaxHealth/2)^1.7, Entity.ACF.MaxArmour*0.25, Entity.ACF.MaxArmour) --Simulating the plate weakening after a hit

--math.Clamp( Entity.ACF.Ductility, -0.8, 0.8 )
if Entity.ACF.PrHealth then
ACF_UpdateVisualHealth(Entity)
end
Expand Down Expand Up @@ -305,7 +320,7 @@ function ACF_SquishyDamage( Entity , Energy , FrAera , Angle , Inflictor , Bone,

end

local dmul = 2.5
local dmul = 1

--BNK stuff
if (ISBNK) then
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/server/sv_acfdamage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function ACF_RoundImpact( Bullet, Speed, Energy, Target, HitPos, HitNormal , Bon
-- Checking for ricochet
if ricoProb > math.random() and Angle < 90 then
Ricochet = math.Clamp(Angle / 90, 0.05, 1) -- atleast 5% of energy is kept
HitRes.Loss = 1 - Ricochet
HitRes.Loss = 0.25 - Ricochet
Energy.Kinetic = Energy.Kinetic * HitRes.Loss
end
end
Expand Down
10 changes: 5 additions & 5 deletions lua/acf/shared/guns/autocannon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("AC", {
name = "Autocannon",
desc = "Autocannons have a rather high weight and bulk for the ammo they fire, but they can fire it extremely fast.",
muzzleflash = "30mm_muzzleflash_noscale",
rofmod = 0.35,
rofmod = 0.85,
sound = "weapons/ACF_Gun/ac_fire4.wav",
soundDistance = " ",
soundNormal = " "
Expand All @@ -19,7 +19,7 @@ ACF_defineGun("20mmAC", { --id
gunclass = "AC",
weight = 225,
year = 1930,
rofmod = 1.8,
rofmod = 0.7,
magsize = 100,
magreload = 3,
round = {
Expand All @@ -36,7 +36,7 @@ ACF_defineGun("30mmAC", {
caliber = 3.0,
weight = 960,
year = 1935,
rofmod = 1,
rofmod = 0.5,
magsize = 75,
magreload = 3,
round = {
Expand All @@ -53,7 +53,7 @@ ACF_defineGun("40mmAC", {
caliber = 4.0,
weight = 1500,
year = 1940,
rofmod = 0.92,
rofmod = 0.48,
magsize = 30,
magreload = 3,
round = {
Expand All @@ -70,7 +70,7 @@ ACF_defineGun("50mmAC", {
caliber = 5.0,
weight = 2130,
year = 1965,
rofmod = 0.9,
rofmod = 0.4,
magsize = 20,
magreload = 3,
round = {
Expand Down
18 changes: 17 additions & 1 deletion lua/acf/shared/guns/cannon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("C", {
name = "Cannon",
desc = "High velocity guns that can fire very powerful ammunition, but are rather slow to reload.",
muzzleflash = "120mm_muzzleflash_noscale",
rofmod = 1.5,
rofmod = 2,
sound = "weapons/ACF_Gun/cannon_new.wav",
soundDistance = "Cannon.Fire",
soundNormal = " "
Expand Down Expand Up @@ -55,6 +55,22 @@ ACF_defineGun("75mmC", {
propweight = 3.8
}
} )


ACF_defineGun("85mmC", {
name = "85mm Cannon",
desc = "You can stop asking, we've got it now.",
model = "models/tankgun/tankgun_85mm.mdl",
gunclass = "C",
caliber = 8.5,
weight = 2085,
year = 1944,
round = {
maxlength = 85.5,
propweight = 6.65
}
} )


ACF_defineGun("100mmC", {
name = "100mm Cannon",
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/shared/guns/howitzer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("HW", {
name = "Howitzer",
desc = "Howitzers are limited to rather mediocre muzzle velocities, but can fire extremely heavy projectiles with large useful payload capacities.",
muzzleflash = "120mm_muzzleflash_noscale",
rofmod = 1.3,
rofmod = 1.8,
sound = "weapons/ACF_Gun/howitzer_new2.wav",
soundDistance = "Howitzer.Fire",
soundNormal = " "
Expand Down
6 changes: 3 additions & 3 deletions lua/acf/shared/guns/machinegun.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ACF_defineGun("12.7mmMG", {
caliber = 1.27,
weight = 30,
year = 1910,
rofmod = 0.766,
rofmod = 1, --0.766
magsize = 150,
magreload = 6,
round = {
Expand All @@ -56,7 +56,7 @@ ACF_defineGun("14.5mmMG", {
caliber = 1.45,
weight = 45,
year = 1932,
rofmod = 0.72,
rofmod = 1, --0.722
magsize = 90,
magreload = 5,
round = {
Expand All @@ -73,7 +73,7 @@ ACF_defineGun("20mmMG", {
caliber = 2.0,
weight = 95,
year = 1935,
rofmod = 0.55,
rofmod = 0.3,
magsize = 50,
magreload = 4,
round = {
Expand Down
2 changes: 1 addition & 1 deletion lua/acf/shared/guns/mortar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("MO", {
name = "Mortar",
desc = "Mortars are able to fire shells with usefull payloads from a light weight gun, at the price of limited velocities.",
muzzleflash = "40mm_muzzleflash_noscale",
rofmod = 2,
rofmod = 2.5,
sound = "weapons/ACF_Gun/mortar_new.wav",
soundDistance = "Mortar.Fire",
soundNormal = " "
Expand Down
12 changes: 6 additions & 6 deletions lua/acf/shared/guns/semiauto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("SA", {
name = "Semiautomatic Cannon",
desc = "Semiautomatic cannons offer better payloads than autocannons and less weight at the cost of rate of fire.",
muzzleflash = "30mm_muzzleflash_noscale",
rofmod = 0.5,
rofmod = 0.85,
sound = "acf_extra/tankfx/gnomefather/25mm1.wav",
soundDistance = " ",
soundNormal = " "
Expand All @@ -19,7 +19,7 @@ ACF_defineGun("25mmSA", { --id
caliber = 2.5,
weight = 200,
year = 1935,
rofmod = 1.224,
rofmod = 1,
magsize = 5,
magreload = 2,
round = {
Expand All @@ -36,7 +36,7 @@ ACF_defineGun("37mmSA", {
caliber = 3.7,
weight = 540,
year = 1940,
rofmod = 1.063,
rofmod = 0.7,
magsize = 5,
magreload = 3.5,
round = {
Expand All @@ -53,7 +53,7 @@ ACF_defineGun("45mmSA", {
caliber = 4.5,
weight = 870,
year = 1965,
rofmod = 1,
rofmod = 0.72,
magsize = 5,
magreload = 4,
round = {
Expand All @@ -70,7 +70,7 @@ ACF_defineGun("57mmSA", {
caliber = 5.7,
weight = 1560,
year = 1965,
rofmod = 1,
rofmod = 0.8,
magsize = 5,
magreload = 4.5,
round = {
Expand All @@ -87,7 +87,7 @@ ACF_defineGun("76mmSA", {
caliber = 7.62,
weight = 2990,
year = 1984,
rofmod = 1,
rofmod = 0.85,
magsize = 5,
magreload = 5,
round = {
Expand Down
18 changes: 17 additions & 1 deletion lua/acf/shared/guns/shortcannon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ACF_defineGunClass("SC", {
name = "Short-Barrel Cannon",
desc = "Short cannons trade muzzle velocity and accuracy for lighter weight and smaller size, with more penetration than howitzers and lighter than cannons.",
muzzleflash = "120mm_muzzleflash_noscale",
rofmod = 1.3,
rofmod = 1.7,
sound = "weapons/ACF_Gun/cannon_new.wav",
soundDistance = "Cannon.Fire",
soundNormal = " "
Expand Down Expand Up @@ -34,6 +34,7 @@ ACF_defineGun("50mmSC", {
gunclass = "SC",
caliber = 5.0,
weight = 330,
rofmod = 1.4,
year = 1915,
sound = "weapons/ACF_Gun/ac_fire4.wav",
round = {
Expand All @@ -56,6 +57,21 @@ ACF_defineGun("75mmSC", {
}
} )

ACF_defineGun("85mmSC", {
name = "85mm Short Cannon",
desc = "Like the 85mm Cannon except shorter and mildly angrier.",
model = "models/tankgun/tankgun_short_85mm.mdl",
gunclass = "SC",
caliber = 8.5,
weight = 1250,
year = 1942,
round = {
maxlength = 84.5,
propweight = 3.25
}
} )


ACF_defineGun("100mmSC", {
name = "100mm Short Cannon",
desc = "The 100mm is an effective infantry-support or antitank weapon, with a lot of uses and surprising lethality.",
Expand Down
72 changes: 72 additions & 0 deletions lua/acf/shared/guns/smoothbore.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
--define the class
ACF_defineGunClass("SB", {
spread = 0.08,
name = "Smoothbore Cannon",
desc = "More modern smoothbore cannons that can only fire munitions that do not rely on spinning for accuracy.",
muzzleflash = "120mm_muzzleflash_noscale",
rofmod = 1.72,
sound = "weapons/ACF_Gun/cannon_new.wav",
soundDistance = "Cannon.Fire",
soundNormal = " "
} )

--add a gun to the class


ACF_defineGun("105mmSB", {
name = "105mm Smoothbore Cannon",
desc = "The 105mm was a benchmark for the early cold war period, and has great muzzle velocity and hitting power, while still boasting a respectable, if small, payload.",
model = "models/tankgun_old/tankgun_100mm.mdl",
gunclass = "SB",
caliber = 10.5,
weight = 3550,
year = 1970,
round = {
maxlength = 93+8,
propweight = 9
}
} )

ACF_defineGun("120mmSB", {
name = "120mm Smoothbore Cannon",
desc = "Often found in MBTs, the 120mm shreds lighter armor with utter impunity, and is formidable against even the big boys.",
model = "models/tankgun_old/tankgun_120mm.mdl",
gunclass = "SB",
caliber = 12.0,
weight = 6000,
year = 1975,
round = {
maxlength = 110+13,
propweight = 18
}
} )

ACF_defineGun("140mmSB", {
name = "140mm Smoothbore Cannon",
desc = "The 140mm fires a massive shell with enormous penetrative capability, but has a glacial reload speed and a very hefty weight.",
model = "models/tankgun_old/tankgun_140mm.mdl",
gunclass = "SB",
caliber = 14.0,
weight = 8980,
year = 1990,
round = {
maxlength = 127+18,
propweight = 28
}
} )

--[[
ACF_defineGun("170mmC", {
name = "170mm Cannon",
desc = "The 170mm fires a gigantic shell with ginormous penetrative capability, but has a glacial reload speed and an extremely hefty weight.",
model = "models/tankgun/tankgun_170mm.mdl",
gunclass = "C",
caliber = 17.0,
weight = 12350,
year = 1990,
round = {
maxlength = 154,
propweight = 34
}
} )
]]--
2 changes: 1 addition & 1 deletion lua/acf/shared/rounds/roundap.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

AddCSLuaFile()

ACF.AmmoBlacklist.AP = { "MO", "SL" }
ACF.AmmoBlacklist.AP = { "MO", "SL", "SB" }

local Round = {}

Expand Down
Loading