zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_extinctioncrab/init.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

47 lines
1.1 KiB
Lua

INC_SERVER()
function SWEP:ThrowGibs()
local owner = self:GetOwner()
owner.LastRangedAttack = CurTime()
local ent = ents.Create("projectile_extinctioncrab")
if ent:IsValid() then
ent:SetPos(owner:GetShootPos())
ent:SetAngles(AngleRand())
ent:SetOwner(owner)
ent:Spawn()
local phys = ent:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()
phys:SetVelocityInstantaneous(owner:GetAimVector() * 600)
phys:AddAngleVelocity(VectorRand() * 360)
end
end
end
function SWEP:PoundAttackProcess()
if CurTime() < self.PoundAttackStart + 0.4 then return end
local owner = self:GetOwner()
local pos = owner:GetPos() + Vector(0, 0, 2)
owner:LagCompensation(true)
owner:EmitSound("physics/concrete/concrete_break3.wav", 77, 70)
util.ScreenShake(pos, 5, 5, 1, 300)
local effectdata = EffectData()
effectdata:SetOrigin(pos)
effectdata:SetNormal(Vector(0, 0, 1))
util.Effect("ThumperDust", effectdata, true, true)
owner:GodEnable()
util.BlastDamageEx(self, owner, pos, 112, 25, DMG_CLUB)
util.BlastDamageEx(self, owner, pos, 22, 40, DMG_CLUB)
owner:GodDisable()
owner:LagCompensation(false)
end