From 46f5d5c8e7517adcb08dbef6eab8b31f6160c805 Mon Sep 17 00:00:00 2001 From: unknao Date: Fri, 27 Dec 2024 06:16:52 +0200 Subject: [PATCH] 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 commit a722a5e74656d122b0bfa26cce08a3bb26048345. * Revert "Fix design oversight on timerSetDelay." This reverts commit e9fe87098962c50f304f56dc673ad0f736858841. * clean up flamethrower effect --- lua/wire/client/thrusterlib.lua | 62 ++++++++++++++++++ lua/wire/stools/thruster.lua | 3 + lua/wire/stools/vthruster.lua | 3 + materials/gui/thrustereffects/exhaust.vmt | 7 ++ materials/gui/thrustereffects/exhaust.vtf | Bin 0 -> 8400 bytes materials/gui/thrustereffects/exhaust_diy.vmt | 7 ++ .../gui/thrustereffects/flamethrower.vmt | 7 ++ .../gui/thrustereffects/flamethrower.vtf | Bin 0 -> 8400 bytes 8 files changed, 89 insertions(+) create mode 100644 materials/gui/thrustereffects/exhaust.vmt create mode 100644 materials/gui/thrustereffects/exhaust.vtf create mode 100644 materials/gui/thrustereffects/exhaust_diy.vmt create mode 100644 materials/gui/thrustereffects/flamethrower.vmt create mode 100644 materials/gui/thrustereffects/flamethrower.vtf diff --git a/lua/wire/client/thrusterlib.lua b/lua/wire/client/thrusterlib.lua index c137f40e..dee80fcd 100644 --- a/lua/wire/client/thrusterlib.lua +++ b/lua/wire/client/thrusterlib.lua @@ -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()) diff --git a/lua/wire/stools/thruster.lua b/lua/wire/stools/thruster.lua index 18144b5f..56030907 100644 --- a/lua/wire/stools/thruster.lua +++ b/lua/wire/stools/thruster.lua @@ -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", } diff --git a/lua/wire/stools/vthruster.lua b/lua/wire/stools/vthruster.lua index 74fcdc7d..b1f6aace 100644 --- a/lua/wire/stools/vthruster.lua +++ b/lua/wire/stools/vthruster.lua @@ -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", } diff --git a/materials/gui/thrustereffects/exhaust.vmt b/materials/gui/thrustereffects/exhaust.vmt new file mode 100644 index 00000000..68b87e7a --- /dev/null +++ b/materials/gui/thrustereffects/exhaust.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "gui/thrustereffects/exhaust" + "$nolod" 1 + "$vertexalpha" 1 + "$vertexcolor" 1 +} diff --git a/materials/gui/thrustereffects/exhaust.vtf b/materials/gui/thrustereffects/exhaust.vtf new file mode 100644 index 0000000000000000000000000000000000000000..f00695ab29f45b08cdf67d0636feae38fa24e832 GIT binary patch literal 8400 zcmeHLU1%HG8NHDMok$ARLjro(2dP-CWm!0aHSMINsRb_8fT0n-nM74IjzvOjlj20A zOyyJ(i7>39)kBc|U~D366uTp2H%`adZjiN*VpB})hcGc^x5?~g!Gmm?Kq4ZPwWi;d zqTM#oCi}1@DHeFgNq#s@wt~%=dCTL3?-F_2=aj^I7U?+wD(4mb zu#IJ>4VFEc!dUhs#q&Pg;)J#A;3__0F}`C&i2s-8)t}qIe~)t`9{(TlFxB$saVJIi z6f-qcKd#~lwYAn}gYUZD<|;odRr&1X+ouc&N$R}rkrC>{P6mBxI!R$wK)cP*2CVi2 z-XY`RihPpX&sLP$bGUad9)!0fiWb64DrR-3ty6|#E~8zcEoR`ap`3ugw~m|iZZi%S zB3&>qTv1Xa4qS+r$#X&j1N^(tgN^hm@PwZhKms zME^E_KLh+V`YIM8F}Ff9SgP)6{ z-L8P1#hgu>aj(#Tn#5qtEs5>AC&S%?ct=20R12v@VA~T4Dk;4`#`pkZFy9yA`Rk4@ zE6<2LTC4IO)1_}BBi%W8r;*RE^xTdICPAFt`% zkzNk~T|{__^Q~Ir(pc86)9L8t4H4)n8)8Q~#49pR-%JAE-mCGs0MWO5(CQ?p(9Pyj ziRa1wAS-8h5@#>RadrN+_!mV(lu|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{Y?q6nDFMn=XJiXVx9llK^K$#;7W%0`R|oVDG|{7 z?QoI&cez~Mt9|`$>W@Ec`N{G^^2W^@Hx7VLdU|@iE@p)eYlKP$&STueOp_k=8xiWX zf#i+t_OI>0;1q1>a0k z2MMop(Jm`Y$NFDCGDZLux|50&R7}o;kur;?fhWorG2u(*5ubbi3*T4yKY}{Ge{>Z5 zOgS$<`uy{ZXOo`g!r^{q#DP?fJrbXxuk5uHuOfh1TFgD2$>VeJP5Pp@hb8>; z9rnX;-g58Jeeeb04}SC|0{zU-4*xja&mdIt9`nZBX3AE?7^((^pk7l>6QPMS(67y7 zyzS|vQqWKKKQe9sByFvK8r<&eM*cUVDgFA#RZ`f+t+eb%#<3 zU)%EZ88oqi52As*Ajs?1@#;8Pmjvq~2x0iv_rLnQ*R==SCS>Ut1zozV_j^7&KjLUM zM-YN6-fb38MIxvzslO*UJO3P?vQ8V3M&QUf4b2wtbq5F|a8-=>Fec}jqyK|-zmC_N zj@RS8LL+q9f-%Wj6baW*z>sgy2EP(Nre5xwjsLTK_r82n{TlPC=kf2nPBh}&h%=P+ bhR+S_l3Km5~37 literal 0 HcmV?d00001 diff --git a/materials/gui/thrustereffects/exhaust_diy.vmt b/materials/gui/thrustereffects/exhaust_diy.vmt new file mode 100644 index 00000000..68b87e7a --- /dev/null +++ b/materials/gui/thrustereffects/exhaust_diy.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "gui/thrustereffects/exhaust" + "$nolod" 1 + "$vertexalpha" 1 + "$vertexcolor" 1 +} diff --git a/materials/gui/thrustereffects/flamethrower.vmt b/materials/gui/thrustereffects/flamethrower.vmt new file mode 100644 index 00000000..a8ff6c1a --- /dev/null +++ b/materials/gui/thrustereffects/flamethrower.vmt @@ -0,0 +1,7 @@ +"UnlitGeneric" +{ + "$basetexture" "gui/thrustereffects/flamethrower" + "$nolod" 1 + "$vertexalpha" 1 + "$vertexcolor" 1 +} diff --git a/materials/gui/thrustereffects/flamethrower.vtf b/materials/gui/thrustereffects/flamethrower.vtf new file mode 100644 index 0000000000000000000000000000000000000000..7f360d389234f527678f6ae0e45d5d04dee6a59e GIT binary patch literal 8400 zcmeHLZEPIH8J=uXayl2)R9N-TbxXwM95_c6l_ND`Z32x0REfo~#5K2PLMlw5#EB}- z7r5JVAtDw;ic3U`_^~l4y6$0?hNdkE)?SmUDM2blumlK&BM#)aP*N%0gV+-(|uHKUqEB{>VS=qK{ z=KGOFzw$zSSwR1qo9DVkx5$nU$Hii^*i7h@S%_+F*#>H#8nND$n>lxzoIvm3yv#0i z^#teX?BNwy%gvlW@HmUb9nP(P$TAb?aYB)^8s~HK&ts(Tybkj^P`=H_!B;a5qB`lg z5f+3T)y@B4R8Q5ftbZdu5kFrD;t8+`g)mJ*yBwj3E40s{H`|`=rwK2-&ov> z;$Du{>;`5&l-`>1Ic(KyHvjyEv_ z`iogT)PnH7Xgz2>*v}^kT`MJpylgOPW-%9zCWPC=wtyVeHb)tgTge`n5tic-nxS38 zFluw*m7?+Bk8x^H3X$I%81y{PGnfn%xIV8undR#fI=)k5epoloH%>W3 z$0At2!n5;{dTV3HXv|EK44^hq6LPQ+YX?(h-hx1}wDV$gH z>ZAwgM|x` zlvav+y(1%Y-;&Ul3#Uv*C}v6_I`Dgj?7}n%IWKrLPa%Mv=2i2d9%iXzgt`P?jn+Xj zd{+D;zC5a1?kry$L@00VROnCc+VM8{#kbASPtLx}q)b9-_2GZw=OECH&P;;(RTP|W zp$D*o`zEWd);nDA4AF`+vZIN%(ZR`1{X)ce5tNJ$LX!byUZ|IJ=%5A-Bh-Vd9_gS3 zUg^{FpN;F#zdq`gOnfaft{@Lx+e#{kTkr)>_<{J5f4~boW#1}?JRK_;Cti+7GPcg> zbP@0JKy@|wTNwh1GAkC@I=HoTyjWd}@yX-cfk#DYd`Mo$t#7m4gJ^3Fqidj|Xj)Ku zXRXlzenv%sK5D+PyF-_?oM-B?(wcA7LLF2!ou1=QzawxgYT2=cu*@Q?v*`DSV57a^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