zombiesurvival-evolved/gamemodes/zombiesurvival/gamemode/zombieclasses/flesh_creeper.lua

194 lines
4.6 KiB
Lua
Raw Normal View History

2014-10-02 08:49:54 +08:00
CLASS.Name = "Flesh Creeper"
CLASS.TranslationName = "class_flesh_creeper"
CLASS.Description = "description_flesh_creeper"
CLASS.Help = "controls_flesh_creeper"
CLASS.Wave = 0
CLASS.Hidden = true
CLASS.Unlocked = true
CLASS.NotRandomStart = true
CLASS.Health = 175
2014-10-02 08:49:54 +08:00
CLASS.SWEP = "weapon_zs_fleshcreeper"
CLASS.Model = Model("models/antlion.mdl")
CLASS.Speed = 160
Merge with current nox changes. Random starting loadouts now include things that aren't weapons (ammo, traits, etc.). Added an option to disable the automatic suicide when changing zombie classes. Zombies will no longer receive damage resistance when only one human remains. Players can no longer claim the arsenal crate that gets spawned in the human spawn when nobody has one. Any player can pack it up though. The Ghoul's ghoul touch special ability has been changed. It will no longer slow targets but will debuff them for the next 10 seconds. They will take 40% more damage (the extra damage is attributed to the person who ghoul touched them last) for the next 10 seconds as well as slightly disorienting them. The Ghoul movement speed has been reduced from 185 to 170. Added crafting recipe: 'Waraxe' Handgun. Combine two 'Battleaxe' Handguns to craft this. Slightly better version of the Owens. The Flesh Creeper model has been changed to one that doesn't have severely awkward hitboxes. The Flesh Creeper can no longer jump and attack at the same time. The Lead Pipe special trait has been changed from a disorientation to a severe view punch/snap on a global cooldown of 1.5 seconds. The Regenerative trait is now 1 health every 6 seconds under 50% health instead of 1 health every 5 seconds under 50% health. Fast Zombie Legs have been changed to be a slightly faster but slightly weaker version of Zombie Legs. Zombies that have just spawned or enter zombie gas will now have a temporary buff which gives 25% extra speed and 40% damage resistance. This buff lasts for 3 seconds and is refreshed by entering the gas. Gas will no longer heal. Zombies with this buff on will strobe dark green. Added crafting recipe: Bladehack. Combine a saw blade with a manhack to get this. Slower but has more health, does more damage, and has less of a knockback when hitting something. Resupply Boxes now award the owner a point for every 2 people who use their box instead of every single person (so half as many points). Fixed Fast Zombie Legs spawning much more abundantly than intended. Fixed Flesh Creepers not being able to jump over obstacles due to their insanely low jump height. Fixed zombies taking themselves in to account when calculating horde damage resistance (bosses always had full resistance because of this). Fixed allowing people to use worth menu after redeeming.
2014-11-07 13:03:40 +08:00
CLASS.JumpPower = 220
2014-10-02 08:49:54 +08:00
CLASS.Points = CLASS.Health/GM.NoHeadboxZombiePointRatio
2014-10-02 08:49:54 +08:00
CLASS.VoicePitch = 0.55
CLASS.PainSounds = {Sound("npc/barnacle/barnacle_pull1.wav"), Sound("npc/barnacle/barnacle_pull2.wav"), Sound("npc/barnacle/barnacle_pull3.wav"), Sound("npc/barnacle/barnacle_pull4.wav")}
CLASS.DeathSounds = {Sound("npc/barnacle/barnacle_die1.wav"), Sound("npc/barnacle/barnacle_die2.wav")}
CLASS.ModelScale = 0.65
--[[CLASS.ModelScale = 0.6324555
CLASS.ClientsideModelScale = 0.4 / CLASS.ModelScale]]
CLASS.Hull = {Vector(-16, -16, 0), Vector(16, 16, 36)}
CLASS.HullDuck = {Vector(-16, -16, 0), Vector(16, 16, 36)}
2014-10-02 08:49:54 +08:00
CLASS.ViewOffset = Vector(0, 0, 35.5)
CLASS.ViewOffsetDucked = Vector(0, 0, 35.5)
2014-10-02 08:49:54 +08:00
local CurTime = CurTime
local math_random = math.random
local math_sin = math.sin
local IN_JUMP = IN_JUMP
2014-10-02 08:49:54 +08:00
function CLASS:CanUse(pl)
return GAMEMODE:GetDynamicSpawning() and not GAMEMODE.ZombieEscape
end
function CLASS:Move(pl, mv)
local wep = pl:GetActiveWeapon()
if wep.Move and wep:Move(mv) then
2014-10-02 08:49:54 +08:00
return true
end
if mv:GetForwardSpeed() <= 0 then
mv:SetMaxSpeed(mv:GetMaxSpeed() * 0.45)
mv:SetMaxClientSpeed(mv:GetMaxClientSpeed() * 0.45)
end
end
function CLASS:CalcMainActivity(pl, velocity)
local wep = pl:GetActiveWeapon()
if wep:IsValid() and wep.IsInAttackAnim then
if wep:IsInAttackAnim() then
return 1, 14
end
if wep:GetHoldingRightClick() then
return 1, 21
2014-10-02 08:49:54 +08:00
end
end
if wep.IsPouncing and wep:IsPouncing() then
return ACT_GLIDE, -1
end
if velocity:Length2DSqr() > 1 then
2014-10-02 08:49:54 +08:00
--[[if pl:Crouching() and pl:OnGround() then
return 1, 17
2014-10-02 08:49:54 +08:00
else]]
return 1, 4
2014-10-02 08:49:54 +08:00
--[[end
elseif pl:Crouching() and pl:OnGround() then
pl.CalcSeqOverride = 40]]
end
return 1, 2
2014-10-02 08:49:54 +08:00
end
function CLASS:UpdateAnimation(pl, velocity, maxseqgroundspeed)
local wep = pl:GetActiveWeapon()
if wep:IsValid() and wep.IsInAttackAnim then
if wep:IsInAttackAnim() then
pl:SetPlaybackRate(0)
pl:SetCycle(1 - (wep:GetAttackAnimTime() - CurTime()) / wep.Primary.Delay)
2014-10-02 08:49:54 +08:00
return true
elseif wep:GetHoldingRightClick() then
pl:SetPlaybackRate(0)
local delta = CurTime() - wep:GetRightClickStart()
if delta > 1 then
--pl:SetCycle(0.333 + (delta * 3 % 1) * 0.2)
pl:SetCycle(0.5 + math_sin(delta * 12) * 0.05)
2014-10-02 08:49:54 +08:00
else
--pl:SetCycle(delta / 3)
pl:SetCycle(delta / 2)
end
return true
end
end
if velocity:Length2DSqr() >= 256 then
2014-10-02 08:49:54 +08:00
GAMEMODE.BaseClass.UpdateAnimation(GAMEMODE.BaseClass, pl, velocity, maxseqgroundspeed)
--[[local dir = Vector(0, 0, 0)
2014-10-02 08:49:54 +08:00
dir:Set(velocity)
dir.z = 0
dir:Normalize()
local aimdir = pl:GetAimVector()
aimdir.z = 0
aimdir:Normalize()
if dir:Dot(aimdir) >= 0.5 then
pl:SetPlaybackRate(pl:GetPlaybackRate() / self.ModelScale / 2)
else]]
pl:SetPlaybackRate(pl:GetPlaybackRate() / self.ModelScale)
--end
--[[if pl:Crouching() then
pl:SetPoseParameter("move_yaw", 0)
end]]
return true
end
--[[if pl:Crouching() then
pl:SetCycle(0.5 + math.sin(CurTime() * 2) * 0.025)
pl:SetPlaybackRate(0)
return true
end]]
return true
end
function CLASS:DoAnimationEvent(pl, event, data)
if event == PLAYERANIMEVENT_ATTACK_PRIMARY then
return ACT_INVALID
end
end
function CLASS:CreateMove(pl, cmd)
local wep = pl:GetActiveWeapon()
if wep:IsValid() and wep.IsSwinging and wep:IsSwinging() and bit.band(cmd:GetButtons(), IN_JUMP) ~= 0 then
cmd:SetButtons(cmd:GetButtons() - IN_JUMP)
end
end
local FootSounds = {
"npc/zombie/foot1.wav",
"npc/zombie/foot2.wav",
"npc/zombie/foot3.wav"
}
function CLASS:PlayerFootstep(pl, vFootPos, iFoot, strSoundName, fVolume, pFilter)
pl:EmitSound(FootSounds[math_random(#FootSounds)], 65, math.random(105, 115))
2014-10-02 08:49:54 +08:00
return true
end
if SERVER then
function CLASS:OnKilled(pl, attacker, inflictor, suicide, headshot, dmginfo)
local ent = pl:FakeDeath(pl:LookupSequence("Flip1"), self.ModelScale, math.Rand(0.45, 0.5))
if ent:IsValid() then
ent:SetMaterial("models/flesh")
end
return true
end
end
if not CLIENT then return end
CLASS.Icon = "zombiesurvival/killicons/fleshcreeper"
2014-10-02 08:49:54 +08:00
local matFlesh = Material("models/flesh")
function CLASS:PrePlayerDraw(pl)
render.ModelMaterialOverride(matFlesh)
end
function CLASS:PostPlayerDraw(pl)
render.ModelMaterialOverride()
end
function CLASS:ShouldDrawLocalPlayer()
return true
end