add anims for standing close to the wall

This commit is contained in:
Jonny_Bro (Nikita) 2023-09-25 20:34:07 +05:00
parent f3dbf0b2de
commit a1befd2ea7
18 changed files with 61 additions and 9 deletions

View file

@ -71,10 +71,10 @@ function SWEP:SetupDataTables()
self:NetworkVar("Float", 2, "PunchReset") self:NetworkVar("Float", 2, "PunchReset")
end end
local runseq = { -- local runseq = {
[6] = true, -- [6] = true,
[7] = true -- [7] = true
} -- }
local oddseq = { local oddseq = {
[8] = true, [8] = true,
@ -124,6 +124,7 @@ local fallct = 0
function SWEP:Think() function SWEP:Think()
local ply = self:GetOwner() local ply = self:GetOwner()
local viewmodel = ply:GetViewModel() local viewmodel = ply:GetViewModel()
if not IsValid(viewmodel) then return end if not IsValid(viewmodel) then return end
if self:GetHoldType() == "fist" and CurTime() > self:GetPunchReset() then if self:GetHoldType() == "fist" and CurTime() > self:GetPunchReset() then
@ -145,6 +146,38 @@ function SWEP:Think()
local injump = curseq == 13 or curseq == 14 or curseq == 17 or curseq == -1 or curseq == 1 local injump = curseq == 13 or curseq == 14 or curseq == 17 or curseq == -1 or curseq == 1
infall = curseq == 19 infall = curseq == 19
-- 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 then
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
if CLIENT then
return ArmInterrupt("standhandwallright")
elseif game.SinglePlayer() then
return ply:SendLua("ArmInterrupt('standhandwallright')")
end
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
if CLIENT then
return ArmInterrupt("standhandwallboth")
elseif game.SinglePlayer() then
return ply:SendLua("ArmInterrupt('standhandwallboth')")
end
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
if CLIENT then
return ArmInterrupt("standhandwallleft")
elseif game.SinglePlayer() then
return ply:SendLua("ArmInterrupt('standhandwallleft')")
end
end
end
self:SetSideStep((curseq == 15 or curseq == 16) and GetConVar("Beatrun_SideStep"):GetBool()) self:SetSideStep((curseq == 15 or curseq == 16) and GetConVar("Beatrun_SideStep"):GetBool())
local insidestep = self:GetSideStep() local insidestep = self:GetSideStep()

View file

@ -329,7 +329,10 @@ local arminterrupts = {
doorbash = true, doorbash = true,
punchmid = true, punchmid = true,
punchleft = true, punchleft = true,
jumpturnflypiecesign = true jumpturnflypiecesign = true,
standhandwallright = true,
standhandwallleft = true,
standhandwallboth = true
} }
local transitionanims = { local transitionanims = {
@ -453,7 +456,10 @@ local worldarm = {
ladderclimbhangstart = true, ladderclimbhangstart = true,
snatchscar = true, snatchscar = true,
jumpcoil = true, jumpcoil = true,
jumpturnlandidle = true jumpturnlandidle = true,
standhandwallright = true,
standhandwallleft = true,
standhandwallboth = true
} }
local ignorezarm = { local ignorezarm = {
@ -1380,7 +1386,7 @@ function ArmInterrupt(anim)
local arm = CreateBodyAnimArmCopy() local arm = CreateBodyAnimArmCopy()
if IsValid(arm) then if IsValid(arm) then
for k, v in ipairs(fingers) do for _, v in ipairs(fingers) do
local b = BodyAnimArmCopy:LookupBone(v) local b = BodyAnimArmCopy:LookupBone(v)
if b then if b then
@ -1388,7 +1394,7 @@ function ArmInterrupt(anim)
end end
end end
for k, v in pairs(fingerscustom) do for k, _ in pairs(fingerscustom) do
local b = BodyAnimArmCopy:LookupBone(k) local b = BodyAnimArmCopy:LookupBone(k)
if b then if b then
@ -1396,6 +1402,19 @@ function ArmInterrupt(anim)
end end
end end
--[[ TODO: make work good
if string.match(anim, "standhandwall") then
local ply = LocalPlayer()
local trace = util.QuickTrace(ply:GetShootPos(), ply:GetAimVector() * 30, ply)
local newAng = Angle(trace.Normal.x * (5 * trace.Fraction * trace.Normal.x), 0, trace.Normal.x * (10 * trace.Fraction * trace.Normal.y))
ply:ChatPrint("Fraction: " .. tostring(trace.Fraction))
ply:ChatPrint("Normal: " .. tostring(trace.Normal))
arm:SetAngles(newAng)
end
--]]
arm:SetSequence(anim) arm:SetSequence(anim)
arm:SetCycle(0) arm:SetCycle(0)
end end

View file

@ -48,7 +48,7 @@ concommand.Add("blindplayer", function(ply, cmd, args)
local mname = "" local mname = ""
local mcount = 0 local mcount = 0
for k, v in ipairs(player.GetAll()) do for _, v in ipairs(player.GetAll()) do
local name = v:Nick() local name = v:Nick()
local smatch = string.match(name, plysearch) local smatch = string.match(name, plysearch)