2014-10-02 08:49:54 +08:00
|
|
|
-- This is a special class which is essentially just Fresh Dead made to be a bit stronger so people can put it in their maps.
|
|
|
|
-- It also has a climbing function although not as good as the Fast Zombie. Only so you don't have people exploiting high places.
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.Base = "freshdead"
|
|
|
|
|
|
|
|
CLASS.Hidden = true
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
CLASS.Name = "Classic Zombie"
|
|
|
|
CLASS.TranslationName = "class_classic_zombie"
|
|
|
|
|
|
|
|
CLASS.Health = 150
|
|
|
|
CLASS.Speed = 200
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.Points = CLASS.Health/GM.HumanoidZombiePointRatio
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
CLASS.SWEP = "weapon_zs_classiczombie"
|
|
|
|
|
|
|
|
CLASS.UsePlayerModel = true
|
|
|
|
CLASS.UsePreviousModel = false
|
|
|
|
CLASS.NoFallDamage = true
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
local ACT_ZOMBIE_CLIMB_UP = ACT_ZOMBIE_CLIMB_UP
|
|
|
|
|
|
|
|
local math_Clamp = math.Clamp
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
if SERVER then
|
|
|
|
function CLASS:OnKilled(pl, attacker, inflictor, suicide, headshot, dmginfo) end
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:Move(pl, mv)
|
|
|
|
local wep = pl:GetActiveWeapon()
|
|
|
|
if wep:IsValid() and wep.Move and wep:Move(mv) then
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:CalcMainActivity(pl, velocity)
|
|
|
|
local wep = pl:GetActiveWeapon()
|
|
|
|
if wep:IsValid() and wep.GetClimbing and wep:GetClimbing() then
|
2018-05-02 06:32:59 +08:00
|
|
|
return ACT_ZOMBIE_CLIMB_UP, -1
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return self.BaseClass.CalcMainActivity(self, pl, velocity)
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
|
|
|
|
local wep = pl:GetActiveWeapon()
|
|
|
|
if wep:IsValid() and wep.GetClimbing and wep:GetClimbing() then
|
|
|
|
local vel = pl:GetVelocity()
|
2018-05-02 06:32:59 +08:00
|
|
|
local speed = vel:LengthSqr()
|
|
|
|
if speed > 64 then
|
|
|
|
pl:SetPlaybackRate(math_Clamp(speed / 3600, 0, 1) * (vel.z < 0 and -1 or 1) * 0.25)
|
2014-10-02 08:49:54 +08:00
|
|
|
else
|
|
|
|
pl:SetPlaybackRate(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
return self.BaseClass.UpdateAnimation(self, pl, velocity, maxseqgroundspeed)
|
|
|
|
end
|