mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Add "flamethrower", "exhaust" and "exhaust_diy" thruster effects (#3231)
* Add entity:parentToAttachment() * Fix design oversight on timerSetDelay. * removed unnecessary logic * Added "exhaust" and "exhaust_diy" * Flamethrower effect & pictures * Revert "removed unnecessary logic" This reverts commita722a5e746
. * Revert "Fix design oversight on timerSetDelay." This reverts commite9fe870989
. * clean up flamethrower effect
This commit is contained in:
parent
93b7900481
commit
46f5d5c8e7
@ -318,6 +318,68 @@ WireLib.ThrusterEffectThink.smoke_firecolors = smoke(function() return math.rand
|
||||
WireLib.ThrusterEffectThink.smoke_random = smoke(function() return math.random(100, 255), math.random(100, 255), math.random(100, 255) end)
|
||||
WireLib.ThrusterEffectThink.smoke_diy = smoke(function(self) local c = self:GetColor() return c.r, c.g, c.b end)
|
||||
|
||||
local function exhaust(color)
|
||||
return function(self)
|
||||
|
||||
self.SmokeTimer = self.SmokeTimer or 0
|
||||
if ( self.SmokeTimer > CurTime() ) then return end
|
||||
|
||||
self.SmokeTimer = CurTime() + 0.015
|
||||
|
||||
local vOffset = self:LocalToWorld(self:GetOffset() + VectorRand(-1.5, 1.5) )
|
||||
local vNormal = self:CalcNormal()
|
||||
|
||||
local particle = emitter:Add( "particles/smokey", vOffset )
|
||||
particle:SetVelocity( vNormal * math.Rand( 40, 60 ) )
|
||||
particle:SetGravity(Vector(0, 0, 25))
|
||||
particle:SetAirResistance(20)
|
||||
particle:SetDieTime( 2.0 )
|
||||
particle:SetStartAlpha( math.Rand( 32, 64 ) )
|
||||
particle:SetStartSize( math.Rand( 3, 5 ) )
|
||||
particle:SetEndSize( math.Rand( 20, 26 ) )
|
||||
particle:SetRoll( math.Rand( -20, 20 ) )
|
||||
particle:SetRollDelta( math.Rand( -2.5, 2.5 ))
|
||||
particle:SetColor(color(self))
|
||||
end
|
||||
end
|
||||
WireLib.ThrusterEffectThink.exhaust = exhaust(function() return 200, 200, 210 end)
|
||||
WireLib.ThrusterEffectThink.exhaust_diy = exhaust(function(self) local c = self:GetColor() return c.r, c.g, c.b end)
|
||||
|
||||
WireLib.ThrusterEffectThink.flamethrower = function(self)
|
||||
|
||||
self.FlamethrowerTimer = self.FlamethrowerTimer or 0
|
||||
if ( self.FlamethrowerTimer > CurTime() ) then return end
|
||||
|
||||
self.SmokeTimer = CurTime() + 0.003
|
||||
|
||||
local vOffset = self:LocalToWorld(self:GetOffset() + VectorRand(-3, 3))
|
||||
local vNormal = self:CalcNormal()
|
||||
|
||||
local particle = emitter:Add( "sprites/physg_glow2", vOffset )
|
||||
particle:SetVelocity( vNormal * math.Rand( 500, 520 ) )
|
||||
particle:SetDieTime(0.4)
|
||||
particle:SetCollide( true )
|
||||
particle:SetStartSize( math.Rand( 20, 30 ) )
|
||||
particle:SetEndSize( math.Rand( 100, 120 ) )
|
||||
particle:SetRoll( math.Rand( -180, 180 ) )
|
||||
particle:SetRollDelta( math.Rand( -20, 20 ))
|
||||
particle:SetStartAlpha( math.Rand( 60, 130 ) )
|
||||
particle:SetAirResistance(100)
|
||||
particle:SetColor(250, 100, 0)
|
||||
|
||||
local particle2 = emitter:Add( "effects/fire_cloud2", vOffset )
|
||||
particle2:SetVelocity( vNormal * math.Rand( 500, 520 ) )
|
||||
particle2:SetDieTime(0.3)
|
||||
particle2:SetCollide( true )
|
||||
particle2:SetStartSize( math.Rand( 3, 4 ) )
|
||||
particle2:SetEndSize( math.Rand( 10, 40 ) )
|
||||
particle2:SetRoll( math.Rand( -180, 180 ) )
|
||||
particle2:SetRollDelta( math.Rand( -20, 20 ))
|
||||
particle2:SetStartAlpha( math.Rand( 30, 150 ) )
|
||||
particle2:SetAirResistance(100)
|
||||
particle2:SetColor(255, 255, 255)
|
||||
end
|
||||
|
||||
WireLib.ThrusterEffectDraw.color_magic = function(self)
|
||||
|
||||
local vOffset = self:LocalToWorld(self:GetOffset())
|
||||
|
@ -52,6 +52,8 @@ function TOOL.BuildCPanel(panel)
|
||||
["#Smoke"] = "smoke",
|
||||
["#Smoke Random"] = "smoke_random",
|
||||
["#Smoke Do it Youself"] = "smoke_diy",
|
||||
["#Exhaust"] = "exhaust",
|
||||
["#Exhaust Do it Yourself"] = "exhaust_diy",
|
||||
["#Rings"] = "rings",
|
||||
["#Rings Growing"] = "rings_grow",
|
||||
["#Rings Shrinking"] = "rings_shrink",
|
||||
@ -92,6 +94,7 @@ function TOOL.BuildCPanel(panel)
|
||||
--["#Debugger 60 Seconds"] = "debug_60",
|
||||
["#Fire and Smoke"] = "fire_smoke",
|
||||
["#Fire and Smoke Huge"] = "fire_smoke_big",
|
||||
["#Flamethrower"] = "flamethrower",
|
||||
["#5 Growing Rings"] = "rings_grow_rings",
|
||||
["#Color and Magic"] = "color_magic",
|
||||
}
|
||||
|
@ -133,6 +133,8 @@ function TOOL.BuildCPanel(panel)
|
||||
["#Smoke"] = "smoke",
|
||||
["#Smoke Random"] = "smoke_random",
|
||||
["#Smoke Do it Youself"] = "smoke_diy",
|
||||
["#Exhaust"] = "exhaust",
|
||||
["#Exhaust Do it Yourself"] = "exhaust_diy",
|
||||
["#Rings"] = "rings",
|
||||
["#Rings Growing"] = "rings_grow",
|
||||
["#Rings Shrinking"] = "rings_shrink",
|
||||
@ -173,6 +175,7 @@ function TOOL.BuildCPanel(panel)
|
||||
--["#Debugger 60 Seconds"] = "debug_60",
|
||||
["#Fire and Smoke"] = "fire_smoke",
|
||||
["#Fire and Smoke Huge"] = "fire_smoke_big",
|
||||
["#Flamethrower"] = "flamethrower",
|
||||
["#5 Growing Rings"] = "rings_grow_rings",
|
||||
["#Color and Magic"] = "color_magic",
|
||||
}
|
||||
|
7
materials/gui/thrustereffects/exhaust.vmt
Normal file
7
materials/gui/thrustereffects/exhaust.vmt
Normal file
@ -0,0 +1,7 @@
|
||||
"UnlitGeneric"
|
||||
{
|
||||
"$basetexture" "gui/thrustereffects/exhaust"
|
||||
"$nolod" 1
|
||||
"$vertexalpha" 1
|
||||
"$vertexcolor" 1
|
||||
}
|
BIN
materials/gui/thrustereffects/exhaust.vtf
Normal file
BIN
materials/gui/thrustereffects/exhaust.vtf
Normal file
Binary file not shown.
7
materials/gui/thrustereffects/exhaust_diy.vmt
Normal file
7
materials/gui/thrustereffects/exhaust_diy.vmt
Normal file
@ -0,0 +1,7 @@
|
||||
"UnlitGeneric"
|
||||
{
|
||||
"$basetexture" "gui/thrustereffects/exhaust"
|
||||
"$nolod" 1
|
||||
"$vertexalpha" 1
|
||||
"$vertexcolor" 1
|
||||
}
|
7
materials/gui/thrustereffects/flamethrower.vmt
Normal file
7
materials/gui/thrustereffects/flamethrower.vmt
Normal file
@ -0,0 +1,7 @@
|
||||
"UnlitGeneric"
|
||||
{
|
||||
"$basetexture" "gui/thrustereffects/flamethrower"
|
||||
"$nolod" 1
|
||||
"$vertexalpha" 1
|
||||
"$vertexcolor" 1
|
||||
}
|
BIN
materials/gui/thrustereffects/flamethrower.vtf
Normal file
BIN
materials/gui/thrustereffects/flamethrower.vtf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user