This commit is contained in:
Hatterhat
2022-08-03 06:01:35 -05:00
parent 4665229e16
commit 670bda0e29
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -250,7 +250,20 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
animate(pixel_x=rand(min,max), pixel_y=rand(min,max), time=1)
animate(pixel_x=oldx, pixel_y=oldy, time=1)
/proc/directional_recoil(mob/M, strength=1, angle = 0)
if(!M || !M.client)
return
var/client/C = M.client
var/recoil_x = -sin(angle)*4*strength + rand(-strength, strength)
var/recoil_y = -cos(angle)*4*strength + rand(-strength, strength)
animate(C, pixel_x=recoil_x, pixel_y=recoil_y, time=1, easing=SINE_EASING|EASE_OUT, flags=ANIMATION_PARALLEL|ANIMATION_RELATIVE)
addtimer(CALLBACK(GLOBAL_PROC, /proc/recoil_recover, M), 2)
/proc/recoil_recover(mob/M)
if(!M || !M.client)
return
var/client/C = M.client
animate(C, pixel_x=0, pixel_y=0, time=3, easing=SINE_EASING|EASE_IN)
/proc/findname(msg)
if(!istext(msg))