zombiesurvival-evolved/gamemodes/zombiesurvival/entities/weapons/weapon_zs_boomstick.lua

80 lines
2.2 KiB
Lua
Raw Normal View History

2014-10-02 08:49:54 +08:00
AddCSLuaFile()
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
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
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
SWEP.ReloadDelay = 0.5
2014-10-02 08:49:54 +08:00
SWEP.Primary.Sound = Sound("weapons/shotgun/shotgun_dbl_fire.wav")
SWEP.Primary.Damage = 27
2014-10-02 08:49:54 +08:00
SWEP.Primary.NumShots = 6
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
SWEP.ConeMax = 11.5
SWEP.ConeMin = 10
2014-10-02 08:49:54 +08:00
SWEP.Tier = 5
SWEP.MaxStock = 2
2014-10-02 08:49:54 +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()
if not self:CanPrimaryAttack() then return end
2014-10-02 08:49:54 +08:00
local owner = self:GetOwner()
2014-10-02 08:49:54 +08:00
self:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
self:EmitSound(self.Primary.Sound)
2014-10-02 08:49:54 +08:00
local clip = self:Clip1()
2014-10-02 08:49:54 +08:00
self:ShootBullets(self.Primary.Damage, self.Primary.NumShots * clip, self:GetCone())
2014-10-02 08:49:54 +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
owner:SetGroundEntity(NULL)
owner:SetVelocity(-self.Knockback * clip * owner:GetAimVector())
2014-10-02 08:49:54 +08:00
self.IdleAnimation = CurTime() + self:SequenceDuration()
2014-10-02 08:49:54 +08:00
end