Skip to content

Commit

Permalink
Flamethrowers now have a shorter cooldown for more of a stream of fir…
Browse files Browse the repository at this point in the history
…e, ammo has been raised to account for this, flamethrower firing sound is now a loop
  • Loading branch information
Dakota0001 committed Oct 22, 2020
1 parent 0eb8610 commit 11c0752
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lua/autorun/SERVER/daktektankballistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
]]--

function PersistFire(Pos, owner, gun)
timer.Create( "DTPersistFire"..(Pos.x)..CurTime(), 0.25, 40, function() FireBurn(Pos, owner, gun) end )
timer.Create( "DTPersistFire"..(Pos.x)..CurTime(), 0.5, 20, function() FireBurn(Pos, owner, gun) end )
end

function FireBurn(Pos, owner, gun)
Expand Down
2 changes: 1 addition & 1 deletion lua/effects/dakteflamefire/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function EFFECT:Init( data )
local emitter = ParticleEmitter( Pos )

if not(Ent==NULL) then
for i = 1,5 do
for i = 1,0 do

local particle = emitter:Add( "dak/smokey", Pos + Ent:GetForward()*math.random( -0, 0 ))

Expand Down
10 changes: 5 additions & 5 deletions lua/effects/dakteflameimpact/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function EFFECT:Init( data )

local emitter = ParticleEmitter( Pos )

for i = 1,10 do
for i = 1,1 do

local particle = emitter:Add( "dak/smokey", Pos)

Expand All @@ -50,7 +50,7 @@ function EFFECT:Init( data )
end
end
local ScaleSize = 2
for i = 1,20 do
for i = 1,3 do
local ang = math.Rand(0,360) * math.pi/180
local particle = emitter:Add( "effects/fire_cloud2.vtf", Pos)
if particle == nil then particle = emitter:Add( "effects/fire_cloud2.vtf", Pos+Vector(25*math.Rand(0,1)*math.cos(ang),25*math.Rand(0,1)*math.sin(ang),math.random(-50,100))) end
Expand Down Expand Up @@ -80,7 +80,7 @@ function EFFECT:Init( data )
end )
end
end
for i = 1,20 do
for i = 1,3 do
local ang = math.Rand(0,360) * math.pi/180
local particle = emitter:Add( "effects/fire_cloud2.vtf", Pos)
if particle == nil then particle = emitter:Add( "effects/fire_cloud2.vtf", Pos+Vector(25*math.Rand(0,1)*math.cos(ang),25*math.Rand(0,1)*math.sin(ang),math.random(-50,100))) end
Expand Down Expand Up @@ -110,7 +110,7 @@ function EFFECT:Init( data )
end )
end
end
for i = 1,10 do
for i = 1,1 do
local ang = math.Rand(0,360) * math.pi/180
local particle = emitter:Add( "effects/fire_cloud1.vtf", Pos)
if particle == nil then particle = emitter:Add( "effects/fire_cloud1.vtf", Pos+Vector(25*math.Rand(0,1)*math.cos(ang),25*math.Rand(0,1)*math.sin(ang),math.random(-50,100))) end
Expand Down Expand Up @@ -140,7 +140,7 @@ function EFFECT:Init( data )
end )
end
end
for i = 1,10 do
for i = 1,1 do
local ang = math.Rand(0,360) * math.pi/180
local particle = emitter:Add( "effects/fire_cloud1.vtf", Pos)
if particle == nil then particle = emitter:Add( "effects/fire_cloud1.vtf", Pos+Vector(25*math.Rand(0,1)*math.cos(ang),25*math.Rand(0,1)*math.sin(ang),math.random(-50,100))) end
Expand Down
10 changes: 5 additions & 5 deletions lua/effects/dakteflametrail/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function EFFECT:Init( data )
self:SetRenderBoundsWS( self.StartPos, self.EndPos )

local emitter = ParticleEmitter( self.StartPos )
for i = 1, 25 do
for i = 1, 4 do

local particle = emitter:Add( "effects/fire_cloud2.vtf", self.StartPos + self.Dir*math.Rand(0,self.Dist) )

Expand All @@ -56,7 +56,7 @@ function EFFECT:Init( data )
particle:SetBounce(0)
end
end
for i = 1, 15 do
for i = 1, 2 do

local particle = emitter:Add( "effects/fire_cloud1.vtf", self.StartPos + self.Dir*math.Rand(0,self.Dist) )

Expand All @@ -81,7 +81,7 @@ function EFFECT:Init( data )
end
end

for i = 1, 15 do
for i = 1, 2 do

local particle = emitter:Add( "dak/smokey", self.StartPos + self.Dir*math.Rand(0,self.Dist) )

Expand Down Expand Up @@ -181,6 +181,6 @@ function EFFECT:Think()
end

function EFFECT:Render()
--render.SetMaterial( self.Mat )
--render.DrawBeam( self.StartPos, self.EndPos, self.Caliber, 1, 0, Color( 255,175,50, 255 ) )
--render.SetMaterial( Material( "trails/plasma" ) )
--render.DrawBeam( self.StartPos, self.EndPos, 5, 1, 0, Color( 75,50,50, 100 ) )
end
4 changes: 2 additions & 2 deletions lua/entities/dak_teammo/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function ENT:Think()
if not(self.DakName == "Base Ammo") then
self.DakCaliber = tonumber(string.Split( self.DakName, "m" )[1])
if self.DakAmmoType == "Flamethrower Fuel" then
self.DakMaxAmmo = 150
self.DakMaxAmmo = 1000
if not(self.DakAmmo) then
self.DakAmmo = self.DakMaxAmmo
end
Expand Down Expand Up @@ -408,7 +408,7 @@ function ENT:PostEntityPaste( Player, Ent, CreatedEntities )

self.DakCaliber = tonumber(string.Split( self.DakName, "m" )[1])
if self.DakAmmoType == "Flamethrower Fuel" then
self.DakMaxAmmo = 150
self.DakMaxAmmo = 1000
if not(self.DakAmmo) then
self.DakAmmo = self.DakMaxAmmo
end
Expand Down
28 changes: 26 additions & 2 deletions lua/entities/dak_temachinegun/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function ENT:Think()
--Flamethrower
if self.DakGunType == "Flamethrower" then
self.DakName = "Flamethrower"
self.DakCooldown = 0.1
self.DakCooldown = 1/66
self.DakMaxHealth = 10
self.DakArmor = 50
self.DakMass = 50
Expand Down Expand Up @@ -555,12 +555,22 @@ function ENT:DakTEFire()
self:SetNWInt("FirePitch",self.DakFirePitch)
self:SetNWFloat("Caliber",self.DakCaliber)

if self.DakName == "Flamethrower" then
if self.FlameFiring == nil then self.FlameFiring = 0 end
if self.FlameFiring == 0 then
self:EmitSound( "daktanks/flamethrower_start.wav", 100, 95, 1, 6)
self:EmitSound( "daktanks/flamethrower_loop.wav", 100, 95, 1, 6)

--weapons/flame_thrower_fire_hit.wav
self.FlameFiring = 1
end
else
net.Start( "daktankshotfired" )
net.WriteVector( self:GetPos() )
net.WriteFloat( self.DakCaliber )
net.WriteString( FiringSound[math.random(1,3)] )
net.Broadcast()

end
--if self.DakCaliber>=40 then
-- self:SetNWBool("Firing",true)
-- timer.Create( "ResoundTimer"..self:EntIndex(), 0.1, 1, function()
Expand Down Expand Up @@ -595,6 +605,13 @@ function ENT:DakTEFire()
end
end
end
else
if self.FlameFiring == 1 then
self.FlameFiring = 0
self:StopSound( "daktanks/flamethrower_start.wav" )
self:StopSound( "daktanks/flamethrower_loop.wav" )
self:EmitSound( "daktanks/flamethrower_end.wav", 100, 95, 1, 6 )
end
end
end
if IsValid(self.DakTankCore) then
Expand Down Expand Up @@ -626,6 +643,13 @@ function ENT:TriggerInput(iname, value)
end)
else
timer.Remove( "RefireTimer"..self:EntIndex() )

if self.FlameFiring == 1 then
self.FlameFiring = 0
self:StopSound( "daktanks/flamethrower_start.wav" )
self:StopSound( "daktanks/flamethrower_loop.wav" )
self:EmitSound( "daktanks/flamethrower_end.wav", 100, 95, 1, 6 )
end
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions lua/weapons/gmod_tool/stools/daktankspawner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,8 @@ function TOOL:LeftClick( trace )
self.DakCaliber = 10
self.DakName = "Flamethrower Fuel Tank"
self.DakIsExplosive = true
self.DakAmmo = 150
self.DakMaxAmmo = 150
self.DakAmmo = 1000
self.DakMaxAmmo = 1000
self.DakAmmoType = "Flamethrower Fuel"
self.spawnedent:SetModel( "models/props_c17/canister_propane01a.mdl" )
end
Expand Down Expand Up @@ -2108,7 +2108,7 @@ function TOOL.BuildCPanel( panel )
end
gunList["Flamethrower"] = function()
DLabel:SetPos( 15, 380 )
DLabel:SetText( "Flamethrower\n\nFlamethrower capable of igniting infantry, softening armor and stalling engines.\n\nWeapon Stats:\nArmor: 50mm\nWeight: 50kg\nHealth: 10\nDamage: 5\nRate of Fire: 600 streams/minute\n" )
DLabel:SetText( "Flamethrower\n\nFlamethrower capable of igniting infantry, softening armor and stalling engines.\n\nWeapon Stats:\nArmor: 50mm\nWeight: 50kg\nHealth: 10\nDamage: 5\nRate of Fire: 3960 streams/minute\n" )
DermaNumSlider:SetVisible( false )
end
gunList["HMG"] = function()
Expand Down Expand Up @@ -2571,7 +2571,7 @@ function TOOL.BuildCPanel( panel )

if AmmoBoxSelect:GetSelected() == "Flamethrower" then
DLabel:SetPos( 15, 380 )
DLabel:SetText( "Flamethrower Fuel\n\nFlamethrower fuel tank, more armored than normal ammo boxes but more likely to be crit, use with caution.\n\nCrate Stats:\nArmor: 12.5mm\nWeight: 500kg\nHealth: 30\n\nFuel Stats:\nCapacity: 15 seconds\nDamage: 5\nRate of Fire: 600 streams/minute" )
DLabel:SetText( "Flamethrower Fuel\n\nFlamethrower fuel tank, more armored than normal ammo boxes but more likely to be crit, use with caution.\n\nCrate Stats:\nArmor: 12.5mm\nWeight: 500kg\nHealth: 30\n\nFuel Stats:\nCapacity: 15 seconds\nDamage: 5\nRate of Fire: 3960 streams/minute" )
RunConsoleCommand( "daktankspawner_SpawnSettings", "Flamethrower Fuel" )
RunConsoleCommand( "daktankspawner_SpawnEnt", "dak_teammo" )
else
Expand Down
Binary file added sound/daktanks/flamethrower_end.wav
Binary file not shown.
Binary file added sound/daktanks/flamethrower_loop.wav
Binary file not shown.
Binary file added sound/daktanks/flamethrower_start.wav
Binary file not shown.

0 comments on commit 11c0752

Please sign in to comment.