mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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.
This commit is contained in:
19
code/game/objects/effects/item_pickup_ghost.dm
Normal file
19
code/game/objects/effects/item_pickup_ghost.dm
Normal file
@@ -0,0 +1,19 @@
|
||||
/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)
|
||||
@@ -213,6 +213,8 @@ GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
|
||||
if(!temp)
|
||||
user << "<span class='notice'>You try to use your hand, but realize it is no longer attached!</span>"
|
||||
return
|
||||
|
||||
var/old_loc = src.loc
|
||||
src.pickup(user)
|
||||
if (istype(src.loc, /obj/item/weapon/storage))
|
||||
var/obj/item/weapon/storage/S = src.loc
|
||||
@@ -225,7 +227,11 @@ GLOBAL_LIST_BOILERPLATE(all_items, /obj/item)
|
||||
else
|
||||
if(isliving(src.loc))
|
||||
return
|
||||
user.put_in_active_hand(src)
|
||||
if(user.put_in_active_hand(src))
|
||||
if(isturf(old_loc))
|
||||
var/obj/effect/temporary_effect/item_pickup_ghost/ghost = new(old_loc)
|
||||
ghost.assumeform(src)
|
||||
ghost.animate_towards(user)
|
||||
return
|
||||
|
||||
/obj/item/attack_ai(mob/user as mob)
|
||||
|
||||
@@ -802,6 +802,7 @@
|
||||
#include "code\game\objects\effects\explosion_particles.dm"
|
||||
#include "code\game\objects\effects\gibs.dm"
|
||||
#include "code\game\objects\effects\glowshroom.dm"
|
||||
#include "code\game\objects\effects\item_pickup_ghost.dm"
|
||||
#include "code\game\objects\effects\landmarks.dm"
|
||||
#include "code\game\objects\effects\manifest.dm"
|
||||
#include "code\game\objects\effects\mines.dm"
|
||||
|
||||
Reference in New Issue
Block a user