zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_hammer/shared.lua

60 lines
1.9 KiB
Lua
Raw Permalink Normal View History

2014-10-02 08:49:54 +08:00
SWEP.Base = "weapon_zs_basemelee"
SWEP.PrintName = "Carpenter's Hammer"
SWEP.Description = "A simple but extremely useful tool. Allows you to hammer in nails to make barricades.\nPress SECONDARY FIRE to hammer in nail. It will be attached to whatever is behind it.\nPress RELOAD to take a nail out.\nUse PRIMARY FIRE to bash zombie brains or to repair damaged nails.\nYou get a point bonus for repairing damaged nails but a point penalty for removing another player's nails."
2014-10-02 08:49:54 +08:00
SWEP.DamageType = DMG_CLUB
SWEP.ViewModel = "models/weapons/v_hammer/c_hammer.mdl"
2014-10-02 08:49:54 +08:00
SWEP.WorldModel = "models/weapons/w_hammer.mdl"
SWEP.UseHands = true
2014-10-02 08:49:54 +08:00
SWEP.Primary.ClipSize = 1
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "GaussEnergy"
SWEP.Primary.Delay = 1
SWEP.Primary.DefaultClip = 16
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 1
SWEP.Secondary.Ammo = "dummy"
2014-10-02 08:49:54 +08:00
--SWEP.MeleeDamage = 35 -- Reduced due to instant swing speed
SWEP.MeleeDamage = 15
2014-10-02 08:49:54 +08:00
SWEP.MeleeRange = 50
SWEP.MeleeSize = 0.875
SWEP.MaxStock = 5
2014-10-02 08:49:54 +08:00
SWEP.UseMelee1 = true
SWEP.NoPropThrowing = true
SWEP.HitGesture = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
SWEP.MissGesture = SWEP.HitGesture
SWEP.HealStrength = 1
SWEP.NoHolsterOnCarry = true
SWEP.NoGlassWeapons = true
SWEP.AllowQualityWeapons = true
GAMEMODE:SetPrimaryWeaponModifier(SWEP, WEAPON_MODIFIER_FIRE_DELAY, -0.04)
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MELEE_RANGE, 3, 1)
function SWEP:SetNextAttack()
local owner = self:GetOwner()
local armdelay = owner:GetMeleeSpeedMul()
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay * (owner.HammerSwingDelayMul or 1) * armdelay)
end
2014-10-02 08:49:54 +08:00
function SWEP:PlayHitSound()
self:EmitSound("weapons/melee/crowbar/crowbar_hit-"..math.random(4)..".ogg", 75, math.random(110, 115))
end
function SWEP:PlayRepairSound(hitent)
hitent:EmitSound("npc/dog/dog_servo"..math.random(7, 8)..".wav", 70, math.random(100, 105))
end