112 lines
3 KiB
Lua
112 lines
3 KiB
Lua
|
CLASS.Name = "Bonemesh"
|
||
|
CLASS.TranslationName = "class_bonemesh"
|
||
|
CLASS.Description = "description_bonemesh"
|
||
|
CLASS.Help = "controls_bonemesh"
|
||
|
|
||
|
CLASS.Wave = 0
|
||
|
CLASS.Threshold = 0
|
||
|
CLASS.Unlocked = true
|
||
|
CLASS.Hidden = true
|
||
|
CLASS.Boss = true
|
||
|
|
||
|
CLASS.Health = 1000
|
||
|
CLASS.Speed = 195
|
||
|
|
||
|
CLASS.FearPerInstance = 1
|
||
|
|
||
|
CLASS.Points = 30
|
||
|
|
||
|
CLASS.SWEP = "weapon_zs_bonemesh"
|
||
|
|
||
|
CLASS.Model = Model("models/player/zombie_fast.mdl")
|
||
|
|
||
|
CLASS.VoicePitch = 0.8
|
||
|
|
||
|
CLASS.Hull = {Vector(-16, -16, 0), Vector(16, 16, 58)}
|
||
|
CLASS.HullDuck = {Vector(-16, -16, 0), Vector(16, 16, 32)}
|
||
|
CLASS.ViewOffset = Vector(0, 0, 50)
|
||
|
CLASS.ViewOffsetDucked = Vector(0, 0, 24)
|
||
|
|
||
|
CLASS.PainSounds = {"npc/zombie/zombie_pain1.wav", "npc/zombie/zombie_pain2.wav", "npc/zombie/zombie_pain3.wav", "npc/zombie/zombie_pain4.wav", "npc/zombie/zombie_pain5.wav", "npc/zombie/zombie_pain6.wav"}
|
||
|
CLASS.DeathSounds = {"npc/zombie/zombie_die1.wav", "npc/zombie/zombie_die2.wav", "npc/zombie/zombie_die3.wav"}
|
||
|
|
||
|
local STEPSOUNDTIME_NORMAL = STEPSOUNDTIME_NORMAL
|
||
|
local STEPSOUNDTIME_WATER_FOOT = STEPSOUNDTIME_WATER_FOOT
|
||
|
local STEPSOUNDTIME_ON_LADDER = STEPSOUNDTIME_ON_LADDER
|
||
|
local STEPSOUNDTIME_WATER_KNEE = STEPSOUNDTIME_WATER_KNEE
|
||
|
local ACT_ZOMBIE_LEAPING = ACT_ZOMBIE_LEAPING
|
||
|
local ACT_HL2MP_RUN_ZOMBIE_FAST = ACT_HL2MP_RUN_ZOMBIE_FAST
|
||
|
|
||
|
function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
|
||
|
if iFoot == 0 then
|
||
|
pl:EmitSound("npc/antlion_guard/foot_light1.wav", 70, math.random(115, 120))
|
||
|
else
|
||
|
pl:EmitSound("npc/antlion_guard/foot_light2.wav", 70, math.random(115, 120))
|
||
|
end
|
||
|
|
||
|
return true
|
||
|
end
|
||
|
|
||
|
function CLASS:PlayerStepSoundTime(pl, iType, bWalking)
|
||
|
if iType == STEPSOUNDTIME_NORMAL or iType == STEPSOUNDTIME_WATER_FOOT then
|
||
|
return 450 - pl:GetVelocity():Length()
|
||
|
elseif iType == STEPSOUNDTIME_ON_LADDER then
|
||
|
return 400
|
||
|
elseif iType == STEPSOUNDTIME_WATER_KNEE then
|
||
|
return 550
|
||
|
end
|
||
|
|
||
|
return 250
|
||
|
end
|
||
|
|
||
|
function CLASS:CalcMainActivity(pl, velocity)
|
||
|
if not pl:OnGround() or pl:WaterLevel() >= 3 then
|
||
|
pl.CalcIdeal = ACT_ZOMBIE_LEAPING
|
||
|
else
|
||
|
pl.CalcIdeal = ACT_HL2MP_RUN_ZOMBIE_FAST
|
||
|
end
|
||
|
|
||
|
return true
|
||
|
end
|
||
|
|
||
|
function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
|
||
|
if not pl:OnGround() or pl:WaterLevel() >= 3 then
|
||
|
pl:SetPlaybackRate(1)
|
||
|
|
||
|
if pl:GetCycle() >= 1 then
|
||
|
pl:SetCycle(pl:GetCycle() - 1)
|
||
|
end
|
||
|
|
||
|
return true
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function CLASS:Move(pl, mv)
|
||
|
if mv:GetForwardSpeed() <= 0 then
|
||
|
mv:SetMaxSpeed(mv:GetMaxSpeed() * 0.33)
|
||
|
mv:SetMaxClientSpeed(mv:GetMaxClientSpeed() * 0.33)
|
||
|
end
|
||
|
end
|
||
|
|
||
|
function CLASS:DoAnimationEvent(pl, event, data)
|
||
|
if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
|
||
|
pl:AnimRestartGesture(GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_GMOD_GESTURE_RANGE_ZOMBIE_SPECIAL, true)
|
||
|
return ACT_INVALID
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if SERVER then
|
||
|
function CLASS:OnSpawned(pl)
|
||
|
local status = pl:GiveStatus("overridemodel")
|
||
|
if status and status:IsValid() then
|
||
|
status:SetModel("models/Zombie/Poison.mdl")
|
||
|
end
|
||
|
|
||
|
pl:CreateAmbience("bonemeshambience")
|
||
|
end
|
||
|
end
|
||
|
|
||
|
if not CLIENT then return end
|
||
|
|
||
|
--CLASS.Icon = "zombiesurvival/killicons/bonemesh"
|