aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/animation/sh_animations.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-07-21 19:08:34 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2018-07-21 19:08:34 -0400
commit81d3d4eb333e226432a591461b84ed12f5ac9a3f (patch)
treed802983c3caf6683f1fd8eb881c7df65afa0d27b /gamemode/core/animation/sh_animations.lua
parentbfdf805676684a838dde5d4cdeb3d8c972d5003d (diff)
downloadartery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.gz
artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.tar.bz2
artery-81d3d4eb333e226432a591461b84ed12f5ac9a3f.zip
Various updates
* Animation api now allows sequences to be played * items now have a .inv attribute that is set when they are added to shaped or equipment inventories * Refactored the way skill inventory is structured * Added some more methods to cl_common to move items around on a player * Minor update to nrequire to display purple message when asked to include a file that dosn't exist.
Diffstat (limited to 'gamemode/core/animation/sh_animations.lua')
-rw-r--r--gamemode/core/animation/sh_animations.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/gamemode/core/animation/sh_animations.lua b/gamemode/core/animation/sh_animations.lua
index 3846fcc..a1430a5 100644
--- a/gamemode/core/animation/sh_animations.lua
+++ b/gamemode/core/animation/sh_animations.lua
@@ -2,3 +2,23 @@ if not RegisterLuaAnimation then
error("JetBoom's libanimbone is required for animations. (It's bundeled with PAC3)")
return
end
+
+local sequences
+local log = nrequire("log.lua")
+if SERVER then
+ sequences = nrequire("core/animation/sv_animate.lua")
+else -- CLIENT
+ sequences = nrequire("core/animation/cl_animate.lua")
+end
+
+hook.Add("UpdateAnimation","art_updateanim",function(ply,vel,mgs)
+ if sequences and ply and sequences[ply] and CurTime() < sequences[ply][1] then
+ ply:SetPlaybackRate(sequences[ply][3])
+ end
+end)
+
+hook.Add("CalcMainActivity","art_swing",function(ply,vel)
+ if sequences and ply and sequences[ply] and CurTime() < sequences[ply][1] then
+ return -1, sequences[ply][2]
+ end
+end)