Files
Polaris/code/game/turfs/turf_flick_animations.dm
Leshana 44ff1a70c6 Removes the datum pool, as it is not performant.
* Creating new objects is cheap, in fact comparable to the cost of getting it out of the pool, so it doesn't help there.
* Placing items in the pool is far more expensive than letting them garbage collect due to the resetting of vars and such.
2017-05-04 01:58:33 -04:00

21 lines
756 B
Plaintext

/proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,flick_anim as text,sleeptime = 0,direction as num)
//This proc throws up either an icon or an animation for a specified amount of time.
//The variables should be apparent enough.
if(!location && target)
location = get_turf(target)
if(location && !target)
target = location
var/atom/movable/overlay/animation = new /atom/movable/overlay(location)
if(direction)
animation.set_dir(direction)
animation.icon = a_icon
animation.layer = target:layer+1
if(a_icon_state)
animation.icon_state = a_icon_state
else
animation.icon_state = "blank"
animation.master = target
flick(flick_anim, animation)
spawn(max(sleeptime, 15))
qdel(animation)