mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
use meta function
This commit is contained in:
parent
bf304985f3
commit
9ff173ab35
18 changed files with 76 additions and 119 deletions
|
@ -10,7 +10,7 @@ if CLIENT then
|
||||||
SWEP.DrawCrosshair = false
|
SWEP.DrawCrosshair = false
|
||||||
|
|
||||||
hook.Add("VManipPrePlayAnim", "LOCNoVManip", function()
|
hook.Add("VManipPrePlayAnim", "LOCNoVManip", function()
|
||||||
if LocalPlayer():GetActiveWeapon():GetClass() == "runnerhands" or blinded then return false end
|
if LocalPlayer():UsingRH() or blinded then return false end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -148,32 +148,29 @@ function SWEP:Think()
|
||||||
|
|
||||||
-- what a piece of shit, send help
|
-- what a piece of shit, send help
|
||||||
if vel:Length() == 0 and util.QuickTrace(ply:GetShootPos(), ply:GetAimVector() * 30, ply).Hit and ply:GetMoveType() ~= MOVETYPE_NOCLIP and not ply:Crouching() and ply:WaterLevel() == 0 and ply:GetWallrun() == 0 then
|
if vel:Length() == 0 and util.QuickTrace(ply:GetShootPos(), ply:GetAimVector() * 30, ply).Hit and ply:GetMoveType() ~= MOVETYPE_NOCLIP and not ply:Crouching() and ply:WaterLevel() == 0 and ply:GetWallrun() == 0 then
|
||||||
if (math.floor(ply:LocalEyeAngles().y) <= 35 and math.floor(ply:LocalEyeAngles().y) >= 5) or
|
if (math.floor(ply:LocalEyeAngles().y) <= 35 and math.floor(ply:LocalEyeAngles().y) >= 5) or (math.floor(ply:LocalEyeAngles().y) <= 125 and math.floor(ply:LocalEyeAngles().y) >= 95) or (math.floor(ply:LocalEyeAngles().y) <= -55 and math.floor(ply:LocalEyeAngles().y) >= -85) or (math.floor(ply:LocalEyeAngles().y) <= -145 and math.floor(ply:LocalEyeAngles().y) >= -175) then
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= 125 and math.floor(ply:LocalEyeAngles().y) >= 95) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= -55 and math.floor(ply:LocalEyeAngles().y) >= -85) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= -145 and math.floor(ply:LocalEyeAngles().y) >= -175) then
|
|
||||||
if CLIENT then
|
if CLIENT then
|
||||||
|
BodyLimitX = 20
|
||||||
|
|
||||||
return ArmInterrupt("standhandwallright")
|
return ArmInterrupt("standhandwallright")
|
||||||
elseif game.SinglePlayer() then
|
elseif game.SinglePlayer() then
|
||||||
return ply:SendLua("ArmInterrupt('standhandwallright')")
|
return ply:SendLua("BodyLimitX = 20 ArmInterrupt('standhandwallright')")
|
||||||
end
|
end
|
||||||
elseif (math.floor(ply:LocalEyeAngles().y) <= 5 and math.floor(ply:LocalEyeAngles().y) >= -5) or
|
elseif (math.floor(ply:LocalEyeAngles().y) <= 5 and math.floor(ply:LocalEyeAngles().y) >= -5) or (math.floor(ply:LocalEyeAngles().y) <= 95 and math.floor(ply:LocalEyeAngles().y) >= 85) or (math.floor(ply:LocalEyeAngles().y) <= -85 and math.floor(ply:LocalEyeAngles().y) >= -95) or (math.floor(ply:LocalEyeAngles().y) <= -175 or math.floor(ply:LocalEyeAngles().y) >= 175) then
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= 95 and math.floor(ply:LocalEyeAngles().y) >= 85) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= -85 and math.floor(ply:LocalEyeAngles().y) >= -95) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= -175 or math.floor(ply:LocalEyeAngles().y) >= 175) then
|
|
||||||
if CLIENT then
|
if CLIENT then
|
||||||
|
BodyLimitX = 20
|
||||||
|
|
||||||
return ArmInterrupt("standhandwallboth")
|
return ArmInterrupt("standhandwallboth")
|
||||||
elseif game.SinglePlayer() then
|
elseif game.SinglePlayer() then
|
||||||
return ply:SendLua("ArmInterrupt('standhandwallboth')")
|
return ply:SendLua("BodyLimitX = 20 ArmInterrupt('standhandwallboth')")
|
||||||
end
|
end
|
||||||
elseif (math.floor(ply:LocalEyeAngles().y) <= 5 and math.floor(ply:LocalEyeAngles().y) >= -35) or
|
elseif (math.floor(ply:LocalEyeAngles().y) <= 5 and math.floor(ply:LocalEyeAngles().y) >= -35) or (math.floor(ply:LocalEyeAngles().y) <= 85 and math.floor(ply:LocalEyeAngles().y) >= 55) or (math.floor(ply:LocalEyeAngles().y) <= -95 and math.floor(ply:LocalEyeAngles().y) >= -125) or (math.floor(ply:LocalEyeAngles().y) <= 175 and math.floor(ply:LocalEyeAngles().y) >= 145) then
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= 85 and math.floor(ply:LocalEyeAngles().y) >= 55) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= -95 and math.floor(ply:LocalEyeAngles().y) >= -125) or
|
|
||||||
(math.floor(ply:LocalEyeAngles().y) <= 175 and math.floor(ply:LocalEyeAngles().y) >= 145) then
|
|
||||||
if CLIENT then
|
if CLIENT then
|
||||||
|
BodyLimitX = 20
|
||||||
|
|
||||||
return ArmInterrupt("standhandwallleft")
|
return ArmInterrupt("standhandwallleft")
|
||||||
elseif game.SinglePlayer() then
|
elseif game.SinglePlayer() then
|
||||||
return ply:SendLua("ArmInterrupt('standhandwallleft')")
|
return ply:SendLua("BodyLimitX = 20 ArmInterrupt('standhandwallleft')")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -120,7 +120,7 @@ function RemoveBodyAnim(noang)
|
||||||
local currentwep = ply:GetActiveWeapon()
|
local currentwep = ply:GetActiveWeapon()
|
||||||
local vm = ply:GetViewModel()
|
local vm = ply:GetViewModel()
|
||||||
|
|
||||||
if IsValid(currentwep) and currentwep:GetClass() ~= "runnerhands" then
|
if ply:notUsingRH() then
|
||||||
if currentwep.PlayViewModelAnimation then
|
if currentwep.PlayViewModelAnimation then
|
||||||
currentwep:PlayViewModelAnimation("Draw")
|
currentwep:PlayViewModelAnimation("Draw")
|
||||||
else
|
else
|
||||||
|
@ -222,13 +222,13 @@ function CacheLerpBodyAnim()
|
||||||
|
|
||||||
local pos = LocalPlayer():GetPos()
|
local pos = LocalPlayer():GetPos()
|
||||||
-- local posdelta = pos - matrixfrompos
|
-- local posdelta = pos - matrixfrompos
|
||||||
local self = BodyAnim
|
local this = BodyAnim
|
||||||
self.m = self.m or Matrix()
|
this.m = this.m or Matrix()
|
||||||
|
|
||||||
local from = matrixfrom
|
local from = matrixfrom
|
||||||
local to = matrixto
|
local to = matrixto
|
||||||
|
|
||||||
for bone = 0, self:GetBoneCount() - 1 do
|
for bone = 0, this:GetBoneCount() - 1 do
|
||||||
if not armbones[BodyAnim:GetBoneName(bone)] then
|
if not armbones[BodyAnim:GetBoneName(bone)] then
|
||||||
if not to[bone] then
|
if not to[bone] then
|
||||||
to[bone] = {{}, {}, {}}
|
to[bone] = {{}, {}, {}}
|
||||||
|
@ -240,7 +240,7 @@ function CacheLerpBodyAnim()
|
||||||
from[bone] = cachebody[bone]:FastToTable(from[bone]) or from[bone]
|
from[bone] = cachebody[bone]:FastToTable(from[bone]) or from[bone]
|
||||||
to[bone] = to[bone] or ModelBoneMatrix:FastToTable(to[bone])
|
to[bone] = to[bone] or ModelBoneMatrix:FastToTable(to[bone])
|
||||||
|
|
||||||
local bonematrix = self:GetBoneMatrix(bone)
|
local bonematrix = this:GetBoneMatrix(bone)
|
||||||
bonematrix:SetTranslation(bonematrix:GetTranslation() - pos)
|
bonematrix:SetTranslation(bonematrix:GetTranslation() - pos)
|
||||||
|
|
||||||
to[bone] = bonematrix:FastToTable(to[bone])
|
to[bone] = bonematrix:FastToTable(to[bone])
|
||||||
|
@ -255,8 +255,8 @@ function CacheLerpBodyAnim()
|
||||||
v[4] = LerpL(transitionlerp, from[4], v[4])
|
v[4] = LerpL(transitionlerp, from[4], v[4])
|
||||||
end
|
end
|
||||||
|
|
||||||
if not self.m then
|
if not this.m then
|
||||||
self.m = Matrix(to[bone])
|
this.m = Matrix(to[bone])
|
||||||
else
|
else
|
||||||
local bt = to[bone]
|
local bt = to[bone]
|
||||||
local bt1 = bt[1]
|
local bt1 = bt[1]
|
||||||
|
@ -264,12 +264,12 @@ function CacheLerpBodyAnim()
|
||||||
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)
|
this.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
|
||||||
|
|
||||||
self.m:SetTranslation(self.m:GetTranslation() + pos)
|
this.m:SetTranslation(this.m:GetTranslation() + pos)
|
||||||
self.m:SetScale(scalevec)
|
this.m:SetScale(scalevec)
|
||||||
self:SetBoneMatrix(bone, self.m)
|
this:SetBoneMatrix(bone, this.m)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -505,9 +505,8 @@ function BodyAnimCalcView2(ply, pos, angles, fov)
|
||||||
|
|
||||||
if ply:Crouching() then
|
if ply:Crouching() then
|
||||||
local from = BodyAnimCrouchLerpZ
|
local from = BodyAnimCrouchLerpZ
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() == "runnerhands" then
|
if ply:UsingRH() then
|
||||||
from = ply:EyePos().z - 64
|
from = ply:EyePos().z - 64
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -541,7 +541,7 @@ local function BeatrunReticle()
|
||||||
|
|
||||||
local wep = LocalPlayer():GetActiveWeapon()
|
local wep = LocalPlayer():GetActiveWeapon()
|
||||||
|
|
||||||
if not IsValid(wep) or wep:GetClass() ~= "runnerhands" then return end
|
if not IsValid(wep) or LocalPlayer():notUsingRH() then return end
|
||||||
|
|
||||||
surface.SetDrawColor(255, 255, 255)
|
surface.SetDrawColor(255, 255, 255)
|
||||||
surface.SetMaterial(crosshair_standard)
|
surface.SetMaterial(crosshair_standard)
|
||||||
|
|
|
@ -1233,7 +1233,7 @@ local function JumpArmDraw(a, b, c)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() == "runnerhands" then
|
if ply:UsingRH() then
|
||||||
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)
|
||||||
|
|
|
@ -610,9 +610,8 @@ function ToggleBlindness(toggle)
|
||||||
if blinded then
|
if blinded then
|
||||||
local ply = LocalPlayer()
|
local ply = LocalPlayer()
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"
|
|
||||||
|
|
||||||
if usingrh and activewep.RunWind1 then
|
if ply:UsingRH() and activewep.RunWind1 then
|
||||||
activewep.RunWind1:Stop()
|
activewep.RunWind1:Stop()
|
||||||
activewep.RunWind2:Stop()
|
activewep.RunWind2:Stop()
|
||||||
end
|
end
|
||||||
|
|
|
@ -374,7 +374,7 @@ 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 ply:UsingRH() and activewep.SetOwnerVelocity then
|
||||||
activewep:SetOwnerVelocity(math.Round(mv:GetVelocity():Length()))
|
activewep:SetOwnerVelocity(math.Round(mv:GetVelocity():Length()))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -68,5 +68,20 @@ end
|
||||||
|
|
||||||
function playermeta:UsingRH(wep)
|
function playermeta:UsingRH(wep)
|
||||||
local activewep = wep or self:GetActiveWeapon()
|
local activewep = wep or self:GetActiveWeapon()
|
||||||
if IsValid(activewep) then return activewep:GetClass() == "runnerhands" end
|
|
||||||
|
if IsValid(activewep) and activewep:GetClass() == "runnerhands" then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function playermeta:notUsingRH(wep)
|
||||||
|
local activewep = wep or self:GetActiveWeapon()
|
||||||
|
|
||||||
|
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
|
@ -70,9 +70,7 @@ hook.Add("SetupMove", "JumpDetect", function(ply, mv, cmd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
if ply:UsingRH() then
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() == "runnerhands" then
|
|
||||||
ply:SetWasOnGround(ply:OnGround())
|
ply:SetWasOnGround(ply:OnGround())
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -649,11 +649,7 @@ local function ClimbingCheck(ply, mv, cmd)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() and activewep.SendWeaponAnim then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh and activewep.SendWeaponAnim then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
||||||
activewep:SetBlockAnims(false)
|
activewep:SetBlockAnims(false)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
local usingrh = nil
|
|
||||||
local punch = Angle(0.5, 0, 0)
|
local punch = Angle(0.5, 0, 0)
|
||||||
local punchland = Angle(10, 0, 0.5)
|
local punchland = Angle(10, 0, 0.5)
|
||||||
local punchthink = Angle()
|
local punchthink = Angle()
|
||||||
|
@ -30,13 +29,9 @@ hook.Add("SetupMove", "CrouchJump", function(ply, mv, cmd)
|
||||||
ply:SetCrouchJumpBlocked(false)
|
ply:SetCrouchJumpBlocked(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
if ply:Alive() and not ply:GetCrouchJumpBlocked() and not IsValid(ply:GetZipline()) and not IsValid(ply:GetLadder()) and ply:GetClimbing() == 0 and not ply:GetJumpTurn() and ply:GetMantle() == 0 and not ply:OnGround() and ply:GetVelocity().z > -350 and ply:GetCrouchJumpTime() < CurTime() and ply:GetWallrun() == 0 and mv:KeyPressed(IN_DUCK) then
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:Alive() and not ply:GetCrouchJumpBlocked() and not IsValid(ply:GetZipline()) and not IsValid(ply:GetLadder()) and ply:GetClimbing() == 0 and not ply:GetJumpTurn() and ply:GetMantle() == 0 and not ply:OnGround() and ply:GetVelocity().z > -350 and ply:GetCrouchJumpTime() < CurTime() and ply:GetWallrun() == 0 and mv:KeyPressed(IN_DUCK) then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if CLIENT then
|
if CLIENT then
|
||||||
local ang = ply:EyeAngles()
|
local ang = ply:EyeAngles()
|
||||||
ang.x = 0
|
ang.x = 0
|
||||||
|
@ -47,7 +42,7 @@ hook.Add("SetupMove", "CrouchJump", function(ply, mv, cmd)
|
||||||
BodyAnimCycle = 0
|
BodyAnimCycle = 0
|
||||||
BodyAnimCrouchLerp = 0
|
BodyAnimCrouchLerp = 0
|
||||||
|
|
||||||
if usingrh then
|
if ply:UsingRH() then
|
||||||
BodyAnimCrouchLerpZ = mv:GetOrigin().z - 32
|
BodyAnimCrouchLerpZ = mv:GetOrigin().z - 32
|
||||||
else
|
else
|
||||||
BodyAnimCrouchLerpZ = mv:GetOrigin().z
|
BodyAnimCrouchLerpZ = mv:GetOrigin().z
|
||||||
|
@ -70,16 +65,10 @@ hook.Add("SetupMove", "CrouchJump", function(ply, mv, cmd)
|
||||||
ply:ViewPunch(punch)
|
ply:ViewPunch(punch)
|
||||||
ply:SetViewOffsetDucked(Vector(0, 0, 28))
|
ply:SetViewOffsetDucked(Vector(0, 0, 28))
|
||||||
|
|
||||||
if usingrh then
|
if ply:UsingRH() then
|
||||||
activewep:SendWeaponAnim(ACT_VM_HOLSTER)
|
activewep:SendWeaponAnim(ACT_VM_HOLSTER)
|
||||||
end
|
end
|
||||||
elseif (ply:OnGround() or ply:GetCrouchJumpTime() < CurTime() or not ply:Alive()) and ply:GetCrouchJump() then
|
elseif (ply:OnGround() or ply:GetCrouchJumpTime() < CurTime() or not ply:Alive()) and ply:GetCrouchJump() then
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
|
|
||||||
if IsValid(activewep) then
|
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if game.SinglePlayer() then
|
if game.SinglePlayer() then
|
||||||
net.Start("CrouchJumpSP")
|
net.Start("CrouchJumpSP")
|
||||||
net.WriteBool(false)
|
net.WriteBool(false)
|
||||||
|
@ -88,7 +77,7 @@ hook.Add("SetupMove", "CrouchJump", function(ply, mv, cmd)
|
||||||
|
|
||||||
ply:SetCrouchJump(false)
|
ply:SetCrouchJump(false)
|
||||||
|
|
||||||
if usingrh and IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
activewep:SendWeaponAnim(ACT_VM_DRAW)
|
activewep:SendWeaponAnim(ACT_VM_DRAW)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ if game.SinglePlayer() and CLIENT then
|
||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("PlayerStepSoundTime", "MEStepTime", function(ply, step, walking)
|
hook.Add("PlayerStepSoundTime", "MEStepTime", function(ply, step, walking)
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
local sprint = ply:GetMEMoveLimit() < speed_limit:GetInt() - 25
|
local sprint = ply:GetMEMoveLimit() < speed_limit:GetInt() - 25
|
||||||
local stepmod = ply:GetStepRight() and 1 or -1
|
local stepmod = ply:GetStepRight() and 1 or -1
|
||||||
local stepvel = 1.25
|
local stepvel = 1.25
|
||||||
|
@ -51,7 +50,7 @@ hook.Add("PlayerStepSoundTime", "MEStepTime", function(ply, step, walking)
|
||||||
local stepmod2 = 1
|
local stepmod2 = 1
|
||||||
local stepmod3 = 1
|
local stepmod3 = 1
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
|
if ply:notUsingRH() then
|
||||||
stepmod2 = 0.25
|
stepmod2 = 0.25
|
||||||
|
|
||||||
if not ply:IsSprinting() then
|
if not ply:IsSprinting() then
|
||||||
|
@ -59,7 +58,7 @@ hook.Add("PlayerStepSoundTime", "MEStepTime", function(ply, step, walking)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not ply:Crouching() and not ply:KeyDown(IN_WALK) then
|
if not ply:Crouching() and not walking then
|
||||||
if game.SinglePlayer() then
|
if game.SinglePlayer() then
|
||||||
local intensity = ply:GetInfoNum("Beatrun_ViewbobIntensity", 20) / 20
|
local intensity = ply:GetInfoNum("Beatrun_ViewbobIntensity", 20) / 20
|
||||||
|
|
||||||
|
@ -212,8 +211,7 @@ hook.Add("OnPlayerHitGround", "MELandSound", function(ply, water, floater, speed
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
|
hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
|
||||||
local activewep = ply:GetActiveWeapon()
|
local usingrh = ply:UsingRH()
|
||||||
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"
|
|
||||||
local ismoving = (mv:KeyDown(IN_FORWARD) or not ply:OnGround() or ply:Crouching()) and not mv:KeyDown(IN_BACK) and ply:Alive() and (mv:GetVelocity():Length() > 50 or ply:GetMantle() ~= 0 or ply:Crouching())
|
local ismoving = (mv:KeyDown(IN_FORWARD) or not ply:OnGround() or ply:Crouching()) and not mv:KeyDown(IN_BACK) and ply:Alive() and (mv:GetVelocity():Length() > 50 or ply:GetMantle() ~= 0 or ply:Crouching())
|
||||||
|
|
||||||
if (CLIENT or game.SinglePlayer()) and CurTime() > (ply:GetStepRelease() or 0) and ply.FootstepReleaseLand then
|
if (CLIENT or game.SinglePlayer()) and CurTime() > (ply:GetStepRelease() or 0) and ply.FootstepReleaseLand then
|
||||||
|
@ -261,7 +259,7 @@ hook.Add("SetupMove", "MESetupMove", function(ply, mv, cmd)
|
||||||
local weaponspeed = 150
|
local weaponspeed = 150
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
|
if ply:notUsingRH() then
|
||||||
weaponspeed = speed_limit:GetInt()
|
weaponspeed = speed_limit:GetInt()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,7 @@ if CLIENT then
|
||||||
if disable_grapple:GetBool() and Course_Name == "" then return end
|
if disable_grapple:GetBool() and Course_Name == "" then return end
|
||||||
if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end
|
if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end
|
||||||
if not ply:Alive() or Course_Name ~= "" then return end
|
if not ply:Alive() or Course_Name ~= "" then return end
|
||||||
|
if ply:notUsingRH() then return end
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then return end
|
|
||||||
if ply:GetMoveType() == MOVETYPE_NOCLIP then return end
|
if ply:GetMoveType() == MOVETYPE_NOCLIP then return end
|
||||||
if GetGlobalBool("GM_INFECTION") or GetGlobalBool("GM_DATATHEFT") or GetGlobalBool("GM_DEATHMATCH") then return end
|
if GetGlobalBool("GM_INFECTION") or GetGlobalBool("GM_DATATHEFT") or GetGlobalBool("GM_DEATHMATCH") then return end
|
||||||
|
|
||||||
|
@ -60,8 +57,7 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
if not ply:Alive() or Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 and not ply:GetNW2Entity("Swingrope"):IsValid() then return end
|
if not ply:Alive() or Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 and not ply:GetNW2Entity("Swingrope"):IsValid() then return end
|
||||||
if GetGlobalBool("GM_INFECTION") or GetGlobalBool("GM_DATATHEFT") or GetGlobalBool("GM_DEATHMATCH") and not ply:GetNW2Entity("Swingrope"):IsValid() then return end
|
if GetGlobalBool("GM_INFECTION") or GetGlobalBool("GM_DATATHEFT") or GetGlobalBool("GM_DEATHMATCH") and not ply:GetNW2Entity("Swingrope"):IsValid() then return end
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local usingrh = ply:UsingRH()
|
||||||
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"
|
|
||||||
|
|
||||||
if not ply.Grapple_tr then
|
if not ply.Grapple_tr then
|
||||||
ply.Grapple_tr = {}
|
ply.Grapple_tr = {}
|
||||||
|
|
|
@ -105,7 +105,7 @@ local doors = {
|
||||||
}
|
}
|
||||||
|
|
||||||
local function KeyMelee(ply, mv)
|
local function KeyMelee(ply, mv)
|
||||||
return mv:KeyPressed(IN_ALT2) or mv:KeyPressed(IN_ATTACK) and IsValid(ply:GetActiveWeapon()) and ply:GetActiveWeapon():GetClass() == "runnerhands"
|
return mv:KeyPressed(IN_ALT2) or mv:KeyPressed(IN_ATTACK) and ply:UsingRH()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function MeleeType(ply, mv, cmd)
|
local function MeleeType(ply, mv, cmd)
|
||||||
|
|
|
@ -38,9 +38,7 @@ function DoJumpTurnStand()
|
||||||
VMLegs:Remove()
|
VMLegs:Remove()
|
||||||
end
|
end
|
||||||
|
|
||||||
local activewep = LocalPlayer():GetActiveWeapon()
|
if LocalPlayer():notUsingRH() then
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
|
|
||||||
BodyAnim:SetSequence("jumpturnlandstandgun")
|
BodyAnim:SetSequence("jumpturnlandstandgun")
|
||||||
else
|
else
|
||||||
BodyAnim:SetSequence("jumpturnlandstand")
|
BodyAnim:SetSequence("jumpturnlandstand")
|
||||||
|
@ -56,7 +54,7 @@ end
|
||||||
local standpunch = Angle(-5, 0, 0)
|
local standpunch = Angle(-5, 0, 0)
|
||||||
|
|
||||||
local function Quickturn(ply, mv, cmd)
|
local function Quickturn(ply, mv, cmd)
|
||||||
local keypressed = ply:Alive() and mv:KeyPressed(IN_ATTACK2) and (ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 1 and ply:GetActiveWeapon():GetClass() == "runnerhands" or ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 0)
|
local keypressed = ply:Alive() and mv:KeyPressed(IN_ATTACK2) and (ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 1 and ply:UsingRH() or ply:GetInfoNum("Beatrun_QuickturnHandsOnly", 0) == 0)
|
||||||
|
|
||||||
if ply:GetWallrun() ~= 0 then
|
if ply:GetWallrun() ~= 0 then
|
||||||
if mv:KeyDown(IN_BACK) and mv:KeyPressed(IN_JUMP) or ply:GetQuickturn() then
|
if mv:KeyDown(IN_BACK) and mv:KeyPressed(IN_JUMP) or ply:GetQuickturn() then
|
||||||
|
@ -118,14 +116,7 @@ local function Quickturn(ply, mv, cmd)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local usingrh = false
|
if not ply:UsingRH() and ply:GetWallrun() >= 2 then return end
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
|
|
||||||
if IsValid(activewep) then
|
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if not usingrh and ply:GetWallrun() >= 2 then return end
|
|
||||||
|
|
||||||
ply:SetQuickturn(true)
|
ply:SetQuickturn(true)
|
||||||
ply:SetQuickturnTime(CurTime())
|
ply:SetQuickturnTime(CurTime())
|
||||||
|
@ -147,11 +138,7 @@ local function Quickturn(ply, mv, cmd)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
|
activewep:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
|
||||||
activewep:SetBlockAnims(true)
|
activewep:SetBlockAnims(true)
|
||||||
end
|
end
|
||||||
|
@ -204,9 +191,8 @@ local function Quickturn(ply, mv, cmd)
|
||||||
end
|
end
|
||||||
|
|
||||||
standpunch.x = -math.abs(math.min(CurTime() - ply:GetJumpTurnRecovery() + 0.5, 0))
|
standpunch.x = -math.abs(math.min(CurTime() - ply:GetJumpTurnRecovery() + 0.5, 0))
|
||||||
local activewep = ply:GetActiveWeapon()
|
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() ~= "runnerhands" then
|
if ply:notUsingRH() then
|
||||||
standpunch.x = standpunch.x * 0.1
|
standpunch.x = standpunch.x * 0.1
|
||||||
standpunch.z = standpunch.x * 10
|
standpunch.z = standpunch.x * 10
|
||||||
else
|
else
|
||||||
|
|
|
@ -68,10 +68,10 @@ net.Receive("RollAnimSP", function()
|
||||||
roll.animmodelstring = "climbanim"
|
roll.animmodelstring = "climbanim"
|
||||||
roll.BodyAnimSpeed = 1.5
|
roll.BodyAnimSpeed = 1.5
|
||||||
else
|
else
|
||||||
if ply:GetActiveWeapon():GetClass() ~= "runnerhands" then
|
if ply:UsingRH() then
|
||||||
roll.AnimString = "merollgun"
|
|
||||||
else
|
|
||||||
roll.AnimString = "meroll"
|
roll.AnimString = "meroll"
|
||||||
|
else
|
||||||
|
roll.AnimString = "merollgun"
|
||||||
end
|
end
|
||||||
|
|
||||||
roll.animmodelstring = "climbanim"
|
roll.animmodelstring = "climbanim"
|
||||||
|
@ -172,10 +172,10 @@ hook.Add("OnPlayerHitGround", "SafetyRoll", function(ply, water, floater, speed)
|
||||||
ply:SetSafetyRollAng(ang)
|
ply:SetSafetyRollAng(ang)
|
||||||
ply:SetSafetyRollTime(CurTime() + 1.05)
|
ply:SetSafetyRollTime(CurTime() + 1.05)
|
||||||
|
|
||||||
if ply:GetActiveWeapon():GetClass() ~= "runnerhands" then
|
if ply:UsingRH() then
|
||||||
roll.AnimString = "merollgun"
|
|
||||||
else
|
|
||||||
roll.AnimString = "meroll"
|
roll.AnimString = "meroll"
|
||||||
|
else
|
||||||
|
roll.AnimString = "merollgun"
|
||||||
end
|
end
|
||||||
|
|
||||||
roll.animmodelstring = "climbanim"
|
roll.animmodelstring = "climbanim"
|
||||||
|
|
|
@ -48,7 +48,7 @@ end
|
||||||
local function PlayVaultAnim(ply, legs, ang)
|
local function PlayVaultAnim(ply, legs, ang)
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() == "runnerhands" and activewep:GetSequence() == 17 then
|
if ply:UsingRH() and activewep:GetSequence() == 17 then
|
||||||
activewep:SendWeaponAnim(ACT_VM_DRAW)
|
activewep:SendWeaponAnim(ACT_VM_DRAW)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -764,7 +764,7 @@ hook.Add("SetupMove", "BeatrunVaulting", function(ply, mv, cmd)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) and activewep:GetClass() == "runnerhands" and mantletype == 1 then
|
if ply:UsingRH() and mantletype == 1 then
|
||||||
activewep:SendWeaponAnim(ACT_VM_RECOIL1)
|
activewep:SendWeaponAnim(ACT_VM_RECOIL1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -105,11 +105,7 @@ local function WallrunningThink(ply, mv, cmd)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
||||||
activewep:SetBlockAnims(false)
|
activewep:SetBlockAnims(false)
|
||||||
end
|
end
|
||||||
|
@ -132,11 +128,7 @@ local function WallrunningThink(ply, mv, cmd)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
||||||
activewep:SetBlockAnims(false)
|
activewep:SetBlockAnims(false)
|
||||||
end
|
end
|
||||||
|
|
|
@ -198,11 +198,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
||||||
activewep:SetBlockAnims(false)
|
activewep:SetBlockAnims(false)
|
||||||
end
|
end
|
||||||
|
@ -225,11 +221,7 @@ function PuristWallrunningThink(ply, mv, cmd, wr, wrtimeremains)
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
|
|
||||||
if IsValid(activewep) then
|
if ply:UsingRH() then
|
||||||
usingrh = activewep:GetClass() == "runnerhands"
|
|
||||||
end
|
|
||||||
|
|
||||||
if usingrh then
|
|
||||||
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
activewep:SendWeaponAnim(ACT_VM_HITCENTER)
|
||||||
activewep:SetBlockAnims(false)
|
activewep:SetBlockAnims(false)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue