2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.PrintName = "Plank"
|
|
|
|
SWEP.Description = "A strip of wood of which repeated swings that connect with it build up momentum and overall damage output."
|
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 = 55
|
|
|
|
SWEP.ViewModelFlip = false
|
|
|
|
|
|
|
|
SWEP.ShowViewModel = false
|
|
|
|
SWEP.ShowWorldModel = false
|
|
|
|
SWEP.VElements = {
|
|
|
|
["base"] = { type = "Model", model = "models/props_debris/wood_chunk03a.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(1.363, 1.363, -11.365), angle = Angle(180, 90, 0), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
|
|
|
|
}
|
|
|
|
SWEP.WElements = {
|
|
|
|
["base"] = { type = "Model", model = "models/props_debris/wood_chunk03a.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(2.273, 1.363, -12.273), angle = Angle(180, 90, 0), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} }
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
SWEP.Base = "weapon_zs_basemelee"
|
|
|
|
|
|
|
|
SWEP.DamageType = DMG_CLUB
|
|
|
|
|
|
|
|
SWEP.ViewModel = "models/weapons/c_crowbar.mdl"
|
|
|
|
SWEP.WorldModel = "models/props_debris/wood_chunk03a.mdl"
|
|
|
|
SWEP.ModelScale = 0.5
|
|
|
|
SWEP.UseHands = true
|
|
|
|
SWEP.BoxPhysicsMin = Vector(-0.5764, -2.397225, -20.080572) * SWEP.ModelScale
|
|
|
|
SWEP.BoxPhysicsMax = Vector(0.70365, 2.501825, 19.973375) * SWEP.ModelScale
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.MeleeDamage = 16
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.MeleeRange = 48
|
|
|
|
SWEP.MeleeSize = 0.875
|
|
|
|
SWEP.Primary.Delay = 0.37
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.WalkSpeed = SPEED_FASTER
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.UseMelee1 = true
|
|
|
|
|
|
|
|
SWEP.HitGesture = ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE
|
|
|
|
SWEP.MissGesture = SWEP.HitGesture
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.AllowQualityWeapons = true
|
|
|
|
|
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MELEE_RANGE, 4)
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
function SWEP:PlaySwingSound()
|
|
|
|
self:EmitSound("weapons/knife/knife_slash"..math.random(2)..".wav")
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PlayHitSound()
|
|
|
|
self:EmitSound("physics/wood/wood_plank_impact_hard"..math.random(5)..".wav")
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PlayHitFleshSound()
|
|
|
|
self:EmitSound("physics/flesh/flesh_impact_bullet"..math.random(5)..".wav")
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PostOnMeleeHit(hitent, hitflesh, tr)
|
|
|
|
if hitent:IsValid() and hitent:IsPlayer() then
|
|
|
|
local combo = self:GetDTInt(2)
|
2018-05-02 06:32:59 +08:00
|
|
|
local owner = self:GetOwner()
|
|
|
|
local armdelay = owner:GetMeleeSpeedMul()
|
|
|
|
self:SetNextPrimaryFire(CurTime() + math.max(0.2, self.Primary.Delay * (1 - combo / 10)) * armdelay)
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
self:SetDTInt(2, combo + 1)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PostOnMeleeMiss(tr)
|
|
|
|
self:SetDTInt(2, 0)
|
|
|
|
end
|