Initial commit

This commit is contained in:
pavetr
2026-03-15 14:54:49 +03:00
commit 64f8029c06
4027 changed files with 254888 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
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