This commit is contained in:
lifestorm
2024-08-04 23:12:27 +03:00
parent 8064ba84d8
commit 9c918c46e5
7081 changed files with 2173485 additions and 14 deletions

View File

@@ -0,0 +1,54 @@
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
function EFFECT:Init(data)
self.ShotStart = data:GetStart()
self.ShotEnd = data:GetOrigin()
-- ws = worldspace
self:SetRenderBoundsWS(self.ShotStart, self.ShotEnd)
self.HitBox = data:GetMagnitude()
self.Duration = data:GetScale() or 0
self.EndTime = CurTime() + self.Duration
self.FadeTime = 3
self.FadeIn = CurTime() + self.FadeTime
self.FadeOut = self.EndTime - self.FadeTime
self.Width = 0
self.WidthMax = 5
end
function EFFECT:Think()
if self.EndTime < CurTime() then
return false
end
if self.FadeIn > CurTime() then
self.Width = self.WidthMax * (1 - ((self.FadeIn - CurTime()) / self.FadeTime))
elseif self.FadeOut < CurTime() then
self.Width = self.WidthMax * (1 - ((CurTime() - self.FadeOut) / self.FadeTime))
end
return true
end
local shot_mat = Material("cable/blue_elec")
--local clr = Color(0, 0, 100, 255)
function EFFECT:Render()
render.SetMaterial(shot_mat)
render.DrawBeam(self.ShotStart, self.ShotEnd, self.Width, 0, 0, self.Color)
end