Skip to content

Commit 87ef61f

Browse files
committed
cleanup
remove commented stuff
1 parent c6cf52e commit 87ef61f

File tree

11 files changed

+145
-207
lines changed

11 files changed

+145
-207
lines changed

gamemodes/beatrun/gamemode/cl/JumpAnim.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,6 @@ local function JumpThink()
17621762
local vel_l = vel:Length()
17631763
local moving = ply:KeyDown(IN_FORWARD) or ply:KeyDown(IN_MOVELEFT) or ply:KeyDown(IN_MOVERIGHT)
17641764
local back = ply:KeyDown(IN_BACK)
1765-
local stepmat = ply.LastStepMat or game.SinglePlayer() and ply:GetNW2String("LastStepMat", "Concrete") or "Concrete"
17661765
vel.z = 0
17671766

17681767
if runanims[BodyAnimString] then
@@ -2040,6 +2039,7 @@ local function JumpThink()
20402039
BodyAnim:SetAngles(oldnewang)
20412040
end
20422041
elseif newang:Forward():Dot(ang:Forward()) < 0.25 then
2042+
local stepmat = ply.LastStepMat or game.SinglePlayer() and ply:GetNW2String("LastStepMat", "Concrete") or "Concrete"
20432043
BodyAnimCycle = 0
20442044

20452045
BodyAnim:SetSequence(BodyAnim:LookupSequence("walktostandleft"))

gamemodes/beatrun/gamemode/sh/Climb.lua

Lines changed: 52 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,4 @@
1-
local ClimbingTimes = {5, 1.25, 1, 1, nil, 2}
2-
3-
--[[
4-
local CLIMB_HANG = 1
5-
local CLIMB_HEAVEUP = 2
6-
local CLIMB_STRAFELEFT = 3
7-
local CLIMB_STRAFERIGHT = 4
8-
local CLIMB_FOLDEDSTART = 5
9-
local CLIMB_FOLDEDHEAVEUP = 6
10-
11-
12-
local climb1 = {
13-
followplayer = false,
14-
animmodelstring = "new_climbanim",
15-
allowmove = true,
16-
lockang = false,
17-
ignorez = true,
18-
smoothend = true,
19-
AnimString = "climb1"
20-
}
21-
22-
local climbstrings = {"climb1", "climb2"}
23-
]]
1+
local ClimbingTimes = { 5, 1.25, 1, 1, nil, 2 }
242

253
if game.SinglePlayer() and SERVER then
264
util.AddNetworkString("Climb_SPFix")
@@ -60,7 +38,7 @@ local function ClimbingEnd(ply, mv, cmd)
6038
local trout = util.TraceHull(tr)
6139

6240
if trout.Hit then
63-
local trout = {}
41+
trout = {}
6442
tr.output = trout
6543
local start = tr.start
6644

@@ -101,9 +79,8 @@ local function ClimbingThink(ply, mv, cmd)
10179
if mv:KeyPressed(IN_FORWARD) and ply:GetClimbingDelay() < CurTime() + 0.65 or mv:KeyDown(IN_FORWARD) and ply:GetClimbingDelay() < CurTime() then
10280
ParkourEvent("hangfoldedheaveup", ply)
10381
ply.FootstepLand = false
104-
timer.Simple(0.35, function()
105-
ply:PlayStepSound(1)
106-
end)
82+
timer.Simple(0.35, function() ply:PlayStepSound(1) end)
83+
10784
ply:SetClimbing(6)
10885
ply:SetClimbingTime(0)
10986
elseif ply:GetClimbingDelay() < CurTime() then
@@ -184,7 +161,7 @@ local function ClimbingThink(ply, mv, cmd)
184161
ply:SetClimbing(0)
185162
ply:SetSafetyRollKeyTime(CurTime() + 0.1)
186163
ParkourEvent("hangjump", ply)
187-
if SERVER then
164+
if SERVER then
188165
ply:EmitSound("WallrunRelease.Concrete")
189166
timer.Simple(0.025, function()
190167
ply:EmitSound("WallrunRelease.Concrete")
@@ -198,15 +175,15 @@ local function ClimbingThink(ply, mv, cmd)
198175
BodyLimitX = 90
199176
BodyLimitY = 180
200177

201-
local ang = ply:EyeAngles()
178+
ang = ply:EyeAngles()
202179
ang.x = 0
203180
ang.z = 0
204181
BodyAnim:SetAngles(ang)
205182
elseif game.SinglePlayer() then
206183
ply:SendLua("lockang2=false lockang=false BodyLimitX=90 BodyLimitY=180 local ang=LocalPlayer():EyeAngles() ang.x=0 ang.z=0 BodyAnim:SetAngles(ang)")
207184
end
208185

209-
local ang = cmd:GetViewAngles()
186+
ang = cmd:GetViewAngles()
210187
ang.x = math.min(ang.x, 0)
211188
ang = ang:Forward()
212189
ang:Mul(350)
@@ -267,10 +244,10 @@ local function ClimbingThink(ply, mv, cmd)
267244
ply.FootstepLand = false
268245
ParkourEvent("climbheave", ply)
269246
timer.Simple(0.6, function()
270-
ply:PlayStepSound(1)
247+
ply:PlayStepSound(1)
271248
end)
272249
timer.Simple(1, function()
273-
ply:PlayStepSound(1)
250+
ply:PlayStepSound(1)
274251
end)
275252
end
276253
end
@@ -291,7 +268,6 @@ local function ClimbingThink(ply, mv, cmd)
291268
local start = mv:GetOrigin() + wallang:Forward() * 20 + Vector(0, 0, 100) + dir
292269
local wallmat = trout.MatType
293270
local handstepsoft = HANDSTEPS_SOFT_LUT[wallmat] or "ConcreteSoft"
294-
local handstephard = HANDSTEPS_HARD_LUT[wallmat] or "ConcreteHard"
295271

296272

297273
tr.start = start
@@ -325,36 +301,27 @@ local function ClimbingThink(ply, mv, cmd)
325301

326302
util.TraceHull(tr)
327303

328-
if not trout.Hit then
329-
ply:SetClimbingEndOld(ply:GetClimbingEnd())
330-
ply:SetClimbing(isright and 4 or 3)
331-
ply:SetClimbingStart(mv:GetOrigin())
332-
ply:SetClimbingEnd(mv:GetOrigin() + dir)
333-
ply:SetClimbingTime(0)
334-
335-
tr.start = mv:GetOrigin() + ply:GetClimbingAngle():Forward() * 20 + Vector(0, 0, 100) + dir
336-
tr.endpos = tr.start - Vector(0, 0, 80)
337-
338-
if isright then
339-
ParkourEvent("hangstraferight", ply)
340-
timer.Simple(0.4, function()
341-
ply:EmitSound("Handsteps.".. handstepsoft)
342-
end)
343-
timer.Simple(0.9, function()
344-
ply:EmitSound("Handsteps.".. handstepsoft)
345-
end)
346-
else
347-
ParkourEvent("hangstrafeleft", ply)
348-
timer.Simple(0.4, function()
349-
ply:EmitSound("Handsteps.".. handstepsoft)
350-
end)
351-
timer.Simple(0.9, function()
352-
ply:EmitSound("Handsteps.".. handstepsoft)
353-
end)
354-
end
355-
356-
ply:SetClimbingDelay(CurTime() + 0.9)
304+
if trout.Hit then return end
305+
ply:SetClimbingEndOld(ply:GetClimbingEnd())
306+
ply:SetClimbing(isright and 4 or 3)
307+
ply:SetClimbingStart(mv:GetOrigin())
308+
ply:SetClimbingEnd(mv:GetOrigin() + dir)
309+
ply:SetClimbingTime(0)
310+
311+
tr.start = mv:GetOrigin() + ply:GetClimbingAngle():Forward() * 20 + Vector(0, 0, 100) + dir
312+
tr.endpos = tr.start - Vector(0, 0, 80)
313+
314+
if isright then
315+
ParkourEvent("hangstraferight", ply)
316+
timer.Simple(0.4, function() ply:EmitSound("Handsteps." .. handstepsoft) end)
317+
timer.Simple(0.9, function() ply:EmitSound("Handsteps." .. handstepsoft) end)
318+
else
319+
ParkourEvent("hangstrafeleft", ply)
320+
timer.Simple(0.4, function() ply:EmitSound("Handsteps." .. handstepsoft) end)
321+
timer.Simple(0.9, function() ply:EmitSound("Handsteps." .. handstepsoft) end)
357322
end
323+
324+
ply:SetClimbingDelay(CurTime() + 0.9)
358325
end
359326
end
360327
end
@@ -488,16 +455,15 @@ local function ClimbingCheck(ply, mv, cmd)
488455
if IsValid(trout.Entity) and trout.Entity.NoClimbing then return end
489456

490457
ply:SetClimbingAngle(wallang)
491-
492-
local wallmat = trout.MatType
493-
local tr = ply.ClimbingTraceEnd
494-
local trout = ply.ClimbingTraceEndOut
458+
459+
local wallmat = trout.MatType
495460
local upvalue = ply:GetWallrun() == 1 and Vector(0, 0, 90) or Vector(0, 0, 65)
496461
local plymins, plymaxs = ply:GetHull()
497462
local handstepsoft = HANDSTEPS_SOFT_LUT[wallmat] or "ConcreteSoft"
498463
local handstephard = HANDSTEPS_HARD_LUT[wallmat] or "ConcreteHard"
499-
local handsteprelease = HANDSTEPS_RELEASE_LUT[wallmat] or "ConcreteRelease"
500464

465+
trout = ply.ClimbingTraceEndOut
466+
tr = ply.ClimbingTraceEnd
501467
tr.start = mv:GetOrigin() + wallang:Forward() * 45 + upvalue
502468
tr.endpos = tr.start - Vector(0, 0, 90)
503469
tr.maxs = plymaxs
@@ -557,8 +523,8 @@ local function ClimbingCheck(ply, mv, cmd)
557523
return
558524
end
559525

560-
local tr = ply.ClimbingTraceSafety
561-
local trout = ply.ClimbingTraceSafetyOut
526+
tr = ply.ClimbingTraceSafety
527+
trout = ply.ClimbingTraceSafetyOut
562528

563529
tr.filter = ply
564530
tr.start = endpos
@@ -585,8 +551,6 @@ local function ClimbingCheck(ply, mv, cmd)
585551
if trout.Hit then return end
586552

587553
-- local steep = trout.HitNormal:Distance(Vector(0, 0, 1)) > 0.01
588-
local tr = ply.ClimbingTraceSafety
589-
local trout = ply.ClimbingTraceSafetyOut
590554

591555
tr.start = mv:GetOrigin()
592556
tr.endpos = tr.start + Vector(0, 0, 75)
@@ -596,8 +560,6 @@ local function ClimbingCheck(ply, mv, cmd)
596560
if trout.Hit then return end
597561

598562
local origin = mv:GetOrigin()
599-
local tr = ply.ClimbingTraceSafety
600-
local trout = ply.ClimbingTraceSafetyOut
601563

602564
tr.start = startpos
603565
tr.endpos = startpos
@@ -684,10 +646,10 @@ local function ClimbingCheck(ply, mv, cmd)
684646

685647
if wr ~= 0 then
686648
ply:SetWallrun(0)
687-
ply:EmitSound("Wallrun.".. wallrun)
649+
ply:EmitSound("Wallrun." .. wallrun)
688650
ply:EmitSound("Cloth.MovementRun")
689651
timer.Simple(0.9, function()
690-
ply:EmitSound("Handsteps.".. handstepsoft)
652+
ply:EmitSound("Handsteps." .. handstepsoft)
691653
end)
692654
end
693655

@@ -714,9 +676,7 @@ local function ClimbingCheck(ply, mv, cmd)
714676
local folded = mv:GetVelocity().z < -400
715677

716678
if folded then
717-
local tr = ply.ClimbingTraceSafety
718-
local trout = ply.ClimbingTraceSafetyOut
719-
local mins, maxs = ply:GetCollisionBounds()
679+
mins, maxs = ply:GetCollisionBounds()
720680
mins.z = maxs.z * 0.25
721681

722682
tr.start = ply:GetClimbingEnd()
@@ -750,50 +710,43 @@ local function ClimbingCheck(ply, mv, cmd)
750710

751711
if wr == 1 then
752712
event = "climb"
753-
wallangc.x = -30
713+
wallangc.x = -30
754714
elseif lastvel.z < -200 then
755715
event = "climbhard2"
756-
timer.Simple(0.05, function()
757-
ply:EmitSound("Handsteps.".. handstephard)
758-
end)
759-
timer.Simple(0.7, function()
760-
ply:EmitSound("Handsteps.".. handstepsoft)
761-
end)
716+
timer.Simple(0.05, function() ply:EmitSound("Handsteps." .. handstephard) end)
717+
timer.Simple(0.7, function() ply:EmitSound("Handsteps." .. handstepsoft) end)
718+
762719
if lastvel.z < -250 then
763720
ply:FaithVO("Faith.Impact")
764721
else
765722
ply:FaithVO("Faith.ImpactSoft")
766723
end
767724
else
768-
if event then
769-
timer.Simple(0.2, function()
770-
ply:EmitSound("Handsteps.".. handstephard)
771-
end)
772-
end
725+
timer.Simple(0.15, function()
726+
ply:EmitSound("Handsteps." .. handstephard)
727+
end)
773728
end
774729

775730
ParkourEvent(event, ply)
776731
end
777732

778733
ply.wallang = wallang
779734

780-
if IsFirstTimePredicted() then
781-
if CLIENT or game.SinglePlayer() then
782-
if wallmat == MAT_CONCRETE then
783-
timer.Simple(0.05, function()
784-
ply:EmitSound("Bump.Concrete")
785-
end)
786-
end
735+
if game.SinglePlayer() or CLIENT and IsFirstTimePredicted() then
736+
if wallmat == MAT_CONCRETE then
737+
timer.Simple(0.05, function()
738+
ply:EmitSound("Bump.Concrete")
739+
end)
787740
end
788741

789-
ply:EmitSound("Handsteps.".. handstephard)
742+
ply:EmitSound("Handsteps." .. handstephard)
790743
ply:EmitSound("Cloth.FallShortMedium")
791744

792745
if CLIENT and IsFirstTimePredicted() then
793746
ply.OrigEyeAng = wallang
794747
lockang2 = true
795748

796-
if folded then
749+
if folded then
797750
DoImpactBlur(8)
798751
lockang2 = false
799752
lockang = true

gamemodes/beatrun/gamemode/sh/FreerunSysAll.lua

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ hook.Add("PlayerStepSoundTime", "MEStepTime", function(ply, step, walking)
8282
if ply:Crouching() then
8383
steptime = steptime * 2
8484
end
85-
85+
8686
if ply:KeyDown(IN_WALK) then
8787
steptime = steptime * 1.5
8888
end
@@ -101,7 +101,8 @@ hook.Add("PlayerFootstep", "MEStepSound", function(ply, pos, foot, sound, volume
101101

102102
if (ply:GetSliding() or CurTime() < ply:GetSafetyRollTime() - 0.5) and not skipcheck then return true end
103103
if ply:GetMEMoveLimit() < 100 and ply:KeyDown(IN_FORWARD) and not ply.FootstepLand then return true end
104-
104+
105+
local mat = sound:sub(0, -6)
105106
local newsound = FOOTSTEPS_LUT[mat] or "Concrete"
106107
local walksound = FOOTSTEPS_WALK_LUT[mat] or "Concrete"
107108

@@ -121,15 +122,15 @@ hook.Add("PlayerFootstep", "MEStepSound", function(ply, pos, foot, sound, volume
121122
if currentSpeed < 150 then
122123
ply:EmitSound("Walk." .. walksound)
123124
ply:EmitSound("Cloth.MovementWalk")
124-
else
125-
ply:EmitSound("Footsteps." .. newsound)
126-
ply:EmitSound("Cloth.MovementRun")
125+
else
126+
ply:EmitSound("Footsteps." .. newsound)
127+
ply:EmitSound("Cloth.MovementRun")
127128
if math.random() > 0.9 then ParkourEvent("step") end
128129
end
129130
end
130131

131-
if ply:InOverdrive() and currentSpeed > 400 then
132-
ply:EmitSound("Footsteps.Spark")
132+
if ply:InOverdrive() and currentSpeed > 400 then
133+
ply:EmitSound("Footsteps.Spark")
133134
end
134135

135136
if ply:Crouching() and not isBalancing and IsFirstTimePredicted() then
@@ -151,10 +152,8 @@ hook.Add("PlayerFootstep", "MEStepSound", function(ply, pos, foot, sound, volume
151152
end
152153
end
153154

154-
if ply:WaterLevel() > 0 then
155-
if ply:Crouching() then
156-
ply:EmitSound("Sneak.Water")
157-
end
155+
if ply:WaterLevel() > 0 and ply:Crouching() then
156+
ply:EmitSound("Sneak.Water")
158157
end
159158

160159
ply.LastFootstepSound = mat
@@ -198,7 +197,7 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed
198197
eyedir.x = 0
199198
eyedir = eyedir:Forward()
200199

201-
local vel = ply:GetVelocity()
200+
vel = ply:GetVelocity()
202201
vel.z = 0
203202

204203
if ply:GetCrouchJumpTime() < CurTime() and vel:GetNormalized():Dot(eyedir) < -0.75 and not ply:GetDive() then
@@ -236,8 +235,8 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
236235

237236
if (CLIENT or game.SinglePlayer()) and CurTime() > (ply:GetStepRelease() or 0) and ply.FootstepReleaseLand then
238237
local newsound = FOOTSTEPS_RELEASE_LUT[ply.LastFootstepSound] or "Concrete"
239-
240-
if ply:GetVelocity():Length() > 160 then
238+
239+
if ply:GetVelocity():Length() > 160 then
241240
ply:EmitSound("Release." .. newsound)
242241
end
243242
ply.FootstepReleaseLand = false

0 commit comments

Comments
 (0)