Specialists-style stunt move!

This commit is contained in:
Fesiug 2024-01-03 21:09:27 -05:00
parent b973b4da70
commit 0fcac41f40
4 changed files with 65 additions and 20 deletions

View File

@ -246,7 +246,7 @@ local lonk = {
Spacer = true, Spacer = true,
}, },
{ {
Glyph = "SPACE", Glyph = "SHIFT",
Text1 = "STUNT", Text1 = "STUNT",
Text2 = "Do a barrel roll", Text2 = "Do a barrel roll",
}, },
@ -306,8 +306,8 @@ item_selected = item_selected or 1
hook.Add( "HUDPaint", "Benny_HUDPaint", function() hook.Add( "HUDPaint", "Benny_HUDPaint", function()
local sw, sh = ScrW(), ScrH() local sw, sh = ScrW(), ScrH()
local Wb = ss(20) local Wb = sh*0.05--ss(20)
local Hb = ss(20) local Hb = sh*0.05--ss(20)
-- Wb = (sh*(4/3)) -- Wb = (sh*(4/3))
-- Wb = (sw-Wb)/2 -- Wb = (sw-Wb)/2

View File

@ -1,12 +1,12 @@
-- Movement -- Movement
local wa, wb = 0, 0
local blop = Angle() local blop = Angle()
local lastmoveangle = 0 if CLIENT then
local lastmoveangle_lerp lastmoveangle = lastmoveangle or 0
TPSOverride = TPSOverride or Angle() lastmoveangle_lerp = lastmoveangle_lerp or nil
TPSOverride = TPSOverride or Angle()
end
hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipState ) hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipState )
if CLIENT then if CLIENT then
@ -28,7 +28,7 @@ hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang )
if w and w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end if w and w:bWepClass( true ) and w:bWepClass( true ).Custom_DisableSpecialMovement and w:bWepClass( true ).Custom_DisableSpecialMovement( w ) then cdis = true end
if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end if GetConVar("benny_cam_override"):GetString() != "" then cdis = true end
if p:NoclippingAndNotVaulting() then cdis = true end if p:NoclippingAndNotVaulting() then cdis = true end
if w and !cdis then if w and !cdis and (y!=0 or x!=0) then
TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) ) TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) )
return true return true
end end
@ -50,8 +50,6 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd )
x, y = ly * -320, lx * 320 x, y = ly * -320, lx * 320
end end
wa, wb = x, y
local ad = Vector( x, y, 0 ) local ad = Vector( x, y, 0 )
local an = Angle() local an = Angle()

View File

@ -38,6 +38,18 @@ local MAXVAULTHEIGHT = 64
local MAXVAULTHEIGHT_FUCKERY = MAXVAULTHEIGHT+1 local MAXVAULTHEIGHT_FUCKERY = MAXVAULTHEIGHT+1
local MAXVAULTHEIGHT_V = Vector( 0, 0, MAXVAULTHEIGHT_FUCKERY ) local MAXVAULTHEIGHT_V = Vector( 0, 0, MAXVAULTHEIGHT_FUCKERY )
if CLIENT then
hook.Add( "CreateMove", "Benny_ADV_CreateMove", function( cmd )
local ply = LocalPlayer()
if ply:KeyDown( IN_SPEED ) then
cmd:AddKey( IN_ALT1 )
end
end)
end
hook.Add( "StartCommand", "Benny_StartCommand", function( ply, cmd )
end)
hook.Add( "Move", "Benny_Move", function( ply, mv ) hook.Add( "Move", "Benny_Move", function( ply, mv )
local ang = mv:GetMoveAngles() local ang = mv:GetMoveAngles()
local pos = mv:GetOrigin() local pos = mv:GetOrigin()
@ -166,5 +178,38 @@ hook.Add( "Move", "Benny_Move", function( ply, mv )
mv:SetMaxSpeed( targetspeed ) mv:SetMaxSpeed( targetspeed )
mv:SetMaxClientSpeed( targetspeed ) mv:SetMaxClientSpeed( targetspeed )
end end
if ply:GetJumpBoost() == 0 then
if mv:KeyDown( IN_ALT1 ) then
local dig = Vector( mv:GetForwardSpeed()+0.01, mv:GetSideSpeed(), 0 ):GetNormalized()
local dug = Angle( 0, ply:EyeAngles().y, 0 )
ply:SetGroundEntity( NULL )
local upspeed = 100
local movespeed = 200
local pitch = ply:EyeAngles().p
if pitch < -15 then
upspeed = 250
movespeed = 320
elseif pitch < 15 then
upspeed = 150
movespeed = 260
end
dig:Mul( movespeed )
mv:SetVelocity( dug:Forward()*dig.x + dug:Right()*dig.y + (vector_up*upspeed) )
ply:AddFlags( FL_ANIMDUCKING )
ply:SetJumpBoost( 1 )
if CLIENT and IsFirstTimePredicted() then
ply:EmitSound( "weapons/slam/throw.wav", 70, 200, 0.5 )
end
end
elseif ply:OnGround() then
if mv:KeyDown( IN_ALT1 ) then
ply:SetJumpBoost( -1 )
else
ply:SetJumpBoost( 0 )
end
ply:RemoveFlags( FL_ANIMDUCKING )
end
--debugoverlay.Box( Target+(TargetNor*16), ba, bb, 0, CR ) --debugoverlay.Box( Target+(TargetNor*16), ba, bb, 0, CR )
end) end)

View File

@ -24,14 +24,16 @@ PLAYER.UseVMHands = true
function PLAYER:SetupDataTables() function PLAYER:SetupDataTables()
self.Player:NetworkVar( "Bool", 0, "Shoulder" ) self.Player:NetworkVar( "Bool", 0, "Shoulder" )
self.Player:NetworkVar( "Float", 0, "VaultDebuff" )
self.Player:NetworkVar( "Int", 0, "JumpBoost" )
self.Player:NetworkVar( "Float", 0, "VaultDebuff" )
self.Player:NetworkVar( "Float", 1, "VaultTransition" ) self.Player:NetworkVar( "Float", 1, "VaultTransition" )
self.Player:NetworkVar( "Float", 2, "Stamina" )
self.Player:NetworkVar( "Vector", 0, "VaultPos1") self.Player:NetworkVar( "Vector", 0, "VaultPos1")
self.Player:NetworkVar( "Vector", 1, "VaultPos2") self.Player:NetworkVar( "Vector", 1, "VaultPos2")
self.Player:NetworkVar( "Float", 2, "Stamina" )
self.Player:NetworkVar( "String", 0, "ReqID1") self.Player:NetworkVar( "String", 0, "ReqID1")
self.Player:NetworkVar( "String", 1, "ReqID2") self.Player:NetworkVar( "String", 1, "ReqID2")
end end