diff --git a/lua/autorun/wepsnd.lua b/lua/autorun/wepsnd.lua index 2324954..000b856 100644 --- a/lua/autorun/wepsnd.lua +++ b/lua/autorun/wepsnd.lua @@ -2,7 +2,7 @@ AddCSLuaFile() -- i'd joke about there being pain involved in making this, but in reality i made a script to do this for me -local pt = {98,102} +local pt = {98, 102} sound.Add({name = "Weapon_30cal.Shoot", channel = 1, volume = 1, level = 150, pitch = pt, sound = "^30cal/30cal_shoot.wav"}) sound.Add({name = "Weapon_30cal.BoltBack", channel = 3, volume = 1, level = 75, pitch = 100, sound = "30cal/30cal_boltback.wav"}) diff --git a/lua/weapons/weapon_acf_30cal.lua b/lua/weapons/weapon_acf_30cal.lua index bc6fd51..b56ccdf 100644 --- a/lua/weapons/weapon_acf_30cal.lua +++ b/lua/weapons/weapon_acf_30cal.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1919" -SWEP.IconOffset = Vector(-22,-8,6) +SWEP.IconOffset = Vector(-22, -8, 6) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -44,14 +44,14 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(2,0,-4) -SWEP.IronSightPos = Vector(-2,-4,2) ---SWEP.IronSightAng = Angle(0,0,0) +SWEP.IdlePos = Vector(2, 0, -4) +SWEP.IronSightPos = Vector(-2, -4, 2) +--SWEP.IronSightAng = Angle(0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,1,-2) -SWEP.OffsetWorldModelAng = Angle(0,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 1, -2) +SWEP.OffsetWorldModelAng = Angle(0, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 1 @@ -66,15 +66,15 @@ function SWEP:Reload() if self:GetSequenceActivity(self:GetSequence()) == ACT_VM_RELOAD_DEPLOYED then return end if self:Clip1() == self.Primary.ClipSize then return end if self:Ammo1() == 0 then return false end - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self:SendWeaponAnim(ACT_VM_RELOAD_DEPLOYED) - local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(),self:Ammo1()) + local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(), self:Ammo1()) self.Reloading = true - timer.Simple(self:SequenceDuration(),function() + timer.Simple(self:SequenceDuration(), function() if self:GetOwner():GetActiveWeapon() ~= self then self.Reloading = false return end self:SendWeaponAnim(ACT_VM_IDLE) - self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(),0,self.Primary.ClipSize)) - self:GetOwner():RemoveAmmo(RoundsMissing,self.Primary.Ammo) + self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(), 0, self.Primary.ClipSize)) + self:GetOwner():RemoveAmmo(RoundsMissing, self.Primary.Ammo) self.Reloading = false end) end @@ -86,7 +86,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -110,9 +110,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_357magnum.lua b/lua/weapons/weapon_acf_357magnum.lua index 28ed45f..f78a228 100644 --- a/lua/weapons/weapon_acf_357magnum.lua +++ b/lua/weapons/weapon_acf_357magnum.lua @@ -6,8 +6,8 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Revolver" -SWEP.IconOffset = Vector(-6,24,2) -SWEP.IconAngOffset = Angle(4,0,0) +SWEP.IconOffset = Vector(-6, 24, 2) +SWEP.IconAngOffset = Angle(4, 0, 0) SWEP.UseHands = true SWEP.ViewModel = "models/weapons/c_357.mdl" @@ -43,8 +43,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-4.71,-6,0.62) -SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-4.71, -6, 0.62) +SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Zoom = 1.3 @@ -61,7 +61,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -85,9 +85,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_57.lua b/lua/weapons/weapon_acf_57.lua index 9f158d7..3e36816 100644 --- a/lua/weapons/weapon_acf_57.lua +++ b/lua/weapons/weapon_acf_57.lua @@ -42,8 +42,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.95,0,2.75) ---SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-5.95, 0, 2.75) +--SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Zoom = 1.2 SWEP.Recovery = 4 @@ -57,7 +57,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -81,7 +81,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_ak47.lua b/lua/weapons/weapon_acf_ak47.lua index 15d8a01..8e87e2f 100644 --- a/lua/weapons/weapon_acf_ak47.lua +++ b/lua/weapons/weapon_acf_ak47.lua @@ -41,8 +41,8 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.57,-7,2.25) -SWEP.IronSightAng = Angle(2.25,0,1) +SWEP.IronSightPos = Vector(-6.57, -7, 2.25) +SWEP.IronSightAng = Angle(2.25, 0, 1) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -56,7 +56,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -80,13 +80,13 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end self:PostShot(1) - timer.Simple(0.01,function() if (Ply:GetActiveWeapon() == self) and self:Clip1() > 0 then self:SendWeaponAnim(ACT_VM_IDLE) end end) + timer.Simple(0.01, function() if (Ply:GetActiveWeapon() == self) and self:Clip1() > 0 then self:SendWeaponAnim(ACT_VM_IDLE) end end) end diff --git a/lua/weapons/weapon_acf_amr.lua b/lua/weapons/weapon_acf_amr.lua index a569a4e..0dc7187 100644 --- a/lua/weapons/weapon_acf_amr.lua +++ b/lua/weapons/weapon_acf_amr.lua @@ -5,8 +5,8 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Anti-Material Rifle" -SWEP.IconOffset = Vector(4,4,0) -SWEP.IconAngOffset = Angle(0,180,0) +SWEP.IconOffset = Vector(4, 4, 0) +SWEP.IconAngOffset = Angle(0, 180, 0) SWEP.UseHands = true SWEP.ViewModel = "models/weapons/v_sniper.mdl" @@ -47,7 +47,7 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.775,-4,0.92) +SWEP.IronSightPos = Vector(-5.775, -4, 0.92) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -71,7 +71,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end diff --git a/lua/weapons/weapon_acf_aug.lua b/lua/weapons/weapon_acf_aug.lua index 239fe74..6494b80 100644 --- a/lua/weapons/weapon_acf_aug.lua +++ b/lua/weapons/weapon_acf_aug.lua @@ -5,7 +5,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF AUG" -SWEP.IconOffset = Vector(6,6,-2) +SWEP.IconOffset = Vector(6, 6, -2) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -46,8 +46,8 @@ SWEP.Zoom = 2 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-8.35,-2,2.1) -SWEP.IronSightAng = Angle(0,-3,0) +SWEP.IronSightPos = Vector(-8.35, -2, 2.1) +SWEP.IronSightAng = Angle(0, -3, 0) SWEP.AimFocused = 0.5 SWEP.AimUnfocused = 4 @@ -62,7 +62,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -86,9 +86,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_bar.lua b/lua/weapons/weapon_acf_bar.lua index 97020fa..a09a519 100644 --- a/lua/weapons/weapon_acf_bar.lua +++ b/lua/weapons/weapon_acf_bar.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1918 BAR" -SWEP.IconOffset = Vector(-16,0,0) +SWEP.IconOffset = Vector(-16, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -45,14 +45,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,0,2) -SWEP.IronSightPos = Vector(-6.26,0,5.55) ---SWEP.IronSightAng = Angle(0,0,0) +SWEP.IdlePos = Vector(0, 0, 2) +SWEP.IronSightPos = Vector(-6.26, 0, 5.55) +--SWEP.IronSightAng = Angle(0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0.75,0.25,1.5) -SWEP.OffsetWorldModelAng = Angle(15,0,180) +SWEP.OffsetWorldModelPos = Vector(0.75, 0.25, 1.5) +SWEP.OffsetWorldModelAng = Angle(15, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -67,7 +67,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -91,7 +91,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_base.lua b/lua/weapons/weapon_acf_base.lua index 873ad90..3ddaa65 100644 --- a/lua/weapons/weapon_acf_base.lua +++ b/lua/weapons/weapon_acf_base.lua @@ -83,9 +83,9 @@ SWEP.ACFMuzzleVel = 800 -- Speed of the projectile leaving the barrel SWEP.ACFProjMass = 0.004 -- kg of projectile SWEP.Tracer = 0 -- Supposed to be length in the final projectile dedicated to tracer filler, but seems to not affect anything except for showing tracers -SWEP.IronSightPos = Vector(0,0,0) -- Shifts the viewmodel by this much to put the view inline with the iron sights +SWEP.IronSightPos = Vector(0, 0, 0) -- Shifts the viewmodel by this much to put the view inline with the iron sights --SWEP.IronSightAng = Angle() -- Turns the viewmodel by this much to help line the above too -SWEP.SprintAng = Angle(-15,40,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-15, 40, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.AimFocused = 0.5 -- Multiplier to the weapon spread while aimed down sights SWEP.AimUnfocused = 3 -- Same, but when not aimed @@ -107,6 +107,7 @@ SWEP.Recovery = 1 SWEP.Handling = 1 -- Attempt a hybrid trace, one that will attempt to ease some pain with the SWEPs SWEP.UseHybrid = true +SWEP.UseBloodEffect = false --Hybrid trace hits will cause blood effects instead of ACF Penetration effect. -- Internal values, don't change! SWEP.DropCalc = {} @@ -191,8 +192,8 @@ function SWEP:SetupACFBullet() end function SWEP:Initialize() - self.FiremodeSetting = math.Clamp(math.floor(self.FiremodeSetting),1,2) - self.CurrentFiremode = math.Clamp(math.floor(self.CurrentFiremode),1,2) + self.FiremodeSetting = math.Clamp(math.floor(self.FiremodeSetting), 1, 2) + self.CurrentFiremode = math.Clamp(math.floor(self.CurrentFiremode), 1, 2) if self.FiremodeSetting ~= 1 then if self.CurrentFiremode == 1 then self.Primary.Automatic = true else self.Primary.Automatic = false end @@ -202,19 +203,19 @@ function SWEP:Initialize() self:SetHoldType(self.HoldType) -- These have to be networked since the clientside ACF bullets don't get information from anything except the crate (the gun represents this in this case) - self:SetNW2Float("Caliber",self.Bullet.Caliber) - self:SetNW2Float("ProjMass",self.Bullet.ProjMass) - self:SetNW2Float("DragCoef",self.Bullet.DragCoef) - self:SetNW2Float("AmmoType",self.Bullet.Type) + self:SetNW2Float("Caliber", self.Bullet.Caliber) + self:SetNW2Float("ProjMass", self.Bullet.ProjMass) + self:SetNW2Float("DragCoef", self.Bullet.DragCoef) + self:SetNW2Float("AmmoType", self.Bullet.Type) - if self.BulletModel then self:SetNW2String("BulletModel",self.BulletModel) self:SetNW2Float("BulletScale",self.BulletScale or 1) end + if self.BulletModel then self:SetNW2String("BulletModel", self.BulletModel) self:SetNW2Float("BulletScale", self.BulletScale or 1) end if self.Tracer > 0 then - self:SetNW2Float("Tracer",self.Tracer) + self:SetNW2Float("Tracer", self.Tracer) end if self.Bullet.Type == "HE" or self.Bullet.Type == "HEAT" then - self:SetNW2Float("FillerMass",self.Bullet.FillerMass) + self:SetNW2Float("FillerMass", self.Bullet.FillerMass) end end @@ -222,22 +223,22 @@ function SWEP:GetAimMod() local Owner = self:GetOwner() if Owner:IsNPC() then return 1 end local LastShot = 0 - if SERVER then LastShot = self.LastShot else LastShot = math.max(self:GetNWFloat("lastshot",CurTime()),self.LastShot) end + if SERVER then LastShot = self.LastShot else LastShot = math.max(self:GetNWFloat("lastshot", CurTime()), self.LastShot) end local Prone = false if Owner.IsProne then Prone = Owner:IsProne() end -- Prone mod support - local VelMod = math.Clamp(Owner:GetAbsVelocity():LengthSqr() / 50000,0,2) * self.MoveBloom + local VelMod = math.Clamp(Owner:GetAbsVelocity():LengthSqr() / 50000, 0, 2) * self.MoveBloom local OwnerOnGround = Owner:IsOnGround() local StanceMod = (Prone and OwnerOnGround and 0.25) or ((Owner:Crouching() and OwnerOnGround) and 0.5 or 1) local OnGround = (OwnerOnGround and 1 or 3) - local Bloom = (1 - math.Clamp((CurTime() - LastShot) * self.Recovery,0,1)) * self.Spread * 6 * (1 / (self.Handling / math.min(1,1.3 * StanceMod))) + local Bloom = (1 - math.Clamp((CurTime() - LastShot) * self.Recovery, 0, 1)) * self.Spread * 6 * (1 / (self.Handling / math.min(1, 1.3 * StanceMod))) if SERVER then local Focus = (self:GetNWBool("iron") and (not Owner:IsSprinting()) and self.AimFocused or self.AimUnfocused) - return math.min(30,((Focus * StanceMod) + Bloom + VelMod) * OnGround) + return math.min(30, ((Focus * StanceMod) + Bloom + VelMod) * OnGround) else - local Focus = Lerp((not Owner:IsSprinting()) and self.IronScale or 0,self.AimUnfocused,self.AimFocused) - return math.min(30,((Focus * StanceMod) + Bloom + VelMod) * OnGround) + local Focus = Lerp((not Owner:IsSprinting()) and self.IronScale or 0, self.AimUnfocused, self.AimFocused) + return math.min(30, ((Focus * StanceMod) + Bloom + VelMod) * OnGround) end end @@ -262,7 +263,7 @@ function SWEP:ResolveAim() end local mask = bit.band(MASK_SOLID, MASK_SHOT) + CONTENTS_AUX -function SWEP:ShootBullet(Pos,Dir) +function SWEP:ShootBullet(Pos, Dir) local Ply = self:GetOwner() local SelfTbl = self:GetTable() @@ -281,12 +282,15 @@ function SWEP:ShootBullet(Pos,Dir) local tr = util.TraceLine({start = Pos, endpos = Pos + (Dir * math.min(1024, SelfTbl.ACFMuzzleVel * 39.37 * 0.05) + Ply:GetVelocity()), filter = filter, mask = mask}) Ply:LagCompensation(false) - if tr.Hit and ACF.Check(tr.Entity) then + if tr.Hit and ACF.Check(tr.Entity) and (tr.Entity:IsPlayer() or tr.Entity:IsNPC()) then --Hybrid trace will fully initiate if it only hits player or npcs. local DmgResult, DmgInfo = DmgObj.DamageResult(), DmgObj.DamageInfo() local Bullet = SelfTbl.Bullet local Thickness = tr.Entity.ACF.Armour local Dist = Pos:Distance(tr.HitPos) local RangedSpeed = ACF.GetRangedSpeed(SelfTbl.ACFMuzzleVel, Bullet.DragCoef, Dist / 39.37) * 0.0254 + local ScaleVel = SelfTbl.ACFMuzzleVel * 39.3701 + local RadiusCal = SelfTbl.Caliber / 10 + --local DecalIndex = ACF.GetAmmoDecalIndex i have no idea why this function is giving blank output... DmgResult:SetPenetration(ACF.Penetration(RangedSpeed, Bullet.ProjMass, Bullet.Diameter * 10)) DmgResult:SetArea(Bullet.ProjArea) @@ -303,6 +307,23 @@ function SWEP:ShootBullet(Pos,Dir) local HitRes = Damage.dealDamage(tr.Entity, DmgResult, DmgInfo) + if SelfTbl.UseBloodEffect then + local effect = EffectData() + effect:SetOrigin(tr.HitPos) + effect:SetNormal(tr.Normal) + effect:SetEntity(self) + util.Effect("BloodImpact", effect, true, true) + else + local effect = EffectData() + effect:SetOrigin(tr.HitPos) + effect:SetNormal(tr.Normal) + effect:SetScale(ScaleVel) + effect:SetMagnitude(SelfTbl.ACFProjMass) + effect:SetRadius(RadiusCal) + --effect:SetDamageType(DecalIndex(SelfTbl.ACFType)) the penetration decal still displays without this??? i give up. + util.Effect("ACF_Penetration", effect, true, true) + end + if HitRes.Kill and IsValid(tr.Entity) then local Energy = ACF.Kinetic(RangedSpeed, Bullet.ProjMass) @@ -323,7 +344,7 @@ function SWEP:CanPrimaryAttack() self:SetNextPrimaryFire(CurTime() + self.Primary.Delay) - if self.Primary.Automatic ~= self:GetNWBool("automatic",false) then self:UpdateFiremode() end + if self.Primary.Automatic ~= self:GetNWBool("automatic", false) then self:UpdateFiremode() end if self:GetOwner():IsPlayer() then if SERVER and IsSinglePlayer then self:CallOnClient("PrimaryAttack") end @@ -336,7 +357,7 @@ function SWEP:CanPrimaryAttack() self:Reload() self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -351,7 +372,7 @@ function SWEP:CanPrimaryAttack() self:CallOnClient("ResetAmmo") self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -373,13 +394,13 @@ function SWEP:PostShot(NumberShots) self:GetOwner():SetAnimation(PLAYER_ATTACK1) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end self:TakePrimaryAmmo(NumberShots) end function SWEP:ResetAmmo() -- Only called clientside, to replenish "used" ammo if the server denies an ACF bullet being made - self:SetClip1(self:GetNWInt("lastammo",self:Clip1())) + self:SetClip1(self:GetNWInt("lastammo", self:Clip1())) self:SetNextPrimaryFire(CurTime() + 0.2) self:SendWeaponAnim(ACT_VM_IDLE) end @@ -411,12 +432,12 @@ end function SWEP:UpdateFiremode() if SERVER then - self:SetNWInt("firemode",self.CurrentFiremode) - self:SetNWBool("automatic",self.Primary.Automatic) + self:SetNWInt("firemode", self.CurrentFiremode) + self:SetNWBool("automatic", self.Primary.Automatic) self:CallOnClient("UpdateFiremode") end - if self.Primary.Automatic ~= self:GetNWBool("automatic",false) then self.Primary.Automatic = self:GetNWBool("automatic",false) end + if self.Primary.Automatic ~= self:GetNWBool("automatic", false) then self.Primary.Automatic = self:GetNWBool("automatic", false) end end function SWEP:Deploy() @@ -424,16 +445,16 @@ function SWEP:Deploy() self.FOV = self:GetOwner():GetFOV() else if self.Tracer > 0 then - local Col = Color(255,255,255) + local Col = Color(255, 255, 255) if self:GetOwner():IsPlayer() then Col = team.GetColor(self:GetOwner():Team()) end self:SetColor(Col) end -- Hopefully fixes some weird problem with weapons not "recoiling" as they should self.Primary.Automatic = false - timer.Simple(0,function() + timer.Simple(0, function() if IsValid(self) then - self.Primary.Automatic = self:GetNWBool("automatic",false) + self.Primary.Automatic = self:GetNWBool("automatic", false) end end) end @@ -441,14 +462,14 @@ function SWEP:Deploy() if self.HasDropCalc then self.DropCalc = self:CalcDropTable() end self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end -- self.Owner = self:GetOwner() -- A quick way to match what ACF does for this self:SendWeaponAnim(ACT_VM_DRAW) -- another missing anim if self.Bullet.Type == "HE" or self.Bullet.Type == "HEAT" then - self:SetNW2Float("FillerMass",self.Bullet.FillerMass) + self:SetNW2Float("FillerMass", self.Bullet.FillerMass) end end @@ -456,7 +477,7 @@ function SWEP:Holster() if not IsFirstTimePredicted() then return end self.Reloading = (self:Clip1() <= 0) and (self:Ammo1() > 0) - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self.IronScale = 0 return true @@ -465,14 +486,14 @@ end function SWEP:Reload() local DidReload = self:DefaultReload( ACT_VM_RELOAD ) -- If this is successful, SWEP:Think doesn't run, so we have to handle anything that should happen in there if DidReload and not self.Reloading then - self:SetNWBool("iron",false) - timer.Simple(self:SequenceDuration() * 0.9,function() self.Reloading = false end) + self:SetNWBool("iron", false) + timer.Simple(self:SequenceDuration() * 0.9, function() self.Reloading = false end) end self.Reloading = DidReload end function SWEP:GetPunch() - return Angle(math.Rand(-1.5, -3.5), math.Rand(-0.8, 0.8), 0) * self.RecoilMod * (self:GetNWBool("iron", false) and 0.4 or 1) + return Angle(-3, 0, 0) * self.RecoilMod * (self:GetNWBool("iron", false) and 0.4 or 1) end function SWEP:GetNPCBulletSpread() @@ -480,11 +501,11 @@ function SWEP:GetNPCBulletSpread() end function SWEP:GetNPCBurstSettings() - return math.ceil(self.Primary.ClipSize * 0.05),math.ceil(self.Primary.ClipSize * 0.5),self.Primary.Delay + return math.ceil(self.Primary.ClipSize * 0.05), math.ceil(self.Primary.ClipSize * 0.5), self.Primary.Delay end function SWEP:GetNPCRestTimes() - return self.Primary.Delay,self.Primary.Delay * 5 + return self.Primary.Delay, self.Primary.Delay * 5 end function SWEP:Think() @@ -497,7 +518,7 @@ function SWEP:Think() and (not Owner:KeyDown(IN_USE)) if self:GetNWBool("iron") ~= Condition then - self:SetNWBool("iron",Condition) -- only updates as needed + self:SetNWBool("iron", Condition) -- only updates as needed if self.CustomAnim then if Condition then @@ -509,7 +530,7 @@ function SWEP:Think() if self.FakeFire then -- bump the accuracy a bit self.LastShot = CurTime() + (self.Primary.Delay / 2) - self:SetNWFloat("lastshot",self.LastShot) + self:SetNWFloat("lastshot", self.LastShot) end end @@ -523,11 +544,11 @@ function SWEP:CalcDropTable() local CheapTime = 1 / 60 local Valid = true - local Bullet = {Flight = Vector(1,0,0) * (self.ACFMuzzleVel * 39.37),Pos = Vector(),pm = BD.ProjMass,DragCoef = BD.DragCoef,Accel = ACF.Gravity} + local Bullet = {Flight = Vector(1, 0, 0) * (self.ACFMuzzleVel * 39.37), Pos = Vector(), pm = BD.ProjMass, DragCoef = BD.DragCoef, Accel = ACF.Gravity} Bullet.NextPos = Bullet.Pos - local Targets = {200,400,500,600,700,800} + local Targets = {200, 400, 500, 600, 700, 800} local DropTable = {} local Int = 0 @@ -536,8 +557,8 @@ function SWEP:CalcDropTable() Bullet.Pos = Bullet.NextPos Time = Time + CheapTime if (#Targets > 0) and ((Bullet.Pos.x / 39.37) >= Targets[1]) or false then - DropTable[#DropTable + 1] = {Bullet.Pos,Time,Targets[1]} - table.remove(Targets,1) + DropTable[#DropTable + 1] = {Bullet.Pos, Time, Targets[1]} + table.remove(Targets, 1) end local Drag = Bullet.Flight:GetNormalized() * (Bullet.DragCoef * Bullet.Flight:LengthSqr()) / ACF.DragDiv Bullet.NextPos = Bullet.Pos + ACF.Scale * CheapTime * Bullet.Flight @@ -553,21 +574,30 @@ function SWEP:CalcDropTable() end function SWEP:Recoil(PunchAmt) + local IFTP = IsFirstTimePredicted() local Ply = self:GetOwner() + if Ply:IsPlayer() and (Ply:IsSprinting() and (Ply:GetAbsVelocity():LengthSqr() > 10000)) then return false end + if (SP and SERVER) or (not SP and CLIENT and IFTP) then + local ang = Ply:EyeAngles() + ang.p = ang.p - self.RecoilMod * 0.5 + ang.y = ang.y + math.Rand(-1, 1) * self.RecoilMod * 0.5 + + Ply:SetEyeAngles(ang) + end Ply:ViewPunch(PunchAmt) end if CLIENT then - local Black = Color(0,0,0) - local White = Color(255,255,255) - local Col = Color(127,65,65) - local BGCol = Color(65,65,65) - local ScreenBlack = Color(0,0,0,255) + local Black = Color(0, 0, 0) + local White = Color(255, 255, 255) + local Col = Color(127, 65, 65) + local BGCol = Color(65, 65, 65) + local ScreenBlack = Color(0, 0, 0, 255) - local SX,SY = ScrW(),ScrH() - local Scale = math.max(SX / 1920,1) + local SX, SY = ScrW(), ScrH() + local Scale = math.max(SX / 1920, 1) - surface.CreateFont("SWEP-HUD-FONT",{ + surface.CreateFont("SWEP-HUD-FONT", { font = "Roboto", size = math.ceil(13 * Scale), weight = 500, @@ -614,16 +644,16 @@ if CLIENT then function SWEP:AdjustMouseSensitivity() local Sens = 1 - local Zoomed = self:GetNWBool("iron",false) and not (self.TempOut or false) + local Zoomed = self:GetNWBool("iron", false) and not (self.TempOut or false) if self.Scope and Zoomed then Sens = (1 / (self.Zoom or 1)) * self.IronScale + (1 - self.IronScale) end if not Sens then Sens = 1 end if Sens == 1 then return nil end -- returning nil actually just leaves the player's default sensitivity - return math.Clamp(Sens,0.001,1) + return math.Clamp(Sens, 0.001, 1) end - function SWEP:GetViewModelPosition(Pos,Ang) + function SWEP:GetViewModelPosition(Pos, Ang) -- A * ( 1 - X ) + B * X - local Up,Right,Forward = Ang:Up(), Ang:Right(), Ang:Forward() + local Up, Right, Forward = Ang:Up(), Ang:Right(), Ang:Forward() local Mul = math.min(self.IronScale / 0.75, 1) local Owner = self:GetOwner() @@ -659,47 +689,47 @@ if CLIENT then Pos = Pos + (ViewShift.x * Right) + (ViewShift.y * Forward) + (ViewShift.z * Up) LastVMPos = ep - return Pos,Ang + return Pos, Ang end function SWEP:ShouldDrawViewModel() if self.Scope then - return not (self:GetNWBool("iron",false) and (self.IronScale >= 0.75) and not (self.TempOut or false)) + return not (self:GetNWBool("iron", false) and (self.IronScale >= 0.75) and not (self.TempOut or false)) else return true end end local SM = {x = SX / 2, y = SY / 2} --local UU = (SX > SY) and (SY / 12) or (SX / 12) - function SWEP:DoDrawCrosshair(x,y) + function SWEP:DoDrawCrosshair(x, y) local AimMod = self:GetAimMod() local Spread = self.Spread local SpreadAmt = Spread * AimMod - if self.CrosshairScale then SpreadAmt = math.max(self.CrosshairScale * AimMod,self.Spread) end - local ViewSpread = Vector(100,0,0) - ViewSpread:Rotate(Angle(SpreadAmt,0,0)) + if self.CrosshairScale then SpreadAmt = math.max(self.CrosshairScale * AimMod, self.Spread) end + local ViewSpread = Vector(100, 0, 0) + ViewSpread:Rotate(Angle(SpreadAmt, 0, 0)) ViewSpread:Rotate(EyeAngles()) local Pos = EyePos() + ViewSpread local SPos = Pos:ToScreen() local SpreadSize = SPos.y - (ScrH() / 2) -- we just gonna cheat a little, project the weapons actual spread and get the distance from center, and draw from there - surface.SetDrawColor(255,255,255) - surface.DrawLine(x - SpreadSize,y,x - SpreadSize - 10,y) - surface.DrawLine(x,y + SpreadSize,x,y + SpreadSize + 10) + surface.SetDrawColor(255, 255, 255) + surface.DrawLine(x - SpreadSize, y, x - SpreadSize - 10, y) + surface.DrawLine(x, y + SpreadSize, x, y + SpreadSize + 10) - surface.SetDrawColor(0,0,0) - surface.DrawLine(x + SpreadSize,y,x + SpreadSize + 10,y) - surface.DrawLine(x,y - SpreadSize,x,y - SpreadSize - 10) + surface.SetDrawColor(0, 0, 0) + surface.DrawLine(x + SpreadSize, y, x + SpreadSize + 10, y) + surface.DrawLine(x, y - SpreadSize, x, y - SpreadSize - 10) return true end - local KeyAttack = string.upper(input.LookupBinding("+attack",true)) - local KeyAltAttack = string.upper(input.LookupBinding("+attack2",true)) - local KeyUse = string.upper(input.LookupBinding("+use",true)) + local KeyAttack = string.upper(input.LookupBinding("+attack", true)) + local KeyAltAttack = string.upper(input.LookupBinding("+attack2", true)) + local KeyUse = string.upper(input.LookupBinding("+use", true)) function SWEP:BuildWepSelectionText() - self.ControlText = {KeyAttack .. ": Shoot",KeyAltAttack .. ": Sights"} + self.ControlText = {KeyAttack .. ": Shoot", KeyAltAttack .. ": Sights"} self.DisplayText = {} if self.FiremodeSetting ~= 1 then @@ -712,11 +742,11 @@ if CLIENT then local PenText if self.Bullet.Type == "HEAT" then - self.MeasuredPen = math.Round(AmmoTypes["HEAT"]:GetPenetration(self.Bullet, self.ACFHEATStandoff, ACF.SteelDensity),1) + self.MeasuredPen = math.Round(AmmoTypes["HEAT"]:GetPenetration(self.Bullet, self.ACFHEATStandoff, ACF.SteelDensity), 1) PenText = self.MeasuredPen .. "mm @ All distances" else - self.MeasuredPen = math.Round(AmmoTypes[self.ACFType]:GetRangedPenetration(self.Bullet,self.CalcDistance),1) - self.MeasuredPen2 = math.Round(AmmoTypes[self.ACFType]:GetRangedPenetration(self.Bullet,self.CalcDistance2),1) + self.MeasuredPen = math.Round(AmmoTypes[self.ACFType]:GetRangedPenetration(self.Bullet, self.CalcDistance), 1) + self.MeasuredPen2 = math.Round(AmmoTypes[self.ACFType]:GetRangedPenetration(self.Bullet, self.CalcDistance2), 1) PenText = self.CalcDistance .. "m: " .. self.MeasuredPen .. "mm/" .. self.CalcDistance2 .. "m: " .. self.MeasuredPen2 .. "mm" end @@ -726,9 +756,9 @@ if CLIENT then end SWEP.FrameCount = 0 -- cheap way to control DPanel - function SWEP:DrawWeaponSelection(x,y,w,h) - draw.RoundedBox(8,x,y,w,h,Col) - draw.RoundedBox(4,x + 8,y + 8,w - 16,h - 16,BGCol) + function SWEP:DrawWeaponSelection(x, y, w, h) + draw.RoundedBox(8, x, y, w, h, Col) + draw.RoundedBox(4, x + 8, y + 8, w - 16, h - 16, BGCol) surface.SetDrawColor(White) --self.DisplayText = nil if not self.DisplayText then self:BuildWepSelectionText() return end @@ -737,28 +767,28 @@ if CLIENT then if not self.Panel then local Panel = vgui.Create("DPanel") self.Panel = Panel - Panel:SetPos(x,y + h / 2) - Panel:SetSize(w,h / 2) + Panel:SetPos(x, y + h / 2) + Panel:SetSize(w, h / 2) Panel:SetAlpha(0) Panel.Think = function() if (FrameNumber() - 1) > self.FrameCount then self.Panel = nil Panel:Remove() end end - local Icon = vgui.Create("DModelPanel",Panel) - Icon:SetSize(w,w) + local Icon = vgui.Create("DModelPanel", Panel) + Icon:SetSize(w, w) Icon:Center() function Icon:LayoutEntity() return end Icon:SetModel(self.WorldModel) local E = Icon.Entity E:SetMaterial("models/wireframe") - Icon:SetColor(Color(255 * 0.7,255 * 0.66,0)) + Icon:SetColor(Color(255 * 0.7, 255 * 0.66, 0)) function Icon:PreDrawModel() render.SuppressEngineLighting(true) end Icon.Entity:SetPos(self.IconOffset) Icon.Entity:SetAngles(self.IconAngOffset) - Icon:SetCamPos(Vector(0,50,0)) + Icon:SetCamPos(Vector(0, 50, 0)) Icon:SetLookAt(Vector()) function Icon:PostDrawModel() @@ -766,12 +796,12 @@ if CLIENT then end end - for I = 1,#self.DisplayText do - draw.SimpleText(self.DisplayText[I],"HudSelectionText",x + (w / 2),y + h - 24 - 14 * I,White,TEXT_ALIGN_CENTER,TEXT_ALIGN_TOP) + for I = 1, #self.DisplayText do + draw.SimpleText(self.DisplayText[I], "HudSelectionText", x + (w / 2), y + h - 24 - 14 * I, White, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) end - for I = 1,#self.ControlText do - draw.SimpleText(self.ControlText[I],"HudSelectionText",x + (w / 2),y - 4 + 14 * I,White,TEXT_ALIGN_CENTER,TEXT_ALIGN_TOP) + for I = 1, #self.ControlText do + draw.SimpleText(self.ControlText[I], "HudSelectionText", x + (w / 2), y - 4 + 14 * I, White, TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP) end end @@ -780,11 +810,11 @@ if CLIENT then if Disable[e] then return false else return true end end - local FireModeAlias = {[1] = "A",[2] = "1"} + local FireModeAlias = {[1] = "A", [2] = "1"} - local ScopeMat = Material("HUD/scope2.png","nocull") + local ScopeMat = Material("HUD/scope2.png", "nocull") - local function DrawMagazine(x,y,s) + local function DrawMagazine(x, y, s) -- Note for any future poor soul, for some reason matrices don't work with DrawPoly like you'd want them -- As of writing, DrawPoly individually clamps EACH AND EVERY VALUE to "stay on screen" -- So using a matrix to move the "center" will not result in what you want and cause MUCH frustration @@ -793,68 +823,68 @@ if CLIENT then local poly = { {x = x, y = y - s * 0.1}, - {x = x,y = y - s}, - {x = x + s,y = y - s}, + {x = x, y = y - s}, + {x = x + s, y = y - s}, {x = x + s, y = y + s * 0.05}, {x = x + s * 0.5, y = y + s}, {x = x - s * 0.45, y = y + s * 0.8} } local m = Matrix() - local pos = Vector(x + s * 0.3,y + s * 0.05,0) + local pos = Vector(x + s * 0.3, y + s * 0.05, 0) m:Translate(pos) - m:Scale(Vector(1.21,1.1,0)) + m:Scale(Vector(1.21, 1.1, 0)) m:Translate(-pos) - surface.SetDrawColor(0,0,0) + surface.SetDrawColor(0, 0, 0) cam.PushModelMatrix(m) surface.DrawPoly(poly) cam.PopModelMatrix() - surface.SetDrawColor(c.r,c.g,c.b) + surface.SetDrawColor(c.r, c.g, c.b) surface.DrawPoly(poly) end - local function DrawRound(x,y,s) + local function DrawRound(x, y, s) local c = surface.GetDrawColor() local poly = { - {x = x - s * 0.25,y = y + s}, - {x = x - s * 0.25,y = y - s * 0.5}, - {x = x,y = y - s}, - {x = x + s * 0.26,y = y - s * 0.5}, - {x = x + s * 0.26,y = y + s} + {x = x - s * 0.25, y = y + s}, + {x = x - s * 0.25, y = y - s * 0.5}, + {x = x, y = y - s}, + {x = x + s * 0.26, y = y - s * 0.5}, + {x = x + s * 0.26, y = y + s} } local m = Matrix() - local pos = Vector(x,y,0) + local pos = Vector(x, y, 0) m:Translate(pos) - m:Scale(Vector(1.4,1.1,0)) + m:Scale(Vector(1.4, 1.1, 0)) m:Translate(-pos) - surface.SetDrawColor(0,0,0) + surface.SetDrawColor(0, 0, 0) cam.PushModelMatrix(m) surface.DrawPoly(poly) cam.PopModelMatrix() - surface.SetDrawColor(c.r,c.g,c.b) + surface.SetDrawColor(c.r, c.g, c.b) surface.DrawPoly(poly) end local function SetAmmoColor(perc) - local c = Vector(255,255,255) + local c = Vector(255, 255, 255) if perc == 1 then return c:Unpack() elseif perc >= 0.5 then - c = LerpVector((perc - 0.5) / 0.5,Vector(255,255,0),Vector(255,255,255)) + c = LerpVector((perc - 0.5) / 0.5, Vector(255, 255, 0), Vector(255, 255, 255)) return c:Unpack() elseif perc > 0 then - c = LerpVector(perc / 0.5,Vector(255,0,0),Vector(255,255,0)) + c = LerpVector(perc / 0.5, Vector(255, 0, 0), Vector(255, 255, 0)) return c:Unpack() end - return 0,0,0 + return 0, 0, 0 end function SWEP:DrawHUD() @@ -883,9 +913,9 @@ if CLIENT then draw.SimpleTextOutlined((200 * I) .. "m", "SWEP-HUD-FONT", Mark.x + (Size * 0.05), Mark.y - 12, White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Black) end - surface.DrawLine(Spot100.x + (Size * 0.05), Spot100.y,Spot800.x + (Size * 0.05), Spot800.y) + surface.DrawLine(Spot100.x + (Size * 0.05), Spot100.y, Spot800.x + (Size * 0.05), Spot800.y) surface.SetDrawColor(White) - surface.DrawLine(Spot100.x + (Size * 0.05), Spot100.y + 1,Spot800.x + (Size * 0.05), Spot800.y + 1) + surface.DrawLine(Spot100.x + (Size * 0.05), Spot100.y + 1, Spot800.x + (Size * 0.05), Spot800.y + 1) local DropCalc = SelfTbl.DropCalc @@ -893,13 +923,13 @@ if CLIENT then local DD = DropCalc[I] local BPos = DD[1] local Pos = (ShootPos + (FWD * BPos.x) + (vector_up * BPos.z)):ToScreen() - local LineScale = math.max((200 / DD[3]) * 12,1) + local LineScale = math.max((200 / DD[3]) * 12, 1) surface.SetDrawColor(Black) - surface.DrawLine(Pos.x - Scale,Pos.y,Pos.x,Pos.y) + surface.DrawLine(Pos.x - Scale, Pos.y, Pos.x, Pos.y) surface.SetDrawColor(White) - surface.DrawLine(Pos.x,Pos.y,Pos.x + LineScale,Pos.y) + surface.DrawLine(Pos.x, Pos.y, Pos.x + LineScale, Pos.y) - draw.SimpleTextOutlined(DD[3] .. "m, " .. math.Round(DD[2],2) .. "s","SWEP-HUD-FONT",Pos.x - 64,Pos.y,White,TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER,1,Black) + draw.SimpleTextOutlined(DD[3] .. "m, " .. math.Round(DD[2], 2) .. "s", "SWEP-HUD-FONT", Pos.x - 64, Pos.y, White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Black) end elseif SelfTbl.HasDropCalc and (SelfTbl.CalcRun == false) then SelfTbl.DropCalc = self:CalcDropTable() @@ -909,22 +939,22 @@ if CLIENT then -- Scope box surface.DrawTexturedRect(SM.x - Size, SM.y - Size, Size * 2, Size * 2) -- Edge filler - surface.DrawRect(0, SM.y + Size * 0.75,SX,SY) - surface.DrawRect(0, SM.y - (Size * 0.75) - SY,SX,SY) + surface.DrawRect(0, SM.y + Size * 0.75, SX, SY) + surface.DrawRect(0, SM.y - (Size * 0.75) - SY, SX, SY) - surface.DrawRect(SM.x + Size * 0.75,0,SX,SY) - surface.DrawRect(SM.x - (Size * 0.75) - SX,0,SX,SY) + surface.DrawRect(SM.x + Size * 0.75, 0, SX, SY) + surface.DrawRect(SM.x - (Size * 0.75) - SX, 0, SX, SY) -- Side dashes - surface.DrawRect(SM.x + (Size * 0.05),SM.y - 2,SM.x,4) - surface.DrawRect(SM.x - (Size * 0.05) - SM.x,SM.y - 2,SM.x,4) + surface.DrawRect(SM.x + (Size * 0.05), SM.y - 2, SM.x, 4) + surface.DrawRect(SM.x - (Size * 0.05) - SM.x, SM.y - 2, SM.x, 4) draw.NoTexture() ScreenBlack.a = 255 * (1 - (SelfTbl.IronScale - 0.75) / 0.25) surface.SetDrawColor(ScreenBlack) - surface.DrawRect(0,0,SX,SY) + surface.DrawRect(0, 0, SX, SY) end draw.NoTexture() @@ -936,26 +966,26 @@ if CLIENT then DrawAmmo = DrawRound AmmoSize = 10 * AmmoScale else - draw.SimpleTextOutlined(Ammo .. " / " .. ClipSize,"SWEP-HUD-FONT",SX - 12,SY - (48 * AmmoScale),White,TEXT_ALIGN_RIGHT,TEXT_ALIGN_BOTTOM,1,Black) + draw.SimpleTextOutlined(Ammo .. " / " .. ClipSize, "SWEP-HUD-FONT", SX - 12, SY - (48 * AmmoScale), White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 1, Black) end if SelfTbl.FiremodeSetting ~= 1 then - draw.SimpleTextOutlined(FireModeAlias[self:GetNWInt("firemode",1)],"SWEP-HUD-FONT",SX - 16,SY - 4,White,TEXT_ALIGN_RIGHT,TEXT_ALIGN_BOTTOM,1,Black) + draw.SimpleTextOutlined(FireModeAlias[self:GetNWInt("firemode", 1)], "SWEP-HUD-FONT", SX - 16, SY - 4, White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 1, Black) end - draw.SimpleTextOutlined("AMMO TYPE: " .. SelfTbl.Primary.Ammo,"SWEP-HUD-FONT",SX - 40 + (SelfTbl.FiremodeSetting == 1 and 20 or 0),SY - 4,White,TEXT_ALIGN_RIGHT,TEXT_ALIGN_BOTTOM,1,Black) + draw.SimpleTextOutlined("AMMO TYPE: " .. SelfTbl.Primary.Ammo, "SWEP-HUD-FONT", SX - 40 + (SelfTbl.FiremodeSetting == 1 and 20 or 0), SY - 4, White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_BOTTOM, 1, Black) surface.SetDrawColor(SetAmmoColor(AmmoPerc)) - DrawAmmo(SX - 24,SY - (32 * AmmoScale),10 * AmmoScale) + DrawAmmo(SX - 24, SY - (32 * AmmoScale), 10 * AmmoScale) local LastAmmo = (Mags * ClipSize) - SpareAmmo - for i = 1, math.min(9,Mags) do - if (LastAmmo > 0) and (i == Mags) then surface.SetDrawColor(SetAmmoColor(1 - (LastAmmo / ClipSize))) else surface.SetDrawColor(255,255,255) end - DrawAmmo(SX - 24 - (i * AmmoSize),SY - (32 * AmmoScale),10 * AmmoScale) + for i = 1, math.min(9, Mags) do + if (LastAmmo > 0) and (i == Mags) then surface.SetDrawColor(SetAmmoColor(1 - (LastAmmo / ClipSize))) else surface.SetDrawColor(255, 255, 255) end + DrawAmmo(SX - 24 - (i * AmmoSize), SY - (32 * AmmoScale), 10 * AmmoScale) end if Mags > 9 then - draw.SimpleTextOutlined((Mags - 9) .. "+","SWEP-HUD-FONT",SX - (30 * AmmoScale) - (9 * AmmoSize),SY - (32 * AmmoScale),White,TEXT_ALIGN_RIGHT,TEXT_ALIGN_CENTER,1,Black) + draw.SimpleTextOutlined((Mags - 9) .. "+", "SWEP-HUD-FONT", SX - (30 * AmmoScale) - (9 * AmmoSize), SY - (32 * AmmoScale), White, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER, 1, Black) end end end diff --git a/lua/weapons/weapon_acf_bazooka.lua b/lua/weapons/weapon_acf_bazooka.lua index 36f451b..cb28414 100644 --- a/lua/weapons/weapon_acf_bazooka.lua +++ b/lua/weapons/weapon_acf_bazooka.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Bazooka" -SWEP.IconOffset = Vector(4,-4,0) +SWEP.IconOffset = Vector(4, -4, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -53,7 +53,7 @@ SWEP.ACFHEATLinerMass = 0.094189 SWEP.ACFHEATPropMass = 0.040291 SWEP.ACFHEATCartMass = 1.21695 SWEP.ACFHEATCasingMass = 0.699373 --- I mean what the actual fuck, why can't I just call a single function to build this fucking data +-- I mean what the actual fuck, why can't I just call a single function to build this fucking data SWEP.ACFHEATJetMass = 0.046411 SWEP.ACFHEATJetMinVel = 4148.51 SWEP.ACFHEATJetMaxVel = 8227.45 @@ -66,11 +66,11 @@ SWEP.IronScale = 0 SWEP.NextIronToggle = 0 SWEP.AimTable = {} -SWEP.AimTable[1] = {IronPos = Vector(-3.83,-8,-0.4),IronAng = Angle(2.9,-0.5,0), PitchAdjust = -1.55,Text = "100yd"} -- 100yd -SWEP.AimTable[2] = {IronPos = Vector(-3.79,-8,-1.9),IronAng = Angle(6.9,-0.4,0), PitchAdjust = -4.2,Text = "200yd"} -- 200yd -SWEP.AimTable[3] = {IronPos = Vector(-3.77,-8,-3.64),IronAng = Angle(11.6,-0.35,0), PitchAdjust = -6.6,Text = "300yd"} -- 300yd +SWEP.AimTable[1] = {IronPos = Vector(-3.83, -8, -0.4), IronAng = Angle(2.9, -0.5, 0), PitchAdjust = -1.55, Text = "100yd"} -- 100yd +SWEP.AimTable[2] = {IronPos = Vector(-3.79, -8, -1.9), IronAng = Angle(6.9, -0.4, 0), PitchAdjust = -4.2, Text = "200yd"} -- 200yd +SWEP.AimTable[3] = {IronPos = Vector(-3.77, -8, -3.64), IronAng = Angle(11.6, -0.35, 0), PitchAdjust = -6.6, Text = "300yd"} -- 300yd -SWEP.SprintAng = Angle(-5,-10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-5, -10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.UseHands = false @@ -81,11 +81,11 @@ SWEP.CustomAnim = true SWEP.AimAnim = ACT_VM_DEPLOY SWEP.IdleAnim = ACT_VM_UNDEPLOY -SWEP.SprintAng = Angle(-10,-10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-10, -10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.FakeFire = true -- This shakes the aim bloom so you can't just quickshot to victory SWEP.MoveBloom = 2 @@ -97,8 +97,8 @@ SWEP:SetupACFBullet() function SWEP:PrimaryAttack() if not self:CanPrimaryAttack() then return end - if self:GetNWBool("iron",false) == false and self:GetOwner():IsPlayer() then - self:GetOwner():PrintMessage(4,"You have to aim first!") + if self:GetNWBool("iron", false) == false and self:GetOwner():IsPlayer() then + self:GetOwner():PrintMessage(4, "You have to aim first!") return end local Ply = self:GetOwner() @@ -116,7 +116,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),(Dir:Angle() + Angle(self.AimTable[self:GetNW2Int("aimsetting",1)].PitchAdjust,0,0)):Forward()) + self:ShootBullet(Ply:GetShootPos(), (Dir:Angle() + Angle(self.AimTable[self:GetNW2Int("aimsetting", 1)].PitchAdjust, 0, 0)):Forward()) self:Recoil(Punch) end @@ -130,10 +130,10 @@ function SWEP:SecondaryAttack() if Owner:KeyDown(IN_USE) and (CurTime() > self.NextAttack2Toggle) then if SERVER then - local cursetting = self:GetNW2Int("aimsetting",1) + local cursetting = self:GetNW2Int("aimsetting", 1) if (cursetting + 1) > #self.AimTable then cursetting = 1 else cursetting = cursetting + 1 end - self:SetNW2Int("aimsetting",cursetting) - self:GetOwner():PrintMessage(4,self.AimTable[cursetting].Text) + self:SetNW2Int("aimsetting", cursetting) + self:GetOwner():PrintMessage(4, self.AimTable[cursetting].Text) else self:EmitSound(FiremodeSound) end @@ -147,6 +147,6 @@ end if CLIENT then function SWEP:GetViewAim() - return self.AimTable[self:GetNW2Int("aimsetting",1)] + return self.AimTable[self:GetNW2Int("aimsetting", 1)] end end diff --git a/lua/weapons/weapon_acf_c96.lua b/lua/weapons/weapon_acf_c96.lua index e541487..0e308e6 100644 --- a/lua/weapons/weapon_acf_c96.lua +++ b/lua/weapons/weapon_acf_c96.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF C96" -SWEP.IconOffset = Vector(0,0,0) +SWEP.IconOffset = Vector(0, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = false @@ -47,14 +47,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.3,-4,3.2) -SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-6.3, -4, 3.2) +SWEP.IronSightAng = Angle(0, -0.2, 0) -SWEP.SprintAng = Angle(-5,10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-5, 10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -68,7 +68,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -92,7 +92,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_colt.lua b/lua/weapons/weapon_acf_colt.lua index cbda291..3c0b64f 100644 --- a/lua/weapons/weapon_acf_colt.lua +++ b/lua/weapons/weapon_acf_colt.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1911" -SWEP.IconOffset = Vector(0,0,0) +SWEP.IconOffset = Vector(0, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = false @@ -47,14 +47,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-3.85,0,3.55) -SWEP.IronSightAng = Angle(0.5,0,0) +SWEP.IronSightPos = Vector(-3.85, 0, 3.55) +SWEP.IronSightAng = Angle(0.5, 0, 0) -SWEP.SprintAng = Angle(-5,10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-5, 10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -68,7 +68,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -92,7 +92,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_crossbow.lua b/lua/weapons/weapon_acf_crossbow.lua index 38fcd04..0c65ff9 100644 --- a/lua/weapons/weapon_acf_crossbow.lua +++ b/lua/weapons/weapon_acf_crossbow.lua @@ -5,7 +5,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Rebar Crossbow" -SWEP.IconOffset = Vector(-8,0,0) +SWEP.IconOffset = Vector(-8, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -47,7 +47,7 @@ SWEP.BulletScale = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-8,-8,2) +SWEP.IronSightPos = Vector(-8, -8, 2) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -67,7 +67,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -91,9 +91,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) else - timer.Simple(self.Primary.Delay * 0.8,function() self.TempOut = false end) + timer.Simple(self.Primary.Delay * 0.8, function() self.TempOut = false end) end self:PostShot(1) @@ -103,10 +103,10 @@ end function SWEP:Reload() local DidReload = self:DefaultReload( ACT_VM_RELOAD ) -- If this is successful, SWEP:Think doesn't run, so we have to handle anything that should happen in there if DidReload and not self.Reloading then - self:SetNWBool("iron",false) - timer.Simple(self:SequenceDuration() * 0.9,function() self.Reloading = false end) + self:SetNWBool("iron", false) + timer.Simple(self:SequenceDuration() * 0.9, function() self.Reloading = false end) self:EmitSound("Weapon_Crossbow.Reload") - timer.Simple(0.62,function() self:EmitSound("Weapon_Crossbow.BoltElectrify") end) + timer.Simple(0.62, function() self:EmitSound("Weapon_Crossbow.BoltElectrify") end) end self.Reloading = DidReload end diff --git a/lua/weapons/weapon_acf_deagle.lua b/lua/weapons/weapon_acf_deagle.lua index 24067c6..81df3ed 100644 --- a/lua/weapons/weapon_acf_deagle.lua +++ b/lua/weapons/weapon_acf_deagle.lua @@ -43,8 +43,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.375,0,2.1) ---SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-6.375, 0, 2.1) +--SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -58,7 +58,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -82,7 +82,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_famas.lua b/lua/weapons/weapon_acf_famas.lua index e726518..3942dc0 100644 --- a/lua/weapons/weapon_acf_famas.lua +++ b/lua/weapons/weapon_acf_famas.lua @@ -41,8 +41,8 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.1,-5,1) -SWEP.IronSightAng = Angle(-0.25,0.25,-2) +SWEP.IronSightPos = Vector(-6.1, -5, 1) +SWEP.IronSightAng = Angle(-0.25, 0.25, -2) SWEP.Zoom = 1.2 SWEP.Recovery = 4 @@ -56,7 +56,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -80,13 +80,13 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end self:PostShot(1) - timer.Simple(0.01,function() if (Ply:GetActiveWeapon() == self) and self:Clip1() > 0 then self:SendWeaponAnim(ACT_VM_IDLE) end end) + timer.Simple(0.01, function() if (Ply:GetActiveWeapon() == self) and self:Clip1() > 0 then self:SendWeaponAnim(ACT_VM_IDLE) end end) end diff --git a/lua/weapons/weapon_acf_g3sg1.lua b/lua/weapons/weapon_acf_g3sg1.lua index 73950e8..943ed67 100644 --- a/lua/weapons/weapon_acf_g3sg1.lua +++ b/lua/weapons/weapon_acf_g3sg1.lua @@ -43,7 +43,7 @@ SWEP.CalcDistance2 = 300 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.2,-10,1.9) +SWEP.IronSightPos = Vector(-6.2, -10, 1.9) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -63,7 +63,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -87,7 +87,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_galil.lua b/lua/weapons/weapon_acf_galil.lua index 8c55705..ebf5751 100644 --- a/lua/weapons/weapon_acf_galil.lua +++ b/lua/weapons/weapon_acf_galil.lua @@ -43,7 +43,7 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.37,-10,2.45) +SWEP.IronSightPos = Vector(-6.37, -10, 2.45) --SWEP.IronSightAng = Angle() SWEP.Zoom = 1.2 @@ -58,7 +58,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -82,9 +82,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_garand.lua b/lua/weapons/weapon_acf_garand.lua index e8fbba0..df368f1 100644 --- a/lua/weapons/weapon_acf_garand.lua +++ b/lua/weapons/weapon_acf_garand.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Garand" -SWEP.IconOffset = Vector(-16,0,0) +SWEP.IconOffset = Vector(-16, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -44,13 +44,13 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.95,-2,5.1) +SWEP.IronSightPos = Vector(-6.95, -2, 5.1) --SWEP.IronSightAng = Angle() SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -67,7 +67,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -91,7 +91,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_glock.lua b/lua/weapons/weapon_acf_glock.lua index 7c95745..eb93fcf 100644 --- a/lua/weapons/weapon_acf_glock.lua +++ b/lua/weapons/weapon_acf_glock.lua @@ -44,8 +44,8 @@ SWEP.CalcDistance2 = 50 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.78,0,2.6) ---SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-5.78, 0, 2.6) +--SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Zoom = 1.2 SWEP.Recovery = 4 @@ -59,7 +59,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -83,9 +83,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_grenadelauncher.lua b/lua/weapons/weapon_acf_grenadelauncher.lua index 8e2f439..73f141c 100644 --- a/lua/weapons/weapon_acf_grenadelauncher.lua +++ b/lua/weapons/weapon_acf_grenadelauncher.lua @@ -6,8 +6,8 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF XM25" -SWEP.IconOffset = Vector(12,0,2) -SWEP.IconAngOffset = Angle(0,180,0) +SWEP.IconOffset = Vector(12, 0, 2) +SWEP.IconAngOffset = Angle(0, 180, 0) SWEP.UseHands = true SWEP.ViewModel = "models/weapons/v_xm25.mdl" @@ -48,7 +48,7 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-3.48,0,-0.35) +SWEP.IronSightPos = Vector(-3.48, 0, -0.35) --SWEP.IronSightAng = Angle() SWEP.HasDropCalc = true @@ -67,7 +67,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -91,7 +91,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_kar98k.lua b/lua/weapons/weapon_acf_kar98k.lua index e6cf9f8..10569be 100644 --- a/lua/weapons/weapon_acf_kar98k.lua +++ b/lua/weapons/weapon_acf_kar98k.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Kar98k" -SWEP.IconOffset = Vector(-14,0,0) +SWEP.IconOffset = Vector(-14, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -44,14 +44,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-6,0) -SWEP.IronSightPos = Vector(-6.67,-10,3.8) ---SWEP.IronSightAng = Angle(0.0,0,0) +SWEP.IdlePos = Vector(0, -6, 0) +SWEP.IronSightPos = Vector(-6.67, -10, 3.8) +--SWEP.IronSightAng = Angle(0.0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 1 @@ -68,7 +68,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -92,7 +92,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_kar98kscoped.lua b/lua/weapons/weapon_acf_kar98kscoped.lua index f7205ce..bedf237 100644 --- a/lua/weapons/weapon_acf_kar98kscoped.lua +++ b/lua/weapons/weapon_acf_kar98kscoped.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Kar98k (Scoped)" -SWEP.IconOffset = Vector(-14,0,0) +SWEP.IconOffset = Vector(-14, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -47,14 +47,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-6,0) -SWEP.IronSightPos = Vector(-5.2,-10,2.7) ---SWEP.IronSightAng = Angle(0.0,0,0) +SWEP.IdlePos = Vector(0, -6, 0) +SWEP.IronSightPos = Vector(-5.2, -10, 2.7) +--SWEP.IronSightAng = Angle(0.0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Scope = true SWEP.Zoom = 4 @@ -65,19 +65,19 @@ SWEP.AimFocused = 0.05 SWEP:SetupACFBullet() -function SWEP:Reload() -- Since this weapon actually loads individual rounds but does it all in one animation, we're gonna cut it to how many we are actually loading +function SWEP:Reload() -- Since this weapon actually loads individual rounds but does it all in one animation, we're gonna cut it to how many we are actually loading if self:GetSequenceActivity(self:GetSequence()) == ACT_VM_RELOAD then return end if self:Clip1() == self.Primary.ClipSize then return end if self:Ammo1() == 0 then return false end - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self:SendWeaponAnim(ACT_VM_RELOAD) - local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(),self:Ammo1()) + local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(), self:Ammo1()) self.Reloading = true - timer.Simple((((self:SequenceDuration() - 1) / 6) * RoundsMissing) + 0.4,function() + timer.Simple((((self:SequenceDuration() - 1) / 6) * RoundsMissing) + 0.4, function() if self:GetOwner():GetActiveWeapon() ~= self then self.Reloading = false return end self:SendWeaponAnim(ACT_VM_IDLE) - self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(),0,self.Primary.ClipSize)) - self:GetOwner():RemoveAmmo(RoundsMissing,self.Primary.Ammo) + self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(), 0, self.Primary.ClipSize)) + self:GetOwner():RemoveAmmo(RoundsMissing, self.Primary.Ammo) self.Reloading = false end) end @@ -89,7 +89,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -113,10 +113,10 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) else self.TempOut = true - timer.Simple(self.Primary.Delay * 0.8,function() self.TempOut = false end) + timer.Simple(self.Primary.Delay * 0.8, function() self.TempOut = false end) end self:PostShot(1) diff --git a/lua/weapons/weapon_acf_lapua.lua b/lua/weapons/weapon_acf_lapua.lua index 93f5a48..317f622 100644 --- a/lua/weapons/weapon_acf_lapua.lua +++ b/lua/weapons/weapon_acf_lapua.lua @@ -43,7 +43,7 @@ SWEP.CalcDistance2 = 300 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.4,-6,2.3) +SWEP.IronSightPos = Vector(-7.4, -6, 2.3) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -63,7 +63,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -87,10 +87,10 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) else self.TempOut = true - timer.Simple(self.Primary.Delay * 0.8,function() self.TempOut = false end) + timer.Simple(self.Primary.Delay * 0.8, function() self.TempOut = false end) end self:PostShot(1) diff --git a/lua/weapons/weapon_acf_m1carbine.lua b/lua/weapons/weapon_acf_m1carbine.lua index f149f14..1c1aa71 100644 --- a/lua/weapons/weapon_acf_m1carbine.lua +++ b/lua/weapons/weapon_acf_m1carbine.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1 Carbine" -SWEP.IconOffset = Vector(-10,6,2) +SWEP.IconOffset = Vector(-10, 6, 2) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -44,14 +44,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-6,0) -SWEP.IronSightPos = Vector(-6.845,-10,3.3) ---SWEP.IronSightAng = Angle(0.0,0,0) +SWEP.IdlePos = Vector(0, -6, 0) +SWEP.IronSightPos = Vector(-6.845, -10, 3.3) +--SWEP.IronSightAng = Angle(0.0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0.5,0.5,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0.5, 0.5, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -66,7 +66,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -90,7 +90,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_m1thompson.lua b/lua/weapons/weapon_acf_m1thompson.lua index 1394ce3..2b109ad 100644 --- a/lua/weapons/weapon_acf_m1thompson.lua +++ b/lua/weapons/weapon_acf_m1thompson.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1 Thompson" -SWEP.IconOffset = Vector(-4,0,4) +SWEP.IconOffset = Vector(-4, 0, 4) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -48,14 +48,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-2,-2) -SWEP.IronSightPos = Vector(-4.52,-4,2.04) -SWEP.IronSightAng = Angle(0,0,0) +SWEP.IdlePos = Vector(0, -2, -2) +SWEP.IronSightPos = Vector(-4.52, -4, 2.04) +SWEP.IronSightAng = Angle(0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0.75,0.25,1.5) -SWEP.OffsetWorldModelAng = Angle(8,0,180) +SWEP.OffsetWorldModelPos = Vector(0.75, 0.25, 1.5) +SWEP.OffsetWorldModelAng = Angle(8, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -70,7 +70,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -94,7 +94,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_m249.lua b/lua/weapons/weapon_acf_m249.lua index e160747..96f179a 100644 --- a/lua/weapons/weapon_acf_m249.lua +++ b/lua/weapons/weapon_acf_m249.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_base" SWEP.PrintName = "ACF M249" -SWEP.IconOffset = Vector(0,0,-3) +SWEP.IconOffset = Vector(0, 0, -3) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -45,7 +45,7 @@ SWEP.Tracer = 1 SWEP.IronToggle = true SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.95,-4,2.3) +SWEP.IronSightPos = Vector(-5.95, -4, 2.3) --SWEP.IronSightAng = Angle() SWEP.Zoom = 1.2 @@ -63,7 +63,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -87,9 +87,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 4 == 0 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 4 == 0 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_m3shotgun.lua b/lua/weapons/weapon_acf_m3shotgun.lua index 45d77cb..4f1ab15 100644 --- a/lua/weapons/weapon_acf_m3shotgun.lua +++ b/lua/weapons/weapon_acf_m3shotgun.lua @@ -46,7 +46,7 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.65,-8,3.48) +SWEP.IronSightPos = Vector(-7.65, -8, 3.48) --SWEP.IronSightAng = Angle() -- Overrides the Spread variable used in drawing the crosshair @@ -81,7 +81,7 @@ function SWEP:DoReload() self:SendWeaponAnim(ACT_VM_RELOAD) self:SetNextPrimaryFire(CurTime() + self:SequenceDuration()) - timer.Simple(self:SequenceDuration(),function() if self.Reloading then self:SetClip1(self:Clip1() + 1) self:GetOwner():RemoveAmmo(1,self.Primary.Ammo) self:DoReload() end end) + timer.Simple(self:SequenceDuration(), function() if self.Reloading then self:SetClip1(self:Clip1() + 1) self:GetOwner():RemoveAmmo(1, self.Primary.Ammo) self:DoReload() end end) self.NextShell = (CurTime() + self:SequenceDuration()) else @@ -98,7 +98,7 @@ end function SWEP:Holster() if not IsFirstTimePredicted() then return end - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self.IronScale = 0 self.IronToggle = false @@ -116,7 +116,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -146,7 +146,7 @@ function SWEP:PrimaryAttack() local BSpread = BrandUnitSquare:GetNormalized() * BCone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local AimSpread = (Dir + BSpread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),AimSpread) + self:ShootBullet(Ply:GetShootPos(), AimSpread) end end diff --git a/lua/weapons/weapon_acf_m4a1.lua b/lua/weapons/weapon_acf_m4a1.lua index 86d85c3..23434eb 100644 --- a/lua/weapons/weapon_acf_m4a1.lua +++ b/lua/weapons/weapon_acf_m4a1.lua @@ -41,8 +41,8 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.85,-5,-0.2) -SWEP.IronSightAng = Angle(2,-1.5,-4) +SWEP.IronSightPos = Vector(-7.85, -5, -0.2) +SWEP.IronSightAng = Angle(2, -1.5, -4) SWEP.Zoom = 1.2 SWEP.Recovery = 5 @@ -56,7 +56,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -80,13 +80,13 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end self:PostShot(1) - timer.Simple(0.1,function() if (Ply:GetActiveWeapon() == self) and self:GetSequenceName(self:GetSequence()) ~= "reload_unsil" then self:SendWeaponAnim(ACT_VM_IDLE) end end) + timer.Simple(0.1, function() if (Ply:GetActiveWeapon() == self) and self:GetSequenceName(self:GetSequence()) ~= "reload_unsil" then self:SendWeaponAnim(ACT_VM_IDLE) end end) end \ No newline at end of file diff --git a/lua/weapons/weapon_acf_mg42.lua b/lua/weapons/weapon_acf_mg42.lua index d61172d..fe9992c 100644 --- a/lua/weapons/weapon_acf_mg42.lua +++ b/lua/weapons/weapon_acf_mg42.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF MG42" -SWEP.IconOffset = Vector(-16,-4,6) +SWEP.IconOffset = Vector(-16, -4, 6) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -44,14 +44,14 @@ SWEP.Tracer = 1 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(2,0,-4) -SWEP.IronSightPos = Vector(0,0,-2) ---SWEP.IronSightAng = Angle(0,0,0) +SWEP.IdlePos = Vector(2, 0, -4) +SWEP.IronSightPos = Vector(0, 0, -2) +--SWEP.IronSightAng = Angle(0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 1 @@ -66,15 +66,15 @@ function SWEP:Reload() if self:GetSequenceActivity(self:GetSequence()) == ACT_VM_RELOAD then return end if self:Clip1() == self.Primary.ClipSize then return end if self:Ammo1() == 0 then return false end - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self:SendWeaponAnim(ACT_VM_RELOAD) - local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(),self:Ammo1()) + local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(), self:Ammo1()) self.Reloading = true - timer.Simple(self:SequenceDuration(),function() + timer.Simple(self:SequenceDuration(), function() if self:GetOwner():GetActiveWeapon() ~= self then self.Reloading = false return end self:SendWeaponAnim(ACT_VM_IDLE) - self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(),0,self.Primary.ClipSize)) - self:GetOwner():RemoveAmmo(RoundsMissing,self.Primary.Ammo) + self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(), 0, self.Primary.ClipSize)) + self:GetOwner():RemoveAmmo(RoundsMissing, self.Primary.Ammo) self.Reloading = false end) end @@ -86,7 +86,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -110,9 +110,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_mp40.lua b/lua/weapons/weapon_acf_mp40.lua index f6cab3e..4d8a135 100644 --- a/lua/weapons/weapon_acf_mp40.lua +++ b/lua/weapons/weapon_acf_mp40.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF MP40" -SWEP.IconOffset = Vector(-10,6,4) +SWEP.IconOffset = Vector(-10, 6, 4) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -45,14 +45,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-6,0) -SWEP.IronSightPos = Vector(-4.425,-6,1.8) -SWEP.IronSightAng = Angle(0.325,-0.1,0) +SWEP.IdlePos = Vector(0, -6, 0) +SWEP.IronSightPos = Vector(-4.425, -6, 1.8) +SWEP.IronSightAng = Angle(0.325, -0.1, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -67,7 +67,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -91,11 +91,11 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end self:PostShot(1) - timer.Simple(0.5,function() if (Ply:GetActiveWeapon() == self) and self:GetSequenceName(self:GetSequence()) ~= "reload" then self:SendWeaponAnim(ACT_VM_IDLE) end end) + timer.Simple(0.5, function() if (Ply:GetActiveWeapon() == self) and self:GetSequenceName(self:GetSequence()) ~= "reload" then self:SendWeaponAnim(ACT_VM_IDLE) end end) end diff --git a/lua/weapons/weapon_acf_mp44.lua b/lua/weapons/weapon_acf_mp44.lua index f1958fa..08ec474 100644 --- a/lua/weapons/weapon_acf_mp44.lua +++ b/lua/weapons/weapon_acf_mp44.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF MP44" -SWEP.IconOffset = Vector(-10,4,4) +SWEP.IconOffset = Vector(-10, 4, 4) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -45,13 +45,13 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-3.575,-7,1.64) -SWEP.IronSightAng = Angle(-0.45,0.35,0) +SWEP.IronSightPos = Vector(-3.575, -7, 1.64) +SWEP.IronSightAng = Angle(-0.45, 0.35, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -66,7 +66,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -90,7 +90,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_mp5.lua b/lua/weapons/weapon_acf_mp5.lua index 36dec40..4a7953e 100644 --- a/lua/weapons/weapon_acf_mp5.lua +++ b/lua/weapons/weapon_acf_mp5.lua @@ -46,8 +46,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.34,-6,1.91) -SWEP.IronSightAng = Angle(1,0,0) +SWEP.IronSightPos = Vector(-5.34, -6, 1.91) +SWEP.IronSightAng = Angle(1, 0, 0) SWEP.Zoom = 1.2 SWEP.Recovery = 3.5 @@ -61,7 +61,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -85,9 +85,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_p38.lua b/lua/weapons/weapon_acf_p38.lua index 3511d88..7aa7a9a 100644 --- a/lua/weapons/weapon_acf_p38.lua +++ b/lua/weapons/weapon_acf_p38.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF P38" -SWEP.IconOffset = Vector(0,0,0) +SWEP.IconOffset = Vector(0, 0, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = false @@ -47,14 +47,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.68,-4,4) -SWEP.IronSightAng = Angle(0,0,0) +SWEP.IronSightPos = Vector(-5.68, -4, 4) +SWEP.IronSightAng = Angle(0, 0, 0) -SWEP.SprintAng = Angle(-5,10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-5, 10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -68,7 +68,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -92,7 +92,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_p90.lua b/lua/weapons/weapon_acf_p90.lua index 39fbae2..923a025 100644 --- a/lua/weapons/weapon_acf_p90.lua +++ b/lua/weapons/weapon_acf_p90.lua @@ -46,8 +46,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.78,-15,2.2) -SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-5.78, -15, 2.2) +SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Scope = true -- Because the P90 doesn't have a proper scope or anything for this model, just hide it SWEP.ScopeTextureOverride = 1 @@ -63,7 +63,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -87,9 +87,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_panzerschreck.lua b/lua/weapons/weapon_acf_panzerschreck.lua index 254aae1..eda20ef 100644 --- a/lua/weapons/weapon_acf_panzerschreck.lua +++ b/lua/weapons/weapon_acf_panzerschreck.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF Panzerschreck" -SWEP.IconOffset = Vector(-2,-8,0) +SWEP.IconOffset = Vector(-2, -8, 0) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -66,11 +66,11 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.4,0,5.45) -SWEP.IronSightAng = Angle(0.1,0.285,0) +SWEP.IronSightPos = Vector(-7.4, 0, 5.45) +SWEP.IronSightAng = Angle(0.1, 0.285, 0) SWEP.PitchAdjust = 0 -SWEP.SprintAng = Angle(-5,-10,0) -- The angle the viewmodel turns to when the player is sprinting +SWEP.SprintAng = Angle(-5, -10, 0) -- The angle the viewmodel turns to when the player is sprinting SWEP.UseHands = false @@ -82,8 +82,8 @@ SWEP.AimAnim = ACT_VM_DEPLOY SWEP.IdleAnim = ACT_VM_UNDEPLOY SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.FakeFire = true -- This shakes the aim bloom so you can't just quickshot to victory SWEP.MoveBloom = 2 @@ -95,8 +95,8 @@ SWEP:SetupACFBullet() function SWEP:PrimaryAttack() if not self:CanPrimaryAttack() then return end - if self:GetNWBool("iron",false) == false and self:GetOwner():IsPlayer() then - self:GetOwner():PrintMessage(4,"You have to aim first!") + if self:GetNWBool("iron", false) == false and self:GetOwner():IsPlayer() then + self:GetOwner():PrintMessage(4, "You have to aim first!") return end local Ply = self:GetOwner() @@ -114,7 +114,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),(Dir:Angle() + Angle(self.PitchAdjust,0,0)):Forward()) + self:ShootBullet(Ply:GetShootPos(), (Dir:Angle() + Angle(self.PitchAdjust, 0, 0)):Forward()) self:Recoil(Punch) end diff --git a/lua/weapons/weapon_acf_scout.lua b/lua/weapons/weapon_acf_scout.lua index f9bdb46..bd1c8c9 100644 --- a/lua/weapons/weapon_acf_scout.lua +++ b/lua/weapons/weapon_acf_scout.lua @@ -42,7 +42,7 @@ SWEP.CalcDistance2 = 300 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-6.65,-10,3.35) +SWEP.IronSightPos = Vector(-6.65, -10, 3.35) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -62,7 +62,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -86,10 +86,10 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) else self.TempOut = true - timer.Simple(self.Primary.Delay * 0.8,function() self.TempOut = false end) + timer.Simple(self.Primary.Delay * 0.8, function() self.TempOut = false end) end self:PostShot(1) diff --git a/lua/weapons/weapon_acf_sg550.lua b/lua/weapons/weapon_acf_sg550.lua index 3bbb5e0..48783b2 100644 --- a/lua/weapons/weapon_acf_sg550.lua +++ b/lua/weapons/weapon_acf_sg550.lua @@ -43,7 +43,7 @@ SWEP.CalcDistance2 = 300 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.5,-10,1.5) +SWEP.IronSightPos = Vector(-7.5, -10, 1.5) --SWEP.IronSightAng = Angle() SWEP.Scope = true @@ -63,7 +63,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -87,7 +87,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_sg552.lua b/lua/weapons/weapon_acf_sg552.lua index 929a3f6..544aad6 100644 --- a/lua/weapons/weapon_acf_sg552.lua +++ b/lua/weapons/weapon_acf_sg552.lua @@ -5,7 +5,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF SG552" -SWEP.IconOffset = Vector(5,4,-2) +SWEP.IconOffset = Vector(5, 4, -2) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -49,8 +49,8 @@ SWEP.Zoom = 4 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-7.9,-2,2.5) -SWEP.IronSightAng = Angle(0,0,0) +SWEP.IronSightPos = Vector(-7.9, -2, 2.5) +SWEP.IronSightAng = Angle(0, 0, 0) SWEP.AimFocused = 0.4 SWEP.AimUnfocused = 4 @@ -65,7 +65,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -89,9 +89,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_springfield.lua b/lua/weapons/weapon_acf_springfield.lua index e2194b9..0178afc 100644 --- a/lua/weapons/weapon_acf_springfield.lua +++ b/lua/weapons/weapon_acf_springfield.lua @@ -6,7 +6,7 @@ include("weapon_acf_base.lua") SWEP.Base = "weapon_acf_base" SWEP.PrintName = "ACF M1903 Springfield" -SWEP.IconOffset = Vector(-14,0,2) +SWEP.IconOffset = Vector(-14, 0, 2) SWEP.IconAngOffset = Angle() SWEP.UseHands = true @@ -47,14 +47,14 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IdlePos = Vector(0,-6,-2) -SWEP.IronSightPos = Vector(-5.35,-10,1.05) ---SWEP.IronSightAng = Angle(0.0,0,0) +SWEP.IdlePos = Vector(0, -6, -2) +SWEP.IronSightPos = Vector(-5.35, -10, 1.05) +--SWEP.IronSightAng = Angle(0.0, 0, 0) SWEP.UseHands = false SWEP.CustomWorldModelPos = true -- An attempt at fixing the broken worldmodel position -SWEP.OffsetWorldModelPos = Vector(0,0,1.5) -SWEP.OffsetWorldModelAng = Angle(10,0,180) +SWEP.OffsetWorldModelPos = Vector(0, 0, 1.5) +SWEP.OffsetWorldModelAng = Angle(10, 0, 180) SWEP.Scope = true SWEP.Zoom = 4 @@ -69,15 +69,15 @@ function SWEP:Reload() -- Since this weapon actually loads individual rounds but if self:GetSequenceActivity(self:GetSequence()) == ACT_VM_RELOAD then return end if self:Clip1() == self.Primary.ClipSize then return end if self:Ammo1() == 0 then return false end - self:SetNWBool("iron",false) + self:SetNWBool("iron", false) self:SendWeaponAnim(ACT_VM_RELOAD) - local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(),self:Ammo1()) + local RoundsMissing = math.min(self.Primary.ClipSize - self:Clip1(), self:Ammo1()) self.Reloading = true - timer.Simple((((self:SequenceDuration() - 1) / 6) * RoundsMissing) + 0.6,function() + timer.Simple((((self:SequenceDuration() - 1) / 6) * RoundsMissing) + 0.6, function() if self:GetOwner():GetActiveWeapon() ~= self then self.Reloading = false return end self:SendWeaponAnim(ACT_VM_IDLE) - self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(),0,self.Primary.ClipSize)) - self:GetOwner():RemoveAmmo(RoundsMissing,self.Primary.Ammo) + self:SetClip1(math.Clamp(self:Clip1() + self:Ammo1(), 0, self.Primary.ClipSize)) + self:GetOwner():RemoveAmmo(RoundsMissing, self.Primary.Ammo) self.Reloading = false end) end @@ -89,7 +89,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -113,10 +113,10 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) else self.TempOut = true - timer.Simple(self.Primary.Delay * 0.8,function() self.TempOut = false end) + timer.Simple(self.Primary.Delay * 0.8, function() self.TempOut = false end) end self:PostShot(1) diff --git a/lua/weapons/weapon_acf_ump45.lua b/lua/weapons/weapon_acf_ump45.lua index e68ca90..7bf44f2 100644 --- a/lua/weapons/weapon_acf_ump45.lua +++ b/lua/weapons/weapon_acf_ump45.lua @@ -44,8 +44,8 @@ SWEP.Tracer = 0 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-8.91,-10,4.1) -SWEP.IronSightAng = Angle(-1.5,-0.2,-2) +SWEP.IronSightPos = Vector(-8.91, -10, 4.1) +SWEP.IronSightAng = Angle(-1.5, -0.2, -2) SWEP.Zoom = 1.2 SWEP.Recovery = 3 @@ -59,7 +59,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -83,9 +83,9 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer",self.Tracer) else self:SetNW2Float("Tracer",0) end + if self:Clip1() % 3 == 1 then self:SetNW2Float("Tracer", self.Tracer) else self:SetNW2Float("Tracer", 0) end - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end diff --git a/lua/weapons/weapon_acf_usp.lua b/lua/weapons/weapon_acf_usp.lua index b3caca0..65f8d2f 100644 --- a/lua/weapons/weapon_acf_usp.lua +++ b/lua/weapons/weapon_acf_usp.lua @@ -44,8 +44,8 @@ SWEP.CalcDistance2 = 50 SWEP.IronScale = 0 SWEP.NextIronToggle = 0 -SWEP.IronSightPos = Vector(-5.925,0,2.45) ---SWEP.IronSightAng = Angle(0,-0.2,0) +SWEP.IronSightPos = Vector(-5.925, 0, 2.45) +--SWEP.IronSightAng = Angle(0, -0.2, 0) SWEP.Zoom = 1.2 SWEP.Recovery = 4 @@ -59,7 +59,7 @@ function SWEP:PrimaryAttack() self:SetNextPrimaryFire(CurTime() + 0.25) self.LastShot = CurTime() - if SERVER then self:SetNWFloat("lastshot",self.LastShot) end + if SERVER then self:SetNWFloat("lastshot", self.LastShot) end return false end @@ -83,7 +83,7 @@ function SWEP:PrimaryAttack() local Spread = randUnitSquare:GetNormalized() * Cone * (math.random() ^ (1 / ACF.GunInaccuracyBias)) local Dir = (Aim:Forward() + Spread):GetNormalized() - self:ShootBullet(Ply:GetShootPos(),Dir) + self:ShootBullet(Ply:GetShootPos(), Dir) end