mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
Adds a Throwing Animation (#14680)
This commit is contained in:
@@ -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)
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
author: SleepyGemmy
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Adds a throwing animation."
|
||||
Reference in New Issue
Block a user