2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
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
|
|
|
|
2018-05-02 06:32:59 +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"
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.DamageType = DMG_CLUB
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.MeleeDamage = 35
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.OriginalMeleeDamage = SWEP.MeleeDamage
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.MeleeRange = 55
|
|
|
|
SWEP.MeleeSize = 1.5
|
2018-05-02 06:32:59 +08:00
|
|
|
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"
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
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
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
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
|
2018-05-02 06:32:59 +08:00
|
|
|
|
|
|
|
--[[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]]
|