Skip to content

Commit

Permalink
New E2/SF functions + SA accuracy buff(again)
Browse files Browse the repository at this point in the history
  • Loading branch information
KemGus committed Oct 7, 2023
1 parent d975420 commit 7fd4d52
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lua/acf/shared/guns/semiauto.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--define the class
ACF_defineGunClass("SA", {
type = "Gun",
spread = 0.131,
spread = 0.11,
name = "Semiautomatic Cannon",
desc = ACFTranslation.GunClasses[12],
muzzleflash = "30mm_muzzleflash_noscale",
Expand Down
9 changes: 5 additions & 4 deletions lua/autorun/acf_globals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,20 @@ if CLIENT then
else
local curveFactor = 2.5
local reset_timer = 60

ACF.Wind = Vector()
timer.Create("ACE_Wind", reset_timer, 0, function()
local smokeDir = Vector(math.Rand(-1, 1), math.Rand(-1, 1), 0):GetNormalized()
local wind = (math.random() ^ curveFactor) * smokeDir * GetConVar("acf_wind"):GetFloat()
ACF.Wind = (math.random() ^ curveFactor) * smokeDir * GetConVar("acf_wind"):GetFloat()
net.Start("ACE_Wind")
net.WriteFloat(wind.x)
net.WriteFloat(wind.y)
net.WriteFloat(ACF.Wind.x)
net.WriteFloat(ACF.Wind.y)
net.Broadcast()
end)
end




cleanup.Register( "aceexplosives" )

AddCSLuaFile("autorun/acf_missile/folder.lua")
Expand Down
10 changes: 10 additions & 0 deletions lua/entities/gmod_wire_expression2/core/custom/acffunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,16 @@ do
e2function number acfCurVersion()
return ACF.Version
end

--returns global variable about air effectiveness against heat
e2function number acfHEATAirGapFactor()
return ACF.HEATAirGapFactor
end

--returns acfWindVector
e2function vector acfWindVector()
return ACF.Wind
end
end

-- [ Engine Functions ] --
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ E2Helper.Descriptions["acfDragDiv"] = "Returns current ACF drag divisor."
E2Helper.Descriptions["acfHeat"] = "Returns heat of an ACF entity."
E2Helper.Descriptions["acfVersion"] = "Returns latest git version of ACE."
E2Helper.Descriptions["acfCurVersion"] = "Returns current version of ACE."

E2Helper.Descriptions["acfHEATAirGapFactor"] = "% velocity loss for every meter traveled. 0.2x means HEAT loses 20% of its energy every 2m traveled. 1m is about typical for the sideskirt spaced armor of most tanks."
E2Helper.Descriptions["acfWindVector()"] = "Returns acf wind direction(vector)"
--engine
E2Helper.Descriptions["acfMaxTorque"] = "Returns the maximum torque (in N/m) of an ACF engine."
E2Helper.Descriptions["acfMaxPower"] = "Returns the maximum power (in kW) of an ACF engine."
Expand Down
18 changes: 18 additions & 0 deletions lua/starfall/libs_sv/acf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,24 @@ function acf_library.getCurrentVersion()
return version
end

--- returns % velocity loss for every meter traveled. 0.2x means HEAT loses 20% of its energy every 2m traveled. 1m is about typical for the sideskirt spaced armor of most tanks.
-- @server
-- @return number
function acf_library.getHEATAirGapFactor()
local airgapfactor = ACF.HEATAirGapFactor

return airgapfactor
end

--- Returns acf wind direction(vector)
-- @server
-- @return vector
function acf_library.getWindVector()
local windVector = ACF.Wind

return windVector
end

----------------------------------------
-- Entity Methods

Expand Down

0 comments on commit 7fd4d52

Please sign in to comment.