zombiesurvival-evolved/gamemodes/zombiesurvival/gamemode/zombieclasses/boss_extinctioncrab/client.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

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