2014-10-02 08:49:54 +08:00
|
|
|
AddCSLuaFile()
|
2018-05-02 06:32:59 +08:00
|
|
|
DEFINE_BASECLASS("weapon_zs_base")
|
2014-10-02 08:49:54 +08:00
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.PrintName = "'Stubber' Rifle"
|
|
|
|
SWEP.Description = "Your basic bolt action sniper rifle, capable of providing good damage on headshots."
|
|
|
|
|
|
|
|
SWEP.Slot = 3
|
|
|
|
SWEP.SlotPos = 0
|
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.ViewModelFlip = false
|
|
|
|
|
|
|
|
SWEP.HUD3DBone = "v_weapon.scout_Parent"
|
|
|
|
SWEP.HUD3DPos = Vector(-1, -2.75, -6)
|
|
|
|
SWEP.HUD3DAng = Angle(0, 0, 0)
|
|
|
|
SWEP.HUD3DScale = 0.015
|
|
|
|
end
|
|
|
|
|
|
|
|
SWEP.Base = "weapon_zs_base"
|
|
|
|
|
|
|
|
SWEP.HoldType = "ar2"
|
|
|
|
|
|
|
|
SWEP.ViewModel = "models/weapons/cstrike/c_snip_scout.mdl"
|
|
|
|
SWEP.WorldModel = "models/weapons/w_snip_scout.mdl"
|
|
|
|
SWEP.UseHands = true
|
|
|
|
|
|
|
|
SWEP.ReloadSound = Sound("Weapon_Scout.ClipOut")
|
|
|
|
SWEP.Primary.Sound = Sound("Weapon_Scout.Single")
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Damage = 55
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.Primary.NumShots = 1
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.Primary.Delay = 1.25
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.ReloadDelay = SWEP.Primary.Delay
|
|
|
|
|
|
|
|
SWEP.Primary.ClipSize = 5
|
|
|
|
SWEP.Primary.Automatic = false
|
|
|
|
SWEP.Primary.Ammo = "357"
|
|
|
|
SWEP.Primary.DefaultClip = 25
|
|
|
|
|
|
|
|
SWEP.Primary.Gesture = ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW
|
|
|
|
SWEP.ReloadGesture = ACT_HL2MP_GESTURE_RELOAD_SHOTGUN
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
SWEP.ConeMax = 3.75
|
2014-10-02 08:49:54 +08:00
|
|
|
SWEP.ConeMin = 0
|
|
|
|
|
|
|
|
SWEP.IronSightsPos = Vector(5.015, -8, 2.52)
|
|
|
|
SWEP.IronSightsAng = Vector(0, 0, 0)
|
|
|
|
|
|
|
|
SWEP.WalkSpeed = SPEED_SLOW
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
GAMEMODE:AttachWeaponModifier(SWEP, WEAPON_MODIFIER_CLIP_SIZE, 1)
|
|
|
|
GAMEMODE:AddNewRemantleBranch(SWEP, 1, "'Prodder' Rifle", "Slightly more headshot damage and zoom, half clip and increased fire delay", function(wept)
|
|
|
|
wept.HeadshotMulti = 2.2
|
|
|
|
wept.Primary.ClipSize = math.ceil(wept.Primary.ClipSize / 2)
|
|
|
|
wept.Primary.Delay = wept.Primary.Delay * 1.7
|
|
|
|
|
|
|
|
wept.IronsightsMultiplier = 0.15
|
|
|
|
end)
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
function SWEP:IsScoped()
|
|
|
|
return self:GetIronsights() and self.fIronTime and self.fIronTime + 0.25 <= CurTime()
|
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:EmitFireSound()
|
|
|
|
self:EmitSound(self.Primary.Sound, 85, 100)
|
|
|
|
end
|
|
|
|
|
|
|
|
if CLIENT then
|
|
|
|
SWEP.IronsightsMultiplier = 0.25
|
|
|
|
|
|
|
|
function SWEP:GetViewModelPosition(pos, ang)
|
2018-05-02 06:32:59 +08:00
|
|
|
if GAMEMODE.DisableScopes then return end
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
if self:IsScoped() then
|
|
|
|
return pos + ang:Up() * 256, ang
|
|
|
|
end
|
|
|
|
|
2018-05-02 06:32:59 +08:00
|
|
|
return BaseClass.GetViewModelPosition(self, pos, ang)
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
function SWEP:DrawHUDBackground()
|
2018-05-02 06:32:59 +08:00
|
|
|
if GAMEMODE.DisableScopes then return end
|
|
|
|
|
2014-10-02 08:49:54 +08:00
|
|
|
if self:IsScoped() then
|
2018-05-02 06:32:59 +08:00
|
|
|
self:DrawRegularScope()
|
2014-10-02 08:49:54 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|