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

88 lines
2.2 KiB
Lua
Raw Normal View History

2014-10-02 08:49:54 +08:00
AddCSLuaFile()
DEFINE_BASECLASS("weapon_zs_base")
2014-10-02 08:49:54 +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
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")
SWEP.Primary.Damage = 55
2014-10-02 08:49:54 +08:00
SWEP.Primary.NumShots = 1
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
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
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)
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
return BaseClass.GetViewModelPosition(self, pos, ang)
2014-10-02 08:49:54 +08:00
end
function SWEP:DrawHUDBackground()
if GAMEMODE.DisableScopes then return end
2014-10-02 08:49:54 +08:00
if self:IsScoped() then
self:DrawRegularScope()
2014-10-02 08:49:54 +08:00
end
end
end