Adds a Throwing Animation (#14680)

This commit is contained in:
SleepyGemmy
2022-08-24 20:02:08 +02:00
committed by GitHub
parent 69bb1417ed
commit 48a15bb2c4
3 changed files with 36 additions and 0 deletions
+26
View File
@@ -268,3 +268,29 @@ note dizziness decrements automatically in the mob's Life() proc.
set_dir(D)
spintime -= speed
return
// Mob Throwing Animation
/proc/animate_throw(atom/A)
var/ipx = A.pixel_x
var/ipy = A.pixel_y
var/mpx = 0
var/mpy = 0
if(A.dir & NORTH)
mpy += 3
else if(A.dir & SOUTH)
mpy -= 3
if(A.dir & EAST)
mpx += 3
else if(A.dir & WEST)
mpx -= 3
var/x = mpx + ipx
var/y = mpy + ipy
animate(A, pixel_x = x, pixel_y = y, time = 0.6, easing = EASE_OUT)
var/matrix/M = matrix(A.transform)
animate(transform = turn(A.transform, (mpx - mpy) * 4), time = 0.6, easing = EASE_OUT)
animate(pixel_x = ipx, pixel_y = ipy, time = 0.6, easing = EASE_IN)
animate(transform = M, time = 0.6, easing = EASE_IN)
+4
View File
@@ -423,6 +423,10 @@ var/list/slot_equipment_priority = list( \
playsound(src, 'sound/effects/throw.ogg', volume, TRUE, -1)
item.throw_at(target, item.throw_range, item.throw_speed, src)
// Animate the mob throwing.
animate_throw(src)
return TRUE
return FALSE