2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Base = "weapon_zs_baseshotgun"
|
|
|
|
|
|
|
|
SWEP.PrintName = "Boom Stick"
|
|
|
|
SWEP.Description = "This shotgun allows you to load up to four shells in the chamber at once. Hold down reload for faster loading of each shell."
|
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.HUD3DBone = "ValveBiped.Gun"
|
|
|
|
SWEP.HUD3DPos = Vector(1.65, 0, -8)
|
|
|
|
SWEP.HUD3DScale = 0.025
|
2018-05-02 06:32:59 +08:00
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.ViewModelFlip = false
|
|
|
|
end
|
|
|
|
|
|
|
|
SWEP.ViewModel = "models/weapons/c_shotgun.mdl"
|
|
|
|
SWEP.WorldModel = "models/weapons/w_shotgun.mdl"
|
|
|
|
SWEP.UseHands = true
|
|
|
|
|
|
|
|
SWEP.CSMuzzleFlashes = false
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ReloadDelay = 0.5
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.Primary.Sound = Sound("weapons/shotgun/shotgun_dbl_fire.wav")
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Damage = 27
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.Primary.NumShots = 6
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Delay = 1
|
|
|
|
|
|
|
|
SWEP.Recoil = 7.5
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.Primary.ClipSize = 4
|
|
|
|
SWEP.Primary.Automatic = false
|
|
|
|
SWEP.Primary.Ammo = "buckshot"
|
|
|
|
SWEP.Primary.DefaultClip = 28
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ConeMax = 11.5
|
|
|
|
SWEP.ConeMin = 10
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Tier = 5
|
|
|
|
SWEP.MaxStock = 2
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.WalkSpeed = SPEED_SLOWER
|
|
|
|
SWEP.FireAnimSpeed = 0.4
|
|
|
|
SWEP.Knockback = 80
|
|
|
|
|
|
|
|
SWEP.PumpActivity = ACT_SHOTGUN_PUMP
|
|
|
|
SWEP.PumpSound = Sound("Weapon_Shotgun.Special1")
|
|
|
|
SWEP.ReloadSound = Sound("Weapon_Shotgun.Reload")
|
|
|
|
|
|
|
|
GAMEMODE:SetPrimaryWeaponModifier(SWEP, WEAPON_MODIFIER_RELOAD_SPEED, 0.07)
|
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_CLIP_SIZE, 1)
|
|
|
|
GAMEMODE:AddNewRemantleBranch(SWEP, 1, "Lithe Stick", "Decreased damage but faster reload, more knockback and more move speed", function(wept)
|
|
|
|
wept.Primary.Damage = wept.Primary.Damage * 0.75
|
|
|
|
wept.ReloadSpeed = wept.ReloadSpeed * 1.25
|
|
|
|
wept.Primary.Delay = wept.Primary.Delay * 0.5
|
|
|
|
wept.Knockback = 100
|
|
|
|
wept.WalkSpeed = SPEED_SLOW
|
|
|
|
end)
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
function SWEP:PrimaryAttack()
|
2018-05-02 06:32:59 +08:00
|
|
|
if not self:CanPrimaryAttack() then return end
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
local owner = self:GetOwner()
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
|
|
|
|
self:EmitSound(self.Primary.Sound)
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
local clip = self:Clip1()
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
self:ShootBullets(self.Primary.Damage, self.Primary.NumShots * clip, self:GetCone())
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
self:TakePrimaryAmmo(clip)
|
|
|
|
owner:ViewPunch(clip * 0.5 * self.Recoil * Angle(math.Rand(-0.1, -0.1), math.Rand(-0.1, 0.1), 0))
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
owner:SetGroundEntity(NULL)
|
|
|
|
owner:SetVelocity(-self.Knockback * clip * owner:GetAimVector())
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
self.IdleAnimation = CurTime() + self:SequenceDuration()
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|