My inheritance only grows fucking STRONGER

This commit is contained in:
Fesiug 2024-01-01 16:25:44 -05:00
parent fd5ebda7be
commit 17d21e13ae
5 changed files with 24 additions and 38 deletions

View File

@ -1,32 +1,9 @@
local fallbackstat = {
["Reload_MagOut"] = 0.2,
["Reload_MagIn"] = 0.8,
["Reload_MagIn_Bonus1"] = 0.56,
["Reload_MagIn_Bonus2"] = 0.56+0.1,
["Sound_Cock"] = "Glock.Cock",
["Damage"] = 0,
["Pellets"] = 1,
["Firemodes"] = { { Mode = 1 } },
["Delay"] = 0,
["Ammo"] = 0,
["Spread"] = 0,
["SpreadAdd"] = 0,
["SpreadDecay_Start"] = 0,
["SpreadDecay_End"] = 0,
["SpreadDecay_RampTime"] = 0,
["Speed_Move"] = 1,
["Speed_Aiming"] = 1,
["Speed_Reloading"] = 1,
["Speed_Firing"] = 1,
["Speed_FiringTime"] = 0.2,
["ShootHolsterTime"] = 0,
}
function SWEP:GetStat( hand, stat )
local thereturn = (self:BClass( hand ) and self:BClass( hand )[stat] or fallbackstat[stat])
assert( thereturn, "No stat for " .. stat )
local Hand = ((hand==true and "Left Hand") or (hand==false and "Right Hand"))
assert( self:BClass( hand ), "No weapon in " .. Hand .. " (Trying to get stat " .. stat .. ")" )
local thereturn = (self:BClass( hand ) and self:BClass( hand )[stat])
assert( thereturn, "No stat for " .. stat .. " ( " .. Hand .. " )" )
return thereturn
end

View File

@ -198,8 +198,9 @@ function SWEP:Think()
-- Don't allow holstering from this weapon if...
-- Just know, this feels bad.
if self:bGetReloadTime( hand ) > 0 then
elseif self:bGetShotTime( hand ) + self:GetStat( hand, "ShootHolsterTime" ) > CurTime() then
-- hold
elseif self:BClass( hand ) and self:bGetShotTime( hand ) + self:GetStat( hand, "ShootHolsterTime" ) > CurTime() then
-- hold
else
if curr != "" then
-- require holster first

View File

@ -18,7 +18,7 @@ ItemDef = {}
function ItemDef.__index( self, key )
if rawget(self, "BaseClass") then
return rawget( rawget(self, "BaseClass"), key )
return rawget(self, "BaseClass")[key]
end
end

View File

@ -150,17 +150,18 @@ hook.Add( "Move", "Benny_Move", function( ply, mv )
end
local w = ply:BennyCheck()
if w then
local hand = false
if w and w:BClass( hand ) then
local targetspeed = ply:GetMaxSpeed()
targetspeed = targetspeed * w:GetStat( false, "Speed_Move" )
targetspeed = targetspeed * w:GetStat( hand, "Speed_Move" )
targetspeed = targetspeed * Lerp( w:GetAim(), 1, w:GetStat( false, "Speed_Aiming" ) )
targetspeed = targetspeed * Lerp( w:GetAim(), 1, w:GetStat( hand, "Speed_Aiming" ) )
local st = w:bGetShotTime( false )
targetspeed = targetspeed * (st+w:GetStat( hand, "Speed_FiringTime" ) > CurTime() and w:GetStat( false, "Speed_Firing" ) or 1)
local st = w:bGetShotTime( hand )
targetspeed = targetspeed * (st+w:GetStat( hand, "Speed_FiringTime" ) > CurTime() and w:GetStat( hand, "Speed_Firing" ) or 1)
targetspeed = targetspeed * (w:bGetReloadTime( false ) > 0 and w:GetStat( false, "Speed_Reloading" ) or 1)
targetspeed = targetspeed * (w:bGetReloadTime( hand ) > 0 and w:GetStat( hand, "Speed_Reloading" ) or 1)
mv:SetMaxSpeed( targetspeed )
mv:SetMaxClientSpeed( targetspeed )

View File

@ -29,6 +29,13 @@ ItemDef("base", {
WModel = "models/weapons/w_357.mdl",
Speed_Move = 1,
Speed_Aiming = 1,
Speed_Reloading = 1,
Speed_Firing = 1,
Speed_FiringTime = 0.2,
ShootHolsterTime = 0,
Func_Attack = function( self, hand )
end,
@ -49,7 +56,7 @@ ItemDef("base", {
})
ItemDef("base_firearm", {
Name = "Base Firearm",
--Name = "Base Firearm",
Type = "base",
Base = "base",
Description = "Base for firearms",
@ -103,7 +110,7 @@ ItemDef("base_magazine", {
})
ItemDef("deagle", {
Name = "DEAGLE",
--Name = "DEAGLE",
Description = "Autoloading .50 caliber pistol.",
Base = "base_firearm",
Type = "pistol",