Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

base weapon recoil generation change+ small bugfix + hybrid trace changes #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/autorun/wepsnd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
28 changes: 14 additions & 14 deletions lua/weapons/weapon_acf_30cal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions lua/weapons/weapon_acf_357magnum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions lua/weapons/weapon_acf_57.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
12 changes: 6 additions & 6 deletions lua/weapons/weapon_acf_ak47.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
8 changes: 4 additions & 4 deletions lua/weapons/weapon_acf_amr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions lua/weapons/weapon_acf_aug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
16 changes: 8 additions & 8 deletions lua/weapons/weapon_acf_bar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
Loading