mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-04-05 18:36:33 +05:00
Push leg fix (closes #4)
This commit is contained in:
parent
234bd45a87
commit
44842541be
3 changed files with 47 additions and 44 deletions
|
@ -412,10 +412,24 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function()
|
|||
end)
|
||||
|
||||
spawnmenu.AddToolMenuOption("Beatrun", "Server", "beatrun_serverfun", "Fun", "", "", function(panel)
|
||||
local funoptions = vgui.Create("DForm")
|
||||
local experimentals = vgui.Create("DForm")
|
||||
panel:ClearControls()
|
||||
panel:SetName("Fun/Experimental Settings")
|
||||
|
||||
panel:CheckBox("Cruelty Parkour (?)", "Beatrun_CrueltyParkour")
|
||||
panel:ControlHelp("\"Funny\" optional feature that blocks some parkour moves and changes some moves\' behavior with a different weapon out.")
|
||||
panel:Help("Some settings that may not be very practical, are very hacky or are just for fun.")
|
||||
panel:ControlHelp("Note: For checkboxes, ticked is ON and unticked/empty box is OFF.")
|
||||
|
||||
panel:AddItem(funoptions)
|
||||
panel:AddItem(experimentals)
|
||||
|
||||
funoptions:SetName("The Fun Options™")
|
||||
|
||||
funoptions:CheckBox("Cruelty Parkour (?)", "Beatrun_CrueltyParkour")
|
||||
funoptions:ControlHelp("\"Funny\" optional feature that blocks some parkour moves and changes some moves\' behavior with a different weapon out.")
|
||||
|
||||
experimentals:SetName("Experimental Things™")
|
||||
experimentals:CheckBox("\"Slippy Wallruns\"", "Beatrun_Experimentals_SlippyWallrun")
|
||||
experimentals:ControlHelp("You randomly drop from wallruns with a different weapon out. Requires Cruelty Parkour to be ON.")
|
||||
end)
|
||||
end)
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
CrueltyParkour = CreateConVar("Beatrun_CrueltyParkour", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Also known as \"Cruelty Mode\".\nDisables some Beatrun parkour abilities using anything but the Beatrun hands when enabled.", 0, 1)
|
||||
CrueltyParkour = CreateConVar("Beatrun_CrueltyParkour", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Also known as \"Cruelty Mode\".\nDisables some Beatrun parkour abilities using anything but the Beatrun hands when enabled.", 0, 1)
|
||||
|
||||
SlippyWallrun = CreateConVar("Beatrun_Experimentals_SlippyWallrun", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Makes your wallrun slippy. Only usable with Cruelty Parkour on.", 0, 1)
|
|
@ -20,39 +20,41 @@ local function SwingbarCheck(ply, mv, cmd)
|
|||
util.TraceHull(tr)
|
||||
|
||||
if IsValid(trout.Entity) and trout.Entity:GetClass() == "br_swingbar" and (ply:GetSwingbarLast() ~= trout.Entity or ply:GetSBDelay() < CurTime()) then
|
||||
local swingbar = trout.Entity
|
||||
local dot = cmd:GetViewAngles():Forward():Dot(swingbar:GetAngles():Forward())
|
||||
local dir = dot > 0 and true or false
|
||||
if CrueltyParkour:GetBool() and !ply:UsingRH() then
|
||||
local swingbar = trout.Entity
|
||||
local dot = cmd:GetViewAngles():Forward():Dot(swingbar:GetAngles():Forward())
|
||||
local dir = dot > 0 and true or false
|
||||
|
||||
if math.abs(dot) < 0.7 then return end
|
||||
if math.abs(dot) < 0.7 then return end
|
||||
|
||||
|
||||
if CLIENT then
|
||||
swingbar:SetPredictable(true)
|
||||
end
|
||||
if CLIENT then
|
||||
swingbar:SetPredictable(true)
|
||||
end
|
||||
|
||||
ply:SetSwingbar(swingbar)
|
||||
ply:SetWallrunTime(0)
|
||||
ply:SetWallrunCount(0)
|
||||
ply:SetSBDir(dir)
|
||||
ply:SetSBStartLerp(0)
|
||||
ply:SetSBOffset(30)
|
||||
ply:SetSBPeak(0)
|
||||
ply:SetDive(false)
|
||||
ply:SetCrouchJump(false)
|
||||
ply:SetSwingbar(swingbar)
|
||||
ply:SetWallrunTime(0)
|
||||
ply:SetWallrunCount(0)
|
||||
ply:SetSBDir(dir)
|
||||
ply:SetSBStartLerp(0)
|
||||
ply:SetSBOffset(30)
|
||||
ply:SetSBPeak(0)
|
||||
ply:SetDive(false)
|
||||
ply:SetCrouchJump(false)
|
||||
|
||||
ParkourEvent("swingbar", ply)
|
||||
ParkourEvent("swingbar", ply)
|
||||
|
||||
mv:SetVelocity(vector_origin)
|
||||
mv:SetVelocity(vector_origin)
|
||||
|
||||
if mv:KeyDown(IN_FORWARD) or mv:GetVelocity():Length() > 150 then
|
||||
ply:SetSBOffsetSpeed(2)
|
||||
else
|
||||
ply:SetSBOffsetSpeed(0)
|
||||
end
|
||||
if mv:KeyDown(IN_FORWARD) or mv:GetVelocity():Length() > 150 then
|
||||
ply:SetSBOffsetSpeed(2)
|
||||
else
|
||||
ply:SetSBOffsetSpeed(0)
|
||||
end
|
||||
|
||||
if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then
|
||||
ply:EmitSound("Handsteps.ConcreteHard")
|
||||
if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then
|
||||
ply:EmitSound("Handsteps.ConcreteHard")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -137,7 +139,7 @@ local function SwingbarThink(ply, mv, cmd)
|
|||
|
||||
offset = ply:GetSBOffset()
|
||||
|
||||
if mv:KeyPressed(IN_JUMP) or mv:KeyDown(IN_JUMP) and offset > 90 then
|
||||
if mv:KeyPressed(IN_JUMP) or mv:KeyDown(IN_JUMP) and offset > 90 or (CrueltyParkour:GetBool() and !ply:UsingRH()) then
|
||||
print("ONE")
|
||||
ParkourEvent("swingjump", ply)
|
||||
|
||||
|
@ -189,21 +191,6 @@ local function Swingbar(ply, mv, cmd)
|
|||
if IsValid(ply:GetSwingbar()) then
|
||||
SwingbarThink(ply, mv, cmd)
|
||||
end
|
||||
|
||||
if CrueltyParkour:GetBool() and !ply:UsingRH() then
|
||||
ParkourEvent("swingjump", ply)
|
||||
|
||||
local ang = cmd:GetViewAngles()
|
||||
ang.x = 0
|
||||
|
||||
ply:SetMoveType(MOVETYPE_WALK)
|
||||
ply:SetSwingbarLast(ply:GetSwingbar())
|
||||
ply:SetSwingbar(nil)
|
||||
ply:SetWallrunDir(dummyvec)
|
||||
|
||||
ply:SetMEMoveLimit(GetConVar("Beatrun_SpeedLimit"):GetInt())
|
||||
ply:SetMESprintDelay(-1)
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("SetupMove", "Swingbar", Swingbar)
|
Loading…
Add table
Reference in a new issue