AddCSLuaFile( "shared.lua" )
SWEP.Author = "Flubascrubadoo"
SWEP.Purpose = ""
SWEP.Instructions = ""
SWEP.Spawnable = false
SWEP.AdminSpawnable = true
SWEP.ViewModel = "models/weapons/v_atgun.mdl"
SWEP.WorldModel = "models/jaanus/atgun.mdl"
SWEP.Category = "etest"
SWEP.Primary.ClipSize = 8
SWEP.Primary.DefaultClip = -1
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "none"
SWEP.Primary.ClipSize = -1
SWEP.Primary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = "none"
SWEP.Weight = 5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.PrintName = "Heavy Plasma Sniper Rifle"
SWEP.Slot = 1
SWEP.SlotPos = 2
SWEP.DrawAmmo = false
SWEP.DrawCrosshair = true
local ShootSound = Sound( "NPC_Hunter.FlechetteShoot" )
Zoom = 0
Slomo = 0
/*---------------------------------------------------------
Think does nothing (insert strikethrough) something
---------------------------------------------------------*/
/*function SWEP:Reload() //ugh doesnt work, but i dont care
if(Slomo == 0) then
if(SERVER) then
RunConsoleCommand("host_timescale", "0.7")
end
self:EmitSound("Weapon_AR2.Special1")
Slomo = 1
else
if(SERVER) then
RunConsoleCommand("host_timescale", "1")
end
self:EmitSound("Weapon_AR2.Special2")
Slomo = 0
end
end*/
/*---------------------------------------------------------
PrimaryAttack
---------------------------------------------------------*/
function SWEP:PrimaryAttack()
self.Weapon:SetNextPrimaryFire( CurTime() + 0.85 )
self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
self:EmitSound( ShootSound )
self:ShootEffects( self )
// The rest is only done on the server and shit
if (!SERVER) then return end
self:TakePrimaryAmmo( 0 )
local x
for x = 1, 12 do
local r1 = math.random(-20, 20) / 10000
local r2 = math.random(-20, 20) / 10000
local r3 = math.random(-20, 20) / 10000
local Forward = self.Owner:EyeAngles():Forward()
local ent = ents.Create( "hunter_flechette" )
if ( ValidEntity( ent ) ) then
ent:SetPos( self.Owner:GetShootPos() + Forward * 30 )
ent:SetAngles( self.Owner:EyeAngles() )
ent:Spawn()
ent:SetVelocity( Forward * 3000 ) //LET THERE BE BULLET DROP! IN THIS CASE, FLECHETTEs.
end
ent:Fire("addoutput","basevelocity 0 0 -5",0.1)
ent:Fire("addoutput","basevelocity 0 0 -6",0.3)
ent:Fire("addoutput","basevelocity 0 0 -8",0.5)
ent:Fire("addoutput","basevelocity 0 0 -10",0.7)
ent:Fire("addoutput","basevelocity 0 0 -13",1)
ent:Fire("addoutput","basevelocity 0 0 -16",1.3)
ent:Fire("addoutput","basevelocity 0 0 -19",1.5)
ent:Fire("addoutput","basevelocity 0 0 -23",1.7) //useless mumbo jumbo
ent:Fire("addoutput","basevelocity 0 0 -27",2)
ent:Fire("addoutput","basevelocity 0 0 -31.5",2.3)
ent:Fire("addoutput","basevelocity 0 0 -34",2.5)
ent:Fire("addoutput","basevelocity 0 0 -39",2.7)
ent:AddEffects( EF_ITEM_BLINK | EF_BRIGHTLIGHT );
ent:SetOwner( self.Owner )
util.ScreenShake( ent:GetPos(), 2, 2, 0.7, 100 )
ParticleEffectAttach("larvae_glow_extract",PATTACH_ABSORIGIN_FOLLOW,ent,0) //wee
ParticleEffectAttach("vortigaunt_hand_glow",PATTACH_ABSORIGIN_FOLLOW,ent,0)
ParticleEffectAttach("test_beam",PATTACH_ABSORIGIN_FOLLOW,ent,0)
timer.Simple(2.7,function() ParticleEffectAttach("Weapon_Combine_Ion_Cannon_Explosion",PATTACH_ABSORIGIN_FOLLOW,ent,0) end)
timer.Simple(2.7,function() ParticleEffectAttach("electrical_arc_01_system",PATTACH_ABSORIGIN_FOLLOW,ent,0) end)
//timer.Simple(2.7,function() ParticleEffectAttach("cingularity",PATTACH_ABSORIGIN_FOLLOW,ent,0) end)
//timer.Simple(2.7,function() ParticleEffectAttach("aurora_02b",PATTACH_ABSORIGIN_FOLLOW,ent,0) end)
end
end
/*---------------------------------------------------------
SecondaryAttack
---------------------------------------------------------*/
function SWEP:SecondaryAttack()
if(Zoom == 0) then
if(SERVER) then
self.Owner:SetFOV( 25, 0.25 )
end
self:EmitSound("Weapon_AR2.Special1")
Zoom = 1
else
if(SERVER) then
self.Owner:SetFOV( 0, 0.25 )
end
self:EmitSound("Weapon_AR2.Special2")
Zoom = 0
end
end
hook.Add("EntityRemoved", "entRemoved", entityRemoved)
timer.Simple(2.7,function()
if IsValid(ent) then
ParticleEffectAttach("aurora_02b",PATTACH_ABSORIGIN_FOLLOW,ent,0)
ParticleEffectAttach("electrical_arc_01_system",PATTACH_ABSORIGIN_FOLLOW,ent,0)
ParticleEffectAttach("Weapon_Combine_Ion_Cannon_Explosion",PATTACH_ABSORIGIN_FOLLOW,ent,0)
ParticleEffectAttach("cingularity",PATTACH_ABSORIGIN_FOLLOW,ent,0)
end
end)