A ton of stuff I forgot
This commit is contained in:
parent
a7d0c55142
commit
5b4497a0cd
|
@ -41,7 +41,7 @@ if CLIENT then
|
||||||
local s = ScreenScaleH
|
local s = ScreenScaleH
|
||||||
local function DST( text, font, x, y, color )
|
local function DST( text, font, x, y, color )
|
||||||
|
|
||||||
for O=1, 2 do
|
for O=1, 1 do
|
||||||
draw.SimpleText( text, font, x-O, y-O, color_black )
|
draw.SimpleText( text, font, x-O, y-O, color_black )
|
||||||
draw.SimpleText( text, font, x, y-O, color_black )
|
draw.SimpleText( text, font, x, y-O, color_black )
|
||||||
draw.SimpleText( text, font, x+O, y-O, color_black )
|
draw.SimpleText( text, font, x+O, y-O, color_black )
|
||||||
|
@ -213,14 +213,14 @@ ENT.States = {
|
||||||
if (self.NextFire or 0) <= CurTime() then
|
if (self.NextFire or 0) <= CurTime() then
|
||||||
local rp = RecipientFilter()
|
local rp = RecipientFilter()
|
||||||
rp:AddAllPlayers()
|
rp:AddAllPlayers()
|
||||||
self:EmitSound("benny/weapons/usp/01.ogg", 100, 100, 0.2, nil, nil, nil, rp )
|
self:EmitSound("benny/weapons/usp/01.ogg", 80, 100, 0.2, nil, nil, nil, rp )
|
||||||
self:FireBullets( {
|
--self:FireBullets( {
|
||||||
Attacker = self,
|
-- Attacker = self,
|
||||||
Inflictor = self,
|
-- Inflictor = self,
|
||||||
Damage = 3,
|
-- Damage = 3,
|
||||||
Dir = self:EyeAngles():Forward(),
|
-- Dir = self:EyeAngles():Forward(),
|
||||||
Src = self:EyePos()
|
-- Src = self:EyePos()
|
||||||
} )
|
--} )
|
||||||
self.NextFire = CurTime() + 0.5
|
self.NextFire = CurTime() + 0.5
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -63,7 +63,7 @@ function SWEP:ItemCheckTrace()
|
||||||
tracedef.endpos = p:EyePos() + (p:GetAimVector() * 90)
|
tracedef.endpos = p:EyePos() + (p:GetAimVector() * 90)
|
||||||
local trace = util.TraceHull(tracedef)
|
local trace = util.TraceHull(tracedef)
|
||||||
--print(trace.StartPos:Distance(trace.HitPos))
|
--print(trace.StartPos:Distance(trace.HitPos))
|
||||||
p:LagCompensation( false )
|
p:LagCompensation( false )
|
||||||
return trace
|
return trace
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
-- Your Name is Benny
|
-- Your Name is Benny
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
local cam_f = CreateConVar( "b-cam_f", -50 )
|
local cam_f = CreateConVar( "b-cam_f", -75 )
|
||||||
local cam_r = CreateConVar( "b-cam_r", 12 )
|
local cam_r = CreateConVar( "b-cam_r", 12 )
|
||||||
local cam_u = CreateConVar( "b-cam_u", 0 )
|
local cam_u = CreateConVar( "b-cam_u", 0 )
|
||||||
local cam_fov = CreateConVar( "b-cam_fov", 75 )
|
local cam_fov = CreateConVar( "b-cam_fov", 75 )
|
||||||
|
|
|
@ -26,7 +26,7 @@ end
|
||||||
local function OpenDebugMenu()
|
local function OpenDebugMenu()
|
||||||
if IsValid(DebugMenu) then DebugMenu:Remove() end
|
if IsValid(DebugMenu) then DebugMenu:Remove() end
|
||||||
DebugMenu = vgui.Create("DFrame")
|
DebugMenu = vgui.Create("DFrame")
|
||||||
DebugMenu:SetSize( 400, 300 )
|
DebugMenu:SetSize( 200, 500 )
|
||||||
DebugMenu:Center()
|
DebugMenu:Center()
|
||||||
DebugMenu:MakePopup()
|
DebugMenu:MakePopup()
|
||||||
DebugMenu:SetKeyboardInputEnabled( false )
|
DebugMenu:SetKeyboardInputEnabled( false )
|
||||||
|
@ -34,10 +34,21 @@ local function OpenDebugMenu()
|
||||||
local opt = DebugMenu:Add("DScrollPanel")
|
local opt = DebugMenu:Add("DScrollPanel")
|
||||||
opt:Dock( FILL )
|
opt:Dock( FILL )
|
||||||
|
|
||||||
|
local categories = {}
|
||||||
|
|
||||||
for iname, idata in SortedPairs( ITEMS ) do
|
for iname, idata in SortedPairs( ITEMS ) do
|
||||||
local button = opt:Add("DButton")
|
if !categories[idata.Category] then
|
||||||
|
local cate = opt:Add("DCollapsibleCategory")
|
||||||
|
cate:Dock(TOP)
|
||||||
|
cate:SetLabel(idata.Category)
|
||||||
|
local plist = vgui.Create("DPanelList")
|
||||||
|
cate:SetContents(plist)
|
||||||
|
categories[idata.Category] = plist
|
||||||
|
end
|
||||||
|
local plist = categories[idata.Category]
|
||||||
|
local button = plist:Add("DButton")
|
||||||
button:Dock( TOP )
|
button:Dock( TOP )
|
||||||
button:DockMargin( 4, 4, 4, 0 )
|
button:DockMargin( 0, 0, 0, 0 )
|
||||||
button:SetText( l8( idata.PrintName ) )
|
button:SetText( l8( idata.PrintName ) )
|
||||||
button.iName = iname
|
button.iName = iname
|
||||||
button.iData = idata
|
button.iData = idata
|
||||||
|
|
|
@ -40,6 +40,14 @@ local function hRect( x, y, w, h )
|
||||||
surface.DrawRect( x, y, w, h )
|
surface.DrawRect( x, y, w, h )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function hRRect( x, y, w, h, r )
|
||||||
|
gx, gy = hXY()
|
||||||
|
x = (x or 0) + gx
|
||||||
|
y = (y or 0) + gy
|
||||||
|
|
||||||
|
draw.RoundedBox( r, x, y, w, h, surface.GetDrawColor() )
|
||||||
|
end
|
||||||
|
|
||||||
local function hTRect( x, y, w, h )
|
local function hTRect( x, y, w, h )
|
||||||
gx, gy = hXY()
|
gx, gy = hXY()
|
||||||
x = (x or 0) + gx
|
x = (x or 0) + gx
|
||||||
|
@ -130,7 +138,7 @@ local function commoncode( set )
|
||||||
local keydown = input.IsKeyDown( lettercode )
|
local keydown = input.IsKeyDown( lettercode )
|
||||||
local thecolor = keydown and COLOR_MAIN or COLOR_DARK
|
local thecolor = keydown and COLOR_MAIN or COLOR_DARK
|
||||||
|
|
||||||
local fakecolor = ColorAlpha( COLOR_BRIGHT, 60)
|
local fakecolor = ColorAlpha( COLOR_BRIGHT, 60 )
|
||||||
hCol( fakecolor )
|
hCol( fakecolor )
|
||||||
hRect( (index-1)*(60+4), 0, 60, 40, 2 )
|
hRect( (index-1)*(60+4), 0, 60, 40, 2 )
|
||||||
|
|
||||||
|
@ -147,6 +155,11 @@ local function commoncode( set )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local fmlookup = {
|
||||||
|
[1] = "SEMI",
|
||||||
|
[math.huge] = "AUTO",
|
||||||
|
}
|
||||||
|
|
||||||
-- Drawing
|
-- Drawing
|
||||||
function GM:HUDPaint()
|
function GM:HUDPaint()
|
||||||
local p = LocalPlayer()
|
local p = LocalPlayer()
|
||||||
|
@ -154,24 +167,42 @@ function GM:HUDPaint()
|
||||||
local handler = p:HandlerCheck()
|
local handler = p:HandlerCheck()
|
||||||
stack = util.Stack()
|
stack = util.Stack()
|
||||||
|
|
||||||
S_Push( 20, 20 )
|
-- S_Push( math.random( -4, 4 ), math.random( -4, 4 ) )
|
||||||
|
|
||||||
|
S_Push( 20, h - 20 - 64 )
|
||||||
hCol( COLOR_DARK )
|
hCol( COLOR_DARK )
|
||||||
hRect( 0, 0, 320, 40 )
|
hRRect( 0, 0, 328, 64, 8 )
|
||||||
|
|
||||||
local x, y = hXY( 6, 0 )
|
local x, y = hXY( 6, 0 )
|
||||||
draw.SimpleText( "BENNY", "HUD_48", x, y, COLOR_MAIN )
|
draw.SimpleText( "BENNY", "HUD_48", x, y, COLOR_MAIN )
|
||||||
|
|
||||||
hCol( COLOR_MAIN )
|
hCol( COLOR_MAIN )
|
||||||
hRect( 4, 4, (320-4-4) * p:GetHealth_Blood()/1000, 40-4-4 )
|
hRect( 8, 8, (320-4-4) * p:GetHealth_Blood()/1000, 40-4-4 )
|
||||||
|
hCol( COLOR_DARK )
|
||||||
hScis( 4, 4, (320-4-4) * p:GetHealth_Blood()/1000, 40-4-4 )
|
hORect( 8+1, 8+1, (320-4-4)-2, 40-4-4-2, 1 )
|
||||||
local x, y = hXY( 6, 0 )
|
|
||||||
draw.SimpleText( "BENNY", "HUD_48", x, y, COLOR_DARK )
|
hCol( COLOR_MAIN )
|
||||||
|
hScis( 8, 8, (320-4-4) * p:GetHealth_Blood()/1000, 40-4-4 )
|
||||||
|
local x, y = hXY( 10, 4 )
|
||||||
|
draw.SimpleText( "BENNY", "HUD_48", x, y, COLOR_DARK )
|
||||||
hScisoff()
|
hScisoff()
|
||||||
|
|
||||||
|
local slen = (320-4-4-4-4-4)
|
||||||
|
hCol( COLOR_MAIN )
|
||||||
|
hRect( 8, 44, slen*0.25, 12 )
|
||||||
|
hRect( 8 + (slen*0.25+4), 44, slen*0.25, 12 )
|
||||||
|
hRect( 8 + (slen*0.25+4)*2, 44, slen*0.25, 12 )
|
||||||
|
hRect( 8 + (slen*0.25+4)*3, 44, slen*0.25, 12 )
|
||||||
|
|
||||||
|
hCol( COLOR_DARK )
|
||||||
|
hORect( 8+1, 44+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
|
hORect( 8+1 + (slen*0.25+4), 44+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
|
hORect( 8+1 + (slen*0.25+4)*2, 44+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
|
hORect( 8+1 + (slen*0.25+4)*3, 44+1, slen*0.25 - 2, 12-2, 1 )
|
||||||
S_Pop()
|
S_Pop()
|
||||||
|
|
||||||
if handler then
|
if handler then
|
||||||
S_Push( 20, h - 60 - 20 )
|
S_Push( 20, 20 )
|
||||||
for i, v in ipairs( p:GetInventory():GetWeighted() ) do
|
for i, v in ipairs( p:GetInventory():GetWeighted() ) do
|
||||||
hCol( v == handler:GetActiveR() and COLOR_BRIGHT or COLOR_DARK )
|
hCol( v == handler:GetActiveR() and COLOR_BRIGHT or COLOR_DARK )
|
||||||
hRect( (i-1)*(120+10), 0, 120, 60 )
|
hRect( (i-1)*(120+10), 0, 120, 60 )
|
||||||
|
@ -194,6 +225,40 @@ function GM:HUDPaint()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
S_Pop()
|
S_Pop()
|
||||||
|
|
||||||
|
local wep = handler:GetActiveR()
|
||||||
|
if wep and wep.GetClip then
|
||||||
|
local Bw, Bh = 328, 160
|
||||||
|
S_Push( w - 20 - Bw, h - 20 - Bh )
|
||||||
|
hCol( COLOR_DARK )
|
||||||
|
hRRect( 0, 0, Bw, Bh, 8 )
|
||||||
|
|
||||||
|
hCol( COLOR_MAIN )
|
||||||
|
local leng = Bw-8-8
|
||||||
|
hRect( 8, 8, leng-70, 26 )
|
||||||
|
hRect( 8 + leng - 70 + 4, 8, leng-(leng-70)-4, 26 )
|
||||||
|
local x, y = hXY( 12, 6 )
|
||||||
|
draw.SimpleText( l8( wep.Class.PrintName ), "HUD_36", x, y, COLOR_DARK )
|
||||||
|
local x, y = hXY( 10 + (leng - 70) + 70/2, 11 )
|
||||||
|
local bc = wep.Class.BurstCount
|
||||||
|
draw.SimpleText( fmlookup[bc] or bc .. "RND", "HUD_24", x, y, COLOR_DARK, TEXT_ALIGN_CENTER )
|
||||||
|
|
||||||
|
S_Push( Bw - 8 - 8, Bh - 18 - 8 )
|
||||||
|
for i=0, wep.Class.ClipSize-1 do
|
||||||
|
if (wep:GetClip() + (wep:GetSlideState() == SLIDE_FORWARD and 1 or 0)) >= (i+1) then
|
||||||
|
hCol( COLOR_MAIN )
|
||||||
|
hRect( (0 - 8 - 2)*i, 0, 8, 18 )
|
||||||
|
hCol( COLOR_DARK )
|
||||||
|
hRect( (0 - 8 - 2)*i, 14, 8, 2 )
|
||||||
|
else
|
||||||
|
hCol( COLOR_BRIGHT )
|
||||||
|
hORect( (0 - 8 - 2)*i, 0, 8, 18 )
|
||||||
|
--hORect( (0 - 8 - 2)*i+1, 1, 8-2, 18-2 )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
S_Pop()
|
||||||
|
S_Pop()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if false then
|
if false then
|
||||||
|
@ -213,10 +278,12 @@ function GM:HUDPaint()
|
||||||
S_Pop()
|
S_Pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
local itemcheck = handler:ItemCheckTrace()
|
|
||||||
|
|
||||||
|
--local itemcheck = handler:ItemCheckTrace()
|
||||||
|
|
||||||
|
-- Hints
|
||||||
if true then
|
if true then
|
||||||
S_Push( w - 20, h - 20 )
|
S_Push( w - 20, 20 )
|
||||||
|
|
||||||
local hints = {}
|
local hints = {}
|
||||||
|
|
||||||
|
@ -229,23 +296,32 @@ function GM:HUDPaint()
|
||||||
table.insert( hints, { "[E]", "THROW" } )
|
table.insert( hints, { "[E]", "THROW" } )
|
||||||
table.insert( hints, { "[R]", "RELOAD" } )
|
table.insert( hints, { "[R]", "RELOAD" } )
|
||||||
table.insert( hints, { "", "RETAIN MAG", "HOLD" } )
|
table.insert( hints, { "", "RETAIN MAG", "HOLD" } )
|
||||||
elseif itemcheck.Entity:IsValid() and itemcheck.Entity.BennyItem then
|
--elseif itemcheck.Entity:IsValid() and itemcheck.Entity.BennyItem then
|
||||||
table.insert( hints, { "", "- - - - - - - - - - - -" } )
|
-- table.insert( hints, { "", "- - - - - - - - - - - -" } )
|
||||||
table.insert( hints, { "[E]", "PICK UP" } )
|
-- table.insert( hints, { "[E]", "PICK UP" } )
|
||||||
end
|
end
|
||||||
|
|
||||||
local x, y = hXY( 0, (#hints-1)*(-24) )
|
local x, y = hXY( 0, 0 )
|
||||||
for i, v in ipairs( hints ) do
|
for i, v in ipairs( hints ) do
|
||||||
draw.SimpleText( v[1], "HUD_24", x - 150, y - 24 + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_CENTER )
|
draw.SimpleText( v[1], "HUD_24", x - 150 + 1, y + (24*(i-1)) + 1, COLOR_DARK, TEXT_ALIGN_CENTER )
|
||||||
draw.SimpleText( v[2], "HUD_24", x, y - 24 + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_RIGHT )
|
draw.SimpleText( v[2], "HUD_24", x + 1, y + (24*(i-1)) + 1, COLOR_DARK, TEXT_ALIGN_RIGHT )
|
||||||
if v[3] then
|
if v[3] then
|
||||||
draw.SimpleText( v[3], "HUD_16", x - 150, y - 24+3 + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_CENTER )
|
draw.SimpleText( v[3], "HUD_16", x - 150 + 1, y+3 + (24*(i-1)) + 1, COLOR_DARK, TEXT_ALIGN_CENTER )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i, v in ipairs( hints ) do
|
||||||
|
draw.SimpleText( v[1], "HUD_24", x - 150, y + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_CENTER )
|
||||||
|
draw.SimpleText( v[2], "HUD_24", x, y + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_RIGHT )
|
||||||
|
if v[3] then
|
||||||
|
draw.SimpleText( v[3], "HUD_16", x - 150, y+3 + (24*(i-1)), COLOR_MAIN, TEXT_ALIGN_CENTER )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
S_Pop()
|
S_Pop()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- S_Pop()
|
||||||
|
|
||||||
local trac = p:GetEyeTrace().HitPos:ToScreen()
|
local trac = p:GetEyeTrace().HitPos:ToScreen()
|
||||||
local trac2 = util.TraceLine( {
|
local trac2 = util.TraceLine( {
|
||||||
start = CamSpot(),
|
start = CamSpot(),
|
||||||
|
@ -256,7 +332,7 @@ function GM:HUDPaint()
|
||||||
for i=1, 2 do
|
for i=1, 2 do
|
||||||
local shadowtime = i==1
|
local shadowtime = i==1
|
||||||
local traac = shadowtime and trac2 or trac
|
local traac = shadowtime and trac2 or trac
|
||||||
local cx, cy = traac.x, traac.y
|
local cx, cy = math.Round(traac.x), math.Round(traac.y)
|
||||||
S_Push( cx, cy )
|
S_Push( cx, cy )
|
||||||
local lol = shadowtime and 0 or 255
|
local lol = shadowtime and 0 or 255
|
||||||
surface.SetDrawColor( lol, lol, lol )
|
surface.SetDrawColor( lol, lol, lol )
|
||||||
|
|
|
@ -76,27 +76,27 @@ AddItem( "base", {
|
||||||
|
|
||||||
local AnimationLookup = {
|
local AnimationLookup = {
|
||||||
["fire"] = {
|
["fire"] = {
|
||||||
["handgun"] = "fire_handgun",
|
["handgun"] = "handgun_fire",
|
||||||
["rifle"] = "rifle_fire",
|
["rifle"] = "rifle_fire",
|
||||||
},
|
},
|
||||||
["reload"] = {
|
["reload"] = {
|
||||||
["handgun"] = "reload_handgun",
|
["handgun"] = "handgun_reload",
|
||||||
["rifle"] = "rifle_reload",
|
["rifle"] = "rifle_reload",
|
||||||
},
|
},
|
||||||
["reload_rack"] = {
|
["reload_rack"] = {
|
||||||
["handgun"] = "reload_handgun_rack",
|
["handgun"] = "handgun_reload_rack",
|
||||||
["rifle"] = "rifle_reload_rack",
|
["rifle"] = "rifle_reload_rack",
|
||||||
},
|
},
|
||||||
["reload_insert"] = {
|
["reload_insert"] = {
|
||||||
["handgun"] = "reload_handgun_insert",
|
["handgun"] = "handgun_reload_insert",
|
||||||
["rifle"] = "rifle_reload_insert",
|
["rifle"] = "rifle_reload_insert",
|
||||||
},
|
},
|
||||||
["deploy"] = {
|
["deploy"] = {
|
||||||
["handgun"] = "deploy_handgun",
|
["handgun"] = "handgun_deploy",
|
||||||
["rifle"] = "rifle_deploy",
|
["rifle"] = "rifle_deploy",
|
||||||
},
|
},
|
||||||
["holster"] = {
|
["holster"] = {
|
||||||
["handgun"] = "holster_handgun",
|
["handgun"] = "handgun_holster",
|
||||||
["rifle"] = "holster_handgun",
|
["rifle"] = "holster_handgun",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -218,6 +218,7 @@ AddItem( "base_firearm", {
|
||||||
|
|
||||||
local acc = math.rad( class.Accuracy or 0 )
|
local acc = math.rad( class.Accuracy or 0 )
|
||||||
local p = handler:GetOwner()
|
local p = handler:GetOwner()
|
||||||
|
p:LagCompensation(true)
|
||||||
handler:FireBullets( {
|
handler:FireBullets( {
|
||||||
Attacker = p,
|
Attacker = p,
|
||||||
Damage = 1,
|
Damage = 1,
|
||||||
|
@ -227,6 +228,7 @@ AddItem( "base_firearm", {
|
||||||
Src = p:GetShootPos(),
|
Src = p:GetShootPos(),
|
||||||
Spread = Vector( acc, acc, 0 ),
|
Spread = Vector( acc, acc, 0 ),
|
||||||
} )
|
} )
|
||||||
|
p:LagCompensation(false)
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["fire"][class.HoldType] ), 0, true )
|
||||||
|
@ -240,36 +242,41 @@ AddItem( "base_firearm", {
|
||||||
|
|
||||||
|
|
||||||
if ent:GetDelay() > CurTime() then return end
|
if ent:GetDelay() > CurTime() then return end
|
||||||
ent:SetDelay( CurTime() + 0.6 )
|
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
|
local time = 0.6
|
||||||
|
|
||||||
if (ent:GetClip() > 0) and ent:GetSlideState() == SLIDE_BACK then
|
if (ent:GetClip() > 0) and ent:GetSlideState() == SLIDE_BACK then
|
||||||
handler:EmitSound( class.BoltDropSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.BoltDropSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetSlideState( SLIDE_FORWARD )
|
ent:SetSlideState( SLIDE_FORWARD )
|
||||||
ent:SetClip( ent:GetClip() - 1 )
|
ent:SetClip( ent:GetClip() - 1 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_rack"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_rack"][class.HoldType] ), 0, true )
|
||||||
|
time = 0.4
|
||||||
elseif (ent:GetClip() > 0) and ent:GetSlideState() == SLIDE_EMPTY then
|
elseif (ent:GetClip() > 0) and ent:GetSlideState() == SLIDE_EMPTY then
|
||||||
handler:EmitSound( class.BoltPullSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.BoltPullSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetSlideState( SLIDE_FORWARD )
|
ent:SetSlideState( SLIDE_FORWARD )
|
||||||
ent:SetClip( ent:GetClip() - 1 )
|
ent:SetClip( ent:GetClip() - 1 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_rack"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_rack"][class.HoldType] ), 0, true )
|
||||||
|
time = 0.4
|
||||||
elseif ent:GetLoaded() then
|
elseif ent:GetLoaded() then
|
||||||
handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.MagOutSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetLoaded( false )
|
ent:SetLoaded( false )
|
||||||
ent:SetClip( 0 )
|
ent:SetClip( 0 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload"][class.HoldType] ), 0, true )
|
||||||
|
time = 0.4
|
||||||
else
|
else
|
||||||
handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC )
|
handler:EmitSound( class.MagInSound, 70, 100, 0.4, CHAN_STATIC )
|
||||||
ent:SetLoaded( true )
|
ent:SetLoaded( true )
|
||||||
ent:SetRefillTime( CurTime() + 0.5 )
|
ent:SetRefillTime( CurTime() + 0.5 )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["reload_insert"][class.HoldType] ), 0, true )
|
||||||
|
time = 0.6
|
||||||
end
|
end
|
||||||
|
ent:SetDelay( CurTime() + time )
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["Deploy"] = function( class, ent, handler )
|
["Deploy"] = function( class, ent, handler )
|
||||||
handler:EmitSound( "weapons/usp/usp_slideback.wav", 70, 125, 0.4, CHAN_STATIC )
|
handler:EmitSound( "weapons/usp/usp_slideback.wav", 70, 125, 0.4, CHAN_STATIC )
|
||||||
ent:SetDelay( CurTime() + 0.25 )
|
ent:SetDelay( CurTime() + 0.5 )
|
||||||
|
|
||||||
local ply = handler:GetOwner()
|
local ply = handler:GetOwner()
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
|
||||||
|
@ -412,109 +419,316 @@ AddItem( "satchels", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
AddItem( "mk23", {
|
AddItem( "toolgun", {
|
||||||
PrintName = "#Item.mk23.Name",
|
PrintName = "#Item.toolgun.Name",
|
||||||
Description = "#Item.mk23.Description",
|
Description = "#Item.toolgun.Description",
|
||||||
Category = "pistol",
|
Category = "dev",
|
||||||
Base = "base_firearm",
|
Base = "base",
|
||||||
|
|
||||||
Model = "models/benny/weapons/testgun.mdl",
|
Model = "models/benny/weapons/testgun.mdl",
|
||||||
HoldType = "handgun",
|
HoldType = "handgun",
|
||||||
|
|
||||||
ClipSize = 12,
|
Vars = {
|
||||||
Delay = (60/350),
|
["Float"] = {
|
||||||
FireSound = {
|
"Delay",
|
||||||
"benny/weapons/usp/01.ogg",
|
},
|
||||||
"benny/weapons/usp/02.ogg",
|
["Int"] = {
|
||||||
"benny/weapons/usp/03.ogg",
|
"BurstCount",
|
||||||
},
|
},
|
||||||
MagOutSound = "benny/weapons/1911/magout.ogg",
|
|
||||||
MagInSound = "benny/weapons/1911/magin.ogg",
|
|
||||||
BoltDropSound = "benny/weapons/1911/slidedrop.ogg",
|
|
||||||
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
|
||||||
|
|
||||||
Accuracy = 5/60,
|
|
||||||
BurstCount = 1,
|
|
||||||
Accuracy_Add = 0.5,
|
|
||||||
Accuracy_Reset = 0.4,
|
|
||||||
Accuracy_Decay = 5,
|
|
||||||
})
|
|
||||||
|
|
||||||
AddItem( "fnc", {
|
|
||||||
PrintName = "#Item.fnc.Name",
|
|
||||||
Description = "#Item.fnc.Description",
|
|
||||||
Base = "base_firearm_ubgl",
|
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
|
||||||
HoldType = "rifle",
|
|
||||||
|
|
||||||
ClipSize = 30,
|
|
||||||
Delay = (60/750),
|
|
||||||
FireSound = {
|
|
||||||
"benny/weapons/m16a2/01.ogg",
|
|
||||||
"benny/weapons/m16a2/02.ogg",
|
|
||||||
"benny/weapons/m16a2/03.ogg",
|
|
||||||
},
|
},
|
||||||
|
|
||||||
Accuracy = 1,
|
["Attack"] = function( class, ent, handler )
|
||||||
Accuracy_Add = 0.4,
|
if ent:GetBurstCount() >= 1 then return end
|
||||||
Accuracy_Reset = 0.4,
|
if ent:GetDelay() > CurTime() then return end
|
||||||
Accuracy_Decay = 12,
|
ent:SetDelay( CurTime() + 0.1 )
|
||||||
|
ent:SetBurstCount( ent:GetBurstCount() + 1 )
|
||||||
|
|
||||||
|
handler:EmitSound("weapons/airboat/airboat_gun_lastshot1.wav", 100, 100, 1, CHAN_STATIC)
|
||||||
|
|
||||||
|
if SERVER then
|
||||||
|
local p = handler:GetOwner()
|
||||||
|
local tr = p:GetEyeTrace()
|
||||||
|
|
||||||
|
local summon = ents.Create( "b-npc_human" )
|
||||||
|
summon:SetPos( tr.HitPos + tr.HitNormal )
|
||||||
|
local ang = Angle( 0, p:EyeAngles().y+0, 0 )
|
||||||
|
summon:SetAngles( ang )
|
||||||
|
summon:Spawn()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
["AttackAlt"] = function( class, ent, handler )
|
||||||
|
if ent:GetDelay() > CurTime() then return end
|
||||||
|
ent:SetDelay( CurTime() + 0.5 )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Reload"] = function( class, ent, handler )
|
||||||
|
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Think"] = function( class, ent, handler )
|
||||||
|
if ent:GetBurstCount() > 0 and !handler:GetOwner():KeyDown( IN_ATTACK ) then
|
||||||
|
ent:SetBurstCount( 0 )
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Deploy"] = function( class, ent, handler )
|
||||||
|
ent:SetDelay( CurTime() + 0.5 )
|
||||||
|
|
||||||
|
local ply = handler:GetOwner()
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["deploy"][class.HoldType] ), 0, true )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Holster"] = function( class, ent, handler )
|
||||||
|
ent:SetDelay( CurTime() + 0.25 )
|
||||||
|
|
||||||
|
local ply = handler:GetOwner()
|
||||||
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_ATTACK_AND_RELOAD, ply:LookupSequence( AnimationLookup["holster"][class.HoldType] ), 0, true )
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
AddItem( "m16a2", {
|
do -- Handguns
|
||||||
PrintName = "#Item.m16a2.Name",
|
|
||||||
Description = "#Item.m16a2.Description",
|
|
||||||
Base = "base_firearm",
|
|
||||||
|
|
||||||
Model = "models/benny/weapons/testrifle3.mdl",--"models/weapons/w_rif_m16a2.mdl",
|
AddItem( "mk23", {
|
||||||
HoldType = "rifle",
|
PrintName = "#Item.mk23.Name",
|
||||||
|
Description = "#Item.mk23.Description",
|
||||||
|
Category = "pistol",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
ClipSize = 30,
|
Model = "models/benny/weapons/testgun.mdl",
|
||||||
Delay = (60/900),
|
HoldType = "handgun",
|
||||||
BurstCount = 3,
|
|
||||||
BurstRunaway = true,
|
|
||||||
BurstAuto = true,
|
|
||||||
BurstDelay = 0.2,
|
|
||||||
FireSound = {
|
|
||||||
"benny/weapons/m16a2/01.ogg",
|
|
||||||
"benny/weapons/m16a2/02.ogg",
|
|
||||||
"benny/weapons/m16a2/03.ogg",
|
|
||||||
},
|
|
||||||
|
|
||||||
Accuracy = 1,
|
ClipSize = 12,
|
||||||
Accuracy_Add = 0.4,
|
Delay = (60/350),
|
||||||
Accuracy_Reset = 0.4,
|
FireSound = {
|
||||||
Accuracy_Decay = 12,
|
"benny/weapons/usp/01.ogg",
|
||||||
})
|
"benny/weapons/usp/02.ogg",
|
||||||
|
"benny/weapons/usp/03.ogg",
|
||||||
|
},
|
||||||
|
MagOutSound = "benny/weapons/1911/magout.ogg",
|
||||||
|
MagInSound = "benny/weapons/1911/magin.ogg",
|
||||||
|
BoltDropSound = "benny/weapons/1911/slidedrop.ogg",
|
||||||
|
BoltPullSound = "benny/weapons/glock/cock.ogg",
|
||||||
|
|
||||||
AddItem( "spas12", {
|
Accuracy = 5/60,
|
||||||
PrintName = "#Item.spas12.Name",
|
BurstCount = 1,
|
||||||
Description = "#Item.spas12.Description",
|
Accuracy_Add = 0.5,
|
||||||
Base = "base_firearm",
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 5,
|
||||||
|
})
|
||||||
|
|
||||||
Model = "models/weapons/w_shotgun.mdl",
|
end
|
||||||
HoldType = "rifle",
|
|
||||||
|
|
||||||
ClipSize = 8,
|
do -- Rifles
|
||||||
Pellets = 8,
|
|
||||||
Delay = 0.4,
|
|
||||||
BurstCount = 1,
|
|
||||||
FireSound = {
|
|
||||||
"benny/weapons/spas12/01.ogg",
|
|
||||||
"benny/weapons/spas12/02.ogg",
|
|
||||||
"benny/weapons/spas12/03.ogg",
|
|
||||||
},
|
|
||||||
MagOutSound = "benny/weapons/spas12/magout-01.ogg",
|
|
||||||
MagInSound = "benny/weapons/spas12/magout-02.ogg",
|
|
||||||
BoltDropSound = "benny/weapons/spas12/magin.ogg",
|
|
||||||
BoltPullSound = "benny/weapons/glock/magin.ogg",
|
|
||||||
|
|
||||||
Accuracy = 8,
|
AddItem( "fnc", {
|
||||||
Accuracy_Add = 0.4,
|
PrintName = "#Item.fnc.Name",
|
||||||
Accuracy_Reset = 0.4,
|
Description = "#Item.fnc.Description",
|
||||||
Accuracy_Decay = 12,
|
Category = "assaultrifle",
|
||||||
})
|
Base = "base_firearm_ubgl",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 30,
|
||||||
|
Delay = (60/750),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/m16a2/01.ogg",
|
||||||
|
"benny/weapons/m16a2/02.ogg",
|
||||||
|
"benny/weapons/m16a2/03.ogg",
|
||||||
|
},
|
||||||
|
|
||||||
|
Accuracy = 1,
|
||||||
|
Accuracy_Add = 0.4,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 12,
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "qbz", {
|
||||||
|
PrintName = "#Item.qbz.Name",
|
||||||
|
Description = "#Item.qbz.Description",
|
||||||
|
Category = "assaultrifle",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 30,
|
||||||
|
Delay = (60/750),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/stoner63/01.ogg",
|
||||||
|
"benny/weapons/stoner63/02.ogg",
|
||||||
|
"benny/weapons/stoner63/03.ogg",
|
||||||
|
},
|
||||||
|
|
||||||
|
Accuracy = 1,
|
||||||
|
Accuracy_Add = 0.4,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 12,
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "m16a2", {
|
||||||
|
PrintName = "#Item.m16a2.Name",
|
||||||
|
Description = "#Item.m16a2.Description",
|
||||||
|
Category = "assaultrifle",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle3.mdl",--"models/weapons/w_rif_m16a2.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 30,
|
||||||
|
Delay = (60/900),
|
||||||
|
BurstCount = 3,
|
||||||
|
BurstRunaway = true,
|
||||||
|
BurstAuto = true,
|
||||||
|
BurstDelay = 0.2,
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/m16a2/01.ogg",
|
||||||
|
"benny/weapons/m16a2/02.ogg",
|
||||||
|
"benny/weapons/m16a2/03.ogg",
|
||||||
|
},
|
||||||
|
|
||||||
|
Accuracy = 1,
|
||||||
|
Accuracy_Add = 0.4,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 12,
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
do -- SMGs
|
||||||
|
|
||||||
|
AddItem( "tmp", {
|
||||||
|
PrintName = "#Item.tmp.Name",
|
||||||
|
Description = "#Item.tmp.Description",
|
||||||
|
Category = "smg",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "handgun",
|
||||||
|
|
||||||
|
ClipSize = 15,
|
||||||
|
Delay = (60/850),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/tmp/01.ogg",
|
||||||
|
"benny/weapons/tmp/02.ogg",
|
||||||
|
"benny/weapons/tmp/03.ogg",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "mp7", {
|
||||||
|
PrintName = "#Item.mp7.Name",
|
||||||
|
Description = "#Item.mp7.Description",
|
||||||
|
Category = "smg",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "handgun",
|
||||||
|
|
||||||
|
ClipSize = 20,
|
||||||
|
Delay = (60/950),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/mp7/01.ogg",
|
||||||
|
"benny/weapons/mp7/02.ogg",
|
||||||
|
"benny/weapons/mp7/03.ogg",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "mp5k", {
|
||||||
|
PrintName = "#Item.mp5k.Name",
|
||||||
|
Description = "#Item.mp5k.Description",
|
||||||
|
Category = "smg",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "handgun",
|
||||||
|
|
||||||
|
ClipSize = 15,
|
||||||
|
Delay = (60/750),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/mp5k/01.ogg",
|
||||||
|
"benny/weapons/mp5k/02.ogg",
|
||||||
|
"benny/weapons/mp5k/03.ogg",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "mac11", {
|
||||||
|
PrintName = "#Item.mac11.Name",
|
||||||
|
Description = "#Item.mac11.Description",
|
||||||
|
Category = "smg",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/benny/weapons/testrifle2.mdl",--"models/weapons/w_rif_ar556.mdl",
|
||||||
|
HoldType = "handgun",
|
||||||
|
|
||||||
|
ClipSize = 16,
|
||||||
|
Delay = (60/1000),
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/mac11/01.ogg",
|
||||||
|
"benny/weapons/mac11/02.ogg",
|
||||||
|
"benny/weapons/mac11/03.ogg",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
do -- Shotguns
|
||||||
|
|
||||||
|
AddItem( "spas12", {
|
||||||
|
PrintName = "#Item.spas12.Name",
|
||||||
|
Description = "#Item.spas12.Description",
|
||||||
|
Category = "shotgun",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/weapons/w_shotgun.mdl",
|
||||||
|
HoldType = "rifle",
|
||||||
|
|
||||||
|
ClipSize = 8,
|
||||||
|
Pellets = 8,
|
||||||
|
Delay = 0.4,
|
||||||
|
BurstCount = 1,
|
||||||
|
FireSound = {
|
||||||
|
"benny/weapons/spas12/01.ogg",
|
||||||
|
"benny/weapons/spas12/02.ogg",
|
||||||
|
"benny/weapons/spas12/03.ogg",
|
||||||
|
},
|
||||||
|
MagOutSound = "benny/weapons/spas12/magout-01.ogg",
|
||||||
|
MagInSound = "benny/weapons/spas12/magout-02.ogg",
|
||||||
|
BoltDropSound = "benny/weapons/spas12/magin.ogg",
|
||||||
|
BoltPullSound = "benny/weapons/glock/magin.ogg",
|
||||||
|
|
||||||
|
Accuracy = 8,
|
||||||
|
Accuracy_Add = 0.4,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 12,
|
||||||
|
})
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
-- bat
|
||||||
|
-- bat_wood
|
||||||
|
-- machete
|
||||||
|
-- kabar
|
||||||
|
-- baton
|
||||||
|
|
||||||
|
-- deagle
|
||||||
|
-- cz75a
|
||||||
|
-- glock
|
||||||
|
-- 1911
|
||||||
|
-- mk23
|
||||||
|
-- nambu
|
||||||
|
-- anaconda
|
||||||
|
|
||||||
|
-- tmp
|
||||||
|
-- mp7
|
||||||
|
-- mp5k
|
||||||
|
-- mac11
|
||||||
|
-- bizon
|
||||||
|
-- chicom
|
||||||
|
|
||||||
|
-- fnc
|
||||||
|
-- qbz
|
||||||
|
-- m16a2
|
||||||
|
|
||||||
for ID, Data in pairs(ITEMS) do
|
for ID, Data in pairs(ITEMS) do
|
||||||
local tent = {}
|
local tent = {}
|
||||||
|
|
|
@ -9,11 +9,29 @@ L["#Item.mk23.Description"] = "Special forces sidearm"
|
||||||
L["#Item.fnc.Name"] = "FNC Para"
|
L["#Item.fnc.Name"] = "FNC Para"
|
||||||
L["#Item.fnc.Description"] = "Imported assault rifle"
|
L["#Item.fnc.Description"] = "Imported assault rifle"
|
||||||
|
|
||||||
|
L["#Item.qbz.Name"] = "QBZ-95"
|
||||||
|
L["#Item.qbz.Description"] = "Low-profile bullpup assault rifle"
|
||||||
|
|
||||||
L["#Item.m16a2.Name"] = "M16A2"
|
L["#Item.m16a2.Name"] = "M16A2"
|
||||||
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
L["#Item.m16a2.Description"] = "Rugged burst rifle"
|
||||||
|
|
||||||
L["#Item.spas12.Name"] = "SPAS-12"
|
L["#Item.spas12.Name"] = "SPAS-12"
|
||||||
L["#Item.spas12.Description"] = "Chrome-lined autoshotgun"
|
L["#Item.spas12.Description"] = "Chrome-lined autoshotgun"
|
||||||
|
|
||||||
|
L["#Item.tmp.Name"] = "TMP"
|
||||||
|
L["#Item.tmp.Description"] = "Concealable machine pistol"
|
||||||
|
|
||||||
|
L["#Item.mp5k.Name"] = "MP5K"
|
||||||
|
L["#Item.mp5k.Description"] = "High-quality SMG"
|
||||||
|
|
||||||
|
L["#Item.mp7.Name"] = "MP7"
|
||||||
|
L["#Item.mp7.Description"] = "Special forces PDW"
|
||||||
|
|
||||||
|
L["#Item.mac11.Name"] = "MAC-11"
|
||||||
|
L["#Item.mac11.Description"] = "Tiny hornet gun"
|
||||||
|
|
||||||
L["#Item.satchels.Name"] = "Satchels"
|
L["#Item.satchels.Name"] = "Satchels"
|
||||||
L["#Item.satchels.Description"] = "Packs of bombs and a detonator"
|
L["#Item.satchels.Description"] = "Packs of bombs and a detonator"
|
||||||
|
|
||||||
|
L["#Item.toolgun.Name"] = "Tool gun"
|
||||||
|
L["#Item.toolgun.Description"] = "Developer tools"
|
|
@ -144,11 +144,58 @@ function GM:UpdateAnimation( ply, vel, maxseqgroundspeed )
|
||||||
normal:Rotate( Angle( 0, -ply:EyeAngles().y, 0 ) )
|
normal:Rotate( Angle( 0, -ply:EyeAngles().y, 0 ) )
|
||||||
|
|
||||||
local speed = (len2d/200)
|
local speed = (len2d/200)
|
||||||
|
|
||||||
|
--print( string.format( "x: %G, y: %G", normal.x, normal.y ))
|
||||||
|
|
||||||
|
local biggerone = math.max( math.abs(normal.x), math.abs(normal.y) )
|
||||||
|
|
||||||
|
local needer = 1+((1-biggerone)/biggerone)
|
||||||
|
normal.x = normal.x * needer
|
||||||
|
normal.y = normal.y * needer
|
||||||
|
|
||||||
|
local diveend = ply:GetLayerSequence( GESTURE_SLOT_JUMP ) == ply:LookupSequence("dive_end_handgun")
|
||||||
|
local divestart = ply:GetLayerSequence( GESTURE_SLOT_JUMP ) == ply:LookupSequence("dive_start_handgun")
|
||||||
|
|
||||||
|
if ply:GetInDive() or diveend then speed = 1 end
|
||||||
|
|
||||||
ply:SetPoseParameter( "move_x", normal.x * speed )
|
ply:SetPoseParameter( "move_x", normal.x * speed )
|
||||||
ply:SetPoseParameter( "move_y", normal.y * speed )
|
ply:SetPoseParameter( "move_y", normal.y * speed )
|
||||||
|
|
||||||
ply:SetAllowFullRotation( true )
|
local magic = ply:EyeAngles().y
|
||||||
ply:SetAngles( Angle( 0, ply:EyeAngles().y, 0 ) )
|
|
||||||
|
magic = -(magic - ply:GetRenderAngles().y)
|
||||||
|
|
||||||
|
--magic = magic % 180
|
||||||
|
|
||||||
|
if magic < -180 then
|
||||||
|
magic = magic + 360
|
||||||
|
elseif magic > 180 then
|
||||||
|
magic = magic - 360
|
||||||
|
end
|
||||||
|
|
||||||
|
magic = magic * 0.75
|
||||||
|
|
||||||
|
ply:SetPoseParameter( "aim_p", -ply:EyeAngles().p/90 )
|
||||||
|
ply:SetPoseParameter( "aim_y", 0 )--magic/90 )
|
||||||
|
|
||||||
|
|
||||||
|
ply:SetAllowFullRotation( false )
|
||||||
|
--ply:SetAngles( Angle( 0, ply:EyeAngles().y, 0 ) )
|
||||||
|
ply:SetRenderAngles( Angle( 0, ply:EyeAngles().y, 0 ) )
|
||||||
|
|
||||||
|
if diveend then
|
||||||
|
local magicnumber = ply:GetLayerCycle( GESTURE_SLOT_JUMP )
|
||||||
|
magicnumber = math.Remap( magicnumber, 0.5, 0.75, 1, 0 )
|
||||||
|
magicnumber = math.Clamp( magicnumber, 0, 1 )
|
||||||
|
ply:AnimSetGestureWeight( GESTURE_SLOT_JUMP, magicnumber )
|
||||||
|
elseif divestart then
|
||||||
|
local magicnumber = ply:GetLayerCycle( GESTURE_SLOT_JUMP )
|
||||||
|
magicnumber = math.Remap( magicnumber, 0.1, 0.6, 1, 0 )
|
||||||
|
magicnumber = math.Clamp( magicnumber, 0, 1 )
|
||||||
|
ply:AnimSetGestureWeight( GESTURE_SLOT_JUMP, magicnumber )
|
||||||
|
else
|
||||||
|
ply:AnimSetGestureWeight( GESTURE_SLOT_JUMP, 1 )
|
||||||
|
end
|
||||||
|
|
||||||
--local dir = ply:GetVelocity():GetNormalized()
|
--local dir = ply:GetVelocity():GetNormalized()
|
||||||
--local dira
|
--local dira
|
||||||
|
@ -211,7 +258,7 @@ function GM:CalcMainActivity( ply, velocity )
|
||||||
end
|
end
|
||||||
|
|
||||||
if ply:GetInDive() then
|
if ply:GetInDive() then
|
||||||
plyTable.CalcSeqOverride = ply:LookupSequence( "dive_idle" )
|
plyTable.CalcSeqOverride = ply:LookupSequence( "dive_idle_handgun" )
|
||||||
end
|
end
|
||||||
|
|
||||||
plyTable.m_bWasOnGround = ply:IsOnGround()
|
plyTable.m_bWasOnGround = ply:IsOnGround()
|
||||||
|
@ -269,8 +316,6 @@ if CLIENT then
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("Move", "Benny_Move", function( ply, mv )
|
hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
ply:SetHull( Vector( -8, -8, 0 ), Vector( 8, 8, 72 ) )
|
|
||||||
ply:SetHullDuck( Vector( -8, -8, 0 ), Vector( 8, 8, 32 ) )
|
|
||||||
if mv:KeyDown( IN_SPEED ) and !ply:GetInDive() and (ply:GetDivedAt() + 0.5 <= CurTime()) then
|
if mv:KeyDown( IN_SPEED ) and !ply:GetInDive() and (ply:GetDivedAt() + 0.5 <= CurTime()) then
|
||||||
local cool = Vector( mv:GetForwardSpeed(), -mv:GetSideSpeed(), 0 )
|
local cool = Vector( mv:GetForwardSpeed(), -mv:GetSideSpeed(), 0 )
|
||||||
cool:Normalize()
|
cool:Normalize()
|
||||||
|
@ -281,7 +326,7 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
ply:SetGroundEntity( NULL )
|
ply:SetGroundEntity( NULL )
|
||||||
ply:SetInDive( true )
|
ply:SetInDive( true )
|
||||||
ply:SetDivedAt( CurTime() )
|
ply:SetDivedAt( CurTime() )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start" ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_start_handgun" ), 0, true )
|
||||||
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
||||||
local rfil = nil
|
local rfil = nil
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
@ -291,6 +336,8 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
end
|
end
|
||||||
ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil)
|
ply:EmitSound("weapons/slam/throw.wav", 70, 100, .25, nil, nil, nil, rfil)
|
||||||
end
|
end
|
||||||
|
ply:SetHull( Vector( -8, -8, 32 ), Vector( 8, 8, 72 ) )
|
||||||
|
ply:SetHullDuck( Vector( -8, -8, 32 ), Vector( 8, 8, 48 ) )
|
||||||
end
|
end
|
||||||
if ply:OnGround() and ply:GetInDive() then
|
if ply:OnGround() and ply:GetInDive() then
|
||||||
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
if (SERVER) or (CLIENT and IsFirstTimePredicted()) then
|
||||||
|
@ -304,7 +351,12 @@ hook.Add("Move", "Benny_Move", function( ply, mv )
|
||||||
end
|
end
|
||||||
ply:SetInDive(false)
|
ply:SetInDive(false)
|
||||||
ply:SetDivedAt( CurTime() )
|
ply:SetDivedAt( CurTime() )
|
||||||
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end" ), 0, true )
|
ply:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, ply:LookupSequence( "dive_end_handgun" ), 0, true )
|
||||||
|
ply:SetHull( Vector( -8, -8, 0 ), Vector( 8, 8, 72 ) )
|
||||||
|
ply:SetHullDuck( Vector( -8, -8, 0 ), Vector( 8, 8, 48 ) )
|
||||||
|
mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) )
|
||||||
|
ply:SetGroundEntity( NULL )
|
||||||
|
mv:SetOrigin( mv:GetOrigin() + vector_up*32 )
|
||||||
end
|
end
|
||||||
--if !ply:OnGround() and ply:GetInDive() then
|
--if !ply:OnGround() and ply:GetInDive() then
|
||||||
-- local da = ply:GetDivedAt()
|
-- local da = ply:GetDivedAt()
|
||||||
|
|
Loading…
Reference in New Issue