mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-02-28 17:29:37 +05:00
Work-in-progress Cruelty Parkour™
This commit is contained in:
parent
865b2b9e28
commit
2a9e7a01bd
10 changed files with 66 additions and 22 deletions
|
@ -6,6 +6,10 @@ for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME")) do
|
||||||
AddCSLuaFile("cl/" .. v)
|
AddCSLuaFile("cl/" .. v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if SERVER then
|
||||||
|
include("preexecute/server.lua")
|
||||||
|
end
|
||||||
|
|
||||||
for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME")) do
|
for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME")) do
|
||||||
AddCSLuaFile("sh/" .. v)
|
AddCSLuaFile("sh/" .. v)
|
||||||
include("sh/" .. v)
|
include("sh/" .. v)
|
||||||
|
|
1
beatrun/gamemodes/beatrun/gamemode/preexecute/server.lua
Normal file
1
beatrun/gamemodes/beatrun/gamemode/preexecute/server.lua
Normal file
|
@ -0,0 +1 @@
|
||||||
|
-- This file does nothing for now.
|
1
beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua
Normal file
1
beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua
Normal file
|
@ -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)
|
|
@ -785,3 +785,9 @@ hook.Add("SetupMove", "Climbing", function(ply, mv, cmd)
|
||||||
ClimbingThink(ply, mv, cmd)
|
ClimbingThink(ply, mv, cmd)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
hook.Add("PlayerSwitchWeapon", "NoSwitchForClimbers", function(ply)
|
||||||
|
if ply:GetClimbing() != 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end)
|
|
@ -73,29 +73,32 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
local dist = trout.HitPos:DistToSqr(mv:GetOrigin())
|
local dist = trout.HitPos:DistToSqr(mv:GetOrigin())
|
||||||
|
|
||||||
if trout.Fraction > 0 and dist < 2750000 and dist > 90000 and mv:KeyPressed(IN_JUMP) then
|
if trout.Fraction > 0 and dist < 2750000 and dist > 90000 and mv:KeyPressed(IN_JUMP) then
|
||||||
local vel = mv:GetVelocity()
|
if RunnerHandsOnly:GetBool() and !ply:UsingRH() then
|
||||||
vel.z = -math.abs(vel.z)
|
else
|
||||||
|
local vel = mv:GetVelocity()
|
||||||
|
vel.z = -math.abs(vel.z)
|
||||||
|
|
||||||
mv:SetVelocity(vel)
|
mv:SetVelocity(vel)
|
||||||
|
|
||||||
ply:SetGrapplePos(trout.HitPos)
|
ply:SetGrapplePos(trout.HitPos)
|
||||||
ply:SetGrappling(true)
|
ply:SetGrappling(true)
|
||||||
ply:SetGrappleLength(mv:GetOrigin():Distance(trout.HitPos))
|
ply:SetGrappleLength(mv:GetOrigin():Distance(trout.HitPos))
|
||||||
ply:SetWallrunCount(0)
|
ply:SetWallrunCount(0)
|
||||||
ply:SetJumpTurn(false)
|
ply:SetJumpTurn(false)
|
||||||
ply:SetCrouchJumpBlocked(false)
|
ply:SetCrouchJumpBlocked(false)
|
||||||
ply:SetNW2Entity("grappleEntity", trout.Entity)
|
ply:SetNW2Entity("grappleEntity", trout.Entity)
|
||||||
ply:SetNW2Bool("grappledNonCourse", true)
|
ply:SetNW2Bool("grappledNonCourse", true)
|
||||||
|
|
||||||
if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then
|
if CLIENT and IsFirstTimePredicted() or game.SinglePlayer() then
|
||||||
ply:EmitSound("mirrorsedge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10))
|
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
|
end
|
||||||
|
|
||||||
ply:ViewPunch(zpunchstart)
|
|
||||||
|
|
||||||
grappled = true
|
|
||||||
|
|
||||||
ply.GrappleLengthOld = ply:GetGrappleLength()
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -138,6 +138,7 @@ local function SwingbarThink(ply, mv, cmd)
|
||||||
offset = ply:GetSBOffset()
|
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 then
|
||||||
|
print("ONE")
|
||||||
ParkourEvent("swingjump", ply)
|
ParkourEvent("swingjump", ply)
|
||||||
|
|
||||||
if mv:KeyPressed(IN_JUMP) and offset > 90 then
|
if mv:KeyPressed(IN_JUMP) and offset > 90 then
|
||||||
|
@ -188,6 +189,21 @@ local function Swingbar(ply, mv, cmd)
|
||||||
if IsValid(ply:GetSwingbar()) then
|
if IsValid(ply:GetSwingbar()) then
|
||||||
SwingbarThink(ply, mv, cmd)
|
SwingbarThink(ply, mv, cmd)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
hook.Add("SetupMove", "Swingbar", Swingbar)
|
hook.Add("SetupMove", "Swingbar", Swingbar)
|
|
@ -775,3 +775,11 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd)
|
||||||
end
|
end
|
||||||
end
|
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)
|
|
@ -522,12 +522,15 @@ end
|
||||||
local vecdir = Vector(1000, 1000, 1000)
|
local vecdir = Vector(1000, 1000, 1000)
|
||||||
|
|
||||||
hook.Add("SetupMove", "Wallrunning", function(ply, mv, cmd)
|
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)
|
ply:SetWallrun(0)
|
||||||
end
|
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
|
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
|
end
|
||||||
|
|
||||||
if ply:GetWallrun() ~= 0 then
|
if ply:GetWallrun() ~= 0 then
|
||||||
|
|
|
@ -138,7 +138,7 @@ local function ZiplineThink(ply, mv, cmd, zipline)
|
||||||
dir:Mul(-1)
|
dir:Mul(-1)
|
||||||
end
|
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:SetZipline(nil)
|
||||||
ply:SetMoveType(MOVETYPE_WALK)
|
ply:SetMoveType(MOVETYPE_WALK)
|
||||||
ply:SetCrouchJumpBlocked(true)
|
ply:SetCrouchJumpBlocked(true)
|
||||||
|
|
|
@ -9,6 +9,8 @@ GM.Website = "www.mirrorsedge.com xd"
|
||||||
|
|
||||||
include("player_class/player_beatrun.lua")
|
include("player_class/player_beatrun.lua")
|
||||||
|
|
||||||
|
include("preexecute/shared.lua")
|
||||||
|
|
||||||
for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do
|
for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do
|
||||||
AddCSLuaFile("sh/" .. v)
|
AddCSLuaFile("sh/" .. v)
|
||||||
include("sh/" .. v)
|
include("sh/" .. v)
|
||||||
|
|
Loading…
Reference in a new issue