diff --git a/beatrun/gamemodes/beatrun/gamemode/init.lua b/beatrun/gamemodes/beatrun/gamemode/init.lua index f28854c..17576c2 100644 --- a/beatrun/gamemodes/beatrun/gamemode/init.lua +++ b/beatrun/gamemodes/beatrun/gamemode/init.lua @@ -6,6 +6,10 @@ for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME")) do AddCSLuaFile("cl/" .. v) end +if SERVER then + include("preexecute/server.lua") +end + for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME")) do AddCSLuaFile("sh/" .. v) include("sh/" .. v) diff --git a/beatrun/gamemodes/beatrun/gamemode/preexecute/server.lua b/beatrun/gamemodes/beatrun/gamemode/preexecute/server.lua new file mode 100644 index 0000000..0ac2392 --- /dev/null +++ b/beatrun/gamemodes/beatrun/gamemode/preexecute/server.lua @@ -0,0 +1 @@ +-- This file does nothing for now. \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua b/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua new file mode 100644 index 0000000..6c6c7fc --- /dev/null +++ b/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua @@ -0,0 +1 @@ +RunnerHandsOnly = CreateConVar("Beatrun_RunnerHandsOnly", 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) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua index 9a77cac..8092d26 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Climb.lua @@ -784,4 +784,10 @@ hook.Add("SetupMove", "Climbing", function(ply, mv, cmd) if ply:GetClimbing() ~= 0 then ClimbingThink(ply, mv, cmd) end +end) + +hook.Add("PlayerSwitchWeapon", "NoSwitchForClimbers", function(ply) + if ply:GetClimbing() != 0 then + return true + end end) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua index 87e1516..17c25bd 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua @@ -73,29 +73,32 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) local dist = trout.HitPos:DistToSqr(mv:GetOrigin()) if trout.Fraction > 0 and dist < 2750000 and dist > 90000 and mv:KeyPressed(IN_JUMP) then - local vel = mv:GetVelocity() - vel.z = -math.abs(vel.z) + if RunnerHandsOnly:GetBool() and !ply:UsingRH() then + else + local vel = mv:GetVelocity() + vel.z = -math.abs(vel.z) - mv:SetVelocity(vel) + mv:SetVelocity(vel) - ply:SetGrapplePos(trout.HitPos) - ply:SetGrappling(true) - ply:SetGrappleLength(mv:GetOrigin():Distance(trout.HitPos)) - ply:SetWallrunCount(0) - ply:SetJumpTurn(false) - ply:SetCrouchJumpBlocked(false) - ply:SetNW2Entity("grappleEntity", trout.Entity) - ply:SetNW2Bool("grappledNonCourse", true) + ply:SetGrapplePos(trout.HitPos) + ply:SetGrappling(true) + ply:SetGrappleLength(mv:GetOrigin():Distance(trout.HitPos)) + ply:SetWallrunCount(0) + ply:SetJumpTurn(false) + ply:SetCrouchJumpBlocked(false) + ply:SetNW2Entity("grappleEntity", trout.Entity) + ply:SetNW2Bool("grappledNonCourse", true) - if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then - ply:EmitSound("mirrorsedge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10)) + if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then + ply:EmitSound("mirrorsedge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10)) + end + + ply:ViewPunch(zpunchstart) + + grappled = true + + ply.GrappleLengthOld = ply:GetGrappleLength() end - - ply:ViewPunch(zpunchstart) - - grappled = true - - ply.GrappleLengthOld = ply:GetGrappleLength() end end diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Swingbar.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Swingbar.lua index 814d10f..f3a8c95 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Swingbar.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Swingbar.lua @@ -138,6 +138,7 @@ local function SwingbarThink(ply, mv, cmd) offset = ply:GetSBOffset() if mv:KeyPressed(IN_JUMP) or mv:KeyDown(IN_JUMP) and offset > 90 then + print("ONE") ParkourEvent("swingjump", ply) if mv:KeyPressed(IN_JUMP) and offset > 90 then @@ -188,6 +189,21 @@ local function Swingbar(ply, mv, cmd) if IsValid(ply:GetSwingbar()) then SwingbarThink(ply, mv, cmd) end + + if RunnerHandsOnly: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) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua index 6bc0162..fc1287a 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Vaulting.lua @@ -774,4 +774,12 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd) mv:SetButtons(0) end end +end) + +hook.Add("PlayerSwitchWeapon", "NoWeaponWhileMantling", function(ply) + if ply:GetMantle() == 5 then + -- You are still mantling at this state, don't pull an SMG + -- out of your back pocket + return true + end end) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua index b956f17..be869c0 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Wallrun.lua @@ -522,12 +522,15 @@ end local vecdir = Vector(1000, 1000, 1000) hook.Add("SetupMove", "Wallrunning", function(ply, mv, cmd) - if ply:GetWallrun() == nil or not ply:Alive() then + if ply:GetWallrun() == nil or not ply:Alive() or (RunnerHandsOnly:GetBool() and !(ply:UsingRH())) then ply:SetWallrun(0) end if ply:GetWallrun() == 0 and mv:GetVelocity().z > -450 and not ply:OnGround() and mv:KeyDown(IN_FORWARD) and not ply:Crouching() and not mv:KeyDown(IN_DUCK) and ply:GetMoveType() ~= MOVETYPE_NOCLIP and ply:WaterLevel() < 1 then - WallrunningCheck(ply, mv, cmd) + if (RunnerHandsOnly:GetBool() and (ply:GetActiveWeapon():GetClass() != "runnerhands")) then + else + WallrunningCheck(ply, mv, cmd) + end end if ply:GetWallrun() ~= 0 then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua index 4774bbd..187679a 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Zipline.lua @@ -138,7 +138,7 @@ local function ZiplineThink(ply, mv, cmd, zipline) dir:Mul(-1) end - if fraction >= 1 or cmd:KeyDown(IN_DUCK) then + if fraction >= 1 or cmd:KeyDown(IN_DUCK) or (RunnerHandsOnly:GetBool() and !ply:UsingRH()) then ply:SetZipline(nil) ply:SetMoveType(MOVETYPE_WALK) ply:SetCrouchJumpBlocked(true) diff --git a/beatrun/gamemodes/beatrun/gamemode/shared.lua b/beatrun/gamemodes/beatrun/gamemode/shared.lua index 79c9f8b..053fe8d 100644 --- a/beatrun/gamemodes/beatrun/gamemode/shared.lua +++ b/beatrun/gamemodes/beatrun/gamemode/shared.lua @@ -9,6 +9,8 @@ GM.Website = "www.mirrorsedge.com xd" include("player_class/player_beatrun.lua") +include("preexecute/shared.lua") + for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do AddCSLuaFile("sh/" .. v) include("sh/" .. v)