e9da54c2f9
Too many changes to list.
31 lines
860 B
Lua
31 lines
860 B
Lua
include("shared.lua")
|
|
|
|
CLASS.Icon = "zombiesurvival/killicons/fastheadcrab"
|
|
CLASS.IconColor = Color(100, 20, 0)
|
|
|
|
function CLASS:PrePlayerDraw(pl)
|
|
render.SetColorModulation(0.39, 0.08, 0)
|
|
end
|
|
|
|
function CLASS:PostPlayerDraw(pl)
|
|
render.SetColorModulation(1, 1, 1)
|
|
end
|
|
|
|
function CLASS:CreateMove(pl, cmd)
|
|
local wep = pl:GetActiveWeapon()
|
|
if wep:IsValid() and wep.m_ViewAngles and wep.IsPouncing and wep:IsPouncing() then
|
|
local maxdiff = FrameTime() * 15
|
|
local mindiff = -maxdiff
|
|
local originalangles = wep.m_ViewAngles
|
|
local viewangles = cmd:GetViewAngles()
|
|
|
|
local diff = math.AngleDifference(viewangles.yaw, originalangles.yaw)
|
|
if diff > maxdiff or diff < mindiff then
|
|
viewangles.yaw = math.NormalizeAngle(originalangles.yaw + math.Clamp(diff, mindiff, maxdiff))
|
|
end
|
|
|
|
wep.m_ViewAngles = viewangles
|
|
|
|
cmd:SetViewAngles(viewangles)
|
|
end
|
|
end
|