Toolgun reload menu & categorization

This commit is contained in:
Fesiug 2023-11-12 00:44:34 -05:00
parent c3461ec7c9
commit bc36188668
1 changed files with 980 additions and 926 deletions

View File

@ -144,7 +144,50 @@ AddSound( "Common.Dryfire.Pistol", "benny/weapons/common/06-13.ogg", 70, 100, 0.
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 )
WEAPONS["toolgun"] = {
do -- Toolgun
CreateClientConVar( "benny_toolgun", "", true, true )
local ToolGunTools = {
["ammocrate"] = function( self, p, tr )
if SERVER then
local summon = ents.Create( "bitem_ammo" )
summon:SetPos( tr.HitPos + tr.HitNormal )
summon:Spawn()
end
end,
["summon_human"] = function( self, p, tr )
if SERVER then
local summon = ents.Create( "bnpc_human" )
summon:SetPos( tr.HitPos + tr.HitNormal )
summon:Spawn()
end
end,
}
local function CreateSelect()
local Frame = vgui.Create( "DFrame" )
Frame:SetSize( 300, 85 )
Frame:SetTitle( "Toolgun Select" )
Frame:Center()
Frame:MakePopup()
local Text = Frame:Add( "DLabel" )
Text:Dock( TOP )
Text:DockMargin( 10, 0, 10, 0 )
Text:SetText( "Select a tool." )
local List = Frame:Add( "DComboBox" )
List:Dock( TOP )
List:SetValue(GetConVar("benny_toolgun"):GetString())
List:DockMargin( 10, 0, 10, 0 )
for i, v in SortedPairs( ToolGunTools ) do
List:AddChoice( i )
end
List.OnSelect = function( self, index, value )
RunConsoleCommand( "benny_toolgun", value )
Frame:Remove()
end
end
WEAPONS["toolgun"] = {
Name = "TOOL GUN",
Description = "Developer development device",
Type = "special",
@ -167,14 +210,8 @@ WEAPONS["toolgun"] = {
local p = self:GetOwner()
local tr = p:GetEyeTrace()
if SERVER then
local summon = ents.Create( "bitem_ammo" )
-- summon:SetModel( "models/props_junk/cardboard_box001a.mdl" )
-- summon:Give( "weapon_stunstick")
summon:SetPos( tr.HitPos + tr.HitNormal )
summon:Spawn()
end
local tool = p:GetInfo( "benny_toolgun" )
if ToolGunTools[tool] then ToolGunTools[tool]( self, p, tr ) end
if CLIENT and IsFirstTimePredicted() then
local vStart = self:GetAttachment( 1 ).Pos
@ -190,8 +227,8 @@ WEAPONS["toolgun"] = {
end,
Reload = function( self, slot )
if self:GetOwner():KeyPressed( IN_RELOAD ) then
print( self )
if CLIENT and self:GetOwner():KeyPressed( IN_RELOAD ) then
CreateSelect()
end
-- Return true to skip weapon logic
@ -199,11 +236,13 @@ WEAPONS["toolgun"] = {
end,
Features = "firearm",
}
}
-- Melee
end
WEAPONS["melee_bat"] = {
do -- Melee
WEAPONS["melee_bat"] = {
Name = "BAT",
Description = "meow",
Type = "melee",
@ -217,9 +256,9 @@ WEAPONS["melee_bat"] = {
Damage = 0,
Features = "melee",
}
}
WEAPONS["melee_baton"] = {
WEAPONS["melee_baton"] = {
Name = "BATON",
Description = "meow",
Type = "melee",
@ -233,9 +272,9 @@ WEAPONS["melee_baton"] = {
Damage = 0,
Features = "melee",
}
}
WEAPONS["melee_knife"] = {
WEAPONS["melee_knife"] = {
Name = "KNIFE",
Description = "meow",
Type = "melee",
@ -249,9 +288,9 @@ WEAPONS["melee_knife"] = {
Damage = 0,
Features = "melee",
}
}
WEAPONS["melee_machete"] = {
WEAPONS["melee_machete"] = {
Name = "MACHETE",
Description = "meow",
Type = "melee",
@ -265,11 +304,13 @@ WEAPONS["melee_machete"] = {
Damage = 0,
Features = "melee",
}
}
-- Handguns
end
WEAPONS["1911"] = {
do -- Handguns
WEAPONS["1911"] = {
Name = "COBRA .45",
Description = "Hits hard. They don't make them like they used to!",
Type = "pistol",
@ -292,9 +333,9 @@ WEAPONS["1911"] = {
Damage = 30,
Features = "firearm",
}
}
WEAPONS["usp"] = {
WEAPONS["usp"] = {
Name = "MK. 23",
Description = "If it works for hardasses around the world, it'll work for you.",
Type = "pistol",
@ -317,9 +358,9 @@ WEAPONS["usp"] = {
Damage = 30,
Features = "firearm",
}
}
WEAPONS["m92"] = {
WEAPONS["m92"] = {
Name = "M92FS",
Description = "Accurate pistol, but low caliber won't do much against armor.",
Type = "pistol",
@ -342,9 +383,9 @@ WEAPONS["m92"] = {
Damage = 30,
Features = "firearm",
}
}
WEAPONS["p226"] = {
WEAPONS["p226"] = {
Name = "P226",
Description = "Special forces pistol in fast .357 ammo.",
Type = "pistol",
@ -367,9 +408,9 @@ WEAPONS["p226"] = {
Damage = 30,
Features = "firearm",
}
}
WEAPONS["glock"] = {
WEAPONS["glock"] = {
Name = "GLOCK-18",
Description = "Bullet storm. Lasts about a second or so, just like you!",
Type = "pistol",
@ -391,9 +432,9 @@ WEAPONS["glock"] = {
Damage = 18,
Features = "firearm",
}
}
WEAPONS["nambu"] = {
WEAPONS["nambu"] = {
Name = "NAMBU .38",
Description = "Eastern revolver that hits as hard as it costs.",
Type = "pistol",
@ -415,9 +456,9 @@ WEAPONS["nambu"] = {
Damage = 26,
Features = "firearm",
}
}
WEAPONS["anaconda"] = {
WEAPONS["anaconda"] = {
Name = "ANACONDA",
Description = "Precise and kicks like a mule.",
Type = "pistol",
@ -439,9 +480,9 @@ WEAPONS["anaconda"] = {
Damage = 40,
Features = "firearm",
}
}
WEAPONS["deagle"] = {
WEAPONS["deagle"] = {
Name = "DEAGLE",
Description = "Autoloading .50 caliber pistol.",
Type = "pistol",
@ -463,11 +504,13 @@ WEAPONS["deagle"] = {
Damage = 40,
Features = "firearm",
}
}
-- SMGs & PDWs
end
WEAPONS["tmp"] = {
do -- SMGs & PDWs
WEAPONS["tmp"] = {
Name = "TMP",
Description = "Small, compact, and fast.",
Type = "smg",
@ -489,9 +532,9 @@ WEAPONS["tmp"] = {
Spread = 20/60,
Features = "firearm",
}
}
WEAPONS["mp7"] = {
WEAPONS["mp7"] = {
Name = "MP7",
Description = "Small, pistol-sized.",
Type = "smg",
@ -513,9 +556,9 @@ WEAPONS["mp7"] = {
Spread = 20/60,
Features = "firearm",
}
}
WEAPONS["mp5k"] = {
WEAPONS["mp5k"] = {
Name = "MP5K",
Description = "Quality manufacturing, but cumbersome.",
Type = "smg",
@ -537,9 +580,9 @@ WEAPONS["mp5k"] = {
Spread = 20/60,
Features = "firearm",
}
}
WEAPONS["mac11"] = {
WEAPONS["mac11"] = {
Name = "MAC-11",
Description = "More fit for combat in a phone booth.",
Type = "smg",
@ -561,9 +604,9 @@ WEAPONS["mac11"] = {
Spread = 30/60,
Features = "firearm",
}
}
WEAPONS["bizon"] = {
WEAPONS["bizon"] = {
Name = "BIZON",
Description = "Unwieldy bullet storm.",
Type = "smg",
@ -585,9 +628,9 @@ WEAPONS["bizon"] = {
Spread = 40/60,
Features = "firearm",
}
}
WEAPONS["chicom"] = {
WEAPONS["chicom"] = {
Name = "QCW-CQB",
Description = "Subsonic bullpup SMG.",
Type = "smg",
@ -609,11 +652,13 @@ WEAPONS["chicom"] = {
Spread = 40/60,
Features = "firearm",
}
}
-- Shotguns
end
WEAPONS["spas12"] = {
do -- Shotguns
WEAPONS["spas12"] = {
Name = "SPAS-12",
Description = "meow",
Type = "shotgun",
@ -635,10 +680,10 @@ WEAPONS["spas12"] = {
Spread = 150/60,
Features = "firearm",
}
}
WEAPONS["cqb70"] = {
Name = "CQB-70",
WEAPONS["cqb70"] = {
Name = "CS-70",
Description = "meow",
Type = "shotgun",
@ -659,9 +704,9 @@ WEAPONS["cqb70"] = {
Spread = 150/60,
Features = "firearm",
}
}
WEAPONS["m12ak"] = {
WEAPONS["m12ak"] = {
Name = "M12AK",
Description = "meow",
Type = "shotgun",
@ -683,9 +728,9 @@ WEAPONS["m12ak"] = {
Spread = 150/60,
Features = "firearm",
}
}
WEAPONS["aa12"] = {
WEAPONS["aa12"] = {
Name = "AA-12",
Description = "meow",
Type = "shotgun",
@ -707,11 +752,13 @@ WEAPONS["aa12"] = {
Spread = 250/60,
Features = "firearm",
}
}
-- Rifles
end
WEAPONS["fnc"] = {
do -- Rifles
WEAPONS["fnc"] = {
Name = "FNC PARA",
Description = "meow",
Type = "rifle",
@ -732,9 +779,9 @@ WEAPONS["fnc"] = {
Damage = 10,
Features = "firearm",
}
}
WEAPONS["qbz"] = {
WEAPONS["qbz"] = {
Name = "QBZ-95",
Description = "Bullpup assault rifle.",
Type = "rifle",
@ -755,9 +802,9 @@ WEAPONS["qbz"] = {
Damage = 10,
Features = "firearm",
}
}
WEAPONS["m16a2"] = {
WEAPONS["m16a2"] = {
Name = "M16A2",
Description = "meow",
Type = "rifle",
@ -781,11 +828,13 @@ WEAPONS["m16a2"] = {
Damage = 10,
Features = "firearm",
}
}
-- Machine guns
end
WEAPONS["stoner63"] = {
do -- Machine guns
WEAPONS["stoner63"] = {
Name = "STONER 63",
Description = "meow",
Type = "machinegun",
@ -805,9 +854,9 @@ WEAPONS["stoner63"] = {
Damage = 10,
Features = "firearm",
}
}
WEAPONS["qbblsw"] = {
WEAPONS["qbblsw"] = {
Name = "QBB-LSW",
Description = "Bullpup light machine gun.",
Type = "machinegun",
@ -827,12 +876,13 @@ WEAPONS["qbblsw"] = {
Damage = 10,
Features = "firearm",
}
}
-- Grenades
-- Nothing here is guaranteed.
end
local function GrenadeFire( self )
do -- Grenades, nothing here is guaranteed.
local function GrenadeFire( self )
local p = self:GetOwner()
if self:GetDelay1() > CurTime() then
return true
@ -858,14 +908,14 @@ local function GrenadeFire( self )
end
return true
end
end
local function GrenadeThink()
local function GrenadeThink()
-- print("yay")
return true
end
end
WEAPONS["g_frag"] = {
WEAPONS["g_frag"] = {
Name = "FRAG GRENADE",
Description = "Pull the pin and throw it the hell away!",
Type = "grenade",
@ -877,9 +927,9 @@ WEAPONS["g_frag"] = {
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
Features = "grenade",
}
}
WEAPONS["g_semtex"] = {
WEAPONS["g_semtex"] = {
Name = "SEMTEX GRENADE",
Description = "Long, audible fuse, but sticks to whatever it touches.",
Type = "grenade",
@ -887,9 +937,9 @@ WEAPONS["g_semtex"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_molotov"] = {
WEAPONS["g_molotov"] = {
Name = "MOLOTOV COCKTAIL",
Description = "Alcoholic bottle of flame!",
Type = "grenade",
@ -897,9 +947,9 @@ WEAPONS["g_molotov"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_tknife"] = {
WEAPONS["g_tknife"] = {
Name = "THROWING KNIFE",
Description = "Lightweight knife to throw and pick back up.",
Type = "grenade",
@ -907,9 +957,9 @@ WEAPONS["g_tknife"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_smoke"] = {
WEAPONS["g_smoke"] = {
Name = "SMOKE GRENADE",
Description = "Smoke bomb used to conceal a position, and makes enemies cough.",
Type = "grenade",
@ -917,9 +967,9 @@ WEAPONS["g_smoke"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_flashbang"] = {
WEAPONS["g_flashbang"] = {
Name = "FLASHBANG",
Description = "Stun grenade that gives off a bright flash and a loud 'bang'.",
Type = "grenade",
@ -927,9 +977,9 @@ WEAPONS["g_flashbang"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_gas"] = {
WEAPONS["g_gas"] = {
Name = "GAS GRENADE",
Description = "Short burst of gas that slows and disorient targets.",
Type = "grenade",
@ -937,9 +987,9 @@ WEAPONS["g_gas"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_prox"] = {
WEAPONS["g_prox"] = {
Name = "PROXIMITY MINE",
Description = "Mine that bounces into the air.",
Type = "grenade",
@ -947,9 +997,9 @@ WEAPONS["g_prox"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_claymore"] = {
WEAPONS["g_claymore"] = {
Name = "CLAYMORE",
Description = "Mine that shoots shrapnel in a cone.",
Type = "grenade",
@ -957,9 +1007,9 @@ WEAPONS["g_claymore"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_scrambler"] = {
WEAPONS["g_scrambler"] = {
Name = "SCRAMBLER",
Description = "Disrupts enemy radar based on proximity.",
Type = "grenade",
@ -967,9 +1017,9 @@ WEAPONS["g_scrambler"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_emp"] = {
WEAPONS["g_emp"] = {
Name = "EMP NADE",
Description = "Disrupts enemy equipment based on proximity.",
Type = "grenade",
@ -977,9 +1027,9 @@ WEAPONS["g_emp"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["g_shockcharge"] = {
WEAPONS["g_shockcharge"] = {
Name = "SHOCK CHARGE",
Description = "Charge that stuns and forces enemies to fire their weapons.",
Type = "grenade",
@ -987,11 +1037,13 @@ WEAPONS["g_shockcharge"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
-- Equipment
end
WEAPONS["e_tacinsertion"] = {
do -- Equipment, nothing here is guaranteed.
WEAPONS["e_tacinsertion"] = {
Name = "TACTICAL INSERTION",
Description = "Flare that changes your deployment location.",
Type = "equipment",
@ -999,9 +1051,9 @@ WEAPONS["e_tacinsertion"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_medkit"] = {
WEAPONS["e_medkit"] = {
Name = "MEDKIT",
Description = "Station that regenerates a portion of health.",
Type = "equipment",
@ -1009,9 +1061,9 @@ WEAPONS["e_medkit"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_ammo"] = {
WEAPONS["e_ammo"] = {
Name = "AMMO CRATE",
Description = "Station that replenishes ammo.",
Type = "equipment",
@ -1019,9 +1071,9 @@ WEAPONS["e_ammo"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_cover"] = {
WEAPONS["e_cover"] = {
Name = "DEPLOYABLE COVER",
Description = ".",
Type = "equipment",
@ -1029,9 +1081,9 @@ WEAPONS["e_cover"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_ddos"] = {
WEAPONS["e_ddos"] = {
Name = "DDOS",
Description = ".",
Type = "equipment",
@ -1039,9 +1091,9 @@ WEAPONS["e_ddos"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_trophysystem"] = {
WEAPONS["e_trophysystem"] = {
Name = "TROPHY SYSTEM",
Description = "Disrupts enemy equipment.",
Type = "equipment",
@ -1049,9 +1101,9 @@ WEAPONS["e_trophysystem"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_portableradar"] = {
WEAPONS["e_portableradar"] = {
Name = "PORTABLE RADAR",
Description = "Detects nearby enemies based on proximity.",
Type = "equipment",
@ -1059,9 +1111,9 @@ WEAPONS["e_portableradar"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_cameraspike"] = {
WEAPONS["e_cameraspike"] = {
Name = "CAMERA SPIKE",
Description = "Mountable camera that gives you a live video feed.",
Type = "equipment",
@ -1069,9 +1121,9 @@ WEAPONS["e_cameraspike"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_recondrone"] = {
WEAPONS["e_recondrone"] = {
Name = "RECON DRONE",
Description = "Pilotable hovering recon drone that automatically marks enemies.",
Type = "equipment",
@ -1079,9 +1131,9 @@ WEAPONS["e_recondrone"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_gasdrone"] = {
WEAPONS["e_gasdrone"] = {
Name = "GAS DRONE",
Description = "Drone that dispenses toxic gas onto an area.",
Type = "equipment",
@ -1089,9 +1141,9 @@ WEAPONS["e_gasdrone"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_suppressionmine"] = {
WEAPONS["e_suppressionmine"] = {
Name = "SUPPRESSION MINE",
Description = "Mine that detonates to dispense hard-to-see sleeping gas.",
Type = "equipment",
@ -1099,9 +1151,9 @@ WEAPONS["e_suppressionmine"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
WEAPONS["e_antiarmor"] = {
WEAPONS["e_antiarmor"] = {
Name = "ANTI-ARMOR ROUNDS",
Description = "Ammo crate that dispenses armor to disable vehicles.",
Type = "equipment",
@ -1109,4 +1161,6 @@ WEAPONS["e_antiarmor"] = {
WModel = "models/weapons/w_eq_flashbang.mdl",
Features = "grenade",
}
}
end