summaryrefslogtreecommitdiff
path: root/entities/weapons/rad_incendiarygrenade/shared.lua
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_incendiarygrenade/shared.lua
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_incendiarygrenade/shared.lua')
-rw-r--r--entities/weapons/rad_incendiarygrenade/shared.lua89
1 files changed, 44 insertions, 45 deletions
diff --git a/entities/weapons/rad_incendiarygrenade/shared.lua b/entities/weapons/rad_incendiarygrenade/shared.lua
index 3dda5dc..42e2723 100644
--- a/entities/weapons/rad_incendiarygrenade/shared.lua
+++ b/entities/weapons/rad_incendiarygrenade/shared.lua
@@ -1,18 +1,18 @@
if SERVER then
AddCSLuaFile("shared.lua")
-
+
end
if CLIENT then
SWEP.ViewModelFlip = true
-
+
SWEP.PrintName = "Incendiary Grenade"
SWEP.IconLetter = "h"
SWEP.Slot = 3
SWEP.Slotpos = 3
-
+
end
SWEP.HoldType = "grenade"
@@ -39,70 +39,70 @@ SWEP.Primary.Delay = 2.300
SWEP.Primary.ClipSize = 1
SWEP.Primary.Automatic = false
-function SWEP:Think()
+function SWEP:Think()
if self.Owner:GetVelocity():Length() > 0 then
-
+
if self.Owner:KeyDown( IN_SPEED ) and self.Owner:GetVelocity():Length() > 0 and self.Owner:GetNWFloat( "Weight", 0 ) < 50 then
-
+
self.LastRunFrame = CurTime() + 0.3
-
+
end
-
+
end
-
+
if self.ThrowTime then
-
+
if self.ThrowTime - 0.3 < CurTime() and not self.ThrowAnim then
-
- self.ThrowAnim = true
-
+
+ self.ThrowAnim = true
+
if self.ThrowPower > 1000 then
-
+
self.Weapon:SendWeaponAnim( ACT_VM_THROW )
-
+
end
-
+
end
-
+
if self.ThrowTime < CurTime() then
-
+
self.ThrowTime = nil
self.ReloadTime = CurTime() + 0.75
-
+
if CLIENT then return end
-
+
local tbl = item.GetByModel( "models/weapons/w_eq_flashbang.mdl" )
-
- if self.Owner:HasItem( tbl.ID ) then
-
+
+ if self.Owner:HasItem( tbl.ID ) then
+
self.Owner:RemoveFromInventory( tbl.ID )
-
+
end
-
+
local ent = ents.Create( "sent_grenade_incendiary" )
ent:SetPos( self.Owner:GetShootPos() + self.Owner:GetRight() * 5 + self.Owner:GetUp() * -5 )
ent:SetOwner( self.Owner )
ent:SetAngles( self.Owner:GetAimVector():Angle() )
ent:SetSpeed( self.ThrowPower )
ent:Spawn()
-
+
if not self.Owner:HasItem( tbl.ID ) then
-
+
self.Owner:StripWeapon( "rad_incendiarygrenade" )
-
+
end
-
+
end
-
+
end
-
+
if self.ReloadTime and self.ReloadTime < CurTime() then
-
+
self.ReloadTime = nil
-
+
self.Weapon:SendWeaponAnim( ACT_VM_DRAW )
-
+
end
end
@@ -113,7 +113,7 @@ function SWEP:SecondaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self.Weapon:ShootEffects()
-
+
self.ThrowTime = CurTime() + 1.25
self.ThrowAnim = false
self.ThrowPower = 800
@@ -126,26 +126,25 @@ function SWEP:PrimaryAttack()
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
self.Weapon:ShootEffects()
-
+
self.ThrowTime = CurTime() + 1.25
self.ThrowAnim = false
self.ThrowPower = 3000
-
+
end
-function SWEP:ShootEffects()
+function SWEP:ShootEffects()
if SERVER then
-
- self.Owner:ViewBounce( self.Primary.Recoil )
-
+
+ self.Owner:ViewBounce( self.Primary.Recoil )
+
end
-
- self.Owner:SetAnimation( PLAYER_ATTACK1 )
-
+
+ self.Owner:SetAnimation( PLAYER_ATTACK1 )
+
end
function SWEP:DrawHUD()
end
-