diff --git a/beatrun/Original Animations/climbanim.dx80.vtx b/beatrun/Original Animations/meclimbanim.dx80.vtx similarity index 100% rename from beatrun/Original Animations/climbanim.dx80.vtx rename to beatrun/Original Animations/meclimbanim.dx80.vtx diff --git a/beatrun/Original Animations/climbanim.dx90.vtx b/beatrun/Original Animations/meclimbanim.dx90.vtx similarity index 100% rename from beatrun/Original Animations/climbanim.dx90.vtx rename to beatrun/Original Animations/meclimbanim.dx90.vtx diff --git a/beatrun/Original Animations/climbanim.mdl b/beatrun/Original Animations/meclimbanim.mdl similarity index 100% rename from beatrun/Original Animations/climbanim.mdl rename to beatrun/Original Animations/meclimbanim.mdl diff --git a/beatrun/Original Animations/climbanim.sw.vtx b/beatrun/Original Animations/meclimbanim.sw.vtx similarity index 100% rename from beatrun/Original Animations/climbanim.sw.vtx rename to beatrun/Original Animations/meclimbanim.sw.vtx diff --git a/beatrun/Original Animations/climbanim.vvd b/beatrun/Original Animations/meclimbanim.vvd similarity index 100% rename from beatrun/Original Animations/climbanim.vvd rename to beatrun/Original Animations/meclimbanim.vvd diff --git a/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx80.vtx b/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx80.vtx new file mode 100644 index 0000000..4da0dc9 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx80.vtx differ diff --git a/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx90.vtx b/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx90.vtx new file mode 100644 index 0000000..6431460 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/models/meclimbanim.dx90.vtx differ diff --git a/beatrun/gamemodes/beatrun/content/models/meclimbanim.mdl b/beatrun/gamemodes/beatrun/content/models/meclimbanim.mdl new file mode 100644 index 0000000..943da61 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/models/meclimbanim.mdl differ diff --git a/beatrun/gamemodes/beatrun/content/models/meclimbanim.sw.vtx b/beatrun/gamemodes/beatrun/content/models/meclimbanim.sw.vtx new file mode 100644 index 0000000..e0f9202 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/models/meclimbanim.sw.vtx differ diff --git a/beatrun/gamemodes/beatrun/content/models/meclimbanim.vvd b/beatrun/gamemodes/beatrun/content/models/meclimbanim.vvd new file mode 100644 index 0000000..4da6509 Binary files /dev/null and b/beatrun/gamemodes/beatrun/content/models/meclimbanim.vvd differ diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua b/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua index 4a7038a..d47afab 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/JumpAnim.lua @@ -13,6 +13,12 @@ local animtable = { usefullbody = 2 } +changedanimset = false + +if UseOldAnims:GetBool() then + animtable.animmodelstring = "meclimbanim" +end + fbanims = { ladderexittoplefthand = true, runfwdstart = true, @@ -1340,10 +1346,50 @@ hook.Add("CalcViewModelView", "lol", function(wep, vm, oldpos, oldang, pos, ang) end) local function JumpAnim(event, ply) + if !animsetchange then animsetchange = false end + print("-------------") + print("JumpAnim called -- " .. engine.TickCount()) + if animsetchange != UseOldAnims:GetBool() then + print("---- BodyAnim removed -- " .. engine.TickCount()) + RemoveBodyAnim() + end + if animsetchange != UseOldAnims:GetBool() then + if UseOldAnims:GetBool() then + animtable.animmodelstring = "meclimbanim" + else + animtable.animmodelstring = "climbanim" + end + StartBodyAnim(animtable) + print("---- BodyAnim recreated -- " .. engine.TickCount()) + + if not IsValid(BodyAnim) then return end + + CreateBodyAnimArmCopy() + + if not ply:ShouldDrawLocalPlayer() or CurTime() < 10 then + for k, v in ipairs(playermodelbones) do + local b = BodyAnim:LookupBone(v) + + if b then + BodyAnim:ManipulateBonePosition(b, Vector(0, 0, 100 * (k == 1 and -1 or 1))) + end + end + end + + hook.Add("BodyAnimCalcView", "JumpCalcView", JumpCalcView) + hook.Add("BodyAnimDrawArm", "JumpArmThink", JumpArmThink) + hook.Add("PostDrawOpaqueRenderables", "JumpArmDraw", JumpArmDraw) + end if events[event] then + print("-- JumpAnim in event -- " .. engine.TickCount()) local wasjumpanim = fbanims[BodyAnimString] and IsValid(BodyAnim) + if changedanimset then + wasjumpanim = false + end + if not wasjumpanim then + print("---- BodyAnim removed -- " .. engine.TickCount()) RemoveBodyAnim() end @@ -1372,7 +1418,13 @@ local function JumpAnim(event, ply) end if not wasjumpanim then + if UseOldAnims:GetBool() then + animtable.animmodelstring = "meclimbanim" + else + animtable.animmodelstring = "climbanim" + end StartBodyAnim(animtable) + print("---- BodyAnim recreated -- " .. engine.TickCount()) if not IsValid(BodyAnim) then return end @@ -1395,6 +1447,7 @@ local function JumpAnim(event, ply) BodyAnim:ResetSequence(BodyAnim:LookupSequence(BodyAnimString)) end end + animsetchange = UseOldAnims:GetBool() end hook.Add("OnParkour", "JumpAnim", JumpAnim) @@ -1790,4 +1843,4 @@ local function JumpThink() end end -hook.Add("Think", "JumpThink", JumpThink) +hook.Add("Think", "JumpThink", JumpThink) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua index 7b719c4..c1a2762 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl_init.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl_init.lua @@ -1,3 +1,4 @@ +--include("preexecute/client.lua") include("shared.lua") for _, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME")) do diff --git a/beatrun/gamemodes/beatrun/gamemode/preexecute/client.lua b/beatrun/gamemodes/beatrun/gamemode/preexecute/client.lua new file mode 100644 index 0000000..e69de29 diff --git a/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua b/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua index bc8db57..335c031 100644 --- a/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua +++ b/beatrun/gamemodes/beatrun/gamemode/preexecute/shared.lua @@ -1,3 +1,5 @@ CrueltyParkour = CreateConVar("Beatrun_CrueltyParkour", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Also known as \"Cruelty Mode\".\nDisables some Beatrun parkour abilities using anything but the Beatrun hands when enabled.", 0, 1) -SlippyWallrun = CreateConVar("Beatrun_Experimentals_SlippyWallrun", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Makes your wallrun slippy. Only usable with Cruelty Parkour on.", 0, 1) \ No newline at end of file +SlippyWallrun = CreateConVar("Beatrun_Experimentals_SlippyWallrun", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Makes your wallrun slippy. Only usable with Cruelty Parkour on.", 0, 1) + +UseOldAnims = CreateConVar("Beatrun_UseOldAnims", 0, {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Use Mirror's Edge animations instead of the reanimated ones.", 0, 1) \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua index 87d6b4d..9cc131e 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua @@ -94,6 +94,12 @@ net.Receive("RollAnimSP", function() roll.BodyAnimSpeed = 1.15 end + if UseOldAnims:GetBool() then + roll.animmodelstring = "meclimbanim" + else + roll.animmodelstring = "climbanim" + end + CacheBodyAnim() RemoveBodyAnim() StartBodyAnim(roll) @@ -132,6 +138,12 @@ hook.Add("SetupMove", "EvadeRoll", function(ply, mv, cmd) end if CLIENT and IsFirstTimePredicted() then + if UseOldAnims:GetBool() then + roll.animmodelstring = "meclimbanim" + else + roll.animmodelstring = "climbanim" + end + CacheBodyAnim() RemoveBodyAnim() StartBodyAnim(roll) @@ -202,6 +214,11 @@ hook.Add("OnPlayerHitGround", "SafetyRoll", function(ply, water, floater, speed) end if CLIENT and IsFirstTimePredicted() then + if UseOldAnims:GetBool() then + roll.animmodelstring = "meclimbanim" + else + roll.animmodelstring = "climbanim" + end CacheBodyAnim() RemoveBodyAnim() StartBodyAnim(roll)