mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
Add extended long jump timing (optional)
This commit is contained in:
parent
3907207dc9
commit
9be0ee2c6b
2 changed files with 38 additions and 7 deletions
|
@ -223,14 +223,16 @@ function SWEP:Think()
|
||||||
local eyeang = ply:EyeAngles()
|
local eyeang = ply:EyeAngles()
|
||||||
eyeang.x = 0
|
eyeang.x = 0
|
||||||
|
|
||||||
if insidestep and viewmodel:GetCycle() <= 0.1 and GetConVar("Beatrun_QuakeJump"):GetBool() then
|
if insidestep and GetConVar("Beatrun_QuakeJump"):GetBool() then
|
||||||
if SERVER then
|
if (!GetConVar("Beatrun_QuakeJump_Timing"):GetBool() and viewmodel:GetCycle() <= 0.1) or ply:GetNWBool("Beatrun_ExtraQuakeJumpTiming") then
|
||||||
ply:EmitSound("quakejump.mp3", 100, 100, 0.2)
|
if SERVER then
|
||||||
|
ply:EmitSound("quakejump.mp3", 100, 100, 0.2)
|
||||||
|
end
|
||||||
|
|
||||||
|
ply.QuakeJumping = true
|
||||||
|
|
||||||
|
self:SetQuakeJumping(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
ply.QuakeJumping = true
|
|
||||||
|
|
||||||
self:SetQuakeJumping(true)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ismoving and not ply:Crouching() then
|
if not ismoving and not ply:Crouching() then
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
local quakejump = CreateConVar("Beatrun_QuakeJump", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
|
local quakejump = CreateConVar("Beatrun_QuakeJump", 1, {FCVAR_REPLICATED, FCVAR_ARCHIVE})
|
||||||
local sidestep = CreateConVar("Beatrun_SideStep", 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})
|
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 function Hardland(jt)
|
||||||
local ply = LocalPlayer()
|
local ply = LocalPlayer()
|
||||||
|
@ -309,6 +311,14 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
|
||||||
activewep:SetSideStep(true)
|
activewep:SetSideStep(true)
|
||||||
|
|
||||||
mv:SetVelocity(cmd:GetViewAngles():Right() * -(speed_limit:GetInt() * 1.8))
|
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))
|
ply:ViewPunch(Angle(-3, 0, -4.5))
|
||||||
|
|
||||||
|
@ -324,6 +334,14 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
|
||||||
activewep:SetSideStep(true)
|
activewep:SetSideStep(true)
|
||||||
|
|
||||||
mv:SetVelocity(cmd:GetViewAngles():Right() * (speed_limit:GetInt() * 1.8))
|
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))
|
ply:ViewPunch(Angle(-3, 0, 4.5))
|
||||||
|
|
||||||
|
@ -424,4 +442,15 @@ if CLIENT then
|
||||||
ArmInterrupt("doorbash")
|
ArmInterrupt("doorbash")
|
||||||
LocalPlayer():CLViewPunch(Angle(1.5, -0.75, 0))
|
LocalPlayer():CLViewPunch(Angle(1.5, -0.75, 0))
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
if SERVER then
|
||||||
|
concommand.Add(
|
||||||
|
"Beatrun_ResetFriction",
|
||||||
|
function()
|
||||||
|
for _, ply in ipairs(player.GetAll()) do
|
||||||
|
ply:SetFriction(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
Loading…
Reference in a new issue