summaryrefslogtreecommitdiff
path: root/entities/weapons/rad_experimental
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-05-30 21:01:18 -0400
commitd62058fcdea5fc6736a2a373f47dc6c14c70c319 (patch)
tree79a1325190e3f1f1b6d6a2dbcdfc1ba3fa866ac9 /entities/weapons/rad_experimental
parentc38f00182ba6c282806eecb39a42e64d5feafa37 (diff)
downloadredead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.gz
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.tar.bz2
redead-d62058fcdea5fc6736a2a373f47dc6c14c70c319.zip
Removed exessive whitespace so future commits will be cleaner
Diffstat (limited to 'entities/weapons/rad_experimental')
-rw-r--r--entities/weapons/rad_experimental/shared.lua86
1 files changed, 43 insertions, 43 deletions
diff --git a/entities/weapons/rad_experimental/shared.lua b/entities/weapons/rad_experimental/shared.lua
index f8da7b8..4c2d1b8 100644
--- a/entities/weapons/rad_experimental/shared.lua
+++ b/entities/weapons/rad_experimental/shared.lua
@@ -1,20 +1,20 @@
if SERVER then
AddCSLuaFile("shared.lua")
-
+
end
if CLIENT then
-
+
SWEP.ViewModelFlip = false
-
+
SWEP.ViewModelFOV = 60
-
+
SWEP.PrintName = "PPW-952"
SWEP.IconLetter = "m"
SWEP.Slot = 4
SWEP.Slotpos = 2
-
+
end
SWEP.HoldType = "ar2"
@@ -51,28 +51,28 @@ SWEP.Primary.Delay = 1.400
SWEP.Primary.ClipSize = 3
SWEP.Primary.Automatic = true
-function SWEP:ShootEffects()
+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( ACT_VM_PRIMARYATTACK )
-
+
+ self.Owner:MuzzleFlash()
+ self.Owner:SetAnimation( PLAYER_ATTACK1 )
+
+ self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
+
end
function SWEP:PrimaryAttack()
- if not self.Weapon:CanPrimaryAttack() then
-
+ if not self.Weapon:CanPrimaryAttack() then
+
self.Weapon:SetNextPrimaryFire( CurTime() + 0.5 )
- return
-
+ return
+
end
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
@@ -81,11 +81,11 @@ function SWEP:PrimaryAttack()
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
@@ -93,62 +93,62 @@ end
function SWEP:ShootBullets( damage, numbullets, aimcone, zoommode )
if SERVER then
-
+
self.Owner:AddStat( "Bullets", numbullets )
-
+
end
local scale = aimcone
-
+
if self.Owner:KeyDown( IN_FORWARD ) or self.Owner:KeyDown( IN_BACK ) or self.Owner:KeyDown( IN_MOVELEFT ) or self.Owner:KeyDown( IN_MOVERIGHT ) then
-
+
scale = aimcone * 1.75
-
+
elseif self.Owner:KeyDown( IN_DUCK ) or self.Owner:KeyDown( IN_WALK ) then
-
+
scale = math.Clamp( aimcone / 1.75, 0, 10 )
-
+
end
-
+
local bullet = {}
bullet.Num = numbullets
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector( scale, scale, 0 )
+ bullet.Src = self.Owner:GetShootPos()
+ bullet.Dir = self.Owner:GetAimVector()
+ bullet.Spread = Vector( scale, scale, 0 )
bullet.Tracer = 1
- bullet.Force = damage * 2
+ bullet.Force = damage * 2
bullet.Damage = 1
bullet.AmmoType = "Pistol"
bullet.TracerName = "AirboatGunHeavyTracer"
-
+
bullet.Callback = function ( attacker, tr, dmginfo )
if IsValid( tr.Entity ) and IsValid( self ) and IsValid( self.Owner ) and SERVER then
-
+
if tr.Entity:IsPlayer() and tr.Entity:Team() == TEAM_ZOMBIES then
-
+
tr.Entity:SetModel( table.Random( GAMEMODE.Corpses ) )
-
+
end
-
+
local dmg = DamageInfo()
dmg:SetDamage( 500 )
dmg:SetDamageType( DMG_BLAST )
dmg:SetAttacker( self.Owner )
dmg:SetInflictor( self.Weapon )
-
+
tr.Entity:EmitSound( self.Gore, 100, math.random(90,110) )
tr.Entity:TakeDamageInfo( dmg )
-
+
end
-
+
local ed = EffectData()
ed:SetOrigin( tr.HitPos )
ed:SetNormal( tr.HitNormal )
util.Effect( "energy_explosion", ed, true, true )
end
-
+
self.Owner:FireBullets( bullet )
-
+
end