2014-10-02 08:49:54 +08:00
|
|
|
CLASS.Name = "Giga Gore Child"
|
|
|
|
CLASS.TranslationName = "class_giga_gore_child"
|
|
|
|
CLASS.Description = "description_giga_gore_child"
|
|
|
|
CLASS.Help = "controls_giga_gore_child"
|
|
|
|
|
|
|
|
CLASS.Boss = true
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.KnockbackScale = 0
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.Health = 2500
|
|
|
|
CLASS.Speed = 230
|
|
|
|
|
|
|
|
CLASS.Points = 40
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
CLASS.CanTaunt = true
|
|
|
|
|
|
|
|
CLASS.FearPerInstance = 1
|
|
|
|
|
|
|
|
CLASS.SWEP = "weapon_zs_gigagorechild"
|
|
|
|
|
|
|
|
CLASS.Model = Model("models/vinrax/player/doll_player.mdl")
|
|
|
|
|
|
|
|
CLASS.VoicePitch = 1
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.ModelScale = 1.3
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
CLASS.CanFeignDeath = true
|
|
|
|
|
|
|
|
CLASS.Mass = 500
|
|
|
|
CLASS.ViewOffset = DEFAULT_VIEW_OFFSET * CLASS.ModelScale
|
|
|
|
CLASS.ViewOffsetDucked = DEFAULT_VIEW_OFFSET_DUCKED * CLASS.ModelScale
|
|
|
|
CLASS.StepSize = 25
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.Hull = {Vector(-16, -16, 0), Vector(16, 16, 72)}
|
|
|
|
CLASS.HullDuck = {Vector(-16, -16, 0), Vector(16, 16, 36)}
|
|
|
|
|
|
|
|
local math_random = math.random
|
|
|
|
local math_min = math.min
|
|
|
|
local math_max = math.max
|
|
|
|
local math_ceil = math.ceil
|
|
|
|
local CurTime = CurTime
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
local DIR_BACK = DIR_BACK
|
|
|
|
local ACT_HL2MP_ZOMBIE_SLUMP_RISE = ACT_HL2MP_ZOMBIE_SLUMP_RISE
|
|
|
|
local ACT_HL2MP_SWIM_PISTOL = ACT_HL2MP_SWIM_PISTOL
|
|
|
|
local ACT_HL2MP_IDLE_CROUCH_ZOMBIE = ACT_HL2MP_IDLE_CROUCH_ZOMBIE
|
|
|
|
local ACT_HL2MP_WALK_CROUCH_ZOMBIE_01 = ACT_HL2MP_WALK_CROUCH_ZOMBIE_01
|
|
|
|
local ACT_HL2MP_RUN_ZOMBIE = ACT_HL2MP_RUN_ZOMBIE
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
local StepSounds = {
|
2014-10-02 08:49:54 +08:00
|
|
|
"npc/zombie/foot1.wav",
|
|
|
|
"npc/zombie/foot2.wav",
|
|
|
|
"npc/zombie/foot3.wav"
|
|
|
|
}
|
|
|
|
function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
pl:EmitSound(StepSounds[math_random(#StepSounds)], 77, 50)
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
if iFoot == 0 then
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:EmitSound("^npc/strider/strider_step4.wav", 90, math_random(90, 110))
|
2014-10-02 08:49:54 +08:00
|
|
|
else
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:EmitSound("^npc/strider/strider_step5.wav", 90, math_random(90, 110))
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:PlayDeathSound(pl)
|
2018-05-02 06:32:59 +08:00
|
|
|
local pitch = math_random(60, 70)
|
2014-10-02 08:49:54 +08:00
|
|
|
for i=1, 2 do
|
|
|
|
pl:EmitSound("ambient/creatures/town_child_scream1.wav", 75, pitch)
|
|
|
|
end
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:PlayPainSound(pl)
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:EmitSound("ambient/voices/citizen_beaten"..math_random(5)..".wav", 70, math_random(50, 60))
|
2014-10-02 08:49:54 +08:00
|
|
|
pl.NextPainSound = CurTime() + 1.25
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:CalcMainActivity(pl, velocity)
|
|
|
|
local feign = pl.FeignDeath
|
|
|
|
if feign and feign:IsValid() then
|
|
|
|
if feign:GetDirection() == DIR_BACK then
|
2018-05-02 06:32:59 +08:00
|
|
|
return 1, pl:LookupSequence("zombie_slump_rise_02_fast")
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
return ACT_HL2MP_ZOMBIE_SLUMP_RISE, -1
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
if pl:WaterLevel() >= 3 then
|
2018-05-02 06:32:59 +08:00
|
|
|
return ACT_HL2MP_SWIM_PISTOL, -1
|
|
|
|
end
|
|
|
|
|
|
|
|
if pl:Crouching() and pl:OnGround() then
|
|
|
|
if velocity:Length2DSqr() <= 1 then
|
|
|
|
return ACT_HL2MP_IDLE_CROUCH_ZOMBIE, -1
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
return ACT_HL2MP_WALK_CROUCH_ZOMBIE_01 - 1 + math_ceil((CurTime() / 4 + pl:EntIndex()) % 3), -1
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
return ACT_HL2MP_RUN_ZOMBIE, -1
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:Move(pl, move)
|
|
|
|
local wep = pl:GetActiveWeapon()
|
2018-05-02 06:32:59 +08:00
|
|
|
if wep:IsValid() and wep.IsCrying and wep:IsCrying() then
|
|
|
|
move:SetMaxSpeed(move:GetMaxSpeed() * 0.5)
|
|
|
|
move:SetMaxClientSpeed(move:GetMaxClientSpeed() * 0.5)
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:PlayerStepSoundTime(pl, iType, bWalking)
|
|
|
|
return GAMEMODE.BaseClass.PlayerStepSoundTime(GAMEMODE.BaseClass, pl, iType, bWalking) * 1.8
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
|
|
|
|
local feign = pl.FeignDeath
|
|
|
|
if feign and feign:IsValid() then
|
|
|
|
if feign:GetState() == 1 then
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:SetCycle(1 - math_max(feign:GetStateEndTime() - CurTime(), 0) * 0.666)
|
2014-10-02 08:49:54 +08:00
|
|
|
else
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:SetCycle(math_max(feign:GetStateEndTime() - CurTime(), 0) * 0.666)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
pl:SetPlaybackRate(0)
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
local len2d = velocity:Length2D()
|
2018-05-02 06:32:59 +08:00
|
|
|
if len2d > 1 then
|
|
|
|
pl:SetPlaybackRate(math_min(len2d / maxseqgroundspeed, 3))
|
2014-10-02 08:49:54 +08:00
|
|
|
else
|
|
|
|
pl:SetPlaybackRate(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
pl:SetPlaybackRate(pl:GetPlaybackRate() * 0.5)
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:DoAnimationEvent(pl, event, data)
|
|
|
|
if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
|
2018-05-02 06:32:59 +08:00
|
|
|
pl:DoZombieAttackAnim(data)
|
2014-10-02 08:49:54 +08:00
|
|
|
return ACT_INVALID
|
|
|
|
elseif event == PLAYERANIMEVENT_RELOAD then
|
|
|
|
pl:AnimRestartGesture(GESTURE_SLOT_ATTACK_AND_RELOAD, ACT_GMOD_GESTURE_ITEM_THROW, true)
|
|
|
|
return ACT_INVALID
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:DoesntGiveFear(pl)
|
|
|
|
return pl.FeignDeath and pl.FeignDeath:IsValid()
|
|
|
|
end
|
|
|
|
|
|
|
|
if SERVER then
|
|
|
|
function CLASS:OnKilled(pl, attacker, inflictor, suicide, headshot, dmginfo)
|
|
|
|
pl:FakeDeath(pl:LookupSequence("death_0"..math.random(4)), self.ModelScale)
|
|
|
|
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:PostOnKilled(pl, attacker, inflictor, suicide, headshot, dmginfo)
|
|
|
|
pl:SetZombieClass(GAMEMODE.DefaultZombieClass)
|
|
|
|
end
|
|
|
|
|
|
|
|
function CLASS:AltUse(pl)
|
|
|
|
pl:StartFeignDeath()
|
|
|
|
end
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
function CLASS:OnSpawned(pl)
|
|
|
|
local oldhands = pl:GetHands()
|
|
|
|
if IsValid(oldhands) then
|
|
|
|
oldhands:Remove()
|
|
|
|
end
|
|
|
|
|
|
|
|
local hands = ents.Create("zs_hands")
|
|
|
|
if hands:IsValid() then
|
|
|
|
hands:DoSetup(pl)
|
|
|
|
hands:Spawn()
|
|
|
|
end
|
|
|
|
end
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
if not CLIENT then return end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
CLASS.Icon = "zombiesurvival/killicons/gigagorechild"
|
|
|
|
|
|
|
|
local render_ModelMaterialOverride = render.ModelMaterialOverride
|
|
|
|
|
|
|
|
local matSheet = Material("models/props_c17/doll01")
|
|
|
|
function CLASS:DrawHands(pl, hands)
|
|
|
|
render_ModelMaterialOverride(matSheet)
|
|
|
|
|
|
|
|
hands:DrawModel()
|
|
|
|
|
|
|
|
render_ModelMaterialOverride(nil)
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
return true
|
|
|
|
end
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
--[[function CLASS:ShouldDrawLocalPlayer()
|
|
|
|
return true
|
|
|
|
end]]
|