mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
Merge pull request #1 from jeffthekillerz/master
This commit is contained in:
commit
bd9a4d17ed
1 changed files with 29 additions and 5 deletions
|
@ -83,6 +83,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
ply:SetWallrunCount(0)
|
ply:SetWallrunCount(0)
|
||||||
ply:SetJumpTurn(false)
|
ply:SetJumpTurn(false)
|
||||||
ply:SetCrouchJumpBlocked(false)
|
ply:SetCrouchJumpBlocked(false)
|
||||||
|
ply:SetNW2Entity("grappleEntity", trout.Entity)
|
||||||
|
|
||||||
if CLIENT_IFTP() or game.SinglePlayer() then
|
if CLIENT_IFTP() or game.SinglePlayer() then
|
||||||
ply:EmitSound("MirrorsEdge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10))
|
ply:EmitSound("MirrorsEdge/Gadgets/ME_Magrope_Fire.wav", 40, 100 + math.random(-25, 10))
|
||||||
|
@ -102,9 +103,17 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
-- local gpos = ply:GetGrapplePos()
|
-- local gpos = ply:GetGrapplePos()
|
||||||
local pos = mv:GetOrigin()
|
local pos = mv:GetOrigin()
|
||||||
local eyepos = mv:GetOrigin()
|
local eyepos = mv:GetOrigin()
|
||||||
|
|
||||||
|
local ent = ply:GetNW2Entity("grappleEntity")
|
||||||
|
|
||||||
eyepos.z = eyepos.z + 64
|
eyepos.z = eyepos.z + 64
|
||||||
|
|
||||||
if not ply:Alive() or mv:KeyPressed(IN_JUMP) and not grappled and not ply:OnGround() or ply:GetClimbing() ~= 0 or ply:GetMantle() ~= 0 or not usingrh then
|
if (not ply:Alive() or mv:KeyPressed(IN_JUMP) and not grappled and not ply:OnGround() or ply:GetClimbing() ~= 0 or ply:GetMantle() ~= 0 or not usingrh) or (ent == NULL or ent == nil) then
|
||||||
|
if IsValid(ent) and ent != NULL then
|
||||||
|
ent:SetNW2Vector("glastpos", nil)
|
||||||
|
ent:SetNW2Vector("gpos", nil)
|
||||||
|
end
|
||||||
|
|
||||||
ply:SetGrappling(false)
|
ply:SetGrappling(false)
|
||||||
|
|
||||||
if CLIENT_IFTP() or game.SinglePlayer() then
|
if CLIENT_IFTP() or game.SinglePlayer() then
|
||||||
|
@ -130,6 +139,12 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ent:GetClass() != "worldspawn" then
|
||||||
|
ent:SetNW2Vector("glastpos", ent:GetNW2Vector("gpos", ent:GetPos()))
|
||||||
|
ent:SetNW2Vector("gpos", ent:GetPos())
|
||||||
|
ply:SetGrapplePos(ply:GetGrapplePos() + (ent:GetNW2Vector("gpos") - ent:GetNW2Vector("glastpos")))
|
||||||
|
end
|
||||||
|
|
||||||
if mv:KeyDown(IN_ATTACK) and mv:GetOrigin().z < ply:GetGrapplePos().z - 64 then
|
if mv:KeyDown(IN_ATTACK) and mv:GetOrigin().z < ply:GetGrapplePos().z - 64 then
|
||||||
ply:SetGrappleLength(ply:GetGrappleLength() - FrameTime() * 100)
|
ply:SetGrappleLength(ply:GetGrappleLength() - FrameTime() * 100)
|
||||||
elseif mv:KeyDown(IN_ATTACK2) then
|
elseif mv:KeyDown(IN_ATTACK2) then
|
||||||
|
@ -203,12 +218,12 @@ local ropelerp = 0
|
||||||
local ropedown = Vector(0, 0, 20)
|
local ropedown = Vector(0, 0, 20)
|
||||||
|
|
||||||
hook.Add("PostDrawTranslucentRenderables", "GrappleBeam", function()
|
hook.Add("PostDrawTranslucentRenderables", "GrappleBeam", function()
|
||||||
local ply = LocalPlayer()
|
local lp = LocalPlayer()
|
||||||
|
|
||||||
if ply:GetGrappling() then
|
if lp:GetGrappling() then
|
||||||
local BA = BodyAnimArmCopy
|
local BA = BodyAnimArmCopy
|
||||||
|
|
||||||
if ply:ShouldDrawLocalPlayer() then
|
if lp:ShouldDrawLocalPlayer() then
|
||||||
BA = BodyAnim
|
BA = BodyAnim
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -239,7 +254,7 @@ hook.Add("PostDrawTranslucentRenderables", "GrappleBeam", function()
|
||||||
rhandpos:Add(up)
|
rhandpos:Add(up)
|
||||||
|
|
||||||
render.DrawBeam(LerpVector(ropelerp, lhandpos - ropedown, rhandpos), lhandpos, 1.5, 0, 1)
|
render.DrawBeam(LerpVector(ropelerp, lhandpos - ropedown, rhandpos), lhandpos, 1.5, 0, 1)
|
||||||
render.DrawBeam(ropetop, ply:GetGrapplePos(), 1.5, 0, 1)
|
render.DrawBeam(ropetop, lp:GetGrapplePos(), 1.5, 0, 1)
|
||||||
|
|
||||||
BodyAnim:SetSequence("grapplecenter")
|
BodyAnim:SetSequence("grapplecenter")
|
||||||
|
|
||||||
|
@ -247,6 +262,15 @@ hook.Add("PostDrawTranslucentRenderables", "GrappleBeam", function()
|
||||||
else
|
else
|
||||||
ropelerp = 0
|
ropelerp = 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i, ply in ipairs(player.GetAll()) do
|
||||||
|
if ply == lp then continue end
|
||||||
|
if ply:GetGrappling() then
|
||||||
|
local pos = ply:GetPos()
|
||||||
|
pos.z = pos.z + 32
|
||||||
|
render.DrawBeam(pos, ply:GetGrapplePos(), 1.5, 0, 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function CreateSwingrope(startpos, length)
|
function CreateSwingrope(startpos, length)
|
||||||
|
|
Loading…
Reference in a new issue