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

View File

@ -1,12 +1,12 @@
-- Movement
local wa, wb = 0, 0
local blop = Angle()
local lastmoveangle = 0
local lastmoveangle_lerp
TPSOverride = TPSOverride or Angle()
if CLIENT then
lastmoveangle = lastmoveangle or 0
lastmoveangle_lerp = lastmoveangle_lerp or nil
TPSOverride = TPSOverride or Angle()
end
hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipState )
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 GetConVar("benny_cam_override"):GetString() != "" 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 ) )
return true
end
@ -50,8 +50,6 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd )
x, y = ly * -320, lx * 320
end
wa, wb = x, y
local ad = Vector( x, y, 0 )
local an = Angle()

View File

@ -38,6 +38,18 @@ local MAXVAULTHEIGHT = 64
local MAXVAULTHEIGHT_FUCKERY = MAXVAULTHEIGHT+1
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 )
local ang = mv:GetMoveAngles()
local pos = mv:GetOrigin()
@ -166,5 +178,38 @@ hook.Add( "Move", "Benny_Move", function( ply, mv )
mv:SetMaxSpeed( targetspeed )
mv:SetMaxClientSpeed( targetspeed )
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 )
end)

View File

@ -23,17 +23,19 @@ PLAYER.AvoidPlayers = true
PLAYER.UseVMHands = true
function PLAYER:SetupDataTables()
self.Player:NetworkVar( "Bool", 0, "Shoulder" )
self.Player:NetworkVar( "Float", 0, "VaultDebuff" )
self.Player:NetworkVar( "Bool", 0, "Shoulder" )
self.Player:NetworkVar( "Float", 1, "VaultTransition" )
self.Player:NetworkVar( "Vector", 0, "VaultPos1")
self.Player:NetworkVar( "Vector", 1, "VaultPos2")
self.Player:NetworkVar( "Float", 2, "Stamina" )
self.Player:NetworkVar( "Int", 0, "JumpBoost" )
self.Player:NetworkVar( "String", 0, "ReqID1")
self.Player:NetworkVar( "String", 1, "ReqID2")
self.Player:NetworkVar( "Float", 0, "VaultDebuff" )
self.Player:NetworkVar( "Float", 1, "VaultTransition" )
self.Player:NetworkVar( "Float", 2, "Stamina" )
self.Player:NetworkVar( "Vector", 0, "VaultPos1")
self.Player:NetworkVar( "Vector", 1, "VaultPos2")
self.Player:NetworkVar( "String", 0, "ReqID1")
self.Player:NetworkVar( "String", 1, "ReqID2")
end
player_manager.RegisterClass( "player_benny", PLAYER, "player_default" )