mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
42 lines
987 B
Lua
42 lines
987 B
Lua
--[[
|
|
| 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/
|
|
--]]
|
|
|
|
|
|
local effects_freeze = CreateClientConVar( "effects_freeze", "1", true, false, "Whether to display Physics Gun freeze effects?" )
|
|
|
|
function EFFECT:Init( data )
|
|
|
|
if ( effects_freeze:GetBool() == false ) then return end
|
|
|
|
self.Target = data:GetEntity()
|
|
self.StartTime = CurTime()
|
|
self.Length = 0.3
|
|
|
|
end
|
|
|
|
function EFFECT:Think()
|
|
|
|
if ( effects_freeze:GetBool() == false ) then return false end
|
|
return self.StartTime + self.Length > CurTime()
|
|
|
|
end
|
|
|
|
function EFFECT:Render()
|
|
|
|
if ( !IsValid( self.Target ) ) then return end
|
|
|
|
local delta = ( ( CurTime() - self.StartTime ) / self.Length ) ^ 0.5
|
|
local idelta = 1 - delta
|
|
|
|
local size = 1
|
|
halo.Add( { self.Target }, Color( 0, 255, 0, 255 * idelta ), size, size, 1, true, false )
|
|
|
|
end
|