mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 21:53:46 +03:00
Upload
This commit is contained in:
41
gamemodes/sandbox/entities/effects/phys_freeze.lua
Normal file
41
gamemodes/sandbox/entities/effects/phys_freeze.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--[[
|
||||
| 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
|
||||
Reference in New Issue
Block a user