2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Base = "weapon_zs_baseshotgun"
|
|
|
|
|
|
|
|
SWEP.PrintName = "'Annabelle' Rifle"
|
|
|
|
SWEP.Description = "This rifle loads rounds individually, at the cost of being not perfectly accurate."
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
if CLIENT then
|
|
|
|
SWEP.ViewModelFlip = false
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.IronSightsPos = Vector(-8.8, 10, 4.32)
|
|
|
|
SWEP.IronSightsAng = Vector(1.4, 0.1, 5)
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.HUD3DBone = "ValveBiped.Gun"
|
|
|
|
SWEP.HUD3DPos = Vector(1.75, 1, -5)
|
|
|
|
SWEP.HUD3DAng = Angle(180, 0, 0)
|
|
|
|
SWEP.HUD3DScale = 0.015
|
|
|
|
end
|
|
|
|
|
|
|
|
SWEP.HoldType = "ar2"
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ViewModel = "models/weapons/c_annabelle.mdl"
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.WorldModel = "models/weapons/w_annabelle.mdl"
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.UseHands = true
|
2014-10-02 08:49:54 +08:00
|
|
|
|
|
|
|
SWEP.CSMuzzleFlashes = false
|
|
|
|
|
|
|
|
SWEP.Primary.Sound = Sound("Weapon_Shotgun.Single")
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Damage = 74
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.Primary.NumShots = 1
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Delay = 0.9
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.ReloadDelay = 0.4
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.ClipSize = 5
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.Primary.Automatic = false
|
|
|
|
SWEP.Primary.Ammo = "357"
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.DefaultClip = 25
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ConeMax = 4
|
|
|
|
SWEP.ConeMin = 0.25
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ReloadSound = Sound("Weapon_Shotgun.Reload")
|
|
|
|
SWEP.PumpSound = Sound("Weapon_Shotgun.Special1")
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.WalkSpeed = SPEED_SLOW
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Tier = 2
|
|
|
|
|
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MAX_SPREAD, -0.5, 1)
|
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_MIN_SPREAD, -0.05, 1)
|
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_FIRE_DELAY, -0.1, 1)
|
|
|
|
GAMEMODE:AddNewRemantleBranch(SWEP, 1, "'Annabelle' Birdshot Rifle", "Fires a spread of less accurate shots that deal more total damage", function(wept)
|
|
|
|
wept.Primary.Damage = wept.Primary.Damage / 5
|
|
|
|
wept.Primary.NumShots = 6
|
|
|
|
wept.ConeMin = wept.ConeMin * 8
|
|
|
|
wept.ConeMax = wept.ConeMax * 2
|
|
|
|
end)
|
|
|
|
|
|
|
|
function SWEP:EmitFireSound()
|
|
|
|
self:EmitSound(self.Primary.Sound, 75, math.random(95, 103), 0.8)
|
|
|
|
self:EmitSound("weapons/shotgun/shotgun_fire6.wav", 75, math.random(78, 81), 0.65, CHAN_WEAPON + 20)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
function SWEP:SecondaryAttack()
|
|
|
|
if self:GetNextSecondaryFire() <= CurTime() and not self:GetOwner():IsHolding() and self:GetReloadFinish() == 0 then
|
|
|
|
self:SetIronsights(true)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:Think()
|
2018-05-02 06:32:59 +08:00
|
|
|
if self:GetIronsights() and not self:GetOwner():KeyDown(IN_ATTACK2) then
|
2014-10-02 08:49:54 +08:00
|
|
|
self:SetIronsights(false)
|
|
|
|
end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
self.BaseClass.Think(self)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|