fixes and cleanup for client part and player class

This commit is contained in:
Jonny_Bro (Nikita) 2023-05-20 14:15:41 +05:00
parent 5c758a7c7b
commit 7d937f7507
38 changed files with 1061 additions and 1251 deletions

View file

@ -1,8 +1,10 @@
function CreateRopes() function CreateRopes()
local ents = ents.GetAll() local ents = ents.GetAll()
for k,v in pairs(ents) do
for k, v in pairs(ents) do
if v:GetClass() == "move_rope" then if v:GetClass() == "move_rope" then
local endpoint = v:GetInternalVariable("m_hEndPoint") local endpoint = v:GetInternalVariable("m_hEndPoint")
if IsValid(endpoint) then if IsValid(endpoint) then
local zipline = CreateZipline(v:GetPos(), endpoint:GetPos()) local zipline = CreateZipline(v:GetPos(), endpoint:GetPos())
zipline:SetNW2Bool("BRProtected", true) zipline:SetNW2Bool("BRProtected", true)
@ -10,11 +12,12 @@ function CreateRopes()
end end
end end
for k,v in pairs(ents) do for k, v in pairs(ents) do
if v:GetClass():find("rope") then if v:GetClass():find("rope") then
v:Remove() v:Remove()
end end
end end
hook.Remove("InitPostEntity", "CreateRopes") hook.Remove("InitPostEntity", "CreateRopes")
end end

View file

@ -1,58 +1,25 @@
local START_Z = -15800 local START_Z = -15800
local CURRENT_Z = 0 local CURRENT_Z = 0
local ROTATION = { local ROTATION = {Vector(-325.8125, 573.90625, START_Z), Vector(-66.3125, 573.90625, START_Z), Vector(189.15625, 573.90625, START_Z), Vector(412.5625, 573.90625, START_Z), Vector(568.09375, 316.59375, START_Z), Vector(568.09375, 69.03125, START_Z), Vector(568.09375, -189.28125, START_Z), Vector(568.09375, -408.125, START_Z), Vector(412.5625, -569.375, START_Z), Vector(189.15625, -569.375, START_Z), Vector(-66.3125, -569.375, START_Z), Vector(-325.8125, -569.375, START_Z), Vector(-568.65625, -408.125, START_Z), Vector(-568.65625, -189.28125, START_Z), Vector(-568.65625, 69.03125, START_Z), Vector(-568.65625, 316.59375, START_Z),}
Vector(-325.8125, 573.90625, START_Z),
Vector(-66.3125, 573.90625, START_Z), local ANGLES = {Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, -90, 0), Angle(0, -90, 0), Angle(0, -90, 0), Angle(0, -90, 0), Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, 0, 0), Angle(0, -90, 0), Angle(0, -90, 0), Angle(0, -90, 0), Angle(0, -90, 0),}
Vector(189.15625, 573.90625, START_Z),
Vector(412.5625, 573.90625, START_Z),
Vector(568.09375, 316.59375, START_Z),
Vector(568.09375, 69.03125, START_Z),
Vector(568.09375, -189.28125, START_Z),
Vector(568.09375, -408.125, START_Z),
Vector(412.5625, -569.375, START_Z),
Vector(189.15625, -569.375, START_Z),
Vector(-66.3125, -569.375, START_Z),
Vector(-325.8125, -569.375, START_Z),
Vector(-568.65625, -408.125, START_Z),
Vector(-568.65625, -189.28125, START_Z),
Vector(-568.65625, 69.03125, START_Z),
Vector(-568.65625, 316.59375, START_Z),
}
local ANGLES = {
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, 0, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
Angle(0, -90, 0),
}
local CURRENT_ROTATION = 1 local CURRENT_ROTATION = 1
local MAX_ROTATION = #ROTATION local MAX_ROTATION = #ROTATION
for i=0, 100 do for i = 0, 100 do
local mdl = "models/hunter/blocks/cube2x3x025.mdl" local mdl = "models/hunter/blocks/cube2x3x025.mdl"
local plat = ents.Create("prop_physics") local plat = ents.Create("prop_physics")
plat:SetModel(mdl)
plat:SetPos(ROTATION[CURRENT_ROTATION]+Vector(0,0,CURRENT_Z))
plat:SetAngles(ANGLES[CURRENT_ROTATION])
plat:SetModel(mdl)
plat:SetPos(ROTATION[CURRENT_ROTATION] + Vector(0, 0, CURRENT_Z))
plat:SetAngles(ANGLES[CURRENT_ROTATION])
plat:Spawn() plat:Spawn()
plat:PhysicsDestroy() plat:PhysicsDestroy()
CURRENT_Z = CURRENT_Z+math.random(20,70) CURRENT_Z = CURRENT_Z + math.random(20, 70)
CURRENT_ROTATION = CURRENT_ROTATION+1 CURRENT_ROTATION = CURRENT_ROTATION + 1
if CURRENT_ROTATION > MAX_ROTATION then if CURRENT_ROTATION > MAX_ROTATION then
CURRENT_ROTATION = 1 CURRENT_ROTATION = 1

View file

@ -1,10 +1,9 @@
local replaysdir = "beatrun/gamemode/Maps/TrainingData/" local replaysdir = "beatrun/gamemode/Maps/TrainingData/"
TUTORIALMODE = true TUTORIALMODE = true
local tutorialcount = 3 local tutorialcount = 3
for i=1, tutorialcount do for i = 1, tutorialcount do
AddCSLuaFile(replaysdir.."tut"..i..".lua") AddCSLuaFile(replaysdir .. "tut" .. i .. ".lua")
end end
hook.Add("PlayerDeath", "Ouch", function(ply) hook.Add("PlayerDeath", "Ouch", function(ply)
@ -15,41 +14,52 @@ end)
slidegate = slidegate or nil slidegate = slidegate or nil
local movegate = false local movegate = false
local sentreset = false local sentreset = false
local function CreateSlideGate() local function CreateSlideGate()
slidegate = ents.Create("prop_physics") slidegate = ents.Create("prop_physics")
slidegate:SetModel("models/hunter/blocks/cube8x8x025.mdl") slidegate:SetModel("models/hunter/blocks/cube8x8x025.mdl")
slidegate:SetPos(Vector(6332, 858, 895)) slidegate:SetPos(Vector(6332, 858, 895))
slidegate:SetAngles(Angle(90,0,0)) slidegate:SetAngles(Angle(90, 0, 0))
slidegate:Spawn() slidegate:Spawn()
slidegate:PhysicsDestroy() slidegate:PhysicsDestroy()
end end
hook.Add("InitPostEntity", "TutorialSlideGate", CreateSlideGate) hook.Add("InitPostEntity", "TutorialSlideGate", CreateSlideGate)
local function ResetSlideGate() local function ResetSlideGate()
if !IsValid(slidegate) then return end if not IsValid(slidegate) then return end
slidegate:SetPos(Vector(6332, 858, 895)) slidegate:SetPos(Vector(6332, 858, 895))
slidegate:SetAngles(Angle(90,0,0)) slidegate:SetAngles(Angle(90, 0, 0))
movegate = false movegate = false
sentreset = false sentreset = false
end end
hook.Add("PostReplayRequest", "ResetSlideGate", ResetSlideGate) hook.Add("PostReplayRequest", "ResetSlideGate", ResetSlideGate)
local function MoveSlideGate() local function MoveSlideGate()
if !IsValid(slidegate) or !IsValid(Entity(1)) then return end if not IsValid(slidegate) or not IsValid(Entity(1)) then return end
if !movegate then
if not movegate then
if Entity(1):GetVelocity():Length() > 25 then if Entity(1):GetVelocity():Length() > 25 then
movegate = true movegate = true
else else
return return
end end
end end
local pos = slidegate:GetPos() local pos = slidegate:GetPos()
if pos[3] > 350 then if pos[3] > 350 then
pos[3] = math.max(350, pos[3]-2.75) pos[3] = math.max(350, pos[3] - 2.75)
slidegate:SetPos(pos) slidegate:SetPos(pos)
elseif !sentreset and !Entity(1).InReplay then elseif not sentreset and not Entity(1).InReplay then
Entity(1):SendLua("SGR()") Entity(1):SendLua("SGR()")
sentreset = true sentreset = true
end end
end end
hook.Add("Tick", "MoveSlideGate", MoveSlideGate) hook.Add("Tick", "MoveSlideGate", MoveSlideGate)

View file

@ -1,23 +1,20 @@
local replaysdir = "beatrun/gamemode/Maps/TrainingData/" local replaysdir = "beatrun/gamemode/Maps/TrainingData/"
TUTORIALMODE = true TUTORIALMODE = true
local tutorialcount = 7 local tutorialcount = 7
local endticks = {300, 300, 350, 500, 500, 230, 800}
tutorials = {}
local endticks = {300, 300, 350, 500, 500, 230, 800}
tutorials = {}
curtutorial = 1 curtutorial = 1
local tutorialtext = { local tutorialtext = {
"Move towards a wall while in the air to climb it", "Move towards a wall while in the air to climb it", {"Press [%s] before landing to break your fall", "+speed"},
{"Press [%s] before landing to break your fall","+speed"}, "Jump towards an obstacle to vault over it", {"Hold Jump while holding [%s] and looking at a wall to wallrun\nYou can release either key during the wallrun, you won't fall off", "+forward"},
"Jump towards an obstacle to vault over it", "Press Jump during a wallrun to jump off\nYou can chain wallruns this way", "Hold Jump while moving towards a wall to wallclimb\nYou can release either key afterwards\nYou will automatically climb ledges", {"Press [%s] while moving left or right to sidestep\nSidestep lets you move at max speed immediately\nHold Crouch to slide under the gate", "+attack2"}
{"Hold Jump while holding [%s] and looking at a wall to wallrun\nYou can release either key during the wallrun, you won't fall off", "+forward"},
"Press Jump during a wallrun to jump off\nYou can chain wallruns this way",
"Hold Jump while moving towards a wall to wallclimb\nYou can release either key afterwards\nYou will automatically climb ledges",
{"Press [%s] while moving left or right to sidestep\nSidestep lets you move at max speed immediately\nHold Crouch to slide under the gate", "+attack2"}
} }
for i=1, tutorialcount do for i = 1, tutorialcount do
tutorials[i] = util.JSONToTable(util.Decompress(file.Read(replaysdir.."tut"..i..".lua", "LUA"))) tutorials[i] = util.JSONToTable(util.Decompress(file.Read(replaysdir .. "tut" .. i .. ".lua", "LUA")))
end end
function PlayTutorialReplay(num) function PlayTutorialReplay(num)
@ -26,11 +23,14 @@ function PlayTutorialReplay(num)
curtutorial = num curtutorial = num
ply.ReplayEndAtTick = endticks[num] ply.ReplayEndAtTick = endticks[num]
ReplayPlay(ply, data[2], data[1]) ReplayPlay(ply, data[2], data[1])
end end
function PTRD() function PTRD()
PlayTutorialReplay(curtutorial) PlayTutorialReplay(curtutorial)
end end
function SGR() function SGR()
if curtutorial == 7 and LocalPlayer():GetPos()[1] < 6345 then if curtutorial == 7 and LocalPlayer():GetPos()[1] < 6345 then
PlayTutorialReplay(curtutorial) PlayTutorialReplay(curtutorial)
@ -39,99 +39,103 @@ end
local curevent = {} local curevent = {}
local eventcheck = {} local eventcheck = {}
local eventwhitelist = { local eventwhitelist = {
["step"] = true, ["step"] = true,
["sidestep"] = true, ["sidestep"] = true,
["jump"] = true, ["jump"] = true,
["land"] = true, ["land"] = true,
["jumpwallrun"] = true ["jumpwallrun"] = true
} }
local eventrequired = { local eventrequired = {
{"climb"}, {"climb"},
{"roll"}, {"roll"},
{"vault", "vault"}, {"vault", "vault"},
{"wallrunh"}, {"wallrunh"},
{"wallrunh", "wallrunh"}, {"wallrunh", "wallrunh"},
{"wallrunv", "climb"}, {"wallrunv", "climb"},
{"slide"} {"slide"}
} }
local eventnicenames = { local eventnicenames = {
["climb"] = "Climb", ["climb"] = "Climb",
["roll"] = "Roll", ["roll"] = "Roll",
["vault"] = "Vault", ["vault"] = "Vault",
["wallrunh"] = "Wallrun (H)", ["wallrunh"] = "Wallrun (H)",
["wallrunv"] = "Wallrun (V)", ["wallrunv"] = "Wallrun (V)",
["slide"] = "Slide", ["slide"] = "Slide",
["springboard"] = "Springboard", ["springboard"] = "Springboard",
["coil"] = "Coil" ["coil"] = "Coil"
} }
local eventhudtext = {} local eventhudtext = {}
local function DrawTutorialText() local function DrawTutorialText()
surface.SetFont("BeatrunHUD") surface.SetFont("BeatrunHUD")
local offsetx, offsety = ScrW()*0.33, ScrH()*0.75
local _, offsety = ScrW() * 0.33, ScrH() * 0.75
local data = tutorialtext[curtutorial] local data = tutorialtext[curtutorial]
local text local text
if type(data) != "table" then
if type(data) ~= "table" then
text = tutorialtext[curtutorial] text = tutorialtext[curtutorial]
else else
text = string.format(tutorialtext[curtutorial][1], input.LookupBinding(tutorialtext[curtutorial][2])) text = string.format(tutorialtext[curtutorial][1], input.LookupBinding(tutorialtext[curtutorial][2]))
end end
local textsplit = string.Split(text,"\n") local textsplit = string.Split(text, "\n")
local linecount = #textsplit -- local linecount = #textsplit
local tw, th = surface.GetTextSize(text) local tw, th = surface.GetTextSize(text)
local boxw = tw local boxw = tw
surface.SetTextColor(220, 220, 220, 255) surface.SetTextColor(220, 220, 220, 255)
surface.SetDrawColor(75, 75, 75, 45) surface.SetDrawColor(75, 75, 75, 45)
surface.DrawRect(ScrW()/2 - (tw*0.5)-15-1, offsety-1, boxw + 30+1, 3) surface.DrawRect(ScrW() / 2 - (tw * 0.5) - 15 - 1, offsety - 1, boxw + 30 + 1, 3)
for k,v in ipairs(textsplit) do for k, v in ipairs(textsplit) do
local tw, th = surface.GetTextSize(v) local tw, th = surface.GetTextSize(v)
surface.SetTextPos(ScrW()/2 - (tw*0.5), offsety + 30 - (th * 0.5) + (th * (k-1)) )
surface.SetTextPos(ScrW() / 2 - (tw * 0.5), offsety + 30 - (th * 0.5) + (th * (k - 1)))
surface.DrawText(v) surface.DrawText(v)
end end
table.Empty(eventhudtext) table.Empty(eventhudtext)
for k,v in ipairs(curevent) do
if !eventwhitelist[v] and eventnicenames[v] then for k, v in ipairs(curevent) do
if not eventwhitelist[v] and eventnicenames[v] then
table.insert(eventhudtext, eventnicenames[v]) table.insert(eventhudtext, eventnicenames[v])
end end
end end
offsety = ScrH()*0.7
offsety = ScrH() * 0.7
text = table.concat(eventhudtext, " + ") text = table.concat(eventhudtext, " + ")
tw, th = surface.GetTextSize(text) tw, th = surface.GetTextSize(text)
surface.SetTextPos(ScrW()/2 - (tw*0.5), offsety + 30 - (th * 0.5) )
surface.SetTextPos(ScrW() / 2 - (tw * 0.5), offsety + 30 - (th * 0.5))
surface.DrawText(text) surface.DrawText(text)
end end
hook.Add("HUDPaint", "TutorialText", DrawTutorialText) hook.Add("HUDPaint", "TutorialText", DrawTutorialText)
hook.Add("BeatrunHUDCourse", "TutorialHUD", function() return "Tutorial" end)
hook.Add("BeatrunHUDCourse", "TutorialHUD", function() local tutorialendpos = {tutorials[2][1], tutorials[3][1], tutorials[4][1], tutorials[5][1], tutorials[6][1], tutorials[7][1], Vector()}
return "Tutorial"
end)
local tutorialendpos = {
tutorials[2][1],
tutorials[3][1],
tutorials[4][1],
tutorials[5][1],
tutorials[6][1],
tutorials[7][1],
Vector()
}
local function TutorialLogic() local function TutorialLogic()
local ply = LocalPlayer() local ply = LocalPlayer()
if !IsValid(ply) then return end
if not IsValid(ply) then return end
if ply.InReplay then return end if ply.InReplay then return end
local endpos = tutorialendpos[curtutorial] local endpos = tutorialendpos[curtutorial]
if !endpos then return end
if not endpos then return end
if ply:GetPos():Distance(endpos) < 20 then if ply:GetPos():Distance(endpos) < 20 then
table.Empty(eventcheck) table.Empty(eventcheck)
for k,v in ipairs(curevent) do
if !eventwhitelist[v] then for k, v in ipairs(curevent) do
if not eventwhitelist[v] then
table.insert(eventcheck, v) table.insert(eventcheck, v)
end end
end end
@ -139,24 +143,30 @@ local function TutorialLogic()
if table.concat(eventcheck) == table.concat(eventrequired[curtutorial]) then if table.concat(eventcheck) == table.concat(eventrequired[curtutorial]) then
table.Empty(curevent) table.Empty(curevent)
table.Empty(eventcheck) table.Empty(eventcheck)
curtutorial = curtutorial + 1 curtutorial = curtutorial + 1
PlayTutorialReplay(curtutorial) PlayTutorialReplay(curtutorial)
else else
table.Empty(curevent) table.Empty(curevent)
table.Empty(eventcheck) table.Empty(eventcheck)
PlayTutorialReplay(curtutorial) PlayTutorialReplay(curtutorial)
end end
end end
end end
hook.Add("Tick", "TutorialLogic", TutorialLogic) hook.Add("Tick", "TutorialLogic", TutorialLogic)
local function TutorialEvents(event, ply) local function TutorialEvents(event, ply)
if !eventnicenames[event] then return end if not eventnicenames[event] then return end
table.insert(curevent, event) table.insert(curevent, event)
if #curevent > 10 then if #curevent > 10 then
table.remove(curevent, 1) table.remove(curevent, 1)
end end
end end
hook.Add("OnParkour", "TutorialEvents", TutorialEvents) hook.Add("OnParkour", "TutorialEvents", TutorialEvents)
function TutorialClearEvents() function TutorialClearEvents()
@ -165,81 +175,103 @@ end
local markerup = Vector() local markerup = Vector()
local markercol = Color(255, 25, 25) local markercol = Color(255, 25, 25)
local function TutorialMarker() local function TutorialMarker()
local markerpos = tutorialendpos[curtutorial] local markerpos = tutorialendpos[curtutorial]
if markerpos then if markerpos then
markerup:Set(markerpos) markerup:Set(markerpos)
markerup[3] = markerup[3] + 50 markerup[3] = markerup[3] + 50
render.DrawLine(markerpos, markerup, markercol, true) render.DrawLine(markerpos, markerup, markercol, true)
local ang = EyeAngles() local ang = EyeAngles()
ang.x = -90 ang.x = -90
markerup[3] = markerup[3] + 50 + math.sin(CurTime()*4)*5 markerup[3] = markerup[3] + 50 + math.sin(CurTime() * 4) * 5
cam.Start3D2D(markerup - ang:Right()*13, ang, 1)
cam.Start3D2D(markerup - ang:Right() * 13, ang, 1)
surface.SetFont("BeatrunHUD") surface.SetFont("BeatrunHUD")
surface.SetTextPos(0,0) surface.SetTextPos(0, 0)
surface.SetTextColor(markercol) surface.SetTextColor(markercol)
surface.DrawText("") surface.DrawText("")
cam.End3D2D() cam.End3D2D()
end end
end end
hook.Add("PostDrawTranslucentRenderables", "TutorialMarker", TutorialMarker) hook.Add("PostDrawTranslucentRenderables", "TutorialMarker", TutorialMarker)
local creditslist = { local creditslist = {
{3.25, "Beatrun"}, {3.25, "Beatrun"},
{3.25, "Authored by datae"}, {3.25, "Authored by datae"},
{3.25, "Ideas stolen from Mirror's Edge"}, {3.25, "Ideas stolen from Mirror's Edge"},
{3.75, "Sounds stolen from Mirror's Edge"}, {3.75, "Sounds stolen from Mirror's Edge"},
{3.25, "Infection music stolen from Dying Light"}, {3.25, "Infection music stolen from Dying Light"},
{1.75, "Maybe I forgot more?"}, {1.75, "Maybe I forgot more?"},
{3.25, "Anyways..."}, {3.25, "Anyways..."},
{8.75, "Thanks for playing, %s!"}, {8.75, "Thanks for playing, %s!"},
{7.5, ""}, {7.5, ""},
} }
local creditstime = 0 local creditstime = 0
local curcredit = 1 local curcredit = 1
local function CreditsThink() local function CreditsThink()
if gui.IsGameUIVisible() then return end if gui.IsGameUIVisible() then return end
cam.Start2D() cam.Start2D()
local data = creditslist[curcredit] local data = creditslist[curcredit]
surface.SetDrawColor(0,0,0)
surface.SetDrawColor(0, 0, 0)
surface.DrawRect(0, 0, ScrW(), ScrH()) surface.DrawRect(0, 0, ScrW(), ScrH())
surface.SetFont("BeatrunHUD") surface.SetFont("BeatrunHUD")
local text = data[2] local text = data[2]
text = string.format(text, LocalPlayer():Nick()) text = string.format(text, LocalPlayer():Nick())
local tw, th = surface.GetTextSize(text) local tw, th = surface.GetTextSize(text)
surface.SetTextColor(220, 220, 220, 255) surface.SetTextColor(220, 220, 220, 255)
surface.SetTextPos(ScrW()/2 - (tw*0.5), ScrH()/2 - (th*0.5)) surface.SetTextPos(ScrW() / 2 - (tw * 0.5), ScrH() / 2 - (th * 0.5))
surface.DrawText(text) surface.DrawText(text)
if CurTime() > creditstime+data[1] then
if CurTime() > creditstime + data[1] then
creditstime = CurTime() creditstime = CurTime()
curcredit = curcredit + 1 curcredit = curcredit + 1
if !creditslist[curcredit] then
if not creditslist[curcredit] then
hook.Remove("PreRender", "Credits") hook.Remove("PreRender", "Credits")
RunConsoleCommand("disconnect") RunConsoleCommand("disconnect")
end end
end end
cam.End2D() cam.End2D()
return true return true
end end
local function CreditsStart() local function CreditsStart()
creditstime = CurTime() creditstime = CurTime()
curcredit = 1 curcredit = 1
hook.Add("PreRender", "Credits", CreditsThink)
hook.Add("PreRender", "Credits", CreditsThink)
RunConsoleCommand("stopsound") RunConsoleCommand("stopsound")
timer.Simple(0, function() EmitSound("music/credits.mp3", vector_origin, -2, CHAN_AUTO, 1, 75, SND_SHOULDPAUSE) end)
timer.Simple(0, function()
EmitSound("music/credits.mp3", vector_origin, -2, CHAN_AUTO, 1, 75, SND_SHOULDPAUSE)
end)
end end
local creditscheck = 0 local creditscheck = 0
hook.Add("PlayerBindPress", "CreditsCheck", function(ply, bind, pressed) hook.Add("PlayerBindPress", "CreditsCheck", function(ply, bind, pressed)
if creditstime == 0 and bind == "+use" then if creditstime == 0 and bind == "+use" then
creditscheck = creditscheck + 1 creditscheck = creditscheck + 1
if creditscheck > (30-ply:GetLevel()) then
if creditscheck > (30 - ply:GetLevel()) then
CreditsStart() CreditsStart()
end end
end end

View file

@ -1,14 +1,23 @@
net.Receive("DeathStopSound", function() net.Receive("DeathStopSound", function()
if !blinded then if not blinded then
RunConsoleCommand("stopsound") RunConsoleCommand("stopsound")
if LocalPlayer():GetPos().z < -2200 then if LocalPlayer():GetPos().z < -2200 then
timer.Simple(0.011, function() RunConsoleCommand("stopsound") end) timer.Simple(0.011, function()
timer.Simple(0.02, function() LocalPlayer():EmitSound("enterwater_highvelocity_0"..math.random(1,2)..".wav") end) RunConsoleCommand("stopsound")
end)
timer.Simple(0.02, function()
LocalPlayer():EmitSound("enterwater_highvelocity_0" .. math.random(1, 2) .. ".wav")
end)
timer.Simple(0.02, function() timer.Simple(0.02, function()
local rag = LocalPlayer():GetRagdollEntity() local rag = LocalPlayer():GetRagdollEntity()
if IsValid(rag) then if IsValid(rag) then
for i = 0, rag:GetPhysicsObjectCount() - 1 do for i = 0, rag:GetPhysicsObjectCount() - 1 do
local phys = rag:GetPhysicsObjectNum( i ) local phys = rag:GetPhysicsObjectNum(i)
phys:EnableMotion(false) phys:EnableMotion(false)
end end
end end

View file

@ -1,14 +1,23 @@
net.Receive("DeathStopSound", function() net.Receive("DeathStopSound", function()
if !blinded then if not blinded then
RunConsoleCommand("stopsound") RunConsoleCommand("stopsound")
if LocalPlayer():GetPos().z < -2200 then if LocalPlayer():GetPos().z < -2200 then
timer.Simple(0.011, function() RunConsoleCommand("stopsound") end) timer.Simple(0.011, function()
timer.Simple(0.02, function() LocalPlayer():EmitSound("enterwater_highvelocity_0"..math.random(1,2)..".wav") end) RunConsoleCommand("stopsound")
end)
timer.Simple(0.02, function()
LocalPlayer():EmitSound("enterwater_highvelocity_0" .. math.random(1, 2) .. ".wav")
end)
timer.Simple(0.02, function() timer.Simple(0.02, function()
local rag = LocalPlayer():GetRagdollEntity() local rag = LocalPlayer():GetRagdollEntity()
if IsValid(rag) then if IsValid(rag) then
for i = 0, rag:GetPhysicsObjectCount() - 1 do for i = 0, rag:GetPhysicsObjectCount() - 1 do
local phys = rag:GetPhysicsObjectNum( i ) local phys = rag:GetPhysicsObjectNum(i)
phys:EnableMotion(false) phys:EnableMotion(false)
end end
end end

View file

@ -1,24 +1,25 @@
local spawn = { local spawn = {
{"br_swingbar", Vector(935.281250, 847.187500, 13185), Angle(0, 0, 0)}, {"br_swingbar", Vector(935.281250, 847.187500, 13185), Angle(0, 0, 0)},
{"br_swingbar", Vector(935.281250, 813.875000, 13185), Angle(0, 0, 0)}, {"br_swingbar", Vector(935.281250, 813.875000, 13185), Angle(0, 0, 0)},
} }
function PrintAllBars() function PrintAllBars()
for k,v in pairs(ents.FindByClass("br_swingbar")) do for k, v in pairs(ents.FindByClass("br_swingbar")) do
local pos, ang = v:GetPos(), v:GetAngles() local pos, ang = v:GetPos(), v:GetAngles()
local str = '{"br_swingbar", Vector('..pos.x..", "..pos.y..", "..pos.z.."), Angle("..ang.x..", "..ang.y..", "..ang.z..")}," local str = "{\"br_swingbar\", Vector(" .. pos.x .. ", " .. pos.y .. ", " .. pos.z .. "), Angle(" .. ang.x .. ", " .. ang.y .. ", " .. ang.z .. ")},"
print(str) print(str)
end end
end end
local function CreateSpawnEntities() local function CreateSpawnEntities()
for k,v in ipairs(spawn) do for k, v in ipairs(spawn) do
BRProtectedEntity(v[1], v[2], v[3]) BRProtectedEntity(v[1], v[2], v[3])
end end
end end
hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities)
hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities)
print("Loaded worlds") print("Loaded worlds")
BlockWhitescaleSkypaint = true BlockWhitescaleSkypaint = true

View file

@ -1,42 +1,48 @@
local blacklistedents = { local blacklistedents = {
["weapon_pistol"] = true, ["weapon_pistol"] = true,
["weapon_357"] = true, ["weapon_357"] = true,
["weapon_crossbow"] = true, ["weapon_crossbow"] = true,
["weapon_crowbar"] = true, ["weapon_crowbar"] = true,
["weapon_ar2"] = true, ["weapon_ar2"] = true,
["weapon_rpg"] = true, ["weapon_rpg"] = true,
["weapon_shotgun"] = true, ["weapon_shotgun"] = true,
["weapon_smg1"] = true, ["weapon_smg1"] = true,
["item_ammo_357"] = true, ["item_ammo_357"] = true,
["item_ammo_ar2"] = true, ["item_ammo_ar2"] = true,
["item_ammo_ar2_altfire"] = true, ["item_ammo_ar2_altfire"] = true,
["item_healthkit"] = true, ["item_healthkit"] = true,
["item_healthvial"] = true, ["item_healthvial"] = true,
["item_ammo_smg1"] = true, ["item_ammo_smg1"] = true,
["item_box_buckshot"] = true, ["item_box_buckshot"] = true,
["item_battery"] = true, ["item_battery"] = true,
["item_ammo_smg1_grenade"] = true, ["item_ammo_smg1_grenade"] = true,
["item_ammo_pistol"] = true, ["item_ammo_pistol"] = true,
["item_ammo_crossbow"] = true, ["item_ammo_crossbow"] = true,
["item_rpg_round"] = true, ["item_rpg_round"] = true,
["item_ammo_smg1_large"] = true, ["item_ammo_smg1_large"] = true,
["weapon_frag"] = true ["weapon_frag"] = true
} }
local old = game.CleanUpMap local old = game.CleanUpMap
local CleanUpMapDetoured = function(dsc, efilters) local CleanUpMapDetoured = function(dsc, efilters)
if istable(efilters) then if istable(efilters) then
table.insert(efilters, "env_skypaint") table.insert(efilters, "env_skypaint")
end end
old(dsc, efilters) old(dsc, efilters)
end end
game.CleanUpMap = CleanUpMapDetoured game.CleanUpMap = CleanUpMapDetoured
local skypaint local skypaint
hook.Add("PlayerSpawn", "CubixInit", function() hook.Add("PlayerSpawn", "CubixInit", function()
RunConsoleCommand("sv_skyname","painted") RunConsoleCommand("sv_skyname", "painted")
if !skypaint then
if not skypaint then
skypaint = ents.Create("env_skypaint") skypaint = ents.Create("env_skypaint")
WhitescaleOn() WhitescaleOn()
end end
end) end)
@ -44,12 +50,14 @@ end)
hook.Add("OnEntityCreated", "BlacklistedEnts", function(ent) hook.Add("OnEntityCreated", "BlacklistedEnts", function(ent)
if IsValid(ent) and blacklistedents[ent:GetClass()] then if IsValid(ent) and blacklistedents[ent:GetClass()] then
ent:Remove() ent:Remove()
return return
end end
timer.Simple(0, function() timer.Simple(0, function()
if IsValid(ent) and (ent:GetClass()=="prop_physics" or ent:GetClass()=="prop_physics_respawnable") then if IsValid(ent) and (ent:GetClass() == "prop_physics" or ent:GetClass() == "prop_physics_respawnable") then
local phys = ent:GetPhysicsObject() local phys = ent:GetPhysicsObject()
if IsValid(phys) then if IsValid(phys) then
phys:EnableMotion(false) phys:EnableMotion(false)
end end

View file

@ -1,219 +1,223 @@
local blacklistedents = { local blacklistedents = {
["weapon_pistol"] = true, ["weapon_pistol"] = true,
["weapon_357"] = true, ["weapon_357"] = true,
["weapon_crossbow"] = true, ["weapon_crossbow"] = true,
["weapon_crowbar"] = true, ["weapon_crowbar"] = true,
["weapon_ar2"] = true, ["weapon_ar2"] = true,
["weapon_rpg"] = true, ["weapon_rpg"] = true,
["weapon_shotgun"] = true, ["weapon_shotgun"] = true,
["weapon_smg1"] = true, ["weapon_smg1"] = true,
["item_ammo_357"] = true, ["item_ammo_357"] = true,
["item_ammo_ar2"] = true, ["item_ammo_ar2"] = true,
["item_ammo_ar2_altfire"] = true, ["item_ammo_ar2_altfire"] = true,
["item_healthkit"] = true, ["item_healthkit"] = true,
["item_healthvial"] = true, ["item_healthvial"] = true,
["item_ammo_smg1"] = true, ["item_ammo_smg1"] = true,
["item_box_buckshot"] = true, ["item_box_buckshot"] = true,
["item_battery"] = true, ["item_battery"] = true,
["item_ammo_smg1_grenade"] = true, ["item_ammo_smg1_grenade"] = true,
["item_ammo_pistol"] = true, ["item_ammo_pistol"] = true,
["item_ammo_crossbow"] = true, ["item_ammo_crossbow"] = true,
["item_rpg_round"] = true, ["item_rpg_round"] = true,
["item_ammo_smg1_large"] = true ["item_ammo_smg1_large"] = true
} }
local old = game.CleanUpMap local old = game.CleanUpMap
local CleanUpMapDetoured = function(dsc, efilters) local CleanUpMapDetoured = function(dsc, efilters)
if istable(efilters) then if istable(efilters) then
table.insert(efilters, "env_skypaint") table.insert(efilters, "env_skypaint")
end end
old(dsc, efilters) old(dsc, efilters)
end end
local spawn = { local spawn = {
{"br_swingbar", Vector(-473.625, 2578.53125, 219.5625), Angle(0, 90, 0)}, {"br_swingbar", Vector(-473.625, 2578.53125, 219.5625), Angle(0, 90, 0)},
{"br_swingbar", Vector(-303.8125, 2578.53125, 219.5625), Angle(0, 90, 0)}, {"br_swingbar", Vector(-303.8125, 2578.53125, 219.5625), Angle(0, 90, 0)},
{"br_swingbar", Vector(-398.15625, 2578.53125, 219.5625), Angle(0, 90, 0)}, {"br_swingbar", Vector(-398.15625, 2578.53125, 219.5625), Angle(0, 90, 0)},
{"br_swingbar", Vector(3387.78125, 2381.0625, 235.1875), Angle(0, 0, 0)}, {"br_swingbar", Vector(3387.78125, 2381.0625, 235.1875), Angle(0, 0, 0)},
{"br_swingbar", Vector(3387.78125, 2286.84375, 235.1875), Angle(0, 0, 0)}, {"br_swingbar", Vector(3387.78125, 2286.84375, 235.1875), Angle(0, 0, 0)},
{"br_swingbar", Vector(1222.21875, 1197.59375, 561.15625), Angle(0, 0, 0)}, {"br_swingbar", Vector(1222.21875, 1197.59375, 561.15625), Angle(0, 0, 0)},
{"br_swingbar", Vector(1566.3125, 1181.9375, 465.78125), Angle(0, -45, 0)}, {"br_swingbar", Vector(1566.3125, 1181.9375, 465.78125), Angle(0, -45, 0)},
{"br_swingbar", Vector(1792.15625, 1228.65625, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1228.65625, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(1792.15625, 1062.25, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1062.25, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(1792.15625, 1156.25, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1156.25, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1417.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1417.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1323.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1323.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1489.59375, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1489.59375, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1417.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1417.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1323.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1323.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2309.21875, 1489.59375, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2309.21875, 1489.59375, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2076.34375, 1417.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2076.34375, 1417.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2076.34375, 1323.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2076.34375, 1323.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2076.375, 1489.59375, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(2076.375, 1489.59375, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(1792.15625, 1417.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1417.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(1792.15625, 1323.1875, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1323.1875, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(1792.15625, 1489.59375, 228.59375), Angle(0, 0, 0)}, {"br_swingbar", Vector(1792.15625, 1489.59375, 228.59375), Angle(0, 0, 0)},
{"br_swingbar", Vector(2014.34375, 2145.6875, 670.9375), Angle(0, 45, 0)}, {"br_swingbar", Vector(2014.34375, 2145.6875, 670.9375), Angle(0, 45, 0)},
{"br_swingbar", Vector(2014.34375, 2145.6875, 355.125), Angle(0, 45, 0)}, {"br_swingbar", Vector(2014.34375, 2145.6875, 355.125), Angle(0, 45, 0)},
{"br_swingbar", Vector(1967.34375, 1558.59375, 582.5625), Angle(0, 90, 0)}, {"br_swingbar", Vector(1967.34375, 1558.59375, 582.5625), Angle(0, 90, 0)},
{"br_swingbar", Vector(2014.34375, 2145.6875, 454.21875), Angle(0, 45, 0)}, {"br_swingbar", Vector(2014.34375, 2145.6875, 454.21875), Angle(0, 45, 0)},
{"br_swingbar", Vector(-302.65625, 5230.15625, 461.625), Angle(0, 90, 0)}, {"br_swingbar", Vector(-302.65625, 5230.15625, 461.625), Angle(0, 90, 0)},
{"br_swingbar", Vector(-445.125, 5230.15625, 461.59375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-445.125, 5230.15625, 461.59375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-350.5, 5230.15625, 461.59375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-350.5, 5230.15625, 461.59375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-350.5, 5692.8125, 381.84375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-350.5, 5692.8125, 381.84375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-302.65625, 5692.8125, 381.84375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-302.65625, 5692.8125, 381.84375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-445.125, 5692.8125, 381.84375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-445.125, 5692.8125, 381.84375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-350.5, 5489.90625, 420.3125), Angle(0, 90, 0)}, {"br_swingbar", Vector(-350.5, 5489.90625, 420.3125), Angle(0, 90, 0)},
{"br_swingbar", Vector(-302.65625, 5489.90625, 420.34375), Angle(0, 90, 0)}, {"br_swingbar", Vector(-302.65625, 5489.90625, 420.34375), Angle(0, 90, 0)},
{"br_swingbar", Vector(-445.125, 5489.90625, 420.3125), Angle(0, 90, 0)}, {"br_swingbar", Vector(-445.125, 5489.90625, 420.3125), Angle(0, 90, 0)},
{"br_swingbar", Vector(446.40625, 4603.78125, 370.9375), Angle(0, 0, 0)}, {"br_swingbar", Vector(446.40625, 4603.78125, 370.9375), Angle(0, 0, 0)},
{"br_swingbar", Vector(446.40625, 4698.09375, 370.9375), Angle(0, 0, 0)}, {"br_swingbar", Vector(446.40625, 4698.09375, 370.9375), Angle(0, 0, 0)},
{"br_swingbar", Vector(446.40625, 4509.8125, 370.9375), Angle(0, 0, 0)}, {"br_swingbar", Vector(446.40625, 4509.8125, 370.9375), Angle(0, 0, 0)},
{"br_swingbar", Vector(446.40625, 4415.53125, 370.9375), Angle(0, 0, 0)}, {"br_swingbar", Vector(446.40625, 4415.53125, 370.9375), Angle(0, 0, 0)},
{"br_swingbar", Vector(748.8125, 4341.1875, 374), Angle(0, 90, 0)}, {"br_swingbar", Vector(748.8125, 4341.1875, 374), Angle(0, 90, 0)},
{"br_swingbar", Vector(654.09375, 4341.1875, 374), Angle(0, 90, 0)}, {"br_swingbar", Vector(654.09375, 4341.1875, 374), Angle(0, 90, 0)},
{"br_swingbar", Vector(558.34375, 4341.1875, 374), Angle(0, 90, 0)}, {"br_swingbar", Vector(558.34375, 4341.1875, 374), Angle(0, 90, 0)},
{"br_swingbar", Vector(1261.25, 4447.3125, 229.40625), Angle(0, -90, 0)}, {"br_swingbar", Vector(1261.25, 4447.3125, 229.40625), Angle(0, -90, 0)},
{"br_swingbar", Vector(1425.46875, 4447.3125, 229.40625), Angle(0, -90, 0)}, {"br_swingbar", Vector(1425.46875, 4447.3125, 229.40625), Angle(0, -90, 0)},
{"br_swingbar", Vector(1331.21875, 4447.3125, 229.40625), Angle(0, -90, 0)}, {"br_swingbar", Vector(1331.21875, 4447.3125, 229.40625), Angle(0, -90, 0)},
{"br_swingbar", Vector(1261.25, 4259.6875, 165.875), Angle(0, -90, 0)}, {"br_swingbar", Vector(1261.25, 4259.6875, 165.875), Angle(0, -90, 0)},
{"br_swingbar", Vector(1425.46875, 4259.6875, 165.875), Angle(0, -90, 0)}, {"br_swingbar", Vector(1425.46875, 4259.6875, 165.875), Angle(0, -90, 0)},
{"br_swingbar", Vector(1331.21875, 4259.6875, 165.875), Angle(0, -90, 0)}, {"br_swingbar", Vector(1331.21875, 4259.6875, 165.875), Angle(0, -90, 0)},
{"br_swingbar", Vector(377.3125, 4595.125, -248.8125), Angle(-15, 0, 0)}, {"br_swingbar", Vector(377.3125, 4595.125, -248.8125), Angle(-15, 0, 0)},
{"br_swingbar", Vector(377.3125, 4689.65625, -248.8125), Angle(-15, 0, 0)}, {"br_swingbar", Vector(377.3125, 4689.65625, -248.8125), Angle(-15, 0, 0)},
{"br_swingbar", Vector(1504.59375, 4527.5625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1504.59375, 4527.5625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1504.59375, 4811.40625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1504.59375, 4811.40625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1504.59375, 4622.09375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1504.59375, 4622.09375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1504.59375, 4716.84375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1504.59375, 4716.84375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1166.28125, 4527.5625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1166.28125, 4527.5625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1166.28125, 4811.40625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1166.28125, 4811.40625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1166.28125, 4622.09375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1166.28125, 4622.09375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1166.28125, 4716.84375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1166.28125, 4716.84375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1718, 4527.5625, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1718, 4527.5625, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.34375, 4811.40625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.34375, 4811.40625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1718, 4622.09375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1718, 4622.09375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1718, 4716.84375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1718, 4716.84375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(538.03125, 4595.125, -248.78125), Angle(-14.96875, 0, 0)}, {"br_swingbar", Vector(538.03125, 4595.125, -248.78125), Angle(-14.96875, 0, 0)},
{"br_swingbar", Vector(538.03125, 4689.65625, -248.78125), Angle(-14.96875, 0, 0)}, {"br_swingbar", Vector(538.03125, 4689.65625, -248.78125), Angle(-14.96875, 0, 0)},
{"br_swingbar", Vector(967.3125, 4622.09375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4622.09375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.3125, 4527.5625, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4527.5625, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.3125, 4716.84375, 216.03125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4716.84375, 216.03125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.3125, 4622.09375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4622.09375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.3125, 4527.5625, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4527.5625, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(967.3125, 4716.84375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(967.3125, 4716.84375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1202.625, 4622.09375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1202.625, 4622.09375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1202.625, 4527.5625, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1202.625, 4527.5625, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1202.625, 4716.84375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1202.625, 4716.84375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1481.375, 4622.09375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1481.375, 4622.09375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1481.375, 4527.5625, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1481.375, 4527.5625, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1481.375, 4716.84375, -37.53125), Angle(0, 0, 0)}, {"br_swingbar", Vector(1481.375, 4716.84375, -37.53125), Angle(0, 0, 0)},
{"br_swingbar", Vector(1773.0625, 4249.3125, -0.875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1773.0625, 4249.3125, -0.875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1774.59375, 4251.5, -0.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1774.59375, 4251.5, -0.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1938, 4251.5, -0.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1938, 4251.5, -0.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1866.53125, 4249.3125, -0.875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1866.53125, 4249.3125, -0.875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1868.0625, 4251.5, -0.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1868.0625, 4251.5, -0.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1936.46875, 4249.3125, -0.875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1936.46875, 4249.3125, -0.875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1773.0625, 4399.96875, -91.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1773.0625, 4399.96875, -91.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1938, 4402.15625, -90.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(1938, 4402.15625, -90.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(1866.53125, 4399.96875, -91.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1866.53125, 4399.96875, -91.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1868.0625, 4402.15625, -90.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(1868.0625, 4402.15625, -90.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(1936.46875, 4399.96875, -91.1875), Angle(0, 90, 0)}, {"br_swingbar", Vector(1936.46875, 4399.96875, -91.1875), Angle(0, 90, 0)},
{"br_swingbar", Vector(1774.59375, 4402.15625, -90.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(1774.59375, 4402.15625, -90.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(538.03125, 4689.65625, -5.46875), Angle(-15, 0, 0)}, {"br_swingbar", Vector(538.03125, 4689.65625, -5.46875), Angle(-15, 0, 0)},
{"br_swingbar", Vector(538.03125, 4595.125, -5.46875), Angle(-15, 0, 0)}, {"br_swingbar", Vector(538.03125, 4595.125, -5.46875), Angle(-15, 0, 0)},
{"br_swingbar", Vector(377.3125, 4595.125, -5.46875), Angle(-15, 0, 0)}, {"br_swingbar", Vector(377.3125, 4595.125, -5.46875), Angle(-15, 0, 0)},
{"br_swingbar", Vector(377.3125, 4689.65625, -5.46875), Angle(-15, 0, 0)}, {"br_swingbar", Vector(377.3125, 4689.65625, -5.46875), Angle(-15, 0, 0)},
{"br_swingbar", Vector(-740.78125, 2292.65625, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-740.78125, 2292.65625, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-740.75, 2385.21875, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-740.75, 2385.21875, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-519.09375, 2385.21875, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-519.09375, 2385.21875, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-519.09375, 2292.65625, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-519.09375, 2292.65625, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-238.9375, 2385.21875, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-238.9375, 2385.21875, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-17.28125, 2292.65625, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-17.28125, 2292.65625, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-238.9375, 2292.65625, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-238.9375, 2292.65625, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(-17.28125, 2385.21875, 638.25), Angle(0, 0, 0)}, {"br_swingbar", Vector(-17.28125, 2385.21875, 638.25), Angle(0, 0, 0)},
{"br_swingbar", Vector(927.21875, 2399.8125, 115.3125), Angle(0, 135, 0)}, {"br_swingbar", Vector(927.21875, 2399.8125, 115.3125), Angle(0, 135, 0)},
{"br_swingbar", Vector(913.59375, 2681.71875, 114.09375), Angle(0, 90, 0)}, {"br_swingbar", Vector(913.59375, 2681.71875, 114.09375), Angle(0, 90, 0)},
{"br_swingbar", Vector(1309.09375, 2333.59375, 19), Angle(0, -45, 0)}, {"br_swingbar", Vector(1309.09375, 2333.59375, 19), Angle(0, -45, 0)},
{"br_swingbar", Vector(1360.53125, 2053.5625, -3.59375), Angle(0, -90, 0)}, {"br_swingbar", Vector(1360.53125, 2053.5625, -3.59375), Angle(0, -90, 0)},
{"br_swingbar", Vector(1360.90625, 1734.5625, -65.09375), Angle(0, -90, 0)}, {"br_swingbar", Vector(1360.90625, 1734.5625, -65.09375), Angle(0, -90, 0)},
{"br_swingbar", Vector(1316.84375, 1415.65625, -84.125), Angle(0, -60, 0)}, {"br_swingbar", Vector(1316.84375, 1415.65625, -84.125), Angle(0, -60, 0)},
{"br_swingbar", Vector(1765.78125, 1377.84375, -99.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(1765.78125, 1377.84375, -99.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(1765.78125, 1284.0625, -99.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(1765.78125, 1284.0625, -99.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(1529.1875, 1197.1875, -99.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(1529.1875, 1197.1875, -99.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(1529.1875, 1290.96875, -99.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(1529.1875, 1290.96875, -99.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2635.4375, 1493.15625, 8.46875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2635.4375, 1493.15625, 8.46875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2635.4375, 1330.03125, 8.5), Angle(0, 0, 0)}, {"br_swingbar", Vector(2635.4375, 1330.03125, 8.5), Angle(0, 0, 0)},
{"br_swingbar", Vector(2713.09375, 1418.4375, 99.78125), Angle(0, 0, 0)}, {"br_swingbar", Vector(2713.09375, 1418.4375, 99.78125), Angle(0, 0, 0)},
{"br_swingbar", Vector(2055, 1418.4375, -183.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2055, 1418.4375, -183.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2055, 1488.59375, -183.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2055, 1488.59375, -183.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2055, 1325.46875, -183.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2055, 1325.46875, -183.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2237, 1418.4375, -140.96875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2237, 1418.4375, -140.96875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2237, 1488.59375, -141), Angle(0, 0, 0)}, {"br_swingbar", Vector(2237, 1488.59375, -141), Angle(0, 0, 0)},
{"br_swingbar", Vector(2237, 1325.46875, -140.96875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2237, 1325.46875, -140.96875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2463.84375, 1418.4375, -85.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2463.84375, 1418.4375, -85.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2463.84375, 1488.59375, -85.71875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2463.84375, 1488.59375, -85.71875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2463.84375, 1325.46875, -85.6875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2463.84375, 1325.46875, -85.6875), Angle(0, 0, 0)},
{"br_swingbar", Vector(2635.4375, 1423, 8.46875), Angle(0, 0, 0)}, {"br_swingbar", Vector(2635.4375, 1423, 8.46875), Angle(0, 0, 0)},
{"br_swingbar", Vector(-2400.0625, 95.59375, 307.90625), Angle(0, 45, 0)}, {"br_swingbar", Vector(-2400.0625, 95.59375, 307.90625), Angle(0, 45, 0)},
{"br_swingbar", Vector(2274.5, 2412.0625, 136.46875), Angle(0, -90, 0)}, {"br_swingbar", Vector(2274.5, 2412.0625, 136.46875), Angle(0, -90, 0)},
{"br_swingbar", Vector(2274.5, 2650.0625, 123.46875), Angle(0, -90, 0)}, {"br_swingbar", Vector(2274.5, 2650.0625, 123.46875), Angle(0, -90, 0)},
{"br_swingbar", Vector(2606.75, 1556, 594.78125), Angle(0, -90, 0)}, {"br_swingbar", Vector(2606.75, 1556, 594.78125), Angle(0, -90, 0)},
{"br_swingbar", Vector(2600.21875, 1798.09375, 611.125), Angle(0, -90, 0)}, {"br_swingbar", Vector(2600.21875, 1798.09375, 611.125), Angle(0, -90, 0)},
{"br_swingbar", Vector(2582.125, 2146.9375, 531.6875), Angle(0, -45, 0)}, {"br_swingbar", Vector(2582.125, 2146.9375, 531.6875), Angle(0, -45, 0)},
{"br_swingbar", Vector(2437.125, 2715.25, 377.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(2437.125, 2715.25, 377.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(2345.5, 2715.25, 377.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(2345.5, 2715.25, 377.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(2376.90625, 2456.28125, 377.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(2376.90625, 2456.28125, 377.5), Angle(0, 90, 0)},
{"br_swingbar", Vector(2285.28125, 2456.28125, 377.5), Angle(0, 90, 0)}, {"br_swingbar", Vector(2285.28125, 2456.28125, 377.5), Angle(0, 90, 0)},
{"br_anticampbox", Vector(-778.63702392578, -1732.625, 1833.2685546875), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-778.63702392578, -1732.625, 1833.2685546875), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-1413.6267089844, -889.77520751953, 1408.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-1413.6267089844, -889.77520751953, 1408.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-2296.6579589844, -766.48419189453, 1152.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-2296.6579589844, -766.48419189453, 1152.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-1411.6685791016, 7568.8515625, 1024.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-1411.6685791016, 7568.8515625, 1024.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(653.60040283203, 7546.6235351563, 1024.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(653.60040283203, 7546.6235351563, 1024.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(1083.7712402344, 3445.6235351563, 896.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(1083.7712402344, 3445.6235351563, 896.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(1605.3482666016, 3456.8474121094, 896.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(1605.3482666016, 3456.8474121094, 896.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(2105.6247558594, 3471.8090820313, 896.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(2105.6247558594, 3471.8090820313, 896.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(4092.0490722656, 4081.3520507813, 1280.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(4092.0490722656, 4081.3520507813, 1280.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(4089.609375, 2811.6884765625, 1280.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(4089.609375, 2811.6884765625, 1280.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(3846.6906738281, 2050.796875, 1216.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(3846.6906738281, 2050.796875, 1216.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(3843.7377929688, 1138.6533203125, 1216.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(3843.7377929688, 1138.6533203125, 1216.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(2306.8647460938, 1014.7623291016, 1474.8770751953), Angle(0, 0, 0)}, {"br_anticampbox", Vector(2306.8647460938, 1014.7623291016, 1474.8770751953), Angle(0, 0, 0)},
{"br_anticampbox", Vector(501.71005249023, 63.838512420654, 1280.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(501.71005249023, 63.838512420654, 1280.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-74.375015258789, 125.63264465332, 1408.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-74.375015258789, 125.63264465332, 1408.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-136.48791503906, -894.35400390625, 1408.03125), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-136.48791503906, -894.35400390625, 1408.03125), Angle(0, 0, 0)},
{"br_anticampbox", Vector(-380.66781616211, 1725.1768798828, 2131.5939941406), Angle(0, 0, 0)}, {"br_anticampbox", Vector(-380.66781616211, 1725.1768798828, 2131.5939941406), Angle(0, 0, 0)},
} }
function PrintAllBars() function PrintAllBars()
for k,v in pairs(ents.FindByClass("br_swingbar")) do for k, v in pairs(ents.FindByClass("br_swingbar")) do
local pos, ang = v:GetPos(), v:GetAngles() local pos, ang = v:GetPos(), v:GetAngles()
local str = '{"br_swingbar", Vector('..pos.x..", "..pos.y..", "..pos.z.."), Angle("..ang.x..", "..ang.y..", "..ang.z..")}," local str = "{\"br_swingbar\", Vector(" .. pos.x .. ", " .. pos.y .. ", " .. pos.z .. "), Angle(" .. ang.x .. ", " .. ang.y .. ", " .. ang.z .. ")},"
print(str) print(str)
end end
end end
function PrintAllCampBoxes() function PrintAllCampBoxes()
for k,v in pairs(ents.FindByClass("br_anticampbox")) do for k, v in pairs(ents.FindByClass("br_anticampbox")) do
local pos, ang = v:GetPos(), v:GetAngles() local pos, ang = v:GetPos(), v:GetAngles()
local str = '{"br_anticampbox", Vector('..pos.x..", "..pos.y..", "..pos.z.."), Angle("..ang.x..", "..ang.y..", "..ang.z..")}," local str = "{\"br_anticampbox\", Vector(" .. pos.x .. ", " .. pos.y .. ", " .. pos.z .. "), Angle(" .. ang.x .. ", " .. ang.y .. ", " .. ang.z .. ")},"
print(str) print(str)
end end
end end
local function CreateSpawnEntities() local function CreateSpawnEntities()
for k,v in ipairs(spawn) do for k, v in ipairs(spawn) do
BRProtectedEntity(v[1], v[2], v[3]) BRProtectedEntity(v[1], v[2], v[3])
end end
end end
hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities)
hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities)
game.CleanUpMap = CleanUpMapDetoured game.CleanUpMap = CleanUpMapDetoured
local skypaint local skypaint
hook.Add("PlayerSpawn", "CubixInit", function() hook.Add("PlayerSpawn", "CubixInit", function()
RunConsoleCommand("sv_skyname","painted") RunConsoleCommand("sv_skyname", "painted")
if !skypaint then
if not skypaint then
skypaint = ents.Create("env_skypaint") skypaint = ents.Create("env_skypaint")
WhitescaleOn() WhitescaleOn()
end end
@ -222,16 +226,20 @@ end)
hook.Add("OnEntityCreated", "BlacklistedEnts", function(ent) hook.Add("OnEntityCreated", "BlacklistedEnts", function(ent)
if IsValid(ent) and blacklistedents[ent:GetClass()] then if IsValid(ent) and blacklistedents[ent:GetClass()] then
ent:Remove() ent:Remove()
return return
end end
if IsValid(ent) and ent:GetClass()=="func_button" and ent:GetName() == "device_ctrl" then
if IsValid(ent) and ent:GetClass() == "func_button" and ent:GetName() == "device_ctrl" then
ent:Remove() ent:Remove()
return return
end end
timer.Simple(0, function() timer.Simple(0, function()
if IsValid(ent) and (ent:GetClass()=="prop_physics" or ent:GetClass()=="prop_physics_respawnable") then if IsValid(ent) and (ent:GetClass() == "prop_physics" or ent:GetClass() == "prop_physics_respawnable") then
local phys = ent:GetPhysicsObject() local phys = ent:GetPhysicsObject()
if IsValid(phys) then if IsValid(phys) then
phys:EnableMotion(false) phys:EnableMotion(false)
end end
@ -240,8 +248,7 @@ hook.Add("OnEntityCreated", "BlacklistedEnts", function(ent)
end) end)
hook.Add("PlayerUse", "button", function(ply, ent) hook.Add("PlayerUse", "button", function(ply, ent)
if ent:GetName() == "device_ctrl" then if ent:GetName() == "device_ctrl" then return false end
return false
end
end) end)
print("Loaded cubix") print("Loaded cubix")

View file

@ -1,17 +1,18 @@
local spawn = { local spawn = {
{"br_databank", Vector(46.673126220703,957.37548828125,256.03125)}, {"br_databank", Vector(46.673126220703, 957.37548828125, 256.03125)},
{"br_databank", Vector(-3.3380174636841,-939.83837890625,256.03125)}, {"br_databank", Vector(-3.3380174636841, -939.83837890625, 256.03125)},
{"br_databank", Vector(946.02209472656,269.16903686523,522.03125)}, {"br_databank", Vector(946.02209472656, 269.16903686523, 522.03125)},
{"br_databank", Vector(-802.15405273438,343.96166992188,272.03125)}, {"br_databank", Vector(-802.15405273438, 343.96166992188, 272.03125)},
{"br_databank", Vector(-694.69586181641,-590.50836181641,272.03125)}, {"br_databank", Vector(-694.69586181641, -590.50836181641, 272.03125)},
{"br_databank", Vector(-46.449630737305,-1083.9945068359,256.03125)}, {"br_databank", Vector(-46.449630737305, -1083.9945068359, 256.03125)},
{"br_databank", Vector(651.01989746094,-464.4665222168,458.03125)}, {"br_databank", Vector(651.01989746094, -464.4665222168, 458.03125)},
} }
local function CreateSpawnEntities() local function CreateSpawnEntities()
for k,v in ipairs(spawn) do for k, v in ipairs(spawn) do
BRProtectedEntity(v[1], v[2], angle_zero) BRProtectedEntity(v[1], v[2], angle_zero)
end end
end end
hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("InitPostEntity", "CreateSpawnEntities", CreateSpawnEntities)
hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities) hook.Add("PostCleanupMap", "CreateSpawnEntities", CreateSpawnEntities)

View file

@ -3,11 +3,11 @@ hook.Add("OnEntityCreated", "lol", function(ent)
SafeRemoveEntityDelayed(ent, 0.1) SafeRemoveEntityDelayed(ent, 0.1)
end end
if ent:GetClass()=="trigger_weapon_strip" then if ent:GetClass() == "trigger_weapon_strip" then
ent:Remove() ent:Remove()
end end
if ent:GetClass()=="trigger_once" then if ent:GetClass() == "trigger_once" then
ent:Remove() ent:Remove()
end end
end) end)

View file

@ -1,20 +1,24 @@
function CreateRopes() function CreateRopes()
local ents = ents.GetAll() local ents = ents.GetAll()
for k,v in pairs(ents) do
for k, v in pairs(ents) do
if v:GetClass() == "move_rope" then if v:GetClass() == "move_rope" then
local endpoint = v:GetInternalVariable("m_hEndPoint") local endpoint = v:GetInternalVariable("m_hEndPoint")
if IsValid(endpoint) then if IsValid(endpoint) then
local zipline = CreateZipline(v:GetPos(), endpoint:GetPos()) local zipline = CreateZipline(v:GetPos(), endpoint:GetPos())
zipline:SetNW2Bool("BRProtected", true) zipline:SetNW2Bool("BRProtected", true)
end end
end end
end end
for k,v in pairs(ents) do for k, v in pairs(ents) do
if v:GetClass():find("rope") then if v:GetClass():find("rope") then
v:Remove() v:Remove()
end end
end end
hook.Remove("InitPostEntity", "CreateRopes") hook.Remove("InitPostEntity", "CreateRopes")
end end

View file

@ -1,20 +1,24 @@
function CreateRopes() function CreateRopes()
local ents = ents.GetAll() local ents = ents.GetAll()
for k,v in pairs(ents) do
for k, v in pairs(ents) do
if v:GetClass() == "move_rope" then if v:GetClass() == "move_rope" then
local endpoint = v:GetInternalVariable("m_hEndPoint") local endpoint = v:GetInternalVariable("m_hEndPoint")
if IsValid(endpoint) then if IsValid(endpoint) then
local zipline = CreateZipline(v:GetPos(), endpoint:GetPos()) local zipline = CreateZipline(v:GetPos(), endpoint:GetPos())
zipline:SetNW2Bool("BRProtected", true) zipline:SetNW2Bool("BRProtected", true)
end end
end end
end end
for k,v in pairs(ents) do for k, v in pairs(ents) do
if v:GetClass():find("rope") then if v:GetClass():find("rope") then
v:Remove() v:Remove()
end end
end end
hook.Remove("InitPostEntity", "CreateRopes") hook.Remove("InitPostEntity", "CreateRopes")
end end

View file

@ -1,20 +1,24 @@
function CreateRopes() function CreateRopes()
local ents = ents.GetAll() local ents = ents.GetAll()
for k,v in pairs(ents) do
for k, v in pairs(ents) do
if v:GetClass() == "move_rope" then if v:GetClass() == "move_rope" then
local endpoint = v:GetInternalVariable("m_hEndPoint") local endpoint = v:GetInternalVariable("m_hEndPoint")
if IsValid(endpoint) then if IsValid(endpoint) then
local zipline = CreateZipline(v:GetPos(), endpoint:GetPos()) local zipline = CreateZipline(v:GetPos(), endpoint:GetPos())
zipline:SetNW2Bool("BRProtected", true) zipline:SetNW2Bool("BRProtected", true)
end end
end end
end end
for k,v in pairs(ents) do for k, v in pairs(ents) do
if v:GetClass():find("rope") then if v:GetClass():find("rope") then
v:Remove() v:Remove()
end end
end end
hook.Remove("InitPostEntity", "CreateRopes") hook.Remove("InitPostEntity", "CreateRopes")
end end

View file

@ -1,20 +1,24 @@
function CreateRopes() function CreateRopes()
local ents = ents.GetAll() local ents = ents.GetAll()
for k,v in pairs(ents) do
for k, v in pairs(ents) do
if v:GetClass() == "move_rope" then if v:GetClass() == "move_rope" then
local endpoint = v:GetInternalVariable("m_hEndPoint") local endpoint = v:GetInternalVariable("m_hEndPoint")
if IsValid(endpoint) then if IsValid(endpoint) then
local zipline = CreateZipline(v:GetPos(), endpoint:GetPos()) local zipline = CreateZipline(v:GetPos(), endpoint:GetPos())
zipline:SetNW2Bool("BRProtected", true) zipline:SetNW2Bool("BRProtected", true)
end end
end end
end end
for k,v in pairs(ents) do for k, v in pairs(ents) do
if v:GetClass():find("rope") then if v:GetClass():find("rope") then
v:Remove() v:Remove()
end end
end end
hook.Remove("InitPostEntity", "CreateRopes") hook.Remove("InitPostEntity", "CreateRopes")
end end

View file

@ -1,8 +1,12 @@
if not game.SinglePlayer() then return end
local bigboy = false local bigboy = false
local welcome = { local welcome = {
w = 700, w = 700,
h = 400 h = 400
} }
welcome.x = 960 - welcome.w * 0.5 welcome.x = 960 - welcome.w * 0.5
welcome.y = 540 - welcome.h * 0.5 welcome.y = 540 - welcome.h * 0.5
welcome.bgcolor = Color(32, 32, 32) welcome.bgcolor = Color(32, 32, 32)
@ -10,12 +14,12 @@ welcome.outlinecolor = Color(54, 55, 56)
welcome.alpha = 0.9 welcome.alpha = 0.9
welcome.elements = {} welcome.elements = {}
/* --[[
local function closebutton(self) local function closebutton(self)
LocalPlayer():EmitSound("holygrenade.mp3") LocalPlayer():EmitSound("holygrenade.mp3")
AEUI:Clear() AEUI:Clear()
end end
*/ ]]
local function warnclosebutton(self) local function warnclosebutton(self)
LocalPlayer():EmitSound("holygrenade.mp3") LocalPlayer():EmitSound("holygrenade.mp3")
@ -24,10 +28,9 @@ local function warnclosebutton(self)
bigboy = true bigboy = true
end end
if not game.SinglePlayer() then return end
local addons = 0 local addons = 0
local warning = Material("vgui/warning.png") local warning = Material("vgui/warning.png")
local shit = { local shit = {
["378401390"] = true, ["378401390"] = true,
["2027577882"] = true, ["2027577882"] = true,
@ -48,16 +51,19 @@ local shit = {
["142911907"] = true, ["142911907"] = true,
["2316713217"] = true ["2316713217"] = true
} }
local warnpanel = { local warnpanel = {
w = 500, w = 500,
h = 350 h = 350
} }
warnpanel.x = 960 - warnpanel.w * 0.5 warnpanel.x = 960 - warnpanel.w * 0.5
warnpanel.y = 540 - warnpanel.h * 0.5 warnpanel.y = 540 - warnpanel.h * 0.5
warnpanel.bgcolor = Color(32, 32, 32) warnpanel.bgcolor = Color(32, 32, 32)
warnpanel.outlinecolor = Color(54, 55, 56) warnpanel.outlinecolor = Color(54, 55, 56)
warnpanel.alpha = 0.9 warnpanel.alpha = 0.9
warnpanel.elements = {} warnpanel.elements = {}
local conflictpanel = { local conflictpanel = {
w = 400, w = 400,
h = 150, h = 150,
@ -68,6 +74,7 @@ local conflictpanel = {
alpha = 1, alpha = 1,
elements = {} elements = {}
} }
local warntext = { local warntext = {
type = "Text", type = "Text",
font = "AEUIDefault", font = "AEUIDefault",
@ -88,10 +95,11 @@ local quitbutton = {
centered = true, centered = true,
color = color_white, color = color_white,
string = "Return to Main Menu", string = "Return to Main Menu",
onclick = function (self) onclick = function(self)
surface.PlaySound("garrysmod/ui_click.wav") surface.PlaySound("garrysmod/ui_click.wav")
MsgC(Color(255, 100, 100), "Quitting Beatrun due to conflicting addons!") MsgC(Color(255, 100, 100), "Quitting Beatrun due to conflicting addons!")
timer.Simple(0.5, function ()
timer.Simple(0.5, function()
RunConsoleCommand("killserver") RunConsoleCommand("killserver")
end) end)
@ -146,6 +154,7 @@ local function Seal()
local eyeang = EyeAngles() local eyeang = EyeAngles()
LocalPlayer():DrawViewModel(false) LocalPlayer():DrawViewModel(false)
render.RenderView({ render.RenderView({
y = 0, y = 0,
x = 0, x = 0,
@ -154,6 +163,7 @@ local function Seal()
w = w, w = w,
h = h h = h
}) })
render.SetScissorRect(0, 0, w, h, true) render.SetScissorRect(0, 0, w, h, true)
local light = render.GetLightColor(eyepos) local light = render.GetLightColor(eyepos)
@ -171,11 +181,14 @@ local function Seal()
surface.SetDrawColor(math.min(colx, 255), math.min(coly, 255), math.min(colz, 255), 255) surface.SetDrawColor(math.min(colx, 255), math.min(coly, 255), math.min(colz, 255), 255)
surface.SetMaterial(sealplead) surface.SetMaterial(sealplead)
surface.DrawTexturedRectRotated(x + w * 0.5, y + h * 0.5, w + x, h + y + math.abs(math.sin(CurTime()) * 10), eyeang.z) surface.DrawTexturedRectRotated(x + w * 0.5, y + h * 0.5, w + x, h + y + math.abs(math.sin(CurTime()) * 10), eyeang.z)
render.SetScissorRect(0, 0, 0, 0, false) render.SetScissorRect(0, 0, 0, 0, false)
surface.SetFont("BeatrunHUD") surface.SetFont("BeatrunHUD")
surface.SetTextPos(2, 0) surface.SetTextPos(2, 0)
surface.SetTextColor(220, 20, 20, math.abs(math.sin(CurTime() * 2) * 255)) surface.SetTextColor(220, 20, 20, math.abs(math.sin(CurTime() * 2) * 255))
surface.DrawText(REC .. " LIVE PLAYER CAM") surface.DrawText(REC .. " LIVE PLAYER CAM")
LocalPlayer():DrawViewModel(true) LocalPlayer():DrawViewModel(true)
end end
@ -202,7 +215,7 @@ else
end end
if conflictlist.string ~= "" then if conflictlist.string ~= "" then
timer.Simple(0, function () timer.Simple(0, function()
AEUI:AddPanel(warnpanel) AEUI:AddPanel(warnpanel)
AEUI:AddPanel(conflictpanel) AEUI:AddPanel(conflictpanel)
end) end)

View file

@ -1,45 +1,5 @@
local playermodelbones = { local playermodelbones = {"ValveBiped.Bip01_R_Clavicle", "ValveBiped.Bip01_R_UpperArm", "ValveBiped.Bip01_R_Forearm", "ValveBiped.Bip01_R_Hand", "ValveBiped.Bip01_L_Clavicle", "ValveBiped.Bip01_L_UpperArm", "ValveBiped.Bip01_L_Forearm", "ValveBiped.Bip01_L_Hand", "ValveBiped.Bip01_L_Wrist", "ValveBiped.Bip01_R_Wrist", "ValveBiped.Bip01_L_Finger4", "ValveBiped.Bip01_L_Finger41", "ValveBiped.Bip01_L_Finger42", "ValveBiped.Bip01_L_Finger3", "ValveBiped.Bip01_L_Finger31", "ValveBiped.Bip01_L_Finger32", "ValveBiped.Bip01_L_Finger2", "ValveBiped.Bip01_L_Finger21", "ValveBiped.Bip01_L_Finger22", "ValveBiped.Bip01_L_Finger1", "ValveBiped.Bip01_L_Finger11", "ValveBiped.Bip01_L_Finger12", "ValveBiped.Bip01_L_Finger0", "ValveBiped.Bip01_L_Finger01", "ValveBiped.Bip01_L_Finger02", "ValveBiped.Bip01_R_Finger4", "ValveBiped.Bip01_R_Finger41", "ValveBiped.Bip01_R_Finger42", "ValveBiped.Bip01_R_Finger3", "ValveBiped.Bip01_R_Finger31", "ValveBiped.Bip01_R_Finger32", "ValveBiped.Bip01_R_Finger2", "ValveBiped.Bip01_R_Finger21", "ValveBiped.Bip01_R_Finger22", "ValveBiped.Bip01_R_Finger1", "ValveBiped.Bip01_R_Finger11", "ValveBiped.Bip01_R_Finger12", "ValveBiped.Bip01_R_Finger0", "ValveBiped.Bip01_R_Finger01", "ValveBiped.Bip01_R_Finger02"}
"ValveBiped.Bip01_R_Clavicle",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Bip01_L_Clavicle",
"ValveBiped.Bip01_L_UpperArm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Bip01_L_Wrist",
"ValveBiped.Bip01_R_Wrist",
"ValveBiped.Bip01_L_Finger4",
"ValveBiped.Bip01_L_Finger41",
"ValveBiped.Bip01_L_Finger42",
"ValveBiped.Bip01_L_Finger3",
"ValveBiped.Bip01_L_Finger31",
"ValveBiped.Bip01_L_Finger32",
"ValveBiped.Bip01_L_Finger2",
"ValveBiped.Bip01_L_Finger21",
"ValveBiped.Bip01_L_Finger22",
"ValveBiped.Bip01_L_Finger1",
"ValveBiped.Bip01_L_Finger11",
"ValveBiped.Bip01_L_Finger12",
"ValveBiped.Bip01_L_Finger0",
"ValveBiped.Bip01_L_Finger01",
"ValveBiped.Bip01_L_Finger02",
"ValveBiped.Bip01_R_Finger4",
"ValveBiped.Bip01_R_Finger41",
"ValveBiped.Bip01_R_Finger42",
"ValveBiped.Bip01_R_Finger3",
"ValveBiped.Bip01_R_Finger31",
"ValveBiped.Bip01_R_Finger32",
"ValveBiped.Bip01_R_Finger2",
"ValveBiped.Bip01_R_Finger21",
"ValveBiped.Bip01_R_Finger22",
"ValveBiped.Bip01_R_Finger1",
"ValveBiped.Bip01_R_Finger11",
"ValveBiped.Bip01_R_Finger12",
"ValveBiped.Bip01_R_Finger0",
"ValveBiped.Bip01_R_Finger01",
"ValveBiped.Bip01_R_Finger02"
}
BodyAnim = BodyAnim or nil BodyAnim = BodyAnim or nil
BodyAnimMDL = BodyAnimMDL or nil BodyAnimMDL = BodyAnimMDL or nil
BodyAnimMDLarm = BodyAnimMDLarm or nil BodyAnimMDLarm = BodyAnimMDLarm or nil
@ -172,6 +132,7 @@ local transition = false
local matrixto = {} local matrixto = {}
local scalevec = Vector(1, 1, 1) local scalevec = Vector(1, 1, 1)
local matrixfrompos = Vector() local matrixfrompos = Vector()
armbones = { armbones = {
["ValveBiped.Bip01_L_Finger0"] = true, ["ValveBiped.Bip01_L_Finger0"] = true,
["ValveBiped.Bip01_L_Finger02"] = true, ["ValveBiped.Bip01_L_Finger02"] = true,
@ -269,6 +230,7 @@ function CacheLerpBodyAnim()
local bonematrix = self:GetBoneMatrix(bone) local bonematrix = self:GetBoneMatrix(bone)
bonematrix:SetTranslation(bonematrix:GetTranslation() - pos) bonematrix:SetTranslation(bonematrix:GetTranslation() - pos)
to[bone] = bonematrix:FastToTable(to[bone]) to[bone] = bonematrix:FastToTable(to[bone])
for i = 1, 3 do for i = 1, 3 do
@ -288,8 +250,8 @@ function CacheLerpBodyAnim()
local bt1 = bt[1] local bt1 = bt[1]
local bt2 = bt[2] local bt2 = bt[2]
local bt3 = bt[3] local bt3 = bt[3]
slot15 = bt[4] slot15 = bt[4]
self.m:SetUnpacked(bt1[1], bt1[2], bt1[3], bt1[4], bt2[1], bt2[2], bt2[3], bt2[4], bt3[1], bt3[2], bt3[3], bt3[4], 0, 0, 0, 1) self.m:SetUnpacked(bt1[1], bt1[2], bt1[3], bt1[4], bt2[1], bt2[2], bt2[3], bt2[4], bt3[1], bt3[2], bt3[3], bt3[4], 0, 0, 0, 1)
end end
@ -309,10 +271,12 @@ function StartBodyAnim(animtable)
local prestart = hook.Run("BodyAnimPreStart", animtable) local prestart = hook.Run("BodyAnimPreStart", animtable)
if prestart then return end if prestart then return end
if IsValid(BodyAnim) and not justremoved then return end if IsValid(BodyAnim) and not justremoved then return end
justremoved = false justremoved = false
local ply = LocalPlayer() local ply = LocalPlayer()
if ply:InVehicle() then return end if ply:InVehicle() then return end
animmodelstring = animtable.animmodelstring animmodelstring = animtable.animmodelstring
@ -361,6 +325,7 @@ function StartBodyAnim(animtable)
BodyAnim:SetAngles(Angle(0, ply:EyeAngles().y, 0)) BodyAnim:SetAngles(Angle(0, ply:EyeAngles().y, 0))
BodyAnim:SetPos(ply:GetPos()) BodyAnim:SetPos(ply:GetPos())
BodyAnim:SetNoDraw(false) BodyAnim:SetNoDraw(false)
BodyAnimStartPos:Set(BodyAnim:GetPos()) BodyAnimStartPos:Set(BodyAnim:GetPos())
if not IsValid(ply:GetHands()) then return end if not IsValid(ply:GetHands()) then return end
@ -529,7 +494,6 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
if BodyAnimPosEaseLerp < 1 then if BodyAnimPosEaseLerp < 1 then
local easedpos = LerpVector(BodyAnimPosEaseLerp, BodyAnimPosEase, pos) local easedpos = LerpVector(BodyAnimPosEaseLerp, BodyAnimPosEase, pos)
BodyAnimPosEaseLerp = math.Approach(BodyAnimPosEaseLerp, 1, FrameTime() * 5) BodyAnimPosEaseLerp = math.Approach(BodyAnimPosEaseLerp, 1, FrameTime() * 5)
BodyAnim:SetPos(easedpos) BodyAnim:SetPos(easedpos)
BodyAnim:SetRenderOrigin(easedpos) BodyAnim:SetRenderOrigin(easedpos)
else else
@ -634,6 +598,7 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
lasteyeang:Set(ply:EyeAngles()) lasteyeang:Set(ply:EyeAngles())
local vm = ply:GetViewModel() local vm = ply:GetViewModel()
BodyAnimEyeAng = attach.Ang BodyAnimEyeAng = attach.Ang
BodyAnimPos = attach.Pos BodyAnimPos = attach.Pos
lastattachpos = attach.Pos lastattachpos = attach.Pos
@ -668,13 +633,16 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
local MEAng = math.Truncate(ang.y, 2) local MEAng = math.Truncate(ang.y, 2)
local target = not lockang and MEAng or ply.OrigEyeAng.y local target = not lockang and MEAng or ply.OrigEyeAng.y
viewtiltlerp.y = math.ApproachAngle(viewtiltlerp.y, target, FT * (1 + math.abs(math.AngleDifference(viewtiltlerp.y, target)) * 5)) viewtiltlerp.y = math.ApproachAngle(viewtiltlerp.y, target, FT * (1 + math.abs(math.AngleDifference(viewtiltlerp.y, target)) * 5))
local MEAngDiff = math.AngleDifference(viewtiltlerp.y, not lockang and lastangy or ply.OrigEyeAng.y) * 0.15 local MEAngDiff = math.AngleDifference(viewtiltlerp.y, not lockang and lastangy or ply.OrigEyeAng.y) * 0.15
ViewTiltAngle = Angle(0, 0, MEAngDiff + viewtiltlerp.z)
ViewTiltAngle = Angle(0, 0, MEAngDiff + viewtiltlerp.z)
view.angles:Add(ViewTiltAngle) view.angles:Add(ViewTiltAngle)
ply:SetNoDraw(false) ply:SetNoDraw(false)
view.angles:Add(ply:GetViewPunchAngles() + ply:GetCLViewPunchAngles()) view.angles:Add(ply:GetViewPunchAngles() + ply:GetCLViewPunchAngles())
hook.Run("BodyAnimCalcView", view) hook.Run("BodyAnimCalcView", view)
@ -754,6 +722,7 @@ hook.Add("CreateMove", "BodyAnim_Mouse", function(cmd)
local oang = ply.OrigEyeAng local oang = ply.OrigEyeAng
local limitx = BodyLimitX or 30 local limitx = BodyLimitX or 30
local limity = BodyLimitY or 50 local limity = BodyLimitY or 50
pastlimitx = limitx < math.AngleDifference(nang.x, oang.x) pastlimitx = limitx < math.AngleDifference(nang.x, oang.x)
pastlimity = limity < math.abs(math.AngleDifference(nang.y, oang.y)) pastlimity = limity < math.abs(math.AngleDifference(nang.y, oang.y))

View file

@ -35,7 +35,6 @@ hook.Add("Tick", "BreathingLogic", function()
if nextbreath < CT then if nextbreath < CT then
ply:FaithVO("Faith.Breath." .. breathstring .. breathstringdur .. breathtype) ply:FaithVO("Faith.Breath." .. breathstring .. breathstringdur .. breathtype)
nextbreath = CT + (vel > 200 and 0.5 or 1.25 + math.random(0, 0.1)) + extradur nextbreath = CT + (vel > 200 and 0.5 or 1.25 + math.random(0, 0.1)) + extradur
breathin = not breathin breathin = not breathin
end end

View file

@ -1,40 +1,48 @@
local rtcache = {} local rtcache = {}
local rtmatcache = {} local rtmatcache = {}
local propspanel = { local propspanel = {
w = 384, w = 384,
h = 400 h = 400
} }
propspanel.x = 1632 - propspanel.w * 0.5 propspanel.x = 1632 - propspanel.w * 0.5
propspanel.y = 702 - propspanel.h * 0.5 propspanel.y = 702 - propspanel.h * 0.5
propspanel.bgcolor = Color(32, 32, 32) propspanel.bgcolor = Color(32, 32, 32)
propspanel.outlinecolor = Color(55, 55, 55) propspanel.outlinecolor = Color(55, 55, 55)
propspanel.alpha = 0.9 propspanel.alpha = 0.9
propspanel.elements = {} propspanel.elements = {}
local elementstogglepanel = { local elementstogglepanel = {
w = 384, w = 384,
h = 40 h = 40
} }
elementstogglepanel.x = 1632 - elementstogglepanel.w * 0.5 elementstogglepanel.x = 1632 - elementstogglepanel.w * 0.5
elementstogglepanel.y = 459 elementstogglepanel.y = 459
elementstogglepanel.bgcolor = Color(32, 32, 32) elementstogglepanel.bgcolor = Color(32, 32, 32)
elementstogglepanel.outlinecolor = Color(55, 55, 55) elementstogglepanel.outlinecolor = Color(55, 55, 55)
elementstogglepanel.alpha = 0.9 elementstogglepanel.alpha = 0.9
elementstogglepanel.elements = {} elementstogglepanel.elements = {}
local bmbuttons = { local bmbuttons = {
w = 190, w = 190,
h = 100, h = 100,
x = 1632 - propspanel.w * 0.5 x = 1632 - propspanel.w * 0.5
} }
bmbuttons.y = 972 - bmbuttons.h * 0.5 bmbuttons.y = 972 - bmbuttons.h * 0.5
bmbuttons.bgcolor = Color(32, 32, 32) bmbuttons.bgcolor = Color(32, 32, 32)
bmbuttons.outlinecolor = Color(55, 55, 55) bmbuttons.outlinecolor = Color(55, 55, 55)
bmbuttons.alpha = 0.45 bmbuttons.alpha = 0.45
bmbuttons.elements = {} bmbuttons.elements = {}
local bminfo = { local bminfo = {
w = 190, w = 190,
h = 100, h = 100,
x = 1634 x = 1634
} }
bminfo.y = 972 - bminfo.h * 0.5 bminfo.y = 972 - bminfo.h * 0.5
bminfo.bgcolor = Color(32, 32, 32) bminfo.bgcolor = Color(32, 32, 32)
bminfo.outlinecolor = Color(55, 55, 55) bminfo.outlinecolor = Color(55, 55, 55)

View file

@ -19,26 +19,15 @@ surface.CreateFont("BeatrunDebug", {
local color_red = Color(220, 20, 20) local color_red = Color(220, 20, 20)
local startx = 0.2 local startx = 0.2
local starty = 0.75 local starty = 0.75
local debugdata = {
"BodyAnim", local debugdata = {"BodyAnim", "BodyAnimCycle", "BodyAnimString", "campos", "camang"}
"BodyAnimCycle",
"BodyAnimString", local debugdata2 = {"BodyAnimArmCopy", "TraceCount"}
"campos",
"camang" local debugoffset = {0, 0, 0}
}
local debugdata2 = { local debuglist = {debugdata, debugdata2}
"BodyAnimArmCopy",
"TraceCount"
}
local debugoffset = {
0,
0,
0
}
local debuglist = {
debugdata,
debugdata2
}
TraceLine_o = TraceLine_o or util.TraceLine TraceLine_o = TraceLine_o or util.TraceLine
local TraceLine_o = TraceLine_o local TraceLine_o = TraceLine_o
local traces = {} local traces = {}

View file

@ -1,80 +1,5 @@
valvebiped = { valvebiped = {"ValveBiped.Bip01_Pelvis", "ValveBiped.Bip01_Spine", "ValveBiped.Bip01_Spine1", "ValveBiped.Bip01_Spine2", "ValveBiped.Bip01_Spine4", "ValveBiped.Bip01_Neck1", "ValveBiped.Bip01_Head1", "ValveBiped.forward", "ValveBiped.Bip01_R_Clavicle", "ValveBiped.Bip01_R_UpperArm", "ValveBiped.Bip01_R_Forearm", "ValveBiped.Bip01_R_Hand", "ValveBiped.Anim_Attachment_RH", "ValveBiped.Bip01_R_Finger4", "ValveBiped.Bip01_R_Finger41", "ValveBiped.Bip01_R_Finger42", "ValveBiped.Bip01_R_Finger3", "ValveBiped.Bip01_R_Finger31", "ValveBiped.Bip01_R_Finger32", "ValveBiped.Bip01_R_Finger2", "ValveBiped.Bip01_R_Finger21", "ValveBiped.Bip01_R_Finger22", "ValveBiped.Bip01_R_Finger1", "ValveBiped.Bip01_R_Finger11", "ValveBiped.Bip01_R_Finger12", "ValveBiped.Bip01_R_Finger0", "ValveBiped.Bip01_R_Finger01", "ValveBiped.Bip01_R_Finger02", "ValveBiped.Bip01_R_Ulna", "ValveBiped.Bip01_R_Wrist", "ValveBiped.Bip01_R_Elbow", "ValveBiped.Bip01_R_Bicep", "ValveBiped.Bip01_R_Shoulder", "ValveBiped.Bip01_R_Trapezius", "ValveBiped.Bip01_L_Clavicle", "ValveBiped.Bip01_L_UpperArm", "ValveBiped.Bip01_L_Forearm", "ValveBiped.Bip01_L_Hand", "ValveBiped.Anim_Attachment_LH", "ValveBiped.Bip01_L_Finger4", "ValveBiped.Bip01_L_Finger41", "ValveBiped.Bip01_L_Finger42", "ValveBiped.Bip01_L_Finger3", "ValveBiped.Bip01_L_Finger31", "ValveBiped.Bip01_L_Finger32", "ValveBiped.Bip01_L_Finger2", "ValveBiped.Bip01_L_Finger21", "ValveBiped.Bip01_L_Finger22", "ValveBiped.Bip01_L_Finger1", "ValveBiped.Bip01_L_Finger11", "ValveBiped.Bip01_L_Finger12", "ValveBiped.Bip01_L_Finger0", "ValveBiped.Bip01_L_Finger01", "ValveBiped.Bip01_L_Finger02", "ValveBiped.Bip01_L_Ulna", "ValveBiped.Bip01_L_Wrist", "ValveBiped.Bip01_L_Elbow", "ValveBiped.Bip01_L_Bicep", "ValveBiped.Bip01_L_Shoulder", "ValveBiped.Bip01_L_Trapezius", "ValveBiped.Bip01_R_Thigh", "ValveBiped.Bip01_R_Calf", "ValveBiped.Bip01_R_Foot", "ValveBiped.Bip01_R_Toe0", "ValveBiped.Bip01_L_Thigh", "ValveBiped.Bip01_L_Calf", "ValveBiped.Bip01_L_Foot", "ValveBiped.Bip01_L_Toe0", "ValveBiped.Bip01_L_Pectoral", "ValveBiped.Bip01_R_Pectoral", "ValveBiped.Cod", "j_ringpalm_L", "j_pinkypalm_L", "j_ringpalm_ri", "j_pinkypalm_ri"}
"ValveBiped.Bip01_Pelvis",
"ValveBiped.Bip01_Spine",
"ValveBiped.Bip01_Spine1",
"ValveBiped.Bip01_Spine2",
"ValveBiped.Bip01_Spine4",
"ValveBiped.Bip01_Neck1",
"ValveBiped.Bip01_Head1",
"ValveBiped.forward",
"ValveBiped.Bip01_R_Clavicle",
"ValveBiped.Bip01_R_UpperArm",
"ValveBiped.Bip01_R_Forearm",
"ValveBiped.Bip01_R_Hand",
"ValveBiped.Anim_Attachment_RH",
"ValveBiped.Bip01_R_Finger4",
"ValveBiped.Bip01_R_Finger41",
"ValveBiped.Bip01_R_Finger42",
"ValveBiped.Bip01_R_Finger3",
"ValveBiped.Bip01_R_Finger31",
"ValveBiped.Bip01_R_Finger32",
"ValveBiped.Bip01_R_Finger2",
"ValveBiped.Bip01_R_Finger21",
"ValveBiped.Bip01_R_Finger22",
"ValveBiped.Bip01_R_Finger1",
"ValveBiped.Bip01_R_Finger11",
"ValveBiped.Bip01_R_Finger12",
"ValveBiped.Bip01_R_Finger0",
"ValveBiped.Bip01_R_Finger01",
"ValveBiped.Bip01_R_Finger02",
"ValveBiped.Bip01_R_Ulna",
"ValveBiped.Bip01_R_Wrist",
"ValveBiped.Bip01_R_Elbow",
"ValveBiped.Bip01_R_Bicep",
"ValveBiped.Bip01_R_Shoulder",
"ValveBiped.Bip01_R_Trapezius",
"ValveBiped.Bip01_L_Clavicle",
"ValveBiped.Bip01_L_UpperArm",
"ValveBiped.Bip01_L_Forearm",
"ValveBiped.Bip01_L_Hand",
"ValveBiped.Anim_Attachment_LH",
"ValveBiped.Bip01_L_Finger4",
"ValveBiped.Bip01_L_Finger41",
"ValveBiped.Bip01_L_Finger42",
"ValveBiped.Bip01_L_Finger3",
"ValveBiped.Bip01_L_Finger31",
"ValveBiped.Bip01_L_Finger32",
"ValveBiped.Bip01_L_Finger2",
"ValveBiped.Bip01_L_Finger21",
"ValveBiped.Bip01_L_Finger22",
"ValveBiped.Bip01_L_Finger1",
"ValveBiped.Bip01_L_Finger11",
"ValveBiped.Bip01_L_Finger12",
"ValveBiped.Bip01_L_Finger0",
"ValveBiped.Bip01_L_Finger01",
"ValveBiped.Bip01_L_Finger02",
"ValveBiped.Bip01_L_Ulna",
"ValveBiped.Bip01_L_Wrist",
"ValveBiped.Bip01_L_Elbow",
"ValveBiped.Bip01_L_Bicep",
"ValveBiped.Bip01_L_Shoulder",
"ValveBiped.Bip01_L_Trapezius",
"ValveBiped.Bip01_R_Thigh",
"ValveBiped.Bip01_R_Calf",
"ValveBiped.Bip01_R_Foot",
"ValveBiped.Bip01_R_Toe0",
"ValveBiped.Bip01_L_Thigh",
"ValveBiped.Bip01_L_Calf",
"ValveBiped.Bip01_L_Foot",
"ValveBiped.Bip01_L_Toe0",
"ValveBiped.Bip01_L_Pectoral",
"ValveBiped.Bip01_R_Pectoral",
"ValveBiped.Cod",
"j_ringpalm_L",
"j_pinkypalm_L",
"j_ringpalm_ri",
"j_pinkypalm_ri"
}
local scalevec = Vector(1, 1, 1) local scalevec = Vector(1, 1, 1)
local function Disarm_Render(self) local function Disarm_Render(self)

View file

@ -8,7 +8,6 @@ sound.Add({
}) })
local zoom = Material("vgui/zoom.vtf") local zoom = Material("vgui/zoom.vtf")
local nextbeat = 0 local nextbeat = 0
local beatvol = 0.3 local beatvol = 0.3
local blurpass = 0 local blurpass = 0

View file

@ -6,17 +6,17 @@ local reticle = CreateClientConVar("Beatrun_HUDReticle", "1", true, false, "Disp
local packetloss = Material("vgui/packetloss.png") local packetloss = Material("vgui/packetloss.png")
local lastloss = 0 local lastloss = 0
local MELogo = Material("vgui/MELogo.png", "mips smooth") local MELogo = Material("vgui/MELogo.png", "mips smooth")
local hide = { local hide = {
CHudBattery = true, CHudBattery = true,
CHudHealth = true, CHudHealth = true,
CHudDamageIndicator = true CHudDamageIndicator = true
} }
local inf = math.huge local inf = math.huge
hook.Add("HUDShouldDraw", "BeatrunHUDHide", function (name) hook.Add("HUDShouldDraw", "BeatrunHUDHide", function(name)
if hide[name] then if hide[name] then return false end
return false
end
end) end)
local color = 1 local color = 1
@ -291,15 +291,13 @@ local function sortleaderboard(a, b)
end end
function BeatrunLeaderboard(forced) function BeatrunLeaderboard(forced)
if not forced and Course_Name == "" and not GetGlobalBool(GM_INFECTION) and not GetGlobalBool(GM_DATATHEFT) then if not forced and Course_Name == "" and not GetGlobalBool(GM_INFECTION) and not GetGlobalBool(GM_DATATHEFT) then return end
return
end
local isinfection = GetGlobalBool(GM_INFECTION) local isinfection = GetGlobalBool(GM_INFECTION)
local isdatatheft = GetGlobalBool(GM_DATATHEFT) local isdatatheft = GetGlobalBool(GM_DATATHEFT)
local ply = LocalPlayer() local ply = LocalPlayer()
local vp = ply:GetViewPunchAngles() local vp = ply:GetViewPunchAngles()
local scrw = ScrW() -- local scrw = ScrW()
local scrh = ScrH() local scrh = ScrH()
if not sway:GetBool() then if not sway:GetBool() then
@ -312,7 +310,6 @@ function BeatrunLeaderboard(forced)
if allplytimer < CurTime() then if allplytimer < CurTime() then
allply = player.GetAll() allply = player.GetAll()
allplytimer = CurTime() + 5 allplytimer = CurTime() + 5
table.sort(allply, sortleaderboard) table.sort(allply, sortleaderboard)
end end
@ -320,7 +317,9 @@ function BeatrunLeaderboard(forced)
surface.SetDrawColor(20, 20, 20, math.max(150 - hidealpha, 50)) surface.SetDrawColor(20, 20, 20, math.max(150 - hidealpha, 50))
surface.DrawRect(-20 + vp.z, scrh * 0.2 + vp.x, 40, SScaleY(30 * allplycount)) surface.DrawRect(-20 + vp.z, scrh * 0.2 + vp.x, 40, SScaleY(30 * allplycount))
DrawBlurRect(20 + vp.z, scrh * 0.2 + vp.x, SScaleX(400), SScaleY(30 * allplycount), math.max(255 - hidealpha, 2)) DrawBlurRect(20 + vp.z, scrh * 0.2 + vp.x, SScaleX(400), SScaleY(30 * allplycount), math.max(255 - hidealpha, 2))
surface.SetDrawColor(20, 20, 20, math.max(100 - hidealpha, 50)) surface.SetDrawColor(20, 20, 20, math.max(100 - hidealpha, 50))
surface.DrawOutlinedRect(20 + vp.z, scrh * 0.2 + vp.x, SScaleX(400), SScaleY(30 * allplycount)) surface.DrawOutlinedRect(20 + vp.z, scrh * 0.2 + vp.x, SScaleX(400), SScaleY(30 * allplycount))
surface.SetFont("BeatrunHUD") surface.SetFont("BeatrunHUD")
@ -331,13 +330,13 @@ function BeatrunLeaderboard(forced)
for k, v in ipairs(allply) do for k, v in ipairs(allply) do
if IsValid(v) then if IsValid(v) then
i = i + 1 i = i + 1
local pbtimenum = v:GetNW2Float("PBTime") local pbtimenum = v:GetNW2Float("PBTime")
local pbtime = niltime local pbtime = niltime
if isdatatheft then if isdatatheft then
pbtimenum = v:GetNW2Int("DataBanked", 0) pbtimenum = v:GetNW2Int("DataBanked", 0)
pbtime = pbtimenum pbtime = pbtimenum
surface.SetTextColor(pbtimenum ~= 0 and placecolors[k] or color_white) surface.SetTextColor(pbtimenum ~= 0 and placecolors[k] or color_white)
else else
surface.SetTextColor(pbtimenum ~= 0 and placecolors[k] or color_white) surface.SetTextColor(pbtimenum ~= 0 and placecolors[k] or color_white)
@ -371,10 +370,9 @@ hook.Add("HUDPaint", "BeatrunLeaderboard", BeatrunLeaderboard)
local lastchatply = nil local lastchatply = nil
hook.Add("OnPlayerChat", "BeatrunChatSound", function (ply, text, teamChat, isDead) hook.Add("OnPlayerChat", "BeatrunChatSound", function(ply, text, teamChat, isDead)
if lastchatply ~= ply then if lastchatply ~= ply then
LocalPlayer():EmitSound("friends/message.wav") LocalPlayer():EmitSound("friends/message.wav")
lastchatply = ply lastchatply = ply
end end
end) end)
@ -391,10 +389,8 @@ local pp = {
["$pp_colour_mulr"] = 0 ["$pp_colour_mulr"] = 0
} }
hook.Add("RenderScreenspaceEffects", "FilterPP", function () hook.Add("RenderScreenspaceEffects", "FilterPP", function()
if render.GetDXLevel() < 90 then if render.GetDXLevel() < 90 then return end
return
end
if not blinded or not blindinverted then if not blinded or not blindinverted then
DrawColorModify(pp) DrawColorModify(pp)
@ -403,15 +399,13 @@ end)
local maxentries = SScaleX(375) local maxentries = SScaleX(375)
speedrecord = {} speedrecord = {}
local lastx = 0 -- local lastx = 0
local lasty = 0 -- local lasty = 0
local sgoffsetx = 0.75 local sgoffsetx = 0.75
local sgoffsety = 0.75 local sgoffsety = 0.75
local function DrawSpeedGraph() local function DrawSpeedGraph()
if not speedrecord or not LocalPlayer().InReplay then if not speedrecord or not LocalPlayer().InReplay then return end
return
end
local offsetx = ScrW() * sgoffsetx local offsetx = ScrW() * sgoffsetx
local offsety = ScrH() * sgoffsety local offsety = ScrH() * sgoffsety
@ -419,9 +413,11 @@ local function DrawSpeedGraph()
local boxscaledy = SScaleY(200) local boxscaledy = SScaleY(200)
render.SetScissorRect(offsetx, offsety, offsetx + boxscaledx, offsety + boxscaledy, true) render.SetScissorRect(offsetx, offsety, offsetx + boxscaledx, offsety + boxscaledy, true)
surface.SetDrawColor(25, 25, 25, 100) surface.SetDrawColor(25, 25, 25, 100)
surface.DrawRect(offsetx, offsety, boxscaledx, boxscaledy) surface.DrawRect(offsetx, offsety, boxscaledx, boxscaledy)
surface.SetFont("DebugFixedSmall") surface.SetFont("DebugFixedSmall")
render.PushFilterMag(TEXFILTER.POINT) render.PushFilterMag(TEXFILTER.POINT)
render.PushFilterMin(TEXFILTER.POINT) render.PushFilterMin(TEXFILTER.POINT)
@ -457,9 +453,7 @@ local smoothvel = true
local lastvel = 0 local lastvel = 0
local function RecordSpeedGraph() local function RecordSpeedGraph()
if not LocalPlayer().InReplay then if not LocalPlayer().InReplay then return end
return
end
local lenrecord = #speedrecord local lenrecord = #speedrecord
local vel = LocalPlayer():GetVelocity() local vel = LocalPlayer():GetVelocity()
@ -495,19 +489,15 @@ hook.Add("Tick", "SpeedGraph", RecordSpeedGraph)
local crosshair_unarmed = Material("vgui/hud/crosshair_unarmed") local crosshair_unarmed = Material("vgui/hud/crosshair_unarmed")
local crosshair_standard = Material("vgui/hud/crosshair_standard") local crosshair_standard = Material("vgui/hud/crosshair_standard")
local crosshair_weapon = Material("vgui/hud/crosshair_weapon") -- local crosshair_weapon = Material("vgui/hud/crosshair_weapon")
local crosshair_reaction = Material("vgui/hud/crosshair_reaction") -- local crosshair_reaction = Material("vgui/hud/crosshair_reaction")
local function BeatrunReticle() local function BeatrunReticle()
if not reticle:GetBool() then if not reticle:GetBool() then return end
return
end
local wep = LocalPlayer():GetActiveWeapon() local wep = LocalPlayer():GetActiveWeapon()
if not IsValid(wep) or wep:GetClass() ~= "runnerhands" then if not IsValid(wep) or wep:GetClass() ~= "runnerhands" then return end
return
end
surface.SetDrawColor(255, 255, 255) surface.SetDrawColor(255, 255, 255)
surface.SetMaterial(crosshair_standard) surface.SetMaterial(crosshair_standard)

View file

@ -12,6 +12,7 @@ local animtable = {
BodyLimitY = 180, BodyLimitY = 180,
usefullbody = 2 usefullbody = 2
} }
fbanims = { fbanims = {
ladderexittoplefthand = true, ladderexittoplefthand = true,
runfwdstart = true, runfwdstart = true,
@ -111,6 +112,7 @@ fbanims = {
swingjumpoff = true, swingjumpoff = true,
snatchscar = true snatchscar = true
} }
local jumpanims = { local jumpanims = {
jumpwrleft = true, jumpwrleft = true,
jumpfast = true, jumpfast = true,
@ -122,11 +124,13 @@ local jumpanims = {
jumpcoil = true, jumpcoil = true,
jumpzipline = true jumpzipline = true
} }
local jumpanims2 = { local jumpanims2 = {
jumpfast = true, jumpfast = true,
jumpslow = true, jumpslow = true,
jumpstill = true jumpstill = true
} }
local runanims = { local runanims = {
crouchfwd = true, crouchfwd = true,
crouchbwd = true, crouchbwd = true,
@ -138,6 +142,7 @@ local runanims = {
sprintfwd = true, sprintfwd = true,
runbwd = true runbwd = true
} }
local events = { local events = {
ladderenter = true, ladderenter = true,
divestart = true, divestart = true,
@ -199,6 +204,7 @@ local events = {
meleeairstill = true, meleeairstill = true,
vaultontohigh = true vaultontohigh = true
} }
local eventslut = { local eventslut = {
ladderenter = "ladderenterbottom", ladderenter = "ladderenterbottom",
divestart = "divestart", divestart = "divestart",
@ -261,6 +267,7 @@ local eventslut = {
meleeairstill = "meleeairstill", meleeairstill = "meleeairstill",
vaultontohigh = "vaultontohigh" vaultontohigh = "vaultontohigh"
} }
local armfollowanims = { local armfollowanims = {
stand = true, stand = true,
diveslideidle = true, diveslideidle = true,
@ -270,6 +277,7 @@ local armfollowanims = {
vaultoverhigh = true, vaultoverhigh = true,
walkfwd = true walkfwd = true
} }
local armlock = { local armlock = {
meleeairhit = true, meleeairhit = true,
bargein = true, bargein = true,
@ -289,6 +297,7 @@ local armlock = {
vaultontohigh = true, vaultontohigh = true,
snatchscar = true snatchscar = true
} }
local stillanims = { local stillanims = {
jumpturnlandstandgun = true, jumpturnlandstandgun = true,
meslideloop = true, meslideloop = true,
@ -305,12 +314,14 @@ local stillanims = {
meleeslide = true, meleeslide = true,
snatchscar = true snatchscar = true
} }
local arminterrupts = { local arminterrupts = {
punchright = true, punchright = true,
doorbash = true, doorbash = true,
punchmid = true, punchmid = true,
punchleft = true punchleft = true
} }
local transitionanims = { local transitionanims = {
hanghardstart = "hang", hanghardstart = "hang",
divestart = "diveidle", divestart = "diveidle",
@ -364,6 +375,7 @@ local transitionanims = {
vaultontohigh = "runfwd", vaultontohigh = "runfwd",
snatchscar = "stand" snatchscar = "stand"
} }
local nospinebend = { local nospinebend = {
ladderclimbuplefthand = true, ladderclimbuplefthand = true,
divestart = true, divestart = true,
@ -397,6 +409,7 @@ local nospinebend = {
vaultontohigh = true, vaultontohigh = true,
snatchscar = true snatchscar = true
} }
local worldarm = { local worldarm = {
ladderclimbuplefthand = true, ladderclimbuplefthand = true,
ladderclimbuplefthandstill = true, ladderclimbuplefthandstill = true,
@ -425,6 +438,7 @@ local worldarm = {
ladderclimbhangstart = true, ladderclimbhangstart = true,
snatchscar = true snatchscar = true
} }
local ignorezarm = { local ignorezarm = {
wallrunvertical = true, wallrunvertical = true,
hangfoldedstart = true, hangfoldedstart = true,
@ -434,19 +448,23 @@ local ignorezarm = {
diestandlong = true, diestandlong = true,
vaultontohigh = true vaultontohigh = true
} }
local nocyclereset = { local nocyclereset = {
jumpwrright = true, jumpwrright = true,
jumpwrleft = true, jumpwrleft = true,
meslidestart = true meslidestart = true
} }
local ignorebac = { local ignorebac = {
evaderoll = true, evaderoll = true,
meroll = true meroll = true
} }
local customspeed = { local customspeed = {
vaultonto = 1.15, vaultonto = 1.15,
vaultontohigh = 1 vaultontohigh = 1
} }
local vaultoverhighcam1 = Vector(0, 0, -7.5) local vaultoverhighcam1 = Vector(0, 0, -7.5)
local vaultoverhighcam2 = Vector(0, 0, 0) local vaultoverhighcam2 = Vector(0, 0, 0)
local vaultoverhigharm1 = Vector(4, -4, 13.5) local vaultoverhigharm1 = Vector(4, -4, 13.5)
@ -457,6 +475,7 @@ local vaultontohigharm1 = Vector(5, -10, 3.5)
local vaultontohigharm2 = Vector(10, 0, 0) local vaultontohigharm2 = Vector(10, 0, 0)
local snatchscarcam1 = Vector(0, 0, 0) local snatchscarcam1 = Vector(0, 0, 0)
local snatchscarcam2 = Vector(10, 0, 5) local snatchscarcam2 = Vector(10, 0, 5)
local customarmoffset = { local customarmoffset = {
meslidestart = Vector(2, 5, 9.5), meslidestart = Vector(2, 5, 9.5),
meslideloop = Vector(2, 5, 9.5), meslideloop = Vector(2, 5, 9.5),
@ -490,6 +509,7 @@ local customarmoffset = {
stand = Vector(10, 0, -10), stand = Vector(10, 0, -10),
walktostandleft = Vector(10, 0, -10) walktostandleft = Vector(10, 0, -10)
} }
local customcamoffset = { local customcamoffset = {
jumpturnfly = Vector(0, 0, 7.5), jumpturnfly = Vector(0, 0, 7.5),
jumpturnflyidle = Vector(0, 0, 7.5), jumpturnflyidle = Vector(0, 0, 7.5),
@ -510,25 +530,22 @@ local customcamoffset = {
crouchfwd = Vector(10, 0, -17.5), crouchfwd = Vector(10, 0, -17.5),
crouchbwd = Vector(20, 0, -10) crouchbwd = Vector(20, 0, -10)
} }
local transitionchecks = { local transitionchecks = {
meleeairstill = function (ply) meleeairstill = function(ply)
if BodyAnimCycle >= 1 or ply:OnGround() then if BodyAnimCycle >= 1 or ply:OnGround() then return true end
return true
end
end, end,
swingjumpoff = function (ply) swingjumpoff = function(ply)
if BodyAnimCycle >= 0.15 or ply:OnGround() then if BodyAnimCycle >= 0.15 or ply:OnGround() then
BodyAnimCycle = 0 BodyAnimCycle = 0
return true return true
end end
end, end,
jumpcoilend = function (ply) jumpcoilend = function(ply)
if ply:GetVelocity():Length() < 10 and BodyAnimCycle > 0.5 or BodyAnimCycle > 0.9 then if ply:GetVelocity():Length() < 10 and BodyAnimCycle > 0.5 or BodyAnimCycle > 0.9 then return true end
return true
end
end, end,
vaultover = function (ply) vaultover = function(ply)
if BodyAnimCycle >= 1 or ply:OnGround() and ply:GetMantle() == 0 then if BodyAnimCycle >= 1 or ply:OnGround() and ply:GetMantle() == 0 then
BodyLimitX = 90 BodyLimitX = 90
BodyLimitY = 180 BodyLimitY = 180
@ -536,7 +553,7 @@ local transitionchecks = {
return true return true
end end
end, end,
vaultkong = function (ply) vaultkong = function(ply)
if BodyAnimCycle >= 1 or ply:OnGround() and ply:GetMantle() == 0 then if BodyAnimCycle >= 1 or ply:OnGround() and ply:GetMantle() == 0 then
BodyLimitX = 90 BodyLimitX = 90
BodyLimitY = 180 BodyLimitY = 180
@ -544,7 +561,7 @@ local transitionchecks = {
return true return true
end end
end, end,
vaultoverhigh = function (ply) vaultoverhigh = function(ply)
if BodyAnimCycle < 0.45 then if BodyAnimCycle < 0.45 then
customarmoffset.vaultoverhigh = vaultoverhigharm1 customarmoffset.vaultoverhigh = vaultoverhigharm1
customcamoffset.vaultoverhigh = vaultoverhighcam1 customcamoffset.vaultoverhigh = vaultoverhighcam1
@ -563,7 +580,7 @@ local transitionchecks = {
BodyLimitY = 40 BodyLimitY = 40
end end
end, end,
vaultontohigh = function (ply) vaultontohigh = function(ply)
if BodyAnimCycle < 0.45 then if BodyAnimCycle < 0.45 then
customarmoffset.vaultontohigh = vaultontohigharm1 customarmoffset.vaultontohigh = vaultontohigharm1
else else
@ -596,29 +613,25 @@ local transitionchecks = {
BodyAnim:SetAngles(eyeang) BodyAnim:SetAngles(eyeang)
end end
end, end,
zipline = function (ply) zipline = function(ply)
if not IsValid(ply:GetZipline()) then if not IsValid(ply:GetZipline()) then
BodyAnimCycle = 0 BodyAnimCycle = 0
return true return true
end end
end, end,
jumpzipline = function (ply) jumpzipline = function(ply)
lockang = false lockang = false
BodyLimitX = 90 BodyLimitX = 90
BodyLimitY = 180 BodyLimitY = 180
end, end,
stepuprightleg = function (ply) stepuprightleg = function(ply)
if BodyAnimCycle >= 1 then if BodyAnimCycle >= 1 then return true end
return true
end
end, end,
springboardleftleg = function (ply) springboardleftleg = function(ply)
if BodyAnimCycle >= 0.75 or ply:OnGround() then if BodyAnimCycle >= 0.75 or ply:OnGround() then return true end
return true
end
end, end,
jumpturnlandstand = function (ply) jumpturnlandstand = function(ply)
if BodyAnimCycle >= 0.85 then if BodyAnimCycle >= 0.85 then
BodyLimitX = 90 BodyLimitX = 90
BodyLimitY = 180 BodyLimitY = 180
@ -626,7 +639,7 @@ local transitionchecks = {
return true return true
end end
end, end,
jumpturnlandstandgun = function (ply) jumpturnlandstandgun = function(ply)
if BodyAnimCycle >= 0.85 then if BodyAnimCycle >= 0.85 then
BodyLimitX = 90 BodyLimitX = 90
BodyLimitY = 180 BodyLimitY = 180
@ -634,73 +647,57 @@ local transitionchecks = {
return true return true
end end
end, end,
fallinguncontrolled = function (ply) fallinguncontrolled = function(ply)
if not ply.FallStatic then if not ply.FallStatic then return true end
return true
end
end, end,
ladderclimbuplefthand = function (ply) ladderclimbuplefthand = function(ply)
if BodyAnimCycle >= 0.75 then if BodyAnimCycle >= 0.75 then return true end
return true
end
end, end,
ladderclimbuprighthand = function (ply) ladderclimbuprighthand = function(ply)
if BodyAnimCycle >= 0.75 then if BodyAnimCycle >= 0.75 then return true end
return true
end
end, end,
ladderenterbottom = function (ply) ladderenterbottom = function(ply)
if BodyAnimCycle >= 0.35 then if BodyAnimCycle >= 0.35 then return true end
return true
end
end, end,
ladderexittoplefthand = function (ply) ladderexittoplefthand = function(ply)
if BodyAnimCycle < 0.25 then if BodyAnimCycle < 0.25 then
customarmoffset.ladderexittoplefthand = ladderexitarm1 customarmoffset.ladderexittoplefthand = ladderexitarm1
else else
customarmoffset.ladderexittoplefthand = ladderexitarm2 customarmoffset.ladderexittoplefthand = ladderexitarm2
end end
if BodyAnimCycle >= 1 or ply:OnGround() then if BodyAnimCycle >= 1 or ply:OnGround() then return true end
return true
end
end, end,
ladderexittoprighthand = function (ply) ladderexittoprighthand = function(ply)
if BodyAnimCycle < 0.25 then if BodyAnimCycle < 0.25 then
customarmoffset.ladderexittoprighthand = ladderexitarm1 customarmoffset.ladderexittoprighthand = ladderexitarm1
else else
customarmoffset.ladderexittoprighthand = ladderexitarm2 customarmoffset.ladderexittoprighthand = ladderexitarm2
end end
if BodyAnimCycle >= 1 or ply:OnGround() then if BodyAnimCycle >= 1 or ply:OnGround() then return true end
return true
end
end, end,
wallrunverticalturn = function (ply) wallrunverticalturn = function(ply)
if ply:GetWallrun() ~= 4 then if ply:GetWallrun() ~= 4 then return true end
return true
end
end, end,
hangfoldedheaveup = function (ply) hangfoldedheaveup = function(ply)
if BodyAnimCycle >= 0.65 then if BodyAnimCycle >= 0.65 then return true end
return true
end
end, end,
hanghardstart = function (ply) hanghardstart = function(ply)
if BodyAnimCycle >= 1 then if BodyAnimCycle >= 1 then
ply.hangyaw = 0 ply.hangyaw = 0
return true return true
end end
end, end,
hanghardstart2 = function (ply) hanghardstart2 = function(ply)
if BodyAnimCycle >= 0.75 then if BodyAnimCycle >= 0.75 then
ply.hangyaw = 0 ply.hangyaw = 0
return true return true
end end
end, end,
snatchscar = function (ply) snatchscar = function(ply)
lockang = true lockang = true
if BodyAnimCycle < 0.35 or BodyAnimCycle > 0.8 then if BodyAnimCycle < 0.35 or BodyAnimCycle > 0.8 then
@ -715,7 +712,7 @@ local transitionchecks = {
return true return true
end end
end, end,
snatchsniper = function (ply) snatchsniper = function(ply)
lockang = true lockang = true
if BodyAnimCycle >= 1 then if BodyAnimCycle >= 1 then
@ -724,12 +721,10 @@ local transitionchecks = {
return true return true
end end
end, end,
ziplinestart = function (ply) ziplinestart = function(ply)
if BodyAnimCycle >= 0.75 then if BodyAnimCycle >= 0.75 then return true end
return true
end
end, end,
walkbalancefalloffleft = function (ply) walkbalancefalloffleft = function(ply)
lockang = true lockang = true
if BodyAnimCycle >= 1 then if BodyAnimCycle >= 1 then
@ -738,7 +733,7 @@ local transitionchecks = {
return true return true
end end
end, end,
walkbalancefalloffright = function (ply) walkbalancefalloffright = function(ply)
lockang = true lockang = true
if BodyAnimCycle >= 1 then if BodyAnimCycle >= 1 then
@ -748,14 +743,13 @@ local transitionchecks = {
end end
end end
} }
fbfunctions = { fbfunctions = {
vaultontohigh = function (ply) vaultontohigh = function(ply) return true end,
return true swingstraight = function(ply)
end,
swingstraight = function (ply)
BodyAnim:SetPoseParameter("swing", (ply:GetSBOffset() / 45 - 1) * 100) BodyAnim:SetPoseParameter("swing", (ply:GetSBOffset() / 45 - 1) * 100)
end, end,
ziplinestart = function (ply) ziplinestart = function(ply)
if IsValid(ply:GetZipline()) then if IsValid(ply:GetZipline()) then
lockang = true lockang = true
CamIgnoreAng = false CamIgnoreAng = false
@ -768,7 +762,7 @@ fbfunctions = {
return true return true
end, end,
zipline = function (ply) zipline = function(ply)
lockang = true lockang = true
CamIgnoreAng = false CamIgnoreAng = false
BodyLimitX = 30 BodyLimitX = 30
@ -779,7 +773,7 @@ fbfunctions = {
return true return true
end, end,
hang = function (ply) hang = function(ply)
CamIgnoreAng = false CamIgnoreAng = false
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
local eyeang = ply:EyeAngles() local eyeang = ply:EyeAngles()
@ -792,6 +786,7 @@ fbfunctions = {
mul = math.Clamp(mul, 0.4, 1) mul = math.Clamp(mul, 0.4, 1)
BodyLimitX = 80 * mul BodyLimitX = 80 * mul
BodyLimitY = 175 BodyLimitY = 175
local a = math.Clamp(math.AngleDifference(ang.y, eyeang.y), -179, 179) local a = math.Clamp(math.AngleDifference(ang.y, eyeang.y), -179, 179)
if not ply.hangyaw then if not ply.hangyaw then
@ -817,23 +812,22 @@ fbfunctions = {
if BodyLimitX <= eyeangx then if BodyLimitX <= eyeangx then
eyeang.x = BodyLimitX - 0.1 eyeang.x = BodyLimitX - 0.1
ply:SetEyeAngles(eyeang) ply:SetEyeAngles(eyeang)
end end
return true return true
end, end,
hangstrafeleft = function (ply) hangstrafeleft = function(ply)
BodyLimitY = 40 BodyLimitY = 40
return true return true
end, end,
hangstraferight = function (ply) hangstraferight = function(ply)
BodyLimitY = 40 BodyLimitY = 40
return true return true
end, end,
hanghardstartvertical = function (ply) hanghardstartvertical = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 120 BodyLimitY = 120
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -842,7 +836,7 @@ fbfunctions = {
return true return true
end, end,
hanghardstart = function (ply) hanghardstart = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 120 BodyLimitY = 120
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -851,7 +845,7 @@ fbfunctions = {
return true return true
end, end,
hanghardstart2 = function (ply) hanghardstart2 = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 120 BodyLimitY = 120
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -860,7 +854,7 @@ fbfunctions = {
return true return true
end, end,
hangheaveup = function (ply) hangheaveup = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 90 BodyLimitY = 90
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -869,7 +863,7 @@ fbfunctions = {
return true return true
end, end,
hangfoldedstart = function (ply) hangfoldedstart = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 90 BodyLimitY = 90
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -878,18 +872,17 @@ fbfunctions = {
return true return true
end, end,
hangfoldedendhang = function (ply) hangfoldedendhang = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 90 BodyLimitY = 90
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
BodyAnim:SetAngles(ang) BodyAnim:SetAngles(ang)
ply.hangyaw = 0 ply.hangyaw = 0
return true return true
end, end,
hangfoldedheaveup = function (ply) hangfoldedheaveup = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 90 BodyLimitY = 90
local ang = ply.OrigEyeAng local ang = ply.OrigEyeAng
@ -898,41 +891,25 @@ fbfunctions = {
return true return true
end, end,
dodgejumpleft = function (ply) dodgejumpleft = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 180 BodyLimitY = 180
end, end,
dodgejumpright = function (ply) dodgejumpright = function(ply)
BodyLimitX = 30 BodyLimitX = 30
BodyLimitY = 180 BodyLimitY = 180
end, end,
ladderclimbdownfast = function (ply) ladderclimbdownfast = function(ply)
lockang = true lockang = true
end end
} }
local defaultcamoffset = Vector() local defaultcamoffset = Vector()
local playermodelbones = {
"ValveBiped.Bip01_L_UpperArm", local playermodelbones = {"ValveBiped.Bip01_L_UpperArm", "ValveBiped.Bip01_R_UpperArm"}
"ValveBiped.Bip01_R_UpperArm"
} local fingers = {"ValveBiped.Bip01_L_Finger4", "ValveBiped.Bip01_L_Finger41", "ValveBiped.Bip01_L_Finger3", "ValveBiped.Bip01_L_Finger31", "ValveBiped.Bip01_L_Finger2", "ValveBiped.Bip01_L_Finger21", "ValveBiped.Bip01_L_Finger1", "ValveBiped.Bip01_L_Finger11", "ValveBiped.Bip01_R_Finger4", "ValveBiped.Bip01_R_Finger41", "ValveBiped.Bip01_R_Finger3", "ValveBiped.Bip01_R_Finger31", "ValveBiped.Bip01_R_Finger2", "ValveBiped.Bip01_R_Finger21", "ValveBiped.Bip01_R_Finger1", "ValveBiped.Bip01_R_Finger11"}
local fingers = {
"ValveBiped.Bip01_L_Finger4",
"ValveBiped.Bip01_L_Finger41",
"ValveBiped.Bip01_L_Finger3",
"ValveBiped.Bip01_L_Finger31",
"ValveBiped.Bip01_L_Finger2",
"ValveBiped.Bip01_L_Finger21",
"ValveBiped.Bip01_L_Finger1",
"ValveBiped.Bip01_L_Finger11",
"ValveBiped.Bip01_R_Finger4",
"ValveBiped.Bip01_R_Finger41",
"ValveBiped.Bip01_R_Finger3",
"ValveBiped.Bip01_R_Finger31",
"ValveBiped.Bip01_R_Finger2",
"ValveBiped.Bip01_R_Finger21",
"ValveBiped.Bip01_R_Finger1",
"ValveBiped.Bip01_R_Finger11"
}
local fingerscustom = { local fingerscustom = {
["ValveBiped.Bip01_L_Finger4"] = Angle(-10, 10, 0), ["ValveBiped.Bip01_L_Finger4"] = Angle(-10, 10, 0),
["ValveBiped.Bip01_L_Finger3"] = Angle(-10, 20, 0), ["ValveBiped.Bip01_L_Finger3"] = Angle(-10, 20, 0),
@ -942,6 +919,7 @@ local fingerscustom = {
["ValveBiped.Bip01_R_Finger3"] = Angle(20, 20, 0), ["ValveBiped.Bip01_R_Finger3"] = Angle(20, 20, 0),
["ValveBiped.Bip01_R_Finger2"] = Angle(10, 20, 0) ["ValveBiped.Bip01_R_Finger2"] = Angle(10, 20, 0)
} }
eventsounds = { eventsounds = {
hangfoldedendhang = { hangfoldedendhang = {
[0.42] = "Handsteps.ConcreteHard", [0.42] = "Handsteps.ConcreteHard",
@ -1024,6 +1002,7 @@ eventsounds = {
[0.3] = "me_body_roll.wav" [0.3] = "me_body_roll.wav"
} }
} }
local CharaName = "Faith" local CharaName = "Faith"
local CharaLen = #CharaName local CharaLen = #CharaName
@ -1042,7 +1021,7 @@ local function BodyEventSounds(anim)
func = ply.EmitSound func = ply.EmitSound
end end
timer.Simple(k, function () timer.Simple(k, function()
func(ply, v) func(ply, v)
end) end)
end end
@ -1052,9 +1031,9 @@ end
camint = 1 camint = 1
campos = Vector() campos = Vector()
camang = Angle() camang = Angle()
local customoffset = Vector() -- local customoffset = Vector()
-- local movedback = false
local customoffsetlerp = Vector() local customoffsetlerp = Vector()
local movedback = false
local function JumpCalcView(view) local function JumpCalcView(view)
if not fbanims[BodyAnimString] then if not fbanims[BodyAnimString] then
@ -1067,13 +1046,13 @@ local function JumpCalcView(view)
end end
end end
local eyepos = LocalPlayer():EyePos() -- local eyepos = LocalPlayer():EyePos()
local vieworigin = view.origin -- local vieworigin = view.origin
BodyAnim:SetupBones() BodyAnim:SetupBones()
local m = BodyAnim:GetBoneMatrix(68) local m = BodyAnim:GetBoneMatrix(68)
local pos, ang = nil local ang = nil -- local pos, ang = nil
if m then if m then
ang = m:GetAngles() ang = m:GetAngles()
@ -1134,7 +1113,7 @@ local function CreateBodyAnimArmCopy()
return BodyAnimArmCopy return BodyAnimArmCopy
end end
hook.Add("BodyAnimRemove", "BodyAnimArmRemove", function () hook.Add("BodyAnimRemove", "BodyAnimArmRemove", function()
if IsValid(BodyAnimArmCopy) then if IsValid(BodyAnimArmCopy) then
BodyAnimArmCopy:Remove() BodyAnimArmCopy:Remove()
end end
@ -1143,9 +1122,7 @@ end)
local function JumpArmThink() local function JumpArmThink()
local bac = CreateBodyAnimArmCopy() local bac = CreateBodyAnimArmCopy()
if IsValid(bac) then if IsValid(bac) then return true end
return true
end
end end
function ArmInterrupting(bac) function ArmInterrupting(bac)
@ -1155,7 +1132,7 @@ end
local defaultarmoffset = Vector() local defaultarmoffset = Vector()
local armoffset = Vector() local armoffset = Vector()
local armoffsetlerp = Vector() local armoffsetlerp = Vector()
local drawnorigin = false -- local drawnorigin = false
local drawnskytime = 0 local drawnskytime = 0
local function JumpArmDraw(a, b, c) local function JumpArmDraw(a, b, c)
@ -1174,26 +1151,22 @@ local function JumpArmDraw(a, b, c)
cam.IgnoreZ(true) cam.IgnoreZ(true)
local camposoff = campos - ply:EyePos() -- local camposoff = campos - ply:EyePos()
local attachId = bac:LookupAttachment("eyes") local attachId = bac:LookupAttachment("eyes")
local offset = bac:GetAttachment(attachId) local offset = bac:GetAttachment(attachId)
if not offset then if not offset then return end
return
end
local arminterrupting = ArmInterrupting(bac) local arminterrupting = ArmInterrupting(bac)
local arminterruptboost = arminterrupting and 4 or 1 local arminterruptboost = arminterrupting and 4 or 1
armoffsetlerp = LerpVector(math.min(10 * FrameTime() * arminterruptboost, 1), armoffsetlerp, not arminterrupting and customarmoffset[BodyAnimString] or defaultarmoffset)
armoffsetlerp = LerpVector(math.min(10 * FrameTime() * arminterruptboost, 1), armoffsetlerp, not arminterrupting and customarmoffset[BodyAnimString] or defaultarmoffset)
armoffset:Set(armoffsetlerp) armoffset:Set(armoffsetlerp)
local pos = offset.Pos local pos = offset.Pos
local ang = offset.Ang local ang = offset.Ang
if not IsValid(BodyAnimMDLarm) then if not IsValid(BodyAnimMDLarm) then return end
return
end
BodyAnimMDLarm:SetNoDraw(true) BodyAnimMDLarm:SetNoDraw(true)
bac:SetParent(nil) bac:SetParent(nil)
@ -1236,9 +1209,11 @@ local function JumpArmDraw(a, b, c)
if not worldarm[BodyAnimString] then if not worldarm[BodyAnimString] then
cam.Start3D(pos, ang) cam.Start3D(pos, ang)
cam.IgnoreZ(ignorezarm[BodyAnimString] or false) cam.IgnoreZ(ignorezarm[BodyAnimString] or false)
BodyAnimMDLarm:SetPos(pos) BodyAnimMDLarm:SetPos(pos)
bac:SetupBones() bac:SetupBones()
BodyAnimMDLarm:DrawModel() BodyAnimMDLarm:DrawModel()
cam.End3D() cam.End3D()
else else
local armoff = LocalToWorld(armoffset, angle_zero, vector_origin, BodyAnim:GetAngles()) local armoff = LocalToWorld(armoffset, angle_zero, vector_origin, BodyAnim:GetAngles())
@ -1247,6 +1222,7 @@ local function JumpArmDraw(a, b, c)
bac:SetAngles(BodyAnim:GetAngles()) bac:SetAngles(BodyAnim:GetAngles())
bac:SetPos(BodyAnim:GetPos() + armoff) bac:SetPos(BodyAnim:GetPos() + armoff)
bac:SetRenderOrigin(nil) bac:SetRenderOrigin(nil)
BodyAnimMDLarm:SetPos(BodyAnim:GetPos() + armoff) BodyAnimMDLarm:SetPos(BodyAnim:GetPos() + armoff)
bac:SetupBones() bac:SetupBones()
BodyAnimMDLarm:DrawModel() BodyAnimMDLarm:DrawModel()
@ -1295,15 +1271,17 @@ local function JumpArmDraw(a, b, c)
end end
end end
hook.Add("PreRender", "JumpArmOriginVar", function () hook.Add("PreRender", "JumpArmOriginVar", function()
drawnorigin = false drawnorigin = false
end) end)
hook.Add("PostDrawSkyBox", "JumpArm3DSky", function ()
hook.Add("PostDrawSkyBox", "JumpArm3DSky", function()
skybox3d = true skybox3d = true
hook.Remove("PostDrawSkyBox", "JumpArm3DSky") hook.Remove("PostDrawSkyBox", "JumpArm3DSky")
end) end)
hook.Add("CalcViewModelView", "lol", function (wep, vm, oldpos, oldang, pos, ang)
hook.Add("CalcViewModelView", "lol", function(wep, vm, oldpos, oldang, pos, ang)
pos:Sub(oldpos) pos:Sub(oldpos)
pos:Add(campos) pos:Add(campos)
ang:Sub(oldang) ang:Sub(oldang)
@ -1317,6 +1295,7 @@ hook.Add("CalcViewModelView", "lol", function (wep, vm, oldpos, oldang, pos, ang
pos:Add(cpos) pos:Add(cpos)
ang:Add(cang) ang:Add(cang)
wep.m_ViewModel:SetRenderOrigin(pos) wep.m_ViewModel:SetRenderOrigin(pos)
wep.m_ViewModel:SetAngles(ang) wep.m_ViewModel:SetAngles(ang)
end end
@ -1357,9 +1336,7 @@ local function JumpAnim(event, ply)
if not wasjumpanim then if not wasjumpanim then
StartBodyAnim(animtable) StartBodyAnim(animtable)
if not IsValid(BodyAnim) then if not IsValid(BodyAnim) then return end
return
end
CreateBodyAnimArmCopy() CreateBodyAnimArmCopy()
@ -1413,7 +1390,7 @@ end
local lastwr = 0 local lastwr = 0
hook.Add("Think", "FBAnimHandler", function () hook.Add("Think", "FBAnimHandler", function()
local ply = LocalPlayer() local ply = LocalPlayer()
if not IsValid(BodyAnim) and ply:Alive() then if not IsValid(BodyAnim) and ply:Alive() then
@ -1456,13 +1433,14 @@ local function JumpThink()
if jumpanims[BodyAnimString] and (ply:OnGround() or ply:GetWallrun() ~= 0 or ply:GetMantle() ~= 0) then if jumpanims[BodyAnimString] and (ply:OnGround() or ply:GetWallrun() ~= 0 or ply:GetMantle() ~= 0) then
BodyAnim:SetSequence(BodyAnim:LookupSequence("runfwd")) BodyAnim:SetSequence(BodyAnim:LookupSequence("runfwd"))
BodyAnimCycle = 0 BodyAnimCycle = 0
end end
local ang = ply:EyeAngles() local ang = ply:EyeAngles()
ang[1] = 0 ang[1] = 0
animtr.start = ply:GetPos() animtr.start = ply:GetPos()
local angold = ang local angold = ang
local lerpspeed = 10 local lerpspeed = 10
local vel = LocalPlayer():GetVelocity() local vel = LocalPlayer():GetVelocity()
@ -1692,9 +1670,7 @@ local function JumpThink()
local func = fbfunctions[BodyAnimString] local func = fbfunctions[BodyAnimString]
func = func and func(ply) func = func and func(ply)
if func == true then if func == true then return end
return
end
if ply:GetMantle() == 4 then if ply:GetMantle() == 4 then
BodyAnim:SetSequence("vaultoverhigh") BodyAnim:SetSequence("vaultoverhigh")
@ -1734,7 +1710,8 @@ local function JumpThink()
BodyAnim:SetSequence(BodyAnim:LookupSequence("walktostandleft")) BodyAnim:SetSequence(BodyAnim:LookupSequence("walktostandleft"))
ply:EmitSound("Release." .. stepmat) ply:EmitSound("Release." .. stepmat)
timer.Simple(0.15, function ()
timer.Simple(0.15, function()
ply:EmitSound("Footsteps." .. stepmat) ply:EmitSound("Footsteps." .. stepmat)
end) end)
end end

View file

@ -2,6 +2,7 @@ local coursepanel = {
w = 1200, w = 1200,
h = 650 h = 650
} }
coursepanel.x = 960 - coursepanel.w * 0.5 coursepanel.x = 960 - coursepanel.w * 0.5
coursepanel.y = 540 - coursepanel.h * 0.5 coursepanel.y = 540 - coursepanel.h * 0.5
coursepanel.bgcolor = Color(32, 32, 32) coursepanel.bgcolor = Color(32, 32, 32)
@ -27,6 +28,7 @@ AEUI:AddButton(coursepanel, " X ", closebutton, "AEUILarge", coursepanel.w - 4
local stopbutton = AEUI:AddButton(coursepanel, "Return to Freeplay", stopbutton, "AEUILarge", coursepanel.w - 295, coursepanel.h - 50) local stopbutton = AEUI:AddButton(coursepanel, "Return to Freeplay", stopbutton, "AEUILarge", coursepanel.w - 295, coursepanel.h - 50)
stopbutton.greyed = sacheck stopbutton.greyed = sacheck
local courselist = { local courselist = {
w = 800, w = 800,
h = 450, h = 450,
@ -68,8 +70,9 @@ function OpenCourseMenu(ply)
end end
end end
hook.Add("InitPostEntity", "CourseMenuCommand", function () hook.Add("InitPostEntity", "CourseMenuCommand", function()
concommand.Add("Beatrun_CourseMenu", OpenCourseMenu) concommand.Add("Beatrun_CourseMenu", OpenCourseMenu)
hook.Remove("InitPostEntity", "CourseMenuCommand") hook.Remove("InitPostEntity", "CourseMenuCommand")
end) end)
concommand.Add("Beatrun_CourseMenu", OpenCourseMenu) concommand.Add("Beatrun_CourseMenu", OpenCourseMenu)

View file

@ -1,13 +1,8 @@
local enemy = Color(255, 0, 0) local enemy = Color(255, 0, 0)
local function HideNearby(ply) local function HideNearby(ply)
if ply == LocalPlayer() then if ply == LocalPlayer() then return end
return if GetGlobalBool(GM_DATATHEFT) then return end
end
if GetGlobalBool(GM_DATATHEFT) then
return
end
ply.distfromlocal = LocalPlayer():GetPos():Distance(ply:GetPos()) ply.distfromlocal = LocalPlayer():GetPos():Distance(ply:GetPos())
local Distance = ply.distfromlocal or 40000 local Distance = ply.distfromlocal or 40000
@ -59,6 +54,7 @@ local function HideNearby(ply)
ang:RotateAroundAxis(ang:Forward(), 90) ang:RotateAroundAxis(ang:Forward(), 90)
ang:RotateAroundAxis(ang:Right(), 90) ang:RotateAroundAxis(ang:Right(), 90)
cam.Start3D2D(pos, Angle(0, ang.y, 90), math.max(2.5 * Distance / 2000, 0.5)) cam.Start3D2D(pos, Angle(0, ang.y, 90), math.max(2.5 * Distance / 2000, 0.5))
cam.IgnoreZ(true) cam.IgnoreZ(true)
draw.DrawText(ply:Nick(), "BeatrunHUD", 2, 2, color, TEXT_ALIGN_CENTER) draw.DrawText(ply:Nick(), "BeatrunHUD", 2, 2, color, TEXT_ALIGN_CENTER)

View file

@ -1,28 +1,25 @@
local apikey = CreateConVar("beatrun_apikey", "0", true, { local apikey = CreateConVar("beatrun_apikey", "0", true, {FCVAR_ARCHIVE, FCVAR_UNLOGGED})
FCVAR_ARCHIVE,
FCVAR_UNLOGGED
})
function UploadCourse() function UploadCourse()
if Course_Name == "" or Course_ID == "" then if Course_Name == "" or Course_ID == "" then return print("Can't upload in Freeplay") end
print("Can't upload in Freeplay")
return
end
local file = file.Open("beatrun/courses/" .. game.GetMap() .. "/" .. Course_ID .. ".txt", "rb", "DATA") local file = file.Open("beatrun/courses/" .. game.GetMap() .. "/" .. Course_ID .. ".txt", "rb", "DATA")
local filedata = util.Decompress(file:Read(file:Size())) local filedata = util.Decompress(file:Read(file:Size()))
local function h_success(code, body, headers)
print("YOUR SHARE CODE: ", code)
print("Successfully uploaded course: ", body)
end
local function h_failed(reason) local function h_failed(reason)
print("HTTP failed: ", reason) print("HTTP failed: ", reason)
end end
local function h_success(code, body, headers)
print(body)
end
local h_method = "POST" local h_method = "POST"
local h_url = "https://datae.org/beatrun/upload.php" local h_url = "https://example.org/beatrun/upload.php"
local h_type = "text/plain"
local h_body = filedata
local h_headers = { local h_headers = {
["Content-Type"] = "text/plain", ["Content-Type"] = "text/plain",
["Content-Length"] = filedata:len(), ["Content-Length"] = filedata:len(),
@ -31,8 +28,6 @@ function UploadCourse()
Authorization = apikey:GetString(), Authorization = apikey:GetString(),
["Game-Map"] = game.GetMap() ["Game-Map"] = game.GetMap()
} }
local h_type = "text/plain"
local h_body = filedata
HTTP({ HTTP({
failed = h_failed, failed = h_failed,
@ -49,13 +44,13 @@ concommand.Add("Beatrun_UploadCourse", UploadCourse)
local GetCourse_Errors = { local GetCourse_Errors = {
["Bad map"] = "Error: You are not playing on the map this course was intended for.", ["Bad map"] = "Error: You are not playing on the map this course was intended for.",
["Not member"] = "Membership error. For more info, login at datae.org/beatrun", ["Invalid API Key"] = "Plese message me for a key.",
["Bad code"] = "Error: The share code provided is invalid.", ["Bad code"] = "Error: The share code provided is invalid.",
["Not valid key"] = "Error: The API key used is not valid." ["Not valid key"] = "Error: The API key used is not valid."
} }
function GetCourse(sharecode) function GetCourse(sharecode)
http.Fetch("https://datae.org/beatrun/getcourse.php?sharecode=" .. sharecode .. "&map=" .. game.GetMap() .. "&key=" .. apikey:GetString(), function (body, length, headers, code) http.Fetch("https://example/beatrun/getcourse.php?sharecode=" .. sharecode .. "&map=" .. game.GetMap() .. "&key=" .. apikey:GetString(), function(body, length, headers, code)
local errorcode = GetCourse_Errors[body] local errorcode = GetCourse_Errors[body]
if not errorcode then if not errorcode then
@ -69,15 +64,17 @@ function GetCourse(sharecode)
return false return false
end end
end, function (message) end,
function(message)
print("An error occurred.", message) print("An error occurred.", message)
return false return false
end, { end,
{
["accept-encoding"] = "gzip, deflate" ["accept-encoding"] = "gzip, deflate"
}) })
end end
concommand.Add("Beatrun_LoadCode", function (ply, cmd, args, argstr) concommand.Add("Beatrun_LoadCode", function(ply, cmd, args, argstr)
GetCourse(args[1]) GetCourse(args[1])
end) end)

View file

@ -1,8 +1,10 @@
local checktimer = 0 -- local checktimer = 0
local errorc = Color(255, 25, 25) local errorc = Color(255, 25, 25)
local whitelist = { local whitelist = {
c_ladderanim = true c_ladderanim = true
} }
local whitelistanims = fbanims local whitelistanims = fbanims
local function BodyAnimAntiStuck() local function BodyAnimAntiStuck()

View file

@ -1,26 +1,15 @@
if not system.IsWindows() or not file.Exists("lua/bin/gmcl_steamfriends_win64.dll", "GAME") then if not system.IsWindows() or not file.Exists("lua/bin/gmcl_steamfriends_win64.dll", "GAME") then return end
return
end
local richtext = "" local richtext = ""
local nextupdate = 0 local nextupdate = 0
local function UpdateRichPresence() local function UpdateRichPresence()
if CurTime() < nextupdate then if CurTime() < nextupdate then return end
return
end
local rp = steamworks.SetRichPresence local rp = steamworks.SetRichPresence
if not rp then return end
if not rp then
return
end
local ply = LocalPlayer() local ply = LocalPlayer()
if not ply.GetLevel then return end
if not ply.GetLevel then
return
end
local map = game.GetMap() local map = game.GetMap()
local level = LocalPlayer():GetLevel() local level = LocalPlayer():GetLevel()
@ -48,7 +37,7 @@ local function LoadRichPresenceDLL()
require("steamfriends") require("steamfriends")
end end
hook.Add("OnGamemodeLoaded", "LoadDLL", function () hook.Add("OnGamemodeLoaded", "LoadDLL", function()
local dllfound = pcall(LoadRichPresenceDLL) local dllfound = pcall(LoadRichPresenceDLL)
LoadRichPresenceDLL = nil LoadRichPresenceDLL = nil

View file

@ -31,9 +31,10 @@ end
function syn:Play(file, events) function syn:Play(file, events)
self:Reset() self:Reset()
sound.PlayFile(file, "noblock", function (a)
sound.PlayFile(file, "noblock", function(a)
if IsValid(a) then if IsValid(a) then
timer.Simple(0, function () timer.Simple(0, function()
a:EnableLooping(true) a:EnableLooping(true)
end) end)
@ -116,6 +117,7 @@ local testcolor = Color(151, 166, 182)
local function test_beat() local function test_beat()
testfov = testfovconvar:GetFloat() testfov = testfovconvar:GetFloat()
BlindGetColor().r = colbeatr BlindGetColor().r = colbeatr
BlindGetColor().g = colbeatg BlindGetColor().g = colbeatg
BlindGetColor().b = colbeatb BlindGetColor().b = colbeatb
@ -194,6 +196,7 @@ local function test_think()
BlindGetColor().r = math.Approach(BlindGetColor().r, colr, FrameTime() * 100) BlindGetColor().r = math.Approach(BlindGetColor().r, colr, FrameTime() * 100)
BlindGetColor().g = math.Approach(BlindGetColor().g, colg, FrameTime() * 100) BlindGetColor().g = math.Approach(BlindGetColor().g, colg, FrameTime() * 100)
BlindGetColor().b = math.Approach(BlindGetColor().b, colb, FrameTime() * 100) BlindGetColor().b = math.Approach(BlindGetColor().b, colb, FrameTime() * 100)
vanishrandx = math.Approach(vanishrandx, 0.5, FrameTime() * 50) vanishrandx = math.Approach(vanishrandx, 0.5, FrameTime() * 50)
vanishrandy = math.Approach(vanishrandy, 0.5, FrameTime() * 50) vanishrandy = math.Approach(vanishrandy, 0.5, FrameTime() * 50)
vanishrandz = math.Approach(vanishrandz, 0.5, FrameTime() * 50) vanishrandz = math.Approach(vanishrandz, 0.5, FrameTime() * 50)
@ -207,11 +210,13 @@ local function test_think()
if testbuildup then if testbuildup then
GlitchIntensity = math.Approach(GlitchIntensity, 0.65, FrameTime() * 0.1) GlitchIntensity = math.Approach(GlitchIntensity, 0.65, FrameTime() * 0.1)
blindrandx = math.Approach(blindrandx, 1.5, FrameTime() * 0.1) blindrandx = math.Approach(blindrandx, 1.5, FrameTime() * 0.1)
blindrandy = math.Approach(blindrandy, 1.5, FrameTime() * 0.1) blindrandy = math.Approach(blindrandy, 1.5, FrameTime() * 0.1)
blindrandz = math.Approach(blindrandz, 1.5, FrameTime() * 0.1) blindrandz = math.Approach(blindrandz, 1.5, FrameTime() * 0.1)
else else
GlitchIntensity = math.Approach(GlitchIntensity, 0.1, FrameTime() * 4) GlitchIntensity = math.Approach(GlitchIntensity, 0.1, FrameTime() * 4)
blindrandx = math.Approach(blindrandx, 0.5, FrameTime() * 10) blindrandx = math.Approach(blindrandx, 0.5, FrameTime() * 10)
blindrandy = math.Approach(blindrandy, 0.5, FrameTime() * 10) blindrandy = math.Approach(blindrandy, 0.5, FrameTime() * 10)
blindrandz = math.Approach(blindrandz, 0.5, FrameTime() * 10) blindrandz = math.Approach(blindrandz, 0.5, FrameTime() * 10)
@ -219,190 +224,52 @@ local function test_think()
end end
local testevents = { local testevents = {
{ {0, test_color1},
0, {0, test_endbuildup},
test_color1 {0, test_beat},
}, {0.75, test_pullback},
{ {1.1, test_pullback},
0, {1.9, test_pullback},
test_endbuildup {3.25, test_beat},
}, {6.75, test_beat},
{ {7.6, test_pullback},
0, {8, test_pullback},
test_beat {8.85, test_pullback},
}, {9, test_pullback},
{ {9.02, test_pullback},
0.75, {10.25, test_beat},
test_pullback {13.675, test_beat},
}, {14.5, test_pullback},
{ {15, test_pullback},
1.1, {15, test_startbuildup},
test_pullback {15.8, test_pullback},
}, {15.9, test_pullback},
{ {16, test_pullback},
1.9, {17.065, test_beat},
test_pullback {20.5, test_beat},
}, {21.3, test_pullback},
{ {21.7, test_pullback},
3.25, {22.5, test_pullback},
test_beat {22.8, test_pullback},
}, {22.82, test_pullback},
{ {24, test_beat},
6.75, {27.375, test_beathard},
test_beat {27.375, test_color2},
}, {30.75, test_beat},
{ {34.25, test_beathard},
7.6, {37.65, test_beat},
test_pullback {41, test_endbuildup},
}, {41.1, test_beat},
{ {44, test_startbuildup},
8, {44.5, test_beat},
test_pullback {48, test_beathard},
}, {51.4, test_beat},
{ {54.8, test_beat},
8.85, {54.8, test_endbuildup},
test_pullback {58.25, test_beat},
}, {59, test_startbuildup},
{ {61.65, test_beathard},
9, {65, test_beat}
test_pullback
},
{
9.02,
test_pullback
},
{
10.25,
test_beat
},
{
13.675,
test_beat
},
{
14.5,
test_pullback
},
{
15,
test_pullback
},
{
15,
test_startbuildup
},
{
15.8,
test_pullback
},
{
15.9,
test_pullback
},
{
16,
test_pullback
},
{
17.065,
test_beat
},
{
20.5,
test_beat
},
{
21.3,
test_pullback
},
{
21.7,
test_pullback
},
{
22.5,
test_pullback
},
{
22.8,
test_pullback
},
{
22.82,
test_pullback
},
{
24,
test_beat
},
{
27.375,
test_beathard
},
{
27.375,
test_color2
},
{
30.75,
test_beat
},
{
34.25,
test_beathard
},
{
37.65,
test_beat
},
{
41,
test_endbuildup
},
{
41.1,
test_beat
},
{
44,
test_startbuildup
},
{
44.5,
test_beat
},
{
48,
test_beathard
},
{
51.4,
test_beat
},
{
54.8,
test_beat
},
{
54.8,
test_endbuildup
},
{
58.25,
test_beat
},
{
59,
test_startbuildup
},
{
61.65,
test_beathard
},
{
65,
test_beat
}
} }
function test_syn(a) function test_syn(a)

View file

@ -6,7 +6,7 @@ local viewbob_intensity = CreateClientConVar("Beatrun_ViewbobIntensity", "20", t
local viewbob_stabilized = CreateClientConVar("Beatrun_ViewbobStabilized", "0", true, true, "Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered", 0, 1) local viewbob_stabilized = CreateClientConVar("Beatrun_ViewbobStabilized", "0", true, true, "Turn on to reduce motion sickness by making viewbobbing keep the player's look position centered", 0, 1)
local function lensqr(ang) local function lensqr(ang)
return ang[1]^2 + ang[2]^2 + ang[3]^2 return ang[1] ^ 2 + ang[2] ^ 2 + ang[3] ^ 2
end end
function metavec:Approach(x, y, z, speed) function metavec:Approach(x, y, z, speed)
@ -111,7 +111,9 @@ local function CLViewPunchCalc(ply, pos, ang)
punchlocal.z = math.max(math.abs(PunchPos.y) * math.abs(runfwd - 1) * 2, -0.5) * crouchmul punchlocal.z = math.max(math.abs(PunchPos.y) * math.abs(runfwd - 1) * 2, -0.5) * crouchmul
punchlocal:Mul(0.66) punchlocal:Mul(0.66)
pos:Add(punchlocal) pos:Add(punchlocal)
punchlocal:Mul(1.5151515151515151) punchlocal:Mul(1.5151515151515151)
runangmul = math.Approach(runangmul, grounded and 0.5 or 0, FrameTime() * (grounded and 5 or 15)) runangmul = math.Approach(runangmul, grounded and 0.5 or 0, FrameTime() * (grounded and 5 or 15))
@ -131,6 +133,7 @@ function meta:CLViewPunch(angle)
ang[1] = math.Clamp(ang[1], -180, 180) ang[1] = math.Clamp(ang[1], -180, 180)
ang[2] = math.Clamp(ang[2], -180, 180) ang[2] = math.Clamp(ang[2], -180, 180)
ang[3] = math.Clamp(ang[3], -180, 180) ang[3] = math.Clamp(ang[3], -180, 180)
self.ViewPunchDone = false self.ViewPunchDone = false
end end

View file

@ -1,24 +1,27 @@
--[[
local wmx, wmy = 0, 0 local wmx, wmy = 0, 0
local wmtime = 0 local wmtime = 0
hook.Add("PostRender", "Watermark", function() hook.Add("PostRender", "Watermark", function()
-- surface.SetFont("DebugFixed") surface.SetFont("DebugFixed")
-- surface.SetTextColor(255,255,255, 75) surface.SetTextColor(255, 255, 255, 75)
-- local steamid = LocalPlayer():SteamID() local steamid = LocalPlayer():SteamID()
-- local tw, th = surface.GetTextSize(steamid) local _, th = surface.GetTextSize(steamid)
-- if SysTime() > wmtime then if SysTime() > wmtime then
-- wmx, wmy = math.random(0, ScrW()-100), math.random(0, ScrH()-100) wmx, wmy = math.random(0, ScrW() - 100), math.random(0, ScrH() - 100)
-- wmtime = SysTime() + 2 wmtime = SysTime() + 2
-- end end
-- cam.Start2D() cam.Start2D()
-- surface.SetTextPos(wmx,wmy) surface.SetTextPos(wmx, wmy)
-- surface.DrawText("Beta") surface.DrawText("Beta")
-- surface.SetTextPos(wmx,wmy+th) surface.SetTextPos(wmx, wmy + th)
-- surface.DrawText(steamid) surface.DrawText(steamid)
-- surface.SetTextPos(wmx,wmy+(th*2)) surface.SetTextPos(wmx, wmy + (th * 2))
-- surface.DrawText(system.SteamTime()) surface.DrawText(system.SteamTime())
-- surface.SetTextPos(wmx,wmy+(th*3)) surface.SetTextPos(wmx, wmy + (th * 3))
-- surface.DrawText(LocalPlayer():Nick()) surface.DrawText(LocalPlayer():Nick())
-- cam.End2D() cam.End2D()
end) end)
]]

View file

@ -1,6 +1,5 @@
local worldmats local worldmats
local editedmats local editedmats
local worldmats_texture = {} local worldmats_texture = {}
local worldmats_color = {} local worldmats_color = {}
local whitescale = false local whitescale = false
@ -11,43 +10,57 @@ local function World_Whitescale()
local propmats = ents.FindByClass("prop_dynamic") local propmats = ents.FindByClass("prop_dynamic")
local dupeprops = {} local dupeprops = {}
for k,v in pairs(propmats) do
for k, v in pairs(propmats) do
if dupeprops[v:GetModel()] then continue end if dupeprops[v:GetModel()] then continue end
for k,v in pairs(v:GetMaterials()) do
for k, v in pairs(v:GetMaterials()) do
table.insert(worldmats, v) table.insert(worldmats, v)
end end
dupeprops[v:GetModel()] = true dupeprops[v:GetModel()] = true
end end
for k,v in pairs(worldmats) do for k, v in pairs(worldmats) do
if v:find("water/") then continue end if v:find("water/") then continue end
local newmat = Material(v) local newmat = Material(v)
table.insert(editedmats, newmat) table.insert(editedmats, newmat)
table.insert(worldmats_color, newmat:GetVector("$color")) table.insert(worldmats_color, newmat:GetVector("$color"))
table.insert(worldmats_texture, newmat:GetString("$basetexture") or 0) table.insert(worldmats_texture, newmat:GetString("$basetexture") or 0)
newmat:SetTexture("$basetexture", "models/debug/debugwhite") newmat:SetTexture("$basetexture", "models/debug/debugwhite")
-- if math.random()>0.5 then -- if math.random()>0.5 then
local noise = util.SharedRandom(k, -0.25, 0) local noise = util.SharedRandom(k, -0.25, 0)
newmat:SetVector("$color",Vector(0.65+noise,0.65+noise,0.65+noise)) newmat:SetVector("$color", Vector(0.65 + noise, 0.65 + noise, 0.65 + noise))
-- else -- else
-- newmat:SetVector("$color",Vector(0.95,0.05,0.05)) -- newmat:SetVector("$color",Vector(0.95,0.05,0.05))
-- end -- end
end end
whitescale = true whitescale = true
net.Start("ToggleWhitescale") net.Start("ToggleWhitescale")
net.WriteBool(whitescale) net.WriteBool(whitescale)
net.SendToServer() net.SendToServer()
end end
local function World_WhitescaleOff() local function World_WhitescaleOff()
if !editedmats then return end if not editedmats then return end
for k,v in pairs(editedmats) do
for k, v in pairs(editedmats) do
local oldtexture = worldmats_texture[k] local oldtexture = worldmats_texture[k]
if oldtexture != 0 then
v:SetTexture("$basetexture",worldmats_texture[k]) if oldtexture ~= 0 then
v:SetTexture("$basetexture", worldmats_texture[k])
end end
v:SetVector("$color",worldmats_color[k])
v:SetVector("$color", worldmats_color[k])
end end
whitescale = false whitescale = false
end end
@ -58,4 +71,5 @@ local function ToggleWhitescale()
World_Whitescale() World_Whitescale()
end end
end end
concommand.Add("ToggleWhitescale",ToggleWhitescale)
concommand.Add("ToggleWhitescale", ToggleWhitescale)

View file

@ -1,10 +1,10 @@
local meta = FindMetaTable("Player") local meta = FindMetaTable("Player")
local XP_max = 2000000 -- local XP_max = 2000000
local XP_ratiocache = nil local XP_ratiocache = nil
local parkourevent_lastpos = Vector() local parkourevent_lastpos = Vector()
function XP_nextlevel(level) function XP_nextlevel(level)
return math.Round(0.25 * level^3 + 0.8 * level^2 + 2 * level) return math.Round(0.25 * level ^ 3 + 0.8 * level ^ 2 + 2 * level)
end end
local ParkourXP = { local ParkourXP = {
@ -20,23 +20,24 @@ local ParkourXP = {
swingbar = 4, swingbar = 4,
step = 1 step = 1
} }
local ParkourXP_RNG = { local ParkourXP_RNG = {
sidestep = 0.1 sidestep = 0.1
} }
local ParkourXP_PosCheck = { local ParkourXP_PosCheck = {
climb = true, climb = true,
vault = true, vault = true,
wallrunh = true, wallrunh = true,
wallrunv = true wallrunv = true
} }
XP_floatingxp = {} XP_floatingxp = {}
hook.Add("OnParkour", "ParkourXP", function (event) hook.Add("OnParkour", "ParkourXP", function(event)
local ply = LocalPlayer() local ply = LocalPlayer()
if ply.InReplay then if ply.InReplay then return end
return
end
local pos = ply:GetPos() local pos = ply:GetPos()
@ -74,10 +75,7 @@ function meta:LevelUp()
self:SetLevel(self:GetLevel() + 1) self:SetLevel(self:GetLevel() + 1)
i = i + 1 i = i + 1
if i > 1000 then break end
if i > 1000 then
break
end
end end
if i > 0 then if i > 0 then
@ -91,6 +89,7 @@ end
function meta:SetXP(xp) function meta:SetXP(xp)
self.XP = math.Round(xp) self.XP = math.Round(xp)
XP_ratiocache = nil XP_ratiocache = nil
self:LevelUp() self:LevelUp()
@ -98,6 +97,7 @@ end
function meta:AddXP(xp) function meta:AddXP(xp)
self.XP = math.Round((self.XP or 0) + xp) self.XP = math.Round((self.XP or 0) + xp)
XP_ratiocache = nil XP_ratiocache = nil
self:LevelUp() self:LevelUp()
@ -110,18 +110,13 @@ function meta:AddXP(xp)
end end
local function SaveXP() local function SaveXP()
local xp = util.TableToJSON({ local xp = util.TableToJSON({LocalPlayer().XP or 0, LocalPlayer().Level or 1})
LocalPlayer().XP or 0,
LocalPlayer().Level or 1
})
local xpold = file.Read("beatrun/local/xp.txt", "DATA") local xpold = file.Read("beatrun/local/xp.txt", "DATA")
if xpold then if xpold then
xpold = util.Decompress(xpold) xpold = util.Decompress(xpold)
if LocalPlayer().XP < util.JSONToTable(xpold)[1] then return end
if LocalPlayer().XP < util.JSONToTable(xpold)[1] then
return
end
end end
local xp = util.Compress(xp) local xp = util.Compress(xp)

View file

@ -5,8 +5,8 @@ local SScaleY_cached = {}
function SScaleX(sizex) function SScaleX(sizex)
-- local iswide = AEUI.ScrW / AEUI.ScrH > 1.6 -- local iswide = AEUI.ScrW / AEUI.ScrH > 1.6
if SScaleX_cached[sizex] then return SScaleX_cached[sizex] end if SScaleX_cached[sizex] then return SScaleX_cached[sizex] end
SScaleX_cached[sizex] = math.ceil(sizex / (1920 / AEUI.ScrW)) SScaleX_cached[sizex] = math.ceil(sizex / (1920 / AEUI.ScrW))
return SScaleX_cached[sizex] return SScaleX_cached[sizex]
@ -42,6 +42,7 @@ function AEUIFonts()
weight = 500, weight = 500,
size = ScreenScale(7) size = ScreenScale(7)
}) })
surface.CreateFont("AEUILarge", { surface.CreateFont("AEUILarge", {
shadow = false, shadow = false,
blursize = 0, blursize = 0,
@ -59,6 +60,7 @@ function AEUIFonts()
weight = 500, weight = 500,
size = ScreenScale(12) size = ScreenScale(12)
}) })
surface.CreateFont("AEUIVeryLarge", { surface.CreateFont("AEUIVeryLarge", {
shadow = false, shadow = false,
blursize = 0, blursize = 0,
@ -231,6 +233,7 @@ local function AEUIDraw()
if e.hover then if e.hover then
local mx = AEUI.MX + SScaleX(20) local mx = AEUI.MX + SScaleX(20)
local my = AEUI.MY + SScaleY(20) local my = AEUI.MY + SScaleY(20)
surface.SetTextColor(255, 255, 255) surface.SetTextColor(255, 255, 255)
surface.SetFont("AEUIDefault") surface.SetFont("AEUIDefault")
@ -251,6 +254,7 @@ local function AEUIDraw()
end end
hook.Add("HUDPaint", "AEUIDraw", AEUIDraw) hook.Add("HUDPaint", "AEUIDraw", AEUIDraw)
hook.Add("StartCommand", "AEUI_StartCommand", function(ply, cmd) hook.Add("StartCommand", "AEUI_StartCommand", function(ply, cmd)
local mx = gui.MouseX() local mx = gui.MouseX()
local my = gui.MouseY() local my = gui.MouseY()
@ -266,7 +270,6 @@ hook.Add("StartCommand", "AEUI_StartCommand", function(ply, cmd)
if x < mx and mx < x + w and y < my and my < y + h then if x < mx and mx < x + w and y < my and my < y + h then
AEUI.HoveredPanel = panel AEUI.HoveredPanel = panel
break break
else else
AEUI.HoveredPanel = nil AEUI.HoveredPanel = nil
@ -319,7 +322,6 @@ end)
hook.Add("OnScreenSizeChanged", "AEUI_ScreenSize", function() hook.Add("OnScreenSizeChanged", "AEUI_ScreenSize", function()
AEUI.ScrH = ScrH() AEUI.ScrH = ScrH()
AEUI.ScrW = ScrW() AEUI.ScrW = ScrW()
table.Empty(SScaleX_cached) table.Empty(SScaleX_cached)
table.Empty(SScaleY_cached) table.Empty(SScaleY_cached)
AEUIFonts() AEUIFonts()
@ -338,7 +340,6 @@ function AEUI.Elements.Text(panel, data)
if isgreyed then if isgreyed then
local colr, colg, colb = data.color:Unpack() local colr, colg, colb = data.color:Unpack()
surface.SetDrawColor(colr, colg, colb, 50) surface.SetDrawColor(colr, colg, colb, 50)
surface.SetTextColor(colr, colg, colb, 50) surface.SetTextColor(colr, colg, colb, 50)
else else

View file

@ -145,6 +145,7 @@ local white = Color(210, 159, 110, 255)
local green = Color(0, 255, 0) local green = Color(0, 255, 0)
local circle = Material("circle.png", "nocull") local circle = Material("circle.png", "nocull")
whiteg = white whiteg = white
customcolors = { customcolors = {
Color(210, 159, 110, 255), Color(210, 159, 110, 255),
Color(203, 145, 65, 255), Color(203, 145, 65, 255),
@ -155,6 +156,7 @@ customcolors = {
Color(250, 20, 40, 255), Color(250, 20, 40, 255),
Color(10, 255, 20, 255) Color(10, 255, 20, 255)
} }
local forcelines = false local forcelines = false
function BlindSetColor(newcol) function BlindSetColor(newcol)
@ -174,11 +176,9 @@ local camvector = Vector()
local camang = Angle() local camang = Angle()
local camlerp = 0 local camlerp = 0
local lerp, sound, bgm = nil local lerp, sound, bgm = nil
blindcolor = {
0, blindcolor = {0, 0, 0}
0,
0
}
local colors = { local colors = {
[MAT_DEFAULT] = blue, [MAT_DEFAULT] = blue,
[MAT_GLASS] = glass, [MAT_GLASS] = glass,
@ -187,12 +187,9 @@ local colors = {
[MAT_GRASS] = grass, [MAT_GRASS] = grass,
[MAT_FLESH] = red [MAT_FLESH] = red
} }
local colorslist = {
green, local colorslist = {green, grass, sand, glass}
grass,
sand,
glass
}
blindrandrendermin = 0.9 blindrandrendermin = 0.9
blindinverted = false blindinverted = false
blindpopulate = false blindpopulate = false
@ -200,12 +197,12 @@ blindpopulatespeed = 1000
blindfakepopulate = false blindfakepopulate = false
customglitch = false customglitch = false
blindcustomlerp = 0 blindcustomlerp = 0
blindcustompoints = {
Vector()
}
local blindcustompoints = blindcustompoints
-- local sizemult = 1
blindcustompoints = {Vector()}
local blindcustompoints = blindcustompoints
-- local sizemult = 1
function InvertColors() function InvertColors()
for k, v in ipairs(colorslist) do for k, v in ipairs(colorslist) do
v.r = 255 - v.r v.r = 255 - v.r
@ -244,6 +241,7 @@ local colorsclass = {
func_door_rotating = green, func_door_rotating = green,
func_door = green func_door = green
} }
local blindedsounds = { local blindedsounds = {
["bad.wav"] = true, ["bad.wav"] = true,
["music/locloop_unk.wav"] = true, ["music/locloop_unk.wav"] = true,
@ -262,9 +260,11 @@ local blindedsounds = {
["lidar/burst3.wav"] = true, ["lidar/burst3.wav"] = true,
["lidar/scanstop.wav"] = true ["lidar/scanstop.wav"] = true
} }
local trw = { local trw = {
collisiongroup = COLLISION_GROUP_WORLD collisiongroup = COLLISION_GROUP_WORLD
} }
local trwr = {} local trwr = {}
local function IsInWorld(pos) local function IsInWorld(pos)
@ -329,9 +329,8 @@ LOCEntities = LOCEntities or {}
meshtbl = meshtbl or new() meshtbl = meshtbl or new()
local meshtbl = meshtbl local meshtbl = meshtbl
pausescan = false pausescan = false
local mathrandom = math.random
/* --[[
local function OptimizeMeshes() local function OptimizeMeshes()
local i = 0 local i = 0
-- local vertexcount = 0 -- local vertexcount = 0
@ -343,7 +342,7 @@ local function OptimizeMeshes()
i = i + 1 i = i + 1
end end
end end
*/ ]]
glob_blindangles = Angle() glob_blindangles = Angle()
glob_blindorigin = Vector() glob_blindorigin = Vector()
@ -357,8 +356,10 @@ local function Blindness(origin, angles)
local eyeang = angles local eyeang = angles
local FT = FrameTime() local FT = FrameTime()
local quality = quality:GetBool() local quality = quality:GetBool()
glob_blindorigin:Set(origin) glob_blindorigin:Set(origin)
glob_blindangles:Set(angles) glob_blindangles:Set(angles)
local hitpointscount = nil local hitpointscount = nil
-- local vel_l = ply:GetVelocity():Length() -- local vel_l = ply:GetVelocity():Length()
-- local vel = 2.5 -- local vel = 2.5
@ -371,6 +372,7 @@ local function Blindness(origin, angles)
end end
local randrender = math.Rand(blindrandrendermin, 1) local randrender = math.Rand(blindrandrendermin, 1)
render.Clear(blindcolor[1] * randrender, blindcolor[2] * randrender, blindcolor[3] * randrender, 0) render.Clear(blindcolor[1] * randrender, blindcolor[2] * randrender, blindcolor[3] * randrender, 0)
render.ClearDepth() render.ClearDepth()
render.ClearStencil() render.ClearStencil()
@ -382,15 +384,18 @@ local function Blindness(origin, angles)
if trace.Hit then if trace.Hit then
hitpoints:push_right(trace.HitPos) hitpoints:push_right(trace.HitPos)
local invert = mathrandom()
local invert = math.random()
if invert < 0.05 then if invert < 0.05 then
trace.HitNormal:Mul(-1) trace.HitNormal:Mul(-1)
end end
hitnormal:push_right(trace.HitNormal) hitnormal:push_right(trace.HitNormal)
local hcol = colors[trace.MatType] local hcol = colors[trace.MatType]
local hcolclass = colorsclass[trace.Entity:GetClass()] local hcolclass = colorsclass[trace.Entity:GetClass()]
hitcolor:push_right(hcol or hcolclass or white) hitcolor:push_right(hcol or hcolclass or white)
if limit < hitpoints:length() then if limit < hitpoints:length() then
@ -432,11 +437,11 @@ local function Blindness(origin, angles)
end end
end end
-- local lastpos = hitpoints[hitpoints.tail]
local f = eyeang:Forward() local f = eyeang:Forward()
local eyediff = Vector() local eyediff = Vector()
local k = limit local k = limit
local k2 = 0 local k2 = 0
-- local lastpos = hitpoints[hitpoints.tail]
-- local vanishlimit = vanishlimit -- local vanishlimit = vanishlimit
-- local vanishrandx = vanishrandx -- local vanishrandx = vanishrandx
-- local vanishrandy = vanishrandy -- local vanishrandy = vanishrandy
@ -460,6 +465,7 @@ local function Blindness(origin, angles)
local ed = eyedot local ed = eyedot
local anggg = ply:EyeAngles() local anggg = ply:EyeAngles()
anggg.x = 0 anggg.x = 0
local eyep = ply:EyePos() + anggg:Forward() * 200 local eyep = ply:EyePos() + anggg:Forward() * 200
local hitindex = 1 local hitindex = 1
local drawcount = #blindcustompoints local drawcount = #blindcustompoints
@ -569,8 +575,9 @@ local function BlindnessPreUI()
end end
end end
-- local te = "te/metamorphosis/" --[[
/* local te = "te/metamorphosis/"
local jingles = { local jingles = {
land = te .. "3-linedrop", land = te .. "3-linedrop",
jump = te .. "1-linemove", jump = te .. "1-linemove",
@ -593,7 +600,7 @@ local function BlindnessJingles(event)
LocalPlayer():EmitSound(jingles[event] .. math.random(1, jinglescount[event]) .. ".wav") LocalPlayer():EmitSound(jingles[event] .. math.random(1, jinglescount[event]) .. ".wav")
end end
end end
*/ ]]
function ToggleBlindness(toggle) function ToggleBlindness(toggle)
blinded = toggle blinded = toggle
@ -616,6 +623,7 @@ function ToggleBlindness(toggle)
local milestone = ply:GetLevel() >= 100 local milestone = ply:GetLevel() >= 100
local bgmstring = milestone and "music/locloop.wav" or "music/locloop_unk.wav" local bgmstring = milestone and "music/locloop.wav" or "music/locloop_unk.wav"
forcelines = not milestone forcelines = not milestone
BlindSetColor(milestone and customcolors[1] or customcolors[3]) BlindSetColor(milestone and customcolors[1] or customcolors[3])
@ -666,6 +674,7 @@ function cool()
for v in hitpoints:iter_right() do for v in hitpoints:iter_right() do
mesh.QuadEasy(v, hitnormal[hitnormal.tail - k2], 2, 2, hitcolor[hitcolor.tail - k2] or white) mesh.QuadEasy(v, hitnormal[hitnormal.tail - k2], 2, 2, hitcolor[hitcolor.tail - k2] or white)
k = k - 1 k = k - 1
k2 = k2 + 1 k2 = k2 + 1
end end

View file

@ -1,20 +1,18 @@
AddCSLuaFile() AddCSLuaFile()
DEFINE_BASECLASS( "player_default" )
if ( CLIENT ) then DEFINE_BASECLASS("player_default")
CreateConVar( "cl_playercolor", "0.24 0.34 0.41", { FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD }, "The value is a Vector - so between 0-1 - not between 0-255" )
CreateConVar( "cl_weaponcolor", "0.30 1.80 2.10", { FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD }, "The value is a Vector - so between 0-1 - not between 0-255" )
CreateConVar( "cl_playerskin", "0", { FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD }, "The skin to use, if the model has any" )
CreateConVar( "cl_playerbodygroups", "0", { FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD }, "The bodygroups to use, if the model has any" )
if CLIENT then
CreateConVar("cl_playercolor", "0.24 0.34 0.41", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The value is a Vector - so between 0-1 - not between 0-255")
CreateConVar("cl_weaponcolor", "0.30 1.80 2.10", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The value is a Vector - so between 0-1 - not between 0-255")
CreateConVar("cl_playerskin", "0", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The skin to use, if the model has any")
CreateConVar("cl_playerbodygroups", "0", {FCVAR_ARCHIVE, FCVAR_USERINFO, FCVAR_DONTRECORD}, "The bodygroups to use, if the model has any")
end end
local PLAYER = {} local PLAYER = {}
PLAYER.DuckSpeed = 0.01 -- How fast to go from not ducking, to ducking PLAYER.DuckSpeed = 0.01 -- How fast to go from not ducking, to ducking
PLAYER.UnDuckSpeed = 0.01 -- How fast to go from ducking, to not ducking PLAYER.UnDuckSpeed = 0.01 -- How fast to go from ducking, to not ducking
-- --
-- Creates a Taunt Camera -- Creates a Taunt Camera
@ -24,158 +22,155 @@ PLAYER.TauntCam = TauntCamera()
-- --
-- See gamemodes/base/player_class/player_default.lua for all overridable variables -- See gamemodes/base/player_class/player_default.lua for all overridable variables
-- --
PLAYER.WalkSpeed = 200 PLAYER.WalkSpeed = 200
PLAYER.RunSpeed = 400 PLAYER.RunSpeed = 400
-- --
-- Set up the network table accessors -- Set up the network table accessors
-- --
function PLAYER:SetupDataTables() function PLAYER:SetupDataTables()
BaseClass.SetupDataTables(self)
self.Player:NetworkVar("Float", 0, "MEMoveLimit")
self.Player:NetworkVar("Float", 1, "MESprintDelay")
self.Player:NetworkVar("Float", 2, "MEAng")
BaseClass.SetupDataTables( self ) self.Player:NetworkVar("Int", 0, "Climbing")
self.Player:NetworkVar( "Float", 0, "MEMoveLimit" ) self.Player:NetworkVar("Float", 3, "ClimbingTime")
self.Player:NetworkVar( "Float", 1, "MESprintDelay" ) self.Player:NetworkVar("Vector", 0, "ClimbingStart")
self.Player:NetworkVar( "Float", 2, "MEAng" ) self.Player:NetworkVar("Vector", 1, "ClimbingEnd")
self.Player:NetworkVar("Vector", 7, "ClimbingEndOld")
self.Player:NetworkVar("Float", 24, "ClimbingDelay")
self.Player:NetworkVar("Angle", 3, "ClimbingAngle")
self.Player:NetworkVar( "Int", 0, "Climbing" ) self.Player:NetworkVar("Int", 1, "Wallrun")
self.Player:NetworkVar( "Float", 3, "ClimbingTime" ) self.Player:NetworkVar("Float", 4, "WallrunTime")
self.Player:NetworkVar( "Vector", 0, "ClimbingStart" ) self.Player:NetworkVar("Float", 5, "WallrunSoundTime")
self.Player:NetworkVar( "Vector", 1, "ClimbingEnd" ) self.Player:NetworkVar("Vector", 2, "WallrunDir")
self.Player:NetworkVar( "Vector", 7, "ClimbingEndOld" ) self.Player:NetworkVar("Vector", 8, "WallrunOrigVel")
self.Player:NetworkVar( "Float", 24, "ClimbingDelay" ) self.Player:NetworkVar("Int", 4, "WallrunCount")
self.Player:NetworkVar( "Angle", 3, "ClimbingAngle" )
self.Player:NetworkVar( "Int", 1, "Wallrun") self.Player:NetworkVar("Bool", 0, "Sliding")
self.Player:NetworkVar( "Float", 4, "WallrunTime") self.Player:NetworkVar("Float", 6, "SlidingTime")
self.Player:NetworkVar( "Float", 5, "WallrunSoundTime") self.Player:NetworkVar("Float", 7, "SlidingDelay")
self.Player:NetworkVar( "Vector", 2, "WallrunDir") self.Player:NetworkVar("Vector", 4, "SlidingLastPos")
self.Player:NetworkVar( "Vector", 8, "WallrunOrigVel") self.Player:NetworkVar("Float", 18, "SlidingVel")
self.Player:NetworkVar( "Int", 4, "WallrunCount") self.Player:NetworkVar("Float", 19, "SlidingStrafe")
self.Player:NetworkVar("Bool", 9, "SlidingSlippery")
self.Player:NetworkVar("Float", 20, "SlidingSlipperyUpdate")
self.Player:NetworkVar("Angle", 2, "SlidingAngle")
self.Player:NetworkVar( "Bool", 0, "Sliding" ) self.Player:NetworkVar("Bool", 1, "StepRight")
self.Player:NetworkVar( "Float", 6, "SlidingTime" ) self.Player:NetworkVar("Float", 8, "StepRelease")
self.Player:NetworkVar( "Float", 7, "SlidingDelay" )
self.Player:NetworkVar( "Vector", 4, "SlidingLastPos" )
self.Player:NetworkVar( "Float", 18, "SlidingVel" )
self.Player:NetworkVar( "Float", 19, "SlidingStrafe" )
self.Player:NetworkVar( "Bool", 9, "SlidingSlippery" )
self.Player:NetworkVar( "Float", 20, "SlidingSlipperyUpdate" )
self.Player:NetworkVar( "Angle", 2, "SlidingAngle" )
self.Player:NetworkVar( "Bool", 1, "StepRight" ) self.Player:NetworkVar("Bool", 2, "Grappling")
self.Player:NetworkVar( "Float", 8, "StepRelease" ) self.Player:NetworkVar("Vector", 3, "GrapplePos")
self.Player:NetworkVar("Float", 29, "GrappleLength")
self.Player:NetworkVar( "Bool", 2, "Grappling" ) self.Player:NetworkVar("Entity", 0, "Swingbar")
self.Player:NetworkVar( "Vector", 3, "GrapplePos" )
self.Player:NetworkVar( "Float", 29, "GrappleLength")
self.Player:NetworkVar( "Entity", 0, "Swingbar" ) self.Player:NetworkVar("Bool", 3, "CrouchJump")
self.Player:NetworkVar("Float", 9, "CrouchJumpTime")
self.Player:NetworkVar("Bool", 12, "CrouchJumpBlocked")
self.Player:NetworkVar( "Bool", 3, "CrouchJump" ) self.Player:NetworkVar("Float", 9, "SafetyRollKeyTime")
self.Player:NetworkVar( "Float", 9, "CrouchJumpTime" ) self.Player:NetworkVar("Float", 10, "SafetyRollTime")
self.Player:NetworkVar( "Bool", 12, "CrouchJumpBlocked" ) self.Player:NetworkVar("Angle", 0, "SafetyRollAng")
self.Player:NetworkVar( "Float", 9, "SafetyRollKeyTime" ) self.Player:NetworkVar("Bool", 4, "Quickturn")
self.Player:NetworkVar( "Float", 10, "SafetyRollTime" ) self.Player:NetworkVar("Float", 10, "QuickturnTime")
self.Player:NetworkVar( "Angle", 0, "SafetyRollAng" ) self.Player:NetworkVar("Angle", 1, "QuickturnAng")
self.Player:NetworkVar( "Bool", 4, "Quickturn" )
self.Player:NetworkVar( "Float", 10, "QuickturnTime" )
self.Player:NetworkVar( "Angle", 1, "QuickturnAng" )
self.Player:NetworkVar( "Bool", 5, "WallrunElevated" )
self.Player:NetworkVar("Bool", 5, "WallrunElevated")
--We have to store this info on the player as multiple people can use one swingbar --We have to store this info on the player as multiple people can use one swingbar
self.Player:NetworkVar( "Float", 11, "SBOffset" ) self.Player:NetworkVar("Float", 11, "SBOffset")
self.Player:NetworkVar( "Float", 12, "SBOffsetSpeed" ) self.Player:NetworkVar("Float", 12, "SBOffsetSpeed")
self.Player:NetworkVar( "Float", 13, "SBStartLerp" ) self.Player:NetworkVar("Float", 13, "SBStartLerp")
self.Player:NetworkVar( "Float", 14, "SBDelay" ) self.Player:NetworkVar("Float", 14, "SBDelay")
self.Player:NetworkVar( "Int", 2, "SBPeak" ) self.Player:NetworkVar("Int", 2, "SBPeak")
self.Player:NetworkVar( "Bool",6, "SBDir" ) self.Player:NetworkVar("Bool", 6, "SBDir")
self.Player:NetworkVar( "Entity",1, "SwingbarLast" ) self.Player:NetworkVar("Entity", 1, "SwingbarLast")
self.Player:NetworkVar( "Entity", 2, "Swingpipe" ) self.Player:NetworkVar("Entity", 2, "Swingpipe")
self.Player:NetworkVar( "Entity", 3, "Rabbit" ) self.Player:NetworkVar("Entity", 3, "Rabbit")
self.Player:NetworkVar( "Int", 3, "RabbitSeat" ) self.Player:NetworkVar("Int", 3, "RabbitSeat")
self.Player:NetworkVar("Float", 15, "OverdriveCharge")
self.Player:NetworkVar("Float", 16, "OverdriveMult")
self.Player:NetworkVar( "Float", 15, "OverdriveCharge" ) self.Player:NetworkVar("Bool", 7, "JumpTurn")
self.Player:NetworkVar( "Float", 16, "OverdriveMult" ) self.Player:NetworkVar("Float", 17, "JumpTurnRecovery")
self.Player:NetworkVar("Bool", 8, "WasOnGround")
self.Player:NetworkVar( "Bool", 7, "JumpTurn" ) self.Player:NetworkVar("Entity", 4, "Ladder")
self.Player:NetworkVar( "Float", 17, "JumpTurnRecovery" ) self.Player:NetworkVar("Float", 21, "LadderDelay")
self.Player:NetworkVar("Float", 22, "LadderHeight")
self.Player:NetworkVar("Bool", 10, "LadderEntering")
self.Player:NetworkVar("Bool", 11, "LadderHand")
self.Player:NetworkVar("Vector", 5, "LadderStartPos")
self.Player:NetworkVar("Vector", 6, "LadderEndPos")
self.Player:NetworkVar("Float", 23, "LadderLerp")
self.Player:NetworkVar( "Bool", 8, "WasOnGround" ) self.Player:NetworkVar("Entity", 5, "Zipline")
self.Player:NetworkVar("Float", 21, "ZiplineStart")
self.Player:NetworkVar("Float", 22, "ZiplineFraction")
self.Player:NetworkVar("Float", 23, "ZiplineSpeed")
self.Player:NetworkVar("Float", 25, "ZiplineDelay")
self.Player:NetworkVar( "Entity", 4, "Ladder" ) self.Player:NetworkVar("Int", 5, "MeleeDamage")
self.Player:NetworkVar( "Float", 21, "LadderDelay" ) self.Player:NetworkVar("Float", 26, "MeleeTime")
self.Player:NetworkVar( "Float", 22, "LadderHeight" ) self.Player:NetworkVar("Float", 27, "MeleeDelay")
self.Player:NetworkVar( "Bool", 10, "LadderEntering" ) self.Player:NetworkVar("Int", 6, "Melee")
self.Player:NetworkVar( "Bool", 11, "LadderHand" )
self.Player:NetworkVar( "Vector", 5, "LadderStartPos" )
self.Player:NetworkVar( "Vector", 6, "LadderEndPos" )
self.Player:NetworkVar( "Float", 23, "LadderLerp" )
self.Player:NetworkVar( "Entity", 5, "Zipline" ) self.Player:NetworkVar("Float", 28, "Balance")
self.Player:NetworkVar( "Float", 21, "ZiplineStart" ) self.Player:NetworkVar("Entity", 6, "BalanceEntity")
self.Player:NetworkVar( "Float", 22, "ZiplineFraction" )
self.Player:NetworkVar( "Float", 23, "ZiplineSpeed" )
self.Player:NetworkVar( "Float", 25, "ZiplineDelay" )
self.Player:NetworkVar( "Int", 5, "MeleeDamage")
self.Player:NetworkVar( "Float", 26, "MeleeTime")
self.Player:NetworkVar( "Float", 27, "MeleeDelay")
self.Player:NetworkVar( "Int", 6, "Melee")
self.Player:NetworkVar( "Float", 28, "Balance")
self.Player:NetworkVar( "Entity", 6, "BalanceEntity")
self.Player:NetworkVar( "Bool", 13, "Dive" )
self.Player:NetworkVar("Bool", 13, "Dive")
end end
function PLAYER:Loadout() function PLAYER:Loadout()
if GetGlobalBool(GM_DATATHEFT) then if GetGlobalBool(GM_DATATHEFT) then
for k,v in ipairs(DATATHEFT_LOADOUTS[ math.random( #DATATHEFT_LOADOUTS ) ]) do for k, v in ipairs(DATATHEFT_LOADOUTS[math.random(#DATATHEFT_LOADOUTS)]) do
local wep = self.Player:Give(v) local wep = self.Player:Give(v)
self.Player:GiveAmmo(300, wep:GetPrimaryAmmoType()) self.Player:GiveAmmo(300, wep:GetPrimaryAmmoType())
end end
else else
self.Player:RemoveAllAmmo() self.Player:RemoveAllAmmo()
end end
self.Player:Give( "runnerhands" )
self.Player:Give("runnerhands")
self.Player:SelectWeapon("runnerhands") self.Player:SelectWeapon("runnerhands")
self.Player:SetJumpPower(230) self.Player:SetJumpPower(230)
self.Player:SetCrouchedWalkSpeed( 0.5 ) self.Player:SetCrouchedWalkSpeed(0.5)
self.Player:SetFOV(self.Player:GetInfoNum("Beatrun_FOV", 120)) self.Player:SetFOV(self.Player:GetInfoNum("Beatrun_FOV", 120))
self.Player:SetCanZoom(false) self.Player:SetCanZoom(false)
end end
hook.Add("PlayerSwitchWeapon", "ResetFOV", function(ply) hook.Add("PlayerSwitchWeapon", "ResetFOV", function(ply)
local fovmult = (ply:InOverdrive() and 1.1) or 1 local fovmult = (ply:InOverdrive() and 1.1) or 1
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120)*fovmult)
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 120) * fovmult)
end) end)
function PLAYER:SetModel() function PLAYER:SetModel()
BaseClass.SetModel(self)
BaseClass.SetModel( self ) local skin = self.Player:GetInfoNum("cl_playerskin", 0)
local skin = self.Player:GetInfoNum( "cl_playerskin", 0 ) self.Player:SetSkin(skin)
self.Player:SetSkin( skin )
local groups = self.Player:GetInfo( "cl_playerbodygroups" ) local groups = self.Player:GetInfo("cl_playerbodygroups")
if ( groups == nil ) then groups = "" end
local groups = string.Explode( " ", groups ) if groups == nil then
for k = 0, self.Player:GetNumBodyGroups() - 1 do groups = ""
self.Player:SetBodygroup( k, tonumber( groups[ k + 1 ] ) or 0 )
end end
local groups = string.Explode(" ", groups)
for k = 0, self.Player:GetNumBodyGroups() - 1 do
self.Player:SetBodygroup(k, tonumber(groups[k + 1]) or 0)
end
end end
-- --
@ -186,55 +181,68 @@ if SERVER then
end end
function PLAYER:Spawn() function PLAYER:Spawn()
BaseClass.Spawn(self)
BaseClass.Spawn( self )
local ply = self.Player local ply = self.Player
local col = ply:GetInfo( "cl_playercolor" ) local col = ply:GetInfo("cl_playercolor")
ply:SetPlayerColor( Vector( col ) )
local faststartmult = (ply:GetInfoNum("Beatrun_FastStart", 0) > 0 and 0.5) or 1
local col = Vector( ply:GetInfo( "cl_weaponcolor" ) ) ply:SetPlayerColor(Vector(col))
if ( col:Length() < 0.001 ) then
col = Vector( 0.001, 0.001, 0.001 ) local faststartmult = (ply:GetInfoNum("Beatrun_FastStart", 0) > 0 and 0.5) or 1
local col = Vector(ply:GetInfo("cl_weaponcolor"))
if col:Length() < 0.001 then
col = Vector(0.001, 0.001, 0.001)
end end
ply:SetWeaponColor( col )
ply:SetWeaponColor(col)
local CPSave = false local CPSave = false
if Course_Name != "" and Course_StartPos != vector_origin then
if ply:GetInfoNum("Beatrun_CPSave", 0) >= 1 and ply:GetNW2Float("CPNum", 1) > 1 and ply.CPSavePos and ply.LastSpawnTime+0.6 < CurTime() then if Course_Name ~= "" and Course_StartPos ~= vector_origin then
if ply:GetInfoNum("Beatrun_CPSave", 0) >= 1 and ply:GetNW2Float("CPNum", 1) > 1 and ply.CPSavePos and ply.LastSpawnTime + 0.6 < CurTime() then
ply:SetPos(ply.CPSavePos) ply:SetPos(ply.CPSavePos)
ply:SetEyeAngles(ply.CPSaveAng) ply:SetEyeAngles(ply.CPSaveAng)
ply:SetLocalVelocity(ply.CPSaveVel) ply:SetLocalVelocity(ply.CPSaveVel)
ply:LoadParkourState() ply:LoadParkourState()
CPSave = true CPSave = true
else else
ply.CPSavePos = nil ply.CPSavePos = nil
ply.CPsaveAng = nil ply.CPsaveAng = nil
ply.CPsaveVel = nil ply.CPsaveVel = nil
ply:SetPos(Course_StartPos) ply:SetPos(Course_StartPos)
ply:SetEyeAngles(Angle(0,Course_StartAng,0)) ply:SetEyeAngles(Angle(0, Course_StartAng, 0))
ply:SetLocalVelocity(vector_origin) ply:SetLocalVelocity(vector_origin)
timer.Simple(0.1, function() ply:SetLocalVelocity(vector_origin) ply:SetPos(Course_StartPos) end) --Failsafe
--Failsafe
timer.Simple(0.1, function()
ply:SetLocalVelocity(vector_origin)
ply:SetPos(Course_StartPos)
end)
ReplayStop(ply) ReplayStop(ply)
ReplayStart(ply) ReplayStart(ply)
end end
end end
if !ply.InReplay and !CPSave then if not ply.InReplay and not CPSave then
ply:SetNW2Float("CPNum", 1) ply:SetNW2Float("CPNum", 1)
end end
if !CPSave then
ply.Course_StartTime = CurTime() + (2*faststartmult) if not CPSave then
ply.Course_StartTime = CurTime() + (2 * faststartmult)
net.Start("BeatrunSpawn") net.Start("BeatrunSpawn")
net.WriteFloat(CurTime()) net.WriteFloat(CurTime())
net.WriteBool(ply.InReplay) net.WriteBool(ply.InReplay)
net.Send(ply) net.Send(ply)
ply.SpawnFreezeTime = CurTime() + (1.75*faststartmult) ply.SpawnFreezeTime = CurTime() + (1.75 * faststartmult)
end end
if !GetGlobalBool(GM_DATATHEFT) then if not GetGlobalBool(GM_DATATHEFT) then
ply:SetCollisionGroup(COLLISION_GROUP_WEAPON) ply:SetCollisionGroup(COLLISION_GROUP_WEAPON)
ply:SetCustomCollisionCheck(true) ply:SetCustomCollisionCheck(true)
else else
@ -242,59 +250,61 @@ function PLAYER:Spawn()
ply:SetCustomCollisionCheck(false) ply:SetCustomCollisionCheck(false)
ply:DataTheft_Bank() ply:DataTheft_Bank()
end end
ply:SetAvoidPlayers(false)
ply:SetLaggedMovementValue( 0 ) --otherwise they drift off ply:SetAvoidPlayers(false)
timer.Simple(0.1, function() ply:SetLaggedMovementValue( 1 ) end) ply:SetLaggedMovementValue(0) --otherwise they drift off
timer.Simple(0.1, function()
ply:SetLaggedMovementValue(1)
end)
if ply.SlideLoopSound and ply.SlideLoopSound.Stop then if ply.SlideLoopSound and ply.SlideLoopSound.Stop then
ply.SlideLoopSound:Stop() ply.SlideLoopSound:Stop()
end end
ply:ResetParkourState() ply:ResetParkourState()
ply:SetOverdriveCharge(0) ply:SetOverdriveCharge(0)
ply:SetOverdriveMult(1) ply:SetOverdriveMult(1)
ply.LastSpawnTime = CurTime() ply.LastSpawnTime = CurTime()
end end
hook.Add( "IsSpawnpointSuitable", "CheckSpawnPoint", function( ply, spawnpointent, bMakeSuitable ) hook.Add("IsSpawnpointSuitable", "CheckSpawnPoint", function(ply, spawnpointent, bMakeSuitable)
if !GetGlobalBool(GM_DATATHEFT) then return end if not GetGlobalBool(GM_DATATHEFT) then return end
local pos = spawnpointent:GetPos() local pos = spawnpointent:GetPos()
-- Note that we're searching the default hull size here for a player in the way of our spawning. -- Note that we're searching the default hull size here for a player in the way of our spawning.
-- This seems pretty rough, seeing as our player's hull could be different.. but it should do the job. -- This seems pretty rough, seeing as our player's hull could be different.. but it should do the job.
-- (HL2DM kills everything within a 128 unit radius) -- (HL2DM kills everything within a 128 unit radius)
local ents = ents.FindInBox( pos + Vector( -16, -16, 0 ), pos + Vector( 16, 16, 72 ) ) local ents = ents.FindInBox(pos + Vector(-16, -16, 0), pos + Vector(16, 16, 72))
local Blockers = 0 local Blockers = 0
for _, v in ipairs( ents ) do for _, v in ipairs(ents) do
if ( v:IsPlayer() and v:Alive() ) then if v:IsPlayer() and v:Alive() then
Blockers = Blockers + 1 Blockers = Blockers + 1
if ( bMakeSuitable ) then if bMakeSuitable then
v:Kill() v:Kill()
end end
end end
end end
if ( bMakeSuitable ) then return true end if bMakeSuitable then return true end
if ( Blockers > 0 ) then return false end if Blockers > 0 then return false end
return true return true
end) end)
hook.Add("SetupMove", "SpawnFreeze", function(ply, mv, cmd) hook.Add("SetupMove", "SpawnFreeze", function(ply, mv, cmd)
if ply.SpawnFreezeTime and Course_Name != "" and Course_StartPos != vector_origin then if ply.SpawnFreezeTime and Course_Name ~= "" and Course_StartPos ~= vector_origin then
if Course_StartPos and ply.SpawnFreezeTime > CurTime() then if Course_StartPos and ply.SpawnFreezeTime > CurTime() then
mv:SetOrigin(Course_StartPos) mv:SetOrigin(Course_StartPos)
end end
end end
end) end)
hook.Add( "ShouldCollide", "NoPlayerCollisions", function( ent1, ent2 ) hook.Add("ShouldCollide", "NoPlayerCollisions", function(ent1, ent2)
if ( ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) ) then if ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) then
if ent2.BRCollisionFunc then if ent2.BRCollisionFunc then
return ent2:BRCollisionFunc(ent1) return ent2:BRCollisionFunc(ent1)
else else
@ -302,59 +312,47 @@ hook.Add( "ShouldCollide", "NoPlayerCollisions", function( ent1, ent2 )
end end
end end
if ( ent2:IsPlayer() and ent1:IsNPC() ) then if ent2:IsPlayer() and ent1:IsNPC() then return true end
return true end)
end
end ) hook.Add("PhysgunPickup", "AllowPlayerPickup", function(ply, ent)
if ply:IsSuperAdmin() and ent:IsPlayer() then return true end
hook.Add( "PhysgunPickup", "AllowPlayerPickup", function( ply, ent ) end)
if ( ply:IsSuperAdmin() and ent:IsPlayer() ) then
return true
end
end )
function PLAYER:ShouldDrawLocal() function PLAYER:ShouldDrawLocal()
if self.TauntCam:ShouldDrawLocalPlayer(self.Player, self.Player:IsPlayingTaunt()) then return true end
if ( self.TauntCam:ShouldDrawLocalPlayer( self.Player, self.Player:IsPlayingTaunt() ) ) then return true end
end end
function PLAYER:CreateMove( cmd ) function PLAYER:CreateMove(cmd)
if self.TauntCam:CreateMove(cmd, self.Player, self.Player:IsPlayingTaunt()) then return true end
if ( self.TauntCam:CreateMove( cmd, self.Player, self.Player:IsPlayingTaunt() ) ) then return true end
end end
function PLAYER:CalcView( view ) function PLAYER:CalcView(view)
if self.TauntCam:CalcView(view, self.Player, self.Player:IsPlayingTaunt()) then return true end
if ( self.TauntCam:CalcView( view, self.Player, self.Player:IsPlayingTaunt() ) ) then return true end
end end
function PLAYER:GetHandsModel() function PLAYER:GetHandsModel()
local cl_playermodel = self.Player:GetInfo("cl_playermodel")
local cl_playermodel = self.Player:GetInfo( "cl_playermodel" ) return player_manager.TranslatePlayerHands(cl_playermodel)
return player_manager.TranslatePlayerHands( cl_playermodel )
end end
function PLAYER:StartMove( move ) function PLAYER:StartMove(move)
end end
function PLAYER:FinishMove( move ) function PLAYER:FinishMove(move)
end end
hook.Add("FinishMove", "BeatrunRHVelocity", function(ply, mv) hook.Add("FinishMove", "BeatrunRHVelocity", function(ply, mv)
local activewep = ply:GetActiveWeapon() local activewep = ply:GetActiveWeapon()
if IsValid(activewep) and activewep:GetClass()=="runnerhands" and activewep.SetOwnerVelocity then
if IsValid(activewep) and activewep:GetClass() == "runnerhands" and activewep.SetOwnerVelocity then
activewep:SetOwnerVelocity(math.Round(mv:GetVelocity():Length())) activewep:SetOwnerVelocity(math.Round(mv:GetVelocity():Length()))
end end
end) end)
local meta = FindMetaTable("Player") local meta = FindMetaTable("Player")
function meta:ResetParkourState() function meta:ResetParkourState()
self:SetSliding(false) self:SetSliding(false)
self:SetCrouchJump(false) self:SetCrouchJump(false)
@ -382,7 +380,7 @@ function meta:ResetParkourState()
self:SetMeleeDelay(0) self:SetMeleeDelay(0)
self:SetJumpTurn(false) self:SetJumpTurn(false)
self:SetDive(false) self:SetDive(false)
self:SetViewOffsetDucked(Vector(0,0,32)) self:SetViewOffsetDucked(Vector(0, 0, 32))
self.Swingrope = nil self.Swingrope = nil
self.DiveSliding = false self.DiveSliding = false
@ -423,7 +421,7 @@ end
function meta:LoadParkourState() function meta:LoadParkourState()
local save = self.ParkourSave local save = self.ParkourSave
if !save then return end if not save then return end
self:SetSliding(save[1]) self:SetSliding(save[1])
self:SetCrouchJump(save[2]) self:SetCrouchJump(save[2])
@ -464,8 +462,9 @@ function meta:ResetParkourTimes()
end end
function meta:InOverdrive() function meta:InOverdrive()
if !self.GetOverdriveMult then return false end if not self.GetOverdriveMult then return false end
return self:GetOverdriveMult() != 1
return self:GetOverdriveMult() ~= 1
end end
function meta:GetRolling() function meta:GetRolling()
@ -484,4 +483,4 @@ hook.Add("PlayerSpawn", "ResetStateTransition", function(ply, transition)
end) end)
end) end)
player_manager.RegisterClass( "player_beatrun", PLAYER, "player_default" ) player_manager.RegisterClass("player_beatrun", PLAYER, "player_default")