diff --git a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua index 7f76eec..230b6dc 100644 --- a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua @@ -223,14 +223,16 @@ function SWEP:Think() local eyeang = ply:EyeAngles() eyeang.x = 0 - if insidestep and viewmodel:GetCycle() <= 0.1 and GetConVar("Beatrun_QuakeJump"):GetBool() then - if SERVER then - ply:EmitSound("quakejump.mp3", 100, 100, 0.2) + if insidestep and GetConVar("Beatrun_QuakeJump"):GetBool() then + if (!GetConVar("Beatrun_QuakeJump_Timing"):GetBool() and viewmodel:GetCycle() <= 0.1) or ply:GetNWBool("Beatrun_ExtraQuakeJumpTiming") then + if SERVER then + ply:EmitSound("quakejump.mp3", 100, 100, 0.2) + end + + ply.QuakeJumping = true + + self:SetQuakeJumping(true) end - - ply.QuakeJumping = true - - self:SetQuakeJumping(true) end if not ismoving and not ply:Crouching() then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua b/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua index 59463a5..8252eba 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua @@ -1,6 +1,8 @@ local quakejump = CreateConVar("Beatrun_QuakeJump", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) local sidestep = CreateConVar("Beatrun_SideStep", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) local speed_limit = CreateConVar("Beatrun_SpeedLimit", 325, {FCVAR_REPLICATED, FCVAR_ARCHIVE}) +beatrunquakejumptiming = CreateConVar("Beatrun_QuakeJump_Timing", 0, {FCVAR_REPLICATED, FCVAR_ARCHIVE}, "Quakejump extra timing window in engine ticks (default 66).") +-- This NEEDS to be accessible from runnerhands' code. local function Hardland(jt) local ply = LocalPlayer() @@ -309,6 +311,14 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd) activewep:SetSideStep(true) mv:SetVelocity(cmd:GetViewAngles():Right() * -(speed_limit:GetInt() * 1.8)) + if beatrunquakejumptiming:GetInt() != 0 then + ply:SetNWBool("Beatrun_ExtraQuakeJumpTiming", true) + ply:SetFriction(ply:GetFriction() * 0.01) + timer.Simple((engine.TickInterval() * beatrunquakejumptiming:GetInt()), function() + ply:SetFriction(ply:GetFriction() / 0.01) + ply:SetNWBool("Beatrun_ExtraQuakeJumpTiming", false) + end) + end ply:ViewPunch(Angle(-3, 0, -4.5)) @@ -324,6 +334,14 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd) activewep:SetSideStep(true) mv:SetVelocity(cmd:GetViewAngles():Right() * (speed_limit:GetInt() * 1.8)) + if beatrunquakejumptiming:GetInt() != 0 then + ply:SetNWBool("Beatrun_ExtraQuakeJumpTiming", true) + ply:SetFriction(ply:GetFriction() * 0.01) + timer.Simple((engine.TickInterval() * beatrunquakejumptiming:GetInt()), function() + ply:SetFriction(ply:GetFriction() / 0.01) + ply:SetNWBool("Beatrun_ExtraQuakeJumpTiming", false) + end) + end ply:ViewPunch(Angle(-3, 0, 4.5)) @@ -424,4 +442,15 @@ if CLIENT then ArmInterrupt("doorbash") LocalPlayer():CLViewPunch(Angle(1.5, -0.75, 0)) end) +end + +if SERVER then + concommand.Add( + "Beatrun_ResetFriction", + function() + for _, ply in ipairs(player.GetAll()) do + ply:SetFriction(1) + end + end + ) end \ No newline at end of file