summaryrefslogtreecommitdiff
path: root/entities/weapons/rad_berettas/shared.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 14:42:09 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 14:42:09 -0400
commit2736f498f30220b858fc6fac23e7ddc4a597df6d (patch)
tree374ceadedb654b00e09dac321620a8320830f734 /entities/weapons/rad_berettas/shared.lua
downloadredead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.gz
redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.tar.bz2
redead-2736f498f30220b858fc6fac23e7ddc4a597df6d.zip
Inital commit
Diffstat (limited to 'entities/weapons/rad_berettas/shared.lua')
-rw-r--r--entities/weapons/rad_berettas/shared.lua91
1 files changed, 91 insertions, 0 deletions
diff --git a/entities/weapons/rad_berettas/shared.lua b/entities/weapons/rad_berettas/shared.lua
new file mode 100644
index 0000000..4ffeebd
--- /dev/null
+++ b/entities/weapons/rad_berettas/shared.lua
@@ -0,0 +1,91 @@
+if SERVER then
+
+ AddCSLuaFile("shared.lua")
+
+end
+
+if CLIENT then
+
+ SWEP.ViewModelFlip = false
+
+ SWEP.PrintName = "Dual Berettas"
+ SWEP.IconLetter = "s"
+ SWEP.Slot = 2
+ SWEP.Slotpos = 0
+
+end
+
+SWEP.HoldType = "duel"
+
+SWEP.Base = "rad_base"
+
+SWEP.ViewModel = "models/weapons/v_pist_elite.mdl"
+SWEP.WorldModel = "models/weapons/w_pist_elite.mdl"
+
+SWEP.SprintPos = Vector (-0.626, 0.5615, 3.5852)
+SWEP.SprintAng = Vector (-25.2347, -3.1815, 0.3427)
+
+SWEP.IsSniper = false
+SWEP.AmmoType = "Pistol"
+
+SWEP.AnimPos = 1
+
+SWEP.Anims = {}
+SWEP.Anims[1] = ACT_VM_SECONDARYATTACK
+SWEP.Anims[2] = ACT_VM_PRIMARYATTACK
+
+SWEP.Primary.Sound = Sound( "Weapon_Elite.Single" )
+SWEP.Primary.Recoil = 9.5
+SWEP.Primary.Damage = 40
+SWEP.Primary.NumShots = 1
+SWEP.Primary.Cone = 0.040
+SWEP.Primary.Delay = 0.180
+
+SWEP.Primary.ClipSize = 30
+SWEP.Primary.Automatic = false
+
+function SWEP:ShootEffects()
+
+ if IsFirstTimePredicted() then
+
+ self.Owner:ViewPunch( Angle( math.Rand( -0.2, -0.1 ) * self.Primary.Recoil, math.Rand( -0.05, 0.05 ) * self.Primary.Recoil, 0 ) )
+
+ end
+
+ self.Owner:MuzzleFlash()
+ self.Owner:SetAnimation( PLAYER_ATTACK1 )
+
+ self.Weapon:SendWeaponAnim( self.Anims[ self.AnimPos ] )
+
+ self.AnimPos = self.AnimPos + 1
+
+ if self.AnimPos > 2 then
+
+ self.AnimPos = 1
+
+ end
+
+end
+
+--[[function SWEP:PrimaryAttack()
+
+ if not self.Weapon:CanPrimaryAttack() then
+
+ self.Weapon:SetNextPrimaryFire( CurTime() + 0.5 )
+ return
+
+ end
+
+ self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
+ self.Weapon:EmitSound( self.Primary.Sound, 100, math.random(95,105) )
+ self.Weapon:ShootBullets( self.Primary.Damage, self.Primary.NumShots, self.Primary.Cone, self.Weapon:GetZoomMode() )
+ self.Weapon:TakePrimaryAmmo( 1 )
+ self.Weapon:ShootEffects()
+
+ if SERVER then
+
+ self.Owner:AddAmmo( self.AmmoType, -1 )
+
+ end
+
+end]]