zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_crowbar.lua

63 lines
1.7 KiB
Lua
Raw Permalink Normal View History

2014-10-02 08:49:54 +08:00
AddCSLuaFile()
SWEP.PrintName = "Crowbar"
SWEP.Description = "An effective and fast swinging melee weapon, the crowbar also has the ability to instantly kill headcrabs."
2014-10-02 08:49:54 +08:00
if CLIENT then
2014-10-02 08:49:54 +08:00
SWEP.ViewModelFOV = 65
end
SWEP.Base = "weapon_zs_basemelee"
SWEP.ViewModel = "models/weapons/c_crowbar.mdl"
SWEP.WorldModel = "models/weapons/w_crowbar.mdl"
SWEP.UseHands = true
SWEP.HoldType = "melee"
SWEP.DamageType = DMG_CLUB
2014-10-02 08:49:54 +08:00
SWEP.MeleeDamage = 35
SWEP.OriginalMeleeDamage = SWEP.MeleeDamage
2014-10-02 08:49:54 +08:00
SWEP.MeleeRange = 55
SWEP.MeleeSize = 1.5
SWEP.MeleeKnockBack = 110
2014-10-02 08:49:54 +08:00
SWEP.Primary.Delay = 0.7
SWEP.SwingTime = 0.4
SWEP.SwingRotation = Angle(30, -30, -30)
SWEP.SwingHoldType = "grenade"
SWEP.AllowQualityWeapons = true
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MELEE_RANGE, 3)
2014-10-02 08:49:54 +08:00
function SWEP:PlaySwingSound()
self:EmitSound("Weapon_Crowbar.Single")
end
function SWEP:PlayHitSound()
self:EmitSound("Weapon_Crowbar.Melee_HitWorld")
end
function SWEP:PlayHitFleshSound()
self:EmitSound("Weapon_Crowbar.Melee_Hit")
end
function SWEP:PostOnMeleeHit(hitent, hitflesh, tr)
if hitent:IsValid() and hitent:IsPlayer() and hitent:Team() == TEAM_UNDEAD and hitent:IsHeadcrab() and gamemode.Call("PlayerShouldTakeDamage", hitent, self:GetOwner()) then
hitent:TakeSpecialDamage(hitent:Health(), DMG_DIRECT, self:GetOwner(), self, tr.HitPos)
2014-10-02 08:49:54 +08:00
end
end
--[[function SWEP:OnMeleeHit(hitent, hitflesh, tr)
if hitent:IsValid() and hitent:IsPlayer() and hitent:Team() == TEAM_UNDEAD and hitent:IsHeadcrab() and gamemode.Call("PlayerShouldTakeDamage", hitent, self:GetOwner()) then
self.MeleeDamage = hitent:GetMaxHealth() * 10
end
end
function SWEP:PostOnMeleeHit(hitent, hitflesh, tr)
self.MeleeDamage = self.OriginalMeleeDamage
end]]