More spawnmenu tweaks! Also, sniper type & wep.

This commit is contained in:
Fesiug 2023-12-09 20:19:02 -05:00
parent 8ebf6099ef
commit c17307bd20
4 changed files with 210 additions and 29 deletions

View File

@ -10,6 +10,14 @@ local function yea()
return true return true
end end
local function rmt1( val, min, max )
return math.Remap( val, min, max, 0, 1 )
end
local function rmt1c( val, min, max )
return math.Clamp( rmt1( val, min, max, 0, 1 ), 0, 1 )
end
local mewer = { local mewer = {
{ {
Func = function( class ) Func = function( class )
@ -26,14 +34,18 @@ local mewer = {
Size = 14, Size = 14,
SizeMultiline = 12, SizeMultiline = 12,
Font = "Benny_12", Font = "Benny_12",
-- "How easily and quickly the weapon can take out a single target.\nDoes not consider armor penetration.\nAffected by Damage and RPM."
}, },
{ {
Name = "Lethality", Name = "Lethality",
Size = 12, Size = 12,
Font = "Benny_10", Font = "Benny_10",
Stat = function( class ) Stat = function( class )
return math.Clamp( math.Remap( class.Damage * (class.Pellets or 1), 12, 50, 0, 1 ), 0, 1 ) local bwep = math.Clamp( math.Remap( class.Damage * (class.Pellets or 1), 14, 80, 0, 1 ), 0, 1 )
local meowzor = math.ease.OutQuart( bwep )
return meowzor
end, end,
-- "How much the weapon's point of aim will move around.\nAffected by various Sway stats."
}, },
{ {
Name = "Suppression", Name = "Suppression",
@ -41,8 +53,19 @@ local mewer = {
Font = "Benny_10", Font = "Benny_10",
Stat = function( class ) Stat = function( class )
local dps = class.Damage * (1/class.Delay) local dps = class.Damage * (1/class.Delay)
return math.Clamp( math.Remap( dps, 50, 550, 0, 1 ), 0, 1 ) local dpscalc = rmt1c( dps, 100, 373 )
local magbonus-- = math.Remap( class.Ammo, 16, 40*2, -0.05, 0.3 )
if class.Ammo > 20 then
magbonus = 1-rmt1c( class.Ammo, 80, 20 )
magbonus = magbonus * 0.5
else
magbonus = math.Remap( class.Ammo, 5, 20, -0.75, -0.1 )
end
local meowzor = math.ease.OutSine( math.Clamp( dpscalc + magbonus, 0, 1 ) )
print( class.Name, dps, dpscalc, math.Round( magbonus, 2 ), meowzor )
return meowzor
end, end,
-- "How much damage the weapon can output over a long period of time.\nDoes not consider armor penetration.\nAffected by Damage, RPM, Capacity and Reload Time."
}, },
{ {
Name = "Range", Name = "Range",
@ -51,6 +74,7 @@ local mewer = {
Stat = function( class ) Stat = function( class )
return 0 return 0
end, end,
-- "How well the weapon gains or loses damage over long distances.\nAffected by Minimum Range, Maximum Range, and damage falloff."
}, },
{ {
Name = "Precision", Name = "Precision",
@ -59,6 +83,7 @@ local mewer = {
Stat = function( class ) Stat = function( class )
return math.Clamp( math.Remap( class.Spread, 1/60, 2, 1, 0 ), 0, 1 ) return math.Clamp( math.Remap( class.Spread, 1/60, 2, 1, 0 ), 0, 1 )
end, end,
-- "How accurate the weapon is when firing single shots or short bursts.\nAffected by Spread and various Recoil stats."
}, },
{ {
Name = "Control", Name = "Control",
@ -67,6 +92,7 @@ local mewer = {
Stat = function( class ) Stat = function( class )
return math.Clamp( math.Remap( class.SpreadAdd * (1/class.Delay), 1, 13, 1, 0 ), 0, 1 ) return math.Clamp( math.Remap( class.SpreadAdd * (1/class.Delay), 1, 13, 1, 0 ), 0, 1 )
end, end,
-- "How managable the weapon's recoil and spread is under sustained fire.\nAffected by RPM and various Recoil stats."
}, },
{ {
Name = "Handling", Name = "Handling",
@ -75,6 +101,7 @@ local mewer = {
Stat = function( class ) Stat = function( class )
return 0 return 0
end, end,
-- "How quickly this weapon readies from sprinting, aiming and deploying.\nAffected by Aim Down Sights Time, Sprint To Fire Time, and Deploy Time."
}, },
{ {
Name = "Maneuvering", Name = "Maneuvering",
@ -83,23 +110,43 @@ local mewer = {
Stat = function( class ) Stat = function( class )
return 0 return 0
end, end,
-- "How accurate the weapon is while not aiming.\nAffected by Hipfire Spread, Mid-air Spread, Sway, and Free Aim Angle."
}, },
{ {
Name = "Mobility", Name = "Mobility",
Size = 12, Size = 12,
Font = "Benny_10", Font = "Benny_10",
Stat = function( class ) Stat = function( class )
return 0 local weight_moving, weight_aiming, weight_reloading, weight_firing = 5, 5, 2, 1
end, local totalscore = (weight_moving + weight_aiming + weight_reloading + weight_firing)
}, weight_moving, weight_aiming, weight_reloading, weight_firing = weight_moving/totalscore, weight_aiming/totalscore, weight_reloading/totalscore, weight_firing/totalscore
{
Name = "Stability", local score_moving, score_aiming, score_reloading, score_firing = 1, 1, 1, 1
Size = 12,
Font = "Benny_10", score_moving = rmt1c( class.Speed_Move or 1, 0.75, 0.95 )
Stat = function( class ) score_moving = score_moving * weight_moving
return 0
score_aiming = rmt1c( class.Speed_Aiming or 1, 0.75, 0.95 )
score_aiming = score_aiming * weight_aiming
score_reloading = rmt1c( class.Speed_Reloading or 1, 0.75, 0.9 )
score_reloading = score_reloading * weight_reloading
score_firing = rmt1c( class.Speed_Firing or 1, 0.75, 0.9 )
score_firing = score_firing * weight_firing
return score_moving + score_aiming + score_reloading + score_firing
end, end,
-- "How fast the user can move while using this weapon.\nAffected by various Speed stats."
}, },
-- {
-- Name = "Stability",
-- Size = 12,
-- Font = "Benny_10",
-- Stat = function( class )
-- return 0
-- end,
-- "How much the weapon's point of aim will move around.\nAffected by various Sway stats."- },
} }
local function multlinetext(text, maxw, font) local function multlinetext(text, maxw, font)
@ -183,7 +230,7 @@ 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(640), ss(360) ) smenu:SetSize( ss(520), ss(360) )
smenu:SetTitle("Developer Spawnmenu") smenu:SetTitle("Developer Spawnmenu")
smenu:MakePopup() smenu:MakePopup()
smenu:SetKeyboardInputEnabled( false ) smenu:SetKeyboardInputEnabled( false )
@ -194,7 +241,7 @@ function OpenSMenu()
smenu:Center() smenu:Center()
local statlist = smenu:Add("DPanel") local statlist = smenu:Add("DPanel")
statlist:SetWide( ss(320) ) statlist:SetWide( ss(300) )
statlist:Dock( RIGHT ) statlist:Dock( RIGHT )
statlist:DockMargin( ss(2), 0, 0, 0 ) statlist:DockMargin( ss(2), 0, 0, 0 )
statlist:DockPadding( ss(2), ss(2), ss(2), ss(2) ) statlist:DockPadding( ss(2), ss(2), ss(2), ss(2) )
@ -251,7 +298,9 @@ function OpenSMenu()
surface.SetDrawColor( col ) surface.SetDrawColor( col )
local width = w-(ss(60+1.5)+h) local width = w-(ss(60+1.5)+h)
surface.DrawRect( ss(60+1)+h, h*.125, math.max( ss(1), width*perc ), h*.75 ) surface.DrawRect( ss(60+1)+h, ss(3), math.max( ss(1), width*perc ), h-ss(6) )
--surface.SetDrawColor( schema("bg") )
--surface.DrawOutlinedRect( ss(60+1)+h, ss(0.5), width, h-ss(1), ss(2) )
for i=1, 10 do for i=1, 10 do
if i==1 then continue end if i==1 then continue end
surface.SetDrawColor( schema("fg", i%2==1 and 0.01 or 1) ) surface.SetDrawColor( schema("fg", i%2==1 and 0.01 or 1) )

View File

@ -606,7 +606,7 @@ hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local mat2 = i == 1 and mat_dot_s or mat_dot local mat2 = i == 1 and mat_dot_s or mat_dot
surface.SetDrawColor( cooler ) surface.SetDrawColor( cooler )
local typ = wep:BClass( hand ).Type local typ = wep:BClass( hand ).Type
if typ == "rifle" then if typ == "rifle" or typ == "sniper" then
surface.SetMaterial( mat1 ) surface.SetMaterial( mat1 )
surface.DrawTexturedRectRotated( poosx - s(spacer_long) - gap, poosy, s(16), s(16), 0 ) surface.DrawTexturedRectRotated( poosx - s(spacer_long) - gap, poosy, s(16), s(16), 0 )
surface.DrawTexturedRectRotated( poosx + s(spacer_long) + gap, poosy, s(16), s(16), 0 ) surface.DrawTexturedRectRotated( poosx + s(spacer_long) + gap, poosy, s(16), s(16), 0 )

View File

@ -92,6 +92,7 @@ function PT:INV_Find( class, exclude )
end end
local T_WEIGHT = { local T_WEIGHT = {
["sniper"] = 45,
["machinegun"] = 40, ["machinegun"] = 40,
["rifle"] = 35, ["rifle"] = 35,
["shotgun"] = 30, ["shotgun"] = 30,
@ -167,8 +168,9 @@ do
["pistol"] = { 2, 1 }, ["pistol"] = { 2, 1 },
["smg"] = { 3, 1 }, ["smg"] = { 3, 1 },
["shotgun"] = { 4, 1 }, ["shotgun"] = { 4, 1 },
["rifle"] = { 5, 1 }, ["sniper"] = { 5, 1 },
["machinegun"] = { 5, 2 }, ["rifle"] = { 5, 2 },
["machinegun"] = { 5, 3 },
["grenade"] = { 6, 1 }, ["grenade"] = { 6, 1 },
["utility"] = { 6, 2 }, ["utility"] = { 6, 2 },
["equipment"] = { 7, 1 }, ["equipment"] = { 7, 1 },

View File

@ -400,6 +400,11 @@ do -- Handguns
SpreadDecay_End = 11, SpreadDecay_End = 11,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 1,
Speed_Aiming = 0.95,
Speed_Reloading = 1,
Speed_Firing = 1,
Features = "firearm", Features = "firearm",
} }
@ -423,7 +428,7 @@ do -- Handguns
Delay = (60/300), Delay = (60/300),
Firemodes = FIREMODE_SEMI, Firemodes = FIREMODE_SEMI,
Ammo = 12, Ammo = 12,
Damage = 30, Damage = 32,
Spread = 15/60, Spread = 15/60,
SpreadAdd = 0.4, SpreadAdd = 0.4,
SpreadAddMax = 15, SpreadAddMax = 15,
@ -432,6 +437,11 @@ do -- Handguns
SpreadDecay_End = 11, SpreadDecay_End = 11,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 1,
Speed_Aiming = 0.95,
Speed_Reloading = 1,
Speed_Firing = 1,
Features = "firearm", Features = "firearm",
} }
@ -463,6 +473,10 @@ do -- Handguns
SpreadDecay_End = 11, SpreadDecay_End = 11,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 1,
Speed_Aiming = 0.95,
Speed_Reloading = 0.95,
Speed_Firing = 0.95,
Features = "firearm", Features = "firearm",
} }
@ -495,6 +509,11 @@ do -- Handguns
SpreadDecay_End = 11, SpreadDecay_End = 11,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 1,
Speed_Aiming = 1,
Speed_Reloading = 0.9,
Speed_Firing = 0.95,
Features = "firearm", Features = "firearm",
} }
@ -526,6 +545,11 @@ do -- Handguns
SpreadDecay_End = 22, SpreadDecay_End = 22,
SpreadDecay_RampTime = 0.65, SpreadDecay_RampTime = 0.65,
Speed_Move = 0.97,
Speed_Aiming = 0.9,
Speed_Reloading = 0.9,
Speed_Firing = 0.95,
Features = "firearm", Features = "firearm",
} }
@ -557,6 +581,11 @@ do -- Handguns
SpreadDecay_End = 25, SpreadDecay_End = 25,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 0.95,
Speed_Aiming = 0.88,
Speed_Reloading = 0.88,
Speed_Firing = 0.93,
Features = "firearm", Features = "firearm",
} }
@ -582,7 +611,7 @@ do -- SMGs & PDWs
Delay = (60/650), Delay = (60/650),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 15, Ammo = 15,
Damage = 18, Damage = 22,
Spread = 20/60, Spread = 20/60,
SpreadAdd = 10/60, SpreadAdd = 10/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -591,6 +620,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.4, SpreadDecay_RampTime = 0.4,
Speed_Move = 0.97,
Speed_Aiming = 0.97,
Speed_Reloading = 0.97,
Speed_Firing = 0.97,
Features = "firearm", Features = "firearm",
} }
@ -612,7 +646,7 @@ do -- SMGs & PDWs
Delay = (60/900), Delay = (60/900),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 20, Ammo = 20,
Damage = 16, Damage = 19,
Spread = 20/60, Spread = 20/60,
SpreadAdd = 20/60, SpreadAdd = 20/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -621,6 +655,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.2, SpreadDecay_RampTime = 0.2,
Speed_Move = 0.97,
Speed_Aiming = 0.97,
Speed_Reloading = 0.97,
Speed_Firing = 0.97,
Features = "firearm", Features = "firearm",
} }
@ -639,10 +678,10 @@ do -- SMGs & PDWs
Sound_MagOut = "MP5K.MagOut", Sound_MagOut = "MP5K.MagOut",
Sound_MagIn = "MP5K.MagIn", Sound_MagIn = "MP5K.MagIn",
Delay = (60/700), Delay = (60/750),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 15, Ammo = 15,
Damage = 18, Damage = 22,
Spread = 20/60, Spread = 20/60,
SpreadAdd = 10/60, SpreadAdd = 10/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -651,6 +690,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.3, SpreadDecay_RampTime = 0.3,
Speed_Move = 0.97,
Speed_Aiming = 0.97,
Speed_Reloading = 0.97,
Speed_Firing = 0.97,
Features = "firearm", Features = "firearm",
} }
@ -672,7 +716,7 @@ do -- SMGs & PDWs
Delay = (60/1400), Delay = (60/1400),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 16, Ammo = 16,
Damage = 16, Damage = 19,
Spread = 60/60, Spread = 60/60,
SpreadAdd = 30/60, SpreadAdd = 30/60,
SpreadAddMax = 20, SpreadAddMax = 20,
@ -681,6 +725,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.3, SpreadDecay_RampTime = 0.3,
Speed_Move = 0.97,
Speed_Aiming = 0.97,
Speed_Reloading = 0.97,
Speed_Firing = 0.97,
Features = "firearm", Features = "firearm",
} }
@ -702,7 +751,7 @@ do -- SMGs & PDWs
Delay = (60/700), Delay = (60/700),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 40, Ammo = 40,
Damage = 16, Damage = 20,
Spread = 40/60, Spread = 40/60,
SpreadAdd = 10/60, SpreadAdd = 10/60,
SpreadAddMax = 20, SpreadAddMax = 20,
@ -711,6 +760,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 10, SpreadDecay_End = 10,
SpreadDecay_RampTime = 0.6, SpreadDecay_RampTime = 0.6,
Speed_Move = 0.94,
Speed_Aiming = 0.94,
Speed_Reloading = 0.93,
Speed_Firing = 0.93,
Features = "firearm", Features = "firearm",
} }
@ -732,7 +786,7 @@ do -- SMGs & PDWs
Delay = (60/1050), Delay = (60/1050),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 36, Ammo = 36,
Damage = 12, Damage = 18,
Spread = 40/60, Spread = 40/60,
SpreadAdd = 33/60, SpreadAdd = 33/60,
SpreadAddMax = 20, SpreadAddMax = 20,
@ -741,6 +795,11 @@ do -- SMGs & PDWs
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.7, SpreadDecay_RampTime = 0.7,
Speed_Move = 0.95,
Speed_Aiming = 0.95,
Speed_Reloading = 0.94,
Speed_Firing = 0.94,
Features = "firearm", Features = "firearm",
} }
@ -775,6 +834,11 @@ do -- Shotguns
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.7, SpreadDecay_RampTime = 0.7,
Speed_Move = 0.85,
Speed_Aiming = 0.85,
Speed_Reloading = 0.85,
Speed_Firing = 0.75,
Features = "firearm", Features = "firearm",
} }
@ -805,6 +869,11 @@ do -- Shotguns
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 0.5, SpreadDecay_RampTime = 0.5,
Speed_Move = 0.9,
Speed_Aiming = 0.9,
Speed_Reloading = 0.85,
Speed_Firing = 0.75,
Features = "firearm", Features = "firearm",
} }
@ -835,6 +904,11 @@ do -- Shotguns
SpreadDecay_End = 30, SpreadDecay_End = 30,
SpreadDecay_RampTime = 1, SpreadDecay_RampTime = 1,
Speed_Move = 0.82,
Speed_Aiming = 0.82,
Speed_Reloading = 0.5,
Speed_Firing = 0.334,
Features = "firearm", Features = "firearm",
} }
@ -869,6 +943,11 @@ do -- Rifles
SpreadDecay_End = 12, SpreadDecay_End = 12,
SpreadDecay_RampTime = 0.2, SpreadDecay_RampTime = 0.2,
Speed_Move = 0.9,
Speed_Aiming = 0.9,
Speed_Reloading = 0.9,
Speed_Firing = 0.9,
Features = "firearm", Features = "firearm",
} }
@ -890,7 +969,7 @@ do -- Rifles
Delay = (60/800), Delay = (60/800),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 30, Ammo = 30,
Damage = 30, Damage = 28,
Spread = 45/60, Spread = 45/60,
SpreadAdd = 35/60, SpreadAdd = 35/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -899,6 +978,11 @@ do -- Rifles
SpreadDecay_End = 36, SpreadDecay_End = 36,
SpreadDecay_RampTime = 0.6, SpreadDecay_RampTime = 0.6,
Speed_Move = 0.9,
Speed_Aiming = 0.935,
Speed_Reloading = 0.935,
Speed_Firing = 0.935,
Features = "firearm", Features = "firearm",
} }
@ -923,7 +1007,7 @@ do -- Rifles
{ Mode = 1 }, { Mode = 1 },
}, },
Ammo = 30, Ammo = 30,
Damage = 30, Damage = 32,
Spread = 22/60, Spread = 22/60,
SpreadAdd = 11/60, SpreadAdd = 11/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -932,6 +1016,52 @@ do -- Rifles
SpreadDecay_End = 12, SpreadDecay_End = 12,
SpreadDecay_RampTime = 0.3, SpreadDecay_RampTime = 0.3,
Speed_Move = 0.9,
Speed_Aiming = 0.85,
Speed_Reloading = 0.9,
Speed_Firing = 0.85,
Features = "firearm",
}
end
do -- Sniper rifles
WEAPONS["barrett"] = {
Name = "BARRETT .50c",
Description = "Semi-automatic .50 slinger. Turns people into slushie!",
Type = "sniper",
Icon = Material( "benny/weapons/m16a2.png", "smooth" ),
WModel = "models/weapons/w_rif_m16a2.mdl",
HoldType = "rpg",
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.3 },
Sound_Fire = "M16A2.Fire",
Sound_DryFire = "Common.Dryfire.Rifle",
Sound_MagOut = "M16A2.MagOut",
Sound_MagIn = "M16A2.MagIn",
Delay = (60/700),
Firemodes = {
{ Mode = 1 },
},
Ammo = 5,
Damage = 99,
Spread = 5/60,
SpreadAdd = 3,
SpreadAddMax = 9,
SpreadDecay_Start = 0,
SpreadDecay_End = 12,
SpreadDecay_RampTime = 0.3,
Speed_Move = 0.75,
Speed_Aiming = 0.75,
Speed_Reloading = 0.5,
Speed_Firing = 0.334,
Features = "firearm", Features = "firearm",
} }
@ -956,7 +1086,7 @@ do -- Machine guns
Delay = (60/650), Delay = (60/650),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 75, Ammo = 75,
Damage = 10, Damage = 32,
Spread = 26/60, Spread = 26/60,
SpreadAdd = 22/60, SpreadAdd = 22/60,
SpreadAddMax = 10, SpreadAddMax = 10,
@ -985,7 +1115,7 @@ do -- Machine guns
Delay = (60/850), Delay = (60/850),
Firemodes = FIREMODE_AUTOSEMI, Firemodes = FIREMODE_AUTOSEMI,
Ammo = 60, Ammo = 60,
Damage = 10, Damage = 29,
Spread = 36/60, Spread = 36/60,
SpreadAdd = 33/60, SpreadAdd = 33/60,
SpreadAddMax = 15, SpreadAddMax = 15,