2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.PrintName = "Nightmare"
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.Base = "weapon_zs_zombie"
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.MeleeDamage = 15
|
|
|
|
SWEP.BleedDamage = 15
|
|
|
|
SWEP.SlowDownScale = 5.4
|
|
|
|
SWEP.MeleeDamageVsProps = 40
|
|
|
|
SWEP.EnfeebleDurationMul = 10 / SWEP.MeleeDamage
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
function SWEP:Reload()
|
|
|
|
self:SecondaryAttack()
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:PlayAlertSound()
|
2018-05-02 06:32:59 +08:00
|
|
|
self:GetOwner():EmitSound("npc/barnacle/barnacle_tongue_pull"..math.random(3)..".wav")
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
SWEP.PlayIdleSound = SWEP.PlayAlertSound
|
|
|
|
|
|
|
|
function SWEP:PlayAttackSound()
|
2018-05-02 06:32:59 +08:00
|
|
|
self:EmitSound("npc/barnacle/barnacle_bark"..math.random(2)..".wav")
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:MeleeHit(ent, trace, damage, forcescale)
|
|
|
|
if not ent:IsPlayer() then
|
|
|
|
damage = self.MeleeDamageVsProps
|
|
|
|
end
|
|
|
|
|
|
|
|
self.BaseClass.MeleeHit(self, ent, trace, damage, forcescale)
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:ApplyMeleeDamage(ent, trace, damage)
|
|
|
|
if SERVER and ent:IsPlayer() then
|
|
|
|
local gt = ent:GiveStatus("enfeeble", damage * self.EnfeebleDurationMul)
|
|
|
|
if gt and gt:IsValid() then
|
|
|
|
gt.Applier = self:GetOwner()
|
|
|
|
end
|
|
|
|
|
|
|
|
ent:GiveStatus("dimvision", 10)
|
|
|
|
|
|
|
|
local bleed = ent:GiveStatus("bleed")
|
|
|
|
if bleed and bleed:IsValid() then
|
|
|
|
bleed:AddDamage(self.BleedDamage)
|
|
|
|
bleed.Damager = self:GetOwner()
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
self.BaseClass.ApplyMeleeDamage(self, ent, trace, damage)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
if not CLIENT then return end
|
|
|
|
|
|
|
|
function SWEP:ViewModelDrawn()
|
|
|
|
render.ModelMaterialOverride(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
local matSheet = Material("Models/Charple/Charple1_sheet")
|
|
|
|
function SWEP:PreDrawViewModel(vm)
|
|
|
|
render.ModelMaterialOverride(matSheet)
|
|
|
|
end
|