New spawnmenu. More derma things. Weapon stats.

This commit is contained in:
Fesiug 2023-12-09 05:30:50 -05:00
parent 76d6f63350
commit 8ebf6099ef
3 changed files with 714 additions and 152 deletions

View File

@ -6,11 +6,184 @@ end
function GM:OnSpawnMenuClose() function GM:OnSpawnMenuClose()
end end
local function yea()
return true
end
local mewer = {
{
Func = function( class )
return class.Name
end,
Size = 18,
SizeMultiline = 18,
Font = "Benny_18",
},
{
Func = function( class )
return class.Description
end,
Size = 14,
SizeMultiline = 12,
Font = "Benny_12",
},
{
Name = "Lethality",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return math.Clamp( math.Remap( class.Damage * (class.Pellets or 1), 12, 50, 0, 1 ), 0, 1 )
end,
},
{
Name = "Suppression",
Size = 12,
Font = "Benny_10",
Stat = function( class )
local dps = class.Damage * (1/class.Delay)
return math.Clamp( math.Remap( dps, 50, 550, 0, 1 ), 0, 1 )
end,
},
{
Name = "Range",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return 0
end,
},
{
Name = "Precision",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return math.Clamp( math.Remap( class.Spread, 1/60, 2, 1, 0 ), 0, 1 )
end,
},
{
Name = "Control",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return math.Clamp( math.Remap( class.SpreadAdd * (1/class.Delay), 1, 13, 1, 0 ), 0, 1 )
end,
},
{
Name = "Handling",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return 0
end,
},
{
Name = "Maneuvering",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return 0
end,
},
{
Name = "Mobility",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return 0
end,
},
{
Name = "Stability",
Size = 12,
Font = "Benny_10",
Stat = function( class )
return 0
end,
},
}
local function multlinetext(text, maxw, font)
local content = {}
local tline = ""
local x = 0
surface.SetFont(font)
local newlined = string.Split(text, "\n")
for _, line in pairs(newlined) do
local words = string.Split(line, " ")
for _, word in pairs(words) do
local tx = surface.GetTextSize(word)
if x + tx >= maxw then
table.insert(content, tline)
tline = ""
x = surface.GetTextSize(word)
end
tline = tline .. word .. " "
x = x + surface.GetTextSize(word .. " ")
end
table.insert(content, tline)
tline = ""
x = 0
end
return content
end
local c_F = 184
local c_D = 184
local c_C = 90
local c_B = 60
local c_A = 12
local c_S = 0
local function rank( perc )
local letter
local color
if perc <= 1/10 then
letter = "F"
local ler = math.Remap( perc, 0, 1/10, 0, 1 )
color = HSVToColor( c_F, 0, .4 )
elseif perc <= 3/10 then
letter = "D"
local ler = math.Remap( perc, 1/10, 3/10, 0, 1 )
color = HSVToColor( Lerp( ler, c_F, c_D ), Lerp( ler, 0.0, 0.5 ), .4 )
elseif perc <= 5/10 then
letter = "C"
local ler = math.Remap( perc, 3/10, 5/10, 0, 1 )
color = HSVToColor( Lerp( ler, c_D, c_C ), Lerp( ler, 0.5, 0.5 ), Lerp( ler, 0.4, 0.6 ) )
elseif perc <= 7/10 then
letter = "B"
local ler = math.Remap( perc, 5/10, 7/10, 0, 1 )
color = HSVToColor( Lerp( ler, c_C, c_B ), Lerp( ler, 0.5, 0.7 ), Lerp( ler, 0.6, 0.8 ) )
elseif perc <= 9/10 then
letter = "A"
local ler = math.Remap( perc, 7/10, 9/10, 0, 1 )
color = HSVToColor( Lerp( ler, c_B, c_A ), Lerp( ler, 0.7, 0.75 ), .80 )
elseif perc <= 1 then
letter = "S"
local ler = math.Remap( perc, 9/10, 1, 0, 1 )
color = HSVToColor( Lerp( ler, c_A, c_S ), Lerp( ler, 0.75, 0.75 ), .80 )
end
return letter, color
end
function OpenSMenu() function OpenSMenu()
if IsValid( smenu ) then smenu:Remove() return end if IsValid( smenu ) then smenu:Remove() return end
local active = GetConVar("benny_hud_tempactive"):GetString() local active = GetConVar("benny_hud_tempactive"):GetString()
smenu = vgui.Create("BFrame") smenu = vgui.Create("BFrame")
smenu:SetSize( ss(1+(96+2)*4), ss(360) ) smenu:SetSize( ss(640), ss(360) )
smenu:SetTitle("Developer Spawnmenu") smenu:SetTitle("Developer Spawnmenu")
smenu:MakePopup() smenu:MakePopup()
smenu:SetKeyboardInputEnabled( false ) smenu:SetKeyboardInputEnabled( false )
@ -18,6 +191,78 @@ function OpenSMenu()
local itemlist = smenu:Add("DScrollPanel") local itemlist = smenu:Add("DScrollPanel")
itemlist:Dock( FILL ) itemlist:Dock( FILL )
smenu:Center()
local statlist = smenu:Add("DPanel")
statlist:SetWide( ss(320) )
statlist:Dock( RIGHT )
statlist:DockMargin( ss(2), 0, 0, 0 )
statlist:DockPadding( ss(2), ss(2), ss(2), ss(2) )
function statlist:Paint( w, h )
surface.SetDrawColor( schema("fg") )
surface.DrawOutlinedRect( 0, 0, w, h, ss(0.5) )
end
for i, us in ipairs( mewer ) do
local fucker = statlist:Add( "DLabel" )
fucker:SetTall( ss(us.Size) )
fucker:Dock( TOP )
fucker:DockMargin( 0, 0, 0, ss(2) )
local lastheight = 0
function fucker:Paint( w, h )
if us.Stat then
surface.SetDrawColor( schema("fg") )
surface.DrawOutlinedRect( 0, 0, w, h, ss(0.5) )
else
surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h )
end
local rang = WeaponGet( pan_active )
if rang then
if us.SizeMultiline then
local multiline = multlinetext( us.Func and us.Func( rang ) or us.Name, w-ss(2), us.Font )
for i, v in ipairs( multiline ) do
local line = i-1
local height = ss( us.Size + ((#multiline-1)*us.SizeMultiline) )
if lastheight != height then
fucker:SetTall( height )
lastheight = height
end
draw.SimpleText( v, us.Font, ss(2), ss(2)+ss(us.SizeMultiline*line), schema_c(us.Stat and "fg" or "bg") )
end
else
draw.SimpleText( us.Func and us.Func( rang ) or us.Name, us.Font, ss(2), ss(2), schema_c(us.Stat and "fg" or "bg") )
end
if us.Stat then
local perc = us.Stat( rang )
--perc = math.abs(math.sin(CurTime()*math.pi/(i^2)*10))
--perc = (CurTime()*0.2+i/4) % 2
--if perc > 1 then
-- perc = 2-perc
--end
--perc = math.Remap( perc, 0, 1, 0.3, 0.8)
local rank, col = rank( perc )
surface.SetDrawColor( schema("fg") )
surface.DrawRect( ss(60), 0, ss(1), h )
draw.SimpleText( rank, us.Font, ss(60+4), ss(2), schema_c("fg") )
surface.DrawRect( ss(60)+h, 0, ss(1), h )
surface.SetDrawColor( col )
local width = w-(ss(60+1.5)+h)
surface.DrawRect( ss(60+1)+h, h*.125, math.max( ss(1), width*perc ), h*.75 )
for i=1, 10 do
if i==1 then continue end
surface.SetDrawColor( schema("fg", i%2==1 and 0.01 or 1) )
surface.DrawRect( ss(60)+h + width*(i-1)/10, 0, ss(1), h )
end
end
end
return true
end
end
local createlist = {} local createlist = {}
@ -30,20 +275,16 @@ function OpenSMenu()
end end
for i, v in SortedPairs( createlist ) do for i, v in SortedPairs( createlist ) do
local Collapse = itemlist:Add( "DCollapsibleCategory" ) local Collapse = itemlist:Add( "BCollapsibleCategory" )
Collapse:Dock( TOP ) Collapse:Dock( TOP )
Collapse:SetLabel( i ) Collapse:SetLabel( i )
local Lays = itemlist:Add( "DIconLayout" ) Collapse:SetExpanded( false )
Collapse:SetContents( Lays ) Collapse:DockMargin( 0, 0, 0, ss(2) )
Collapse:SetExpanded( i!="magazine" ) Collapse:DockPadding( ss(2), ss(2), ss(2), ss(2) )
Lays:Dock( FILL )
Lays:SetSpaceX( ss(1) )
Lays:SetSpaceY( ss(1) )
for Mew, New in ipairs( v ) do for Mew, New in ipairs( v ) do
local button = Lays:Add( "DButton" ) local button = Collapse:Add( "DButton" )
button:SetSize( ss(95), ss(14) ) button:SetSize( ss(96), ss(20) )
--button:Dock( TOP ) button:DockMargin( 0, 0, 0, ss(2) )
button:DockMargin( 0, 0, 0, ss(4) )
button.Text_Name = New.Class.Name button.Text_Name = New.Class.Name
button.Text_Desc = New.Class.Description button.Text_Desc = New.Class.Description
@ -59,19 +300,18 @@ function OpenSMenu()
chat.AddText( "Gave " .. WeaponGet("mag_"..New.ClassName).Name ) chat.AddText( "Gave " .. WeaponGet("mag_"..New.ClassName).Name )
end end
function button:Think()
if self:IsHovered() then
pan_active = New.ClassName
end
end
function button:Paint( w, h ) function button:Paint( w, h )
surface.SetDrawColor( schemes[active]["fg"] ) surface.SetDrawColor( schema("fg") )
surface.DrawRect( 0, 0, w, h ) surface.DrawOutlinedRect( 0, 0, w, h, ss(1) )
surface.SetTextColor( schemes[active]["bg"] ) draw.SimpleText( self.Text_Name, "Benny_14", w/2, ss(2), schema_c("fg"), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP )
draw.SimpleText( self.Text_Desc, "Benny_8", w/2, ss(2+8), schema_c("fg"), TEXT_ALIGN_CENTER, TEXT_ALIGN_TOP )
surface.SetFont( "Benny_12" )
surface.SetTextPos( ss(2), ss(2) )
surface.DrawText( self.Text_Name )
-- surface.SetFont( "Benny_10" )
-- surface.SetTextPos( ss(4), ss(4 + 12) )
-- surface.DrawText( self.Text_Desc )
return true return true
end end
end end

View File

@ -0,0 +1,318 @@
local PANEL = {
Init = function( self )
end,
DoClick = function( self )
self:GetParent():Toggle()
end,
UpdateColours = function( self, skin )
end,
Paint = function( self )
return true
end,
GenerateExample = function()
end
}
derma.DefineControl( "BCategoryHeader", "Category Header", PANEL, "DButton" )
local PANEL = {}
AccessorFunc( PANEL, "m_bSizeExpanded", "Expanded", FORCE_BOOL )
AccessorFunc( PANEL, "m_iContentHeight", "StartHeight" )
AccessorFunc( PANEL, "m_fAnimTime", "AnimTime" )
AccessorFunc( PANEL, "m_bDrawBackground", "PaintBackground", FORCE_BOOL )
AccessorFunc( PANEL, "m_bDrawBackground", "DrawBackground", FORCE_BOOL ) -- deprecated
AccessorFunc( PANEL, "m_iPadding", "Padding" )
AccessorFunc( PANEL, "m_pList", "List" )
function PANEL:Init()
self.Header = vgui.Create( "BCategoryHeader", self )
self.Header:Dock( TOP )
self.Header:SetSize( ss(12), ss(12) )
self:SetSize( ss(8), ss(8) )
self:SetExpanded( true )
self:SetMouseInputEnabled( true )
self:SetAnimTime( 0.2 )
self.animSlide = Derma_Anim( "Anim", self, self.AnimSlide )
self:SetPaintBackground( true )
end
function PANEL:Add( strName )
local button = vgui.Create( "DButton", self )
button.Paint = function( panel, w, h ) end
button.UpdateColours = function( button, skin )
if ( button.AltLine ) then
if ( button.Depressed || button.m_bSelected ) then return button:SetTextStyleColor( skin.Colours.Category.LineAlt.Text_Selected ) end
if ( button.Hovered ) then return button:SetTextStyleColor( skin.Colours.Category.LineAlt.Text_Hover ) end
return button:SetTextStyleColor( skin.Colours.Category.LineAlt.Text )
end
if ( button.Depressed || button.m_bSelected ) then return button:SetTextStyleColor( skin.Colours.Category.Line.Text_Selected ) end
if ( button.Hovered ) then return button:SetTextStyleColor( skin.Colours.Category.Line.Text_Hover ) end
return button:SetTextStyleColor( skin.Colours.Category.Line.Text )
end
button:SetHeight( ss(8) )
button.DoClickInternal = function()
if ( self:GetList() ) then
self:GetList():UnselectAll()
else
self:UnselectAll()
end
button:SetSelected( true )
end
button:Dock( TOP )
self:InvalidateLayout( true )
self:UpdateAltLines()
return button
end
function PANEL:UnselectAll()
for k, v in ipairs( self:GetChildren() ) do
if ( v.SetSelected ) then
v:SetSelected( false )
end
end
end
function PANEL:UpdateAltLines()
for k, v in ipairs( self:GetChildren() ) do
v.AltLine = k % 2 != 1
end
end
function PANEL:Think()
self.animSlide:Run()
end
function PANEL:SetLabel( strLabel )
self.Header:SetText( strLabel )
end
function PANEL:SetHeaderHeight( height )
self.Header:SetTall( height )
end
function PANEL:GetHeaderHeight()
return self.Header:GetTall()
end
function PANEL:Paint( w, h )
local h1 = self:GetHeaderHeight()
local ex = self:GetExpanded()
if ex then
surface.SetDrawColor( schema( "fg" ) )
surface.DrawRect( 0, 0, w, h1, ss(0.5) )
else
surface.SetDrawColor( schema( "fg" ) )
surface.DrawOutlinedRect( 0, 0, w, h1, ss(0.5) )
end
surface.SetDrawColor( schema( "fg" ) )
surface.DrawOutlinedRect( 0, h1, w, h-h1, ss(0.5) )
draw.SimpleText( (ex and "- " or "> "), "Benny_12", ss(3), ss(0.5), schema_c(ex and "bg" or "fg"), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
draw.SimpleText( self.Header:GetText(), "Benny_12", ss(3+8), ss(1), schema_c(ex and "bg" or "fg"), TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
return false
end
function PANEL:SetContents( pContents )
self.Contents = pContents
self.Contents:SetParent( self )
self.Contents:Dock( FILL )
if ( !self:GetExpanded() ) then
self.OldHeight = self:GetTall()
elseif ( self:GetExpanded() && IsValid( self.Contents ) && self.Contents:GetTall() < 1 ) then
self.Contents:SizeToChildren( false, true )
self.OldHeight = self.Contents:GetTall()
self:SetTall( self.OldHeight )
end
self:InvalidateLayout( true )
end
function PANEL:SetExpanded( expanded )
self.m_bSizeExpanded = tobool( expanded )
if ( !self:GetExpanded() ) then
if ( !self.animSlide.Finished && self.OldHeight ) then return end
self.OldHeight = self:GetTall()
end
end
function PANEL:Toggle()
self:SetExpanded( !self:GetExpanded() )
self.animSlide:Start( self:GetAnimTime(), { From = self:GetTall() } )
self:InvalidateLayout( true )
self:GetParent():InvalidateLayout()
self:GetParent():GetParent():InvalidateLayout()
local open = "1"
if ( !self:GetExpanded() ) then open = "0" end
self:SetCookie( "Open", open )
self:OnToggle( self:GetExpanded() )
end
function PANEL:OnToggle( expanded )
-- Do nothing / For developers to overwrite
end
function PANEL:DoExpansion( b )
if ( self:GetExpanded() == b ) then return end
self:Toggle()
end
function PANEL:PerformLayout()
if ( IsValid( self.Contents ) ) then
if ( self:GetExpanded() ) then
self.Contents:InvalidateLayout( true )
self.Contents:SetVisible( true )
else
self.Contents:SetVisible( false )
end
end
if ( self:GetExpanded() ) then
if ( IsValid( self.Contents ) && #self.Contents:GetChildren() > 0 ) then self.Contents:SizeToChildren( false, true ) end
self:SizeToChildren( false, true )
else
if ( IsValid( self.Contents ) && !self.OldHeight ) then self.OldHeight = self.Contents:GetTall() end
self:SetTall( self:GetHeaderHeight() )
end
-- Make sure the color of header text is set
self.Header:ApplySchemeSettings()
self.animSlide:Run()
self:UpdateAltLines()
end
function PANEL:OnMousePressed( mcode )
if ( !self:GetParent().OnMousePressed ) then return end
return self:GetParent():OnMousePressed( mcode )
end
function PANEL:AnimSlide( anim, delta, data )
self:InvalidateLayout()
self:InvalidateParent()
if ( anim.Started ) then
if ( !IsValid( self.Contents ) && ( self.OldHeight || 0 ) < self.Header:GetTall() ) then
-- We are not using self.Contents and our designated height is less
-- than the header size, something is clearly wrong, try to rectify
self.OldHeight = 0
for id, pnl in ipairs( self:GetChildren() ) do
self.OldHeight = self.OldHeight + pnl:GetTall()
end
end
if ( self:GetExpanded() ) then
data.To = math.max( self.OldHeight, self:GetTall() )
else
data.To = self:GetTall()
end
end
if ( IsValid( self.Contents ) ) then self.Contents:SetVisible( true ) end
self:SetTall( Lerp( delta, data.From, data.To ) )
end
function PANEL:LoadCookies()
local Open = self:GetCookieNumber( "Open", 1 ) == 1
self:SetExpanded( Open )
self:InvalidateLayout( true )
self:GetParent():InvalidateLayout()
self:GetParent():GetParent():InvalidateLayout()
end
function PANEL:GenerateExample( ClassName, PropertySheet, Width, Height )
local ctrl = vgui.Create( ClassName )
ctrl:SetLabel( "Category List Test Category" )
ctrl:SetSize( 300, 300 )
ctrl:SetPadding( 10 )
ctrl:SetHeaderHeight( 32 )
-- The contents can be any panel, even a DPanelList
local Contents = vgui.Create( "DButton" )
Contents:SetText( "This is the content of the control" )
ctrl:SetContents( Contents )
ctrl:InvalidateLayout( true )
PropertySheet:AddSheet( ClassName, ctrl, nil, true, true )
end
derma.DefineControl( "BCollapsibleCategory", "Collapsable Category Panel", PANEL, "Panel" )

View File

@ -15,138 +15,142 @@ function WeaponGet( classname )
return WEAPONS[ classname ] return WEAPONS[ classname ]
end end
AddSound( "1911.Fire", { do -- Sound definitions
"benny/weapons/1911/01.ogg",
"benny/weapons/1911/02.ogg",
"benny/weapons/1911/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC )
AddSound( "Bizon.Fire", { AddSound( "1911.Fire", {
"benny/weapons/bizon/01.ogg", "benny/weapons/1911/01.ogg",
"benny/weapons/bizon/02.ogg", "benny/weapons/1911/02.ogg",
"benny/weapons/bizon/03.ogg", "benny/weapons/1911/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "MP5K.Fire", { AddSound( "Bizon.Fire", {
"benny/weapons/mp5k/01.ogg", "benny/weapons/bizon/01.ogg",
"benny/weapons/mp5k/02.ogg", "benny/weapons/bizon/02.ogg",
"benny/weapons/mp5k/03.ogg", "benny/weapons/bizon/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "MAC11.Fire", { AddSound( "MP5K.Fire", {
"benny/weapons/mac11/01.ogg", "benny/weapons/mp5k/01.ogg",
"benny/weapons/mac11/02.ogg", "benny/weapons/mp5k/02.ogg",
"benny/weapons/mac11/03.ogg", "benny/weapons/mp5k/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "MP7.Fire", { AddSound( "MAC11.Fire", {
"benny/weapons/mp7/01.ogg", "benny/weapons/mac11/01.ogg",
"benny/weapons/mp7/02.ogg", "benny/weapons/mac11/02.ogg",
"benny/weapons/mp7/03.ogg", "benny/weapons/mac11/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "TMP.Fire", { AddSound( "MP7.Fire", {
"benny/weapons/tmp/01.ogg", "benny/weapons/mp7/01.ogg",
"benny/weapons/tmp/02.ogg", "benny/weapons/mp7/02.ogg",
"benny/weapons/tmp/03.ogg", "benny/weapons/mp7/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "Anaconda.Fire", { AddSound( "TMP.Fire", {
"benny/weapons/anaconda/01.ogg", "benny/weapons/tmp/01.ogg",
"benny/weapons/anaconda/02.ogg", "benny/weapons/tmp/02.ogg",
"benny/weapons/anaconda/03.ogg", "benny/weapons/tmp/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "Nambu.Fire", { AddSound( "Anaconda.Fire", {
"benny/weapons/nambu/01.ogg", "benny/weapons/anaconda/01.ogg",
"benny/weapons/nambu/02.ogg", "benny/weapons/anaconda/02.ogg",
"benny/weapons/nambu/03.ogg", "benny/weapons/anaconda/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "USP.Fire", { AddSound( "Nambu.Fire", {
"benny/weapons/usp/01.ogg", "benny/weapons/nambu/01.ogg",
"benny/weapons/usp/02.ogg", "benny/weapons/nambu/02.ogg",
"benny/weapons/usp/03.ogg", "benny/weapons/nambu/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "Glock.Fire", { AddSound( "USP.Fire", {
"benny/weapons/glock/01.ogg", "benny/weapons/usp/01.ogg",
"benny/weapons/glock/02.ogg", "benny/weapons/usp/02.ogg",
"benny/weapons/glock/03.ogg", "benny/weapons/usp/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "M92.Fire", { AddSound( "Glock.Fire", {
"benny/weapons/m92/01.ogg", "benny/weapons/glock/01.ogg",
"benny/weapons/m92/02.ogg", "benny/weapons/glock/02.ogg",
"benny/weapons/m92/03.ogg", "benny/weapons/glock/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "P226.Fire", { AddSound( "M92.Fire", {
"benny/weapons/p226/01.ogg", "benny/weapons/m92/01.ogg",
"benny/weapons/p226/02.ogg", "benny/weapons/m92/02.ogg",
"benny/weapons/p226/03.ogg", "benny/weapons/m92/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "M16A2.Fire", { AddSound( "P226.Fire", {
"benny/weapons/m16a2/01.ogg", "benny/weapons/p226/01.ogg",
"benny/weapons/m16a2/02.ogg", "benny/weapons/p226/02.ogg",
"benny/weapons/m16a2/03.ogg", "benny/weapons/p226/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "FNC.Fire", { AddSound( "M16A2.Fire", {
"benny/weapons/fnc/01.ogg", "benny/weapons/m16a2/01.ogg",
"benny/weapons/fnc/02.ogg", "benny/weapons/m16a2/02.ogg",
"benny/weapons/fnc/03.ogg", "benny/weapons/m16a2/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "AA12.Fire", "benny/weapons/aa12/01.ogg", 140, 100, 0.5, CHAN_STATIC ) AddSound( "FNC.Fire", {
"benny/weapons/fnc/01.ogg",
"benny/weapons/fnc/02.ogg",
"benny/weapons/fnc/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC )
AddSound( "SPAS12.Fire", { AddSound( "AA12.Fire", "benny/weapons/aa12/01.ogg", 140, 100, 0.5, CHAN_STATIC )
"benny/weapons/spas12/01.ogg",
"benny/weapons/spas12/02.ogg",
"benny/weapons/spas12/03.ogg",
}, 140, 100, 0.5, CHAN_STATIC )
AddSound( "MP5K.MagOut", "benny/weapons/mp5k/magout.ogg", 70, 100, 0.5, CHAN_STATIC ) AddSound( "SPAS12.Fire", {
AddSound( "MP5K.MagIn", "benny/weapons/mp5k/magin.ogg", 70, 100, 0.5, CHAN_STATIC ) "benny/weapons/spas12/01.ogg",
AddSound( "MAC11.MagOut", "benny/weapons/mac11/magout.ogg", 70, 100, 0.5, CHAN_STATIC ) "benny/weapons/spas12/02.ogg",
AddSound( "MAC11.MagIn", "benny/weapons/mac11/magin.ogg", 70, 100, 0.5, CHAN_STATIC ) "benny/weapons/spas12/03.ogg",
AddSound( "MP7.MagOut", "benny/weapons/mp7/magout.ogg", 70, 100, 0.5, CHAN_STATIC ) }, 140, 100, 0.5, CHAN_STATIC )
AddSound( "MP7.MagIn", "benny/weapons/mp7/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "TMP.MagOut", "benny/weapons/tmp/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "TMP.MagIn", "benny/weapons/tmp/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Bizon.MagOut", "benny/weapons/bizon/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Bizon.MagIn", "benny/weapons/bizon/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Anaconda.MagOut", "benny/weapons/anaconda/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Anaconda.MagIn", "benny/weapons/anaconda/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Nambu.MagOut", "benny/weapons/nambu/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Nambu.MagIn", "benny/weapons/nambu/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "P226.MagOut", "benny/weapons/p226/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "P226.MagIn", "benny/weapons/p226/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M92.MagOut", "benny/weapons/m92/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M92.MagIn", "benny/weapons/m92/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "1911.MagOut", "benny/weapons/1911/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "1911.MagIn", "benny/weapons/1911/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "USP.MagOut", "benny/weapons/usp/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "USP.MagIn", "benny/weapons/usp/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Glock.MagOut", "benny/weapons/glock/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Glock.MagIn", "benny/weapons/glock/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M16A2.MagOut", "benny/weapons/m16a2/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M16A2.MagIn", "benny/weapons/m16a2/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "FNC.MagOut", "benny/weapons/fnc/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "FNC.MagIn", "benny/weapons/fnc/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "AA12.MagOut", "benny/weapons/aa12/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "AA12.MagIn", "benny/weapons/aa12/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "SPAS12.MagOut", {
"benny/weapons/spas12/magout-01.ogg",
"benny/weapons/spas12/magout-02.ogg",
"benny/weapons/spas12/magout-03.ogg",
}, 70, 100, 0.5, CHAN_STATIC )
AddSound( "SPAS12.MagIn", "benny/weapons/spas12/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.Dryfire.Pistol", "benny/weapons/common/06-13.ogg", 70, 100, 0.5, CHAN_STATIC ) AddSound( "MP5K.MagOut", "benny/weapons/mp5k/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.Dryfire.Rifle", "benny/weapons/common/06-12.ogg", 70, 100, 0.5, CHAN_STATIC ) AddSound( "MP5K.MagIn", "benny/weapons/mp5k/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.NoAmmo", "benny/weapons/noammo.ogg", 70, 100, 0.5, CHAN_STATIC ) AddSound( "MAC11.MagOut", "benny/weapons/mac11/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "MAC11.MagIn", "benny/weapons/mac11/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "MP7.MagOut", "benny/weapons/mp7/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "MP7.MagIn", "benny/weapons/mp7/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "TMP.MagOut", "benny/weapons/tmp/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "TMP.MagIn", "benny/weapons/tmp/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Bizon.MagOut", "benny/weapons/bizon/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Bizon.MagIn", "benny/weapons/bizon/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Anaconda.MagOut", "benny/weapons/anaconda/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Anaconda.MagIn", "benny/weapons/anaconda/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Nambu.MagOut", "benny/weapons/nambu/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Nambu.MagIn", "benny/weapons/nambu/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "P226.MagOut", "benny/weapons/p226/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "P226.MagIn", "benny/weapons/p226/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M92.MagOut", "benny/weapons/m92/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M92.MagIn", "benny/weapons/m92/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "1911.MagOut", "benny/weapons/1911/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "1911.MagIn", "benny/weapons/1911/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "USP.MagOut", "benny/weapons/usp/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "USP.MagIn", "benny/weapons/usp/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Glock.MagOut", "benny/weapons/glock/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Glock.MagIn", "benny/weapons/glock/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M16A2.MagOut", "benny/weapons/m16a2/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "M16A2.MagIn", "benny/weapons/m16a2/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "FNC.MagOut", "benny/weapons/fnc/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "FNC.MagIn", "benny/weapons/fnc/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "AA12.MagOut", "benny/weapons/aa12/magout.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "AA12.MagIn", "benny/weapons/aa12/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "SPAS12.MagOut", {
"benny/weapons/spas12/magout-01.ogg",
"benny/weapons/spas12/magout-02.ogg",
"benny/weapons/spas12/magout-03.ogg",
}, 70, 100, 0.5, CHAN_STATIC )
AddSound( "SPAS12.MagIn", "benny/weapons/spas12/magin.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.Dryfire.Pistol", "benny/weapons/common/06-13.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.Dryfire.Rifle", "benny/weapons/common/06-12.ogg", 70, 100, 0.5, CHAN_STATIC )
AddSound( "Common.NoAmmo", "benny/weapons/noammo.ogg", 70, 100, 0.5, CHAN_STATIC )
end
do -- Toolgun do -- Toolgun
@ -421,7 +425,7 @@ do -- Handguns
Ammo = 12, Ammo = 12,
Damage = 30, Damage = 30,
Spread = 15/60, Spread = 15/60,
SpreadAdd = 0.5, SpreadAdd = 0.4,
SpreadAddMax = 15, SpreadAddMax = 15,
SpreadDecay_Start = 3, SpreadDecay_Start = 3,
@ -447,7 +451,7 @@ do -- Handguns
Sound_MagOut = "Glock.MagOut", Sound_MagOut = "Glock.MagOut",
Sound_MagIn = "Glock.MagIn", Sound_MagIn = "Glock.MagIn",
Delay = (60/800), Delay = (60/900),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 17, Ammo = 17,
Damage = 18, Damage = 18,
@ -482,7 +486,7 @@ do -- Handguns
Delay = (60/180), Delay = (60/180),
Firemodes = FIREMODE_SEMI, Firemodes = FIREMODE_SEMI,
Ammo = 6, Ammo = 6,
Damage = 26, Damage = 36,
Spread = 30/60, Spread = 30/60,
SpreadAdd = 1.5, SpreadAdd = 1.5,
SpreadAddMax = 15, SpreadAddMax = 15,
@ -513,7 +517,7 @@ do -- Handguns
Delay = (60/180), Delay = (60/180),
Firemodes = FIREMODE_SEMI, Firemodes = FIREMODE_SEMI,
Ammo = 6, Ammo = 6,
Damage = 49, Damage = 55,
Spread = 30/60, Spread = 30/60,
SpreadAdd = 6, SpreadAdd = 6,
SpreadAddMax = 15, SpreadAddMax = 15,
@ -544,7 +548,7 @@ do -- Handguns
Delay = (60/180), Delay = (60/180),
Firemodes = FIREMODE_SEMI, Firemodes = FIREMODE_SEMI,
Ammo = 7, Ammo = 7,
Damage = 40, Damage = 47,
Spread = 30/60, Spread = 30/60,
SpreadAdd = 4, SpreadAdd = 4,
SpreadAddMax = 15, SpreadAddMax = 15,
@ -746,7 +750,7 @@ do -- Shotguns
WEAPONS["spas12"] = { WEAPONS["spas12"] = {
Name = "SPAS-12", Name = "SPAS-12",
Description = "meow", Description = "Heavy metal pump-action shotgun.",
Type = "shotgun", Type = "shotgun",
WModel = "models/weapons/w_shotgun.mdl", WModel = "models/weapons/w_shotgun.mdl",
@ -776,7 +780,7 @@ do -- Shotguns
WEAPONS["doublebarrel"] = { WEAPONS["doublebarrel"] = {
Name = "D/B", Name = "D/B",
Description = "meow", Description = "Pocket-sized double-barrelled rocket of fun!",
Type = "shotgun", Type = "shotgun",
WModel = "models/weapons/w_shot_shorty.mdl", WModel = "models/weapons/w_shot_shorty.mdl",
@ -806,7 +810,7 @@ do -- Shotguns
WEAPONS["aa12"] = { WEAPONS["aa12"] = {
Name = "AA-12", Name = "AA-12",
Description = "meow", Description = "Magazine fed powerhouse.",
Type = "shotgun", Type = "shotgun",
WModel = "models/weapons/w_shot_br99.mdl", WModel = "models/weapons/w_shot_br99.mdl",
@ -840,7 +844,7 @@ do -- Rifles
WEAPONS["fnc"] = { WEAPONS["fnc"] = {
Name = "FNC PARA", Name = "FNC PARA",
Description = "meow", Description = "Run of the mill automatic assault rifle.",
Type = "rifle", Type = "rifle",
Icon = Material( "benny/weapons/fnc.png", "smooth" ), Icon = Material( "benny/weapons/fnc.png", "smooth" ),
@ -856,7 +860,7 @@ do -- Rifles
Delay = (60/600), Delay = (60/600),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 30, Ammo = 30,
Damage = 10, Damage = 30,
Spread = 30/60, Spread = 30/60,
SpreadAdd = 22/60, SpreadAdd = 22/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -870,7 +874,7 @@ do -- Rifles
WEAPONS["qbz"] = { WEAPONS["qbz"] = {
Name = "QBZ-95", Name = "QBZ-95",
Description = "Bullpup assault rifle.", Description = "Bullpup assault rifle. Low profile, great in close quarters.",
Type = "rifle", Type = "rifle",
Icon = Material( "benny/weapons/fnc.png", "smooth" ), Icon = Material( "benny/weapons/fnc.png", "smooth" ),
@ -886,7 +890,7 @@ do -- Rifles
Delay = (60/800), Delay = (60/800),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 30, Ammo = 30,
Damage = 10, Damage = 30,
Spread = 45/60, Spread = 45/60,
SpreadAdd = 35/60, SpreadAdd = 35/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -900,7 +904,7 @@ do -- Rifles
WEAPONS["m16a2"] = { WEAPONS["m16a2"] = {
Name = "M16A2", Name = "M16A2",
Description = "meow", Description = "Burst-fire assault rifle. Precise and effective at range.",
Type = "rifle", Type = "rifle",
Icon = Material( "benny/weapons/m16a2.png", "smooth" ), Icon = Material( "benny/weapons/m16a2.png", "smooth" ),
@ -919,7 +923,7 @@ do -- Rifles
{ Mode = 1 }, { Mode = 1 },
}, },
Ammo = 30, Ammo = 30,
Damage = 10, Damage = 30,
Spread = 22/60, Spread = 22/60,
SpreadAdd = 11/60, SpreadAdd = 11/60,
SpreadAddMax = 10, SpreadAddMax = 10,