Files
Polaris/code/game/objects/effects/item_pickup_ghost.dm
drexample be5c144a16 Ports Baystation12 newest item pickup animations. Fancy! (#5302)
* fixed photos

* Added item pick up animation

* Revert useless commit

* Removed unnecessary extra define, made sure ghost object deletes itself after animation, changed planes.
2018-05-27 11:54:36 -05:00

20 lines
781 B
Plaintext

/obj/effect/temporary_effect/item_pickup_ghost
anchored = 1
plane = MOB_PLANE
layer = ABOVE_MOB_LAYER
mouse_opacity = 0//just in case something dumb happens
time_to_die = 0.5 SECONDS
var/lifetime = 0.25 SECONDS //so it doesn't die before animation ends
/obj/effect/temporary_effect/item_pickup_ghost/proc/assumeform(var/obj/item/picked_up)
icon = picked_up.icon
icon_state = picked_up.icon_state
pixel_x = picked_up.pixel_x
pixel_y = picked_up.pixel_y
color = picked_up.color
/obj/effect/temporary_effect/item_pickup_ghost/proc/animate_towards(var/atom/target)
var/new_pixel_x = pixel_x + (target.x - src.x) * 32
var/new_pixel_y = pixel_y + (target.y - src.y) * 32
animate(src, pixel_x = new_pixel_x, pixel_y = new_pixel_y, transform = matrix()*0, time = lifetime)