mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
Merge branch 'master' of https://github.com/jeffthekillerz/beatrun-jonny
This commit is contained in:
commit
9597909c73
3 changed files with 31 additions and 28 deletions
|
@ -26,6 +26,7 @@ This version of the beatrun works on any version of the game (Chromium or not).
|
|||
- [ ] Gamemodes menu
|
||||
|
||||
## Fixes and changes from previous version
|
||||
* Hacky fix for weapon damage.
|
||||
* Proper Kick Glitch (Like in original ME: https://www.youtube.com/watch?v=zK5y3NBUStc)
|
||||
* Grapple fixes. Now it moves with entity it attached to and other players can see it.
|
||||
* More reliable grappling.
|
||||
|
|
10
beatrun/gamemodes/beatrun/gamemode/cl/SpawnMenuSettings.lua
Normal file
10
beatrun/gamemodes/beatrun/gamemode/cl/SpawnMenuSettings.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
hook.Add("AddToolMenuCategories", "Beatrun_Category", function()
|
||||
spawnmenu.AddToolCategory("Beatrun", "beatrun_category", "Beatrun Settings")
|
||||
end)
|
||||
|
||||
hook.Add("PopulateToolMenu", "CustomMenuSettings", function()
|
||||
spawnmenu.AddToolMenuOption("Utilities", "Beatrun Settings", "Custom_Menu", "#My Custom Menu", "", "", function(panel)
|
||||
panel:ClearControls()
|
||||
panel:NumSlider("Gravity", "sv_gravity", 0, 600)
|
||||
end)
|
||||
end)
|
|
@ -305,7 +305,9 @@ hook.Add("ShouldCollide", "NoPlayerCollisions", function(ent1, ent2)
|
|||
if ent2.BRCollisionFunc then
|
||||
return ent2:BRCollisionFunc(ent1)
|
||||
else
|
||||
if (ent1.br_Fired and ent2.br_FiredBy == ent1) or (ent2.br_Fired and ent1.br_FiredBy == ent2) then return true end
|
||||
if ent1.br_Fired or ent2.br_Fired then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
@ -314,35 +316,10 @@ hook.Add("ShouldCollide", "NoPlayerCollisions", function(ent1, ent2)
|
|||
if ent2:IsPlayer() and ent1:IsNPC() then return true end
|
||||
end)
|
||||
|
||||
local function calc_fov(src, dst)
|
||||
local v_src = src:Forward()
|
||||
local v_dst = dst:Forward()
|
||||
|
||||
local result = math.deg(math.acos(v_dst:Dot(v_src) / v_dst:Length()))
|
||||
|
||||
if result != result or (result == math.huge or result == -math.huge) then
|
||||
result = 0
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
// i was forced
|
||||
hook.Add("EntityFireBullets", "thisengineismadebyacrackhead", function(ent, data)
|
||||
if not IsValid(ent) or not isfunction(ent.GetShootPos) or not ent:IsPlayer() then return end
|
||||
|
||||
for i, ply in ipairs(player.GetAll()) do
|
||||
if ply == ent then continue end
|
||||
local fov = calc_fov(data.Dir:Angle(), (ply:GetShootPos() - data.Src):Angle())
|
||||
print(fov)
|
||||
if fov > 60 then continue end
|
||||
|
||||
ply.br_FiredBy = ent
|
||||
timer.Simple(engine.TickInterval()*3, function() if IsValid(ply) then ply.br_FiredBy = nil end end)
|
||||
end
|
||||
|
||||
hook.Add("EntityFireBullets", "thisengineismadebyacrackhead", function(ent, data)
|
||||
ent.br_Fired = true
|
||||
timer.Simple(engine.TickInterval()*3, function() if IsValid(ent) then ent.br_Fired = false end end)
|
||||
timer.Simple(engine.TickInterval()*2, function() if IsValid(ent) then ent.br_Fired = false end end)
|
||||
end)
|
||||
|
||||
hook.Add("PhysgunPickup", "AllowPlayerPickup", function(ply, ent)
|
||||
|
@ -513,4 +490,19 @@ hook.Add("PlayerSpawn", "ResetStateTransition", function(ply, transition)
|
|||
end)
|
||||
end)
|
||||
|
||||
player_manager.RegisterClass("player_beatrun", PLAYER, "player_default")elf:GetSafetyRollTime() > CurTime()
|
||||
end
|
||||
|
||||
hook.Add("PlayerSpawn", "ResetStateTransition", function(ply, transition)
|
||||
timer.Simple(0, function()
|
||||
if transition and IsValid(ply) then
|
||||
ply:ResetParkourTimes()
|
||||
ply:SetJumpPower(230)
|
||||
ply:SetFOV(ply:GetInfoNum("Beatrun_FOV", 110))
|
||||
ply:SetCanZoom(false)
|
||||
ply.ClimbingTrace = nil
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
player_manager.RegisterClass("player_beatrun", PLAYER, "player_default")
|
Loading…
Reference in a new issue