From 478fb208f4b72f12277460f9473aee408d70a397 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Fri, 16 Jun 2023 20:49:27 +0500 Subject: [PATCH] duck in roll and some fixes --- README.md | 11 ++++++++--- .../entities/entities/br_databank/shared.lua | 8 -------- .../entities/weapons/runnerhands/shared.lua | 2 +- beatrun/gamemodes/beatrun/gamemode/cl/Disarm.lua | 2 +- beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua | 3 +-- .../beatrun/gamemode/cl/ToolMenuSettings.lua | 2 -- .../gamemodes/beatrun/gamemode/sh/DataTheft.lua | 6 +----- .../gamemodes/beatrun/gamemode/sh/Infection.lua | 1 - .../gamemodes/beatrun/gamemode/sh/SafetyRoll.lua | 2 ++ .../beatrun/gamemode/sv/Menu_Gamemodes.lua | 15 ++------------- 10 files changed, 16 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 5ab319e..3a330aa 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,10 @@ All of the settings below can be changed in the configuration menu - [ ] Gamemodes menu ## Fixes and changes from previous version -* nothin, just README changes +* Punching while crouching. +* Tweaked safety roll, now you can roll under things. +* Fixes to Gamemodes menu. +* Removed unused code. # All changes and fixes * Course saving works with compression and without. @@ -38,7 +41,9 @@ All of the settings below can be changed in the configuration menu * Fixed error when loading course. * Fixed collisions issues. * Fixed and tweaked player-player weapon damage. -* Proper Kick Glitch (Like in original ME: https://www.youtube.com/watch?v=zK5y3NBUStc) -* You can now dive to your death =) +* Proper Kick Glitch (Like in original ME: https://www.youtube.com/watch?v=zK5y3NBUStc). +* Tweaked safety roll, now you can roll under things. +* You can now dive to your death =). +* Allowed punching while crouching. * Grapple fixes. Now it moves with entity it attached to and other players can see it. * More reliable grappling. diff --git a/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua index 1c054ae..a8e1989 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua @@ -126,14 +126,6 @@ if SERVER then local dbtbl = ents.FindByClass("br_databank") local bank = dbtbl[math.random(1, #dbtbl)] - --[[ - while self:GetNW2Entity("DataBank") == bank do - table.Shuffle(dbtbl) - - bank = dbtbl[1] - end - ]] - if bank then self:SetNW2Entity("DataBank", bank) end diff --git a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua index 1e18774..4590c3c 100644 --- a/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/weapons/runnerhands/shared.lua @@ -419,7 +419,7 @@ function SWEP:PrimaryAttack() return end - if not ply:OnGround() or ply:Crouching() or ply:GetSliding() or ply:GetGrappling() or ply:GetWallrun() ~= 0 then return end + if not ply:OnGround() or ply:GetSliding() or ply:GetGrappling() or ply:GetWallrun() ~= 0 then return end local curseq = self:GetSequence() local infall = curseq == 19 diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/Disarm.lua b/beatrun/gamemodes/beatrun/gamemode/cl/Disarm.lua index fd3584c..b0291a7 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/Disarm.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/Disarm.lua @@ -1,4 +1,4 @@ -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"} +local 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"} local scalevec = Vector(1, 1, 1) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua index 8f06d65..03c1a1b 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/HUD.lua @@ -170,7 +170,7 @@ local function BeatrunHUD() local coursename = nil local customname = hook.Run("BeatrunHUDCourse") - coursename = customname and customname or Course_Name ~= "" and Course_Name or "Freeplay" + coursename = customname and customname or Course_Name ~= "" and "Course: " .. Course_Name or "Freeplay" -- local lastxp = ply.LastXP or 0 local nicktext = nil @@ -324,7 +324,6 @@ function BeatrunLeaderboard(forced) local isdatatheft = GetGlobalBool(GM_DATATHEFT) local ply = LocalPlayer() local vp = ply:GetViewPunchAngles() - -- local scrw = ScrW() local scrh = ScrH() if not sway:GetBool() then diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua index 942ea5c..909c5bd 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/ToolMenuSettings.lua @@ -212,7 +212,6 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() InfectionButton:SetText("Toggle Infection Gamemode") InfectionButton:SetSize(0, 20) InfectionButton.DoClick = function() - -- if GetGlobalBool(GM_DATATHEFT) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end if GetGlobalBool(GM_DATATHEFT) then InfectionButton:SetText("Another gamemode is running!") timer.Simple(2, function() @@ -229,7 +228,6 @@ hook.Add("PopulateToolMenu", "Beatrun_ToolMenu", function() DatatheftButton:SetText("Toggle Data Theft Gamemode") DatatheftButton:SetSize(0, 20) DatatheftButton.DoClick = function() - -- if GetGlobalBool(GM_INFECTION) then return notification.AddLegacy("Another gamemode is running!", NOTIFY_HINT, 2) end if GetGlobalBool(GM_INFECTION) then InfectionButton:SetText("Another gamemode is running!") timer.Simple(2, function() diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua index cd69c52..2ae0347 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua @@ -1,5 +1,3 @@ -GM_DATATHEFT = 1 - DATATHEFT_LOADOUTS = { {"weapon_357", "weapon_ar2"} } @@ -44,9 +42,7 @@ if SERVER then local function DataTheftSync(ply) if GetGlobalBool(GM_DATATHEFT) and not ply.DataTheftSynced then - net.Start("Infection_Sync") - net.WriteFloat(Infection_StartTime) - net.WriteFloat(Infection_EndTime) + net.Start("DataTheft_Sync") net.Send(ply) ply.DataTheftSynced = true diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Infection.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Infection.lua index cbeaa7e..b544f7d 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Infection.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Infection.lua @@ -1,4 +1,3 @@ -GM_INFECTION = 0 Infection_StartTime = 0 Infection_EndTime = 0 diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua index bae2b9e..f4235f8 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/SafetyRoll.lua @@ -21,6 +21,8 @@ local function SafetyRollThink(ply, mv, cmd) mv:SetSideSpeed(0) mv:SetForwardSpeed(0) + mv:AddKey(IN_DUCK) + if ang ~= landang then local vel = mv:GetVelocity() vel.x = 0 diff --git a/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua b/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua index a0a8bd2..3e93421 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sv/Menu_Gamemodes.lua @@ -1,30 +1,19 @@ util.AddNetworkString("Beatrun_ToggleGamemode") -util.AddNetworkString("Beatrun_UpdateDataTheftLoadout") - -local datatheft, infection = false, false net.Receive("Beatrun_ToggleGamemode", function(_, ply) local gm = net.ReadString() if gm == "datatheft" then - datatheft = not datatheft - - if datatheft then + if not GetGlobalBool(GM_DATATHEFT) then Beatrun_StartDataTheft() else Beatrun_StopDataTheft() end elseif gm == "infection" then - infection = not infection - - if infection then + if not GetGlobalBool(GM_INFECTION) then Beatrun_StartInfection() else Beatrun_StopInfection() end end -end) - -net.Receive("Beatrun_UpdateDataTheftLoadout", function(_, ply) - end) \ No newline at end of file