Single shot/3-burst

This commit is contained in:
Arctic 2022-07-31 14:55:53 +10:00
parent a9b110cdb4
commit 7605cdbe7e
6 changed files with 43 additions and 15 deletions

View File

@ -44,7 +44,7 @@ You could also opt to combine these methods together - it's common for an attach
- Reworked standardized weapon stat handling
- Blind fire for all weapons
- Looping sounds
- Reworked RHIK system with greater compatibility, better performance, and multiple targets
- Reworked RHIK system
- RHIK supports right hands too
- Snazzy new UI
- Better standard weapon ecosystem

View File

@ -57,5 +57,5 @@ hook.Add("PostDrawEffects", "ARC9_CleanFlashlights", function()
if GetViewEntity() == LocalPlayer() then return end
wpn:KillFlashlightsVM()
wpn:KillFlashlights()
end)

View File

@ -340,13 +340,13 @@ function ARC9.DrawHUD()
firemode_text = arc9_mode.PrintName
else
if arc9_mode.Mode == 1 then
firemode_text = "SEMI"
firemode_text = "SINGLE"
elseif arc9_mode.Mode == 0 then
firemode_text = "SAFE"
elseif arc9_mode.Mode < 0 then
firemode_text = "AUTO"
elseif arc9_mode.Mode > 1 then
firemode_text = tostring(arc9_mode.Mode) .. "BST"
firemode_text = tostring(arc9_mode.Mode) .. "-BURST"
end
end
@ -403,17 +403,17 @@ function ARC9.DrawHUD()
elseif weapon:IsScripted() then
if !weapon.Primary.Automatic then
firemode_pic = firemode_pics[1]
firemode_text = "SEMI"
firemode_text = "SINGLE"
end
if weapon.ThreeRoundBurst then
firemode_pic = firemode_pics[3]
firemode_text = "3BST"
firemode_text = "3-BURST"
end
if weapon.TwoRoundBurst then
firemode_pic = firemode_pics[2]
firemode_text = "2BST"
firemode_text = "2-BURST"
end
if weapon.GetSafe then
@ -439,7 +439,7 @@ function ARC9.DrawHUD()
else
if !automatics[weapon:GetClass()] then
firemode_pic = firemode_pics[1]
firemode_text = "SEMI"
firemode_text = "SINGLE"
end
end

View File

@ -105,6 +105,8 @@ function SWEP:DrawCustomModel(wm, custompos, customang)
if !wm then
self:DrawFlashlightsVM()
else
self:DrawFlashlightsWM()
end
end
end

View File

@ -11,7 +11,7 @@ function SWEP:GetHasFlashlights()
return false
end
function SWEP:CreateFlashlightsVM()
function SWEP:CreateFlashlights()
self:KillFlashlights()
self.Flashlights = {}
@ -66,11 +66,11 @@ function SWEP:CreateFlashlightsVM()
end
function SWEP:KillFlashlights()
self:KillFlashlightsVM()
self:KillFlashlights()
-- self:KillFlashlightsWM()
end
function SWEP:KillFlashlightsVM()
function SWEP:KillFlashlights()
if !self.Flashlights then return end
for i, k in ipairs(self.Flashlights) do
@ -82,9 +82,37 @@ function SWEP:KillFlashlightsVM()
self.Flashlights = nil
end
function SWEP:DrawFlashlightsWM()
if !self.Flashlights then
self:CreateFlashlights()
end
for i, k in ipairs(self.Flashlights) do
local model = (k.slottbl or {}).WModel
if !model then continue end
local pos, ang
if !model then
pos = self:GetOwner():EyePos()
ang = self:GetOwner():EyeAngles()
else
pos = model:GetPos()
ang = model:GetAngles()
end
-- ang:RotateAroundAxis(ang:Up(), 90)
k.light:SetPos(pos)
k.light:SetAngles(ang)
k.light:Update()
end
end
function SWEP:DrawFlashlightsVM()
if !self.Flashlights then
self:CreateFlashlightsVM()
self:CreateFlashlights()
end
for i, k in ipairs(self.Flashlights) do

View File

@ -406,9 +406,7 @@ function SWEP:SetupModel(wm, lod, cm)
end
end
if !wm then
self:CreateFlashlightsVM()
end
self:CreateFlashlights()
self:DoBodygroups(wm, cm)
end